@anthropic-ai/sdk 0.122.0 → 0.124.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 +62 -0
- package/client.d.mts +6 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -5
- package/client.d.ts.map +1 -1
- package/client.js +2 -1
- package/client.js.map +1 -1
- package/client.mjs +2 -1
- package/client.mjs.map +1 -1
- package/core/credentials.d.mts.map +1 -1
- package/core/credentials.d.ts.map +1 -1
- package/core/credentials.js +5 -7
- package/core/credentials.js.map +1 -1
- package/core/credentials.mjs +5 -7
- package/core/credentials.mjs.map +1 -1
- package/core/streaming.js +4 -2
- package/core/streaming.js.map +1 -1
- package/core/streaming.mjs +4 -2
- package/core/streaming.mjs.map +1 -1
- package/internal/file-store.d.mts.map +1 -1
- package/internal/file-store.d.ts.map +1 -1
- package/internal/file-store.js +23 -25
- package/internal/file-store.js.map +1 -1
- package/internal/file-store.mjs +5 -6
- package/internal/file-store.mjs.map +1 -1
- package/internal/node.browser.d.mts +9 -0
- package/internal/node.browser.d.mts.map +1 -0
- package/internal/node.browser.d.ts +9 -0
- package/internal/node.browser.d.ts.map +1 -0
- package/internal/node.browser.js +22 -0
- package/internal/node.browser.js.map +1 -0
- package/internal/node.browser.mjs +19 -0
- package/internal/node.browser.mjs.map +1 -0
- package/internal/node.d.mts +14 -0
- package/internal/node.d.mts.map +1 -0
- package/internal/node.d.ts +14 -0
- package/internal/node.d.ts.map +1 -0
- package/internal/node.js +24 -0
- package/internal/node.js.map +1 -0
- package/internal/node.mjs +14 -0
- package/internal/node.mjs.map +1 -0
- package/lib/BetaMessageStream.d.mts.map +1 -1
- package/lib/BetaMessageStream.d.ts.map +1 -1
- package/lib/BetaMessageStream.js +3 -0
- package/lib/BetaMessageStream.js.map +1 -1
- package/lib/BetaMessageStream.mjs +3 -0
- package/lib/BetaMessageStream.mjs.map +1 -1
- package/lib/credentials/credential-chain.js +1 -1
- package/lib/credentials/credential-chain.js.map +1 -1
- package/lib/credentials/credential-chain.mjs +1 -1
- package/lib/credentials/credential-chain.mjs.map +1 -1
- package/lib/credentials/identity-token.js +1 -1
- package/lib/credentials/identity-token.js.map +1 -1
- package/lib/credentials/identity-token.mjs +1 -1
- package/lib/credentials/identity-token.mjs.map +1 -1
- package/lib/credentials/types.d.mts.map +1 -1
- package/lib/credentials/types.d.ts.map +1 -1
- package/lib/credentials/types.js +2 -3
- package/lib/credentials/types.js.map +1 -1
- package/lib/credentials/types.mjs +2 -3
- package/lib/credentials/types.mjs.map +1 -1
- package/lib/credentials/user-oauth.js +1 -1
- package/lib/credentials/user-oauth.js.map +1 -1
- package/lib/credentials/user-oauth.mjs +1 -1
- package/lib/credentials/user-oauth.mjs.map +1 -1
- package/lib/middleware.d.mts.map +1 -1
- package/lib/middleware.d.ts.map +1 -1
- package/lib/middleware.js +30 -7
- package/lib/middleware.js.map +1 -1
- package/lib/middleware.mjs +30 -7
- package/lib/middleware.mjs.map +1 -1
- package/package.json +3 -1
- package/resources/beta/agents/agents.d.mts +46 -1
- package/resources/beta/agents/agents.d.mts.map +1 -1
- package/resources/beta/agents/agents.d.ts +46 -1
- package/resources/beta/agents/agents.d.ts.map +1 -1
- package/resources/beta/agents/agents.js +25 -10
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs +25 -10
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/agents/versions.d.mts +9 -0
- package/resources/beta/agents/versions.d.mts.map +1 -1
- package/resources/beta/agents/versions.d.ts +9 -0
- package/resources/beta/agents/versions.d.ts.map +1 -1
- package/resources/beta/agents/versions.js +5 -2
- package/resources/beta/agents/versions.js.map +1 -1
- package/resources/beta/agents/versions.mjs +5 -2
- package/resources/beta/agents/versions.mjs.map +1 -1
- package/resources/beta/beta.d.mts +5 -5
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +5 -5
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/deployment-runs.d.mts +24 -6
- package/resources/beta/deployment-runs.d.mts.map +1 -1
- package/resources/beta/deployment-runs.d.ts +24 -6
- package/resources/beta/deployment-runs.d.ts.map +1 -1
- package/resources/beta/deployment-runs.js +10 -4
- package/resources/beta/deployment-runs.js.map +1 -1
- package/resources/beta/deployment-runs.mjs +10 -4
- package/resources/beta/deployment-runs.mjs.map +1 -1
- package/resources/beta/deployments.d.mts +75 -2
- package/resources/beta/deployments.d.mts.map +1 -1
- package/resources/beta/deployments.d.ts +75 -2
- package/resources/beta/deployments.d.ts.map +1 -1
- package/resources/beta/deployments.js +40 -16
- package/resources/beta/deployments.js.map +1 -1
- package/resources/beta/deployments.mjs +40 -16
- package/resources/beta/deployments.mjs.map +1 -1
- package/resources/beta/dreams.d.mts +73 -1
- package/resources/beta/dreams.d.mts.map +1 -1
- package/resources/beta/dreams.d.ts +73 -1
- package/resources/beta/dreams.d.ts.map +1 -1
- package/resources/beta/dreams.js +25 -10
- package/resources/beta/dreams.js.map +1 -1
- package/resources/beta/dreams.mjs +25 -10
- package/resources/beta/dreams.mjs.map +1 -1
- package/resources/beta/environments/environments.d.mts +54 -0
- package/resources/beta/environments/environments.d.mts.map +1 -1
- package/resources/beta/environments/environments.d.ts +54 -0
- package/resources/beta/environments/environments.d.ts.map +1 -1
- package/resources/beta/environments/environments.js +30 -12
- package/resources/beta/environments/environments.js.map +1 -1
- package/resources/beta/environments/environments.mjs +30 -12
- package/resources/beta/environments/environments.mjs.map +1 -1
- package/resources/beta/environments/work.d.mts +36 -0
- package/resources/beta/environments/work.d.mts.map +1 -1
- package/resources/beta/environments/work.d.ts +36 -0
- package/resources/beta/environments/work.d.ts.map +1 -1
- package/resources/beta/environments/work.js +20 -8
- package/resources/beta/environments/work.js.map +1 -1
- package/resources/beta/environments/work.mjs +20 -8
- package/resources/beta/environments/work.mjs.map +1 -1
- package/resources/beta/files.d.mts +48 -1
- package/resources/beta/files.d.mts.map +1 -1
- package/resources/beta/files.d.ts +48 -1
- package/resources/beta/files.d.ts.map +1 -1
- package/resources/beta/files.js +22 -9
- package/resources/beta/files.js.map +1 -1
- package/resources/beta/files.mjs +22 -9
- package/resources/beta/files.mjs.map +1 -1
- package/resources/beta/index.d.mts +2 -2
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +2 -2
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/memory-stores/memories.d.mts +51 -4
- package/resources/beta/memory-stores/memories.d.mts.map +1 -1
- package/resources/beta/memory-stores/memories.d.ts +51 -4
- package/resources/beta/memory-stores/memories.d.ts.map +1 -1
- package/resources/beta/memory-stores/memories.js +25 -10
- package/resources/beta/memory-stores/memories.js.map +1 -1
- package/resources/beta/memory-stores/memories.mjs +25 -10
- package/resources/beta/memory-stores/memories.mjs.map +1 -1
- package/resources/beta/memory-stores/memory-stores.d.mts +54 -0
- package/resources/beta/memory-stores/memory-stores.d.mts.map +1 -1
- package/resources/beta/memory-stores/memory-stores.d.ts +54 -0
- package/resources/beta/memory-stores/memory-stores.d.ts.map +1 -1
- package/resources/beta/memory-stores/memory-stores.js +30 -12
- package/resources/beta/memory-stores/memory-stores.js.map +1 -1
- package/resources/beta/memory-stores/memory-stores.mjs +30 -12
- package/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.mts +31 -4
- package/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.ts +31 -4
- package/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
- package/resources/beta/memory-stores/memory-versions.js +15 -6
- package/resources/beta/memory-stores/memory-versions.js.map +1 -1
- package/resources/beta/memory-stores/memory-versions.mjs +15 -6
- package/resources/beta/memory-stores/memory-versions.mjs.map +1 -1
- package/resources/beta/messages/batches.d.mts +54 -0
- package/resources/beta/messages/batches.d.mts.map +1 -1
- package/resources/beta/messages/batches.d.ts +54 -0
- package/resources/beta/messages/batches.d.ts.map +1 -1
- package/resources/beta/messages/batches.js +25 -11
- package/resources/beta/messages/batches.js.map +1 -1
- package/resources/beta/messages/batches.mjs +25 -11
- package/resources/beta/messages/batches.mjs.map +1 -1
- package/resources/beta/messages/index.d.mts +1 -1
- package/resources/beta/messages/index.d.mts.map +1 -1
- package/resources/beta/messages/index.d.ts +1 -1
- package/resources/beta/messages/index.d.ts.map +1 -1
- package/resources/beta/messages/index.js.map +1 -1
- package/resources/beta/messages/index.mjs.map +1 -1
- package/resources/beta/messages/messages.d.mts +148 -3
- package/resources/beta/messages/messages.d.mts.map +1 -1
- package/resources/beta/messages/messages.d.ts +148 -3
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js +4 -2
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs +4 -2
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/beta/models.d.mts +18 -0
- package/resources/beta/models.d.mts.map +1 -1
- package/resources/beta/models.d.ts +18 -0
- package/resources/beta/models.d.ts.map +1 -1
- package/resources/beta/models.js +10 -4
- package/resources/beta/models.js.map +1 -1
- package/resources/beta/models.mjs +10 -4
- package/resources/beta/models.mjs.map +1 -1
- package/resources/beta/organization/compliance-settings.d.mts +76 -0
- package/resources/beta/organization/compliance-settings.d.mts.map +1 -0
- package/resources/beta/organization/compliance-settings.d.ts +76 -0
- package/resources/beta/organization/compliance-settings.d.ts.map +1 -0
- package/resources/beta/organization/compliance-settings.js +52 -0
- package/resources/beta/organization/compliance-settings.js.map +1 -0
- package/resources/beta/organization/compliance-settings.mjs +48 -0
- package/resources/beta/organization/compliance-settings.mjs.map +1 -0
- package/resources/beta/organization/external-keys.d.mts +6 -3
- package/resources/beta/organization/external-keys.d.mts.map +1 -1
- package/resources/beta/organization/external-keys.d.ts +6 -3
- package/resources/beta/organization/external-keys.d.ts.map +1 -1
- package/resources/beta/organization/index.d.mts +1 -0
- package/resources/beta/organization/index.d.mts.map +1 -1
- package/resources/beta/organization/index.d.ts +1 -0
- package/resources/beta/organization/index.d.ts.map +1 -1
- package/resources/beta/organization/index.js +3 -1
- package/resources/beta/organization/index.js.map +1 -1
- package/resources/beta/organization/index.mjs +1 -0
- package/resources/beta/organization/index.mjs.map +1 -1
- package/resources/beta/organization/organization.d.mts +4 -0
- package/resources/beta/organization/organization.d.mts.map +1 -1
- package/resources/beta/organization/organization.d.ts +4 -0
- package/resources/beta/organization/organization.d.ts.map +1 -1
- package/resources/beta/organization/organization.js +4 -0
- package/resources/beta/organization/organization.js.map +1 -1
- package/resources/beta/organization/organization.mjs +4 -0
- package/resources/beta/organization/organization.mjs.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.d.mts +28 -12
- package/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.d.ts +28 -12
- package/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.js.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.mjs.map +1 -1
- package/resources/beta/sessions/events.d.mts +28 -1
- package/resources/beta/sessions/events.d.mts.map +1 -1
- package/resources/beta/sessions/events.d.ts +28 -1
- package/resources/beta/sessions/events.d.ts.map +1 -1
- package/resources/beta/sessions/events.js +15 -6
- package/resources/beta/sessions/events.js.map +1 -1
- package/resources/beta/sessions/events.mjs +15 -6
- package/resources/beta/sessions/events.mjs.map +1 -1
- package/resources/beta/sessions/resources.d.mts +45 -0
- package/resources/beta/sessions/resources.d.mts.map +1 -1
- package/resources/beta/sessions/resources.d.ts +45 -0
- package/resources/beta/sessions/resources.d.ts.map +1 -1
- package/resources/beta/sessions/resources.js +25 -10
- package/resources/beta/sessions/resources.js.map +1 -1
- package/resources/beta/sessions/resources.mjs +25 -10
- package/resources/beta/sessions/resources.mjs.map +1 -1
- package/resources/beta/sessions/sessions.d.mts +64 -10
- package/resources/beta/sessions/sessions.d.mts.map +1 -1
- package/resources/beta/sessions/sessions.d.ts +64 -10
- package/resources/beta/sessions/sessions.d.ts.map +1 -1
- package/resources/beta/sessions/sessions.js +30 -12
- package/resources/beta/sessions/sessions.js.map +1 -1
- package/resources/beta/sessions/sessions.mjs +30 -12
- package/resources/beta/sessions/sessions.mjs.map +1 -1
- package/resources/beta/sessions/threads/events.d.mts +18 -0
- package/resources/beta/sessions/threads/events.d.mts.map +1 -1
- package/resources/beta/sessions/threads/events.d.ts +18 -0
- package/resources/beta/sessions/threads/events.d.ts.map +1 -1
- package/resources/beta/sessions/threads/events.js +10 -4
- package/resources/beta/sessions/threads/events.js.map +1 -1
- package/resources/beta/sessions/threads/events.mjs +10 -4
- package/resources/beta/sessions/threads/events.mjs.map +1 -1
- package/resources/beta/sessions/threads/threads.d.mts +27 -0
- package/resources/beta/sessions/threads/threads.d.mts.map +1 -1
- package/resources/beta/sessions/threads/threads.d.ts +27 -0
- package/resources/beta/sessions/threads/threads.d.ts.map +1 -1
- package/resources/beta/sessions/threads/threads.js +15 -6
- package/resources/beta/sessions/threads/threads.js.map +1 -1
- package/resources/beta/sessions/threads/threads.mjs +15 -6
- package/resources/beta/sessions/threads/threads.mjs.map +1 -1
- package/resources/beta/skills/skills.d.mts +36 -0
- package/resources/beta/skills/skills.d.mts.map +1 -1
- package/resources/beta/skills/skills.d.ts +36 -0
- package/resources/beta/skills/skills.d.ts.map +1 -1
- package/resources/beta/skills/skills.js +20 -8
- package/resources/beta/skills/skills.js.map +1 -1
- package/resources/beta/skills/skills.mjs +20 -8
- package/resources/beta/skills/skills.mjs.map +1 -1
- package/resources/beta/skills/versions.d.mts +45 -0
- package/resources/beta/skills/versions.d.mts.map +1 -1
- package/resources/beta/skills/versions.d.ts +45 -0
- package/resources/beta/skills/versions.d.ts.map +1 -1
- package/resources/beta/skills/versions.js +22 -9
- package/resources/beta/skills/versions.js.map +1 -1
- package/resources/beta/skills/versions.mjs +22 -9
- package/resources/beta/skills/versions.mjs.map +1 -1
- package/resources/beta/tunnels/certificates.d.mts +36 -0
- package/resources/beta/tunnels/certificates.d.mts.map +1 -1
- package/resources/beta/tunnels/certificates.d.ts +36 -0
- package/resources/beta/tunnels/certificates.d.ts.map +1 -1
- package/resources/beta/tunnels/certificates.js +20 -8
- package/resources/beta/tunnels/certificates.js.map +1 -1
- package/resources/beta/tunnels/certificates.mjs +20 -8
- package/resources/beta/tunnels/certificates.mjs.map +1 -1
- package/resources/beta/tunnels/tunnels.d.mts +54 -0
- package/resources/beta/tunnels/tunnels.d.mts.map +1 -1
- package/resources/beta/tunnels/tunnels.d.ts +54 -0
- package/resources/beta/tunnels/tunnels.d.ts.map +1 -1
- package/resources/beta/tunnels/tunnels.js +30 -12
- package/resources/beta/tunnels/tunnels.js.map +1 -1
- package/resources/beta/tunnels/tunnels.mjs +30 -12
- package/resources/beta/tunnels/tunnels.mjs.map +1 -1
- package/resources/beta/user-profiles.d.mts +21 -25
- package/resources/beta/user-profiles.d.mts.map +1 -1
- package/resources/beta/user-profiles.d.ts +21 -25
- package/resources/beta/user-profiles.d.ts.map +1 -1
- package/resources/beta/vaults/credentials.d.mts +63 -0
- package/resources/beta/vaults/credentials.d.mts.map +1 -1
- package/resources/beta/vaults/credentials.d.ts +63 -0
- package/resources/beta/vaults/credentials.d.ts.map +1 -1
- package/resources/beta/vaults/credentials.js +35 -14
- package/resources/beta/vaults/credentials.js.map +1 -1
- package/resources/beta/vaults/credentials.mjs +35 -14
- package/resources/beta/vaults/credentials.mjs.map +1 -1
- package/resources/beta/vaults/vaults.d.mts +54 -0
- package/resources/beta/vaults/vaults.d.mts.map +1 -1
- package/resources/beta/vaults/vaults.d.ts +54 -0
- package/resources/beta/vaults/vaults.d.ts.map +1 -1
- package/resources/beta/vaults/vaults.js +30 -12
- package/resources/beta/vaults/vaults.js.map +1 -1
- package/resources/beta/vaults/vaults.mjs +30 -12
- package/resources/beta/vaults/vaults.mjs.map +1 -1
- package/resources/completions.d.mts +9 -0
- package/resources/completions.d.mts.map +1 -1
- package/resources/completions.d.ts +9 -0
- package/resources/completions.d.ts.map +1 -1
- package/resources/completions.js +5 -2
- package/resources/completions.js.map +1 -1
- package/resources/completions.mjs +5 -2
- package/resources/completions.mjs.map +1 -1
- package/resources/files.d.mts +104 -15
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +104 -15
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +79 -10
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +79 -10
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/batches.d.mts +68 -6
- package/resources/messages/batches.d.mts.map +1 -1
- package/resources/messages/batches.d.ts +68 -6
- package/resources/messages/batches.d.ts.map +1 -1
- package/resources/messages/batches.js +52 -13
- package/resources/messages/batches.js.map +1 -1
- package/resources/messages/batches.mjs +52 -13
- package/resources/messages/batches.mjs.map +1 -1
- package/resources/messages/index.d.mts +1 -1
- package/resources/messages/index.d.mts.map +1 -1
- package/resources/messages/index.d.ts +1 -1
- package/resources/messages/index.d.ts.map +1 -1
- package/resources/messages/index.js.map +1 -1
- package/resources/messages/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +21 -5
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +21 -5
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +10 -4
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +10 -4
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/models.d.mts +31 -0
- package/resources/models.d.mts.map +1 -1
- package/resources/models.d.ts +31 -0
- package/resources/models.d.ts.map +1 -1
- package/resources/models.js +23 -4
- package/resources/models.js.map +1 -1
- package/resources/models.mjs +23 -4
- package/resources/models.mjs.map +1 -1
- package/resources/skills/index.d.mts +1 -1
- package/resources/skills/index.d.mts.map +1 -1
- package/resources/skills/index.d.ts +1 -1
- package/resources/skills/index.d.ts.map +1 -1
- package/resources/skills/index.js.map +1 -1
- package/resources/skills/index.mjs.map +1 -1
- package/resources/skills/skills.d.mts +75 -10
- package/resources/skills/skills.d.mts.map +1 -1
- package/resources/skills/skills.d.ts +75 -10
- package/resources/skills/skills.d.ts.map +1 -1
- package/resources/skills/skills.js +64 -8
- package/resources/skills/skills.js.map +1 -1
- package/resources/skills/skills.mjs +64 -8
- package/resources/skills/skills.mjs.map +1 -1
- package/resources/skills/versions.d.mts +75 -5
- package/resources/skills/versions.d.mts.map +1 -1
- package/resources/skills/versions.d.ts +75 -5
- package/resources/skills/versions.d.ts.map +1 -1
- package/resources/skills/versions.js +67 -7
- package/resources/skills/versions.js.map +1 -1
- package/resources/skills/versions.mjs +67 -7
- package/resources/skills/versions.mjs.map +1 -1
- package/src/client.ts +12 -1
- package/src/core/credentials.ts +5 -7
- package/src/core/streaming.ts +4 -2
- package/src/internal/file-store.ts +11 -10
- package/src/internal/node.browser.ts +22 -0
- package/src/internal/node.ts +14 -0
- package/src/lib/BetaMessageStream.ts +4 -0
- package/src/lib/credentials/credential-chain.ts +1 -1
- package/src/lib/credentials/identity-token.ts +1 -1
- package/src/lib/credentials/types.ts +2 -3
- package/src/lib/credentials/user-oauth.ts +1 -1
- package/src/lib/middleware.ts +33 -9
- package/src/resources/beta/agents/agents.ts +76 -10
- package/src/resources/beta/agents/versions.ts +15 -2
- package/src/resources/beta/beta.ts +16 -1
- package/src/resources/beta/deployment-runs.ts +36 -10
- package/src/resources/beta/deployments.ts +123 -18
- package/src/resources/beta/dreams.ts +117 -10
- package/src/resources/beta/environments/environments.ts +90 -12
- package/src/resources/beta/environments/work.ts +60 -8
- package/src/resources/beta/files.ts +75 -11
- package/src/resources/beta/index.ts +6 -0
- package/src/resources/beta/memory-stores/memories.ts +81 -14
- package/src/resources/beta/memory-stores/memory-stores.ts +90 -12
- package/src/resources/beta/memory-stores/memory-versions.ts +49 -10
- package/src/resources/beta/messages/batches.ts +85 -11
- package/src/resources/beta/messages/index.ts +4 -0
- package/src/resources/beta/messages/messages.ts +173 -10
- package/src/resources/beta/models.ts +30 -4
- package/src/resources/beta/organization/compliance-settings.ts +106 -0
- package/src/resources/beta/organization/external-keys.ts +6 -3
- package/src/resources/beta/organization/index.ts +11 -0
- package/src/resources/beta/organization/organization.ts +28 -0
- package/src/resources/beta/organization/workspaces/workspaces.ts +28 -12
- package/src/resources/beta/sessions/events.ts +46 -7
- package/src/resources/beta/sessions/resources.ts +75 -10
- package/src/resources/beta/sessions/sessions.ts +100 -22
- package/src/resources/beta/sessions/threads/events.ts +30 -4
- package/src/resources/beta/sessions/threads/threads.ts +45 -6
- package/src/resources/beta/skills/skills.ts +60 -8
- package/src/resources/beta/skills/versions.ts +72 -9
- package/src/resources/beta/tunnels/certificates.ts +60 -8
- package/src/resources/beta/tunnels/tunnels.ts +90 -12
- package/src/resources/beta/user-profiles.ts +24 -27
- package/src/resources/beta/vaults/credentials.ts +105 -14
- package/src/resources/beta/vaults/vaults.ts +90 -12
- package/src/resources/completions.ts +15 -2
- package/src/resources/files.ts +161 -18
- package/src/resources/index.ts +5 -0
- package/src/resources/messages/batches.ts +137 -13
- package/src/resources/messages/index.ts +4 -0
- package/src/resources/messages/messages.ts +40 -12
- package/src/resources/models.ts +43 -4
- package/src/resources/skills/index.ts +2 -0
- package/src/resources/skills/skills.ts +127 -13
- package/src/resources/skills/versions.ts +115 -11
- package/src/tools/agent-toolset/fs-util.ts +22 -9
- package/src/tools/agent-toolset/memories.ts +5 -3
- package/src/tools/agent-toolset/skills.ts +5 -10
- package/src/version.ts +1 -1
- package/tools/agent-toolset/fs-util.d.mts +11 -4
- package/tools/agent-toolset/fs-util.d.mts.map +1 -1
- package/tools/agent-toolset/fs-util.d.ts +11 -4
- package/tools/agent-toolset/fs-util.d.ts.map +1 -1
- package/tools/agent-toolset/fs-util.js +27 -19
- package/tools/agent-toolset/fs-util.js.map +1 -1
- package/tools/agent-toolset/fs-util.mjs +17 -8
- package/tools/agent-toolset/fs-util.mjs.map +1 -1
- package/tools/agent-toolset/memories.d.mts.map +1 -1
- package/tools/agent-toolset/memories.d.ts.map +1 -1
- package/tools/agent-toolset/memories.js +6 -4
- package/tools/agent-toolset/memories.js.map +1 -1
- package/tools/agent-toolset/memories.mjs +5 -3
- package/tools/agent-toolset/memories.mjs.map +1 -1
- package/tools/agent-toolset/skills.d.mts.map +1 -1
- package/tools/agent-toolset/skills.d.ts.map +1 -1
- package/tools/agent-toolset/skills.js +15 -21
- package/tools/agent-toolset/skills.js.map +1 -1
- package/tools/agent-toolset/skills.mjs +4 -9
- package/tools/agent-toolset/skills.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/models.ts
CHANGED
|
@@ -14,17 +14,25 @@ export class Models extends APIResource {
|
|
|
14
14
|
*
|
|
15
15
|
* The Models API response can be used to determine information about a specific
|
|
16
16
|
* model or resolve a model alias to a model ID.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const modelInfo = await client.models.retrieve('model_id');
|
|
21
|
+
* ```
|
|
17
22
|
*/
|
|
18
23
|
retrieve(
|
|
19
24
|
modelID: string,
|
|
20
25
|
params: ModelRetrieveParams | null | undefined = {},
|
|
21
26
|
options?: RequestOptions,
|
|
22
27
|
): APIPromise<ModelInfo> {
|
|
23
|
-
const { betas } = params ?? {};
|
|
28
|
+
const { betas, workspace_id } = params ?? {};
|
|
24
29
|
return this._client.get(path`/v1/models/${modelID}`, {
|
|
25
30
|
...options,
|
|
26
31
|
headers: buildHeaders([
|
|
27
|
-
{
|
|
32
|
+
{
|
|
33
|
+
...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined),
|
|
34
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
35
|
+
},
|
|
28
36
|
options?.headers,
|
|
29
37
|
]),
|
|
30
38
|
});
|
|
@@ -35,17 +43,28 @@ export class Models extends APIResource {
|
|
|
35
43
|
*
|
|
36
44
|
* The Models API response can be used to determine which models are available for
|
|
37
45
|
* use in the API. More recently released models are listed first.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* // Automatically fetches more pages as needed.
|
|
50
|
+
* for await (const modelInfo of client.models.list()) {
|
|
51
|
+
* // ...
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
38
54
|
*/
|
|
39
55
|
list(
|
|
40
56
|
params: ModelListParams | null | undefined = {},
|
|
41
57
|
options?: RequestOptions,
|
|
42
58
|
): PagePromise<ModelInfosPage, ModelInfo> {
|
|
43
|
-
const { betas, ...query } = params ?? {};
|
|
59
|
+
const { betas, workspace_id, ...query } = params ?? {};
|
|
44
60
|
return this._client.getAPIList('/v1/models', Page<ModelInfo>, {
|
|
45
61
|
query,
|
|
46
62
|
...options,
|
|
47
63
|
headers: buildHeaders([
|
|
48
|
-
{
|
|
64
|
+
{
|
|
65
|
+
...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined),
|
|
66
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
67
|
+
},
|
|
49
68
|
options?.headers,
|
|
50
69
|
]),
|
|
51
70
|
});
|
|
@@ -249,6 +268,16 @@ export interface ModelRetrieveParams {
|
|
|
249
268
|
* Optional header to specify the beta version(s) you want to use.
|
|
250
269
|
*/
|
|
251
270
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Optional header to select the Workspace for this request. The value is a
|
|
274
|
+
* Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
275
|
+
*
|
|
276
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
277
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
278
|
+
* match that Workspace.
|
|
279
|
+
*/
|
|
280
|
+
workspace_id?: string;
|
|
252
281
|
}
|
|
253
282
|
|
|
254
283
|
export interface ModelListParams extends PageParams {
|
|
@@ -256,6 +285,16 @@ export interface ModelListParams extends PageParams {
|
|
|
256
285
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
257
286
|
*/
|
|
258
287
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
291
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
292
|
+
*
|
|
293
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
294
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
295
|
+
* match that Workspace.
|
|
296
|
+
*/
|
|
297
|
+
workspace_id?: string;
|
|
259
298
|
}
|
|
260
299
|
|
|
261
300
|
export declare namespace Models {
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
import { APIPromise } from '../../core/api-promise';
|
|
16
16
|
import { PageCursor, type PageCursorParams, PagePromise } from '../../core/pagination';
|
|
17
17
|
import { type Uploadable } from '../../core/uploads';
|
|
18
|
+
import { buildHeaders } from '../../internal/headers';
|
|
18
19
|
import { RequestOptions } from '../../internal/request-options';
|
|
19
20
|
import { multipartFormRequestOptions } from '../../internal/uploads';
|
|
20
21
|
import { path } from '../../internal/utils/path';
|
|
@@ -24,36 +25,103 @@ export class Skills extends APIResource {
|
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Create Skill
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const skill = await client.skills.create({
|
|
32
|
+
* files: [fs.createReadStream('path/to/file')],
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
27
35
|
*/
|
|
28
|
-
create(
|
|
36
|
+
create(params: SkillCreateParams, options?: RequestOptions): APIPromise<Skill> {
|
|
37
|
+
const { workspace_id, ...body } = params;
|
|
29
38
|
return this._client.post(
|
|
30
39
|
'/v1/skills',
|
|
31
|
-
multipartFormRequestOptions(
|
|
40
|
+
multipartFormRequestOptions(
|
|
41
|
+
{
|
|
42
|
+
body,
|
|
43
|
+
...options,
|
|
44
|
+
headers: buildHeaders([
|
|
45
|
+
{ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
|
|
46
|
+
options?.headers,
|
|
47
|
+
]),
|
|
48
|
+
},
|
|
49
|
+
this._client,
|
|
50
|
+
false,
|
|
51
|
+
),
|
|
32
52
|
);
|
|
33
53
|
}
|
|
34
54
|
|
|
35
55
|
/**
|
|
36
56
|
* Get Skill
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const skill = await client.skills.retrieve('skill_id');
|
|
61
|
+
* ```
|
|
37
62
|
*/
|
|
38
|
-
retrieve(
|
|
39
|
-
|
|
63
|
+
retrieve(
|
|
64
|
+
skillID: string,
|
|
65
|
+
params: SkillRetrieveParams | null | undefined = {},
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): APIPromise<Skill> {
|
|
68
|
+
const { workspace_id } = params ?? {};
|
|
69
|
+
return this._client.get(path`/v1/skills/${skillID}`, {
|
|
70
|
+
...options,
|
|
71
|
+
headers: buildHeaders([
|
|
72
|
+
{ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
|
|
73
|
+
options?.headers,
|
|
74
|
+
]),
|
|
75
|
+
});
|
|
40
76
|
}
|
|
41
77
|
|
|
42
78
|
/**
|
|
43
79
|
* List Skills
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* // Automatically fetches more pages as needed.
|
|
84
|
+
* for await (const skill of client.skills.list()) {
|
|
85
|
+
* // ...
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
44
88
|
*/
|
|
45
89
|
list(
|
|
46
|
-
|
|
90
|
+
params: SkillListParams | null | undefined = {},
|
|
47
91
|
options?: RequestOptions,
|
|
48
92
|
): PagePromise<SkillsPageCursor, Skill> {
|
|
49
|
-
|
|
93
|
+
const { workspace_id, ...query } = params ?? {};
|
|
94
|
+
return this._client.getAPIList('/v1/skills', PageCursor<Skill>, {
|
|
95
|
+
query,
|
|
96
|
+
...options,
|
|
97
|
+
headers: buildHeaders([
|
|
98
|
+
{ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
|
|
99
|
+
options?.headers,
|
|
100
|
+
]),
|
|
101
|
+
});
|
|
50
102
|
}
|
|
51
103
|
|
|
52
104
|
/**
|
|
53
105
|
* Delete Skill
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* const deletedSkill = await client.skills.delete('skill_id');
|
|
110
|
+
* ```
|
|
54
111
|
*/
|
|
55
|
-
delete(
|
|
56
|
-
|
|
112
|
+
delete(
|
|
113
|
+
skillID: string,
|
|
114
|
+
params: SkillDeleteParams | null | undefined = {},
|
|
115
|
+
options?: RequestOptions,
|
|
116
|
+
): APIPromise<DeletedSkill> {
|
|
117
|
+
const { workspace_id } = params ?? {};
|
|
118
|
+
return this._client.delete(path`/v1/skills/${skillID}`, {
|
|
119
|
+
...options,
|
|
120
|
+
headers: buildHeaders([
|
|
121
|
+
{ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
|
|
122
|
+
options?.headers,
|
|
123
|
+
]),
|
|
124
|
+
});
|
|
57
125
|
}
|
|
58
126
|
}
|
|
59
127
|
|
|
@@ -142,7 +210,7 @@ export interface SkillSource {
|
|
|
142
210
|
|
|
143
211
|
export interface SkillCreateParams {
|
|
144
212
|
/**
|
|
145
|
-
* Files to upload for the skill.
|
|
213
|
+
* Body param: Files to upload for the skill.
|
|
146
214
|
*
|
|
147
215
|
* All files must be in the same top-level directory and must include a SKILL.md
|
|
148
216
|
* file at the root of that directory.
|
|
@@ -150,16 +218,38 @@ export interface SkillCreateParams {
|
|
|
150
218
|
files: Array<Uploadable>;
|
|
151
219
|
|
|
152
220
|
/**
|
|
153
|
-
* Human-readable, single-line label for the Skill. Maximum 255
|
|
154
|
-
* set: derived from the SKILL.md frontmatter `name` when
|
|
155
|
-
* unique.
|
|
221
|
+
* Body param: Human-readable, single-line label for the Skill. Maximum 255
|
|
222
|
+
* characters. Always set: derived from the SKILL.md frontmatter `name` when
|
|
223
|
+
* omitted at creation. Not unique.
|
|
156
224
|
*/
|
|
157
225
|
display_name?: string | null;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
229
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
230
|
+
*
|
|
231
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
232
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
233
|
+
* match that Workspace.
|
|
234
|
+
*/
|
|
235
|
+
workspace_id?: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface SkillRetrieveParams {
|
|
239
|
+
/**
|
|
240
|
+
* Optional header to select the Workspace for this request. The value is a
|
|
241
|
+
* Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
242
|
+
*
|
|
243
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
244
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
245
|
+
* match that Workspace.
|
|
246
|
+
*/
|
|
247
|
+
workspace_id?: string;
|
|
158
248
|
}
|
|
159
249
|
|
|
160
250
|
export interface SkillListParams extends PageCursorParams {
|
|
161
251
|
/**
|
|
162
|
-
* Filter skills by source.
|
|
252
|
+
* Query param: Filter skills by source.
|
|
163
253
|
*
|
|
164
254
|
* If provided, only skills from the specified source will be returned:
|
|
165
255
|
*
|
|
@@ -167,6 +257,28 @@ export interface SkillListParams extends PageCursorParams {
|
|
|
167
257
|
* - `"anthropic"`: only return Anthropic-created skills
|
|
168
258
|
*/
|
|
169
259
|
source?: string | null;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
263
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
264
|
+
*
|
|
265
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
266
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
267
|
+
* match that Workspace.
|
|
268
|
+
*/
|
|
269
|
+
workspace_id?: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export interface SkillDeleteParams {
|
|
273
|
+
/**
|
|
274
|
+
* Optional header to select the Workspace for this request. The value is a
|
|
275
|
+
* Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
276
|
+
*
|
|
277
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
278
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
279
|
+
* match that Workspace.
|
|
280
|
+
*/
|
|
281
|
+
workspace_id?: string;
|
|
170
282
|
}
|
|
171
283
|
|
|
172
284
|
Skills.Versions = Versions;
|
|
@@ -178,7 +290,9 @@ export declare namespace Skills {
|
|
|
178
290
|
type SkillSource as SkillSource,
|
|
179
291
|
type SkillsPageCursor as SkillsPageCursor,
|
|
180
292
|
type SkillCreateParams as SkillCreateParams,
|
|
293
|
+
type SkillRetrieveParams as SkillRetrieveParams,
|
|
181
294
|
type SkillListParams as SkillListParams,
|
|
295
|
+
type SkillDeleteParams as SkillDeleteParams,
|
|
182
296
|
};
|
|
183
297
|
|
|
184
298
|
export {
|
|
@@ -4,6 +4,7 @@ import { APIResource } from '../../core/resource';
|
|
|
4
4
|
import { APIPromise } from '../../core/api-promise';
|
|
5
5
|
import { PageCursor, type PageCursorParams, PagePromise } from '../../core/pagination';
|
|
6
6
|
import { type Uploadable } from '../../core/uploads';
|
|
7
|
+
import { buildHeaders } from '../../internal/headers';
|
|
7
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
9
|
import { multipartFormRequestOptions } from '../../internal/uploads';
|
|
9
10
|
import { path } from '../../internal/utils/path';
|
|
@@ -11,50 +12,113 @@ import { path } from '../../internal/utils/path';
|
|
|
11
12
|
export class Versions extends APIResource {
|
|
12
13
|
/**
|
|
13
14
|
* Create Skill Version
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const skillVersion = await client.skills.versions.create(
|
|
19
|
+
* 'skill_id',
|
|
20
|
+
* { files: [fs.createReadStream('path/to/file')] },
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
14
23
|
*/
|
|
15
|
-
create(skillID: string,
|
|
24
|
+
create(skillID: string, params: VersionCreateParams, options?: RequestOptions): APIPromise<SkillVersion> {
|
|
25
|
+
const { workspace_id, ...body } = params;
|
|
16
26
|
return this._client.post(
|
|
17
27
|
path`/v1/skills/${skillID}/versions`,
|
|
18
|
-
multipartFormRequestOptions(
|
|
28
|
+
multipartFormRequestOptions(
|
|
29
|
+
{
|
|
30
|
+
body,
|
|
31
|
+
...options,
|
|
32
|
+
headers: buildHeaders([
|
|
33
|
+
{ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
|
|
34
|
+
options?.headers,
|
|
35
|
+
]),
|
|
36
|
+
},
|
|
37
|
+
this._client,
|
|
38
|
+
false,
|
|
39
|
+
),
|
|
19
40
|
);
|
|
20
41
|
}
|
|
21
42
|
|
|
22
43
|
/**
|
|
23
44
|
* Get Skill Version
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const skillVersion = await client.skills.versions.retrieve(
|
|
49
|
+
* 'version',
|
|
50
|
+
* { skill_id: 'skill_id' },
|
|
51
|
+
* );
|
|
52
|
+
* ```
|
|
24
53
|
*/
|
|
25
54
|
retrieve(
|
|
26
55
|
version: string,
|
|
27
56
|
params: VersionRetrieveParams,
|
|
28
57
|
options?: RequestOptions,
|
|
29
58
|
): APIPromise<SkillVersion> {
|
|
30
|
-
const { skill_id } = params;
|
|
31
|
-
return this._client.get(path`/v1/skills/${skill_id}/versions/${version}`,
|
|
59
|
+
const { skill_id, workspace_id } = params;
|
|
60
|
+
return this._client.get(path`/v1/skills/${skill_id}/versions/${version}`, {
|
|
61
|
+
...options,
|
|
62
|
+
headers: buildHeaders([
|
|
63
|
+
{ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
|
|
64
|
+
options?.headers,
|
|
65
|
+
]),
|
|
66
|
+
});
|
|
32
67
|
}
|
|
33
68
|
|
|
34
69
|
/**
|
|
35
70
|
* List Skill Versions
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* // Automatically fetches more pages as needed.
|
|
75
|
+
* for await (const skillVersion of client.skills.versions.list(
|
|
76
|
+
* 'skill_id',
|
|
77
|
+
* )) {
|
|
78
|
+
* // ...
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
36
81
|
*/
|
|
37
82
|
list(
|
|
38
83
|
skillID: string,
|
|
39
|
-
|
|
84
|
+
params: VersionListParams | null | undefined = {},
|
|
40
85
|
options?: RequestOptions,
|
|
41
86
|
): PagePromise<SkillVersionsPageCursor, SkillVersion> {
|
|
87
|
+
const { workspace_id, ...query } = params ?? {};
|
|
42
88
|
return this._client.getAPIList(path`/v1/skills/${skillID}/versions`, PageCursor<SkillVersion>, {
|
|
43
89
|
query,
|
|
44
90
|
...options,
|
|
91
|
+
headers: buildHeaders([
|
|
92
|
+
{ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
|
|
93
|
+
options?.headers,
|
|
94
|
+
]),
|
|
45
95
|
});
|
|
46
96
|
}
|
|
47
97
|
|
|
48
98
|
/**
|
|
49
99
|
* Delete Skill Version
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* const deletedSkillVersion =
|
|
104
|
+
* await client.skills.versions.delete('version', {
|
|
105
|
+
* skill_id: 'skill_id',
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
50
108
|
*/
|
|
51
109
|
delete(
|
|
52
110
|
version: string,
|
|
53
111
|
params: VersionDeleteParams,
|
|
54
112
|
options?: RequestOptions,
|
|
55
113
|
): APIPromise<DeletedSkillVersion> {
|
|
56
|
-
const { skill_id } = params;
|
|
57
|
-
return this._client.delete(path`/v1/skills/${skill_id}/versions/${version}`,
|
|
114
|
+
const { skill_id, workspace_id } = params;
|
|
115
|
+
return this._client.delete(path`/v1/skills/${skill_id}/versions/${version}`, {
|
|
116
|
+
...options,
|
|
117
|
+
headers: buildHeaders([
|
|
118
|
+
{ ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
|
|
119
|
+
options?.headers,
|
|
120
|
+
]),
|
|
121
|
+
});
|
|
58
122
|
}
|
|
59
123
|
}
|
|
60
124
|
|
|
@@ -119,32 +183,72 @@ export interface SkillVersion {
|
|
|
119
183
|
|
|
120
184
|
export interface VersionCreateParams {
|
|
121
185
|
/**
|
|
122
|
-
* Files to upload for the skill.
|
|
186
|
+
* Body param: Files to upload for the skill.
|
|
123
187
|
*
|
|
124
188
|
* All files must be in the same top-level directory and must include a SKILL.md
|
|
125
189
|
* file at the root of that directory.
|
|
126
190
|
*/
|
|
127
191
|
files: Array<Uploadable>;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
195
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
196
|
+
*
|
|
197
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
198
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
199
|
+
* match that Workspace.
|
|
200
|
+
*/
|
|
201
|
+
workspace_id?: string;
|
|
128
202
|
}
|
|
129
203
|
|
|
130
204
|
export interface VersionRetrieveParams {
|
|
131
205
|
/**
|
|
132
|
-
* Unique identifier for the skill.
|
|
206
|
+
* Path param: Unique identifier for the skill.
|
|
133
207
|
*
|
|
134
208
|
* The format and length of IDs may change over time.
|
|
135
209
|
*/
|
|
136
210
|
skill_id: string;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
214
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
215
|
+
*
|
|
216
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
217
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
218
|
+
* match that Workspace.
|
|
219
|
+
*/
|
|
220
|
+
workspace_id?: string;
|
|
137
221
|
}
|
|
138
222
|
|
|
139
|
-
export interface VersionListParams extends PageCursorParams {
|
|
223
|
+
export interface VersionListParams extends PageCursorParams {
|
|
224
|
+
/**
|
|
225
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
226
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
227
|
+
*
|
|
228
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
229
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
230
|
+
* match that Workspace.
|
|
231
|
+
*/
|
|
232
|
+
workspace_id?: string;
|
|
233
|
+
}
|
|
140
234
|
|
|
141
235
|
export interface VersionDeleteParams {
|
|
142
236
|
/**
|
|
143
|
-
* Unique identifier for the skill.
|
|
237
|
+
* Path param: Unique identifier for the skill.
|
|
144
238
|
*
|
|
145
239
|
* The format and length of IDs may change over time.
|
|
146
240
|
*/
|
|
147
241
|
skill_id: string;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
245
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
246
|
+
*
|
|
247
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
248
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
249
|
+
* match that Workspace.
|
|
250
|
+
*/
|
|
251
|
+
workspace_id?: string;
|
|
148
252
|
}
|
|
149
253
|
|
|
150
254
|
export declare namespace Versions {
|
|
@@ -5,15 +5,19 @@
|
|
|
5
5
|
* and these helpers can be reused by every file tool.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { randomUUID } from 'node:crypto';
|
|
8
|
+
import type { FileHandle } from 'node:fs/promises';
|
|
9
|
+
import { crypto, fs as nodefs, path } from '../../internal/node';
|
|
11
10
|
import { ToolError } from '../../lib/tools/ToolError';
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/** Mode for
|
|
16
|
-
export const
|
|
12
|
+
const fs = nodefs.promises;
|
|
13
|
+
|
|
14
|
+
/** Mode for directories the file tools create: owner-only under any umask, like the memory tool. */
|
|
15
|
+
export const DIR_CREATE_MODE = 0o700;
|
|
16
|
+
/**
|
|
17
|
+
* Mode for files the file tools create: owner-only, so other local users can't
|
|
18
|
+
* read what an agent wrote. A file that already exists keeps its own mode.
|
|
19
|
+
*/
|
|
20
|
+
export const FILE_CREATE_MODE = 0o600;
|
|
17
21
|
|
|
18
22
|
/** True when `p` is `root` itself or lexically contained within it. */
|
|
19
23
|
export function isWithin(root: string, p: string): boolean {
|
|
@@ -137,13 +141,22 @@ export async function confineToRoot(
|
|
|
137
141
|
* Atomically write `content` to `targetPath`: write a sibling temp file, fsync
|
|
138
142
|
* it, then rename over the target. The rename is atomic on most filesystems, so
|
|
139
143
|
* a crash mid-write never leaves the target half-written.
|
|
144
|
+
*
|
|
145
|
+
* A new file is created {@link FILE_CREATE_MODE}; an existing one keeps its
|
|
146
|
+
* permission bits (the rename replaces the inode, so they are copied onto the
|
|
147
|
+
* temp file first) — an edit must not strip `+x` or sharing the owner chose.
|
|
140
148
|
*/
|
|
141
149
|
export async function atomicWriteFile(targetPath: string, content: string): Promise<void> {
|
|
142
150
|
const dir = path.dirname(targetPath);
|
|
143
|
-
const tempPath = path.join(dir, `.tmp-${process.pid}-${randomUUID()}`);
|
|
144
|
-
|
|
151
|
+
const tempPath = path.join(dir, `.tmp-${process.pid}-${crypto.randomUUID()}`);
|
|
152
|
+
const existingMode = await fs.stat(targetPath).then(
|
|
153
|
+
(st) => st.mode & 0o777,
|
|
154
|
+
() => undefined,
|
|
155
|
+
);
|
|
156
|
+
let handle: FileHandle | undefined;
|
|
145
157
|
try {
|
|
146
158
|
handle = await fs.open(tempPath, 'wx', FILE_CREATE_MODE);
|
|
159
|
+
if (existingMode !== undefined) await handle.chmod(existingMode);
|
|
147
160
|
await handle.writeFile(content, 'utf-8');
|
|
148
161
|
await handle.sync();
|
|
149
162
|
await handle.close();
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
* it is reachable through the shimmed `node.ts` entry point.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import
|
|
14
|
-
import { createHash } from 'node:crypto';
|
|
13
|
+
import { crypto, path } from '../../internal/node';
|
|
15
14
|
import type { Anthropic } from '../../client';
|
|
16
15
|
import { AnthropicError } from '../../core/error';
|
|
17
16
|
import { loggerFor, type Logger } from '../../internal/utils/log';
|
|
@@ -51,7 +50,10 @@ export const MARKER_PATH = '.anthropic-memory-store';
|
|
|
51
50
|
const MARKER_VERSION = 1;
|
|
52
51
|
|
|
53
52
|
function markerSha(memoryStoreId: string): string {
|
|
54
|
-
return
|
|
53
|
+
return crypto
|
|
54
|
+
.createHash('sha256')
|
|
55
|
+
.update(`version ${MARKER_VERSION}\n${memoryStoreId}`, 'utf-8')
|
|
56
|
+
.digest('hex');
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
/** How long a file must stay missing locally before its server delete goes out. */
|
|
@@ -5,19 +5,14 @@
|
|
|
5
5
|
* `node.ts` — distinct enough, and large enough, to review on its own.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
import * as fssync from 'node:fs';
|
|
10
|
-
import * as path from 'node:path';
|
|
11
|
-
import { execFile } from 'node:child_process';
|
|
12
|
-
import { promisify } from 'node:util';
|
|
13
|
-
import { Readable } from 'node:stream';
|
|
14
|
-
import { pipeline } from 'node:stream/promises';
|
|
8
|
+
import { child_process, fs as fssync, path, stream, util } from '../../internal/node';
|
|
15
9
|
import { AnthropicError } from '../../core/error';
|
|
16
10
|
import { loggerFor } from '../../internal/utils/log';
|
|
17
11
|
import { DIR_CREATE_MODE, errnoCode } from './fs-util';
|
|
18
12
|
import type { AgentToolContext } from './node';
|
|
19
13
|
|
|
20
|
-
const
|
|
14
|
+
const fs = fssync.promises;
|
|
15
|
+
const execFileAsync = util.promisify(child_process.execFile);
|
|
21
16
|
|
|
22
17
|
/**
|
|
23
18
|
* Download the session agent's skills into `{ctx.workdir}/skills/<name>/`.
|
|
@@ -265,8 +260,8 @@ export async function extractSkillArchive(resp: Response, dest: string): Promise
|
|
|
265
260
|
if (!resp.body) {
|
|
266
261
|
throw new AnthropicError('skill download response had no body');
|
|
267
262
|
}
|
|
268
|
-
await pipeline(
|
|
269
|
-
Readable.fromWeb(resp.body as Parameters<typeof Readable.fromWeb>[0]),
|
|
263
|
+
await stream.promises.pipeline(
|
|
264
|
+
stream.Readable.fromWeb(resp.body as Parameters<typeof stream.Readable.fromWeb>[0]),
|
|
270
265
|
fssync.createWriteStream(tmp),
|
|
271
266
|
);
|
|
272
267
|
const stage = path.join(path.dirname(dest), `.skill-stage-${process.pid}-${Date.now()}`);
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.124.0'; // x-release-please-version
|
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
* error messages. Kept out of `node.ts` so the tool implementations stay focused
|
|
5
5
|
* and these helpers can be reused by every file tool.
|
|
6
6
|
*/
|
|
7
|
-
/** Mode for directories the file tools create
|
|
8
|
-
export declare const DIR_CREATE_MODE =
|
|
9
|
-
/**
|
|
10
|
-
|
|
7
|
+
/** Mode for directories the file tools create: owner-only under any umask, like the memory tool. */
|
|
8
|
+
export declare const DIR_CREATE_MODE = 448;
|
|
9
|
+
/**
|
|
10
|
+
* Mode for files the file tools create: owner-only, so other local users can't
|
|
11
|
+
* read what an agent wrote. A file that already exists keeps its own mode.
|
|
12
|
+
*/
|
|
13
|
+
export declare const FILE_CREATE_MODE = 384;
|
|
11
14
|
/** True when `p` is `root` itself or lexically contained within it. */
|
|
12
15
|
export declare function isWithin(root: string, p: string): boolean;
|
|
13
16
|
/**
|
|
@@ -62,6 +65,10 @@ export declare function confineToRoot(root: string, p: string, opts?: {
|
|
|
62
65
|
* Atomically write `content` to `targetPath`: write a sibling temp file, fsync
|
|
63
66
|
* it, then rename over the target. The rename is atomic on most filesystems, so
|
|
64
67
|
* a crash mid-write never leaves the target half-written.
|
|
68
|
+
*
|
|
69
|
+
* A new file is created {@link FILE_CREATE_MODE}; an existing one keeps its
|
|
70
|
+
* permission bits (the rename replaces the inode, so they are copied onto the
|
|
71
|
+
* temp file first) — an edit must not strip `+x` or sharing the owner chose.
|
|
65
72
|
*/
|
|
66
73
|
export declare function atomicWriteFile(targetPath: string, content: string): Promise<void>;
|
|
67
74
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-util.d.mts","sourceRoot":"","sources":["../../src/tools/agent-toolset/fs-util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"fs-util.d.mts","sourceRoot":"","sources":["../../src/tools/agent-toolset/fs-util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,oGAAoG;AACpG,eAAO,MAAM,eAAe,MAAQ,CAAC;AACrC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,MAAQ,CAAC;AAEtC,uEAAuE;AACvE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAGzD;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAK1G;AAKD,2EAA2E;AAC3E,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B/D;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,CAAC,EAAE,MAAM,EACT,IAAI,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC1C,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBxF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAwBjE"}
|