chore: sync workspace changes

This commit is contained in:
Nathan Flurry 2026-01-28 01:13:50 -08:00
parent 8a91b8e9aa
commit 6aa591bd91
13 changed files with 237 additions and 26 deletions

View file

@ -1,4 +1,6 @@
export { SandboxAgent, SandboxAgentError } from "./client.ts";
export { buildInspectorUrl } from "./inspector.ts";
export type { InspectorUrlOptions } from "./inspector.ts";
export type {
SandboxAgentConnectOptions,
SandboxAgentStartOptions,

View file

@ -0,0 +1,32 @@
const INSPECTOR_URL = "https://inspect.sandboxagent.dev";
export interface InspectorUrlOptions {
/**
* Base URL of the sandbox-agent server.
*/
baseUrl: string;
/**
* Optional bearer token for authentication.
*/
token?: string;
/**
* Optional extra headers to pass to the sandbox-agent server.
* Will be JSON-encoded in the URL.
*/
headers?: Record<string, string>;
}
/**
* Builds a URL to the sandbox-agent inspector UI with the given connection parameters.
*/
export function buildInspectorUrl(options: InspectorUrlOptions): string {
const normalized = options.baseUrl.replace(/\/+$/, "");
const params = new URLSearchParams({ url: normalized });
if (options.token) {
params.set("token", options.token);
}
if (options.headers && Object.keys(options.headers).length > 0) {
params.set("headers", JSON.stringify(options.headers));
}
return `${INSPECTOR_URL}?${params.toString()}`;
}