From 0d29ff7dac4cbf7b0da3171ea3d772f20e21dd90 Mon Sep 17 00:00:00 2001 From: Akshita Goyal Date: Mon, 4 May 2026 19:33:02 +0530 Subject: [PATCH 1/3] feat: add AgentRunActivityAction type and action field to activity interfaces Adds AgentRunActivityAction interface (name + redirect_url) and an optional action field to AgentRunActivity and CreateAgentRunActivityRequest, so agents can attach CTA buttons to response activities. Co-Authored-By: Claude Sonnet 4.6 --- src/models/AgentRun.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/models/AgentRun.ts b/src/models/AgentRun.ts index bf848b1..20be042 100644 --- a/src/models/AgentRun.ts +++ b/src/models/AgentRun.ts @@ -84,6 +84,14 @@ export interface AgentRunActivityTextContent { */ export type AgentRunActivityContent = AgentRunActivityActionContent | AgentRunActivityTextContent; +/** + * Top-level action attached to an activity (e.g. a CTA button shown below the response body). + */ +export interface AgentRunActivityAction { + name: string; + redirect_url: string | null; +} + /** * Agent Run Activity interface */ @@ -99,6 +107,7 @@ export interface AgentRunActivity extends BaseModel { type: AgentRunActivityType; project?: string; workspace: string; + actions?: AgentRunActivityAction[]; } /** @@ -111,4 +120,5 @@ export interface CreateAgentRunActivityRequest { signal_metadata?: Record; type: Exclude; project?: string; + actions?: AgentRunActivityAction[]; } From 3d7d1ef377b732134f414ea56a25f5e8c1f7445a Mon Sep 17 00:00:00 2001 From: Akshita Goyal Date: Tue, 5 May 2026 13:57:56 +0530 Subject: [PATCH 2/3] feat(agent-runs): add update method and UpdateAgentRunRequest type Co-Authored-By: Claude Sonnet 4.6 --- src/api/AgentRuns/index.ts | 13 ++++++++++++- src/models/AgentRun.ts | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/api/AgentRuns/index.ts b/src/api/AgentRuns/index.ts index 9c47dd0..eac0aab 100644 --- a/src/api/AgentRuns/index.ts +++ b/src/api/AgentRuns/index.ts @@ -1,6 +1,6 @@ import { BaseResource } from "../BaseResource"; import { Configuration } from "../../Configuration"; -import { AgentRun, CreateAgentRunRequest } from "../../models/AgentRun"; +import { AgentRun, CreateAgentRunRequest, UpdateAgentRunRequest } from "../../models/AgentRun"; import { Activities } from "./Activities"; /** @@ -34,5 +34,16 @@ export class AgentRuns extends BaseResource { async retrieve(workspaceSlug: string, runId: string): Promise { return this.get(`/workspaces/${workspaceSlug}/runs/${runId}/`); } + + /** + * Update an agent run + * @param workspaceSlug - The workspace slug + * @param runId - The agent run ID + * @param data - The fields to update + * @returns The updated agent run + */ + async update(workspaceSlug: string, runId: string, data: UpdateAgentRunRequest): Promise { + return this.patch(`/workspaces/${workspaceSlug}/runs/${runId}/`, data); + } } diff --git a/src/models/AgentRun.ts b/src/models/AgentRun.ts index 20be042..a5d7e5e 100644 --- a/src/models/AgentRun.ts +++ b/src/models/AgentRun.ts @@ -62,6 +62,13 @@ export interface CreateAgentRunRequest { type?: AgentRunType; } +/** + * Update agent run request interface + */ +export interface UpdateAgentRunRequest { + external_link?: string | null; +} + /** * Agent run activity content for action type */ From 9e86ff6f319aeffc59154a36607e9c2429a1b54c Mon Sep 17 00:00:00 2001 From: Akshita Goyal Date: Tue, 5 May 2026 15:53:04 +0530 Subject: [PATCH 3/3] refactor(agent-runs): move actions into content type, remove incorrect top-level fields Co-Authored-By: Claude Sonnet 4.6 --- src/models/AgentRun.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/models/AgentRun.ts b/src/models/AgentRun.ts index a5d7e5e..93c62d4 100644 --- a/src/models/AgentRun.ts +++ b/src/models/AgentRun.ts @@ -69,6 +69,14 @@ export interface UpdateAgentRunRequest { external_link?: string | null; } +/** + * Action button attached to an activity (e.g. a CTA shown below the response body). + */ +export interface AgentRunActivityAction { + name: string; + redirect_url: string | null; +} + /** * Agent run activity content for action type */ @@ -84,6 +92,7 @@ export interface AgentRunActivityActionContent { export interface AgentRunActivityTextContent { type: Exclude; body: string; + actions?: AgentRunActivityAction[]; } /** @@ -91,14 +100,6 @@ export interface AgentRunActivityTextContent { */ export type AgentRunActivityContent = AgentRunActivityActionContent | AgentRunActivityTextContent; -/** - * Top-level action attached to an activity (e.g. a CTA button shown below the response body). - */ -export interface AgentRunActivityAction { - name: string; - redirect_url: string | null; -} - /** * Agent Run Activity interface */ @@ -114,7 +115,6 @@ export interface AgentRunActivity extends BaseModel { type: AgentRunActivityType; project?: string; workspace: string; - actions?: AgentRunActivityAction[]; } /** @@ -127,5 +127,4 @@ export interface CreateAgentRunActivityRequest { signal_metadata?: Record; type: Exclude; project?: string; - actions?: AgentRunActivityAction[]; }