diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27be2a0..65e39f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,15 +21,15 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/warp-api-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' - name: Set up pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 with: version: '10.30.1' @@ -48,15 +48,15 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' - name: Set up pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 with: version: '10.30.1' @@ -71,7 +71,7 @@ jobs: github.repository == 'stainless-sdks/warp-api-typescript' && !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: core.setOutput('github_token', await core.getIDToken()); @@ -90,15 +90,15 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/warp-api-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' - name: Set up pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 with: version: '10.30.1' diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index e911be3..b6c2398 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -17,15 +17,15 @@ jobs: id-token: write steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v3 + uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1 with: node-version: '20' - name: Set up pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 - name: Install dependencies run: | diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index bf3a1de..cdc0277 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'warpdotdev/oz-sdk-typescript' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check release environment run: | diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7b135d9..b3b66c9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.4.0-alpha.1" + ".": "1.4.0-alpha.2" } diff --git a/.stats.yml b/.stats.yml index 2cb0b3b..e679286 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-1fecc5f5d6ee664d804b81bd1aa6eec4d3f170ffa788d214fead4f7e95ab9d4e.yml -openapi_spec_hash: 82990b03bd5a93e45bfc79db56ae7fc0 -config_hash: f52e7636f248f25c4ea0b086e7326816 +configured_endpoints: 23 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-964f646a32c318735de7673531a12788aede1840f7ab4893f2efa31c83440837.yml +openapi_spec_hash: 30f07ff0bfb491efb11cd88fce79968a +config_hash: 236823a4936c76818117c16aa5c188df diff --git a/CHANGELOG.md b/CHANGELOG.md index 20d8721..31a7e8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,45 @@ # Changelog +## 1.4.0-alpha.2 (2026-05-21) + +Full Changelog: [v1.4.0-alpha.1...v1.4.0-alpha.2](https://github.com/warpdotdev/oz-sdk-typescript/compare/v1.4.0-alpha.1...v1.4.0-alpha.2) + +### Features + +* Add default harness selection for agents ([a5ec72d](https://github.com/warpdotdev/oz-sdk-typescript/commit/a5ec72d95f8c53927571b3493396c1282c7f1844)) +* Add per-agent AWS Bedrock OIDC inference role (backend) ([c82dc15](https://github.com/warpdotdev/oz-sdk-typescript/commit/c82dc153cdac6ab44e4e2aa3bf451a50bba54a52)) +* Add updated_at to agent API responses ([0de41e1](https://github.com/warpdotdev/oz-sdk-typescript/commit/0de41e183fc457652ffda1cd94c624ed9f70e04c)) +* **agents:** add prompt property to agent identity data model ([bc889e1](https://github.com/warpdotdev/oz-sdk-typescript/commit/bc889e1be8e9d52df135230cb37aa6817192e4cd)) +* **api:** api update ([05594f1](https://github.com/warpdotdev/oz-sdk-typescript/commit/05594f1ad14c32f357fcd31ceaea7758c5b41a91)) +* **api:** api update ([4e81853](https://github.com/warpdotdev/oz-sdk-typescript/commit/4e81853387e0cb3031ba517781ab2560f92a98fc)) +* **api:** api update ([64fc1a2](https://github.com/warpdotdev/oz-sdk-typescript/commit/64fc1a2471b3e0ed9873795a04b4f0e2368c92dd)) +* **api:** api update ([f43cf4f](https://github.com/warpdotdev/oz-sdk-typescript/commit/f43cf4fb4f402b3961166a792b7556fbee266ece)) +* **api:** api update ([a530c11](https://github.com/warpdotdev/oz-sdk-typescript/commit/a530c11d0897c8c1cc3706e1fc68d2d9b1768689)) +* **api:** api update ([63390f5](https://github.com/warpdotdev/oz-sdk-typescript/commit/63390f5adc5bfae988ebc6081c3f447672c59d61)) +* **api:** api update ([89e4435](https://github.com/warpdotdev/oz-sdk-typescript/commit/89e44352062b2526d9bd39f28d70562c87d667cf)) +* **api:** api update ([345e736](https://github.com/warpdotdev/oz-sdk-typescript/commit/345e736aba6081962afbae4d997b267ee7755497)) +* **api:** api update ([63ba09a](https://github.com/warpdotdev/oz-sdk-typescript/commit/63ba09ae4224b712830fb30980b96e3658804e01)) +* **api:** api update ([cfd9f36](https://github.com/warpdotdev/oz-sdk-typescript/commit/cfd9f367cd29d9bd81d74e1b1c4c2a908806967b)) +* **api:** api update ([cc72fe8](https://github.com/warpdotdev/oz-sdk-typescript/commit/cc72fe842eb431c60bbe72f16b3aab1694893fb6)) +* Codex auth: API key support. ([3239af5](https://github.com/warpdotdev/oz-sdk-typescript/commit/3239af50b067dc61e9795e0abbd0e11fb155e83d)) +* **memory:** agent identity memory store attachments — API layer ([f987f21](https://github.com/warpdotdev/oz-sdk-typescript/commit/f987f2148a940658d6e751ef1b98e4a5dbc2c3a3)) +* **memory:** wire memory stores into run pipeline and add listing endpoint ([56324ee](https://github.com/warpdotdev/oz-sdk-typescript/commit/56324ee8cf997f928aa67e3c95821b78fea619b2)) +* Partial support for multiple skills per run ([a24ac35](https://github.com/warpdotdev/oz-sdk-typescript/commit/a24ac355581959d8fa6329a8adc2a7f11cc31dfb)) +* Resolve Bedrock region server-side and ship as AWS_REGION ([fce3967](https://github.com/warpdotdev/oz-sdk-typescript/commit/fce39679b0ca2095b812fac8631b71d81fceef63)) +* Retrieve memories in third party harnesses ([3df6e50](https://github.com/warpdotdev/oz-sdk-typescript/commit/3df6e50ad1915320ad8b0e15be00dac5c55c1b06)) +* Support service account impersonation in GCP Workload Identity Federation config ([2a1e2cd](https://github.com/warpdotdev/oz-sdk-typescript/commit/2a1e2cd9bd113ab834c70ff1df781696220b21b5)) + + +### Bug Fixes + +* **typescript:** upgrade tsc-multi so that it works with Node 26 ([17a7800](https://github.com/warpdotdev/oz-sdk-typescript/commit/17a7800ccf6ea73492d8dc5d20ff3a1b83ab36dc)) + + +### Chores + +* redact api-key headers in debug logs ([173a753](https://github.com/warpdotdev/oz-sdk-typescript/commit/173a7532c552b3741ecb6e34a177d4f7f4ecce5d)) +* **tests:** remove redundant File import ([c8353e7](https://github.com/warpdotdev/oz-sdk-typescript/commit/c8353e75abd9f48897f6f60339cfdf62920eaf19)) + ## 1.4.0-alpha.1 (2026-05-07) Full Changelog: [v1.4.0-alpha.0...v1.4.0-alpha.1](https://github.com/warpdotdev/oz-sdk-typescript/compare/v1.4.0-alpha.0...v1.4.0-alpha.1) diff --git a/api.md b/api.md index 1eb0f66..83812ab 100644 --- a/api.md +++ b/api.md @@ -79,6 +79,7 @@ Methods: - client.agent.agent.update(uid, { ...params }) -> AgentResponse - client.agent.agent.list() -> ListAgentIdentitiesResponse - client.agent.agent.delete(uid) -> void +- client.agent.agent.get(uid) -> AgentResponse ## Sessions diff --git a/package.json b/package.json index 2f61787..8e52e89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oz-agent-sdk", - "version": "1.4.0-alpha.1", + "version": "1.4.0-alpha.2", "description": "The official TypeScript library for the Oz API API", "author": "Oz API <>", "types": "dist/index.d.ts", @@ -43,7 +43,7 @@ "publint": "^0.2.12", "ts-jest": "^29.1.0", "ts-node": "^10.5.0", - "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz", + "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz", "tsconfig-paths": "^4.0.0", "tslib": "^2.8.1", "typescript": "5.8.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0540538..6497094 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,8 +56,8 @@ importers: specifier: ^10.5.0 version: 10.7.0(@swc/core@1.4.16)(@types/node@20.19.11)(typescript@5.8.3) tsc-multi: - specifier: https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz - version: https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz(typescript@5.8.3) + specifier: https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz + version: https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz(typescript@5.8.3) tsconfig-paths: specifier: ^4.0.0 version: 4.2.0 @@ -3119,13 +3119,13 @@ packages: '@swc/wasm': optional: true - tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz: + tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz: resolution: { - integrity: sha512-tWyCXnx0WqCkVlo5s+4KMj7HC0/0YrCZY0PustUwX9F2lNwd8Kp07q/Q56uGvV9q80XaSDrhy0YqBmrX5TDNpQ==, - tarball: https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz, + integrity: sha512-LrjLRdfDnJ6UcZPSsxxY8QDnZmS3ZpPyvzgjUlNMjjRoTAUVqeL+IWrIzEU3Z+CwVrpVI97PePRLenEfCtR/UQ==, + tarball: https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz, } - version: 1.1.9 + version: 1.1.11 engines: { node: '>=14' } hasBin: true peerDependencies: @@ -5399,7 +5399,7 @@ snapshots: optionalDependencies: '@swc/core': 1.4.16 - tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz(typescript@5.8.3): + tsc-multi@https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz(typescript@5.8.3): dependencies: debug: 4.4.1 fast-glob: 3.3.2 diff --git a/src/internal/utils/log.ts b/src/internal/utils/log.ts index e70ef91..0ff4adb 100644 --- a/src/internal/utils/log.ts +++ b/src/internal/utils/log.ts @@ -107,6 +107,8 @@ export const formatRequestDetails = (details: { name, ( name.toLowerCase() === 'authorization' || + name.toLowerCase() === 'api-key' || + name.toLowerCase() === 'x-api-key' || name.toLowerCase() === 'cookie' || name.toLowerCase() === 'set-cookie' ) ? diff --git a/src/resources/agent/agent.ts b/src/resources/agent/agent.ts index e9faa4e..ec4d9df 100644 --- a/src/resources/agent/agent.ts +++ b/src/resources/agent/agent.ts @@ -245,11 +245,21 @@ export interface AmbientAgentConfig { */ idle_timeout_minutes?: number; + /** + * Inference provider settings used for LLM calls. + */ + inference_providers?: AmbientAgentConfig.InferenceProviders; + /** * Map of MCP server configurations by name */ mcp_servers?: { [key: string]: McpServerConfig }; + /** + * Memory stores to attach to this run. + */ + memory_stores?: Array; + /** * LLM model to use (uses team default if not specified) */ @@ -274,13 +284,23 @@ export interface AmbientAgentConfig { session_sharing?: AmbientAgentConfig.SessionSharing; /** - * Skill specification identifying which agent skill to use. Format: + * Skill specification identifying the primary agent skill to use. Format: * "{owner}/{repo}:{skill_path}" Example: - * "warpdotdev/warp-server:.claude/skills/deploy/SKILL.md" Use the list agents - * endpoint to discover available skills. + * "warpdotdev/warp-server:.claude/skills/deploy/SKILL.md" Mutually exclusive with + * skills in create/update requests. Responses include the first skills entry here + * for backward compatibility. Use the list agents endpoint to discover available + * skills. */ skill_spec?: string; + /** + * Ordered skill specifications to attach to the run. Format: + * "{owner}/{repo}:{skill_path}" Example: + * "warpdotdev/warp-server:.claude/skills/deploy/SKILL.md" Mutually exclusive with + * skill_spec in create/update requests. + */ + skills?: Array; + /** * Self-hosted worker ID that should execute this task. If not specified or set to * "warp", the task runs on Warp-hosted workers. @@ -316,6 +336,65 @@ export namespace AmbientAgentConfig { * type is "claude". */ claude_auth_secret_name?: string; + + /** + * Name of a managed secret for Codex harness authentication. The secret must exist + * within the caller's personal or team scope. Only applicable when harness type is + * "codex". + */ + codex_auth_secret_name?: string; + } + + /** + * Inference provider settings used for LLM calls. + */ + export interface InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + aws?: InferenceProviders.Aws; + } + + export namespace InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + export interface Aws { + /** + * If true, opt out of Bedrock at this layer. + */ + disabled?: boolean; + + /** + * AWS region used for STS when assuming the Bedrock inference role. + */ + region?: string; + + /** + * IAM role ARN to assume when calling Bedrock. + */ + role_arn?: string; + } + } + + /** + * Reference to a memory store to attach to an agent. + */ + export interface MemoryStore { + /** + * Access level for the store. + */ + access: 'read_write' | 'read_only'; + + /** + * Instructions for how the agent should use this memory store. Must not be empty. + */ + instructions: string; + + /** + * UID of the memory store. + */ + uid: string; } /** @@ -625,6 +704,11 @@ export interface GcpProviderConfig { * Workload Identity Federation provider ID */ workload_identity_federation_provider_id: string; + + /** + * Optional GCP service account email to impersonate + */ + service_account_email?: string; } /** @@ -1025,7 +1109,7 @@ export interface AgentRunParams { /** * The prompt/instruction for the agent to execute. Required unless a skill is - * specified via the skill field or config.skill_spec. + * specified via the skill field, config.skill_spec, or config.skills. */ prompt?: string; diff --git a/src/resources/agent/agent_.ts b/src/resources/agent/agent_.ts index 3cc745b..32e7dc7 100644 --- a/src/resources/agent/agent_.ts +++ b/src/resources/agent/agent_.ts @@ -67,6 +67,20 @@ export class Agent extends APIResource { headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } + + /** + * Retrieve a single agent by its unique identifier. The response includes an + * `available` flag indicating whether the agent is within the team's plan limit + * and may be used for runs. + * + * @example + * ```ts + * const agentResponse = await client.agent.agent.get('uid'); + * ``` + */ + get(uid: string, options?: RequestOptions): APIPromise { + return this._client.get(path`/agent/identities/${uid}`, options); + } } export interface AgentResponse { @@ -80,6 +94,12 @@ export interface AgentResponse { */ created_at: string; + /** + * Memory stores attached to this agent. Always present; empty when no stores are + * attached. + */ + memory_stores: Array; + /** * Name of the agent */ @@ -101,13 +121,79 @@ export interface AgentResponse { */ uid: string; + /** + * Default harness for runs executed by this agent. The precedence order for + * harness resolution is: + * + * 1. The harness specified on the run itself + * 2. The agent's base harness + * 3. Oz + */ + base_harness?: string; + + /** + * Base model for runs executed by this agent. The precedence order for model + * resolution is: + * + * 1. The model specified on the run itself + * 2. The agent's base model + * 3. The team's default model + */ + base_model?: string; + /** * Optional description of the agent */ description?: string | null; + + /** + * Default cloud environment ID for runs executed by this agent. The precedence + * order for environment resolution is: + * + * 1. The environment specified on the run itself + * 2. The agent's default environment + * 3. An empty environment + */ + environment_id?: string; + + /** + * Authentication secrets for third-party harnesses. Only the secret for the + * harness specified gets injected into the environment. + */ + harness_auth_secrets?: AgentResponse.HarnessAuthSecrets; + + /** + * Inference provider settings used for LLM calls. + */ + inference_providers?: AgentResponse.InferenceProviders; + + /** + * Optional base prompt for this agent + */ + prompt?: string | null; } export namespace AgentResponse { + /** + * Reference to a memory store to attach to an agent. + */ + export interface MemoryStore { + /** + * Access level for the store. + */ + access: 'read_write' | 'read_only'; + + /** + * Instructions for how the agent should use this memory store. Must not be empty. + */ + instructions: string; + + /** + * UID of the memory store. + */ + uid: string; + } + /** * Reference to a managed secret by name. */ @@ -117,6 +203,58 @@ export namespace AgentResponse { */ name: string; } + + /** + * Authentication secrets for third-party harnesses. Only the secret for the + * harness specified gets injected into the environment. + */ + export interface HarnessAuthSecrets { + /** + * Name of a managed secret for Claude Code harness authentication. The secret must + * exist within the caller's personal or team scope. Only applicable when harness + * type is "claude". + */ + claude_auth_secret_name?: string; + + /** + * Name of a managed secret for Codex harness authentication. The secret must exist + * within the caller's personal or team scope. Only applicable when harness type is + * "codex". + */ + codex_auth_secret_name?: string; + } + + /** + * Inference provider settings used for LLM calls. + */ + export interface InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + aws?: InferenceProviders.Aws; + } + + export namespace InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + export interface Aws { + /** + * If true, opt out of Bedrock at this layer. + */ + disabled?: boolean; + + /** + * AWS region used for STS when assuming the Bedrock inference role. + */ + region?: string; + + /** + * IAM role ARN to assume when calling Bedrock. + */ + role_arn?: string; + } + } } export interface CreateAgentRequest { @@ -125,11 +263,50 @@ export interface CreateAgentRequest { */ name: string; + /** + * Optional default harness for runs executed by this agent. + */ + base_harness?: string | null; + + /** + * Optional base model for runs executed by this agent. + */ + base_model?: string | null; + /** * Optional description of the agent */ description?: string | null; + /** + * Optional default cloud environment ID for runs executed by this agent. The + * environment must be owned by the same team as the agent. + */ + environment_id?: string | null; + + /** + * Authentication secrets for third-party harnesses. Only the secret for the + * harness specified gets injected into the environment. + */ + harness_auth_secrets?: CreateAgentRequest.HarnessAuthSecrets; + + /** + * Inference provider settings used for LLM calls. + */ + inference_providers?: CreateAgentRequest.InferenceProviders; + + /** + * Optional list of memory stores to attach to the agent. Each store must be + * team-owned by the same team as the agent. Duplicate UIDs within a single request + * are rejected. + */ + memory_stores?: Array; + + /** + * Optional base prompt for this agent + */ + prompt?: string | null; + /** * Optional list of secrets associated with the agent. Duplicate names within a * single request are rejected. Each entry is unioned into the run-time secret @@ -148,6 +325,78 @@ export interface CreateAgentRequest { } export namespace CreateAgentRequest { + /** + * Authentication secrets for third-party harnesses. Only the secret for the + * harness specified gets injected into the environment. + */ + export interface HarnessAuthSecrets { + /** + * Name of a managed secret for Claude Code harness authentication. The secret must + * exist within the caller's personal or team scope. Only applicable when harness + * type is "claude". + */ + claude_auth_secret_name?: string; + + /** + * Name of a managed secret for Codex harness authentication. The secret must exist + * within the caller's personal or team scope. Only applicable when harness type is + * "codex". + */ + codex_auth_secret_name?: string; + } + + /** + * Inference provider settings used for LLM calls. + */ + export interface InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + aws?: InferenceProviders.Aws; + } + + export namespace InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + export interface Aws { + /** + * If true, opt out of Bedrock at this layer. + */ + disabled?: boolean; + + /** + * AWS region used for STS when assuming the Bedrock inference role. + */ + region?: string; + + /** + * IAM role ARN to assume when calling Bedrock. + */ + role_arn?: string; + } + } + + /** + * Reference to a memory store to attach to an agent. + */ + export interface MemoryStore { + /** + * Access level for the store. + */ + access: 'read_write' | 'read_only'; + + /** + * Instructions for how the agent should use this memory store. Must not be empty. + */ + instructions: string; + + /** + * UID of the memory store. + */ + uid: string; + } + /** * Reference to a managed secret by name. */ @@ -171,17 +420,58 @@ export interface ListAgentIdentitiesResponse { * - Non-empty: replace the field wholesale with the provided value. */ export interface UpdateAgentRequest { + /** + * Replacement default harness. Omit or pass `null` to leave unchanged, or pass an + * empty string to clear. + */ + base_harness?: string | null; + + /** + * Replacement base model. Omit or pass `null` to leave unchanged, or pass an empty + * string to clear. + */ + base_model?: string | null; + /** * Replacement description. Omit or pass `null` to leave unchanged, or use an empty * value to clear. */ description?: string | null; + /** + * Replacement default cloud environment ID. Omit or pass `null` to leave + * unchanged, or pass an empty string to clear. + */ + environment_id?: string | null; + + /** + * Authentication secrets for third-party harnesses. Only the secret for the + * harness specified gets injected into the environment. + */ + harness_auth_secrets?: UpdateAgentRequest.HarnessAuthSecrets | null; + + /** + * Inference provider settings used for LLM calls. + */ + inference_providers?: UpdateAgentRequest.InferenceProviders | null; + + /** + * Replacement list of memory stores. Omit to leave unchanged, pass an empty array + * to clear, or pass a non-empty array to replace. + */ + memory_stores?: Array | null; + /** * The new name for the agent */ name?: string; + /** + * Replacement prompt. Omit or pass `null` to leave unchanged, or use an empty + * value to clear. + */ + prompt?: string | null; + /** * Replacement list of secrets. Omit to leave unchanged, pass an empty array to * clear, or pass a non-empty array to replace. Duplicate names are rejected. @@ -196,6 +486,78 @@ export interface UpdateAgentRequest { } export namespace UpdateAgentRequest { + /** + * Authentication secrets for third-party harnesses. Only the secret for the + * harness specified gets injected into the environment. + */ + export interface HarnessAuthSecrets { + /** + * Name of a managed secret for Claude Code harness authentication. The secret must + * exist within the caller's personal or team scope. Only applicable when harness + * type is "claude". + */ + claude_auth_secret_name?: string; + + /** + * Name of a managed secret for Codex harness authentication. The secret must exist + * within the caller's personal or team scope. Only applicable when harness type is + * "codex". + */ + codex_auth_secret_name?: string; + } + + /** + * Inference provider settings used for LLM calls. + */ + export interface InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + aws?: InferenceProviders.Aws; + } + + export namespace InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + export interface Aws { + /** + * If true, opt out of Bedrock at this layer. + */ + disabled?: boolean; + + /** + * AWS region used for STS when assuming the Bedrock inference role. + */ + region?: string; + + /** + * IAM role ARN to assume when calling Bedrock. + */ + role_arn?: string; + } + } + + /** + * Reference to a memory store to attach to an agent. + */ + export interface MemoryStore { + /** + * Access level for the store. + */ + access: 'read_write' | 'read_only'; + + /** + * Instructions for how the agent should use this memory store. Must not be empty. + */ + instructions: string; + + /** + * UID of the memory store. + */ + uid: string; + } + /** * Reference to a managed secret by name. */ @@ -213,11 +575,50 @@ export interface AgentCreateParams { */ name: string; + /** + * Optional default harness for runs executed by this agent. + */ + base_harness?: string | null; + + /** + * Optional base model for runs executed by this agent. + */ + base_model?: string | null; + /** * Optional description of the agent */ description?: string | null; + /** + * Optional default cloud environment ID for runs executed by this agent. The + * environment must be owned by the same team as the agent. + */ + environment_id?: string | null; + + /** + * Authentication secrets for third-party harnesses. Only the secret for the + * harness specified gets injected into the environment. + */ + harness_auth_secrets?: AgentCreateParams.HarnessAuthSecrets; + + /** + * Inference provider settings used for LLM calls. + */ + inference_providers?: AgentCreateParams.InferenceProviders; + + /** + * Optional list of memory stores to attach to the agent. Each store must be + * team-owned by the same team as the agent. Duplicate UIDs within a single request + * are rejected. + */ + memory_stores?: Array; + + /** + * Optional base prompt for this agent + */ + prompt?: string | null; + /** * Optional list of secrets associated with the agent. Duplicate names within a * single request are rejected. Each entry is unioned into the run-time secret @@ -236,6 +637,78 @@ export interface AgentCreateParams { } export namespace AgentCreateParams { + /** + * Authentication secrets for third-party harnesses. Only the secret for the + * harness specified gets injected into the environment. + */ + export interface HarnessAuthSecrets { + /** + * Name of a managed secret for Claude Code harness authentication. The secret must + * exist within the caller's personal or team scope. Only applicable when harness + * type is "claude". + */ + claude_auth_secret_name?: string; + + /** + * Name of a managed secret for Codex harness authentication. The secret must exist + * within the caller's personal or team scope. Only applicable when harness type is + * "codex". + */ + codex_auth_secret_name?: string; + } + + /** + * Inference provider settings used for LLM calls. + */ + export interface InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + aws?: InferenceProviders.Aws; + } + + export namespace InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + export interface Aws { + /** + * If true, opt out of Bedrock at this layer. + */ + disabled?: boolean; + + /** + * AWS region used for STS when assuming the Bedrock inference role. + */ + region?: string; + + /** + * IAM role ARN to assume when calling Bedrock. + */ + role_arn?: string; + } + } + + /** + * Reference to a memory store to attach to an agent. + */ + export interface MemoryStore { + /** + * Access level for the store. + */ + access: 'read_write' | 'read_only'; + + /** + * Instructions for how the agent should use this memory store. Must not be empty. + */ + instructions: string; + + /** + * UID of the memory store. + */ + uid: string; + } + /** * Reference to a managed secret by name. */ @@ -248,17 +721,58 @@ export namespace AgentCreateParams { } export interface AgentUpdateParams { + /** + * Replacement default harness. Omit or pass `null` to leave unchanged, or pass an + * empty string to clear. + */ + base_harness?: string | null; + + /** + * Replacement base model. Omit or pass `null` to leave unchanged, or pass an empty + * string to clear. + */ + base_model?: string | null; + /** * Replacement description. Omit or pass `null` to leave unchanged, or use an empty * value to clear. */ description?: string | null; + /** + * Replacement default cloud environment ID. Omit or pass `null` to leave + * unchanged, or pass an empty string to clear. + */ + environment_id?: string | null; + + /** + * Authentication secrets for third-party harnesses. Only the secret for the + * harness specified gets injected into the environment. + */ + harness_auth_secrets?: AgentUpdateParams.HarnessAuthSecrets | null; + + /** + * Inference provider settings used for LLM calls. + */ + inference_providers?: AgentUpdateParams.InferenceProviders | null; + + /** + * Replacement list of memory stores. Omit to leave unchanged, pass an empty array + * to clear, or pass a non-empty array to replace. + */ + memory_stores?: Array | null; + /** * The new name for the agent */ name?: string; + /** + * Replacement prompt. Omit or pass `null` to leave unchanged, or use an empty + * value to clear. + */ + prompt?: string | null; + /** * Replacement list of secrets. Omit to leave unchanged, pass an empty array to * clear, or pass a non-empty array to replace. Duplicate names are rejected. @@ -273,6 +787,78 @@ export interface AgentUpdateParams { } export namespace AgentUpdateParams { + /** + * Authentication secrets for third-party harnesses. Only the secret for the + * harness specified gets injected into the environment. + */ + export interface HarnessAuthSecrets { + /** + * Name of a managed secret for Claude Code harness authentication. The secret must + * exist within the caller's personal or team scope. Only applicable when harness + * type is "claude". + */ + claude_auth_secret_name?: string; + + /** + * Name of a managed secret for Codex harness authentication. The secret must exist + * within the caller's personal or team scope. Only applicable when harness type is + * "codex". + */ + codex_auth_secret_name?: string; + } + + /** + * Inference provider settings used for LLM calls. + */ + export interface InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + aws?: InferenceProviders.Aws; + } + + export namespace InferenceProviders { + /** + * Configures AWS Bedrock as the LLM inference provider for this agent or run. + */ + export interface Aws { + /** + * If true, opt out of Bedrock at this layer. + */ + disabled?: boolean; + + /** + * AWS region used for STS when assuming the Bedrock inference role. + */ + region?: string; + + /** + * IAM role ARN to assume when calling Bedrock. + */ + role_arn?: string; + } + } + + /** + * Reference to a memory store to attach to an agent. + */ + export interface MemoryStore { + /** + * Access level for the store. + */ + access: 'read_write' | 'read_only'; + + /** + * Instructions for how the agent should use this memory store. Must not be empty. + */ + instructions: string; + + /** + * UID of the memory store. + */ + uid: string; + } + /** * Reference to a managed secret by name. */ diff --git a/src/resources/agent/runs.ts b/src/resources/agent/runs.ts index eb42578..5bd0dc6 100644 --- a/src/resources/agent/runs.ts +++ b/src/resources/agent/runs.ts @@ -455,6 +455,11 @@ export namespace RunItem { * Cost of LLM inference for the run */ inference_cost?: number; + + /** + * Cost of platform usage for the run + */ + platform_cost?: number; } /** diff --git a/src/resources/agent/schedules.ts b/src/resources/agent/schedules.ts index b549fe7..893e1cc 100644 --- a/src/resources/agent/schedules.ts +++ b/src/resources/agent/schedules.ts @@ -258,7 +258,7 @@ export interface ScheduleCreateParams { /** * The prompt/instruction for the agent to execute. Required unless - * agent_config.skill_spec is provided. + * agent_config.skill_spec or agent_config.skills is provided. */ prompt?: string; @@ -304,7 +304,7 @@ export interface ScheduleUpdateParams { /** * The prompt/instruction for the agent to execute. Required unless - * agent_config.skill_spec is provided. + * agent_config.skill_spec or agent_config.skills is provided. */ prompt?: string; } diff --git a/src/version.ts b/src/version.ts index 8cdaf0f..01c06f9 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.4.0-alpha.1'; // x-release-please-version +export const VERSION = '1.4.0-alpha.2'; // x-release-please-version diff --git a/tests/api-resources/agent/agent_.test.ts b/tests/api-resources/agent/agent_.test.ts index 3a263ad..53a0c9d 100644 --- a/tests/api-resources/agent/agent_.test.ts +++ b/tests/api-resources/agent/agent_.test.ts @@ -24,7 +24,29 @@ describe('resource agent', () => { test.skip('create: required and optional params', async () => { const response = await client.agent.agent.create({ name: 'name', + base_harness: 'base_harness', + base_model: 'base_model', description: 'description', + environment_id: 'environment_id', + harness_auth_secrets: { + claude_auth_secret_name: 'claude_auth_secret_name', + codex_auth_secret_name: 'codex_auth_secret_name', + }, + inference_providers: { + aws: { + disabled: true, + region: 'region', + role_arn: 'role_arn', + }, + }, + memory_stores: [ + { + access: 'read_write', + instructions: 'instructions', + uid: 'uid', + }, + ], + prompt: 'prompt', secrets: [{ name: 'name' }], skills: ['string'], }); @@ -65,4 +87,16 @@ describe('resource agent', () => { expect(dataAndResponse.data).toBe(response); expect(dataAndResponse.response).toBe(rawResponse); }); + + // Mock server tests are disabled + test.skip('get', async () => { + const responsePromise = client.agent.agent.get('uid'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); }); diff --git a/tests/api-resources/agent/schedules.test.ts b/tests/api-resources/agent/schedules.test.ts index b9dc864..65331ed 100644 --- a/tests/api-resources/agent/schedules.test.ts +++ b/tests/api-resources/agent/schedules.test.ts @@ -33,8 +33,18 @@ describe('resource schedules', () => { computer_use_enabled: true, environment_id: 'environment_id', harness: { type: 'oz' }, - harness_auth_secrets: { claude_auth_secret_name: 'claude_auth_secret_name' }, + harness_auth_secrets: { + claude_auth_secret_name: 'claude_auth_secret_name', + codex_auth_secret_name: 'codex_auth_secret_name', + }, idle_timeout_minutes: 1, + inference_providers: { + aws: { + disabled: true, + region: 'region', + role_arn: 'role_arn', + }, + }, mcp_servers: { foo: { args: ['string'], @@ -45,10 +55,18 @@ describe('resource schedules', () => { warp_id: 'warp_id', }, }, + memory_stores: [ + { + access: 'read_write', + instructions: 'instructions', + uid: 'uid', + }, + ], model_id: 'model_id', name: 'name', session_sharing: { public_access: 'VIEWER' }, skill_spec: 'skill_spec', + skills: ['string'], worker_host: 'worker_host', }, agent_uid: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -98,8 +116,18 @@ describe('resource schedules', () => { computer_use_enabled: true, environment_id: 'environment_id', harness: { type: 'oz' }, - harness_auth_secrets: { claude_auth_secret_name: 'claude_auth_secret_name' }, + harness_auth_secrets: { + claude_auth_secret_name: 'claude_auth_secret_name', + codex_auth_secret_name: 'codex_auth_secret_name', + }, idle_timeout_minutes: 1, + inference_providers: { + aws: { + disabled: true, + region: 'region', + role_arn: 'role_arn', + }, + }, mcp_servers: { foo: { args: ['string'], @@ -110,10 +138,18 @@ describe('resource schedules', () => { warp_id: 'warp_id', }, }, + memory_stores: [ + { + access: 'read_write', + instructions: 'instructions', + uid: 'uid', + }, + ], model_id: 'model_id', name: 'name', session_sharing: { public_access: 'VIEWER' }, skill_spec: 'skill_spec', + skills: ['string'], worker_host: 'worker_host', }, agent_uid: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts index 418d26a..a17a91e 100644 --- a/tests/uploads.test.ts +++ b/tests/uploads.test.ts @@ -1,7 +1,6 @@ import fs from 'fs'; import type { ResponseLike } from 'oz-agent-sdk/internal/to-file'; import { toFile } from 'oz-agent-sdk/core/uploads'; -import { File } from 'node:buffer'; class MyClass { name: string = 'foo';