Skip to content

Commit 66d3adb

Browse files
authored
refactor: repo-wide deslop (net −51.8k lines) (#92)
Full-repo deslop: **net −51,800 lines (−24%), 146 files removed**, executed as seven gate-verified waves plus an adversarial regression-review pass. ## What changed - **Vendored Office tooling deduplicated (−45,082):** `skills/{docx,pptx,xlsx}/scripts/office` were byte-identical; one copy now lives at `skills/_shared/office` and the sandbox Dockerfile materializes all three paths at image build. `pnpm turbo skills:build` output is byte-identical. - **Gateway OpenAPI subsystem removed (−1,575):** zero consumers (no codegen, docs site, or fetches). Telemetry now keys on Hono route templates; rate-limit buckets key on route templates (old-format buckets age out). - **`packages/db` restructured:** the hand-maintained `supabase-target*` schema mirror (2,904 LOC) became a 720-LOC migration smoke+invariant gate under `scripts/supabase-target/`; the three lease-queue implementations share one generic core (SQL semantics preserved op-by-op); research workflows deduplicated. - **Workers refactored:** Durable Object calls converted from hand-rolled HTTP-over-fetch to native RPC (SSE stream stays on fetch); three deletion workflows share one job-runner; four workers share one bootstrap/error runtime; the ProjectSandbox facade is a lease-policy table (276→82 lines). - **Dead code purged:** dead routes (`/v1/tools`, `/v1/agents`, sandbox file API replaced by the code-server IDE, `runs/status`), write-only stream parts (schemas retained for historical transcripts), 55% of web CSS, single-use wrappers, barrel bloat, config husks. - **Bug fixes:** web proxy matcher now guards `/pricing`+`/usage` (and drops nonexistent routes); stale `app_worker` role reference removed; `SkillRuntimeScopeSchema` single-sourced in `@cheatcode/types`. - **Gate hardened:** `pnpm deadcode` now runs knip with `includeEntryExports` (it previously could not flag any dead export) and reports zero findings. ## Deliberately kept Gateway idempotency DO layer (an adversarial concurrency trace proved it load-bearing: post-commit/pre-DO-start duplicate-POST race), `api/health`, the daily-maintenance activation phase, Ultra/Max env plumbing, `generated-manifest.ts` tracking (Vercel affected-detection). ## Regression pass An independent review of the refactor commits found and this branch fixes: gateway error responses losing CORS/security headers (proven fixed live: cross-origin 401 carries ACAO+CSP+HSTS), webhook store outages surfacing 500 instead of retriable 503, a blind row-cast that could permanently drop a webhook, four over-deleted migration invariant validators (restored), preview-proxy leaking `X-Request-Id` upstream. ## Verification `lint` / `typecheck` / `turbo build --force` (23/23 cold) / `deadcode` (0 findings) / `architecture:check` / `skills:build` manifest-stable — all green post-merge with `origin/main` (upload-guard + `restoreUploadedFiles` work ported into the new facade). Live smoke via direct agent-browser: home, signed-out auth redirects for `/pricing`+`/usage`, signed-in `/usage`, historical chat transcript rendering. Deploy notes: sandbox snapshot rebuilds on merge (Dockerfile materialization step); gateway telemetry route labels change format once (analytics series discontinuity).
1 parent 64eae99 commit 66d3adb

372 files changed

Lines changed: 3047 additions & 54838 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,4 @@
1717
*.log
1818
/*.png
1919
**/*.tsbuildinfo
20-
coverage
2120
node_modules
22-
qa-output
23-
supabase/.temp

.editorconfig

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,5 @@ indent_size = 2
1111
[*.py]
1212
indent_size = 4
1313

14-
[*.toml]
15-
indent_size = 4
16-
1714
[*.md]
1815
trim_trailing_whitespace = false
19-
20-
[Makefile]
21-
indent_style = tab

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ node_modules/
66
.next/
77
.vercel/
88
dist/
9-
coverage/
109
.qa/
11-
qa-output/
12-
qa-*.png
13-
*.har
1410
*.tsbuildinfo
1511
.env
1612
.env.*

.vercelignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# Local documentation and planning directories are not part of the deploy bundle.
2-
/docs/
3-
/tasks/
4-
/plans/
51
# Build artifacts (match anywhere; Vercel installs + builds fresh)
62
node_modules
73
.pnpm-store
@@ -17,4 +13,3 @@ node_modules
1713
compose.yaml
1814
.dockerignore
1915
infra/containers/dev
20-
supabase

AGENTS.md

Lines changed: 25 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ apps/ Deployable services
3939
webhooks-worker/ Polar/Clerk/Composio webhooks + internal ops workflows
4040
4141
packages/ Shared libraries
42-
agent-core/ Mastra instance + workflows
43-
tools-*/ Tool implementations per domain
42+
agent-core/ Mastra instance, workflows, and data/document/media tools
43+
tools-{browser,code,research}/ Multi-consumer and isolated tool-domain packages
4444
db/ Drizzle schema (per-domain) + queries + migrations
4545
byok/ Vault-backed BYOK key store
4646
skills/ Build-time skill bundler
@@ -49,9 +49,9 @@ packages/ Shared libraries
4949
types/ Zod schemas + branded IDs + InferAgentUIMessage
5050
ui/ Shared Cheatcode UI primitives, icon barrel, AI response renderer
5151
52-
skills/ 8 curated Anthropic SKILL.md skills
53-
infra/ Wrangler configs, Supabase migrations, Daytona sandbox Dockerfile
54-
scripts/ Operational helpers only: build skills, local startup, deploy orchestration, migrations
52+
skills/ 19 curated skills; _shared/office is vendored and not bundled
53+
infra/ Container images and Dockerfiles for local development and Daytona sandboxes
54+
scripts/ Operational helpers: build-skills, dev, dev-worker-config, jsonc, migrate, migration-drizzle, database-operation-safety
5555
```
5656

5757
## Build
@@ -73,46 +73,24 @@ pnpm turbo lint # Biome check (fails CI on warnings)
7373
pnpm turbo build # Production build
7474
```
7575

76-
Product/acceptance testing is direct `agent-browser --auto-connect --session cheatcode-debug`
77-
UI interaction only: click/fill/type through real flows, capture screenshots,
78-
inspect console/network output, and read app logs. Do not add or run scripted
79-
test harnesses for product flows, browser automation, prompt submission, auth,
80-
accessibility, load, or final E2E. Package `test` scripts are intentionally not
81-
part of the V2 command surface, and source-level `*.test.ts` files are
82-
intentionally absent. Do not generate temporary validation scripts either;
83-
operate the UI directly and check logs, and remove any throwaway product QA
84-
script that appears in the V2 tree. Operational scripts may exist only for
85-
build, migration, and local-stack configuration; they are not
86-
product tests and must not simulate UI/user flows. Do not create temporary
87-
testing scripts in `scripts/`, package folders, `/tmp`, or any out-of-tree
88-
location.
89-
90-
May 27, 2026 user override: never use scripts for product testing. Product QA
91-
means direct `agent-browser` UI operation, screenshots, console/network
92-
inspection, and running app-log review only. Delete any future V2 product-flow
93-
validator, prompt runner, browser wrapper, or throwaway QA helper on sight
94-
instead of running it. The removed V1 tree must not be restored, copied back,
95-
or used as a source of product-test scripts.
96-
97-
May 28, 2026 hardening: do not wrap product QA in `pnpm`, `tsx`, shell loops,
98-
`/tmp` helpers, generated files, browser-driver wrappers, package aliases, or
99-
any scripted flow. Every product UI action, screenshot, console read,
100-
network/resource inspection, and app-log inspection must be issued directly in
101-
the transcript. Typecheck/lint/build are code-health gates only; they are not
102-
product QA.
103-
104-
May 28, 2026 direct override: delete any product-flow test script, temporary
105-
helper, command-loop runner, browser wrapper, prompt driver, curl flow, or
106-
package alias when discovered. The active V2 tree should contain no product-test
107-
scripts. The remaining `scripts/` files are operational only and must not click
108-
the UI, submit prompts, drive auth, gather acceptance evidence, or replace
109-
direct `agent-browser` operation.
110-
111-
May 28, 2026 latest user directive: code the all-weeks V2 surface first, then
112-
run final product QA only through direct `agent-browser --auto-connect --session
113-
cheatcode-debug` UI actions and direct console/network/app-log inspection. Do
114-
not write, run, or keep scripts to submit prompts, click UI, drive auth, wrap
115-
`agent-browser`, run curl flows, or gather acceptance evidence.
76+
Product/acceptance testing uses only direct
77+
`agent-browser --auto-connect --session cheatcode-debug` commands issued in the
78+
transcript to click, fill, and type through real flows, capture screenshots,
79+
inspect console/network/resources, and read running app logs. Never add, run,
80+
write, or keep scripts for product testing, browser automation, prompt
81+
submission, auth, accessibility, load, or final E2E, including `pnpm`/`tsx`
82+
wrappers, shell or command loops, `/tmp` or generated helpers, browser-driver
83+
wrappers, package aliases, prompt drivers, curl flows, validators, and
84+
throwaway QA helpers in `scripts/`, package folders, or any out-of-tree
85+
location; delete them on sight instead of running them. Package `test` scripts
86+
and source-level `*.test.ts` files remain absent. Operational scripts may exist
87+
only for build, migration, and local-stack configuration and must not click the
88+
UI, submit prompts, drive auth, gather acceptance evidence, or replace direct
89+
browser operation. Typecheck, lint, and build are code-health gates only, not
90+
product QA. Code the all-weeks V2 surface first, then perform final QA through
91+
the direct browser commands and direct console/network/app-log inspection. The
92+
removed V1 tree must not be restored, copied back, used as a testing surface, or
93+
used as a source of product-test scripts.
11694

11795
## Run locally
11896

@@ -121,47 +99,8 @@ pnpm dev # Compose: Next + chained Workers agains
12199
pnpm dev:down # Stop the local Compose stack
122100
```
123101

124-
Required local env vars in `.env.local` (template in `.env.example`):
125-
126-
```
127-
# Production Supabase session-pooler URLs for the three isolated Worker roles.
128-
# Administrative migration credentials never belong in .env.local.
129-
SUPABASE_GATEWAY_DATABASE_URL=
130-
SUPABASE_AGENT_DATABASE_URL=
131-
SUPABASE_WEBHOOKS_DATABASE_URL=
132-
133-
# Per-Worker signed tenant context (three distinct secrets, each at least 32 bytes)
134-
DATABASE_CONTEXT_SIGNING_SECRET_GATEWAY=
135-
DATABASE_CONTEXT_SIGNING_SECRET_AGENT=
136-
DATABASE_CONTEXT_SIGNING_SECRET_WEBHOOKS=
137-
138-
# Daytona
139-
DAYTONA_API_KEY=
140-
DAYTONA_API_URL=https://app.daytona.io/api
141-
DAYTONA_TARGET=us
142-
DAYTONA_SANDBOX_SNAPSHOT=
143-
DAYTONA_WORKSPACE_VOLUME=cheatcode-workspaces-development
144-
PREVIEW_TOKEN_SECRET=
145-
146-
# Clerk development instance only
147-
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
148-
CLERK_SECRET_KEY=
149-
150-
# Polar
151-
POLAR_ACCESS_TOKEN=
152-
POLAR_WEBHOOK_SECRET=
153-
154-
# Composio
155-
COMPOSIO_API_KEY=
156-
COMPOSIO_AUTH_CONFIGS={"github":"ac_...","gmail":"ac_...","slack":"ac_...","notion":"ac_...","linear":"ac_..."}
157-
COMPOSIO_WEBHOOK_SECRET=
158-
159-
# Signed output capability
160-
OUTPUT_DOWNLOAD_SIGNING_SECRET=
161-
162-
# Browser-visible local routing configuration (not secrets)
163-
NEXT_PUBLIC_GATEWAY_URL=http://127.0.0.1:8787
164-
```
102+
Copy the complete `.env.local` template from `.env.example`;
103+
`scripts/dev.ts` validates it before local startup.
165104

166105
Never commit `.env.local`. It is the sole laptop application credential file;
167106
its database URLs contain only the three least-privilege production runtime

CLAUDE.md

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ apps/
3737
webhooks-worker/ Clerk, Polar, Composio webhooks + internal ops workflows
3838
3939
packages/
40-
agent-core/ Mastra agent, workflows, tools, and runtime contexts
40+
agent-core/ Mastra agent, workflows, contexts, and data/document/media tools
4141
tools-code/ Sandbox shell/file/git/runCode tools
4242
tools-browser/ Stagehand LOCAL browser automation
43-
tools-docs/ pptxgenjs, docx, exceljs, @react-pdf/renderer
44-
tools-data/ Arquero CSV analysis + deterministic SVG charts
4543
tools-research/ Exa + Firecrawl
4644
db/ Drizzle schema (per-domain) + queries + migrations
4745
byok/ Vault-backed BYOK with provider validation
@@ -54,9 +52,9 @@ packages/
5452
ui/ shared UI primitives, icon barrel, AI response renderer
5553
tsconfig/ Shared base/nextjs/worker/library configs
5654
57-
skills/ 8 curated Anthropic SKILL.md skills
58-
infra/ Wrangler configs, Supabase migrations, Daytona sandbox Dockerfile/snapshot
59-
scripts/ Operational helpers only: build skills, local startup, deploy orchestration, migrations, audit archive
55+
skills/ 19 curated skills; _shared/office is vendored and not bundled
56+
infra/ Container images and Dockerfiles for local development and Daytona sandboxes
57+
scripts/ Operational helpers: build-skills, dev, dev-worker-config, jsonc, migrate, migration-drizzle, database-operation-safety
6058
```
6159

6260
## Critical conventions (non-negotiable)
@@ -89,42 +87,29 @@ pnpm --filter @cheatcode/db db:generate # Create new migration
8987
```
9088

9189
Pre-commit (Lefthook) runs Biome on staged + typecheck on changed packages. Must stay <5s.
92-
Product/acceptance testing is direct `agent-browser --auto-connect --session cheatcode-debug`
93-
UI operation plus console/network/app-log review. Do not add or run scripted
94-
browser/product-flow test harnesses; package `test` scripts and source-level
95-
`*.test.ts` files are intentionally absent from the V2 command surface. Do not generate temporary validation scripts either; operate
96-
the UI directly and check logs, and remove any throwaway product QA script that
97-
appears in the V2 tree. Operational scripts may exist only for build,
98-
migration, secret sync, Docker cleanup, and guarded deploy orchestration; they are not
99-
product tests and must not simulate UI/user flows. Do not create temporary
100-
testing scripts in `scripts/`, package folders, `/tmp`, or any out-of-tree
101-
location. Delete future V2 product validators instead of running them. The
90+
Product/acceptance testing uses only direct
91+
`agent-browser --auto-connect --session cheatcode-debug` commands issued in the
92+
transcript to click, fill, and type through real flows, capture screenshots,
93+
inspect console/network/resources, and read running app logs. Never add, run,
94+
write, or keep scripts for browser or product-flow testing, including
95+
`pnpm`/`tsx` wrappers, shell or command loops, `/tmp` or generated helpers,
96+
browser-driver wrappers, package aliases, prompt drivers, curl flows,
97+
validators, and throwaway QA helpers in `scripts/`, package folders, or any
98+
out-of-tree location; delete them on sight instead of running them. Package
99+
`test` scripts and source-level `*.test.ts` files remain absent. Operational
100+
scripts may exist only for build, migration, secret sync, Docker cleanup, and
101+
guarded deploy orchestration and must not click the UI, submit prompts, drive
102+
auth, gather acceptance evidence, simulate UI/user flows, or replace direct
103+
browser operation. Typecheck, lint, and build are code-health gates only, not
104+
product QA. Code the all-weeks V2 surface first, then perform final QA through
105+
the direct browser commands and direct console/network/app-log inspection. The
102106
removed V1 tree must not be restored or copied back as a testing surface.
103107

104-
May 28, 2026 hardening: do not wrap product QA in `pnpm`, `tsx`, shell loops,
105-
`/tmp` helpers, generated files, browser-driver wrappers, package aliases, or
106-
any scripted flow. Each UI action, screenshot, console read, network/resource
107-
inspection, and app-log inspection must be issued directly in the transcript.
108-
Typecheck/lint/build remain code-health gates only.
109-
110-
May 28, 2026 direct override: delete any product-flow test script, temporary
111-
helper, command-loop runner, browser wrapper, prompt driver, curl flow, or
112-
package alias when discovered. The active V2 tree should contain no product-test
113-
scripts. The remaining `scripts/` files are operational only and must not click
114-
the UI, submit prompts, drive auth, gather acceptance evidence, or replace
115-
direct `agent-browser` operation.
116-
117-
May 28, 2026 latest user directive: code the all-weeks V2 surface first, then
118-
run final product QA only through direct `agent-browser --auto-connect --session
119-
cheatcode-debug` UI actions and direct console/network/app-log inspection. Do
120-
not write, run, or keep scripts to submit prompts, click UI, drive auth, wrap
121-
`agent-browser`, run curl flows, or gather acceptance evidence.
122-
123108
## Where things live
124109

125110
| Need | File |
126111
|---|---|
127-
| Add a new tool | `packages/tools-<domain>/src/<tool>.ts` |
112+
| Add a new tool | `packages/agent-core/src/tools/<domain>/<tool>.ts` for data/docs/media; `packages/tools-<domain>/src/<tool>.ts` for browser/code/research |
128113
| Add a new agent | `packages/agent-core/src/mastra/agents/<name>.ts` |
129114
| Add a new workflow | `packages/agent-core/src/mastra/workflows/<name>.ts` |
130115
| Add a new skill | `skills/<name>/SKILL.md` (+ optional `references/` / `assets/`) |
@@ -136,7 +121,13 @@ not write, run, or keep scripts to submit prompts, click UI, drive auth, wrap
136121

137122
Curated skills are bundled at build time into `packages/skills/src/generated.ts` (Workers have no filesystem at runtime). Anthropic SKILL.md format. V2 has no bundled skill scripts, no `evals/evals.json`, no local skill-eval runner, and no `skill_run_script` tool.
138123

139-
The source-of-truth catalog is the set of skill folders under `skills/`; do not duplicate a manually maintained name list here. External skill registry exports, skills.sh links, public publishing scripts, and launch-prep copy are outside V2 unless the user explicitly re-expands the plan.
124+
The source-of-truth catalog is the set of non-underscore skill folders under
125+
`skills/`; do not duplicate a manually maintained name list here.
126+
`skills/_shared/office/` is the shared vendored tree materialized by the sandbox
127+
Dockerfile, and `scripts/build-skills.ts` skips `_`-prefixed directories.
128+
External skill registry exports, skills.sh links, public publishing scripts,
129+
and launch-prep copy are outside V2 unless the user explicitly re-expands the
130+
plan.
140131

141132
The bundler contract lives in `scripts/build-skills.ts` and `packages/skills`.
142133

apps/agent-worker/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ Mastra tool-call chunks also emit `step_started`, `step_completed`,
194194
live stream. If the last stream subscriber disconnects while a run is still
195195
running, AgentRun emits `run_abandoned` for the watchdog/funnel trail.
196196

197-
AgentRun also emits `data-plan` and `data-task-status` UI chunks so the web app can
198-
render task progress without polling a separate status endpoint.
199-
200197
Project deletion first fences project/thread mutations, refuses an active run, records a
201198
durable cleanup request, then removes that project's workspace folder. The database marks
202199
cleanup complete only after the Agent service succeeds, so a repeated DELETE retries a

apps/agent-worker/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"types": "./dist/index.d.ts",
88
"scripts": {
99
"build": "wrangler deploy --dry-run",
10-
"deploy": "wrangler deploy",
1110
"lint": "biome check .",
1211
"typecheck": "tsc -p tsconfig.json --noEmit"
1312
},

apps/agent-worker/src/agent-api-run-routes.ts

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
type AgentRunAdmissionOutcome,
2828
activeRunForThreadRoute,
2929
agentRunForRunId,
30+
callAgentRun,
3031
fetchAgentRun,
3132
reconcileAgentRunAdmission,
3233
runEntitlementPolicy,
@@ -63,7 +64,6 @@ type RejectedRunResult = Exclude<
6364
export function registerAgentRunHttpRoutes(app: Hono<{ Bindings: AgentEnv }>): void {
6465
app.post("/v1/threads/:threadId/runs", createRun);
6566
app.get("/v1/threads/:threadId/runs/stream", streamActiveRun);
66-
app.get("/v1/threads/:threadId/runs/status", activeRunStatus);
6767
app.post("/v1/runs/:runId/cancel", cancelRun);
6868
app.get("/v1/threads/:threadId/browser-takeover", browserTakeoverStatus);
6969
app.post("/v1/threads/:threadId/browser-takeover/start", startBrowserTakeover);
@@ -276,26 +276,11 @@ async function streamActiveRun(c: AgentContext): Promise<Response> {
276276
);
277277
}
278278

279-
async function activeRunStatus(c: AgentContext): Promise<Response> {
280-
const userId = readGatewayUserId(c.req.raw.headers);
281-
const threadId = parseThreadRouteParam(c.req.param("threadId") ?? "");
282-
const run = await activeRunForThreadRoute(c.env, userId, threadId);
283-
if (!run) {
284-
return new Response(null, { status: 204 });
285-
}
286-
return fetchAgentRun(agentRunForRunId(c.env, run.runId), "https://agent-run.internal/status", {
287-
headers: { "X-Cheatcode-User-Id": userId },
288-
});
289-
}
290-
291279
async function cancelRun(c: AgentContext): Promise<Response> {
292280
const userId = readGatewayUserId(c.req.raw.headers);
293281
const runId = parseRunRouteParam(c.req.param("runId") ?? "");
294282
const run = await runForRoute(c.env, userId, runId);
295-
return fetchAgentRun(agentRunForRunId(c.env, run.runId), "https://agent-run.internal/cancel", {
296-
headers: { "X-Cheatcode-User-Id": userId },
297-
method: "POST",
298-
});
283+
return callAgentRun(agentRunForRunId(c.env, run.runId).cancel(userId));
299284
}
300285

301286
async function browserTakeoverStatus(c: AgentContext): Promise<Response> {
@@ -304,11 +289,7 @@ async function browserTakeoverStatus(c: AgentContext): Promise<Response> {
304289
if (!run) {
305290
return Response.json(BrowserTakeoverStatusSchema.parse({ status: "inactive" }));
306291
}
307-
return fetchAgentRun(
308-
agentRunForRunId(c.env, run.runId),
309-
"https://agent-run.internal/browser-takeover",
310-
{ headers: { "X-Cheatcode-User-Id": userId } },
311-
);
292+
return callAgentRun(agentRunForRunId(c.env, run.runId).browserTakeoverStatus(userId));
312293
}
313294

314295
async function startBrowserTakeover(c: AgentContext): Promise<Response> {
@@ -320,11 +301,7 @@ async function startBrowserTakeover(c: AgentContext): Promise<Response> {
320301
retriable: false,
321302
});
322303
}
323-
return fetchAgentRun(
324-
agentRunForRunId(c.env, run.runId),
325-
"https://agent-run.internal/browser-takeover/start",
326-
{ headers: { "X-Cheatcode-User-Id": userId }, method: "POST" },
327-
);
304+
return callAgentRun(agentRunForRunId(c.env, run.runId).browserTakeoverStart(userId));
328305
}
329306

330307
async function resumeBrowserTakeover(c: AgentContext): Promise<Response> {
@@ -336,17 +313,8 @@ async function resumeBrowserTakeover(c: AgentContext): Promise<Response> {
336313
if (!run) {
337314
return Response.json(BrowserTakeoverResumeResultSchema.parse({ ok: true, status: "inactive" }));
338315
}
339-
return fetchAgentRun(
340-
agentRunForRunId(c.env, run.runId),
341-
"https://agent-run.internal/browser-takeover/resume",
342-
{
343-
body: JSON.stringify(body),
344-
headers: {
345-
"Content-Type": "application/json",
346-
"X-Cheatcode-User-Id": userId,
347-
},
348-
method: "POST",
349-
},
316+
return callAgentRun(
317+
agentRunForRunId(c.env, run.runId).browserTakeoverResume(userId, body.takeoverId),
350318
);
351319
}
352320

0 commit comments

Comments
 (0)