{"_id":"@astrifer-ai/agent-os","_rev":"4-373c828b82d808251e6401b817e98ae1","name":"@astrifer-ai/agent-os","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@astrifer-ai/agent-os","version":"0.1.0","keywords":["ariadra","sdk","openapi"],"license":"Apache-2.0","_id":"@astrifer-ai/agent-os@0.1.0","maintainers":[{"name":"yf36","email":"yifan.fan.1983@gmail.com"}],"homepage":"https://am.astrifer.ai","bugs":{"url":"https://github.com/vibengine-ai/ariadra-sdk-typescript/issues"},"dist":{"shasum":"c8a8eb4156aff0920ca4dabdf921d444c57ac551","tarball":"https://registry.npmjs.org/@astrifer-ai/agent-os/-/agent-os-0.1.0.tgz","fileCount":6,"integrity":"sha512-fsEQJDYuz2eE+hUEu70EUyN+pkJDIWYqpQDLXcz7sVhKTVQvo6nWjqbnP2xDex0t2W/2THAAd7qJbEl1eYku3A==","signatures":[{"sig":"MEQCIG5M4Zm77ttRWRwmIfCMwig5Xb7ZCrNXlnC/qR6vPLBHAiBuodMoiMK5D/Z78qnTGJaMZAXsUAHfo/iaup57XtZVqw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":637749},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"ed283e23739ae90856c76eed2a0f47a4a5c4b455","scripts":{"lint":"biome check .","test":"vitest run","build":"tsup","check":"npm run check:branding && npm run check:openapi && npm run check:metadata && npm run check:boundaries && npm run lint && npm run typecheck && npm test && npm run build && npm run check:surface && npm run check:management","clean":"rm -rf dist coverage","format":"biome check --write .","prepack":"npm run check","pack:dry":"npm pack --dry-run","smoke:bun":"node scripts/smoke-bun-consumer.mjs","typecheck":"tsc --noEmit","test:watch":"vitest","gen:openapi":"tsx scripts/gen-openapi.ts && npm run gen:openapi --workspace @astrifer-ai/agent-os-management","gen:surface":"tsx scripts/check-surface.ts","setup:hooks":"git config core.hooksPath .githooks","sync:openapi":"tsx scripts/gen-openapi.ts --sync && npm run sync:openapi --workspace @astrifer-ai/agent-os-management","check:openapi":"tsx scripts/gen-openapi.ts --check && npm run check:openapi --workspace @astrifer-ai/agent-os-management","check:surface":"tsx scripts/check-surface.ts --check","smoke:package":"node scripts/smoke-package.mjs","check:branding":"tsx scripts/check-branding.ts","check:metadata":"tsx scripts/check-package-metadata.ts","check:boundaries":"tsx scripts/check-module-boundaries.ts","check:management":"npm run check --workspace @astrifer-ai/agent-os-management","test:integration":"ARIADRA_SDK_INTEGRATION=1 vitest run test/integration","release:dry-run:sdk":"scripts/publish-npm.sh --package sdk","smoke:bun:streaming":"node scripts/smoke-bun-live-streaming.mjs","test:integration:hitl":"ARIADRA_SDK_INTEGRATION=1 ARIADRA_SDK_MOCK_RD_INTEGRATION=1 vitest run test/integration/hitl.integration.test.ts","smoke:management-package":"node scripts/smoke-management-package.mjs","check:production-contract":"tsx scripts/check-production-contract.ts","release:dry-run:management":"scripts/publish-npm.sh --package management-sdk","test:integration:stream-chaos":"ARIADRA_SDK_INTEGRATION=1 ARIADRA_SDK_STREAM_CHAOS_INTEGRATION=1 vitest run test/integration/stream-chaos.integration.test.ts"},"_npmUser":{"name":"yf36","email":"yifan.fan.1983@gmail.com"},"repository":{"url":"git+https://github.com/vibengine-ai/ariadra-sdk-typescript.git","type":"git"},"workspaces":["packages/*"],"_npmVersion":"11.19.0","description":"TypeScript SDK for Astrifer Agent OS.","directories":{},"sideEffects":false,"_nodeVersion":"26.8.1","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.22.3","tsup":"^8.5.1","vite":"^6.4.2","yaml":"^2.9.0","vitest":"^3.2.4","typescript":"^5.9.3","@types/node":"^18.19.130","@biomejs/biome":"^2.4.16","openapi-typescript":"^7.13.0"},"_npmOperationalInternal":{"tmp":"tmp/agent-os_0.1.0_1788846436393_0.5399797176614876","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@astrifer-ai/agent-os","version":"0.2.0","keywords":["ariadra","sdk","openapi"],"license":"Apache-2.0","_id":"@astrifer-ai/agent-os@0.2.0","maintainers":[{"name":"yf36","email":"yifan.fan.1983@gmail.com"}],"homepage":"https://am.astrifer.ai","bugs":{"url":"https://github.com/vibengine-ai/ariadra-sdk-typescript/issues"},"dist":{"shasum":"036e421631615f194daf2cb8322f65cea41824d8","tarball":"https://registry.npmjs.org/@astrifer-ai/agent-os/-/agent-os-0.2.0.tgz","fileCount":6,"integrity":"sha512-O1kXUvRTecJJIjZRDp2YtP19IVyVSNRNVmMWYOY4HfaAbjjEVwpIOp1Ze+g7gSN29UwtIvyIIL+DeTlSNMKTJA==","signatures":[{"sig":"MEQCIERIeERqywDYv7LUON4VNvJorky720ymHVWWrBqwXJoMAiAb7U8Nd0cVhpQECUJLKISGC3C4mwQXqyvptImgRzFS6g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIDEsNATn6whLIoQK7wPAxgQY44i5HZTajjL59Gz3WibwAiEAsFjvxiDxJZzqpDn1tPGOhXUGPHFGJfqrontiIAX+0AE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":684251},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"3fc77674c90ecf98599f1244144dd43e4c13f57c","scripts":{"lint":"biome check .","test":"vitest run","build":"tsup","check":"npm run check:branding && npm run check:openapi && npm run check:metadata && npm run check:boundaries && npm run lint && npm run typecheck && npm test && npm run build && npm run check:surface && npm run check:management","clean":"rm -rf dist coverage","format":"biome check --write .","prepack":"npm run check","pack:dry":"npm pack --dry-run","smoke:bun":"node scripts/smoke-bun-consumer.mjs","typecheck":"tsc --noEmit","test:watch":"vitest","gen:openapi":"tsx scripts/gen-openapi.ts && npm run gen:openapi --workspace @astrifer-ai/agent-os-management","gen:surface":"tsx scripts/check-surface.ts","setup:hooks":"git config core.hooksPath .githooks","sync:openapi":"tsx scripts/gen-openapi.ts --sync && npm run sync:openapi --workspace @astrifer-ai/agent-os-management","check:openapi":"tsx scripts/gen-openapi.ts --check && npm run check:openapi --workspace @astrifer-ai/agent-os-management","check:surface":"tsx scripts/check-surface.ts --check","smoke:package":"node scripts/smoke-package.mjs","check:branding":"tsx scripts/check-branding.ts","check:metadata":"tsx scripts/check-package-metadata.ts","check:boundaries":"tsx scripts/check-module-boundaries.ts","check:management":"npm run check --workspace @astrifer-ai/agent-os-management","test:integration":"ARIADRA_SDK_INTEGRATION=1 vitest run test/integration","release:dry-run:sdk":"scripts/publish-npm.sh --package sdk","smoke:bun:streaming":"node scripts/smoke-bun-live-streaming.mjs","test:integration:hitl":"ARIADRA_SDK_INTEGRATION=1 ARIADRA_SDK_MOCK_RD_INTEGRATION=1 vitest run test/integration/hitl.integration.test.ts","smoke:management-package":"node scripts/smoke-management-package.mjs","check:production-contract":"tsx scripts/check-production-contract.ts","release:dry-run:management":"scripts/publish-npm.sh --package management-sdk","test:integration:stream-chaos":"ARIADRA_SDK_INTEGRATION=1 ARIADRA_SDK_STREAM_CHAOS_INTEGRATION=1 vitest run test/integration/stream-chaos.integration.test.ts"},"_npmUser":{"name":"yf36","email":"yifan.fan.1983@gmail.com"},"repository":{"url":"git+https://github.com/vibengine-ai/ariadra-sdk-typescript.git","type":"git"},"workspaces":["packages/*"],"_npmVersion":"11.19.1","description":"TypeScript SDK for Astrifer Agent OS.","directories":{},"sideEffects":false,"_nodeVersion":"26.8.2","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.22.3","tsup":"^8.5.1","vite":"^6.4.2","yaml":"^2.9.0","vitest":"^3.2.4","typescript":"^5.9.3","@types/node":"^18.19.130","@biomejs/biome":"^2.4.16","openapi-typescript":"^7.13.0"},"_npmOperationalInternal":{"tmp":"tmp/agent-os_0.2.0_1789973913187_0.5808420723773959","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@astrifer-ai/agent-os","version":"0.2.1","keywords":["ariadra","sdk","openapi"],"license":"Apache-2.0","_id":"@astrifer-ai/agent-os@0.2.1","maintainers":[{"name":"yf36","email":"yifan.fan.1983@gmail.com"}],"homepage":"https://am.astrifer.ai","bugs":{"url":"https://github.com/vibengine-ai/ariadra-sdk-typescript/issues"},"dist":{"shasum":"b6dd6cdf3afcc68305eb60609e0477567318c375","tarball":"https://registry.npmjs.org/@astrifer-ai/agent-os/-/agent-os-0.2.1.tgz","fileCount":6,"integrity":"sha512-HabYh9teFz7coDypItPahfiUDrkokerNTVBALg5JTK2O8jbSzrg7S2T7OxjrxWN82so1CgxCwznXJbyW+peSvQ==","signatures":[{"sig":"MEYCIQCxjnCrA3bFm6dXiaZBxfYI5yX5qeOQoZInKOFRALKSCgIhANTaDNWxDKoC0r9ov3j7DF6ExNvdkcJBV2AFu8+O/jvx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIAFmTPzhwyXPX/UDTGtxRibEnQdTc6wdJN3idZJwfp39AiEA7FaKH09OCCuB0q+KISxlYXL9ncB/nlfGBvKfOth0Ny8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":685100},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"2d10b3e3f56404b21ac29d97460c0fdfceb3f291","scripts":{"lint":"biome check .","test":"vitest run","build":"tsup","check":"npm run check:branding && npm run check:openapi && npm run check:metadata && npm run check:boundaries && npm run lint && npm run typecheck && npm test && npm run build && npm run check:surface && npm run check:management","clean":"rm -rf dist coverage","format":"biome check --write .","prepack":"npm run check","pack:dry":"npm pack --dry-run","smoke:bun":"node scripts/smoke-bun-consumer.mjs","typecheck":"tsc --noEmit","test:watch":"vitest","gen:openapi":"tsx scripts/gen-openapi.ts && npm run gen:openapi --workspace @astrifer-ai/agent-os-management","gen:surface":"tsx scripts/check-surface.ts","setup:hooks":"git config core.hooksPath .githooks","sync:openapi":"tsx scripts/gen-openapi.ts --sync && npm run sync:openapi --workspace @astrifer-ai/agent-os-management","check:openapi":"tsx scripts/gen-openapi.ts --check && npm run check:openapi --workspace @astrifer-ai/agent-os-management","check:surface":"tsx scripts/check-surface.ts --check","smoke:package":"node scripts/smoke-package.mjs","check:branding":"tsx scripts/check-branding.ts","check:metadata":"tsx scripts/check-package-metadata.ts","check:boundaries":"tsx scripts/check-module-boundaries.ts","check:management":"npm run check --workspace @astrifer-ai/agent-os-management","test:integration":"ARIADRA_SDK_INTEGRATION=1 vitest run test/integration","release:dry-run:sdk":"scripts/publish-npm.sh --package sdk","smoke:bun:streaming":"node scripts/smoke-bun-live-streaming.mjs","test:integration:hitl":"ARIADRA_SDK_INTEGRATION=1 ARIADRA_SDK_MOCK_RD_INTEGRATION=1 vitest run test/integration/hitl.integration.test.ts","smoke:management-package":"node scripts/smoke-management-package.mjs","check:production-contract":"tsx scripts/check-production-contract.ts","release:dry-run:management":"scripts/publish-npm.sh --package management-sdk","test:integration:stream-chaos":"ARIADRA_SDK_INTEGRATION=1 ARIADRA_SDK_STREAM_CHAOS_INTEGRATION=1 vitest run test/integration/stream-chaos.integration.test.ts"},"_npmUser":{"name":"yf36","email":"yifan.fan.1983@gmail.com"},"repository":{"url":"git+https://github.com/vibengine-ai/ariadra-sdk-typescript.git","type":"git"},"workspaces":["packages/*"],"_npmVersion":"11.19.1","description":"TypeScript SDK for Astrifer Agent OS.","directories":{},"sideEffects":false,"_nodeVersion":"26.8.2","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.13","tsup":"^8.5.1","vite":"^6.4.3","yaml":"^2.9.0","vitest":"^3.2.7","typescript":"^5.9.3","@types/node":"^18.19.130","@biomejs/biome":"^2.4.16","openapi-typescript":"^7.13.0"},"_npmOperationalInternal":{"tmp":"tmp/agent-os_0.2.1_1789976971066_0.8762003448024303","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"_id":"@astrifer-ai/agent-os@0.3.0","bugs":{"url":"https://github.com/vibengine-ai/ariadra-sdk-typescript/issues"},"dist":{"shasum":"326a633eeaa3f7d6df0e4885b823b0dc0fe9f537","tarball":"https://registry.npmjs.org/@astrifer-ai/agent-os/-/agent-os-0.3.0.tgz","fileCount":6,"integrity":"sha512-IFSjFqUFJcrDz33tORH7bWQmhFNGopBJjpP2nclP/neyzfgzI2E4suBzUPMjFrrLad9biDNK8loiwlr/mvMIFg==","signatures":[{"sig":"MEUCIQDYmxTsAj+Tt/Tuzwr3VJdlwro5871FzPlTiJg958h8YQIgbdCWJLklXqlpo+jGusA4XH4r9OCxkG0hnb2ne916v/k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGiwxFX76/B4KHrXjXBucU/Cqg7a+Ia0CV5eV/ewYHbXAiBSEuzztkd9skoqj83DI+QzcT1SB8YvJlXCJayHarK0BQ=="}],"unpackedSize":699345},"main":"./dist/index.js","name":"@astrifer-ai/agent-os","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"license":"Apache-2.0","scripts":{"lint":"biome check .","test":"vitest run","build":"tsup","check":"npm run check:branding && npm run check:openapi && npm run check:metadata && npm run check:boundaries && npm run lint && npm run typecheck && npm test && npm run build && npm run check:surface && npm run check:management","clean":"rm -rf dist coverage","format":"biome check --write .","prepack":"npm run check","pack:dry":"npm pack --dry-run","smoke:bun":"node scripts/smoke-bun-consumer.mjs","typecheck":"tsc --noEmit","test:watch":"vitest","gen:openapi":"tsx scripts/gen-openapi.ts && npm run gen:openapi --workspace @astrifer-ai/agent-os-management","gen:surface":"tsx scripts/check-surface.ts","setup:hooks":"git config core.hooksPath .githooks","sync:openapi":"tsx scripts/gen-openapi.ts --sync && npm run sync:openapi --workspace @astrifer-ai/agent-os-management","check:openapi":"tsx scripts/gen-openapi.ts --check && npm run check:openapi --workspace @astrifer-ai/agent-os-management","check:surface":"tsx scripts/check-surface.ts --check","smoke:package":"node scripts/smoke-package.mjs","check:branding":"tsx scripts/check-branding.ts","check:metadata":"tsx scripts/check-package-metadata.ts","check:boundaries":"tsx scripts/check-module-boundaries.ts","check:management":"npm run check --workspace @astrifer-ai/agent-os-management","test:integration":"ARIADRA_SDK_INTEGRATION=1 vitest run test/integration","release:dry-run:sdk":"scripts/publish-npm.sh --package sdk","smoke:bun:streaming":"node scripts/smoke-bun-live-streaming.mjs","test:integration:hitl":"ARIADRA_SDK_INTEGRATION=1 ARIADRA_SDK_MOCK_RD_INTEGRATION=1 vitest run test/integration/hitl.integration.test.ts","smoke:management-package":"node scripts/smoke-management-package.mjs","check:production-contract":"tsx scripts/check-production-contract.ts","release:dry-run:management":"scripts/publish-npm.sh --package management-sdk","test:integration:stream-chaos":"ARIADRA_SDK_INTEGRATION=1 ARIADRA_SDK_STREAM_CHAOS_INTEGRATION=1 vitest run test/integration/stream-chaos.integration.test.ts"},"version":"0.3.0","_npmUser":{"name":"yf36","email":"yifan.fan.1983@gmail.com"},"homepage":"https://am.astrifer.ai","keywords":["ariadra","sdk","openapi"],"repository":{"url":"git+https://github.com/vibengine-ai/ariadra-sdk-typescript.git","type":"git"},"workspaces":["packages/*"],"_npmVersion":"11.19.1","description":"TypeScript SDK for Astrifer Agent OS.","directories":{},"maintainers":[{"name":"yf36","email":"yifan.fan.1983@gmail.com"}],"sideEffects":false,"_nodeVersion":"26.8.2","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.13","tsup":"^8.5.1","vite":"^6.4.3","yaml":"^2.9.0","vitest":"^3.2.7","typescript":"^5.9.3","@types/node":"^18.19.130","@biomejs/biome":"^2.4.16","openapi-typescript":"^7.13.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent-os_0.3.0_1790152251411_0.17082654468431802"}}},"time":{"created":"2026-09-08T05:47:16.219Z","modified":"2026-09-23T08:30:51.735Z","0.1.0":"2026-09-08T05:47:16.529Z","0.2.0":"2026-09-21T06:58:33.264Z","0.2.1":"2026-09-21T07:49:31.172Z","0.3.0":"2026-09-23T08:30:51.488Z"},"bugs":{"url":"https://github.com/vibengine-ai/ariadra-sdk-typescript/issues"},"license":"Apache-2.0","homepage":"https://am.astrifer.ai","keywords":["ariadra","sdk","openapi"],"repository":{"url":"git+https://github.com/vibengine-ai/ariadra-sdk-typescript.git","type":"git"},"description":"TypeScript SDK for Astrifer Agent OS.","maintainers":[{"name":"yf36","email":"yifan.fan.1983@gmail.com"}],"readme":"# Astrifer Agent OS TypeScript SDK\n\nTypeScript and JavaScript SDK for building applications on AgentOS.\n\nThis repository contains the Astrifer Agent OS SDK packages, starting at version `0.1.0`.\nSee [SDK baseline](https://github.com/vibengine-ai/ariadra-sdk-typescript/blob/main/docs/sdk-baseline.md) for names, contracts, and release status.\n\n## Install\n\n```bash\nnpm install @astrifer-ai/agent-os\n```\n\nThe package is ESM-only and supports Node.js 18 or later. Compatible runtimes\nmust provide the standard Fetch, Web Streams, `AbortController`, `TextDecoder`,\nand Web Crypto APIs.\n\n## Quickstart\n\n```ts\nimport { AgentOS } from \"@astrifer-ai/agent-os\";\n\nconst client = new AgentOS({\n  apiKey: process.env.ARIADRA_API_KEY,\n  baseURL: process.env.ARIADRA_BASE_URL!,\n  namespace: process.env.ARIADRA_NAMESPACE,\n});\n\nconst sessions = await client.sessions.list({ limit: 20 });\n\nfor (const session of sessions.data) {\n  console.log(session.session_id, session.current_status);\n}\n```\n\nUse `https://api.am.astrifer.ai` for the hosted API; `https://am.astrifer.ai` is the workspace UI.\n\n`baseURL` is the API URL for your AgentOS deployment. Keep API keys in\nenvironment variables or a secret manager rather than source code.\n\n## Configuration\n\nThe `AgentOS` constructor accepts:\n\n| Option | Description |\n| --- | --- |\n| `baseURL` | Required AgentOS API URL. |\n| `apiKey` | API key sent as Bearer authentication. |\n| `namespace` | Optional namespace routing value. |\n| `region` | Optional region routing value. |\n| `timeoutMs` | Optional request deadline in milliseconds. |\n| `maxRetries` | Retry count for eligible transient failures. Defaults to `0`. |\n| `fetch` | Optional Fetch-compatible implementation. |\n\nRequest methods also accept per-request timeout, retry, header, and\n`AbortSignal` options.\n\n## Core APIs\n\nThe client provides typed resources for:\n\n- Agent specifications and immutable versions\n- Environment specifications and sandbox provider discovery\n- Sessions, effective context, events, messages, usage, resources, and web\n  previews\n- Volume attachments, skills, and artifacts\n- Non-secret LLM provider credential and HTTP MCP tool discovery\n- Event Bus subscriptions, delivery streams, DLQ, bindings, and strict inbound\n  APIs\n\nNew AgentSpec versions support `claude_code` and `codex_cli`, with an optional backend-native\n`tool_permission_mode` (omitting it selects the recommended bypass policy). This SDK supports only these two runtimes for both creation and reading.\n\nUse the resource methods directly when you need REST-shaped operations. For a\ncommon conversational turn, `runTurn` sends one user message and yields typed\nupdates until the turn finishes:\n\n```ts\nimport { deriveReplyContext } from \"@astrifer-ai/agent-os\";\n\nconst sessionId = process.env.ARIADRA_SESSION_ID!;\nconst displayed = await client.sessions.events.listLatest(sessionId, {\n  limit: 100,\n});\nconst replyContext = deriveReplyContext(displayed.data);\nif (!replyContext) throw new Error(\"The displayed turn is still open\");\n\nfor await (const update of client.sessions.runTurn(sessionId, \"Hello\", {\n  replyContext,\n})) {\n  switch (update.type) {\n    case \"accepted\":\n      console.log(\"message accepted\", update.event.sequence);\n      break;\n    case \"event\":\n      if (update.event.type === \"agent.message\") {\n        console.log(update.event.payload.content);\n      }\n      break;\n    case \"result\":\n      console.log(\"turn finished\", update.result.status);\n      break;\n  }\n}\n```\n\nSession event types are discriminated unions, so TypeScript narrows each event\npayload from its `type` field.\n\n## Event Consumption\n\nFor application event loops, use `watchWithHistory` to consume existing events\nand continue watching for new ones. Persist the cursor reported through\n`onCursor` after your application has processed it.\n\n```ts\nlet afterSequence = 0;\n\nfor await (const event of client.sessions.events.watchWithHistory(sessionId, {\n  afterSequence,\n  onCursor: (cursor) => {\n    afterSequence = cursor;\n  },\n  retry: { maxAttempts: 3 },\n})) {\n  console.log(event.sequence, event.type);\n}\n```\n\nFor one message at a time, prefer `runTurn`. Use\n`client.sessions.events.list`, `stream`, or `watchWithHistory` when your\napplication needs direct control over history, live events, or cursor storage.\n\n## Error Handling\n\n```ts\nimport {\n  APIError,\n  FrozenReplyConflictError,\n  InputValidationError,\n  TimeoutError,\n  UnsupportedAPIVersionError,\n} from \"@astrifer-ai/agent-os\";\n\ntry {\n  await client.sessions.get(sessionId);\n} catch (error) {\n  if (error instanceof InputValidationError) {\n    console.error(error.field, error.unit, error.limit, error.reason);\n  } else if (error instanceof UnsupportedAPIVersionError) {\n    console.error(\"Upgrade the AgentOS SDK\", error.minimumCompatibleVersion);\n  } else if (error instanceof FrozenReplyConflictError) {\n    console.error(\"Refresh the conversation and ask the user to confirm again\");\n  } else if (error instanceof APIError) {\n    console.error(error.status, error.code, error.requestId, error.traceId);\n  } else if (error instanceof TimeoutError) {\n    console.error(`request timed out after ${error.timeoutMs}ms`);\n  } else {\n    throw error;\n  }\n}\n```\n\nSDK errors expose the request trace ID when available, which can be used to\ncorrelate client failures with AgentOS support and service logs.\n\nCurated resource methods validate the generated public input bounds before\nsending a request. They never truncate or normalize an over-limit value, and\n`InputValidationError` never contains the rejected value. The Platform remains\nthe final authority. For forward-compatible fields not yet represented by a\ncurated method, low-level `client.request(...)` deliberately bypasses SDK\npreflight and sends the request to the server unchanged.\n\nSee the [public input validation guide](https://github.com/vibengine-ai/ariadra-sdk-typescript/blob/main/docs/public-input-validation.md)\nfor units, collection/JSON/Base64 behavior, and the raw escape hatch.\n\n## Tenant Management\n\nUse the companion `@astrifer-ai/agent-os-management` package for enterprise\ntenant administration such as member, namespace, API key, and provider\ncredential management, plus Event Bus adapter installation, grant,\nsubscription teardown, lifecycle, and Link Authorization control-plane\noperations. The two packages version independently and can be used together in\nthe same application.\n\n## More Information\n\nProduct information, documentation, and support are available at\n[am.astrifer.ai](https://am.astrifer.ai).\n\n## License\n\nApache-2.0\n\n## Independent Sandboxes\n\n`client.sandboxes` manages user-owned Sandbox assets. A Sandbox has one frozen\nEnvironment and optional Workspace; multiple Sessions can use it concurrently\n(up to the server's configured attachment limit, currently at most eight).\nManaged and independent instances share the per-tenant/user quota, initially one;\npaused instances and pending cleanup still count.\n\n```ts\nconst accepted = await client.sandboxes.create(\n  { environment_spec_id: \"env_project\", workspace_id: \"vol_project\" },\n  { idempotencyKey: \"create-project-sandbox-1\" },\n);\nconst { sandbox, operation } = accepted.data;\nconst receipt = await client.sandboxes.operation(sandbox.sandbox_id, operation.operation_id);\n// Poll with the server's retry_after_seconds until terminal. Completion alone\n// is not success: check outcome, then verify sandbox.state === \"running\".\n```\n\nAfter readiness, create a Session with `sandbox_id` instead of\n`environment_spec_id`; do not supply a Volume override. Creating a managed\nSession continues to use `environment_spec_id` and optional Volume resources.\n\n```ts\nawait client.sessions.create(\n  { agent_spec_id: \"as_project\", sandbox_id: \"sbx_ready_instance\" },\n  { idempotencyKey: \"project-conversation-1\" },\n);\n```\n\nSandbox operations use `sandbox.read`, `sandbox.use` and `sandbox.manage`\nindependently. Listing attached Sessions also requires Session-read permission.\nPause refuses active work or any attached Session's `keep_warm`; it never forces\nan interruption and may be cancelled if new activity races admission.\nResume does not create another instance. Within the replay window, reusing a\ncompleted operation key returns its old receipt, so a new pause/resume action\nneeds a new key. Delete refuses live\nattachments, retains Workspace data and returns acceptance before physical cleanup\nfinishes. `workspaces.references()` returns tagged Session/Sandbox references under\nthe caller's separate read grants; hidden references still prevent deletion.\n\nEvery accepted mutation returns `Retry-After: 5`, available through\n`.withResponse()`, even for a completed replay. Inspect the operation state first;\nonly nonterminal operations need another GET poll. The SDK does not poll or\nrepeat a mutation automatically to advance its operation.\n\nCompleted pause/resume receipts remain available for at least 24 hours. Pending\noperations remain until settled; create/delete receipts stay with the asset until\nits deleted record can be collected (at least 24 hours after deletion and all\noperation completion, with resources, metering and references settled). These APIs\nare not an audit archive. Collection makes the asset/receipt return 404; that does\nnot prove an operation failed. Do not resubmit an old key beyond its guaranteed\nwindow: once collected, it may be treated as a new request.\n","readmeFilename":"README.md"}