@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,1017 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-level memory-store download and sync.
|
|
3
|
+
*
|
|
4
|
+
* A session may have several memory stores attached. This module resolves
|
|
5
|
+
* where each store's folder goes on disk, opens a {@link LocalFileStore}
|
|
6
|
+
* there, and reconciles each folder with its remote store — the merge rules
|
|
7
|
+
* live on {@link SessionMemoryStores}.
|
|
8
|
+
*
|
|
9
|
+
* Node-only (it sits on the filesystem-backed FileStore); like `skills.ts`,
|
|
10
|
+
* it is reachable through the shimmed `node.ts` entry point.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import * as path from 'node:path';
|
|
14
|
+
import { createHash } from 'node:crypto';
|
|
15
|
+
import type { Anthropic } from '../../client';
|
|
16
|
+
import { AnthropicError } from '../../core/error';
|
|
17
|
+
import { loggerFor, type Logger } from '../../internal/utils/log';
|
|
18
|
+
import { decodeUTF8 } from '../../internal/utils/bytes';
|
|
19
|
+
import { isStatus } from '../../internal/utils/backoff';
|
|
20
|
+
import { isPathLegal, FileStoreError, LocalFileStore, type FileStore } from '../../internal/file-store';
|
|
21
|
+
import type { BetaManagedAgentsSession } from '../../resources/beta/sessions/sessions';
|
|
22
|
+
import type { BetaManagedAgentsMemoryStoreResource } from '../../resources/beta/sessions/resources';
|
|
23
|
+
import type {
|
|
24
|
+
BetaManagedAgentsMemory,
|
|
25
|
+
BetaManagedAgentsMemoryView,
|
|
26
|
+
} from '../../resources/beta/memory-stores/memories';
|
|
27
|
+
import { DEFAULT_MEMORY_SYNC_INTERVAL_MS, checkMemorySyncInterval } from './sync-interval';
|
|
28
|
+
|
|
29
|
+
export { DEFAULT_MEMORY_SYNC_INTERVAL_MS, MIN_MEMORY_SYNC_INTERVAL_MS } from './sync-interval';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Whether a locally deleted file may delete its memory on the server:
|
|
33
|
+
* `"enabled"` sends the delete, `"log_only"` runs the checks but only logs,
|
|
34
|
+
* `"disabled"` never deletes.
|
|
35
|
+
*/
|
|
36
|
+
export type MemoryDeleteMode = 'enabled' | 'log_only' | 'disabled';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Time bound the worker puts on each teardown pass — the final
|
|
40
|
+
* {@link SessionMemoryStores.finish}, then {@link SessionMemoryStores.flushWrites} —
|
|
41
|
+
* so a slow server cannot stall teardown.
|
|
42
|
+
*/
|
|
43
|
+
export const MEMORY_FLUSH_TIMEOUT_MS = 30_000;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Marker file stamped into every store folder; a sync trusts the folder only
|
|
47
|
+
* when it matches. Never itself syncs.
|
|
48
|
+
*/
|
|
49
|
+
export const MARKER_PATH = '.anthropic-memory-store';
|
|
50
|
+
|
|
51
|
+
const MARKER_VERSION = 1;
|
|
52
|
+
|
|
53
|
+
function markerSha(memoryStoreId: string): string {
|
|
54
|
+
return createHash('sha256').update(`version ${MARKER_VERSION}\n${memoryStoreId}`, 'utf-8').digest('hex');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** How long a file must stay missing locally before its server delete goes out. */
|
|
58
|
+
export const DELETE_CORROBORATION_MS = 30_000;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Page sizes for memory listings — the API's maximum per view: `basic` pages
|
|
62
|
+
* carry up to 100 items, `full` pages are capped by the server.
|
|
63
|
+
*/
|
|
64
|
+
const LIST_PAGE_SIZE = 100;
|
|
65
|
+
const FULL_LIST_PAGE_SIZE = 20;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* How many single-memory content fetches may be in flight at once during one
|
|
69
|
+
* store's pull pass. A sync rarely pulls more than a handful of memories, so
|
|
70
|
+
* a higher cap buys nothing in the common case.
|
|
71
|
+
*/
|
|
72
|
+
const FETCH_CONCURRENCY = 16;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* How many uploads one store's flush keeps in flight. At ~0.3s per upload,
|
|
76
|
+
* 32 clears the server's 2000-memories-per-store cap inside
|
|
77
|
+
* {@link MEMORY_FLUSH_TIMEOUT_MS}.
|
|
78
|
+
*/
|
|
79
|
+
export const UPLOAD_CONCURRENCY = 32;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Per-sync remote-delete cap bounds. The floor lets a small store's
|
|
83
|
+
* deletes clear in one pass; the ceiling caps damage on large ones.
|
|
84
|
+
*/
|
|
85
|
+
const DELETE_CAP_FLOOR = 8;
|
|
86
|
+
const DELETE_CAP_CEILING = 50;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* One directory scan: the marker check and the file listing come from the
|
|
90
|
+
* same read, so a folder wiped mid-sync cannot pass the check and then look
|
|
91
|
+
* empty.
|
|
92
|
+
*/
|
|
93
|
+
type MarkerScan = {
|
|
94
|
+
files: Record<string, string>;
|
|
95
|
+
markerOk: boolean;
|
|
96
|
+
distrustReason: string | null;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* A session's memory stores could not be mounted.
|
|
101
|
+
*
|
|
102
|
+
* Thrown by {@link SessionMemoryStores.download} when a store cannot be
|
|
103
|
+
* materialised on disk, and by the environment worker when a work item for a
|
|
104
|
+
* session that has memory stores carried no sessions token to reach them with.
|
|
105
|
+
*/
|
|
106
|
+
export class SessionMemoryError extends AnthropicError {
|
|
107
|
+
constructor(message: string, cause?: unknown) {
|
|
108
|
+
super(message);
|
|
109
|
+
this.name = 'SessionMemoryError';
|
|
110
|
+
// in some environments the 'cause' property is already declared
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
if (cause !== undefined) this.cause = cause;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** One attached store: its {@link FileStore} on disk plus the sync baseline. */
|
|
117
|
+
type AttachedStore = {
|
|
118
|
+
memoryStoreId: string;
|
|
119
|
+
files: FileStore;
|
|
120
|
+
readOnly: boolean;
|
|
121
|
+
/** `{rel → content sha}` as of the last download or successful sync. */
|
|
122
|
+
baseline: Map<string, string>;
|
|
123
|
+
/** `{rel → sha}` the server refused; retried only after the file changes. */
|
|
124
|
+
refusedShas: Map<string, string>;
|
|
125
|
+
/** `{rel → Date.now()}` when first seen missing locally. */
|
|
126
|
+
pendingDeletes: Map<string, number>;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/** One sync's remote-delete gate and counters. */
|
|
130
|
+
class DeletePass {
|
|
131
|
+
attempted = 0;
|
|
132
|
+
capped = 0;
|
|
133
|
+
suppressed = 0;
|
|
134
|
+
|
|
135
|
+
constructor(
|
|
136
|
+
readonly mode: MemoryDeleteMode,
|
|
137
|
+
readonly cap: number,
|
|
138
|
+
/** Skip the delete wait — set on the session's last sync. */
|
|
139
|
+
readonly waiveWindow: boolean,
|
|
140
|
+
) {}
|
|
141
|
+
|
|
142
|
+
takeSlot(): boolean {
|
|
143
|
+
if (this.attempted >= this.cap) {
|
|
144
|
+
this.capped++;
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
this.attempted++;
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface SessionMemoryStoresOptions {
|
|
153
|
+
/** Base directory for the `{workdir}/memory/<name>` fallback store location. */
|
|
154
|
+
workdir: string;
|
|
155
|
+
/**
|
|
156
|
+
* How often (milliseconds) {@link SessionMemoryStores.syncIfDue} actually
|
|
157
|
+
* syncs. Defaults to {@link DEFAULT_MEMORY_SYNC_INTERVAL_MS} (15s); values
|
|
158
|
+
* below {@link MIN_MEMORY_SYNC_INTERVAL_MS} (5s) are rejected.
|
|
159
|
+
*/
|
|
160
|
+
syncIntervalMs?: number;
|
|
161
|
+
/** See {@link MemoryDeleteMode}. Defaults to `"enabled"`. */
|
|
162
|
+
syncDeletions?: MemoryDeleteMode;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The memory stores attached to one session, materialised on disk.
|
|
167
|
+
*
|
|
168
|
+
* {@link SessionMemoryStores.download} opens a {@link LocalFileStore} at each
|
|
169
|
+
* attached store's directory (its `mount_path`, or a workdir fallback — see
|
|
170
|
+
* {@link SessionMemoryStores.download}), pulls its memories, and records each
|
|
171
|
+
* one's `content_sha256` as the sync baseline. Each sync
|
|
172
|
+
* ({@link SessionMemoryStores.syncIfDue} on the worker's cadence,
|
|
173
|
+
* {@link SessionMemoryStores.finish} once at the end) reconciles disk against
|
|
174
|
+
* server, per store and per path:
|
|
175
|
+
*
|
|
176
|
+
* - a memory changed only remotely is written to disk;
|
|
177
|
+
* - a file changed only locally is uploaded — an update with a
|
|
178
|
+
* `content_sha256` precondition, or a create for a new file;
|
|
179
|
+
* - a file changed on both sides logs a warning and takes the server version;
|
|
180
|
+
* - a file the server refuses (too large, invalid content) is skipped —
|
|
181
|
+
* warned once and retried only after the file changes; other files keep
|
|
182
|
+
* syncing;
|
|
183
|
+
* - a file deleted locally is deleted on the server after a delay and a
|
|
184
|
+
* re-check — never on the first sync that notices, and only up to a
|
|
185
|
+
* per-sync cap. `syncDeletions` gates it;
|
|
186
|
+
* - a memory deleted on the server is deleted on disk — unless the local
|
|
187
|
+
* file holds un-pushed edits: a writable store re-creates the memory
|
|
188
|
+
* from the file, a read-only one keeps the file unsynced;
|
|
189
|
+
* - a store attached read-only pulls but never pushes.
|
|
190
|
+
*
|
|
191
|
+
* A download pulls the whole store, so it lists with content included. The
|
|
192
|
+
* recurring syncs instead run two phases: a content-free listing (paths and
|
|
193
|
+
* shas) drives the merge decisions, then only the memories actually being
|
|
194
|
+
* written to disk are fetched, a bounded number at a time. A sync that finds
|
|
195
|
+
* nothing changed moves no content at all.
|
|
196
|
+
*
|
|
197
|
+
* A file whose write to disk failed is never in the baseline, so its absence
|
|
198
|
+
* reads as a failed download — it is pulled again, never deleted. A write
|
|
199
|
+
* never re-creates a store folder that vanished mid-sync: it fails, and the
|
|
200
|
+
* next sync's scan finds whatever is at the path by then — nothing
|
|
201
|
+
* (re-downloaded) or someone else's files (left alone) — under the rules
|
|
202
|
+
* below.
|
|
203
|
+
*
|
|
204
|
+
* A store folder that loses its {@link MARKER_PATH} marker, is emptied,
|
|
205
|
+
* or vanishes is re-downloaded rather than treated as a mass local
|
|
206
|
+
* delete; a folder whose marker names another store is left as found —
|
|
207
|
+
* nothing pushed, nothing deleted.
|
|
208
|
+
*
|
|
209
|
+
* Two things about the store's directory make
|
|
210
|
+
* {@link SessionMemoryStores.download} refuse the session outright, with
|
|
211
|
+
* {@link SessionMemoryError}: a `mount_path` that is not a clean absolute
|
|
212
|
+
* path, and a directory already sitting at that path.
|
|
213
|
+
*
|
|
214
|
+
* {@link SessionMemoryStores.download} throws on the first store it cannot
|
|
215
|
+
* materialise. The syncs never throw: mid-session, one bad store or one bad
|
|
216
|
+
* file is logged and the rest continue. Instances are not safe for concurrent
|
|
217
|
+
* use. The worker builds one on its token-scoped sub-client (the memory
|
|
218
|
+
* endpoints reject the environment key): `syncIfDue` after each tool call,
|
|
219
|
+
* `finish` once at a clean end, a bounded {@link SessionMemoryStores.flushWrites}
|
|
220
|
+
* in every teardown, `dispose` last.
|
|
221
|
+
*/
|
|
222
|
+
export class SessionMemoryStores {
|
|
223
|
+
readonly #client: Anthropic;
|
|
224
|
+
readonly #workdir: string;
|
|
225
|
+
readonly #syncIntervalMs: number;
|
|
226
|
+
readonly #syncDeletions: MemoryDeleteMode;
|
|
227
|
+
readonly #log: Logger;
|
|
228
|
+
#lastSyncAt: number;
|
|
229
|
+
#finished = false;
|
|
230
|
+
readonly #stores: AttachedStore[] = [];
|
|
231
|
+
|
|
232
|
+
constructor(client: Anthropic, opts: SessionMemoryStoresOptions) {
|
|
233
|
+
this.#client = client;
|
|
234
|
+
this.#workdir = opts.workdir;
|
|
235
|
+
this.#syncIntervalMs = opts.syncIntervalMs ?? DEFAULT_MEMORY_SYNC_INTERVAL_MS;
|
|
236
|
+
checkMemorySyncInterval(this.#syncIntervalMs, 'syncIntervalMs');
|
|
237
|
+
this.#syncDeletions = opts.syncDeletions ?? 'enabled';
|
|
238
|
+
this.#log = loggerFor(client);
|
|
239
|
+
this.#lastSyncAt = Date.now();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Every attached store's root directory.
|
|
244
|
+
*
|
|
245
|
+
* The worker lists these as the file tools' allowed roots so a store
|
|
246
|
+
* mounted outside the workdir stays reachable.
|
|
247
|
+
*/
|
|
248
|
+
get roots(): string[] {
|
|
249
|
+
return this.#stores.map((s) => s.files.root().path);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Root directories of stores attached read-only.
|
|
254
|
+
*
|
|
255
|
+
* The file tools consult this to refuse writes into read-only stores.
|
|
256
|
+
*/
|
|
257
|
+
get readOnlyRoots(): string[] {
|
|
258
|
+
return this.#stores.filter((s) => s.readOnly).map((s) => s.files.root().path);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Where one store's files land on disk.
|
|
263
|
+
*
|
|
264
|
+
* The store's files land at its `mount_path` — the very location the agent's
|
|
265
|
+
* system prompt tells it to read. A `mount_path` we cannot use verbatim is
|
|
266
|
+
* refused rather than quietly relocated: the agent would read an empty
|
|
267
|
+
* folder at the path it was told about, and write notes somewhere the next
|
|
268
|
+
* session looks for nothing.
|
|
269
|
+
*/
|
|
270
|
+
#storeRoot(resource: BetaManagedAgentsMemoryStoreResource): string {
|
|
271
|
+
if (resource.mount_path) {
|
|
272
|
+
if (!isPathLegal(resource.mount_path)) {
|
|
273
|
+
throw new SessionMemoryError(
|
|
274
|
+
`memory store mount_path is not a clean absolute path: ${JSON.stringify(resource.mount_path)} ` +
|
|
275
|
+
`(memory_store_id=${resource.memory_store_id})`,
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
return resource.mount_path;
|
|
279
|
+
}
|
|
280
|
+
// No mount_path at all: nothing points the agent anywhere, so the workdir
|
|
281
|
+
// is as good a home as any.
|
|
282
|
+
return path.join(this.#workdir, 'memory', resource.name || resource.memory_store_id);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Download every attached store's memories to disk.
|
|
287
|
+
*
|
|
288
|
+
* `session` arrives already fetched — one snapshot shared with the skills
|
|
289
|
+
* download, so the two cannot disagree about the resources.
|
|
290
|
+
*/
|
|
291
|
+
async download(session: BetaManagedAgentsSession): Promise<void> {
|
|
292
|
+
for (const resource of session.resources) {
|
|
293
|
+
if (resource.type !== 'memory_store') continue;
|
|
294
|
+
const root = this.#storeRoot(resource);
|
|
295
|
+
let store: AttachedStore | undefined;
|
|
296
|
+
try {
|
|
297
|
+
store = {
|
|
298
|
+
memoryStoreId: resource.memory_store_id,
|
|
299
|
+
// utf8: a binary file is refused at put/get, not mid-sync.
|
|
300
|
+
files: await LocalFileStore.open(root, { utf8: true }),
|
|
301
|
+
readOnly: resource.access === 'read_only',
|
|
302
|
+
baseline: new Map(),
|
|
303
|
+
refusedShas: new Map(),
|
|
304
|
+
pendingDeletes: new Map(),
|
|
305
|
+
};
|
|
306
|
+
// A root `open` did not create is a dead run's leftovers; the first
|
|
307
|
+
// sync would upload them into the customer's store.
|
|
308
|
+
if (!store.files.root().removedOnDispose) {
|
|
309
|
+
// The configured path, not root().path — that one is resolved and
|
|
310
|
+
// would name a symlinked mount's target.
|
|
311
|
+
throw new SessionMemoryError(
|
|
312
|
+
`something already exists at the memory store's path: ${root} ` +
|
|
313
|
+
`(memory_store_id=${resource.memory_store_id}); ` +
|
|
314
|
+
'it must not exist when the session starts',
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
try {
|
|
318
|
+
await store.files.createRoot();
|
|
319
|
+
} catch (e) {
|
|
320
|
+
if (!isErrno(e)) throw e;
|
|
321
|
+
// An unmountable root fails the item, not just one file.
|
|
322
|
+
throw new SessionMemoryError(
|
|
323
|
+
`cannot create the memory store's folder: ${root} ` +
|
|
324
|
+
`(memory_store_id=${resource.memory_store_id}): ${e}; ` +
|
|
325
|
+
'the worker host must make this mount path writable',
|
|
326
|
+
e,
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
await this.#stampAndPull(store);
|
|
330
|
+
this.#log.info('downloaded memories', {
|
|
331
|
+
count: store.baseline.size,
|
|
332
|
+
memory_store_id: store.memoryStoreId,
|
|
333
|
+
dest: store.files.root().path,
|
|
334
|
+
});
|
|
335
|
+
this.#stores.push(store);
|
|
336
|
+
} catch (e) {
|
|
337
|
+
// A half-downloaded folder self-destructs; `dispose` leaves a refused
|
|
338
|
+
// pre-existing directory exactly as found.
|
|
339
|
+
if (store) await store.files.dispose().catch(() => {});
|
|
340
|
+
// Every store must land: a session missing a folder its system prompt
|
|
341
|
+
// names runs with amnesia and syncs nothing back.
|
|
342
|
+
if (e instanceof SessionMemoryError) throw e;
|
|
343
|
+
throw new SessionMemoryError(
|
|
344
|
+
`failed to download memory store memory_store_id=${resource.memory_store_id}: ${e}`,
|
|
345
|
+
e,
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
this.#lastSyncAt = Date.now();
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* The session's last sync — skips the delete wait, so calling it twice
|
|
354
|
+
* would undo the protection; it throws instead.
|
|
355
|
+
*/
|
|
356
|
+
async finish(): Promise<void> {
|
|
357
|
+
if (this.#finished) {
|
|
358
|
+
throw new AnthropicError("finish() was already called: it is the session's last sync and runs once");
|
|
359
|
+
}
|
|
360
|
+
this.#finished = true;
|
|
361
|
+
await this.syncAll(true);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/** @internal — reconcile every store once; the tests' deterministic driver */
|
|
365
|
+
async syncAll(final: boolean): Promise<void> {
|
|
366
|
+
await Promise.all(this.#stores.map((store) => this.#syncStore(store, final)));
|
|
367
|
+
this.#lastSyncAt = Date.now();
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
async #scanMarker(store: AttachedStore): Promise<MarkerScan> {
|
|
371
|
+
const local = await store.files.hashtree();
|
|
372
|
+
const marker = local[MARKER_PATH];
|
|
373
|
+
delete local[MARKER_PATH];
|
|
374
|
+
if (marker === markerSha(store.memoryStoreId)) {
|
|
375
|
+
return { files: local, markerOk: true, distrustReason: null };
|
|
376
|
+
}
|
|
377
|
+
return {
|
|
378
|
+
files: local,
|
|
379
|
+
markerOk: false,
|
|
380
|
+
distrustReason:
|
|
381
|
+
marker !== undefined ? 'the marker file does not match this store' : 'the marker file is gone',
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
async #syncStore(store: AttachedStore, final: boolean): Promise<void> {
|
|
386
|
+
try {
|
|
387
|
+
const scan = await this.#scanMarker(store);
|
|
388
|
+
const local = scan.files;
|
|
389
|
+
if (!scan.markerOk) {
|
|
390
|
+
if (Object.keys(local).length > 0) {
|
|
391
|
+
this.#log.warn(`${scan.distrustReason}; leaving the memory store folder as found and not syncing`, {
|
|
392
|
+
root: store.files.root().path,
|
|
393
|
+
memory_store_id: store.memoryStoreId,
|
|
394
|
+
});
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
await this.#recover(store, 'the folder or its marker is gone');
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
// A lone file vanishing is an ordinary deletion; two or more at
|
|
401
|
+
// once with nothing left is a wiped folder.
|
|
402
|
+
if (Object.keys(local).length === 0 && store.baseline.size > 1) {
|
|
403
|
+
await this.#recover(store, 'every memory file is gone at once');
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const remote = new Map<string, BetaManagedAgentsMemory>();
|
|
408
|
+
for await (const [rel, item] of this.#listMemories(store.memoryStoreId)) {
|
|
409
|
+
remote.set(rel, item);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const deletes = new DeletePass(
|
|
413
|
+
this.#syncDeletions,
|
|
414
|
+
Math.max(DELETE_CAP_FLOOR, Math.min(DELETE_CAP_CEILING, Math.floor(store.baseline.size / 4))),
|
|
415
|
+
final,
|
|
416
|
+
);
|
|
417
|
+
const pulls: Array<[rel: string, item: BetaManagedAgentsMemory]> = [];
|
|
418
|
+
const baseline = new Map<string, string>();
|
|
419
|
+
const paths = [...new Set([...remote.keys(), ...Object.keys(local), ...store.baseline.keys()])].sort();
|
|
420
|
+
for (const rel of paths) {
|
|
421
|
+
const remoteItem = remote.get(rel);
|
|
422
|
+
const localSha = local[rel];
|
|
423
|
+
const baseSha = store.baseline.get(rel);
|
|
424
|
+
let sha: string | undefined;
|
|
425
|
+
if (
|
|
426
|
+
localSha === undefined &&
|
|
427
|
+
baseSha !== undefined &&
|
|
428
|
+
remoteItem !== undefined &&
|
|
429
|
+
remoteItem.content_sha256 === baseSha &&
|
|
430
|
+
!store.readOnly
|
|
431
|
+
) {
|
|
432
|
+
sha = await this.#corroboratedDelete(store, rel, remoteItem, baseSha, deletes);
|
|
433
|
+
} else {
|
|
434
|
+
sha = await this.#syncPath(store, rel, remoteItem, localSha, pulls);
|
|
435
|
+
}
|
|
436
|
+
if (sha !== undefined) baseline.set(rel, sha);
|
|
437
|
+
}
|
|
438
|
+
store.baseline = baseline;
|
|
439
|
+
// The content pass: everything above moved only shas.
|
|
440
|
+
await this.#pullAll(store, pulls);
|
|
441
|
+
if (deletes.suppressed > 0) {
|
|
442
|
+
this.#log.debug('remote deletes are disabled; locally deleted memories stay on the server', {
|
|
443
|
+
count: deletes.suppressed,
|
|
444
|
+
memory_store_id: store.memoryStoreId,
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
if (deletes.capped > 0) {
|
|
448
|
+
this.#log.warn(
|
|
449
|
+
`delete cap reached: ${deletes.mode === 'log_only' ? 'would send' : 'sent'} ` +
|
|
450
|
+
`${deletes.attempted} deletes, held ${deletes.capped} for later syncs`,
|
|
451
|
+
{ memory_store_id: store.memoryStoreId },
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
} catch (e) {
|
|
455
|
+
this.#log.warn('memory sync failed', { memory_store_id: store.memoryStoreId, error: String(e) });
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/** Sync when `syncIntervalMs` has elapsed since the last one. Never throws. */
|
|
460
|
+
async syncIfDue(): Promise<void> {
|
|
461
|
+
if (Date.now() - this.#lastSyncAt < this.#syncIntervalMs) return;
|
|
462
|
+
await this.syncAll(false);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Upload new and changed files; send no deletes and pull nothing.
|
|
467
|
+
*
|
|
468
|
+
* The push-only rescue pass for a session ending on an error or
|
|
469
|
+
* cancel — best-effort, bounded by the caller: once `signal` aborts no
|
|
470
|
+
* further upload starts, each store cut off part-way logs how many
|
|
471
|
+
* changed files it had not finished uploading, and this resolves without
|
|
472
|
+
* waiting for requests already in flight. Each store uploads up to
|
|
473
|
+
* {@link UPLOAD_CONCURRENCY} files at a time. Skips read-only stores,
|
|
474
|
+
* refused files, files the server already holds, and folders that fail
|
|
475
|
+
* the marker check. Never throws.
|
|
476
|
+
*/
|
|
477
|
+
async flushWrites(signal?: AbortSignal): Promise<void> {
|
|
478
|
+
await Promise.all(this.#stores.map((store) => this.#flushStore(store, signal)));
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
async #flushStore(store: AttachedStore, signal: AbortSignal | undefined): Promise<void> {
|
|
482
|
+
const dirty = new Map<string, string>();
|
|
483
|
+
const unsent = new Set<string>();
|
|
484
|
+
const push = async (): Promise<void> => {
|
|
485
|
+
if (store.readOnly) return;
|
|
486
|
+
const scan = await this.#scanMarker(store);
|
|
487
|
+
if (!scan.markerOk) {
|
|
488
|
+
this.#log.warn(`${scan.distrustReason}; not uploading anything from the memory store folder`, {
|
|
489
|
+
root: store.files.root().path,
|
|
490
|
+
memory_store_id: store.memoryStoreId,
|
|
491
|
+
});
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
for (const [rel, sha] of Object.entries(scan.files)) {
|
|
495
|
+
if (sha !== store.baseline.get(rel) && store.refusedShas.get(rel) !== sha) {
|
|
496
|
+
dirty.set(rel, sha);
|
|
497
|
+
unsent.add(rel);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
if (dirty.size === 0 || signal?.aborted) return;
|
|
501
|
+
const remote = new Map<string, BetaManagedAgentsMemory>();
|
|
502
|
+
for await (const [rel, item] of this.#listMemories(store.memoryStoreId)) {
|
|
503
|
+
if (signal?.aborted) return;
|
|
504
|
+
remote.set(rel, item);
|
|
505
|
+
}
|
|
506
|
+
const uploads: Array<
|
|
507
|
+
[rel: string, localSha: string | undefined, existing: BetaManagedAgentsMemory | undefined]
|
|
508
|
+
> = [];
|
|
509
|
+
for (const rel of [...dirty.keys()].sort()) {
|
|
510
|
+
const localSha = dirty.get(rel);
|
|
511
|
+
const baseSha = store.baseline.get(rel);
|
|
512
|
+
const existing = remote.get(rel);
|
|
513
|
+
if (existing !== undefined && existing.content_sha256 === localSha) {
|
|
514
|
+
store.baseline.set(rel, existing.content_sha256);
|
|
515
|
+
unsent.delete(rel);
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
if (existing !== undefined && existing.content_sha256 !== baseSha) {
|
|
519
|
+
this.#log.warn('memory changed both locally and remotely; the flush leaves the remote version', {
|
|
520
|
+
path: rel,
|
|
521
|
+
memory_store_id: store.memoryStoreId,
|
|
522
|
+
});
|
|
523
|
+
unsent.delete(rel);
|
|
524
|
+
continue;
|
|
525
|
+
}
|
|
526
|
+
uploads.push([rel, localSha, existing]);
|
|
527
|
+
}
|
|
528
|
+
await this.#uploadAll(store, uploads, unsent, signal);
|
|
529
|
+
};
|
|
530
|
+
try {
|
|
531
|
+
await settledOrAborted(push(), signal);
|
|
532
|
+
if (signal?.aborted && unsent.size > 0) {
|
|
533
|
+
this.#log.warn(
|
|
534
|
+
`memory flush cut off part-way; ${unsent.size} of ${dirty.size} changed files had not finished uploading`,
|
|
535
|
+
{ memory_store_id: store.memoryStoreId },
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
} catch (e) {
|
|
539
|
+
this.#log.warn('memory flush failed', { memory_store_id: store.memoryStoreId, error: String(e) });
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Remove every store directory that {@link SessionMemoryStores.download}
|
|
545
|
+
* created. Pre-existing directories are left alone — that is
|
|
546
|
+
* {@link FileStore.dispose}'s own rule. A folder that fails the marker
|
|
547
|
+
* check is kept too — sync left it as found, so must dispose.
|
|
548
|
+
*/
|
|
549
|
+
async dispose(): Promise<void> {
|
|
550
|
+
for (const store of this.#stores) {
|
|
551
|
+
const root = store.files.root();
|
|
552
|
+
try {
|
|
553
|
+
const scan = await this.#scanMarker(store);
|
|
554
|
+
if (!scan.markerOk && Object.keys(scan.files).length > 0) {
|
|
555
|
+
this.#log.warn(`${scan.distrustReason}; leaving the memory store folder on disk`, {
|
|
556
|
+
root: root.path,
|
|
557
|
+
memory_store_id: store.memoryStoreId,
|
|
558
|
+
});
|
|
559
|
+
continue;
|
|
560
|
+
}
|
|
561
|
+
await store.files.dispose();
|
|
562
|
+
} catch (e) {
|
|
563
|
+
if (!(e instanceof FileStoreError) && !isErrno(e)) throw e;
|
|
564
|
+
this.#log.warn('failed to remove the memory store folder', {
|
|
565
|
+
root: store.files.root().path,
|
|
566
|
+
memory_store_id: store.memoryStoreId,
|
|
567
|
+
error: String(e),
|
|
568
|
+
});
|
|
569
|
+
continue;
|
|
570
|
+
}
|
|
571
|
+
if (root.removedOnDispose) {
|
|
572
|
+
this.#log.info('removed memory store dir', {
|
|
573
|
+
dest: root.path,
|
|
574
|
+
memory_store_id: store.memoryStoreId,
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/** Rebuild a destroyed folder from the server; sends no deletes, no uploads. */
|
|
581
|
+
async #recover(store: AttachedStore, reason: string): Promise<void> {
|
|
582
|
+
this.#log.warn(`${reason}; re-downloading the memory store folder instead of syncing`, {
|
|
583
|
+
root: store.files.root().path,
|
|
584
|
+
memory_store_id: store.memoryStoreId,
|
|
585
|
+
});
|
|
586
|
+
await store.files.createRoot();
|
|
587
|
+
await this.#stampAndPull(store);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Write the marker, then pull every remote memory. Baseline is cleared
|
|
592
|
+
* first so a failed write never leaves an entry whose file is not on disk.
|
|
593
|
+
* Every memory is needed here, so the listing carries the content — pages
|
|
594
|
+
* cost far fewer round-trips than a request per memory.
|
|
595
|
+
*/
|
|
596
|
+
async #stampAndPull(store: AttachedStore): Promise<void> {
|
|
597
|
+
store.baseline = new Map();
|
|
598
|
+
store.pendingDeletes.clear();
|
|
599
|
+
await store.files.put(MARKER_PATH, `version ${MARKER_VERSION}\n${store.memoryStoreId}`);
|
|
600
|
+
for await (const [rel, item] of this.#listMemories(store.memoryStoreId, 'full')) {
|
|
601
|
+
if (await this.#write(store, rel, item.content ?? '')) {
|
|
602
|
+
store.baseline.set(rel, item.content_sha256);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Reconcile one path. Returns the sha to record in the baseline, or
|
|
609
|
+
* `undefined` to drop the path from it.
|
|
610
|
+
*
|
|
611
|
+
* `pulls` is an output: when the remote version should be written to disk,
|
|
612
|
+
* this appends `[rel, remote]` to it instead of writing — `rel` is the
|
|
613
|
+
* file to write, `remote` the listed memory whose content `#pullAll` will
|
|
614
|
+
* fetch and write there.
|
|
615
|
+
*/
|
|
616
|
+
async #syncPath(
|
|
617
|
+
store: AttachedStore,
|
|
618
|
+
rel: string,
|
|
619
|
+
remote: BetaManagedAgentsMemory | undefined,
|
|
620
|
+
localSha: string | undefined,
|
|
621
|
+
pulls: Array<[rel: string, item: BetaManagedAgentsMemory]>,
|
|
622
|
+
): Promise<string | undefined> {
|
|
623
|
+
const baseSha = store.baseline.get(rel);
|
|
624
|
+
if (localSha !== undefined) {
|
|
625
|
+
store.pendingDeletes.delete(rel);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
if (!remote) {
|
|
629
|
+
if (localSha === undefined) {
|
|
630
|
+
store.pendingDeletes.delete(rel);
|
|
631
|
+
return undefined;
|
|
632
|
+
}
|
|
633
|
+
if (baseSha !== undefined) {
|
|
634
|
+
if (localSha === baseSha) {
|
|
635
|
+
const fresh = await this.#removeLocal(store, rel, baseSha);
|
|
636
|
+
if (fresh === undefined) return undefined;
|
|
637
|
+
if (fresh === baseSha) return baseSha;
|
|
638
|
+
localSha = fresh;
|
|
639
|
+
}
|
|
640
|
+
// The file holds an un-pushed edit — the only copy; falling
|
|
641
|
+
// through re-creates or keeps it.
|
|
642
|
+
if (store.readOnly) {
|
|
643
|
+
this.#log.warn(
|
|
644
|
+
'memory deleted remotely but edited locally; keeping the file, ' +
|
|
645
|
+
'which a read-only store cannot push',
|
|
646
|
+
{ path: rel, memory_store_id: store.memoryStoreId },
|
|
647
|
+
);
|
|
648
|
+
} else if (store.refusedShas.get(rel) !== localSha) {
|
|
649
|
+
this.#log.info('memory deleted remotely but edited locally; re-creating it from the file', {
|
|
650
|
+
path: rel,
|
|
651
|
+
memory_store_id: store.memoryStoreId,
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
if (store.readOnly) return undefined;
|
|
656
|
+
if (store.refusedShas.get(rel) === localSha) return undefined;
|
|
657
|
+
return await this.#upload(store, rel, localSha, undefined);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
const remoteSha = remote.content_sha256;
|
|
661
|
+
const remoteChanged = remoteSha !== baseSha;
|
|
662
|
+
const locallyEdited = localSha !== undefined && localSha !== baseSha && localSha !== remoteSha;
|
|
663
|
+
// Read-only stores never push, so their local edits don't count.
|
|
664
|
+
const localChanged = !store.readOnly && locallyEdited;
|
|
665
|
+
|
|
666
|
+
if (localSha === undefined && baseSha !== undefined) {
|
|
667
|
+
// Only successful writes enter the baseline, so this file was verifiably
|
|
668
|
+
// on disk and is now gone: a real local deletion. The unchanged-remote
|
|
669
|
+
// case went to #corroboratedDelete.
|
|
670
|
+
if (remoteChanged) {
|
|
671
|
+
this.#log.warn('memory deleted locally but changed remotely; restoring the remote version', {
|
|
672
|
+
path: rel,
|
|
673
|
+
memory_store_id: store.memoryStoreId,
|
|
674
|
+
});
|
|
675
|
+
store.pendingDeletes.delete(rel);
|
|
676
|
+
pulls.push([rel, remote]);
|
|
677
|
+
}
|
|
678
|
+
return baseSha;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
if (remoteChanged) {
|
|
682
|
+
// The file already holds the remote bytes — adopt without a fetch.
|
|
683
|
+
if (localSha === remoteSha) return remoteSha;
|
|
684
|
+
// locallyEdited, not localChanged: warn on read-only overwrites too.
|
|
685
|
+
if (locallyEdited) {
|
|
686
|
+
this.#log.warn('memory changed both locally and remotely; keeping the remote version', {
|
|
687
|
+
path: rel,
|
|
688
|
+
memory_store_id: store.memoryStoreId,
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
pulls.push([rel, remote]);
|
|
692
|
+
return baseSha;
|
|
693
|
+
}
|
|
694
|
+
if (localChanged) {
|
|
695
|
+
if (store.refusedShas.get(rel) === localSha) return remoteSha;
|
|
696
|
+
return (await this.#upload(store, rel, localSha, remote)) ?? remoteSha;
|
|
697
|
+
}
|
|
698
|
+
return remoteSha;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Remove the file for a memory the server no longer has, if it still holds
|
|
703
|
+
* `expectSha`. Returns `undefined` when the file is gone from disk,
|
|
704
|
+
* `expectSha` when it must stay in the baseline (I/O error), or the file's
|
|
705
|
+
* fresh sha when it was edited since the scan.
|
|
706
|
+
*/
|
|
707
|
+
async #removeLocal(store: AttachedStore, rel: string, expectSha: string): Promise<string | undefined> {
|
|
708
|
+
// Re-read: an edit since the scan makes this file the only copy.
|
|
709
|
+
let freshSha: string | null;
|
|
710
|
+
try {
|
|
711
|
+
freshSha = await store.files.hashFile(rel);
|
|
712
|
+
} catch (e) {
|
|
713
|
+
if (!(e instanceof FileStoreError) && !isErrno(e)) throw e;
|
|
714
|
+
return expectSha;
|
|
715
|
+
}
|
|
716
|
+
if (freshSha === null) return undefined;
|
|
717
|
+
if (freshSha !== expectSha) return freshSha;
|
|
718
|
+
try {
|
|
719
|
+
await store.files.remove(rel);
|
|
720
|
+
} catch (e) {
|
|
721
|
+
if (!(e instanceof FileStoreError) && !isErrno(e)) throw e;
|
|
722
|
+
this.#log.warn('failed to remove memory deleted remotely', {
|
|
723
|
+
path: rel,
|
|
724
|
+
memory_store_id: store.memoryStoreId,
|
|
725
|
+
error: String(e),
|
|
726
|
+
});
|
|
727
|
+
return expectSha;
|
|
728
|
+
}
|
|
729
|
+
return undefined;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Write a memory's content to disk; `false` (and a warning) on failure.
|
|
734
|
+
*
|
|
735
|
+
* A `..` component in the wire path reaches here as {@link FileStoreError} —
|
|
736
|
+
* that is the escape guard.
|
|
737
|
+
*/
|
|
738
|
+
async #write(store: AttachedStore, rel: string, content: string): Promise<boolean> {
|
|
739
|
+
try {
|
|
740
|
+
await store.files.put(rel, content);
|
|
741
|
+
} catch (e) {
|
|
742
|
+
if (!(e instanceof FileStoreError) && !isErrno(e)) throw e;
|
|
743
|
+
this.#log.warn('failed to write memory', {
|
|
744
|
+
path: rel,
|
|
745
|
+
memory_store_id: store.memoryStoreId,
|
|
746
|
+
error: String(e),
|
|
747
|
+
});
|
|
748
|
+
return false;
|
|
749
|
+
}
|
|
750
|
+
return true;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
/**
|
|
754
|
+
* Fetch and write the given memories, {@link FETCH_CONCURRENCY} at a time.
|
|
755
|
+
*
|
|
756
|
+
* The sync's content pass: the listing carried no content, so each memory
|
|
757
|
+
* is fetched individually and written as it arrives. On success the path's
|
|
758
|
+
* baseline advances; on a failed fetch or write the old entry stays and the
|
|
759
|
+
* next sync retries. A 404 means the memory was deleted after the listing —
|
|
760
|
+
* the next sync reconciles it.
|
|
761
|
+
*/
|
|
762
|
+
async #pullAll(store: AttachedStore, pulls: Array<[rel: string, item: BetaManagedAgentsMemory]>) {
|
|
763
|
+
if (pulls.length === 0) return;
|
|
764
|
+
const pullOne = async (rel: string, listed: BetaManagedAgentsMemory): Promise<void> => {
|
|
765
|
+
let item: BetaManagedAgentsMemory;
|
|
766
|
+
try {
|
|
767
|
+
item = await this.#client.beta.memoryStores.memories.retrieve(listed.id, {
|
|
768
|
+
memory_store_id: store.memoryStoreId,
|
|
769
|
+
view: 'full',
|
|
770
|
+
});
|
|
771
|
+
} catch (e) {
|
|
772
|
+
if (isStatus(e, 404)) return;
|
|
773
|
+
this.#log.warn('failed to fetch memory content', {
|
|
774
|
+
path: rel,
|
|
775
|
+
memory_store_id: store.memoryStoreId,
|
|
776
|
+
error: String(e),
|
|
777
|
+
});
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
if (await this.#write(store, rel, item.content ?? '')) {
|
|
781
|
+
store.baseline.set(rel, item.content_sha256);
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
// A fixed pool of workers drains the queue; the write stays inside the
|
|
785
|
+
// worker so a slow disk cannot let fetched bodies pile up beyond the bound.
|
|
786
|
+
const queue = pulls[Symbol.iterator]();
|
|
787
|
+
const worker = async (): Promise<void> => {
|
|
788
|
+
for (const [rel, listed] of queue) await pullOne(rel, listed);
|
|
789
|
+
};
|
|
790
|
+
await Promise.all(Array.from({ length: Math.min(FETCH_CONCURRENCY, pulls.length) }, worker));
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Upload the given files, {@link UPLOAD_CONCURRENCY} at a time, taking each
|
|
795
|
+
* path off `unsent` as its upload returns. No upload starts once `signal`
|
|
796
|
+
* aborts; the ones already in flight run to completion.
|
|
797
|
+
*/
|
|
798
|
+
async #uploadAll(
|
|
799
|
+
store: AttachedStore,
|
|
800
|
+
uploads: Array<
|
|
801
|
+
[rel: string, localSha: string | undefined, existing: BetaManagedAgentsMemory | undefined]
|
|
802
|
+
>,
|
|
803
|
+
unsent: Set<string>,
|
|
804
|
+
signal: AbortSignal | undefined,
|
|
805
|
+
): Promise<void> {
|
|
806
|
+
const queue = uploads[Symbol.iterator]();
|
|
807
|
+
const worker = async (): Promise<void> => {
|
|
808
|
+
for (const [rel, localSha, existing] of queue) {
|
|
809
|
+
if (signal?.aborted) return;
|
|
810
|
+
const sha = await this.#upload(store, rel, localSha, existing);
|
|
811
|
+
unsent.delete(rel);
|
|
812
|
+
if (sha !== undefined) store.baseline.set(rel, sha);
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
await Promise.all(Array.from({ length: Math.min(UPLOAD_CONCURRENCY, uploads.length) }, worker));
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* The store's memories keyed by relative path (the wire path's leading `/`
|
|
820
|
+
* stripped — `#upload` re-prefixes it) — `basic` view (shas, no content) at
|
|
821
|
+
* {@link LIST_PAGE_SIZE} per page unless the caller needs `full` pages.
|
|
822
|
+
* `memory_prefix` rollups and the reserved marker path are skipped.
|
|
823
|
+
*/
|
|
824
|
+
async *#listMemories(
|
|
825
|
+
memoryStoreId: string,
|
|
826
|
+
view: BetaManagedAgentsMemoryView = 'basic',
|
|
827
|
+
): AsyncGenerator<[rel: string, item: BetaManagedAgentsMemory]> {
|
|
828
|
+
const limit = view === 'basic' ? LIST_PAGE_SIZE : FULL_LIST_PAGE_SIZE;
|
|
829
|
+
for await (const item of this.#client.beta.memoryStores.memories.list(memoryStoreId, { view, limit })) {
|
|
830
|
+
if (item.type !== 'memory') continue;
|
|
831
|
+
const rel = item.path.replace(/^\/+/, '');
|
|
832
|
+
if (rel === MARKER_PATH) {
|
|
833
|
+
this.#log.warn('the server listed the reserved marker path; skipping', {
|
|
834
|
+
path: item.path,
|
|
835
|
+
memory_store_id: memoryStoreId,
|
|
836
|
+
});
|
|
837
|
+
continue;
|
|
838
|
+
}
|
|
839
|
+
yield [rel, item];
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Push one local file; `undefined` keeps the old baseline so the next pass retries.
|
|
845
|
+
*
|
|
846
|
+
* A refusal the server would repeat (400/413, the utf-8 gate) enters
|
|
847
|
+
* `refusedShas`: warned once, retried only after the file changes.
|
|
848
|
+
*/
|
|
849
|
+
async #upload(
|
|
850
|
+
store: AttachedStore,
|
|
851
|
+
rel: string,
|
|
852
|
+
localSha: string | undefined,
|
|
853
|
+
existing: BetaManagedAgentsMemory | undefined,
|
|
854
|
+
): Promise<string | undefined> {
|
|
855
|
+
try {
|
|
856
|
+
const data = await store.files.get(rel);
|
|
857
|
+
if (data === null) return undefined;
|
|
858
|
+
const content = decodeUTF8(data);
|
|
859
|
+
const item =
|
|
860
|
+
existing ?
|
|
861
|
+
await this.#client.beta.memoryStores.memories.update(existing.id, {
|
|
862
|
+
memory_store_id: store.memoryStoreId,
|
|
863
|
+
content,
|
|
864
|
+
precondition: { type: 'content_sha256', content_sha256: existing.content_sha256 },
|
|
865
|
+
})
|
|
866
|
+
: await this.#client.beta.memoryStores.memories.create(store.memoryStoreId, {
|
|
867
|
+
path: '/' + rel,
|
|
868
|
+
content,
|
|
869
|
+
});
|
|
870
|
+
store.refusedShas.delete(rel);
|
|
871
|
+
return item.content_sha256;
|
|
872
|
+
} catch (e) {
|
|
873
|
+
if (existing && isStatus(e, 404)) {
|
|
874
|
+
// Deleted remotely since the listing, so this file is now the only copy.
|
|
875
|
+
return await this.#upload(store, rel, localSha, undefined);
|
|
876
|
+
}
|
|
877
|
+
const permanent = e instanceof FileStoreError || isStatus(e, 400) || isStatus(e, 413);
|
|
878
|
+
if (existing && isStatus(e, 409)) {
|
|
879
|
+
// The precondition lost a race: the remote moved under us, so the push
|
|
880
|
+
// is dropped. The local file is now stale — the next sync sees
|
|
881
|
+
// remoteChanged and pulls the winner over it.
|
|
882
|
+
this.#log.warn(
|
|
883
|
+
'memory changed both locally and remotely; the upload was refused and the local edit loses',
|
|
884
|
+
{
|
|
885
|
+
path: rel,
|
|
886
|
+
memory_store_id: store.memoryStoreId,
|
|
887
|
+
},
|
|
888
|
+
);
|
|
889
|
+
} else if (permanent && localSha !== undefined) {
|
|
890
|
+
store.refusedShas.set(rel, localSha);
|
|
891
|
+
this.#log.warn(
|
|
892
|
+
'the server rejected this memory file, so it stays un-synced until its content changes',
|
|
893
|
+
{ path: rel, memory_store_id: store.memoryStoreId, rejection: String(e) },
|
|
894
|
+
);
|
|
895
|
+
} else {
|
|
896
|
+
this.#log.warn('failed to upload memory', {
|
|
897
|
+
path: rel,
|
|
898
|
+
memory_store_id: store.memoryStoreId,
|
|
899
|
+
error: String(e),
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
return undefined;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
/** Send the server delete only after the wait, the cap, and a fresh re-check all clear. */
|
|
907
|
+
async #corroboratedDelete(
|
|
908
|
+
store: AttachedStore,
|
|
909
|
+
rel: string,
|
|
910
|
+
remote: BetaManagedAgentsMemory,
|
|
911
|
+
baseSha: string,
|
|
912
|
+
deletes: DeletePass,
|
|
913
|
+
): Promise<string | undefined> {
|
|
914
|
+
if (deletes.mode === 'disabled') {
|
|
915
|
+
deletes.suppressed++;
|
|
916
|
+
return baseSha;
|
|
917
|
+
}
|
|
918
|
+
let firstAbsent = store.pendingDeletes.get(rel);
|
|
919
|
+
if (firstAbsent === undefined) {
|
|
920
|
+
firstAbsent = Date.now();
|
|
921
|
+
store.pendingDeletes.set(rel, firstAbsent);
|
|
922
|
+
}
|
|
923
|
+
if (!deletes.waiveWindow && Date.now() - firstAbsent < DELETE_CORROBORATION_MS) {
|
|
924
|
+
return baseSha;
|
|
925
|
+
}
|
|
926
|
+
let markerOk: boolean;
|
|
927
|
+
let stillAbsent: boolean;
|
|
928
|
+
try {
|
|
929
|
+
// Re-check: the folder may have been wiped mid-sync.
|
|
930
|
+
markerOk = (await store.files.hashFile(MARKER_PATH)) === markerSha(store.memoryStoreId);
|
|
931
|
+
stillAbsent = (await store.files.hashFile(rel)) === null;
|
|
932
|
+
} catch (e) {
|
|
933
|
+
if (!(e instanceof FileStoreError) && !isErrno(e)) throw e;
|
|
934
|
+
markerOk = stillAbsent = false;
|
|
935
|
+
}
|
|
936
|
+
if (!markerOk) return baseSha;
|
|
937
|
+
if (!stillAbsent) {
|
|
938
|
+
store.pendingDeletes.delete(rel);
|
|
939
|
+
return baseSha;
|
|
940
|
+
}
|
|
941
|
+
if (!deletes.takeSlot()) return baseSha;
|
|
942
|
+
if (deletes.mode === 'log_only') {
|
|
943
|
+
// Repeats each sync — the log is the dry run.
|
|
944
|
+
this.#log.info('log-only: sync would delete this memory on the server', {
|
|
945
|
+
path: rel,
|
|
946
|
+
memory_store_id: store.memoryStoreId,
|
|
947
|
+
});
|
|
948
|
+
return baseSha;
|
|
949
|
+
}
|
|
950
|
+
const sha = await this.#deleteRemote(store, rel, remote, baseSha);
|
|
951
|
+
if (sha === undefined) {
|
|
952
|
+
store.pendingDeletes.delete(rel);
|
|
953
|
+
}
|
|
954
|
+
return sha;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
async #deleteRemote(
|
|
958
|
+
store: AttachedStore,
|
|
959
|
+
rel: string,
|
|
960
|
+
remote: BetaManagedAgentsMemory,
|
|
961
|
+
baseSha: string,
|
|
962
|
+
): Promise<string | undefined> {
|
|
963
|
+
try {
|
|
964
|
+
await this.#client.beta.memoryStores.memories.delete(remote.id, {
|
|
965
|
+
memory_store_id: store.memoryStoreId,
|
|
966
|
+
expected_content_sha256: baseSha,
|
|
967
|
+
});
|
|
968
|
+
} catch (e) {
|
|
969
|
+
if (isStatus(e, 404)) return undefined; // already gone remotely too
|
|
970
|
+
if (isStatus(e, 409) || isStatus(e, 412)) {
|
|
971
|
+
this.#log.warn('memory deleted locally but changed remotely; keeping the remote version', {
|
|
972
|
+
path: rel,
|
|
973
|
+
memory_store_id: store.memoryStoreId,
|
|
974
|
+
});
|
|
975
|
+
} else {
|
|
976
|
+
this.#log.warn('failed to delete memory', {
|
|
977
|
+
path: rel,
|
|
978
|
+
memory_store_id: store.memoryStoreId,
|
|
979
|
+
error: String(e),
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
return baseSha;
|
|
983
|
+
}
|
|
984
|
+
this.#log.info('propagated local deletion', { path: rel, memory_store_id: store.memoryStoreId });
|
|
985
|
+
return undefined;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* True for a thrown value shaped like a Node filesystem error. Shape-checked,
|
|
991
|
+
* not `instanceof Error` — fs errors can come from another realm.
|
|
992
|
+
*/
|
|
993
|
+
function isErrno(e: unknown): boolean {
|
|
994
|
+
return typeof e === 'object' && e !== null && typeof (e as NodeJS.ErrnoException).code === 'string';
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Resolve when `p` settles, or as soon as `signal` aborts. A rejection from
|
|
999
|
+
* `p` before the abort propagates; one after it is dropped.
|
|
1000
|
+
*/
|
|
1001
|
+
async function settledOrAborted(p: Promise<unknown>, signal: AbortSignal | undefined): Promise<void> {
|
|
1002
|
+
if (!signal) {
|
|
1003
|
+
await p;
|
|
1004
|
+
return;
|
|
1005
|
+
}
|
|
1006
|
+
let onAbort!: () => void;
|
|
1007
|
+
const aborted = new Promise<void>((resolve) => {
|
|
1008
|
+
onAbort = resolve;
|
|
1009
|
+
if (signal.aborted) resolve();
|
|
1010
|
+
});
|
|
1011
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
1012
|
+
try {
|
|
1013
|
+
await Promise.race([p, aborted]);
|
|
1014
|
+
} finally {
|
|
1015
|
+
signal.removeEventListener('abort', onAbort);
|
|
1016
|
+
}
|
|
1017
|
+
}
|