Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 2 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/warp-api-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -42,7 +42,7 @@ jobs:
build:
timeout-minutes: 5
name: build
runs-on: ${{ github.repository == 'stainless-sdks/warp-api-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: 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')
permissions:
contents: read
Expand All @@ -65,45 +65,3 @@ jobs:

- name: Check build
run: ./scripts/build

- name: Get GitHub OIDC Token
if: |-
github.repository == 'stainless-sdks/warp-api-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: |-
github.repository == 'stainless-sdks/warp-api-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh
test:
timeout-minutes: 10
name: test
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '20'

- name: Set up pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
with:
version: '10.30.1'

- name: Bootstrap
run: ./scripts/bootstrap

- name: Run tests
run: ./scripts/test
26 changes: 26 additions & 0 deletions .github/workflows/promote_sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Promote SDK updates from this staging repository to the corresponding
# production repository.

name: Promote SDK

on:
workflow_dispatch:

jobs:
promote:
name: promote
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.repository.default_branch }}
fetch-depth: 0
persist-credentials: false

- name: Promote SDK to production
uses: warpdotdev/warp-github-actions/.github/actions/promote_sdk@main
with:
production_repo_token: ${{ secrets.STAINLESS_SDK_PROD_WRITE_TOKEN }}
8 changes: 2 additions & 6 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to NPM in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/warpdotdev/oz-sdk-typescript/actions/workflows/publish-npm.yml
# This workflow publishes the package to NPM.
# You can run this workflow manually by navigating to https://www.github.com/warpdotdev/oz-sdk-typescript/actions/workflows/publish-npm.yml
name: Publish NPM
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ jobs:
- name: Check release environment
run: |
bash ./bin/check-release-environment
env:
RELEASE_PLEASE_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
3 changes: 0 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
configured_endpoints: 23
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-0bc171e3cd0224936953898ce9b7eb35e1bf1cbf58a673fc80b32c90ce84bcd0.yml
openapi_spec_hash: 6c7d5f294b0800e878729314f57a09f0
config_hash: 279b20eafe220bf54131676cc0b9cdd2
4 changes: 4 additions & 0 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

errors=()

if [ -z "${RELEASE_PLEASE_TOKEN}" ]; then
errors+=("The RELEASE_PLEASE_TOKEN secret has not been set. Create a fine-grained GitHub PAT and add it as a repository secret.")
fi

