mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-19 00:25:23 +00:00
chore: sync workspace changes
This commit is contained in:
parent
8a91b8e9aa
commit
6aa591bd91
13 changed files with 237 additions and 26 deletions
|
|
@ -4,5 +4,12 @@
|
|||
"type": "module",
|
||||
"exports": {
|
||||
".": "./src/sandbox-agent-client.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "latest",
|
||||
"typescript": "latest"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,20 +21,33 @@ const INSPECTOR_URL = "https://inspect.sandboxagent.dev";
|
|||
export function buildInspectorUrl({
|
||||
baseUrl,
|
||||
token,
|
||||
headers,
|
||||
}: {
|
||||
baseUrl: string;
|
||||
token?: string;
|
||||
headers?: Record<string, string>;
|
||||
}): string {
|
||||
const normalized = normalizeBaseUrl(ensureUrl(baseUrl));
|
||||
const params = new URLSearchParams({ url: normalized });
|
||||
if (token) {
|
||||
params.set("token", token);
|
||||
}
|
||||
if (headers && Object.keys(headers).length > 0) {
|
||||
params.set("headers", JSON.stringify(headers));
|
||||
}
|
||||
return `${INSPECTOR_URL}?${params.toString()}`;
|
||||
}
|
||||
|
||||
export function logInspectorUrl({ baseUrl, token }: { baseUrl: string; token?: string }): void {
|
||||
console.log(`Inspector: ${buildInspectorUrl({ baseUrl, token })}`);
|
||||
export function logInspectorUrl({
|
||||
baseUrl,
|
||||
token,
|
||||
headers,
|
||||
}: {
|
||||
baseUrl: string;
|
||||
token?: string;
|
||||
headers?: Record<string, string>;
|
||||
}): void {
|
||||
console.log(`Inspector: ${buildInspectorUrl({ baseUrl, token, headers })}`);
|
||||
}
|
||||
|
||||
type HeaderOptions = {
|
||||
|
|
|
|||
16
examples/shared/tsconfig.json
Normal file
16
examples/shared/tsconfig.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2022", "DOM"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue