@anthropic-ai/sdk 0.119.0 → 0.121.0
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 +46 -0
- package/helpers/beta/environments.d.mts +5 -4
- package/helpers/beta/environments.d.mts.map +1 -1
- package/helpers/beta/environments.d.ts +5 -4
- package/helpers/beta/environments.d.ts.map +1 -1
- package/helpers/beta/environments.js +5 -4
- package/helpers/beta/environments.js.map +1 -1
- package/helpers/beta/environments.mjs +5 -4
- package/helpers/beta/environments.mjs.map +1 -1
- package/helpers/beta/standard-schema.d.mts +45 -0
- package/helpers/beta/standard-schema.d.mts.map +1 -0
- package/helpers/beta/standard-schema.d.ts +45 -0
- package/helpers/beta/standard-schema.d.ts.map +1 -0
- package/helpers/beta/standard-schema.js +58 -0
- package/helpers/beta/standard-schema.js.map +1 -0
- package/helpers/beta/standard-schema.mjs +54 -0
- package/helpers/beta/standard-schema.mjs.map +1 -0
- package/internal/detect-platform.js +1 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/file-store.d.mts +136 -0
- package/internal/file-store.d.mts.map +1 -0
- package/internal/file-store.d.ts +136 -0
- package/internal/file-store.d.ts.map +1 -0
- package/internal/file-store.js +531 -0
- package/internal/file-store.js.map +1 -0
- package/internal/file-store.mjs +523 -0
- package/internal/file-store.mjs.map +1 -0
- package/internal/utils/values.d.mts +6 -0
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts +6 -0
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +7 -0
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +6 -0
- package/internal/utils/values.mjs.map +1 -1
- package/lib/BetaMessageStream.d.mts.map +1 -1
- package/lib/BetaMessageStream.d.ts.map +1 -1
- package/lib/BetaMessageStream.js +3 -4
- package/lib/BetaMessageStream.js.map +1 -1
- package/lib/BetaMessageStream.mjs +1 -2
- package/lib/BetaMessageStream.mjs.map +1 -1
- package/lib/MessageStream.d.mts.map +1 -1
- package/lib/MessageStream.d.ts.map +1 -1
- package/lib/MessageStream.js +3 -4
- package/lib/MessageStream.js.map +1 -1
- package/lib/MessageStream.mjs +1 -2
- package/lib/MessageStream.mjs.map +1 -1
- package/lib/environments/poller.d.mts +6 -0
- package/lib/environments/poller.d.mts.map +1 -1
- package/lib/environments/poller.d.ts +6 -0
- package/lib/environments/poller.d.ts.map +1 -1
- package/lib/environments/poller.js +46 -1
- package/lib/environments/poller.js.map +1 -1
- package/lib/environments/poller.mjs +46 -1
- package/lib/environments/poller.mjs.map +1 -1
- package/lib/environments/worker.d.mts +89 -12
- package/lib/environments/worker.d.mts.map +1 -1
- package/lib/environments/worker.d.ts +89 -12
- package/lib/environments/worker.d.ts.map +1 -1
- package/lib/environments/worker.js +336 -67
- package/lib/environments/worker.js.map +1 -1
- package/lib/environments/worker.mjs +336 -68
- package/lib/environments/worker.mjs.map +1 -1
- package/lib/sessions/accumulate.d.mts.map +1 -1
- package/lib/sessions/accumulate.d.ts.map +1 -1
- package/lib/sessions/accumulate.js +3 -4
- package/lib/sessions/accumulate.js.map +1 -1
- package/lib/sessions/accumulate.mjs +1 -2
- package/lib/sessions/accumulate.mjs.map +1 -1
- package/lib/standard-schema.d.mts +131 -0
- package/lib/standard-schema.d.mts.map +1 -0
- package/lib/standard-schema.d.ts +131 -0
- package/lib/standard-schema.d.ts.map +1 -0
- package/lib/standard-schema.js +45 -0
- package/lib/standard-schema.js.map +1 -0
- package/lib/standard-schema.mjs +41 -0
- package/lib/standard-schema.mjs.map +1 -0
- package/lib/tools/BetaToolRunner.d.mts.map +1 -1
- package/lib/tools/BetaToolRunner.d.ts.map +1 -1
- package/lib/tools/BetaToolRunner.js +35 -6
- package/lib/tools/BetaToolRunner.js.map +1 -1
- package/lib/tools/BetaToolRunner.mjs +35 -6
- package/lib/tools/BetaToolRunner.mjs.map +1 -1
- package/package.json +2 -11
- package/resources/beta/agents/agents.d.mts +322 -27
- package/resources/beta/agents/agents.d.mts.map +1 -1
- package/resources/beta/agents/agents.d.ts +322 -27
- package/resources/beta/agents/agents.d.ts.map +1 -1
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/agents/index.d.mts +1 -1
- package/resources/beta/agents/index.d.mts.map +1 -1
- package/resources/beta/agents/index.d.ts +1 -1
- package/resources/beta/agents/index.d.ts.map +1 -1
- package/resources/beta/agents/index.js.map +1 -1
- package/resources/beta/agents/index.mjs.map +1 -1
- package/resources/beta/beta.d.mts +7 -3
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +7 -3
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +4 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +4 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/environments/environments.d.mts +8 -1
- package/resources/beta/environments/environments.d.mts.map +1 -1
- package/resources/beta/environments/environments.d.ts +8 -1
- package/resources/beta/environments/environments.d.ts.map +1 -1
- package/resources/beta/environments/environments.js.map +1 -1
- package/resources/beta/environments/environments.mjs.map +1 -1
- package/resources/beta/environments/work.d.mts +5 -1
- package/resources/beta/environments/work.d.mts.map +1 -1
- package/resources/beta/environments/work.d.ts +5 -1
- package/resources/beta/environments/work.d.ts.map +1 -1
- package/resources/beta/environments/work.js +0 -17
- package/resources/beta/environments/work.js.map +1 -1
- package/resources/beta/environments/work.mjs +0 -17
- package/resources/beta/environments/work.mjs.map +1 -1
- package/resources/beta/index.d.mts +2 -1
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +2 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +11 -9
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -0
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/memory-stores/memories.d.mts +6 -5
- package/resources/beta/memory-stores/memories.d.mts.map +1 -1
- package/resources/beta/memory-stores/memories.d.ts +6 -5
- package/resources/beta/memory-stores/memories.d.ts.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.mts +8 -5
- package/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.ts +8 -5
- package/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
- package/resources/beta/messages/messages.d.mts +51 -9
- package/resources/beta/messages/messages.d.mts.map +1 -1
- package/resources/beta/messages/messages.d.ts +51 -9
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/beta/organization/api-keys.d.mts +177 -0
- package/resources/beta/organization/api-keys.d.mts.map +1 -0
- package/resources/beta/organization/api-keys.d.ts +177 -0
- package/resources/beta/organization/api-keys.d.ts.map +1 -0
- package/resources/beta/organization/api-keys.js +56 -0
- package/resources/beta/organization/api-keys.js.map +1 -0
- package/resources/beta/organization/api-keys.mjs +52 -0
- package/resources/beta/organization/api-keys.mjs.map +1 -0
- package/resources/beta/organization/external-keys.d.mts +269 -0
- package/resources/beta/organization/external-keys.d.mts.map +1 -0
- package/resources/beta/organization/external-keys.d.ts +269 -0
- package/resources/beta/organization/external-keys.d.ts.map +1 -0
- package/resources/beta/organization/external-keys.js +119 -0
- package/resources/beta/organization/external-keys.js.map +1 -0
- package/resources/beta/organization/external-keys.mjs +115 -0
- package/resources/beta/organization/external-keys.mjs.map +1 -0
- package/resources/beta/organization/federation/federation.d.mts +14 -0
- package/resources/beta/organization/federation/federation.d.mts.map +1 -0
- package/resources/beta/organization/federation/federation.d.ts +14 -0
- package/resources/beta/organization/federation/federation.d.ts.map +1 -0
- package/resources/beta/organization/federation/federation.js +21 -0
- package/resources/beta/organization/federation/federation.js.map +1 -0
- package/resources/beta/organization/federation/federation.mjs +16 -0
- package/resources/beta/organization/federation/federation.mjs.map +1 -0
- package/resources/beta/organization/federation/index.d.mts +4 -0
- package/resources/beta/organization/federation/index.d.mts.map +1 -0
- package/resources/beta/organization/federation/index.d.ts +4 -0
- package/resources/beta/organization/federation/index.d.ts.map +1 -0
- package/resources/beta/organization/federation/index.js +11 -0
- package/resources/beta/organization/federation/index.js.map +1 -0
- package/resources/beta/organization/federation/index.mjs +5 -0
- package/resources/beta/organization/federation/index.mjs.map +1 -0
- package/resources/beta/organization/federation/issuers.d.mts +353 -0
- package/resources/beta/organization/federation/issuers.d.mts.map +1 -0
- package/resources/beta/organization/federation/issuers.d.ts +353 -0
- package/resources/beta/organization/federation/issuers.d.ts.map +1 -0
- package/resources/beta/organization/federation/issuers.js +169 -0
- package/resources/beta/organization/federation/issuers.js.map +1 -0
- package/resources/beta/organization/federation/issuers.mjs +165 -0
- package/resources/beta/organization/federation/issuers.mjs.map +1 -0
- package/resources/beta/organization/federation/rules/index.d.mts +3 -0
- package/resources/beta/organization/federation/rules/index.d.mts.map +1 -0
- package/resources/beta/organization/federation/rules/index.d.ts +3 -0
- package/resources/beta/organization/federation/rules/index.d.ts.map +1 -0
- package/resources/beta/organization/federation/rules/index.js +9 -0
- package/resources/beta/organization/federation/rules/index.js.map +1 -0
- package/resources/beta/organization/federation/rules/index.mjs +4 -0
- package/resources/beta/organization/federation/rules/index.mjs.map +1 -0
- package/resources/beta/organization/federation/rules/rules.d.mts +468 -0
- package/resources/beta/organization/federation/rules/rules.d.mts.map +1 -0
- package/resources/beta/organization/federation/rules/rules.d.ts +468 -0
- package/resources/beta/organization/federation/rules/rules.d.ts.map +1 -0
- package/resources/beta/organization/federation/rules/rules.js +198 -0
- package/resources/beta/organization/federation/rules/rules.js.map +1 -0
- package/resources/beta/organization/federation/rules/rules.mjs +193 -0
- package/resources/beta/organization/federation/rules/rules.mjs.map +1 -0
- package/resources/beta/organization/federation/rules/workspaces.d.mts +124 -0
- package/resources/beta/organization/federation/rules/workspaces.d.mts.map +1 -0
- package/resources/beta/organization/federation/rules/workspaces.d.ts +124 -0
- package/resources/beta/organization/federation/rules/workspaces.d.ts.map +1 -0
- package/resources/beta/organization/federation/rules/workspaces.js +114 -0
- package/resources/beta/organization/federation/rules/workspaces.js.map +1 -0
- package/resources/beta/organization/federation/rules/workspaces.mjs +110 -0
- package/resources/beta/organization/federation/rules/workspaces.mjs.map +1 -0
- package/resources/beta/organization/federation/rules.d.mts +2 -0
- package/resources/beta/organization/federation/rules.d.mts.map +1 -0
- package/resources/beta/organization/federation/rules.d.ts +2 -0
- package/resources/beta/organization/federation/rules.d.ts.map +1 -0
- package/resources/beta/organization/federation/rules.js +6 -0
- package/resources/beta/organization/federation/rules.js.map +1 -0
- package/resources/beta/organization/federation/rules.mjs +3 -0
- package/resources/beta/organization/federation/rules.mjs.map +1 -0
- package/resources/beta/organization/federation.d.mts +2 -0
- package/resources/beta/organization/federation.d.mts.map +1 -0
- package/resources/beta/organization/federation.d.ts +2 -0
- package/resources/beta/organization/federation.d.ts.map +1 -0
- package/resources/beta/organization/federation.js +6 -0
- package/resources/beta/organization/federation.js.map +1 -0
- package/resources/beta/organization/federation.mjs +3 -0
- package/resources/beta/organization/federation.mjs.map +1 -0
- package/resources/beta/organization/index.d.mts +10 -0
- package/resources/beta/organization/index.d.mts.map +1 -0
- package/resources/beta/organization/index.d.ts +10 -0
- package/resources/beta/organization/index.d.ts.map +1 -0
- package/resources/beta/organization/index.js +23 -0
- package/resources/beta/organization/index.js.map +1 -0
- package/resources/beta/organization/index.mjs +11 -0
- package/resources/beta/organization/index.mjs.map +1 -0
- package/resources/beta/organization/invites.d.mts +162 -0
- package/resources/beta/organization/invites.d.mts.map +1 -0
- package/resources/beta/organization/invites.d.ts +162 -0
- package/resources/beta/organization/invites.d.ts.map +1 -0
- package/resources/beta/organization/invites.js +76 -0
- package/resources/beta/organization/invites.js.map +1 -0
- package/resources/beta/organization/invites.mjs +72 -0
- package/resources/beta/organization/invites.mjs.map +1 -0
- package/resources/beta/organization/organization.d.mts +69 -0
- package/resources/beta/organization/organization.d.mts.map +1 -0
- package/resources/beta/organization/organization.d.ts +69 -0
- package/resources/beta/organization/organization.d.ts.map +1 -0
- package/resources/beta/organization/organization.js +58 -0
- package/resources/beta/organization/organization.js.map +1 -0
- package/resources/beta/organization/organization.mjs +53 -0
- package/resources/beta/organization/organization.mjs.map +1 -0
- package/resources/beta/organization/rate-limits.d.mts +78 -0
- package/resources/beta/organization/rate-limits.d.mts.map +1 -0
- package/resources/beta/organization/rate-limits.d.ts +78 -0
- package/resources/beta/organization/rate-limits.d.ts.map +1 -0
- package/resources/beta/organization/rate-limits.js +32 -0
- package/resources/beta/organization/rate-limits.js.map +1 -0
- package/resources/beta/organization/rate-limits.mjs +28 -0
- package/resources/beta/organization/rate-limits.mjs.map +1 -0
- package/resources/beta/organization/service-accounts/index.d.mts +3 -0
- package/resources/beta/organization/service-accounts/index.d.mts.map +1 -0
- package/resources/beta/organization/service-accounts/index.d.ts +3 -0
- package/resources/beta/organization/service-accounts/index.d.ts.map +1 -0
- package/resources/beta/organization/service-accounts/index.js +9 -0
- package/resources/beta/organization/service-accounts/index.js.map +1 -0
- package/resources/beta/organization/service-accounts/index.mjs +4 -0
- package/resources/beta/organization/service-accounts/index.mjs.map +1 -0
- package/resources/beta/organization/service-accounts/service-accounts.d.mts +258 -0
- package/resources/beta/organization/service-accounts/service-accounts.d.mts.map +1 -0
- package/resources/beta/organization/service-accounts/service-accounts.d.ts +258 -0
- package/resources/beta/organization/service-accounts/service-accounts.d.ts.map +1 -0
- package/resources/beta/organization/service-accounts/service-accounts.js +174 -0
- package/resources/beta/organization/service-accounts/service-accounts.js.map +1 -0
- package/resources/beta/organization/service-accounts/service-accounts.mjs +169 -0
- package/resources/beta/organization/service-accounts/service-accounts.mjs.map +1 -0
- package/resources/beta/organization/service-accounts/workspaces.d.mts +141 -0
- package/resources/beta/organization/service-accounts/workspaces.d.mts.map +1 -0
- package/resources/beta/organization/service-accounts/workspaces.d.ts +141 -0
- package/resources/beta/organization/service-accounts/workspaces.d.ts.map +1 -0
- package/resources/beta/organization/service-accounts/workspaces.js +125 -0
- package/resources/beta/organization/service-accounts/workspaces.js.map +1 -0
- package/resources/beta/organization/service-accounts/workspaces.mjs +121 -0
- package/resources/beta/organization/service-accounts/workspaces.mjs.map +1 -0
- package/resources/beta/organization/service-accounts.d.mts +2 -0
- package/resources/beta/organization/service-accounts.d.mts.map +1 -0
- package/resources/beta/organization/service-accounts.d.ts +2 -0
- package/resources/beta/organization/service-accounts.d.ts.map +1 -0
- package/resources/beta/organization/service-accounts.js +6 -0
- package/resources/beta/organization/service-accounts.js.map +1 -0
- package/resources/beta/organization/service-accounts.mjs +3 -0
- package/resources/beta/organization/service-accounts.mjs.map +1 -0
- package/resources/beta/organization/users.d.mts +124 -0
- package/resources/beta/organization/users.d.mts.map +1 -0
- package/resources/beta/organization/users.d.ts +124 -0
- package/resources/beta/organization/users.d.ts.map +1 -0
- package/resources/beta/organization/users.js +67 -0
- package/resources/beta/organization/users.js.map +1 -0
- package/resources/beta/organization/users.mjs +63 -0
- package/resources/beta/organization/users.mjs.map +1 -0
- package/resources/beta/organization/workspaces/index.d.mts +5 -0
- package/resources/beta/organization/workspaces/index.d.mts.map +1 -0
- package/resources/beta/organization/workspaces/index.d.ts +5 -0
- package/resources/beta/organization/workspaces/index.d.ts.map +1 -0
- package/resources/beta/organization/workspaces/index.js +13 -0
- package/resources/beta/organization/workspaces/index.js.map +1 -0
- package/resources/beta/organization/workspaces/index.mjs +6 -0
- package/resources/beta/organization/workspaces/index.mjs.map +1 -0
- package/resources/beta/organization/workspaces/members.d.mts +135 -0
- package/resources/beta/organization/workspaces/members.d.mts.map +1 -0
- package/resources/beta/organization/workspaces/members.d.ts +135 -0
- package/resources/beta/organization/workspaces/members.d.ts.map +1 -0
- package/resources/beta/organization/workspaces/members.js +102 -0
- package/resources/beta/organization/workspaces/members.js.map +1 -0
- package/resources/beta/organization/workspaces/members.mjs +98 -0
- package/resources/beta/organization/workspaces/members.mjs.map +1 -0
- package/resources/beta/organization/workspaces/rate-limits.d.mts +84 -0
- package/resources/beta/organization/workspaces/rate-limits.d.mts.map +1 -0
- package/resources/beta/organization/workspaces/rate-limits.d.ts +84 -0
- package/resources/beta/organization/workspaces/rate-limits.d.ts.map +1 -0
- package/resources/beta/organization/workspaces/rate-limits.js +35 -0
- package/resources/beta/organization/workspaces/rate-limits.js.map +1 -0
- package/resources/beta/organization/workspaces/rate-limits.mjs +31 -0
- package/resources/beta/organization/workspaces/rate-limits.mjs.map +1 -0
- package/resources/beta/organization/workspaces/service-accounts.d.mts +210 -0
- package/resources/beta/organization/workspaces/service-accounts.d.mts.map +1 -0
- package/resources/beta/organization/workspaces/service-accounts.d.ts +210 -0
- package/resources/beta/organization/workspaces/service-accounts.d.ts.map +1 -0
- package/resources/beta/organization/workspaces/service-accounts.js +189 -0
- package/resources/beta/organization/workspaces/service-accounts.js.map +1 -0
- package/resources/beta/organization/workspaces/service-accounts.mjs +185 -0
- package/resources/beta/organization/workspaces/service-accounts.mjs.map +1 -0
- package/resources/beta/organization/workspaces/workspaces.d.mts +287 -0
- package/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -0
- package/resources/beta/organization/workspaces/workspaces.d.ts +287 -0
- package/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -0
- package/resources/beta/organization/workspaces/workspaces.js +112 -0
- package/resources/beta/organization/workspaces/workspaces.js.map +1 -0
- package/resources/beta/organization/workspaces/workspaces.mjs +107 -0
- package/resources/beta/organization/workspaces/workspaces.mjs.map +1 -0
- package/resources/beta/organization/workspaces.d.mts +2 -0
- package/resources/beta/organization/workspaces.d.mts.map +1 -0
- package/resources/beta/organization/workspaces.d.ts +2 -0
- package/resources/beta/organization/workspaces.d.ts.map +1 -0
- package/resources/beta/organization/workspaces.js +6 -0
- package/resources/beta/organization/workspaces.js.map +1 -0
- package/resources/beta/organization/workspaces.mjs +3 -0
- package/resources/beta/organization/workspaces.mjs.map +1 -0
- package/resources/beta/organization.d.mts +2 -0
- package/resources/beta/organization.d.mts.map +1 -0
- package/resources/beta/organization.d.ts +2 -0
- package/resources/beta/organization.d.ts.map +1 -0
- package/resources/beta/organization.js +6 -0
- package/resources/beta/organization.js.map +1 -0
- package/resources/beta/organization.mjs +3 -0
- package/resources/beta/organization.mjs.map +1 -0
- package/resources/beta/sessions/threads/threads.d.mts +2 -1
- package/resources/beta/sessions/threads/threads.d.mts.map +1 -1
- package/resources/beta/sessions/threads/threads.d.ts +2 -1
- package/resources/beta/sessions/threads/threads.d.ts.map +1 -1
- package/resources/beta/sessions/threads/threads.js.map +1 -1
- package/resources/beta/sessions/threads/threads.mjs.map +1 -1
- package/resources/messages/messages.d.mts +1 -1
- package/resources/messages/messages.d.ts +1 -1
- package/src/helpers/beta/environments.ts +5 -4
- package/src/helpers/beta/standard-schema.ts +99 -0
- package/src/internal/detect-platform.ts +1 -1
- package/src/internal/file-store.ts +550 -0
- package/src/internal/utils/values.ts +7 -0
- package/src/lib/BetaMessageStream.ts +1 -3
- package/src/lib/MessageStream.ts +1 -3
- package/src/lib/environments/poller.ts +47 -1
- package/src/lib/environments/worker.ts +419 -79
- package/src/lib/sessions/accumulate.ts +1 -3
- package/src/lib/standard-schema.ts +209 -0
- package/src/lib/tools/BetaToolRunner.ts +38 -6
- package/src/resources/beta/agents/agents.ts +435 -30
- package/src/resources/beta/agents/index.ts +17 -0
- package/src/resources/beta/beta.ts +52 -1
- package/src/resources/beta/environments/environments.ts +8 -1
- package/src/resources/beta/environments/work.ts +7 -0
- package/src/resources/beta/index.ts +18 -0
- package/src/resources/beta/memory-stores/memories.ts +6 -5
- package/src/resources/beta/memory-stores/memory-versions.ts +8 -5
- package/src/resources/beta/messages/messages.ts +51 -9
- package/src/resources/beta/organization/api-keys.ts +231 -0
- package/src/resources/beta/organization/external-keys.ts +362 -0
- package/src/resources/beta/organization/federation/federation.ts +71 -0
- package/src/resources/beta/organization/federation/index.ts +31 -0
- package/src/resources/beta/organization/federation/issuers.ts +486 -0
- package/src/resources/beta/organization/federation/rules/index.ts +23 -0
- package/src/resources/beta/organization/federation/rules/rules.ts +624 -0
- package/src/resources/beta/organization/federation/rules/workspaces.ts +196 -0
- package/src/resources/beta/organization/federation/rules.ts +3 -0
- package/src/resources/beta/organization/federation.ts +3 -0
- package/src/resources/beta/organization/index.ts +83 -0
- package/src/resources/beta/organization/invites.ts +207 -0
- package/src/resources/beta/organization/organization.ts +245 -0
- package/src/resources/beta/organization/rate-limits.ts +105 -0
- package/src/resources/beta/organization/service-accounts/index.ts +21 -0
- package/src/resources/beta/organization/service-accounts/service-accounts.ts +389 -0
- package/src/resources/beta/organization/service-accounts/workspaces.ts +217 -0
- package/src/resources/beta/organization/service-accounts.ts +3 -0
- package/src/resources/beta/organization/users.ts +163 -0
- package/src/resources/beta/organization/workspaces/index.ts +43 -0
- package/src/resources/beta/organization/workspaces/members.ts +209 -0
- package/src/resources/beta/organization/workspaces/rate-limits.ts +114 -0
- package/src/resources/beta/organization/workspaces/service-accounts.ts +325 -0
- package/src/resources/beta/organization/workspaces/workspaces.ts +434 -0
- package/src/resources/beta/organization/workspaces.ts +3 -0
- package/src/resources/beta/organization.ts +3 -0
- package/src/resources/beta/sessions/threads/threads.ts +2 -1
- package/src/resources/messages/messages.ts +1 -1
- package/src/tools/agent-toolset/fs-util.ts +40 -24
- package/src/tools/agent-toolset/memories.ts +1017 -0
- package/src/tools/agent-toolset/node.browser.ts +69 -1
- package/src/tools/agent-toolset/node.ts +143 -57
- package/src/tools/agent-toolset/skills.ts +29 -9
- package/src/tools/agent-toolset/sync-interval.ts +30 -0
- package/src/version.ts +1 -1
- package/tools/agent-toolset/fs-util.d.mts +23 -10
- package/tools/agent-toolset/fs-util.d.mts.map +1 -1
- package/tools/agent-toolset/fs-util.d.ts +23 -10
- package/tools/agent-toolset/fs-util.d.ts.map +1 -1
- package/tools/agent-toolset/fs-util.js +40 -25
- package/tools/agent-toolset/fs-util.js.map +1 -1
- package/tools/agent-toolset/fs-util.mjs +38 -25
- package/tools/agent-toolset/fs-util.mjs.map +1 -1
- package/tools/agent-toolset/memories.d.mts +173 -0
- package/tools/agent-toolset/memories.d.mts.map +1 -0
- package/tools/agent-toolset/memories.d.ts +173 -0
- package/tools/agent-toolset/memories.d.ts.map +1 -0
- package/tools/agent-toolset/memories.js +902 -0
- package/tools/agent-toolset/memories.js.map +1 -0
- package/tools/agent-toolset/memories.mjs +895 -0
- package/tools/agent-toolset/memories.mjs.map +1 -0
- package/tools/agent-toolset/node.browser.d.mts +32 -1
- package/tools/agent-toolset/node.browser.d.mts.map +1 -1
- package/tools/agent-toolset/node.browser.d.ts +32 -1
- package/tools/agent-toolset/node.browser.d.ts.map +1 -1
- package/tools/agent-toolset/node.browser.js +59 -1
- package/tools/agent-toolset/node.browser.js.map +1 -1
- package/tools/agent-toolset/node.browser.mjs +54 -0
- package/tools/agent-toolset/node.browser.mjs.map +1 -1
- package/tools/agent-toolset/node.d.mts +56 -24
- package/tools/agent-toolset/node.d.mts.map +1 -1
- package/tools/agent-toolset/node.d.ts +56 -24
- package/tools/agent-toolset/node.d.ts.map +1 -1
- package/tools/agent-toolset/node.js +83 -44
- package/tools/agent-toolset/node.js.map +1 -1
- package/tools/agent-toolset/node.mjs +77 -44
- package/tools/agent-toolset/node.mjs.map +1 -1
- package/tools/agent-toolset/skills.d.mts +16 -7
- package/tools/agent-toolset/skills.d.mts.map +1 -1
- package/tools/agent-toolset/skills.d.ts +16 -7
- package/tools/agent-toolset/skills.d.ts.map +1 -1
- package/tools/agent-toolset/skills.js +27 -9
- package/tools/agent-toolset/skills.js.map +1 -1
- package/tools/agent-toolset/skills.mjs +27 -9
- package/tools/agent-toolset/skills.mjs.map +1 -1
- package/tools/agent-toolset/sync-interval.d.mts +19 -0
- package/tools/agent-toolset/sync-interval.d.mts.map +1 -0
- package/tools/agent-toolset/sync-interval.d.ts +19 -0
- package/tools/agent-toolset/sync-interval.d.ts.map +1 -0
- package/tools/agent-toolset/sync-interval.js +29 -0
- package/tools/agent-toolset/sync-interval.js.map +1 -0
- package/tools/agent-toolset/sync-interval.mjs +25 -0
- package/tools/agent-toolset/sync-interval.mjs.map +1 -0
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AnthropicError } from '../../core/error';
|
|
2
|
+
import { checkNever } from '../../internal/utils/values';
|
|
2
3
|
import type {
|
|
3
4
|
BetaManagedAgentsAgentMessageEvent,
|
|
4
5
|
BetaManagedAgentsStreamSessionEvents,
|
|
@@ -125,6 +126,3 @@ export function accumulateManagedAgentsEvent(
|
|
|
125
126
|
return accumulated;
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
|
-
|
|
129
|
-
// Compile-time exhaustiveness guard.
|
|
130
|
-
function checkNever(_x: never): void {}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { AnthropicError } from '../core/error';
|
|
2
|
+
|
|
3
|
+
// Standard Schema spec types, copied from `@standard-schema/spec@1.1.0` (MIT) as the spec
|
|
4
|
+
// recommends. See https://standardschema.dev
|
|
5
|
+
|
|
6
|
+
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
7
|
+
export interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
8
|
+
/** The Standard properties. */
|
|
9
|
+
readonly '~standard': StandardTypedV1.Props<Input, Output>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare namespace StandardTypedV1 {
|
|
13
|
+
/** The Standard Typed properties interface. */
|
|
14
|
+
interface Props<Input = unknown, Output = Input> {
|
|
15
|
+
/** The version number of the standard. */
|
|
16
|
+
readonly version: 1;
|
|
17
|
+
/** The vendor name of the schema library. */
|
|
18
|
+
readonly vendor: string;
|
|
19
|
+
/** Inferred types associated with the schema. */
|
|
20
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The Standard Typed types interface. */
|
|
24
|
+
interface Types<Input = unknown, Output = Input> {
|
|
25
|
+
/** The input type of the schema. */
|
|
26
|
+
readonly input: Input;
|
|
27
|
+
/** The output type of the schema. */
|
|
28
|
+
readonly output: Output;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Infers the input type of a Standard Typed. */
|
|
32
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['input'];
|
|
33
|
+
|
|
34
|
+
/** Infers the output type of a Standard Typed. */
|
|
35
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema['~standard']['types']>['output'];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The Standard Schema interface. */
|
|
39
|
+
export interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
40
|
+
/** The Standard Schema properties. */
|
|
41
|
+
readonly '~standard': StandardSchemaV1.Props<Input, Output>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare namespace StandardSchemaV1 {
|
|
45
|
+
/** The Standard Schema properties interface. */
|
|
46
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
47
|
+
/** Validates unknown input values. */
|
|
48
|
+
readonly validate: (
|
|
49
|
+
value: unknown,
|
|
50
|
+
options?: StandardSchemaV1.Options | undefined,
|
|
51
|
+
) => Result<Output> | Promise<Result<Output>>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The result interface of the validate function. */
|
|
55
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
56
|
+
|
|
57
|
+
/** The result interface if validation succeeds. */
|
|
58
|
+
interface SuccessResult<Output> {
|
|
59
|
+
/** The typed output value. */
|
|
60
|
+
readonly value: Output;
|
|
61
|
+
/** A falsy value for `issues` indicates success. */
|
|
62
|
+
readonly issues?: undefined;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface Options {
|
|
66
|
+
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
67
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** The result interface if validation fails. */
|
|
71
|
+
interface FailureResult {
|
|
72
|
+
/** The issues of failed validation. */
|
|
73
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** The issue interface of the failure output. */
|
|
77
|
+
interface Issue {
|
|
78
|
+
/** The error message of the issue. */
|
|
79
|
+
readonly message: string;
|
|
80
|
+
/** The path of the issue, if any. */
|
|
81
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** The path segment interface of the issue. */
|
|
85
|
+
interface PathSegment {
|
|
86
|
+
/** The key representing a path segment. */
|
|
87
|
+
readonly key: PropertyKey;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** The Standard types interface. */
|
|
91
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
92
|
+
|
|
93
|
+
/** Infers the input type of a Standard. */
|
|
94
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
95
|
+
|
|
96
|
+
/** Infers the output type of a Standard. */
|
|
97
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** The Standard JSON Schema interface. */
|
|
101
|
+
export interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
|
|
102
|
+
/** The Standard JSON Schema properties. */
|
|
103
|
+
readonly '~standard': StandardJSONSchemaV1.Props<Input, Output>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export declare namespace StandardJSONSchemaV1 {
|
|
107
|
+
/** The Standard JSON Schema properties interface. */
|
|
108
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
109
|
+
/** Methods for generating the input/output JSON Schema. */
|
|
110
|
+
readonly jsonSchema: StandardJSONSchemaV1.Converter;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** The Standard JSON Schema converter interface. */
|
|
114
|
+
interface Converter {
|
|
115
|
+
/** Converts the input type to JSON Schema. May throw if conversion is not supported. */
|
|
116
|
+
readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
117
|
+
/** Converts the output type to JSON Schema. May throw if conversion is not supported. */
|
|
118
|
+
readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The target version of the generated JSON Schema.
|
|
123
|
+
*
|
|
124
|
+
* It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they
|
|
125
|
+
* are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should
|
|
126
|
+
* throw if they don't support a specified target.
|
|
127
|
+
*
|
|
128
|
+
* The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a
|
|
129
|
+
* superset of JSON Schema `"draft-04"`.
|
|
130
|
+
*/
|
|
131
|
+
type Target = 'draft-2020-12' | 'draft-07' | 'openapi-3.0' | ({} & string);
|
|
132
|
+
|
|
133
|
+
/** The options for the input/output methods. */
|
|
134
|
+
interface Options {
|
|
135
|
+
/** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
|
|
136
|
+
readonly target: Target;
|
|
137
|
+
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
138
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** The Standard types interface. */
|
|
142
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
143
|
+
|
|
144
|
+
/** Infers the input type of a Standard. */
|
|
145
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
146
|
+
|
|
147
|
+
/** Infers the output type of a Standard. */
|
|
148
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Returns `jsonSchema` if given, otherwise the schema's Standard JSON Schema `input`
|
|
153
|
+
* representation (the model produces the value that the validator consumes).
|
|
154
|
+
*/
|
|
155
|
+
export function standardSchemaToJSONSchema(
|
|
156
|
+
schema: StandardSchemaV1,
|
|
157
|
+
jsonSchema?: Record<string, unknown> | undefined,
|
|
158
|
+
): Record<string, unknown> {
|
|
159
|
+
if (jsonSchema) {
|
|
160
|
+
return jsonSchema;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const std: StandardSchemaV1.Props & Partial<StandardJSONSchemaV1.Props> = schema['~standard'];
|
|
164
|
+
if (std.jsonSchema) {
|
|
165
|
+
return std.jsonSchema.input({ target: 'draft-2020-12' });
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
throw new AnthropicError(
|
|
169
|
+
`Could not derive a JSON Schema from this ${std.vendor} schema as it does not implement Standard JSON Schema (\`~standard.jsonSchema\`). Pass the \`jsonSchema\` option, or use a library version that implements it (e.g. zod >= 4.2, or valibot via \`toStandardJsonSchema()\`).`,
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Validates `value` with `~standard.validate` and returns the typed output, throwing an
|
|
175
|
+
* `AnthropicError` on issues. Validation must be synchronous because `parse` hooks are.
|
|
176
|
+
*/
|
|
177
|
+
export function parseWithStandardSchema<Schema extends StandardSchemaV1>(
|
|
178
|
+
schema: Schema,
|
|
179
|
+
value: unknown,
|
|
180
|
+
): StandardSchemaV1.InferOutput<Schema> {
|
|
181
|
+
const result = schema['~standard'].validate(value);
|
|
182
|
+
|
|
183
|
+
if (result instanceof Promise) {
|
|
184
|
+
// avoid an unhandled rejection from the discarded result
|
|
185
|
+
result.catch(() => {});
|
|
186
|
+
throw new AnthropicError(
|
|
187
|
+
`Async validation is not supported: the ${schema['~standard'].vendor} schema's \`~standard.validate()\` returned a Promise.`,
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (result.issues) {
|
|
192
|
+
const formattedIssues = result.issues.slice(0, 5).map(formatIssue).join('\n');
|
|
193
|
+
const issueCount = result.issues.length;
|
|
194
|
+
const suffix = issueCount > 5 ? `\n ... and ${issueCount - 5} more issue(s)` : '';
|
|
195
|
+
|
|
196
|
+
throw new AnthropicError(
|
|
197
|
+
`Schema validation failed with ${issueCount} issue(s):\n${formattedIssues}${suffix}`,
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return result.value;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function formatIssue(issue: StandardSchemaV1.Issue): string {
|
|
205
|
+
const path = (issue.path ?? [])
|
|
206
|
+
.map((segment) => String(typeof segment === 'object' ? segment.key : segment))
|
|
207
|
+
.join('.');
|
|
208
|
+
return path ? ` - ${path}: ${issue.message}` : ` - ${issue.message}`;
|
|
209
|
+
}
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
BetaMessageParam,
|
|
9
9
|
BetaRequestToolAdditionBlock,
|
|
10
10
|
BetaRequestToolRemovalBlock,
|
|
11
|
+
BetaStopReason,
|
|
11
12
|
BetaToolChangeMCPToolReference,
|
|
12
13
|
BetaToolChangeMCPToolsetReference,
|
|
13
14
|
BetaToolChangeToolReference,
|
|
@@ -18,6 +19,7 @@ import { BetaMessageStream } from '../BetaMessageStream';
|
|
|
18
19
|
import { RequestOptions } from '../../internal/request-options';
|
|
19
20
|
import { buildHeaders } from '../../internal/headers';
|
|
20
21
|
import { promiseWithResolvers } from '../../internal/utils/promise';
|
|
22
|
+
import { checkNever } from '../../internal/utils/values';
|
|
21
23
|
import { CompactionControl, DEFAULT_SUMMARY_PROMPT, DEFAULT_TOKEN_THRESHOLD } from './CompactionControl';
|
|
22
24
|
import {
|
|
23
25
|
collectStainlessHelpers,
|
|
@@ -220,6 +222,7 @@ export class BetaToolRunner<Stream extends boolean> {
|
|
|
220
222
|
if (!isCompacted) {
|
|
221
223
|
if (!this.#mutated) {
|
|
222
224
|
const message = await this.#message;
|
|
225
|
+
const nextStep = determineNextStepFromStopReason(message.stop_reason);
|
|
223
226
|
this.#state.params.messages.push({ role: message.role, content: message.content });
|
|
224
227
|
|
|
225
228
|
// Container-bound server tools reject a follow-up request that omits the container the
|
|
@@ -233,14 +236,12 @@ export class BetaToolRunner<Stream extends boolean> {
|
|
|
233
236
|
}
|
|
234
237
|
}
|
|
235
238
|
|
|
236
|
-
|
|
237
|
-
// with partial input, so executing this turn's tools would fire side effects the
|
|
238
|
-
// model never confirmed — and once middleware strips the refusal turn, their
|
|
239
|
-
// tool_results could never be replayed coherently. Surface the refusal as the
|
|
240
|
-
// final message instead.
|
|
241
|
-
if (message.stop_reason === 'refusal') {
|
|
239
|
+
if (nextStep === 'stop') {
|
|
242
240
|
break;
|
|
243
241
|
}
|
|
242
|
+
if (nextStep === 'resume') {
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
244
245
|
}
|
|
245
246
|
|
|
246
247
|
const toolMessage = await this.#generateToolResponse(this.#state.params.messages.at(-1)!);
|
|
@@ -612,6 +613,37 @@ function referencedToolName(
|
|
|
612
613
|
}
|
|
613
614
|
}
|
|
614
615
|
|
|
616
|
+
type NextStep = 'run_tools' | 'resume' | 'stop';
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Sorts every stop reason into one of three buckets: `run_tools` turns run their client tool
|
|
620
|
+
* calls and continue the loop; `resume` turns are sent back unchanged so the server continues
|
|
621
|
+
* them; `stop` turns end the loop without running any tool calls.
|
|
622
|
+
*/
|
|
623
|
+
function determineNextStepFromStopReason(stopReason: BetaStopReason | null): NextStep {
|
|
624
|
+
if (stopReason === null) return 'stop';
|
|
625
|
+
switch (stopReason) {
|
|
626
|
+
case 'tool_use':
|
|
627
|
+
return 'run_tools';
|
|
628
|
+
case 'pause_turn':
|
|
629
|
+
// pause_after_compaction hands the turn back before the model answers; sending it back
|
|
630
|
+
// unchanged continues it.
|
|
631
|
+
case 'compaction':
|
|
632
|
+
return 'resume';
|
|
633
|
+
case 'end_turn':
|
|
634
|
+
case 'stop_sequence':
|
|
635
|
+
case 'max_tokens':
|
|
636
|
+
case 'model_context_window_exceeded':
|
|
637
|
+
case 'refusal':
|
|
638
|
+
return 'stop';
|
|
639
|
+
default:
|
|
640
|
+
// The union is forward-compatible, so a stop reason this SDK doesn't know yet ends the
|
|
641
|
+
// loop rather than throwing; the `never` check makes tsc reject an unclassified member.
|
|
642
|
+
checkNever(stopReason);
|
|
643
|
+
return 'stop';
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
|
|
615
647
|
// vendored from typefest just to make things look a bit nicer on hover
|
|
616
648
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
617
649
|
|