Install @deepest/sdk from npm, configure an ESM client, narrow typed envelopes, and preserve server retry and recovery semantics.
@deepest/sdk provides generated TypeScript types and a zero-dependency client covering the entire Public API V1 contract. Authorization, resource admission, and lifecycle behavior remain server decisions: the SDK never retries automatically, manages lifecycle orchestration, or masks errors.Use it from a trusted environment that can securely hold an Agent API Key. For an end-to-end Agent example, see For Agents.
Install from npm
@deepest/sdk (0.1.0, MIT) is ESM-only and supports Node.js 18 or later using standard fetch:
npm install @deepest/sdk
npm install @deepest/sdk@0.1.0
Use .mjs files or "type": "module" in package.json.
Create a client and read resources
Set DEEPEST_API_URL (https://console.deepest.dev or your configured control origin, without appending /v1) and DEEPEST_API_KEY in the caller’s environment:
Pass the control origin without /v1 (the SDK includes operation paths automatically). Never pass a Preview, Share, or Viewer runtime URL as baseUrl.
Select a specific Machine
Collection namespaces (computers, sandboxes, tools, vault, agentKeys, resources, invites) list or create resources; computer(id) and sandbox(id) operate on a specific stable ID:
const list = await deepest.computers.list();if (!list.ok) throw new Error(list.error.code);for (const item of list.result) { console.log(item.id, item.display_name, item.state, item.ram_mib);}const computer = deepest.computer(process.env.DEEPEST_COMPUTER_ID);const current = await computer.get();if (!current.ok) throw new Error(`${current.error.code} (${current.retry})`);
Always identify Machines by id, not display_name. Use deepest.sandboxes and deepest.sandbox(id) for Sandboxes—Computer-only namespaces (ssh, desktop, assistance, snapshots, preview, shares, tools, resize, clone, storage) do not exist on Sandboxes.
TypeScript result handling
All SDK methods return a discriminated union { ok: true; ... } | Failure. A small helper can narrow results while keeping the structured failure envelope intact:
import type { Failure } from "@deepest/sdk";export function requireResult<T>(reply: { ok: true; result: T } | Failure): T { if (!reply.ok) { throw new Error( JSON.stringify({ code: reply.error.code, resource_id: reply.resource_id, retry: reply.retry, limit: reply.error.limit, retry_after_seconds: reply.error.retry_after_seconds, }), ); } return reply.result;}
Valid API errors return as Failure envelopes rather than rejected promises, while invalid constructor options or path identifiers ("", ".", "..") throw a client-side TypeError before any network call.
Authentication modes
Pass exactly one of apiKey or getSessionToken:
apiKey: Standard mode for Agents, CLI scripts, and trusted backend services using an Account-wide Agent API Key.
getSessionToken: Async callback (() => Promise<string | null>) used by authenticated Web Console sessions to obtain a fresh Human-session token per request (required for agentKeys.*, invites.redeem, and assistance.begin/touch/complete). The SDK never caches Human tokens across calls—never prompt users to paste browser session tokens into scripts or Agents.
Transport and recovery guarantees
Identifier & URL safety: Resource IDs are encoded as path components; empty, ., and .. identifiers are rejected before dispatch.
No redirects or browser cookies: Requests use redirect: "error" and credentials: "omit". If you supply a custom fetch, preserve those guarantees and avoid logging Authorization headers or Secret payloads.
No automatic retries: Transport failures, non-JSON responses, or HTTP/envelope mismatches return { ok: false, resource_id, retry: "query-first", error: { code: "UNKNOWN", ... } }. When resource_id falls back to "request", it means no Machine ID was known—never treat "request" as a created Machine ID.
On UNKNOWN (retry: "query-first"), always observe the original resource or task effect before retrying. For uncertain computers.create, sandboxes.create, clone, or snapshots.create, preserve the exact original idempotency_key and request parameters.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Deepest","description":"Documentation for Deepest: persistent Linux Computers, temporary Sandboxes, SSH, Desktop, Vault, and Public API V1.","colors":{"primary":"#262626","light":"#E5E5E5","dark":"#171717"},"logo":{"light":"https://mintcdn.com/deepest-v1-review/VxB8SQC7bkxwHjrQ/logo/light.svg?fit=max\u0026auto=format\u0026n=VxB8SQC7bkxwHjrQ\u0026q=85\u0026s=c0bc9b5199d182f8d3b3e96a7a684077","dark":"https://mintcdn.com/deepest-v1-review/VxB8SQC7bkxwHjrQ/logo/dark.svg?fit=max\u0026auto=format\u0026n=VxB8SQC7bkxwHjrQ\u0026q=85\u0026s=daa20a04403dffeb52325c11a68924d2","href":"https://deepest.dev"},"favicon":"https://mintcdn.com/deepest-v1-review/2UqazGaJgeXyCkZv/favicon.svg?fit=max\u0026auto=format\u0026n=2UqazGaJgeXyCkZv\u0026q=85\u0026s=df1877152e0989352f9cfda3e8d28190","api":{"playground":{"display":"interactive"}},"navbar":{"links":[{"href":"mailto:support@deepest.dev","label":"Support"}],"primary":{"type":"button","label":"Console","href":"https://console.deepest.dev"}},"footer":{"links":[{"header":"Documentation","items":[{"label":"Overview","href":"/"},{"label":"Quickstart","href":"/quickstart"},{"label":"For agents","href":"/for-agents"},{"label":"API Reference","href":"/api-reference"}]},{"header":"Platform","items":[{"label":"Console","href":"https://console.deepest.dev"},{"label":"TypeScript SDK","href":"/api-and-sdk/typescript"},{"label":"Troubleshooting","href":"/help/troubleshooting"},{"label":"Support","href":"mailto:support@deepest.dev"}]},{"header":"Legal","items":[{"label":"Terms of Service","href":"https://deepest.dev/terms"},{"label":"Privacy Policy","href":"https://deepest.dev/privacy"},{"label":"Acceptable Use","href":"https://deepest.dev/acceptable-use"}]}]},"seo":{"organization":{"name":"Deepest","url":"https://deepest.dev"},"indexing":"navigable"},"fonts":{"heading":{"family":"Geist"},"body":{"family":"Geist"}},"icons":{"library":"lucide"},"contextual":{"options":["copy","view"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"deepest-v1-review","hasAudioNarration":false,"actualSubdomain":"deepest-v1-review","customDomains":["docs.deepest.dev"],"gitSource":{"type":"github","owner":"renj369","repo":"deepest-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":"","_id":"6afd0012003541e92f3cb2fc"},"entitlements":{},"buildId":"6b0c10e23f7540bc94fcea74","clientVersion":"0.0.4347","searchFilterCounts":[{"language":"default","tag":"API Reference","count":62},{"language":"default","tag":"Endpoints","count":61},{"language":"default","tag":"Guides","count":36},{"language":"default","tag":"Vault \u0026 Secrets","count":11},{"language":"default","tag":"Computers","count":10},{"language":"default","tag":"Sandboxes","count":9},{"language":"default","tag":"Desktop \u0026 Assistance","count":7},{"language":"default","tag":"Snapshots \u0026 Storage","count":6},{"language":"default","tag":"Build with API and SDK","count":5},{"language":"default","tag":"Manage Computers","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"footer#footer.advanced-footer>div{max-width:92rem;padding-inline:1rem}@media (min-width: 1024px){footer#footer.advanced-footer>div{padding-inline:3rem}footer#footer.advanced-footer>div>div:first-child>div:first-child{min-width:16rem}}footer#footer.advanced-footer img.nav-logo{width:auto;height:1.75rem;max-width:none}"}]}
{"page":{"pagePath":"api-and-sdk/typescript","slug":"/api-and-sdk/typescript","pageMetadata":{"title":"Use the TypeScript and JavaScript SDK","sidebarTitle":"TypeScript SDK","description":"Install @deepest/sdk from npm, configure an ESM client, narrow typed envelopes, and preserve server retry and recovery semantics.","keywords":["Deepest TypeScript SDK","JavaScript","ESM","Node.js","@deepest/sdk","npm"],"href":"/api-and-sdk/typescript"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Install @deepest/sdk from npm, configure an ESM client, narrow typed envelopes, and preserve server retry and recovery semantics.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`@deepest/sdk`}),` provides generated TypeScript types and a zero-dependency client covering the entire Public API V1 contract. Authorization, resource admission, and lifecycle behavior remain server decisions: the SDK never retries automatically, manages lifecycle orchestration, or masks errors.`]}),`\n`,_jsxs(_components.p,{children:[`Use it from a trusted environment that can securely hold an Agent API Key. For an end-to-end Agent example, see `,_jsx(_components.a,{href:`/for-agents`,children:`For Agents`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`install-from-npm`,children:`Install from npm`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`https://www.npmjs.com/package/@deepest/sdk/v/0.1.0`,children:_jsx(_components.code,{children:`@deepest/sdk`})}),` (`,_jsx(_components.code,{children:`0.1.0`}),`, MIT) is `,_jsx(_components.strong,{children:`ESM-only`}),` and supports `,_jsx(_components.strong,{children:`Node.js 18 or later`}),` using standard `,_jsx(_components.code,{children:`fetch`}),`:`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Latest`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @deepest/sdk`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Pinned release`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @deepest/sdk@0.1.0`})]}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`.mjs`}),` files or `,_jsx(_components.code,{children:`\"type\": \"module\"`}),` in `,_jsx(_components.code,{children:`package.json`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-client-and-read-resources`,children:`Create a client and read resources`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`DEEPEST_API_URL`}),` (`,_jsx(_components.code,{children:`https://console.deepest.dev`}),` or your configured control origin, `,_jsx(_components.strong,{children:`without`}),` appending `,_jsx(_components.code,{children:`/v1`}),`) and `,_jsx(_components.code,{children:`DEEPEST_API_KEY`}),` in the caller’s environment:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`32`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`32`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Save as resources.mjs`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Deepest`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@deepest/sdk\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`DEEPEST_API_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`DEEPEST_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`DEEPEST_API_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`DEEPEST_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` TypeError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Set DEEPEST_API_URL and DEEPEST_API_KEY.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` deepest`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Deepest`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` baseUrl:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` DEEPEST_API_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` DEEPEST_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` reply`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` deepest`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resources`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` account_id:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`account_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` entitlement:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`entitlement`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` available_memory_mib:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ram_limit_mib`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` -`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ram_used_mib`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` storage_status:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`storage_status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` count_constraints:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`machine_count_constraints`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`} `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` code:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resource_id:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resource_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` retry:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`retry`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` limit:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`limit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` retry_after_seconds:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`retry_after_seconds`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`exitCode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Pass the control origin without `,_jsx(_components.code,{children:`/v1`}),` (the SDK includes operation paths automatically). Never pass a Preview, Share, or Viewer runtime URL as `,_jsx(_components.code,{children:`baseUrl`}),`.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`select-a-specific-machine`,children:`Select a specific Machine`}),`\n`,_jsxs(_components.p,{children:[`Collection namespaces (`,_jsx(_components.code,{children:`computers`}),`, `,_jsx(_components.code,{children:`sandboxes`}),`, `,_jsx(_components.code,{children:`tools`}),`, `,_jsx(_components.code,{children:`vault`}),`, `,_jsx(_components.code,{children:`agentKeys`}),`, `,_jsx(_components.code,{children:`resources`}),`, `,_jsx(_components.code,{children:`invites`}),`) list or create resources; `,_jsx(_components.code,{children:`computer(id)`}),` and `,_jsx(_components.code,{children:`sandbox(id)`}),` operate on a specific stable ID:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` list`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` deepest`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`computers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`list`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`list`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`list`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` item`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` of`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` list`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`display_name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`state`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ram_mib`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` computer`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` deepest`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`computer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`DEEPEST_COMPUTER_ID`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` current`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` computer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`current`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`current`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`code`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` (`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`current`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`retry`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\")`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Always identify Machines by `,_jsx(_components.code,{children:`id`}),`, not `,_jsx(_components.code,{children:`display_name`}),`. Use `,_jsx(_components.code,{children:`deepest.sandboxes`}),` and `,_jsx(_components.code,{children:`deepest.sandbox(id)`}),` for Sandboxes—Computer-only namespaces (`,_jsx(_components.code,{children:`ssh`}),`, `,_jsx(_components.code,{children:`desktop`}),`, `,_jsx(_components.code,{children:`assistance`}),`, `,_jsx(_components.code,{children:`snapshots`}),`, `,_jsx(_components.code,{children:`preview`}),`, `,_jsx(_components.code,{children:`shares`}),`, `,_jsx(_components.code,{children:`tools`}),`, `,_jsx(_components.code,{children:`resize`}),`, `,_jsx(_components.code,{children:`clone`}),`, `,_jsx(_components.code,{children:`storage`}),`) do not exist on Sandboxes.`]}),`\n`,_jsx(Heading,{level:`2`,id:`typescript-result-handling`,children:`TypeScript result handling`}),`\n`,_jsxs(_components.p,{children:[`All SDK methods return a discriminated union `,_jsx(_components.code,{children:`{ ok: true; ... } | Failure`}),`. A small helper can narrow results while keeping the structured failure envelope intact:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` type`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Failure`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@deepest/sdk\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` requireResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`T`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`>(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`reply`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` T`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`|`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Failure`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` T`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` code:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`code`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resource_id:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resource_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` retry:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`retry`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` limit:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`limit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` retry_after_seconds:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`retry_after_seconds`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` reply`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`result`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Valid API errors return as `,_jsx(_components.code,{children:`Failure`}),` envelopes rather than rejected promises, while invalid constructor options or path identifiers (`,_jsx(_components.code,{children:`\"\"`}),`, `,_jsx(_components.code,{children:`\".\"`}),`, `,_jsx(_components.code,{children:`\"..\"`}),`) throw a client-side `,_jsx(_components.code,{children:`TypeError`}),` before any network call.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authentication-modes`,children:`Authentication modes`}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.strong,{children:`exactly one`}),` of `,_jsx(_components.code,{children:`apiKey`}),` or `,_jsx(_components.code,{children:`getSessionToken`}),`:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`apiKey`}),`:`]}),` Standard mode for Agents, CLI scripts, and trusted backend services using an Account-wide Agent API Key.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`getSessionToken`}),`:`]}),` Async callback (`,_jsx(_components.code,{children:`() => Promise\u003cstring | null>`}),`) used by authenticated Web Console sessions to obtain a fresh Human-session token per request (required for `,_jsx(_components.code,{children:`agentKeys.*`}),`, `,_jsx(_components.code,{children:`invites.redeem`}),`, and `,_jsx(_components.code,{children:`assistance.begin/touch/complete`}),`). The SDK never caches Human tokens across calls—never prompt users to paste browser session tokens into scripts or Agents.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`transport-and-recovery-guarantees`,children:`Transport and recovery guarantees`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Identifier \u0026 URL safety:`}),` Resource IDs are encoded as path components; empty, `,_jsx(_components.code,{children:`.`}),`, and `,_jsx(_components.code,{children:`..`}),` identifiers are rejected before dispatch.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`No redirects or browser cookies:`}),` Requests use `,_jsx(_components.code,{children:`redirect: \"error\"`}),` and `,_jsx(_components.code,{children:`credentials: \"omit\"`}),`. If you supply a custom `,_jsx(_components.code,{children:`fetch`}),`, preserve those guarantees and avoid logging `,_jsx(_components.code,{children:`Authorization`}),` headers or Secret payloads.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`No automatic retries:`}),` Transport failures, non-JSON responses, or HTTP/envelope mismatches return `,_jsx(_components.code,{children:`{ ok: false, resource_id, retry: \"query-first\", error: { code: \"UNKNOWN\", ... } }`}),`. When `,_jsx(_components.code,{children:`resource_id`}),` falls back to `,_jsx(_components.code,{children:`\"request\"`}),`, it means no Machine ID was known—never treat `,_jsx(_components.code,{children:`\"request\"`}),` as a created Machine ID.`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`On `,_jsx(_components.code,{children:`UNKNOWN`}),` (`,_jsx(_components.code,{children:`retry: \"query-first\"`}),`), always observe the original resource or task effect before retrying. For uncertain `,_jsx(_components.code,{children:`computers.create`}),`, `,_jsx(_components.code,{children:`sandboxes.create`}),`, `,_jsx(_components.code,{children:`clone`}),`, or `,_jsx(_components.code,{children:`snapshots.create`}),`, preserve the exact original `,_jsx(_components.code,{children:`idempotency_key`}),` and request parameters.`]})}),`\n`,_jsxs(_components.p,{children:[`Continue with `,_jsx(_components.a,{href:`/concepts/account-resources`,children:`Account resources`}),`, `,_jsx(_components.a,{href:`/connect/commands`,children:`Commands`}),`, `,_jsx(_components.a,{href:`/api-and-sdk/errors`,children:`Errors`}),`, `,_jsx(_components.a,{href:`/api-and-sdk/reliability`,children:`Reliability and recovery`}),`, or the `,_jsx(_components.a,{href:`/api-reference`,children:`API Reference`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Use the TypeScript and JavaScript SDK","sidebarTitle":"TypeScript SDK","description":"Install @deepest/sdk from npm, configure an ESM client, narrow typed envelopes, and preserve server retry and recovery semantics.","keywords":["Deepest TypeScript SDK","JavaScript","ESM","Node.js","@deepest/sdk","npm"],"href":"/api-and-sdk/typescript"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Install from npm","slug":"install-from-npm","depth":2,"children":[]},{"title":"Create a client and read resources","slug":"create-a-client-and-read-resources","depth":2,"children":[]},{"title":"Select a specific Machine","slug":"select-a-specific-machine","depth":2,"children":[]},{"title":"TypeScript result handling","slug":"typescript-result-handling","depth":2,"children":[]},{"title":"Authentication modes","slug":"authentication-modes","depth":2,"children":[]},{"title":"Transport and recovery guarantees","slug":"transport-and-recovery-guarantees","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"deepest-v1-review","siteName":"Deepest","title":"Use the TypeScript and JavaScript SDK - Deepest","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-29T11:47:52.941Z","originalFileLocation":"api-and-sdk/typescript.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Install @deepest/sdk from npm, configure an ESM client, narrow typed envelopes, and preserve server retry and recovery semantics.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Deepest\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/deepest-v1-review/lor1PpzZkTu0RXhn/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/deepest-v1-review/lor1PpzZkTu0RXhn/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/deepest-v1-review/lor1PpzZkTu0RXhn/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/deepest-v1-review/lor1PpzZkTu0RXhn/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/deepest-v1-review/lor1PpzZkTu0RXhn/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/deepest-v1-review/lor1PpzZkTu0RXhn/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/deepest-v1-review/lor1PpzZkTu0RXhn/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/deepest-v1-review/lor1PpzZkTu0RXhn/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/deepest-v1-review/lor1PpzZkTu0RXhn/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Use the TypeScript and JavaScript SDK - Deepest\">\u003cmeta data-mint-head property=\"og:description\" content=\"Install @deepest/sdk from npm, configure an ESM client, narrow typed envelopes, and preserve server retry and recovery semantics.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Deepest\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.deepest.dev/api-and-sdk/typescript\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://deepest-v1-review.mintlify.site/_mintlify/api/og/v2?division=Build+with+API+and+SDK\u0026amp;title=Use+the+TypeScript+and+JavaScript+SDK\u0026amp;description=Install+%40deepest%2Fsdk+from+npm%2C+configure+an+ESM+client%2C+narrow+typed+envelopes%2C+and+preserve+server+retry+and+recovery+semantics.\u0026amp;theme=1454fa38cbf8de229cdc6625\u0026amp;signature=e1b6bccf42e1facccf60574e79993fcc8d10f03dbbd520c2b5a232c23761f08e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Use the TypeScript and JavaScript SDK - Deepest\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Install @deepest/sdk from npm, configure an ESM client, narrow typed envelopes, and preserve server retry and recovery semantics.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://deepest-v1-review.mintlify.site/_mintlify/api/og/v2?division=Build+with+API+and+SDK\u0026amp;title=Use+the+TypeScript+and+JavaScript+SDK\u0026amp;description=Install+%40deepest%2Fsdk+from+npm%2C+configure+an+ESM+client%2C+narrow+typed+envelopes%2C+and+preserve+server+retry+and+recovery+semantics.\u0026amp;theme=1454fa38cbf8de229cdc6625\u0026amp;signature=e1b6bccf42e1facccf60574e79993fcc8d10f03dbbd520c2b5a232c23761f08e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/deepest-v1-review/lor1PpzZkTu0RXhn/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Deepest\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#262626\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.deepest.dev/api-and-sdk/typescript\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-and-sdk/typescript.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://deepest.dev/#organization\",\"name\":\"Deepest\",\"url\":\"https://deepest.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/deepest-v1-review/VxB8SQC7bkxwHjrQ/logo/light.svg?fit=max\u0026auto=format\u0026n=VxB8SQC7bkxwHjrQ\u0026q=85\u0026s=c0bc9b5199d182f8d3b3e96a7a684077\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.deepest.dev#website\",\"name\":\"Deepest\",\"url\":\"https://docs.deepest.dev\",\"publisher\":{\"@id\":\"https://deepest.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.deepest.dev/api-and-sdk/typescript#webpage\",\"url\":\"https://docs.deepest.dev/api-and-sdk/typescript\",\"name\":\"Use the TypeScript and JavaScript SDK\",\"description\":\"Install @deepest/sdk from npm, configure an ESM client, narrow typed envelopes, and preserve server retry and recovery semantics.\",\"dateModified\":\"2026-11-29T11:47:52.941Z\",\"isPartOf\":{\"@id\":\"https://docs.deepest.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.deepest.dev/api-and-sdk/typescript#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.deepest.dev/api-and-sdk/typescript#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Build with API and SDK\",\"item\":\"https://docs.deepest.dev/api-and-sdk/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Use the TypeScript and JavaScript SDK\",\"item\":\"https://docs.deepest.dev/api-and-sdk/typescript\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.deepest.dev/api-and-sdk/typescript#article\",\"headline\":\"Use the TypeScript and JavaScript SDK\",\"name\":\"Use the TypeScript and JavaScript SDK\",\"description\":\"Install @deepest/sdk from npm, configure an ESM client, narrow typed envelopes, and preserve server retry and recovery semantics.\",\"url\":\"https://docs.deepest.dev/api-and-sdk/typescript\",\"mainEntityOfPage\":{\"@id\":\"https://docs.deepest.dev/api-and-sdk/typescript#webpage\"},\"dateModified\":\"2026-11-29T11:47:52.941Z\",\"keywords\":\"Deepest TypeScript SDK, JavaScript, ESM, Node.js, @deepest/sdk, npm\",\"publisher\":{\"@id\":\"https://deepest.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.deepest.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Deepest\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Deepest\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-and-sdk/typescript.md","siteName":"Deepest","nav":{"global":null,"tabs":[{"tab":"Guides","groups":[{"group":"Get started","pages":[{"title":"Deepest documentation","sidebarTitle":"Overview","href":""},{"title":"Get your first working Linux Computer","sidebarTitle":"Quickstart","href":"/quickstart"},{"title":"Choose a Computer or a Sandbox","href":"/concepts/choose-a-machine"},{"title":"Use Deepest from an Agent or program","sidebarTitle":"For agents","href":"/for-agents"}]},{"group":"Account and access","pages":[{"title":"Understand the Account resource pool","sidebarTitle":"Account resources","href":"/concepts/account-resources"},{"title":"Account access, invitations, and retention","href":"/account/access-and-retention"},{"title":"Create and revoke Agent API Keys","href":"/account/agent-keys"}]},{"group":"Manage Computers","pages":[{"title":"Create, find, start, and stop a Computer","sidebarTitle":"Computer lifecycle","href":"/computers/lifecycle"},{"title":"Resize a Computer's Memory","href":"/computers/resize"},{"title":"Create disk snapshots and restore a Computer","sidebarTitle":"Disk snapshots and restore","href":"/computers/snapshots-and-restore"},{"title":"Clone a stopped Computer","href":"/computers/clone"},{"title":"Reclaim storage after deleting files","href":"/computers/storage-reclaim"}]},{"group":"Run temporary tasks","pages":[{"title":"Run a task in a Sandbox","href":"/sandboxes/overview"},{"title":"Manage Sandbox expiry and idle Stop","href":"/sandboxes/lifecycle"}]},{"group":"Connect and move work","pages":[{"title":"Connect to a Computer with SSH","sidebarTitle":"SSH","href":"/connect/ssh"},{"title":"Use VS Code Remote SSH","href":"/connect/vscode"},{"title":"Transfer files with SFTP","href":"/connect/sftp"},{"title":"Forward a Computer port to your laptop","href":"/connect/port-forwarding"},{"title":"Run commands with Exec","href":"/connect/commands"}]},{"group":"Prepare development environment","pages":[{"title":"Understand the Developer Image","href":"/environment/developer-image"},{"title":"Work with Git and GitHub","href":"/environment/git-and-github"},{"title":"Run Docker and Dev Containers","href":"/environment/docker-and-dev-containers"},{"title":"Inspect and install Coding Agent tools","href":"/environment/agent-tools"}]},{"group":"Desktop and human assistance","pages":[{"title":"Open the Desktop and browser","sidebarTitle":"Desktop and browser","href":"/desktop/overview"},{"title":"Ask a human to help an Agent","href":"/desktop/human-assistance"}]},{"group":"Preview, sharing, and network","pages":[{"title":"Preview an HTTP or WebSocket service","sidebarTitle":"Private Preview","href":"/network/private-preview"},{"title":"Share a web service with an anonymous visitor","sidebarTitle":"Share","href":"/network/share"},{"title":"Outbound networking, bandwidth, and traffic","href":"/network/outbound-and-bandwidth"}]},{"group":"Protect access and secrets","pages":[{"title":"Isolation and credential boundaries","href":"/security/isolation-and-credentials"},{"title":"Use Vault secrets from a Computer or Sandbox","sidebarTitle":"Vault","href":"/security/vault"}]},{"group":"Build with API and SDK","pages":[{"title":"Public API and SDK overview","href":"/api-and-sdk/overview"},{"title":"Authenticate Human and Agent requests","description":"Use the right Bearer credential on the Deepest control API and distinguish Agent-eligible operations from Human-only controls.","href":"/api-and-sdk/authentication"},{"title":"Use the TypeScript and JavaScript SDK","sidebarTitle":"TypeScript SDK","href":"/api-and-sdk/typescript"},{"title":"Understand API results and errors","description":"Distinguish API envelopes from process outcomes, interpret every stable ErrorCode and LimitDimension, and respect HTTP 429 retry backoff.","href":"/api-and-sdk/errors"},{"title":"Retries, idempotency, and uncertain results","href":"/api-and-sdk/reliability"}]},{"group":"Troubleshoot","pages":[{"title":"Troubleshoot a Deepest task","sidebarTitle":"Troubleshooting","href":"/help/troubleshooting"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference"}]}]},"basePath":"","title":"Use the TypeScript and JavaScript SDK - Deepest","deploymentId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","buildId":"dpl_6UE2cqB47X6P7P3F2hD3UphW6ijc","dynamics":[],"chunks":[]}