@code-yeongyu/senpi 2026.8.25 → 2026.8.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +29 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/per-turn-cap.d.ts +5 -9
- package/dist/core/extensions/builtin/compaction/per-turn-cap.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/per-turn-cap.js +5 -11
- package/dist/core/extensions/builtin/compaction/per-turn-cap.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/todo-bridge.d.ts +2 -3
- package/dist/core/extensions/builtin/compaction/todo-bridge.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/todo-bridge.js +53 -14
- package/dist/core/extensions/builtin/compaction/todo-bridge.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +28 -5
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/node_modules/@anthropic-ai/sdk/CHANGELOG.md +558 -0
- package/node_modules/@anthropic-ai/sdk/README.md +16 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js +14 -2
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs +14 -2
- package/node_modules/@anthropic-ai/sdk/_vendor/partial-json-parser/parser.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/api-promise.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/api-promise.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/api-promise.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/api-promise.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/bin/migration-config.json +481 -0
- package/node_modules/@anthropic-ai/sdk/client.d.mts +165 -11
- package/node_modules/@anthropic-ai/sdk/client.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/client.d.ts +165 -11
- package/node_modules/@anthropic-ai/sdk/client.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/client.js +415 -38
- package/node_modules/@anthropic-ai/sdk/client.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/client.mjs +414 -37
- package/node_modules/@anthropic-ai/sdk/client.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api-promise.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.js +7 -2
- package/node_modules/@anthropic-ai/sdk/core/api-promise.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs +8 -3
- package/node_modules/@anthropic-ai/sdk/core/api-promise.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/api.d.mts +11 -0
- package/node_modules/@anthropic-ai/sdk/core/api.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api.d.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/core/api.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api.js +3 -0
- package/node_modules/@anthropic-ai/sdk/core/api.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/api.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/core/api.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.mts +131 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.ts +131 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.js +317 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.mjs +277 -0
- package/node_modules/@anthropic-ai/sdk/core/credentials.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.mts +12 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/error.d.ts +12 -0
- package/node_modules/@anthropic-ai/sdk/core/error.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/error.js +18 -1
- package/node_modules/@anthropic-ai/sdk/core/error.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/error.mjs +16 -0
- package/node_modules/@anthropic-ai/sdk/core/error.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.mts +154 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.ts +154 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.js +174 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.mjs +168 -0
- package/node_modules/@anthropic-ai/sdk/core/middleware.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts +20 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts +20 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.js +26 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/pagination.mjs +24 -0
- package/node_modules/@anthropic-ai/sdk/core/pagination.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/resource.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/resource.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts +9 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts +9 -0
- package/node_modules/@anthropic-ai/sdk/core/streaming.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.js +34 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.mjs +34 -1
- package/node_modules/@anthropic-ai/sdk/core/streaming.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/uploads.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/core/uploads.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/error.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/error.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/error.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/error.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/error.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/error.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.mts +23 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.js +31 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.mjs +23 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/environments.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.js +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/helpers/beta/json-schema.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.js +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/mcp.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/memory.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/memory.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.mts +11 -5
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.ts +11 -5
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.js +2 -2
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.mjs +2 -2
- package/node_modules/@anthropic-ai/sdk/helpers/beta/zod.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/json-schema.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/json-schema.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/json-schema.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/zod.d.mts +2 -2
- package/node_modules/@anthropic-ai/sdk/helpers/zod.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/zod.d.ts +2 -2
- package/node_modules/@anthropic-ai/sdk/helpers/zod.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/zod.js +1 -2
- package/node_modules/@anthropic-ai/sdk/helpers/zod.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/helpers/zod.mjs +1 -2
- package/node_modules/@anthropic-ai/sdk/helpers/zod.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/index.d.mts +4 -2
- package/node_modules/@anthropic-ai/sdk/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/index.d.ts +4 -2
- package/node_modules/@anthropic-ai/sdk/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/index.js +5 -1
- package/node_modules/@anthropic-ai/sdk/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/index.mjs +3 -2
- package/node_modules/@anthropic-ai/sdk/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.js +0 -5
- package/node_modules/@anthropic-ai/sdk/internal/constants.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/constants.mjs +0 -5
- package/node_modules/@anthropic-ai/sdk/internal/constants.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/jsonl.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/decoders/line.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/detect-platform.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.mts +136 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.ts +136 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.js +531 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs +523 -0
- package/node_modules/@anthropic-ai/sdk/internal/file-store.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/headers.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/headers.js +45 -4
- package/node_modules/@anthropic-ai/sdk/internal/headers.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/headers.mjs +43 -3
- package/node_modules/@anthropic-ai/sdk/internal/headers.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.mts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.ts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.js +34 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs +30 -0
- package/node_modules/@anthropic-ai/sdk/internal/message-stream-utils.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts +2 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts +2 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.js +16 -10
- package/node_modules/@anthropic-ai/sdk/internal/parse.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs +15 -9
- package/node_modules/@anthropic-ai/sdk/internal/parse.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.mts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.js +13 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs +9 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/formats.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.mts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.ts +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.js +14 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.mjs +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.js +277 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs +274 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/stringify.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.mts +57 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.ts +57 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.js +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/types.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.mts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.ts +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.js +230 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs +217 -0
- package/node_modules/@anthropic-ai/sdk/internal/qs/utils.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts +52 -2
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts +52 -2
- package/node_modules/@anthropic-ai/sdk/internal/request-options.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.js +12 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs +10 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-options.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.mts +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.js +50 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.mjs +45 -0
- package/node_modules/@anthropic-ai/sdk/internal/request-signal.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/internal/shims.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.mts +60 -0
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.ts +60 -0
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/{lib → internal}/stainless-helper-header.js +27 -6
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/{lib → internal}/stainless-helper-header.mjs +25 -5
- package/node_modules/@anthropic-ai/sdk/internal/stainless-helper-header.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/to-file.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/to-file.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/types.d.mts +12 -6
- package/node_modules/@anthropic-ai/sdk/internal/types.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/types.d.ts +12 -6
- package/node_modules/@anthropic-ai/sdk/internal/types.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/uploads.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.mts +13 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.ts +13 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.js +26 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs +23 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/abort.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.mts +31 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.ts +31 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.js +75 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs +71 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/async-queue.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.mts +23 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.js +44 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs +36 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/backoff.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/base64.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts +11 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts +11 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.js +37 -11
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs +35 -10
- package/node_modules/@anthropic-ai/sdk/internal/utils/log.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/path.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.mts +11 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.js +18 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs +15 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/promise.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.mts +0 -3
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.ts +0 -3
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.js +3 -16
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.mjs +2 -16
- package/node_modules/@anthropic-ai/sdk/internal/utils/query.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts +9 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts +9 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js +23 -2
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs +23 -2
- package/node_modules/@anthropic-ai/sdk/internal/utils/sleep.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.js +8 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.mjs +5 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/time.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/internal/utils/values.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/internal/utils.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js +66 -31
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs +66 -31
- package/node_modules/@anthropic-ai/sdk/lib/BetaMessageStream.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js +37 -26
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs +34 -23
- package/node_modules/@anthropic-ai/sdk/lib/MessageStream.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/beta-parser.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/beta-parser.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/beta-parser.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.mts +39 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.ts +39 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js +245 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs +208 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/credential-chain.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.mts +11 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js +72 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs +35 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/identity-token.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.mts +40 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.ts +40 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.js +82 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs +79 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/oidc-federation.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.mts +54 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.ts +54 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.js +112 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs +108 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/token-cache.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.mts +96 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.ts +96 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js +266 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs +224 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/types.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.mts +21 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.ts +21 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js +130 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs +94 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials/user-oauth.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.d.mts +4 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.d.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.js +8 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/lib/credentials.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.mts +4 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.js +18 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.mts +95 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.ts +95 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.js +226 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs +217 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/poller.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.mts +227 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.ts +227 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.js +569 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs +564 -0
- package/node_modules/@anthropic-ai/sdk/lib/environments/worker.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.mts +31 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.ts +31 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.js +58 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.mjs +55 -0
- package/node_modules/@anthropic-ai/sdk/lib/helper-client.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.mts +98 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.ts +98 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.js +754 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs +749 -0
- package/node_modules/@anthropic-ai/sdk/lib/middleware.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/parser.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/parser.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/parser.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts +22 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts +22 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js +88 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs +85 -0
- package/node_modules/@anthropic-ai/sdk/lib/sessions/accumulate.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.mts +38 -5
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.ts +38 -5
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.js +28 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs +25 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaRunnableTool.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js +107 -29
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs +105 -27
- package/node_modules/@anthropic-ai/sdk/lib/tools/BetaToolRunner.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/CompactionControl.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/CompactionControl.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.mts +179 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.ts +179 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.js +728 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs +724 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/SessionToolRunner.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolError.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolError.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/lib/transform-json-schema.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/package.json +32 -15
- package/node_modules/@anthropic-ai/sdk/pagination.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/pagination.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/pagination.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/pagination.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resource.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resource.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resource.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/resource.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.mts +608 -68
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.ts +608 -68
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.js +2 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs +2 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/agents.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents/versions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/agents.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts +51 -13
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts +51 -13
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js +22 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs +22 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/beta.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.mts +306 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.ts +306 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.js +55 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs +51 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployment-runs.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts +698 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts +698 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.js +196 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs +192 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/deployments.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts +309 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts +309 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.js +116 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs +112 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/dreams.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts +426 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts +426 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.js +150 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs +145 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/environments.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.mts +501 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.ts +501 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.js +257 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs +251 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments/work.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.mts +1 -388
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.ts +1 -388
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.js +2 -138
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.mjs +1 -136
- package/node_modules/@anthropic-ai/sdk/resources/beta/environments.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts +22 -22
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts +22 -22
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js +5 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs +5 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/files.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts +11 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts +11 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js +23 -13
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs +6 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.mts +136 -24
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.ts +136 -24
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.js +10 -10
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs +10 -10
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memories.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.mts +60 -16
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.ts +60 -16
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.js +12 -12
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs +12 -12
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.mts +105 -7
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.ts +105 -7
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.js +6 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs +6 -6
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores/memory-versions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/memory-stores.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts +81 -30
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts +81 -30
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js +12 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs +12 -9
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/batches.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts +2453 -380
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts +2453 -380
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js +16 -22
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs +16 -22
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/models.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.mts +643 -19
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.ts +643 -19
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.js +29 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs +27 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/events.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.mts +3 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.ts +3 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.js +3 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/resources.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.mts +455 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.ts +455 -8
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.js +5 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs +6 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/sessions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.mts +78 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.ts +78 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.js +61 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs +57 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/events.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts +195 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts +195 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.js +88 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs +83 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads/threads.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions/threads.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/sessions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.mts +13 -11
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.ts +13 -11
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.js +5 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs +5 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/skills.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.mts +31 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.ts +31 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.js +32 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs +32 -3
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills/versions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/skills.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.mts +163 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.ts +163 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.js +129 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs +125 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/certificates.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.mts +212 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.ts +212 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.js +181 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs +176 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels/tunnels.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/tunnels.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.mts +62 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.ts +62 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.js +5 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs +5 -5
- package/node_modules/@anthropic-ai/sdk/resources/beta/user-profiles.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.mts +256 -4
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.ts +256 -4
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.js +22 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs +22 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/credentials.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.mts +2 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.ts +2 -2
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults/vaults.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/vaults.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts +466 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts +466 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js +20 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs +16 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta/webhooks.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/beta.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts +18 -11
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts +18 -11
- package/node_modules/@anthropic-ai/sdk/resources/completions.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/completions.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/files.d.mts +105 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.d.ts +105 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.js +52 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.mjs +48 -0
- package/node_modules/@anthropic-ai/sdk/resources/files.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.d.mts +4 -2
- package/node_modules/@anthropic-ai/sdk/resources/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.d.ts +4 -2
- package/node_modules/@anthropic-ai/sdk/resources/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.js +5 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/index.mjs +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts +20 -11
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts +20 -11
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js +17 -9
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs +17 -9
- package/node_modules/@anthropic-ai/sdk/resources/messages/batches.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/index.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts +1782 -162
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts +1782 -162
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js +23 -28
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs +23 -28
- package/node_modules/@anthropic-ai/sdk/resources/messages/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/messages.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/models.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.mts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.js +9 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.mjs +4 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/index.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.mts +129 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.ts +129 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.js +44 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs +39 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/skills.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.mts +104 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.ts +104 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.js +41 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs +37 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills/versions.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.d.mts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.d.ts +2 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.js +6 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.mjs +3 -0
- package/node_modules/@anthropic-ai/sdk/resources/skills.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/resources.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/resources.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/src/_vendor/partial-json-parser/parser.ts +18 -2
- package/node_modules/@anthropic-ai/sdk/src/client.ts +749 -42
- package/node_modules/@anthropic-ai/sdk/src/core/api-promise.ts +14 -4
- package/node_modules/@anthropic-ai/sdk/src/core/api.ts +11 -0
- package/node_modules/@anthropic-ai/sdk/src/core/credentials.ts +379 -0
- package/node_modules/@anthropic-ai/sdk/src/core/error.ts +17 -0
- package/node_modules/@anthropic-ai/sdk/src/core/middleware.ts +339 -0
- package/node_modules/@anthropic-ai/sdk/src/core/pagination.ts +60 -0
- package/node_modules/@anthropic-ai/sdk/src/core/streaming.ts +38 -1
- package/node_modules/@anthropic-ai/sdk/src/helpers/beta/environments.ts +34 -0
- package/node_modules/@anthropic-ai/sdk/src/helpers/beta/json-schema.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/src/helpers/beta/mcp.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/src/helpers/beta/zod.ts +14 -10
- package/node_modules/@anthropic-ai/sdk/src/helpers/zod.ts +3 -6
- package/node_modules/@anthropic-ai/sdk/src/index.ts +16 -1
- package/node_modules/@anthropic-ai/sdk/src/internal/constants.ts +0 -5
- package/node_modules/@anthropic-ai/sdk/src/internal/file-store.ts +550 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/headers.ts +47 -4
- package/node_modules/@anthropic-ai/sdk/src/internal/message-stream-utils.ts +30 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/parse.ts +16 -11
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/LICENSE.md +13 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/README.md +3 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/formats.ts +10 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/index.ts +13 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/stringify.ts +385 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/types.ts +71 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/qs/utils.ts +265 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/request-options.ts +55 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/request-signal.ts +68 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/stainless-helper-header.ts +122 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/abort.ts +21 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/async-queue.ts +66 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/backoff.ts +41 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/log.ts +41 -10
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/promise.ts +18 -0
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/query.ts +2 -18
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/sleep.ts +25 -2
- package/node_modules/@anthropic-ai/sdk/src/internal/utils/time.ts +4 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/BetaMessageStream.ts +72 -33
- package/node_modules/@anthropic-ai/sdk/src/lib/MessageStream.ts +36 -24
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/credential-chain.ts +292 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/identity-token.ts +37 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/oidc-federation.ts +140 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/token-cache.ts +130 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/types.ts +295 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials/user-oauth.ts +144 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/credentials.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/environments/index.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/environments/poller.ts +299 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/environments/worker.ts +779 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/helper-client.ts +86 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/middleware.ts +994 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/sessions/accumulate.ts +130 -0
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/BetaRunnableTool.ts +71 -7
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/BetaToolRunner.ts +135 -35
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/SessionToolRunner.ts +885 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/agents.ts +806 -69
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/agents/index.ts +34 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/beta.ts +690 -28
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployment-runs.ts +441 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/deployments.ts +996 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/dreams.ts +453 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/environments.ts +626 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/index.ts +42 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments/work.ts +705 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/environments.ts +1 -540
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/files.ts +28 -28
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/index.ts +312 -5
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/index.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memories.ts +141 -31
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-stores.ts +66 -20
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/memory-stores/memory-versions.ts +112 -9
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/batches.ts +90 -33
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/index.ts +90 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/messages/messages.ts +2755 -211
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/models.ts +7 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/events.ts +888 -18
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/index.ts +60 -1
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/sessions.ts +669 -14
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/events.ts +123 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/index.ts +15 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads/threads.ts +330 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/sessions/threads.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/index.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/skills.ts +15 -14
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/skills/versions.ts +49 -3
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/certificates.ts +252 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/index.ts +23 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels/tunnels.ts +347 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/tunnels.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/user-profiles.ts +76 -5
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/credentials.ts +347 -3
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/index.ts +17 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/vaults/vaults.ts +34 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/beta/webhooks.ts +762 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/completions.ts +18 -11
- package/node_modules/@anthropic-ai/sdk/src/resources/files.ts +163 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/index.ts +89 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/batches.ts +30 -12
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/index.ts +70 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/messages/messages.ts +2202 -226
- package/node_modules/@anthropic-ai/sdk/src/resources/skills/index.ts +21 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/skills/skills.ts +194 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/skills/versions.ts +160 -0
- package/node_modules/@anthropic-ai/sdk/src/resources/skills.ts +3 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/fs-util.ts +190 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/memories.ts +1017 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.browser.ts +172 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/node.ts +914 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/skills.ts +372 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/agent-toolset/sync-interval.ts +30 -0
- package/node_modules/@anthropic-ai/sdk/src/tools/memory/node.browser.ts +64 -0
- package/node_modules/@anthropic-ai/sdk/src/version.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/streaming.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/streaming.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/streaming.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/streaming.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.mts +75 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.ts +75 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js +196 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs +185 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/fs-util.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.mts +173 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.ts +173 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js +902 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs +895 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/memories.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts +82 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts +82 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js +151 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs +131 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.browser.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts +190 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts +190 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js +819 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs +797 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/node.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts +82 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts +82 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js +352 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs +344 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/skills.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.mts +19 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.ts +19 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.js +29 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs +25 -0
- package/node_modules/@anthropic-ai/sdk/tools/agent-toolset/sync-interval.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.mts +27 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.mts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.ts +27 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.d.ts.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.js +49 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.js.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.mjs +44 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.browser.mjs.map +1 -0
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/tools/memory/node.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/uploads.d.mts +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/uploads.d.ts +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/uploads.mjs +1 -0
- package/node_modules/@anthropic-ai/sdk/uploads.mjs.map +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.mts +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.mts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.ts +1 -1
- package/node_modules/@anthropic-ai/sdk/version.d.ts.map +1 -1
- package/node_modules/@anthropic-ai/sdk/version.js +1 -1
- package/node_modules/@anthropic-ai/sdk/version.js.map +1 -1
- package/node_modules/@anthropic-ai/sdk/version.mjs +1 -1
- package/node_modules/@anthropic-ai/sdk/version.mjs.map +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +12 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +3 -3
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/node_modules/@stablelib/base64/LICENSE +21 -0
- package/node_modules/@stablelib/base64/base64.bench.ts +25 -0
- package/node_modules/@stablelib/base64/base64.test.ts +85 -0
- package/node_modules/@stablelib/base64/base64.ts +283 -0
- package/node_modules/@stablelib/base64/lib/base64.bench.d.ts +1 -0
- package/node_modules/@stablelib/base64/lib/base64.bench.js +23 -0
- package/node_modules/@stablelib/base64/lib/base64.bench.js.map +1 -0
- package/node_modules/@stablelib/base64/lib/base64.d.ts +34 -0
- package/node_modules/@stablelib/base64/lib/base64.js +282 -0
- package/node_modules/@stablelib/base64/lib/base64.js.map +1 -0
- package/node_modules/@stablelib/base64/lib/base64.test.d.ts +1 -0
- package/node_modules/@stablelib/base64/lib/base64.test.js +82 -0
- package/node_modules/@stablelib/base64/lib/base64.test.js.map +1 -0
- package/node_modules/@stablelib/base64/package.json +25 -0
- package/node_modules/@stablelib/base64/tsconfig.json +27 -0
- package/node_modules/fast-sha256/LICENSE +24 -0
- package/node_modules/fast-sha256/README.md +127 -0
- package/node_modules/fast-sha256/package.json +42 -0
- package/node_modules/fast-sha256/sha256.d.ts +39 -0
- package/node_modules/fast-sha256/sha256.js +427 -0
- package/node_modules/fast-sha256/sha256.min.js +1 -0
- package/node_modules/standardwebhooks/README.md +41 -0
- package/node_modules/standardwebhooks/dist/index.d.ts +24 -0
- package/node_modules/standardwebhooks/dist/index.js +106 -0
- package/node_modules/standardwebhooks/dist/index.js.map +1 -0
- package/node_modules/standardwebhooks/dist/timing_safe_equal.d.ts +1 -0
- package/node_modules/standardwebhooks/dist/timing_safe_equal.js +30 -0
- package/node_modules/standardwebhooks/dist/timing_safe_equal.js.map +1 -0
- package/node_modules/standardwebhooks/package.json +45 -0
- package/package.json +17 -8
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.mts +0 -34
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.ts +0 -34
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/stainless-helper-header.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.mts +0 -132
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.mts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.ts +0 -132
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.d.ts.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.js +0 -294
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.js.map +0 -1
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.mjs +0 -290
- package/node_modules/@anthropic-ai/sdk/lib/tools/ToolRunner.mjs.map +0 -1
- package/node_modules/@anthropic-ai/sdk/src/lib/stainless-helper-header.ts +0 -80
- package/node_modules/@anthropic-ai/sdk/src/lib/tools/ToolRunner.ts +0 -381
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
import { AnthropicError, APIError } from '../../core/error';
|
|
2
|
+
import type { Anthropic } from '../../client';
|
|
3
|
+
import type { BetaSelfHostedWork, BetaWorkSecret } from '../../resources/beta/environments/work';
|
|
4
|
+
import { loggerFor, type Logger } from '../../internal/utils/log';
|
|
5
|
+
import { fromBase64 } from '../../internal/utils/base64';
|
|
6
|
+
import { decodeUTF8 } from '../../internal/utils/bytes';
|
|
7
|
+
import { readEnv } from '../../internal/utils/env';
|
|
8
|
+
import { sleep } from '../../internal/utils/sleep';
|
|
9
|
+
import { isFatal4xx, isStatus } from '../../internal/utils/backoff';
|
|
10
|
+
import { linkAbort } from '../../internal/utils/abort';
|
|
11
|
+
import { isObj } from '../../internal/utils/values';
|
|
12
|
+
import { buildHeaders } from '../../internal/headers';
|
|
13
|
+
import type { BetaRunnableTool } from '../tools/BetaRunnableTool';
|
|
14
|
+
import type { BetaToolRunnerRequestOptions } from '../tools/BetaToolRunner';
|
|
15
|
+
import { SessionToolRunner } from '../tools/SessionToolRunner';
|
|
16
|
+
import { WorkPoller } from './poller';
|
|
17
|
+
import { copyClientForHelper } from '../helper-client';
|
|
18
|
+
// `tools/agent-toolset/node` is Node-only (node:child_process, node:fs, …).
|
|
19
|
+
// Only the type is imported statically (erased at build); the module's values
|
|
20
|
+
// (`setupSkills`, `betaAgentToolset20260401`) are loaded lazily inside the
|
|
21
|
+
// per-item handler. That keeps this file free of Node-only deps in the static
|
|
22
|
+
// import graph, which is what lets `client.beta.environments.work.worker()`
|
|
23
|
+
// exist as a resource method without pulling Node built-ins into the SDK core.
|
|
24
|
+
import type { AgentToolContext, MemoryDeleteMode, SessionMemoryStores } from '../../tools/agent-toolset/node';
|
|
25
|
+
import { checkMemorySyncInterval } from '../../tools/agent-toolset/sync-interval';
|
|
26
|
+
import type { BetaManagedAgentsSession } from '../../resources/beta/sessions/sessions';
|
|
27
|
+
|
|
28
|
+
const HEARTBEAT_DEFAULT_MS = 30_000;
|
|
29
|
+
const HEARTBEAT_TTL_DEFAULT_MS = 90_000;
|
|
30
|
+
const NO_HEARTBEAT_SENTINEL = 'NO_HEARTBEAT';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Either a fixed tool array or a factory invoked once per claimed session with
|
|
34
|
+
* that session's {@link AgentToolContext} — use the factory form to bind
|
|
35
|
+
* `betaAgentToolset20260401` (or any tool that needs the workdir / session
|
|
36
|
+
* id) to the right session.
|
|
37
|
+
*/
|
|
38
|
+
export type EnvironmentWorkerTools =
|
|
39
|
+
| Array<BetaRunnableTool>
|
|
40
|
+
| ((ctx: AgentToolContext) => Array<BetaRunnableTool>);
|
|
41
|
+
|
|
42
|
+
export interface EnvironmentWorkerOptions {
|
|
43
|
+
client: Anthropic;
|
|
44
|
+
/**
|
|
45
|
+
* The self-hosted environment to poll for work. Required by
|
|
46
|
+
* {@link EnvironmentWorker.run}; not used by {@link EnvironmentWorker.handleItem}.
|
|
47
|
+
*/
|
|
48
|
+
environmentId?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The environment key — the worker's standing credential: polling always
|
|
51
|
+
* uses it, and per-session calls fall back to it when a claimed item's
|
|
52
|
+
* `secret` doesn't yield a sessions token. Required by
|
|
53
|
+
* {@link EnvironmentWorker.run}; falls back to `ANTHROPIC_ENVIRONMENT_KEY` in
|
|
54
|
+
* {@link EnvironmentWorker.handleItem}.
|
|
55
|
+
*/
|
|
56
|
+
environmentKey?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Tools to expose to each claimed session. Defaults to
|
|
59
|
+
* `betaAgentToolset20260401(ctx)` (the standard `agent_toolset_20260401` set
|
|
60
|
+
* bound to the per-session {@link AgentToolContext}).
|
|
61
|
+
*
|
|
62
|
+
* A `run` that blocks the event loop synchronously also stalls the lease
|
|
63
|
+
* heartbeat, and the worker can lose the lease; keep tools non-blocking (see
|
|
64
|
+
* {@link BetaRunnableTool.run}).
|
|
65
|
+
*/
|
|
66
|
+
tools?: EnvironmentWorkerTools;
|
|
67
|
+
/** Base directory for the per-session {@link AgentToolContext}. Defaults to `process.cwd()`. */
|
|
68
|
+
workdir?: string;
|
|
69
|
+
/**
|
|
70
|
+
* @deprecated No longer accepted: the file tools are always confined to
|
|
71
|
+
* `workdir` plus `allowedRoots`, which is neither behavior this flag used to
|
|
72
|
+
* select, so passing either value throws. Remove it; list extra directories
|
|
73
|
+
* in {@link AgentToolContext.allowedRoots}. The property is removed in a
|
|
74
|
+
* future release.
|
|
75
|
+
*/
|
|
76
|
+
unrestrictedPaths?: boolean;
|
|
77
|
+
/** Forwarded to the per-session {@link AgentToolContext} (`maxFileBytes`). */
|
|
78
|
+
maxFileBytes?: number | null;
|
|
79
|
+
/** Forwarded to {@link SessionToolRunner} (`maxIdleMs`). */
|
|
80
|
+
maxIdleMs?: number;
|
|
81
|
+
/**
|
|
82
|
+
* How often (milliseconds) to sync the session's attached memory stores back
|
|
83
|
+
* while it runs — checked after each dispatched tool call, plus one final
|
|
84
|
+
* sync when the session ends cleanly. Defaults to
|
|
85
|
+
* `DEFAULT_MEMORY_SYNC_INTERVAL_MS` (15s); the constructor throws for
|
|
86
|
+
* values below `MIN_MEMORY_SYNC_INTERVAL_MS` (5s). Every teardown also runs
|
|
87
|
+
* a push-only flush of changed files; that flush and the final sync are
|
|
88
|
+
* each bounded by `MEMORY_FLUSH_TIMEOUT_MS`, and a warning is logged when
|
|
89
|
+
* either bound cuts work off. `null` disables memory download and sync
|
|
90
|
+
* entirely. Memory stores are only touched for work items whose `secret`
|
|
91
|
+
* carries a `sessions_token`; while sync is enabled, an item without one
|
|
92
|
+
* fails when its session has memory stores attached, because those stores
|
|
93
|
+
* cannot be mounted without the token. With `null` the same item runs,
|
|
94
|
+
* without memory, and nothing is logged — turning sync off is the
|
|
95
|
+
* operator's explicit choice.
|
|
96
|
+
*/
|
|
97
|
+
memorySyncIntervalMs?: number | null;
|
|
98
|
+
/**
|
|
99
|
+
* Whether local file deletions may delete on the server — see
|
|
100
|
+
* {@link MemoryDeleteMode}. Uploads and pulls are unaffected.
|
|
101
|
+
* Defaults to `"enabled"`.
|
|
102
|
+
*/
|
|
103
|
+
memorySyncDeletions?: MemoryDeleteMode;
|
|
104
|
+
/** Forwarded to the {@link WorkPoller}. */
|
|
105
|
+
workerId?: string;
|
|
106
|
+
/** External abort signal; aborting it ends the run. */
|
|
107
|
+
signal?: AbortSignal;
|
|
108
|
+
/**
|
|
109
|
+
* Extra per-request options merged into every call this worker issues — the
|
|
110
|
+
* work poll/ack/heartbeat/stop control-plane calls and the per-session
|
|
111
|
+
* SessionToolRunner's stream/list/send. Mirrors what
|
|
112
|
+
* `client.beta.messages.toolRunner` accepts: custom `headers` (e.g. a proxy's
|
|
113
|
+
* auth/routing headers) reach all of them. The worker owns the abort signals,
|
|
114
|
+
* so a `signal` here is ignored — use {@link EnvironmentWorkerOptions.signal}.
|
|
115
|
+
*/
|
|
116
|
+
requestOptions?: BetaToolRunnerRequestOptions;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Options for {@link EnvironmentWorker.handleItem}. Every field falls back to the
|
|
121
|
+
* matching `ANTHROPIC_*` environment variable — the ones the
|
|
122
|
+
* `ant worker poll --on-work` command sets for the process it spawns — when not
|
|
123
|
+
* passed explicitly.
|
|
124
|
+
*/
|
|
125
|
+
export interface HandleItemOptions {
|
|
126
|
+
/** Work item id. Falls back to `ANTHROPIC_WORK_ID`. */
|
|
127
|
+
workId?: string;
|
|
128
|
+
/** Self-hosted environment id. Falls back to `ANTHROPIC_ENVIRONMENT_ID`. */
|
|
129
|
+
environmentId?: string;
|
|
130
|
+
/** Session id. Falls back to `ANTHROPIC_SESSION_ID`. */
|
|
131
|
+
sessionId?: string;
|
|
132
|
+
/**
|
|
133
|
+
* The environment key used to authenticate every per-session call. Resolution
|
|
134
|
+
* order: this option, then the worker's own `environmentKey`, then
|
|
135
|
+
* `ANTHROPIC_ENVIRONMENT_KEY`.
|
|
136
|
+
*/
|
|
137
|
+
environmentKey?: string;
|
|
138
|
+
/**
|
|
139
|
+
* The work item's per-item `secret` payload from the poll response. Falls
|
|
140
|
+
* back to `ANTHROPIC_WORK_SECRET`. Unlike the others it is optional — when
|
|
141
|
+
* present, the sessions token extracted from it is preferred as the Bearer
|
|
142
|
+
* credential for this item's heartbeat / force-stop / skill-download /
|
|
143
|
+
* session calls; when absent (or undecodable) those calls use the
|
|
144
|
+
* environment key.
|
|
145
|
+
*/
|
|
146
|
+
workSecret?: string;
|
|
147
|
+
/** External abort signal; aborting it ends the run. Defaults to the constructor's signal. */
|
|
148
|
+
signal?: AbortSignal;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The fields of {@link BetaSelfHostedWork} the per-item flow reads. `secret` is
|
|
153
|
+
* declared here rather than picked because the generated model does not carry
|
|
154
|
+
* it — only the poll response populates it.
|
|
155
|
+
*/
|
|
156
|
+
type ClaimedWork = Pick<BetaSelfHostedWork, 'id' | 'environment_id' | 'data'> & {
|
|
157
|
+
secret?: string | null;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/** True when the session has at least one memory store attached. */
|
|
161
|
+
function hasMemoryStore(session: BetaManagedAgentsSession): boolean {
|
|
162
|
+
return session.resources.some((r) => r.type === 'memory_store');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Extract the per-item sessions token from a work item's `secret` payload.
|
|
167
|
+
*
|
|
168
|
+
* The `secret` the poll response populates is not itself a credential: it is a
|
|
169
|
+
* URL-safe base64 JSON payload matching {@link BetaWorkSecret} — the
|
|
170
|
+
* `sessions_token` (the bearer for this item's work lifecycle and
|
|
171
|
+
* session-level calls) plus fields this worker does not consume. Returns the
|
|
172
|
+
* sessions token, or `null` (meaning: fall back to the environment key) when
|
|
173
|
+
* the payload is missing, doesn't decode, or carries no token. Never log the
|
|
174
|
+
* payload or anything extracted from it.
|
|
175
|
+
*/
|
|
176
|
+
export function sessionsTokenFromSecret(secret: string | null | undefined): string | null {
|
|
177
|
+
if (!secret) return null;
|
|
178
|
+
let parsed: unknown;
|
|
179
|
+
try {
|
|
180
|
+
// The payload may arrive URL-safe and without base64 padding; normalize
|
|
181
|
+
// both before decoding.
|
|
182
|
+
const normalized = secret.replace(/-/g, '+').replace(/_/g, '/');
|
|
183
|
+
const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, '=');
|
|
184
|
+
parsed = JSON.parse(decodeUTF8(fromBase64(padded)));
|
|
185
|
+
} catch {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) return null;
|
|
189
|
+
// The payload is untrusted input, so the token is still checked at runtime
|
|
190
|
+
// rather than trusted to match the schema.
|
|
191
|
+
const token = (parsed as Partial<BetaWorkSecret>).sessions_token;
|
|
192
|
+
return typeof token === 'string' && token !== '' ? token : null;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The self-hosted environment runner, composed from the control-plane
|
|
197
|
+
* {@link WorkPoller} and the per-session {@link SessionToolRunner}.
|
|
198
|
+
*
|
|
199
|
+
* For each claimed `session` work item it: builds the per-session
|
|
200
|
+
* {@link AgentToolContext}, downloads the session agent's skills
|
|
201
|
+
* (`setupSkills`), then runs a {@link SessionToolRunner} for the session
|
|
202
|
+
* while heartbeating the work-item lease on the same event loop; on exit it
|
|
203
|
+
* force-stops the work item (unless the lease was lost, in which case the item
|
|
204
|
+
* is left to whoever holds it now), cleans up the downloaded skills, and loops
|
|
205
|
+
* to the next one. The lease heartbeat reports `state === "stopping"` / a lost
|
|
206
|
+
* lease back into the run by aborting the session runner.
|
|
207
|
+
*
|
|
208
|
+
* The `environmentKey` is the worker's standing credential. When a claimed
|
|
209
|
+
* work item carries a per-item `secret` (a short-lived payload the poll
|
|
210
|
+
* response may populate), the sessions token extracted from it is preferred
|
|
211
|
+
* over the environment key for that item's heartbeat / force-stop /
|
|
212
|
+
* skill-download / session calls; polling itself always uses the environment
|
|
213
|
+
* key, and items without a usable secret fall back to it entirely.
|
|
214
|
+
*
|
|
215
|
+
* Use {@link EnvironmentWorker.handleItem} if you already hold a claimed work
|
|
216
|
+
* item (e.g. a `worker poll --on-work` script handed one to a fresh process) and
|
|
217
|
+
* just want the per-item flow without the poll loop — with no arguments it reads
|
|
218
|
+
* the `ANTHROPIC_*` env vars that command sets.
|
|
219
|
+
*
|
|
220
|
+
* Construct it via `client.beta.environments.work.worker({ ... })` (or
|
|
221
|
+
* `new EnvironmentWorker({ client, ... })` directly).
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```ts
|
|
225
|
+
* // Long-running daemon: poll for work, serve each session, loop.
|
|
226
|
+
* await client.beta.environments.work
|
|
227
|
+
* .worker({ environmentId, environmentKey, workdir: '/workspace' })
|
|
228
|
+
* .run(AbortSignal.timeout(60 * 60_000));
|
|
229
|
+
*
|
|
230
|
+
* // Already-claimed item (e.g. inside `ant worker poll --on-work ...`):
|
|
231
|
+
* await client.beta.environments.work.worker({ workdir: '/workspace' }).handleItem();
|
|
232
|
+
* ```
|
|
233
|
+
*/
|
|
234
|
+
export class EnvironmentWorker {
|
|
235
|
+
readonly client: Anthropic;
|
|
236
|
+
readonly environmentId: string | undefined;
|
|
237
|
+
readonly environmentKey: string | undefined;
|
|
238
|
+
readonly tools: EnvironmentWorkerTools | undefined;
|
|
239
|
+
readonly workdir: string;
|
|
240
|
+
/** @deprecated Never set; see {@link EnvironmentWorkerOptions.unrestrictedPaths}. */
|
|
241
|
+
readonly unrestrictedPaths: boolean | undefined;
|
|
242
|
+
readonly maxFileBytes: number | null | undefined;
|
|
243
|
+
readonly maxIdleMs: number | undefined;
|
|
244
|
+
readonly memorySyncIntervalMs: number | null | undefined;
|
|
245
|
+
readonly memorySyncDeletions: MemoryDeleteMode;
|
|
246
|
+
readonly workerId: string | undefined;
|
|
247
|
+
readonly requestOptions: BetaToolRunnerRequestOptions | undefined;
|
|
248
|
+
readonly #signal: AbortSignal | undefined;
|
|
249
|
+
|
|
250
|
+
constructor(opts: Omit<EnvironmentWorkerOptions, 'unrestrictedPaths'>);
|
|
251
|
+
/** @deprecated `unrestrictedPaths` is no longer accepted — see {@link EnvironmentWorkerOptions.unrestrictedPaths}. */
|
|
252
|
+
constructor(opts: Omit<EnvironmentWorkerOptions, 'unrestrictedPaths'> & { unrestrictedPaths: boolean }); // help language servers see deprecation
|
|
253
|
+
constructor(opts: EnvironmentWorkerOptions) {
|
|
254
|
+
if (opts.unrestrictedPaths !== undefined) {
|
|
255
|
+
throw new AnthropicError(
|
|
256
|
+
'The `unrestrictedPaths` option you passed to EnvironmentWorker (or ' +
|
|
257
|
+
'client.beta.environments.work.worker()) is no longer supported. ' +
|
|
258
|
+
"The worker's file tools (read, write, edit, glob, grep) are now always confined to `workdir` " +
|
|
259
|
+
"plus the session's memory folders. Remove `unrestrictedPaths` from your options; to let the " +
|
|
260
|
+
'file tools reach any other directory, add it to `AgentToolContext.allowedRoots` from a ' +
|
|
261
|
+
'`tools` factory.',
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
this.client = opts.client;
|
|
265
|
+
this.environmentId = opts.environmentId;
|
|
266
|
+
this.environmentKey = opts.environmentKey;
|
|
267
|
+
this.tools = opts.tools;
|
|
268
|
+
this.workdir = opts.workdir ?? process.cwd();
|
|
269
|
+
this.maxFileBytes = opts.maxFileBytes;
|
|
270
|
+
this.maxIdleMs = opts.maxIdleMs;
|
|
271
|
+
if (opts.memorySyncIntervalMs != null) {
|
|
272
|
+
checkMemorySyncInterval(opts.memorySyncIntervalMs, 'memorySyncIntervalMs');
|
|
273
|
+
}
|
|
274
|
+
this.memorySyncIntervalMs = opts.memorySyncIntervalMs;
|
|
275
|
+
this.memorySyncDeletions = opts.memorySyncDeletions ?? 'enabled';
|
|
276
|
+
this.workerId = opts.workerId;
|
|
277
|
+
this.requestOptions = opts.requestOptions;
|
|
278
|
+
this.#signal = opts.signal;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Poll the environment and service each claimed session until the supplied
|
|
283
|
+
* signal (or the one passed to the constructor) aborts. Throws if
|
|
284
|
+
* `environmentId` / `environmentKey` were not provided to the constructor.
|
|
285
|
+
*/
|
|
286
|
+
async run(signal?: AbortSignal): Promise<void> {
|
|
287
|
+
const { environmentId, environmentKey } = this;
|
|
288
|
+
if (environmentId === undefined || environmentKey === undefined) {
|
|
289
|
+
throw new AnthropicError(
|
|
290
|
+
'EnvironmentWorker.run: environmentId and environmentKey are required to poll for work',
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
const externalSignal = signal ?? this.#signal;
|
|
294
|
+
const poller = new WorkPoller({
|
|
295
|
+
client: this.client,
|
|
296
|
+
environmentId,
|
|
297
|
+
environmentKey,
|
|
298
|
+
...(this.workerId !== undefined ? { workerId: this.workerId } : {}),
|
|
299
|
+
...(externalSignal ? { signal: externalSignal } : {}),
|
|
300
|
+
...(this.requestOptions !== undefined ? { requestOptions: this.requestOptions } : {}),
|
|
301
|
+
// The per-item handler stops or releases every work item on exit; let it
|
|
302
|
+
// be the single owner of `work.stop` rather than double-posting from the
|
|
303
|
+
// poller.
|
|
304
|
+
autoStop: false,
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
for await (const work of poller) {
|
|
308
|
+
try {
|
|
309
|
+
await this.#handleItem(work, environmentKey, poller.signal);
|
|
310
|
+
} catch (e) {
|
|
311
|
+
// One bad item fails that item, not the worker: the handler's teardown
|
|
312
|
+
// already stopped or released it, so the next poll claims the next
|
|
313
|
+
// item. A store directory left behind by a killed worker would
|
|
314
|
+
// otherwise crashloop this process forever.
|
|
315
|
+
if (poller.signal?.aborted) throw e;
|
|
316
|
+
loggerFor(this.client).error('work item failed', { work_id: work.id, error: String(e) });
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Service a single, already-claimed work item without the poll loop: build the
|
|
323
|
+
* per-session {@link AgentToolContext} (workdir from this worker's options),
|
|
324
|
+
* download the session agent's skills (`setupSkills`), run a
|
|
325
|
+
* {@link SessionToolRunner} for the session while heartbeating the work-item
|
|
326
|
+
* lease, and force-stop the work item on exit (whether the runner finishes
|
|
327
|
+
* normally, throws, or the control plane signals shutdown). The one
|
|
328
|
+
* exception is a lost lease: the item then belongs to the queue or another
|
|
329
|
+
* worker and is left alone.
|
|
330
|
+
*
|
|
331
|
+
* Use this when something else does the claiming — e.g. a `worker poll
|
|
332
|
+
* --on-work` script that hands an already-claimed item to a fresh process. The
|
|
333
|
+
* work id / environment id / session id each fall back to `ANTHROPIC_WORK_ID` /
|
|
334
|
+
* `ANTHROPIC_ENVIRONMENT_ID` / `ANTHROPIC_SESSION_ID` (the env vars that
|
|
335
|
+
* command sets) when not passed; the environment key resolves from this
|
|
336
|
+
* option, then the worker's own `environmentKey`, then
|
|
337
|
+
* `ANTHROPIC_ENVIRONMENT_KEY`. With no arguments inside that command it just
|
|
338
|
+
* works. Throws a clear error naming the first of the four required values
|
|
339
|
+
* still missing after resolution. Throws `SessionMemoryError` when the
|
|
340
|
+
* session has memory stores attached but they cannot be mounted — the work
|
|
341
|
+
* item carried no sessions token (unless `memorySyncIntervalMs` turned
|
|
342
|
+
* memory off), or a store failed to download.
|
|
343
|
+
*
|
|
344
|
+
* `workSecret` is the work item's per-item `secret` payload from the poll
|
|
345
|
+
* response, falling back to `ANTHROPIC_WORK_SECRET`; unlike the others it is
|
|
346
|
+
* optional — when present, the sessions token extracted from it is preferred
|
|
347
|
+
* as the Bearer credential for this item's heartbeat / force-stop / session
|
|
348
|
+
* calls; when absent (or undecodable) those calls use the environment key.
|
|
349
|
+
*/
|
|
350
|
+
async handleItem(opts?: HandleItemOptions): Promise<void> {
|
|
351
|
+
const workId = opts?.workId ?? readEnv('ANTHROPIC_WORK_ID');
|
|
352
|
+
const environmentId = opts?.environmentId ?? readEnv('ANTHROPIC_ENVIRONMENT_ID');
|
|
353
|
+
const sessionId = opts?.sessionId ?? readEnv('ANTHROPIC_SESSION_ID');
|
|
354
|
+
const environmentKey =
|
|
355
|
+
opts?.environmentKey ?? this.environmentKey ?? readEnv('ANTHROPIC_ENVIRONMENT_KEY');
|
|
356
|
+
// `||` rather than `??` so an empty option still falls through to the env
|
|
357
|
+
// var and then to null (matching how `readEnv` treats empty values).
|
|
358
|
+
const workSecret = opts?.workSecret || readEnv('ANTHROPIC_WORK_SECRET') || null;
|
|
359
|
+
|
|
360
|
+
if (!workId) {
|
|
361
|
+
throw new AnthropicError('handleItem: workId is required — pass it or set ANTHROPIC_WORK_ID');
|
|
362
|
+
}
|
|
363
|
+
if (!environmentId) {
|
|
364
|
+
throw new AnthropicError(
|
|
365
|
+
'handleItem: environmentId is required — pass it or set ANTHROPIC_ENVIRONMENT_ID',
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
if (!sessionId) {
|
|
369
|
+
throw new AnthropicError('handleItem: sessionId is required — pass it or set ANTHROPIC_SESSION_ID');
|
|
370
|
+
}
|
|
371
|
+
if (!environmentKey) {
|
|
372
|
+
throw new AnthropicError(
|
|
373
|
+
'handleItem: environmentKey is required — pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY',
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
const work: ClaimedWork = {
|
|
378
|
+
id: workId,
|
|
379
|
+
environment_id: environmentId,
|
|
380
|
+
secret: workSecret,
|
|
381
|
+
data: { type: 'session', id: sessionId },
|
|
382
|
+
};
|
|
383
|
+
await this.#handleItem(work, environmentKey, opts?.signal ?? this.#signal);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* The per-item body shared by {@link EnvironmentWorker.run}'s poll loop and
|
|
388
|
+
* {@link EnvironmentWorker.handleItem}: run a {@link SessionToolRunner} for the
|
|
389
|
+
* work item's session while heartbeating its lease, force-stopping on exit
|
|
390
|
+
* unless the lease was lost. Non-session work items are ignored.
|
|
391
|
+
*
|
|
392
|
+
* When the poll response carried a per-item `secret` (a short-lived payload
|
|
393
|
+
* scoped to this work item), the sessions token extracted from it is
|
|
394
|
+
* preferred over `environmentKey` as the Bearer credential for those
|
|
395
|
+
* per-item calls; a missing/undecodable secret falls back to
|
|
396
|
+
* `environmentKey` unchanged.
|
|
397
|
+
*/
|
|
398
|
+
async #handleItem(
|
|
399
|
+
work: ClaimedWork,
|
|
400
|
+
environmentKey: string,
|
|
401
|
+
externalSignal: AbortSignal | undefined,
|
|
402
|
+
): Promise<void> {
|
|
403
|
+
const log = loggerFor(this.client);
|
|
404
|
+
// The per-item credential: the sessions token carried inside the work
|
|
405
|
+
// item's secret payload when the server issued one, otherwise the
|
|
406
|
+
// environment key. Never log this value.
|
|
407
|
+
const sessionsToken = sessionsTokenFromSecret(work.secret);
|
|
408
|
+
if (work.secret && sessionsToken === null) {
|
|
409
|
+
log.warn(
|
|
410
|
+
'work item carried a secret payload but no sessions token could be extracted; ' +
|
|
411
|
+
'falling back to the environment key',
|
|
412
|
+
{ work_id: work.id },
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
const itemCredential = sessionsToken ?? environmentKey;
|
|
416
|
+
// Every per-session call — the SessionToolRunner event stream/list/send, the
|
|
417
|
+
// lease heartbeat, the skill download, and the work force-stop —
|
|
418
|
+
// authenticates with the per-item credential. Scope a client to it once and
|
|
419
|
+
// thread that through. `copyClientForHelper` also clears the parent's
|
|
420
|
+
// `apiKey`, so the sub-client emits *only* the bearer credential on the
|
|
421
|
+
// wire (a plain `withOptions({authToken})` would leave `X-Api-Key` set as
|
|
422
|
+
// well).
|
|
423
|
+
const sessionClient = copyClientForHelper(this.client, {
|
|
424
|
+
authToken: itemCredential,
|
|
425
|
+
helper: 'environments-worker',
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
// The poller runs with `autoStop: false`, so the per-item handler is the
|
|
429
|
+
// single owner of `work.stop` for every claimed item.
|
|
430
|
+
const sessionId = work.data.id;
|
|
431
|
+
|
|
432
|
+
// A per-session controller: aborts when the supplied signal aborts, when the
|
|
433
|
+
// session runner finishes, or when the lease heartbeat says to stop.
|
|
434
|
+
const ctrl = new AbortController();
|
|
435
|
+
const detachExternal = linkAbort(externalSignal, ctrl);
|
|
436
|
+
const lease = new Lease(ctrl);
|
|
437
|
+
|
|
438
|
+
// Lazily load the Node-only toolset module — see the import note at the top.
|
|
439
|
+
const agentToolset = await import('../../tools/agent-toolset/node');
|
|
440
|
+
|
|
441
|
+
// Start the lease heartbeat BEFORE the session fetch and the skill /
|
|
442
|
+
// memory downloads: those can take longer than the lease TTL, and an
|
|
443
|
+
// unheartbeated lease lapsing mid-download would let another worker
|
|
444
|
+
// reclaim the item and serve the same session (split-brain).
|
|
445
|
+
//
|
|
446
|
+
// Each heartbeat reports the lease TTL the server is enforcing; it becomes
|
|
447
|
+
// the runner's tool-result send retry window so a send keeps retrying
|
|
448
|
+
// exactly as long as the lease could still be live. The runner is only
|
|
449
|
+
// built after the downloads, so hold the latest TTL until then.
|
|
450
|
+
let leaseTtlMs: number | undefined;
|
|
451
|
+
let runner: SessionToolRunner | undefined;
|
|
452
|
+
const heartbeatPromise = heartbeatLoop(sessionClient, work, lease, log, this.requestOptions, (ttlMs) => {
|
|
453
|
+
leaseTtlMs = ttlMs;
|
|
454
|
+
runner?._setSendRetryWindow(ttlMs);
|
|
455
|
+
}).catch((e) => {
|
|
456
|
+
if (!ctrl.signal.aborted) log.error('heartbeat loop failed', { work_id: work.id, error: String(e) });
|
|
457
|
+
ctrl.abort();
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
let cleanupSkills: () => Promise<void> = async () => {};
|
|
461
|
+
let stores: SessionMemoryStores | undefined;
|
|
462
|
+
let cleanEnd = false;
|
|
463
|
+
try {
|
|
464
|
+
if (work.data.type !== 'session') {
|
|
465
|
+
log.debug('skipping non-session work item', { work_id: work.id, type: work.data.type });
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
// One session fetch, shared by the skills download and the memory-store
|
|
469
|
+
// download — two fetches could disagree about the attached resources.
|
|
470
|
+
// A failed fetch fails the work item (the teardown below still stops
|
|
471
|
+
// or releases it).
|
|
472
|
+
const session: BetaManagedAgentsSession = await sessionClient.beta.sessions.retrieve(sessionId);
|
|
473
|
+
// Only with the session in hand can we tell one that simply has no
|
|
474
|
+
// memory from one whose memory we cannot mount. Turning memory off
|
|
475
|
+
// with the interval knob is a deliberate opt-out and stays quiet.
|
|
476
|
+
if (sessionsToken === null && this.memorySyncIntervalMs !== null && hasMemoryStore(session)) {
|
|
477
|
+
throw new agentToolset.SessionMemoryError(
|
|
478
|
+
`cannot mount the session's memories: the work item carried no sessions token ` +
|
|
479
|
+
`(work_id=${work.id}, session_id=${sessionId}); ` +
|
|
480
|
+
'the memory endpoints reject the environment key, so the poller must issue a per-item ' +
|
|
481
|
+
'`secret` carrying `sessions_token`, or set `memorySyncIntervalMs: null` to run without memory',
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
const ctx: AgentToolContext = {
|
|
486
|
+
workdir: this.workdir,
|
|
487
|
+
// The scoped sub-client, not the parent: the skill download
|
|
488
|
+
// `setupSkills` performs for this session rides the same per-item
|
|
489
|
+
// credential as every other per-item call.
|
|
490
|
+
client: sessionClient,
|
|
491
|
+
session,
|
|
492
|
+
...(this.maxFileBytes !== undefined ? { maxFileBytes: this.maxFileBytes } : {}),
|
|
493
|
+
};
|
|
494
|
+
try {
|
|
495
|
+
cleanupSkills = await agentToolset.setupSkills(ctx);
|
|
496
|
+
} catch (e) {
|
|
497
|
+
log.warn('skill setup failed', { session_id: sessionId, work_id: work.id, error: String(e) });
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
// Memory stores: the memory_stores endpoints accept the per-item sessions
|
|
501
|
+
// token but reject the environment key, so download and sync only run when
|
|
502
|
+
// the item carried a usable secret (and the interval is set).
|
|
503
|
+
// `sessionClient` is already scoped to that token then, so the memory
|
|
504
|
+
// calls ride the same sub-client. A store that cannot be materialised
|
|
505
|
+
// throws `SessionMemoryError` out of `download` and fails the item.
|
|
506
|
+
if (sessionsToken !== null && this.memorySyncIntervalMs !== null) {
|
|
507
|
+
stores = new agentToolset.SessionMemoryStores(sessionClient, {
|
|
508
|
+
workdir: this.workdir,
|
|
509
|
+
...(this.memorySyncIntervalMs !== undefined ? { syncIntervalMs: this.memorySyncIntervalMs } : {}),
|
|
510
|
+
syncDeletions: this.memorySyncDeletions,
|
|
511
|
+
});
|
|
512
|
+
await stores.download(session);
|
|
513
|
+
// A store mounted outside the workdir must stay reachable by the file
|
|
514
|
+
// tools; read-only stores still refuse writes.
|
|
515
|
+
ctx.allowedRoots = stores.roots;
|
|
516
|
+
ctx.readOnlyRoots = stores.readOnlyRoots;
|
|
517
|
+
} else {
|
|
518
|
+
log.debug('memory stores disabled for this item', { work_id: work.id });
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
const tools =
|
|
522
|
+
typeof this.tools === 'function' ?
|
|
523
|
+
this.tools(ctx)
|
|
524
|
+
: this.tools ?? agentToolset.betaAgentToolset20260401(ctx);
|
|
525
|
+
|
|
526
|
+
runner = new SessionToolRunner(sessionId, {
|
|
527
|
+
client: sessionClient,
|
|
528
|
+
tools,
|
|
529
|
+
...(this.maxIdleMs !== undefined ? { maxIdleMs: this.maxIdleMs } : {}),
|
|
530
|
+
...(this.requestOptions !== undefined ? { requestOptions: this.requestOptions } : {}),
|
|
531
|
+
signal: ctrl.signal,
|
|
532
|
+
});
|
|
533
|
+
if (leaseTtlMs !== undefined) runner._setSendRetryWindow(leaseTtlMs);
|
|
534
|
+
for await (const _ of runner) {
|
|
535
|
+
// Drive the runner to completion; per-call observability is not part
|
|
536
|
+
// of this composition's surface — use `SessionToolRunner` directly
|
|
537
|
+
// (via `client.beta.sessions.events.toolRunner`) if you want it.
|
|
538
|
+
if (stores) await stores.syncIfDue();
|
|
539
|
+
}
|
|
540
|
+
// Only a clean stream end earns the last full sync; it runs in the
|
|
541
|
+
// teardown below.
|
|
542
|
+
cleanEnd = !ctrl.signal.aborted;
|
|
543
|
+
} finally {
|
|
544
|
+
// The heartbeat keeps the lease alive until this teardown is done.
|
|
545
|
+
try {
|
|
546
|
+
// cleanupSkills first, so its failure cannot skip the memory flush.
|
|
547
|
+
await cleanupSkills().catch((e) => {
|
|
548
|
+
log.warn('skill cleanup failed', { session_id: sessionId, work_id: work.id, error: String(e) });
|
|
549
|
+
});
|
|
550
|
+
} finally {
|
|
551
|
+
if (stores) {
|
|
552
|
+
const boundMs = agentToolset.MEMORY_FLUSH_TIMEOUT_MS;
|
|
553
|
+
if (cleanEnd) {
|
|
554
|
+
const finishCutOff = await withTimeout(stores.finish(), boundMs);
|
|
555
|
+
if (finishCutOff) {
|
|
556
|
+
log.warn(
|
|
557
|
+
`final memory sync cut off after ${boundMs}ms; the flush that follows still uploads changed files`,
|
|
558
|
+
{ session_id: sessionId, work_id: work.id },
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
// Also after finish(): it swallows its own failures, and a
|
|
563
|
+
// clean flush is a no-op.
|
|
564
|
+
const flushBound = new AbortController();
|
|
565
|
+
const flushCutOff = await withTimeout(stores.flushWrites(flushBound.signal), boundMs);
|
|
566
|
+
if (flushCutOff) {
|
|
567
|
+
flushBound.abort();
|
|
568
|
+
log.warn(
|
|
569
|
+
`memory flush cut off after ${boundMs}ms; changed files it had not uploaded yet are not saved`,
|
|
570
|
+
{ session_id: sessionId, work_id: work.id },
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
await stores.dispose().catch((e) => {
|
|
574
|
+
log.warn('memory store cleanup failed', {
|
|
575
|
+
session_id: sessionId,
|
|
576
|
+
work_id: work.id,
|
|
577
|
+
error: String(e),
|
|
578
|
+
});
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
lease.finish('runner_done');
|
|
583
|
+
detachExternal();
|
|
584
|
+
await heartbeatPromise;
|
|
585
|
+
// Stop only an item this worker still holds — after a lost lease it
|
|
586
|
+
// belongs to the queue or another worker.
|
|
587
|
+
if (lease.lost) {
|
|
588
|
+
log.info('lease lost; released without stopping it', { session_id: sessionId, work_id: work.id });
|
|
589
|
+
} else {
|
|
590
|
+
await forceStop(sessionClient, work, log, this.requestOptions);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Resolve when `p` settles or `ms` elapses — `true` when `ms` elapsed
|
|
598
|
+
* first. A timed-out `p` keeps running — JS cannot cancel a promise.
|
|
599
|
+
*/
|
|
600
|
+
async function withTimeout(p: Promise<void>, ms: number): Promise<boolean> {
|
|
601
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
602
|
+
try {
|
|
603
|
+
return await Promise.race([
|
|
604
|
+
p.then(
|
|
605
|
+
() => false,
|
|
606
|
+
() => false,
|
|
607
|
+
),
|
|
608
|
+
new Promise<boolean>((resolve) => {
|
|
609
|
+
timer = setTimeout(() => resolve(true), ms);
|
|
610
|
+
}),
|
|
611
|
+
]);
|
|
612
|
+
} finally {
|
|
613
|
+
if (timer !== undefined) clearTimeout(timer);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
/** Force-stop a claimed work item, swallowing the 409 that means it's already stopped. */
|
|
618
|
+
async function forceStop(
|
|
619
|
+
client: Anthropic,
|
|
620
|
+
work: Pick<BetaSelfHostedWork, 'id' | 'environment_id'>,
|
|
621
|
+
log: Logger,
|
|
622
|
+
requestOptions?: BetaToolRunnerRequestOptions,
|
|
623
|
+
): Promise<void> {
|
|
624
|
+
try {
|
|
625
|
+
await client.beta.environments.work.stop(
|
|
626
|
+
work.id,
|
|
627
|
+
{ environment_id: work.environment_id, force: true },
|
|
628
|
+
// Caller's headers pass through; the helper-tag header is on the scoped
|
|
629
|
+
// sub-client's default_headers via copyClientForHelper, so no per-call
|
|
630
|
+
// re-stamping needed.
|
|
631
|
+
{ ...requestOptions, headers: buildHeaders([requestOptions?.headers]) },
|
|
632
|
+
);
|
|
633
|
+
} catch (e) {
|
|
634
|
+
if (!isStatus(e, 409)) {
|
|
635
|
+
log.error('force-stop on exit failed', { work_id: work.id, error: String(e) });
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/** Why heartbeating of a work item ended, as recorded on its {@link Lease}. */
|
|
641
|
+
type LeaseEndReason =
|
|
642
|
+
| 'runner_done'
|
|
643
|
+
| 'control_plane_stop'
|
|
644
|
+
| 'lease_lost'
|
|
645
|
+
| 'heartbeat_rejected'
|
|
646
|
+
| 'assumed_lost';
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* This worker's view of one work-item lease: the per-item abort signal plus
|
|
650
|
+
* why heartbeating ended. The first recorded reason wins, so a run aborted
|
|
651
|
+
* *because* the lease was lost still reads as lost afterwards; an abort with
|
|
652
|
+
* no recorded reason (the external signal) is not lost.
|
|
653
|
+
*/
|
|
654
|
+
class Lease {
|
|
655
|
+
readonly #ctrl: AbortController;
|
|
656
|
+
#endReason: LeaseEndReason | undefined;
|
|
657
|
+
|
|
658
|
+
constructor(ctrl: AbortController) {
|
|
659
|
+
this.#ctrl = ctrl;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
get signal(): AbortSignal {
|
|
663
|
+
return this.#ctrl.signal;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
finish(reason: LeaseEndReason): void {
|
|
667
|
+
this.#endReason ??= reason;
|
|
668
|
+
this.#ctrl.abort();
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/** True once the item belongs to the queue or another worker. */
|
|
672
|
+
get lost(): boolean {
|
|
673
|
+
return this.#endReason === 'lease_lost' || this.#endReason === 'assumed_lost';
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/** The server's view of the lease carried by a 412 heartbeat response, or empty if absent. */
|
|
678
|
+
function serverLeaseState(e: unknown): Record<string, unknown> {
|
|
679
|
+
let node: unknown = e instanceof APIError ? e.error : undefined;
|
|
680
|
+
for (const key of ['error', 'details', 'current_state']) {
|
|
681
|
+
if (!isObj(node)) return {};
|
|
682
|
+
node = node[key];
|
|
683
|
+
}
|
|
684
|
+
return isObj(node) ? node : {};
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Keep the work-item lease alive while a session is being served. Runs until
|
|
689
|
+
* `lease` ends, and ends it itself when the control plane reports the work is
|
|
690
|
+
* `stopping`/`stopped` or no longer extends the lease, when a heartbeat is
|
|
691
|
+
* rejected (a 412 means the lease already belongs to someone else), or when no
|
|
692
|
+
* heartbeat has succeeded for longer than the lease ttl (the lease is assumed
|
|
693
|
+
* lost, so two runners don't end up serving the same work). Each heartbeat
|
|
694
|
+
* call is cut off after the current beat interval so a hung request cannot
|
|
695
|
+
* outlive the lease it is meant to renew.
|
|
696
|
+
*/
|
|
697
|
+
async function heartbeatLoop(
|
|
698
|
+
client: Anthropic,
|
|
699
|
+
work: Pick<BetaSelfHostedWork, 'id' | 'environment_id'>,
|
|
700
|
+
lease: Lease,
|
|
701
|
+
logger: Logger,
|
|
702
|
+
requestOptions?: BetaToolRunnerRequestOptions,
|
|
703
|
+
/** Called with the server-reported lease TTL after every successful beat. */
|
|
704
|
+
onLeaseTtl?: (ttlMs: number) => void,
|
|
705
|
+
): Promise<void> {
|
|
706
|
+
let intervalMs = HEARTBEAT_DEFAULT_MS;
|
|
707
|
+
let ttlMs = HEARTBEAT_TTL_DEFAULT_MS;
|
|
708
|
+
let lastSuccessMs = Date.now();
|
|
709
|
+
let last = NO_HEARTBEAT_SENTINEL;
|
|
710
|
+
const beat = async (): Promise<void> => {
|
|
711
|
+
// Not the request `timeout` option: the core client retries timeouts, so
|
|
712
|
+
// it would not bound the call as a whole.
|
|
713
|
+
const beatCtrl = new AbortController();
|
|
714
|
+
const detach = linkAbort(lease.signal, beatCtrl);
|
|
715
|
+
const cutoff = setTimeout(() => beatCtrl.abort(), intervalMs);
|
|
716
|
+
try {
|
|
717
|
+
const resp = await client.beta.environments.work.heartbeat(
|
|
718
|
+
work.id,
|
|
719
|
+
{ environment_id: work.environment_id, expected_last_heartbeat: last },
|
|
720
|
+
{ ...requestOptions, headers: buildHeaders([requestOptions?.headers]), signal: beatCtrl.signal },
|
|
721
|
+
);
|
|
722
|
+
lastSuccessMs = Date.now();
|
|
723
|
+
last = resp.last_heartbeat;
|
|
724
|
+
if (resp.ttl_seconds > 0) {
|
|
725
|
+
ttlMs = resp.ttl_seconds * 1000;
|
|
726
|
+
intervalMs = Math.max(1_000, Math.min(ttlMs / 2, HEARTBEAT_DEFAULT_MS));
|
|
727
|
+
onLeaseTtl?.(ttlMs);
|
|
728
|
+
}
|
|
729
|
+
if (resp.state === 'stopping' || resp.state === 'stopped') {
|
|
730
|
+
logger.info('heartbeat signals shutdown', { work_id: work.id, state: resp.state });
|
|
731
|
+
lease.finish('control_plane_stop');
|
|
732
|
+
}
|
|
733
|
+
if (!resp.lease_extended) {
|
|
734
|
+
logger.warn('lease not extended, shutting down', { work_id: work.id });
|
|
735
|
+
lease.finish('control_plane_stop');
|
|
736
|
+
}
|
|
737
|
+
} catch (e) {
|
|
738
|
+
// An abort throws to unwind the caller (the `heartbeatLoop(...).catch`
|
|
739
|
+
// in `#handleItem`) rather than returning early.
|
|
740
|
+
lease.signal.throwIfAborted();
|
|
741
|
+
if (isStatus(e, 412)) {
|
|
742
|
+
const server = serverLeaseState(e);
|
|
743
|
+
logger.error('lease lost: heartbeat precondition failed', {
|
|
744
|
+
work_id: work.id,
|
|
745
|
+
server_state: server['state'],
|
|
746
|
+
server_ttl_seconds: server['ttl_seconds'],
|
|
747
|
+
server_last_heartbeat: server['last_heartbeat'],
|
|
748
|
+
});
|
|
749
|
+
lease.finish('lease_lost');
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
if (isFatal4xx(e)) {
|
|
753
|
+
logger.error('permanent heartbeat failure', { work_id: work.id, error: String(e) });
|
|
754
|
+
lease.finish('heartbeat_rejected');
|
|
755
|
+
throw e;
|
|
756
|
+
}
|
|
757
|
+
if (Date.now() - lastSuccessMs > ttlMs) {
|
|
758
|
+
logger.error('lease assumed lost: no successful heartbeat in ttl', {
|
|
759
|
+
work_id: work.id,
|
|
760
|
+
ttl_ms: ttlMs,
|
|
761
|
+
error: String(e),
|
|
762
|
+
});
|
|
763
|
+
lease.finish('assumed_lost');
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
logger.warn('transient heartbeat failure', { work_id: work.id, error: String(e) });
|
|
767
|
+
} finally {
|
|
768
|
+
clearTimeout(cutoff);
|
|
769
|
+
detach();
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
await beat();
|
|
774
|
+
while (!lease.signal.aborted) {
|
|
775
|
+
await sleep(intervalMs, lease.signal);
|
|
776
|
+
lease.signal.throwIfAborted();
|
|
777
|
+
await beat();
|
|
778
|
+
}
|
|
779
|
+
}
|