@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
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../../core/resource';
|
|
4
|
+
import * as BetaAPI from '../../beta';
|
|
5
|
+
import * as MembersAPI from './members';
|
|
6
|
+
import {
|
|
7
|
+
MemberAddParams,
|
|
8
|
+
MemberListParams,
|
|
9
|
+
MemberRemoveParams,
|
|
10
|
+
MemberRemoveResponse,
|
|
11
|
+
MemberRetrieveParams,
|
|
12
|
+
MemberUpdateParams,
|
|
13
|
+
Members,
|
|
14
|
+
} from './members';
|
|
15
|
+
import * as RateLimitsAPI from './rate-limits';
|
|
16
|
+
import {
|
|
17
|
+
BetaWorkspaceRateLimit,
|
|
18
|
+
BetaWorkspaceRateLimitValue,
|
|
19
|
+
BetaWorkspaceRateLimitsPageCursor,
|
|
20
|
+
RateLimitListParams,
|
|
21
|
+
RateLimits,
|
|
22
|
+
} from './rate-limits';
|
|
23
|
+
import * as ServiceAccountsAPI from './service-accounts';
|
|
24
|
+
import {
|
|
25
|
+
ServiceAccountAddParams,
|
|
26
|
+
ServiceAccountListParams,
|
|
27
|
+
ServiceAccountRemoveParams,
|
|
28
|
+
ServiceAccountRemoveResponse,
|
|
29
|
+
ServiceAccountRetrieveParams,
|
|
30
|
+
ServiceAccountUpdateParams,
|
|
31
|
+
ServiceAccounts,
|
|
32
|
+
} from './service-accounts';
|
|
33
|
+
import { APIPromise } from '../../../../core/api-promise';
|
|
34
|
+
import { Page, type PageParams, PagePromise } from '../../../../core/pagination';
|
|
35
|
+
import { buildHeaders } from '../../../../internal/headers';
|
|
36
|
+
import { RequestOptions } from '../../../../internal/request-options';
|
|
37
|
+
import { path } from '../../../../internal/utils/path';
|
|
38
|
+
|
|
39
|
+
export class Workspaces extends APIResource {
|
|
40
|
+
rateLimits: RateLimitsAPI.RateLimits = new RateLimitsAPI.RateLimits(this._client);
|
|
41
|
+
members: MembersAPI.Members = new MembersAPI.Members(this._client);
|
|
42
|
+
serviceAccounts: ServiceAccountsAPI.ServiceAccounts = new ServiceAccountsAPI.ServiceAccounts(this._client);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Create Workspace
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const betaWorkspace =
|
|
50
|
+
* await client.beta.organization.workspaces.create({
|
|
51
|
+
* name: 'x',
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
create(params: WorkspaceCreateParams, options?: RequestOptions): APIPromise<BetaWorkspace> {
|
|
56
|
+
const { betas, ...body } = params;
|
|
57
|
+
return this._client.post('/v1/organizations/workspaces?beta=true', {
|
|
58
|
+
body,
|
|
59
|
+
...options,
|
|
60
|
+
headers: buildHeaders([
|
|
61
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
62
|
+
options?.headers,
|
|
63
|
+
]),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get Workspace
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const betaWorkspace =
|
|
73
|
+
* await client.beta.organization.workspaces.retrieve(
|
|
74
|
+
* 'workspace_id',
|
|
75
|
+
* );
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
retrieve(workspaceID: string, options?: RequestOptions): APIPromise<BetaWorkspace> {
|
|
79
|
+
return this._client.get(path`/v1/organizations/workspaces/${workspaceID}?beta=true`, options);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Update Workspace
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* const betaWorkspace =
|
|
88
|
+
* await client.beta.organization.workspaces.update(
|
|
89
|
+
* 'workspace_id',
|
|
90
|
+
* );
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
update(
|
|
94
|
+
workspaceID: string,
|
|
95
|
+
body: WorkspaceUpdateParams,
|
|
96
|
+
options?: RequestOptions,
|
|
97
|
+
): APIPromise<BetaWorkspace> {
|
|
98
|
+
return this._client.post(path`/v1/organizations/workspaces/${workspaceID}?beta=true`, {
|
|
99
|
+
body,
|
|
100
|
+
...options,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* List Workspaces
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* // Automatically fetches more pages as needed.
|
|
110
|
+
* for await (const betaWorkspace of client.beta.organization.workspaces.list()) {
|
|
111
|
+
* // ...
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
list(
|
|
116
|
+
query: WorkspaceListParams | null | undefined = {},
|
|
117
|
+
options?: RequestOptions,
|
|
118
|
+
): PagePromise<BetaWorkspacesPage, BetaWorkspace> {
|
|
119
|
+
return this._client.getAPIList('/v1/organizations/workspaces?beta=true', Page<BetaWorkspace>, {
|
|
120
|
+
query,
|
|
121
|
+
...options,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Archive Workspace
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* const betaWorkspace =
|
|
131
|
+
* await client.beta.organization.workspaces.archive(
|
|
132
|
+
* 'workspace_id',
|
|
133
|
+
* );
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
archive(workspaceID: string, options?: RequestOptions): APIPromise<BetaWorkspace> {
|
|
137
|
+
return this._client.post(path`/v1/organizations/workspaces/${workspaceID}/archive?beta=true`, options);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export type BetaWorkspacesPage = Page<BetaWorkspace>;
|
|
142
|
+
|
|
143
|
+
export type BetaWorkspaceMembersPage = Page<BetaWorkspaceMember>;
|
|
144
|
+
|
|
145
|
+
export type BetaAllowedInferenceGeo = 'global' | 'us';
|
|
146
|
+
|
|
147
|
+
export interface BetaDataResidency {
|
|
148
|
+
/**
|
|
149
|
+
* Permitted inference geo values. 'unrestricted' means all geos are allowed.
|
|
150
|
+
*/
|
|
151
|
+
allowed_inference_geos: Array<string> | 'unrestricted';
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Default inference geo applied when requests omit the parameter.
|
|
155
|
+
*/
|
|
156
|
+
default_inference_geo: string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Geographic region for workspace data storage. Immutable after creation.
|
|
160
|
+
*/
|
|
161
|
+
workspace_geo: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface BetaDataResidencyCreateConfig {
|
|
165
|
+
/**
|
|
166
|
+
* Permitted inference geo values. Defaults to 'unrestricted' if omitted, which
|
|
167
|
+
* allows all geos. Use the string 'unrestricted' to allow all geos, or a list of
|
|
168
|
+
* specific geos.
|
|
169
|
+
*/
|
|
170
|
+
allowed_inference_geos?: Array<BetaAllowedInferenceGeo> | 'unrestricted' | null;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Default inference geo applied when requests omit the parameter. Defaults to
|
|
174
|
+
* 'global' if omitted. Must be a member of `allowed_inference_geos` unless
|
|
175
|
+
* `allowed_inference_geos` is `"unrestricted"`.
|
|
176
|
+
*/
|
|
177
|
+
default_inference_geo?: 'global' | 'us' | null;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Geographic region for workspace data storage. Immutable after creation. Defaults
|
|
181
|
+
* to 'us' if omitted.
|
|
182
|
+
*/
|
|
183
|
+
workspace_geo?: 'us' | null;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface BetaDataResidencyUpdateConfig {
|
|
187
|
+
/**
|
|
188
|
+
* Permitted inference geo values. Use 'unrestricted' to allow all geos, or a list
|
|
189
|
+
* of specific geos.
|
|
190
|
+
*/
|
|
191
|
+
allowed_inference_geos?: Array<BetaAllowedInferenceGeo> | 'unrestricted' | null;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Default inference geo applied when requests omit the parameter. Must be a member
|
|
195
|
+
* of `allowed_inference_geos` unless `allowed_inference_geos` is `"unrestricted"`.
|
|
196
|
+
*/
|
|
197
|
+
default_inference_geo?: 'global' | 'us' | null;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export type BetaNoBillingWorkspaceRole =
|
|
201
|
+
| 'workspace_admin'
|
|
202
|
+
| 'workspace_developer'
|
|
203
|
+
| 'workspace_restricted_developer'
|
|
204
|
+
| 'workspace_user';
|
|
205
|
+
|
|
206
|
+
export interface BetaWorkspace {
|
|
207
|
+
/**
|
|
208
|
+
* ID of the Workspace.
|
|
209
|
+
*/
|
|
210
|
+
id: string;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* RFC 3339 datetime string indicating when the Workspace was archived, or `null`
|
|
214
|
+
* if the Workspace is not archived.
|
|
215
|
+
*/
|
|
216
|
+
archived_at: string | null;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Identifier for this Workspace's encryption compartment. When you configure a
|
|
220
|
+
* customer-managed encryption key (CMEK) on AWS, reference this value in your KMS
|
|
221
|
+
* key-policy condition so the key is scoped to this compartment. On GCP and Azure,
|
|
222
|
+
* Anthropic enforces the compartment binding automatically; you do not need to
|
|
223
|
+
* reference this value in your key configuration. See the CMEK integration guide
|
|
224
|
+
* for the required key configuration, including the value used during key
|
|
225
|
+
* validation.
|
|
226
|
+
*/
|
|
227
|
+
compartment_id: string;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* RFC 3339 datetime string indicating when the Workspace was created.
|
|
231
|
+
*/
|
|
232
|
+
created_at: string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Data residency configuration.
|
|
236
|
+
*/
|
|
237
|
+
data_residency: BetaDataResidency;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Hex color code representing the Workspace in the Anthropic Console.
|
|
241
|
+
*/
|
|
242
|
+
display_color: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* ID of the customer-managed encryption key (CMEK) configuration to use for this
|
|
246
|
+
* Workspace. Setting this field requires CMEK to be enabled for your organization.
|
|
247
|
+
* When set, data stored for this Workspace is encrypted with the referenced key.
|
|
248
|
+
* Create key configurations with the External Keys API. This field is write-once:
|
|
249
|
+
* once a key is attached to a Workspace it cannot be detached or replaced. To
|
|
250
|
+
* rotate key material, rotate the underlying key on your cloud KMS; the
|
|
251
|
+
* `external_key_id` stays the same.
|
|
252
|
+
*/
|
|
253
|
+
external_key_id: string | null;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Name of the Workspace.
|
|
257
|
+
*/
|
|
258
|
+
name: string;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* User-defined tags as string key-value pairs. Keys may not begin with
|
|
262
|
+
* `anthropic`.
|
|
263
|
+
*/
|
|
264
|
+
tags: { [key: string]: string };
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Object type.
|
|
268
|
+
*
|
|
269
|
+
* For Workspaces, this is always `"workspace"`.
|
|
270
|
+
*/
|
|
271
|
+
type: 'workspace';
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface BetaWorkspaceMember {
|
|
275
|
+
/**
|
|
276
|
+
* Object type.
|
|
277
|
+
*
|
|
278
|
+
* For Workspace Members, this is always `"workspace_member"`.
|
|
279
|
+
*/
|
|
280
|
+
type: 'workspace_member';
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* ID of the User.
|
|
284
|
+
*/
|
|
285
|
+
user_id: string;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* ID of the Workspace.
|
|
289
|
+
*/
|
|
290
|
+
workspace_id: string;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Role of the Workspace Member.
|
|
294
|
+
*/
|
|
295
|
+
workspace_role: BetaWorkspaceRole;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export type BetaWorkspaceRole =
|
|
299
|
+
| 'workspace_admin'
|
|
300
|
+
| 'workspace_billing'
|
|
301
|
+
| 'workspace_developer'
|
|
302
|
+
| 'workspace_restricted_developer'
|
|
303
|
+
| 'workspace_user';
|
|
304
|
+
|
|
305
|
+
export interface WorkspaceCreateParams {
|
|
306
|
+
/**
|
|
307
|
+
* Body param: Name of the Workspace.
|
|
308
|
+
*/
|
|
309
|
+
name: string;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Body param: Data residency configuration for the workspace. If omitted, defaults
|
|
313
|
+
* to `workspace_geo: "us"`, `allowed_inference_geos: "unrestricted"`, and
|
|
314
|
+
* `default_inference_geo: "global"`.
|
|
315
|
+
*/
|
|
316
|
+
data_residency?: BetaDataResidencyCreateConfig | null;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Body param: Hex color code representing the Workspace in the Anthropic Console.
|
|
320
|
+
*/
|
|
321
|
+
display_color?: string | null;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Body param: ID of the customer-managed encryption key (CMEK) configuration to
|
|
325
|
+
* use for this Workspace. Setting this field requires CMEK to be enabled for your
|
|
326
|
+
* organization. When set, data stored for this Workspace is encrypted with the
|
|
327
|
+
* referenced key. Create key configurations with the External Keys API. This field
|
|
328
|
+
* is write-once: once a key is attached to a Workspace it cannot be detached or
|
|
329
|
+
* replaced. To rotate key material, rotate the underlying key on your cloud KMS;
|
|
330
|
+
* the `external_key_id` stays the same.
|
|
331
|
+
*/
|
|
332
|
+
external_key_id?: string | null;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Body param: User-defined tags as string key-value pairs. Keys may not begin with
|
|
336
|
+
* `anthropic`.
|
|
337
|
+
*/
|
|
338
|
+
tags?: { [key: string]: string } | null;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
342
|
+
*/
|
|
343
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export interface WorkspaceUpdateParams {
|
|
347
|
+
/**
|
|
348
|
+
* Data residency configuration for the workspace.
|
|
349
|
+
*/
|
|
350
|
+
data_residency?: BetaDataResidencyUpdateConfig | null;
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Hex color code representing the Workspace in the Anthropic Console.
|
|
354
|
+
*/
|
|
355
|
+
display_color?: string;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* ID of the customer-managed encryption key (CMEK) configuration to use for this
|
|
359
|
+
* Workspace. Setting this field requires CMEK to be enabled for your organization.
|
|
360
|
+
* When set, data stored for this Workspace is encrypted with the referenced key.
|
|
361
|
+
* Create key configurations with the External Keys API. This field is write-once:
|
|
362
|
+
* once a key is attached to a Workspace it cannot be detached or replaced. To
|
|
363
|
+
* rotate key material, rotate the underlying key on your cloud KMS; the
|
|
364
|
+
* `external_key_id` stays the same.
|
|
365
|
+
*/
|
|
366
|
+
external_key_id?: string;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Name of the Workspace.
|
|
370
|
+
*/
|
|
371
|
+
name?: string;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* User-defined tags as string key-value pairs. Keys may not begin with
|
|
375
|
+
* `anthropic`.
|
|
376
|
+
*/
|
|
377
|
+
tags?: { [key: string]: string | null } | null;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export interface WorkspaceListParams extends PageParams {
|
|
381
|
+
/**
|
|
382
|
+
* Whether to include Workspaces that have been archived in the response
|
|
383
|
+
*/
|
|
384
|
+
include_archived?: boolean;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
Workspaces.RateLimits = RateLimits;
|
|
388
|
+
Workspaces.Members = Members;
|
|
389
|
+
Workspaces.ServiceAccounts = ServiceAccounts;
|
|
390
|
+
|
|
391
|
+
export declare namespace Workspaces {
|
|
392
|
+
export {
|
|
393
|
+
type BetaAllowedInferenceGeo as BetaAllowedInferenceGeo,
|
|
394
|
+
type BetaDataResidency as BetaDataResidency,
|
|
395
|
+
type BetaDataResidencyCreateConfig as BetaDataResidencyCreateConfig,
|
|
396
|
+
type BetaDataResidencyUpdateConfig as BetaDataResidencyUpdateConfig,
|
|
397
|
+
type BetaNoBillingWorkspaceRole as BetaNoBillingWorkspaceRole,
|
|
398
|
+
type BetaWorkspace as BetaWorkspace,
|
|
399
|
+
type BetaWorkspaceMember as BetaWorkspaceMember,
|
|
400
|
+
type BetaWorkspaceRole as BetaWorkspaceRole,
|
|
401
|
+
type BetaWorkspacesPage as BetaWorkspacesPage,
|
|
402
|
+
type WorkspaceCreateParams as WorkspaceCreateParams,
|
|
403
|
+
type WorkspaceUpdateParams as WorkspaceUpdateParams,
|
|
404
|
+
type WorkspaceListParams as WorkspaceListParams,
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
export {
|
|
408
|
+
RateLimits as RateLimits,
|
|
409
|
+
type BetaWorkspaceRateLimit as BetaWorkspaceRateLimit,
|
|
410
|
+
type BetaWorkspaceRateLimitValue as BetaWorkspaceRateLimitValue,
|
|
411
|
+
type BetaWorkspaceRateLimitsPageCursor as BetaWorkspaceRateLimitsPageCursor,
|
|
412
|
+
type RateLimitListParams as RateLimitListParams,
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
export {
|
|
416
|
+
Members as Members,
|
|
417
|
+
type MemberRemoveResponse as MemberRemoveResponse,
|
|
418
|
+
type MemberRetrieveParams as MemberRetrieveParams,
|
|
419
|
+
type MemberUpdateParams as MemberUpdateParams,
|
|
420
|
+
type MemberListParams as MemberListParams,
|
|
421
|
+
type MemberAddParams as MemberAddParams,
|
|
422
|
+
type MemberRemoveParams as MemberRemoveParams,
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
export {
|
|
426
|
+
ServiceAccounts as ServiceAccounts,
|
|
427
|
+
type ServiceAccountRemoveResponse as ServiceAccountRemoveResponse,
|
|
428
|
+
type ServiceAccountRetrieveParams as ServiceAccountRetrieveParams,
|
|
429
|
+
type ServiceAccountUpdateParams as ServiceAccountUpdateParams,
|
|
430
|
+
type ServiceAccountListParams as ServiceAccountListParams,
|
|
431
|
+
type ServiceAccountAddParams as ServiceAccountAddParams,
|
|
432
|
+
type ServiceAccountRemoveParams as ServiceAccountRemoveParams,
|
|
433
|
+
};
|
|
434
|
+
}
|
|
@@ -117,7 +117,8 @@ export interface BetaManagedAgentsSessionThread {
|
|
|
117
117
|
id: string;
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
120
|
+
* The resolved agent a session thread runs: a saved-agent snapshot, the platform
|
|
121
|
+
* advisor entry, or an inline-defined (ephemeral) agent snapshot.
|
|
121
122
|
*/
|
|
122
123
|
agent: AgentsAPI.BetaManagedAgentsSessionThreadAgent | AgentsAPI.BetaManagedAgentsAdvisor;
|
|
123
124
|
|
|
@@ -15,13 +15,25 @@ export const DIR_CREATE_MODE = 0o755;
|
|
|
15
15
|
/** Mode for files the file tools create. */
|
|
16
16
|
export const FILE_CREATE_MODE = 0o644;
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
/** True when `p` is `root` itself or lexically contained within it. */
|
|
19
|
+
export function isWithin(root: string, p: string): boolean {
|
|
20
|
+
const rel = path.relative(root, p);
|
|
21
|
+
return rel === '' || (!rel.startsWith('..' + path.sep) && rel !== '..' && !path.isAbsolute(rel));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The first entry of `roots` whose canonical form contains the
|
|
26
|
+
* already-canonical `target`, returned as configured; `undefined` when none
|
|
27
|
+
* does. Each root goes through {@link canonicalize} at check time, exactly like
|
|
28
|
+
* the workdir in {@link confineToRoot}, so granting access (`allowedRoots`)
|
|
29
|
+
* and refusing writes (`readOnlyRoots`) can never resolve the same entry two
|
|
30
|
+
* different ways.
|
|
31
|
+
*/
|
|
32
|
+
export async function containingRoot(roots: readonly string[], target: string): Promise<string | undefined> {
|
|
33
|
+
for (const root of roots) {
|
|
34
|
+
if (isWithin(await canonicalize(path.resolve(root)), target)) return root;
|
|
24
35
|
}
|
|
36
|
+
return undefined;
|
|
25
37
|
}
|
|
26
38
|
|
|
27
39
|
/** Matches Linux MAXSYMLINKS, the threshold at which `realpath` itself reports ELOOP. */
|
|
@@ -79,17 +91,19 @@ export async function canonicalize(abs: string): Promise<string> {
|
|
|
79
91
|
}
|
|
80
92
|
|
|
81
93
|
/**
|
|
82
|
-
* Resolve `p` and confine it to `root
|
|
94
|
+
* Resolve `p` against `root` and confine it to `root` or one of `allowedRoots`
|
|
95
|
+
* (absolute paths, resolved at check time exactly like `root`).
|
|
83
96
|
*
|
|
84
97
|
* Absolute and relative inputs go through the same canonicalise-then-contain
|
|
85
|
-
* check — an absolute path that lands inside
|
|
86
|
-
* that resolve *outside* are rejected. Every symlink in
|
|
87
|
-
* leaf, even a dangling one) is resolved before the
|
|
88
|
-
* resolved path is what the caller then operates
|
|
89
|
-
* that points outside it can neither pass the
|
|
90
|
-
* `..` is collapsed lexically before any
|
|
91
|
-
* be resolved (symlink loop, unreadable
|
|
92
|
-
* `ToolError` naming `p`, never the host's
|
|
98
|
+
* check — an absolute path that lands inside a permitted root is accepted,
|
|
99
|
+
* only paths that resolve *outside* all of them are rejected. Every symlink in
|
|
100
|
+
* `p` (including the leaf, even a dangling one) is resolved before the
|
|
101
|
+
* confinement check, and the resolved path is what the caller then operates
|
|
102
|
+
* on, so a symlink inside `root` that points outside it can neither pass the
|
|
103
|
+
* check nor be followed afterwards. `..` is collapsed lexically before any
|
|
104
|
+
* symlink is followed. A path that cannot be resolved (symlink loop, unreadable
|
|
105
|
+
* component) is rejected with a `ToolError` naming `p`, never the host's
|
|
106
|
+
* absolute path.
|
|
93
107
|
*
|
|
94
108
|
* Residual TOCTOU: a component could still be swapped for a symlink between this
|
|
95
109
|
* call and the eventual `fs` operation. Closing that fully needs per-component
|
|
@@ -99,22 +113,24 @@ export async function canonicalize(abs: string): Promise<string> {
|
|
|
99
113
|
export async function confineToRoot(
|
|
100
114
|
root: string,
|
|
101
115
|
p: string,
|
|
102
|
-
opts?: {
|
|
116
|
+
opts?: { allowedRoots?: readonly string[] },
|
|
103
117
|
): Promise<string> {
|
|
104
|
-
const
|
|
105
|
-
const realRoot = await
|
|
106
|
-
const abs = path.resolve(realRoot, p);
|
|
107
|
-
if (allowOutside) return abs;
|
|
118
|
+
const allowedRoots = opts?.allowedRoots ?? [];
|
|
119
|
+
const realRoot = await canonicalize(path.resolve(root));
|
|
108
120
|
let real: string;
|
|
109
121
|
try {
|
|
110
|
-
real = await canonicalize(
|
|
122
|
+
real = await canonicalize(path.resolve(realRoot, p));
|
|
111
123
|
} catch (err) {
|
|
112
124
|
throw new ToolError(fsErrorMessage(err, `path ${JSON.stringify(p)}`));
|
|
113
125
|
}
|
|
114
|
-
if (real
|
|
115
|
-
|
|
126
|
+
if (isWithin(realRoot, real) || (await containingRoot(allowedRoots, real)) !== undefined) {
|
|
127
|
+
return real;
|
|
116
128
|
}
|
|
117
|
-
|
|
129
|
+
const permitted =
|
|
130
|
+
allowedRoots.length ?
|
|
131
|
+
"the session's working directory and its other permitted directories"
|
|
132
|
+
: "the session's working directory";
|
|
133
|
+
throw new ToolError(`path ${JSON.stringify(p)} is outside ${permitted}`);
|
|
118
134
|
}
|
|
119
135
|
|
|
120
136
|
/**
|