lenErrors=${#errors[@]}

if [[ lenErrors -gt 0 ]]; then
Expand Down
5 changes: 1 addition & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": {
".": {}
},
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-v-in-tag": true,
"include-component-in-tag": false,
"versioning": "prerelease",
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ UPLOAD_RESPONSE=$(curl -v -X PUT \

if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/warp-api-typescript/$SHA'\033[0m"
echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/oz-sdk-typescript-staging/$SHA'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
Expand Down
7 changes: 4 additions & 3 deletions src/resources/agent/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export class Agent extends APIResource {
}

/**
* Alias for POST /agent/run. This is the preferred endpoint for creating new agent
* runs. Behavior is identical to POST /agent/run.
* Spawn a cloud agent with a prompt and optional configuration. The agent will be
* queued for execution and assigned a unique run ID.
*
* @example
* ```ts
Expand Down Expand Up @@ -1109,7 +1109,8 @@ export interface AgentRunParams {

/**
* The prompt/instruction for the agent to execute. Required unless a skill is
* specified via the skill field, config.skill_spec, or config.skills.
* specified via the skill field, config.skill_spec, or config.skills. Handoff
* requests may omit prompt when conversation_id is set.
*/
prompt?: string;

Expand Down
33 changes: 33 additions & 0 deletions src/resources/agent/agent_.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../core/resource';
import * as AgentAPI from './agent';
import { APIPromise } from '../../core/api-promise';
import { buildHeaders } from '../../internal/headers';
import { RequestOptions } from '../../internal/request-options';
Expand Down Expand Up @@ -172,6 +173,12 @@ export interface AgentResponse {
*/
inference_providers?: AgentResponse.InferenceProviders;

/**
* MCP server configurations attached to this agent by default. Run-level MCP
* config takes precedence over this agent-level default.
*/
mcp_servers?: { [key: string]: AgentAPI.McpServerConfig };

/**
* Optional base prompt for this agent
*/
Expand Down Expand Up @@ -300,6 +307,12 @@ export interface CreateAgentRequest {
*/
inference_providers?: CreateAgentRequest.InferenceProviders;

/**
* Optional map of MCP server configurations by name to attach to runs executed by
* this agent. Run-level MCP config takes precedence over this agent-level default.
*/
mcp_servers?: { [key: string]: AgentAPI.McpServerConfig };

/**
* 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
Expand Down Expand Up @@ -460,6 +473,13 @@ export interface UpdateAgentRequest {
*/
inference_providers?: UpdateAgentRequest.InferenceProviders | null;

/**
* Replacement map of MCP server configurations by name. Omit to leave unchanged,
* pass an empty object to clear, or pass a non-empty object to replace. Run-level
* MCP config takes precedence over this agent-level default.
*/
mcp_servers?: { [key: string]: AgentAPI.McpServerConfig };

/**
* Replacement list of memory stores. Omit to leave unchanged, pass an empty array
* to clear, or pass a non-empty array to replace.
Expand Down Expand Up @@ -612,6 +632,12 @@ export interface AgentCreateParams {
*/
inference_providers?: AgentCreateParams.InferenceProviders;

/**
* Optional map of MCP server configurations by name to attach to runs executed by
* this agent. Run-level MCP config takes precedence over this agent-level default.
*/
mcp_servers?: { [key: string]: AgentAPI.McpServerConfig };

/**
* 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
Expand Down Expand Up @@ -761,6 +787,13 @@ export interface AgentUpdateParams {
*/
inference_providers?: AgentUpdateParams.InferenceProviders | null;

/**
* Replacement map of MCP server configurations by name. Omit to leave unchanged,
* pass an empty object to clear, or pass a non-empty object to replace. Run-level
* MCP config takes precedence over this agent-level default.
*/
mcp_servers?: { [key: string]: AgentAPI.McpServerConfig };

/**
* Replacement list of memory stores. Omit to leave unchanged, pass an empty array
* to clear, or pass a non-empty array to replace.
Expand Down
11 changes: 9 additions & 2 deletions src/resources/agent/runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export class Runs extends APIResource {
* ```ts
* const response = await client.agent.runs.submitFollowup(
* 'runId',
* { message: 'message' },
* );
* ```
*/
Expand Down Expand Up @@ -347,6 +346,14 @@ export interface RunItem {

executor?: AgentAPI.UserProfile;

/**
* Whether the run's type is eligible for cancellation via the API.
* State-independent: false for GitHub Action and local runs; true for all other
* run types (including self-hosted). Clients should still gate the control on the
* run's current state.
*/
is_run_type_cancellable?: boolean;

/**
* Whether the sandbox environment is currently running
*/
Expand Down Expand Up @@ -741,7 +748,7 @@ export interface RunSubmitFollowupParams {
/**
* The follow-up message to send to the run.
*/
message: string;
message?: string;

/**
* Optional query mode for the follow-up. Defaults to `normal` when omitted. The
Expand Down
10 changes: 10 additions & 0 deletions tests/api-resources/agent/agent_.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ describe('resource agent', () => {
role_arn: 'role_arn',
},
},
mcp_servers: {
foo: {
args: ['string'],
command: 'command',
env: { foo: 'string' },
headers: { foo: 'string' },
url: 'https://example.com',
warp_id: 'warp_id',
},
},
memory_stores: [
{
access: 'read_write',
Expand Down
9 changes: 2 additions & 7 deletions tests/api-resources/agent/runs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ describe('resource runs', () => {
});

// Mock server tests are disabled
test.skip('submitFollowup: only required params', async () => {
const responsePromise = client.agent.runs.submitFollowup('runId', { message: 'message' });
test.skip('submitFollowup', async () => {
const responsePromise = client.agent.runs.submitFollowup('runId', {});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand All @@ -100,9 +100,4 @@ describe('resource runs', () => {
expect(dataAndResponse.data).toBe(response);
expect(dataAndResponse.response).toBe(rawResponse);
});

// Mock server tests are disabled
test.skip('submitFollowup: required and optional params', async () => {
const response = await client.agent.runs.submitFollowup('runId', { message: 'message', mode: 'normal' });
});
});
Loading