Skip to content

Commit 5e2c15c

Browse files
committed
refactor(files): remove obsolete sandbox file exports
Remove the unused web sandbox listing helpers superseded by project files. Drop redundant Knip suppressions while retaining the explicit runtime entrypoints required by the non-workspace browser driver and skill runtime.
1 parent 4ea5319 commit 5e2c15c

2 files changed

Lines changed: 4 additions & 43 deletions

File tree

apps/web/src/lib/api/sandbox.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {
99
BrowserTakeoverStatusSchema,
1010
type SandboxConsoleSnapshot,
1111
SandboxConsoleSnapshotSchema,
12-
type SandboxFileEntry,
13-
SandboxFileListSchema,
1412
type SandboxIdeSession,
1513
SandboxIdeSessionSchema,
1614
SandboxTerminalCommandSchema,
@@ -50,23 +48,6 @@ export async function readSandboxConsole(
5048
);
5149
}
5250

53-
export async function listSandboxFiles(
54-
getToken: () => Promise<null | string>,
55-
threadId: string,
56-
path: string,
57-
recursive = false,
58-
signal?: AbortSignal,
59-
) {
60-
const response = await authorizedFetch(
61-
getToken,
62-
sandboxFilesPath(threadId, path, recursive),
63-
signal ? { signal } : {},
64-
);
65-
return SandboxFileListSchema.parse(
66-
await readBoundedJsonResponse(response, API_RESPONSE_LIMIT_BYTES.files),
67-
);
68-
}
69-
7051
export async function runSandboxTerminal(
7152
getToken: () => Promise<null | string>,
7253
threadId: string,
@@ -218,21 +199,6 @@ export async function runComputerTerminal(
218199
);
219200
}
220201

221-
export function compareFileEntries(left: SandboxFileEntry, right: SandboxFileEntry): number {
222-
if (left.type === "directory" && right.type !== "directory") {
223-
return -1;
224-
}
225-
if (left.type !== "directory" && right.type === "directory") {
226-
return 1;
227-
}
228-
return left.relativePath.localeCompare(right.relativePath);
229-
}
230-
231-
function sandboxFilesPath(threadId: string, path: string, recursive: boolean): string {
232-
const query = new URLSearchParams({ path, recursive: String(recursive) });
233-
return `/v1/threads/${encodeURIComponent(threadId)}/sandbox/files?${query.toString()}`;
234-
}
235-
236202
function browserTakeoverPath(threadId: string): string {
237203
return `/v1/threads/${encodeURIComponent(threadId)}/browser-takeover`;
238204
}

knip.jsonc

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,13 @@
1717
"entry": ["drizzle.config.ts", "src/schema/drizzle.ts"]
1818
},
1919
"infra/containers/sandbox/browser-driver": {
20-
// The snapshot launches this service from start-browser-driver.sh.
21-
"entry": ["server.js"],
22-
// Stagehand resolves these peer packages dynamically inside the snapshot,
23-
// so a clean root-only CI install exposes no source-level import to Knip.
24-
"ignoreDependencies": ["playwright-core", "zod"]
20+
// The snapshot launches this non-workspace service directly.
21+
"entry": ["server.js"]
2522
},
2623
"infra/containers/sandbox/skill-runtime": {
2724
"entry": ["bin/*.mjs"],
28-
// Snapshot launchers resolve these executables by installed binary name;
29-
// a root-only install cannot expose those child-process edges to Knip.
30-
"ignoreDependencies": ["agent-browser", "tsx"],
31-
"ignoreBinaries": ["agent-browser"]
25+
// The runtime resolves this executable from an absolute installed path.
26+
"ignoreDependencies": ["tsx"]
3227
}
3328
}
3429
}

0 commit comments

Comments
 (0)