@agents24/node 0.5.33 → 0.5.34

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.
@@ -23,6 +23,8 @@ type EmbedStreamRequest = {
23
23
  thread_id?: string;
24
24
  knowledge_namespaces?: Record<string, string>;
25
25
  knowledgeNamespaces?: Record<string, string>;
26
+ requestedOutputs?: string[];
27
+ requested_outputs?: string[];
26
28
  tool_inputs?: ToolInputOverrides;
27
29
  requested_model_id?: string;
28
30
  requested_model_node_id?: string;
@@ -159,6 +161,7 @@ type EmbedThreadMessageSubmit = {
159
161
  input: string;
160
162
  attachmentIds?: string[];
161
163
  requestedModelId?: string;
164
+ requestedOutputs?: readonly string[];
162
165
  toolInputs?: ToolInputOverrides;
163
166
  metadata?: Record<string, unknown>;
164
167
  };
@@ -635,6 +638,8 @@ type AgentStreamRequest = {
635
638
  attachment_ids?: string[];
636
639
  thread_id?: string;
637
640
  runtime_context?: Record<string, unknown>;
641
+ requestedOutputs?: string[];
642
+ requested_outputs?: string[];
638
643
  tool_inputs?: ToolInputOverrides;
639
644
  requested_model_id?: string;
640
645
  requested_model_node_id?: string;
@@ -659,6 +664,8 @@ type ControlPlaneAgentRunRequest = {
659
664
  messages?: Array<Record<string, unknown>>;
660
665
  thread_id?: string;
661
666
  runtime_context?: Record<string, unknown>;
667
+ requestedOutputs?: string[];
668
+ requested_outputs?: string[];
662
669
  tool_inputs?: ToolInputOverrides;
663
670
  requested_model_id?: string;
664
671
  requested_model_node_id?: string;
@@ -1593,6 +1600,7 @@ type ResourcePolicyQuotaScheduleResult = {
1593
1600
  };
1594
1601
  /** Authorized result of one embedded workflow; no model or checkpoint internals. */
1595
1602
  type EmbeddedRunSnapshot = {
1603
+ workflow_outputs?: _agents24_client.WorkflowOutputsPage;
1596
1604
  run_id: string;
1597
1605
  thread_id: string | null;
1598
1606
  status: "queued" | "pending" | "running" | "waiting" | "interrupted" | "cancelling" | "completed" | "failed" | "cancelled" | "paused";
@@ -1739,6 +1747,7 @@ declare class AgentsNamespace {
1739
1747
  mode: "queue" | "steer";
1740
1748
  input: string;
1741
1749
  attachmentIds?: string[];
1750
+ requestedOutputs?: string[];
1742
1751
  requestedAgentId?: string;
1743
1752
  requestedModelId?: string;
1744
1753
  relayClientId?: string | null;
@@ -1883,6 +1892,11 @@ declare class EmbedNamespace extends EmbedNamespace$1 {
1883
1892
  download?: boolean;
1884
1893
  }): Promise<ThreadComputerContentAccess>;
1885
1894
  deleteAgentThread(agentId: string, threadId: string, options: ThreadDeleteOptions, requestOptions?: RequestOptions): Promise<ThreadDeleteResult>;
1895
+ listAgentRunOutputs(agentId: string, runId: string, scope: RunContextOptions & {
1896
+ after?: number;
1897
+ limit?: number;
1898
+ }): Promise<_agents24_client.WorkflowOutputsPage>;
1899
+ getAgentRunOutput(agentId: string, runId: string, outputId: string, scope: RunContextOptions): Promise<_agents24_client.WorkflowOutputResult>;
1886
1900
  getAgentRun(agentId: string, runId: string, scope: RunContextOptions, options?: {
1887
1901
  signal?: AbortSignal;
1888
1902
  }): Promise<EmbeddedRunSnapshot>;
@@ -1941,6 +1955,17 @@ declare class ResourceInstallationsNamespace {
1941
1955
 
1942
1956
  declare class RunsNamespace {
1943
1957
  private readonly http;
1958
+ readonly outputs: {
1959
+ list: (input: {
1960
+ runId: string;
1961
+ after?: number;
1962
+ limit?: number;
1963
+ }) => Promise<_agents24_client.WorkflowOutputsPage>;
1964
+ get: (input: {
1965
+ runId: string;
1966
+ outputId: string;
1967
+ }) => Promise<_agents24_client.WorkflowOutputResult>;
1968
+ };
1944
1969
  constructor(http: Agents24HttpClient);
1945
1970
  get(runId: string, options?: {
1946
1971
  includeTree?: boolean;
@@ -23,6 +23,8 @@ type EmbedStreamRequest = {
23
23
  thread_id?: string;
24
24
  knowledge_namespaces?: Record<string, string>;
25
25
  knowledgeNamespaces?: Record<string, string>;
26
+ requestedOutputs?: string[];
27
+ requested_outputs?: string[];
26
28
  tool_inputs?: ToolInputOverrides;
27
29
  requested_model_id?: string;
28
30
  requested_model_node_id?: string;
@@ -159,6 +161,7 @@ type EmbedThreadMessageSubmit = {
159
161
  input: string;
160
162
  attachmentIds?: string[];
161
163
  requestedModelId?: string;
164
+ requestedOutputs?: readonly string[];
162
165
  toolInputs?: ToolInputOverrides;
163
166
  metadata?: Record<string, unknown>;
164
167
  };
@@ -635,6 +638,8 @@ type AgentStreamRequest = {
635
638
  attachment_ids?: string[];
636
639
  thread_id?: string;
637
640
  runtime_context?: Record<string, unknown>;
641
+ requestedOutputs?: string[];
642
+ requested_outputs?: string[];
638
643
  tool_inputs?: ToolInputOverrides;
639
644
  requested_model_id?: string;
640
645
  requested_model_node_id?: string;
@@ -659,6 +664,8 @@ type ControlPlaneAgentRunRequest = {
659
664
  messages?: Array<Record<string, unknown>>;
660
665
  thread_id?: string;
661
666
  runtime_context?: Record<string, unknown>;
667
+ requestedOutputs?: string[];
668
+ requested_outputs?: string[];
662
669
  tool_inputs?: ToolInputOverrides;
663
670
  requested_model_id?: string;
664
671
  requested_model_node_id?: string;
@@ -1593,6 +1600,7 @@ type ResourcePolicyQuotaScheduleResult = {
1593
1600
  };
1594
1601
  /** Authorized result of one embedded workflow; no model or checkpoint internals. */
1595
1602
  type EmbeddedRunSnapshot = {
1603
+ workflow_outputs?: _agents24_client.WorkflowOutputsPage;
1596
1604
  run_id: string;
1597
1605
  thread_id: string | null;
1598
1606
  status: "queued" | "pending" | "running" | "waiting" | "interrupted" | "cancelling" | "completed" | "failed" | "cancelled" | "paused";
@@ -1739,6 +1747,7 @@ declare class AgentsNamespace {
1739
1747
  mode: "queue" | "steer";
1740
1748
  input: string;
1741
1749
  attachmentIds?: string[];
1750
+ requestedOutputs?: string[];
1742
1751
  requestedAgentId?: string;
1743
1752
  requestedModelId?: string;
1744
1753
  relayClientId?: string | null;
@@ -1883,6 +1892,11 @@ declare class EmbedNamespace extends EmbedNamespace$1 {
1883
1892
  download?: boolean;
1884
1893
  }): Promise<ThreadComputerContentAccess>;
1885
1894
  deleteAgentThread(agentId: string, threadId: string, options: ThreadDeleteOptions, requestOptions?: RequestOptions): Promise<ThreadDeleteResult>;
1895
+ listAgentRunOutputs(agentId: string, runId: string, scope: RunContextOptions & {
1896
+ after?: number;
1897
+ limit?: number;
1898
+ }): Promise<_agents24_client.WorkflowOutputsPage>;
1899
+ getAgentRunOutput(agentId: string, runId: string, outputId: string, scope: RunContextOptions): Promise<_agents24_client.WorkflowOutputResult>;
1886
1900
  getAgentRun(agentId: string, runId: string, scope: RunContextOptions, options?: {
1887
1901
  signal?: AbortSignal;
1888
1902
  }): Promise<EmbeddedRunSnapshot>;
@@ -1941,6 +1955,17 @@ declare class ResourceInstallationsNamespace {
1941
1955
 
1942
1956
  declare class RunsNamespace {
1943
1957
  private readonly http;
1958
+ readonly outputs: {
1959
+ list: (input: {
1960
+ runId: string;
1961
+ after?: number;
1962
+ limit?: number;
1963
+ }) => Promise<_agents24_client.WorkflowOutputsPage>;
1964
+ get: (input: {
1965
+ runId: string;
1966
+ outputId: string;
1967
+ }) => Promise<_agents24_client.WorkflowOutputResult>;
1968
+ };
1944
1969
  constructor(http: Agents24HttpClient);
1945
1970
  get(runId: string, options?: {
1946
1971
  includeTree?: boolean;
package/dist/index.cjs CHANGED
@@ -219,8 +219,8 @@ async function consumeThreadSummaryEventStream(response, onEvent, signal, onCont
219
219
 
220
220
  // src/agents.ts
221
221
  function runBody(payload) {
222
- const { customerTenant, ...wire } = payload;
223
- return { ...wire, ...customerTenant === void 0 ? {} : { customer_tenant: customerTenant } };
222
+ const { customerTenant, requestedOutputs, ...wire } = payload;
223
+ return { ...wire, ...requestedOutputs === void 0 ? {} : { requested_outputs: requestedOutputs }, ...customerTenant === void 0 ? {} : { customer_tenant: customerTenant } };
224
224
  }
225
225
  var AgentsNamespace = class {
226
226
  constructor(http) {
@@ -267,6 +267,7 @@ var AgentsNamespace = class {
267
267
  return this.http.requestJson(`/agents/${encodeURIComponent(agentId)}/threads/${encodeURIComponent(threadId)}/messages`, {
268
268
  method: "POST",
269
269
  body: {
270
+ ...payload.requestedOutputs === void 0 ? {} : { requested_outputs: payload.requestedOutputs },
270
271
  mode: payload.mode,
271
272
  input: payload.input,
272
273
  attachment_ids: payload.attachmentIds ?? [],
@@ -307,7 +308,7 @@ var AgentsNamespace = class {
307
308
  });
308
309
  }
309
310
  async stream(agentId, payload, onEvent, mode, options = {}) {
310
- const response = await this.http.fetchOrThrow(this.http.url(`/agents/${agentId}/stream`, { mode, stream_features: "assistant-completion-v1" }), {
311
+ const response = await this.http.fetchOrThrow(this.http.url(`/agents/${agentId}/stream`, { mode, stream_features: "assistant-completion-v1,workflow-outputs-v1" }), {
311
312
  method: "POST",
312
313
  headers: this.http.streamHeaders(),
313
314
  body: JSON.stringify(runBody(payload)),
@@ -673,7 +674,7 @@ var EmbedNamespace = class extends EmbedDelegationsNamespace {
673
674
  }
674
675
  async openConversationSubmission(threadId, request, options) {
675
676
  const response = await this.http.fetchOrThrow(
676
- this.http.url(`/public/embed/threads/${encodeURIComponent(threadId)}/messages/stream`, { stream_features: options?.streamFeatures ?? "assistant-completion-v1" }),
677
+ this.http.url(`/public/embed/threads/${encodeURIComponent(threadId)}/messages/stream`, { stream_features: options?.streamFeatures ?? "assistant-completion-v1,workflow-outputs-v1" }),
677
678
  { method: "POST", headers: this.http.streamHeaders(void 0, options, true), body: JSON.stringify(request), signal: options?.signal },
678
679
  "Failed to connect to the conversation endpoint."
679
680
  );
@@ -708,16 +709,17 @@ var EmbedNamespace2 = class extends EmbedNamespace {
708
709
  }
709
710
  namespacePayload(payload) {
710
711
  if (!payload || typeof payload !== "object") return payload;
711
- const { knowledgeNamespaces, chatScope, customerTenant, ...wire } = payload;
712
+ const { knowledgeNamespaces, chatScope, customerTenant, requestedOutputs, ...wire } = payload;
712
713
  return {
713
714
  ...wire,
715
+ ...requestedOutputs === void 0 ? {} : { requested_outputs: requestedOutputs },
714
716
  ...customerTenant === void 0 ? {} : { customer_tenant: customerTenant },
715
717
  ...knowledgeNamespaces === void 0 ? {} : { knowledge_namespaces: knowledgeNamespaces },
716
718
  ...chatScope === void 0 ? {} : { chat_scope: chatScope }
717
719
  };
718
720
  }
719
721
  async stream(path, payload, onEvent, options) {
720
- const response = await this.http.fetchOrThrow(this.http.url(path, { stream_features: options.streamFeatures ?? "assistant-completion-v1", lease_seconds: options.leaseSeconds }), {
722
+ const response = await this.http.fetchOrThrow(this.http.url(path, { stream_features: options.streamFeatures ?? "assistant-completion-v1,workflow-outputs-v1", lease_seconds: options.leaseSeconds }), {
721
723
  method: "POST",
722
724
  headers: this.http.streamHeaders(void 0, options, true),
723
725
  body: JSON.stringify(this.namespacePayload(payload)),
@@ -851,6 +853,7 @@ var EmbedNamespace2 = class extends EmbedNamespace {
851
853
  customer_tenant: payload.customerTenant,
852
854
  ...payload.trustedContext === void 0 ? {} : { trusted_context: payload.trustedContext },
853
855
  execution_limits: payload.executionLimits,
856
+ ...payload.requestedOutputs === void 0 ? {} : { requested_outputs: payload.requestedOutputs },
854
857
  tool_inputs: payload.toolInputs ?? {},
855
858
  ...payload.metadata === void 0 ? {} : { metadata: payload.metadata }
856
859
  },
@@ -1030,6 +1033,16 @@ var EmbedNamespace2 = class extends EmbedNamespace {
1030
1033
  chat_scope: options.chatScope
1031
1034
  }, options: requestOptions, mutation: true });
1032
1035
  }
1036
+ listAgentRunOutputs(agentId, runId, scope) {
1037
+ return this.http.requestJson(`/public/embed/agents/${encodeURIComponent(agentId)}/runs/${encodeURIComponent(runId)}/outputs`, {
1038
+ query: { ...this.threadMessageQuery(scope), after: scope.after, limit: scope.limit }
1039
+ });
1040
+ }
1041
+ getAgentRunOutput(agentId, runId, outputId, scope) {
1042
+ return this.http.requestJson(`/public/embed/agents/${encodeURIComponent(agentId)}/runs/${encodeURIComponent(runId)}/outputs/${encodeURIComponent(outputId)}`, {
1043
+ query: this.threadMessageQuery(scope)
1044
+ });
1045
+ }
1033
1046
  getAgentRun(agentId, runId, scope, options = {}) {
1034
1047
  return this.http.requestJson(`/public/embed/agents/${encodeURIComponent(agentId)}/runs/${encodeURIComponent(runId)}`, {
1035
1048
  query: this.threadMessageQuery(scope),
@@ -1351,8 +1364,18 @@ var ResourceInstallationsNamespace = class {
1351
1364
  var RunsNamespace = class {
1352
1365
  constructor(http) {
1353
1366
  this.http = http;
1367
+ this.outputs = {
1368
+ list: (input) => http.requestJson(
1369
+ `/agents/runs/${encodeURIComponent(input.runId)}/outputs`,
1370
+ { query: { after: input.after, limit: input.limit } }
1371
+ ),
1372
+ get: (input) => http.requestJson(
1373
+ `/agents/runs/${encodeURIComponent(input.runId)}/outputs/${encodeURIComponent(input.outputId)}`
1374
+ )
1375
+ };
1354
1376
  }
1355
1377
  http;
1378
+ outputs;
1356
1379
  get(runId, options = {}) {
1357
1380
  return this.http.requestJson(`/agents/runs/${runId}`, { query: { include_tree: options.includeTree } });
1358
1381
  }
@@ -2050,6 +2073,8 @@ var SDK_OPERATION_IDS = [
2050
2073
  "client.resource_policy",
2051
2074
  "client.runs.attach",
2052
2075
  "client.runs.cancel",
2076
+ "client.runs.outputs.get",
2077
+ "client.runs.outputs.list",
2053
2078
  "client.runs.set_feedback",
2054
2079
  "client.sessions.anonymous",
2055
2080
  "client.sessions.backendExchange",
@@ -2092,12 +2117,14 @@ var SDK_OPERATION_IDS = [
2092
2117
  "embed.get_agent_thread",
2093
2118
  "embed.get_conversation_computer",
2094
2119
  "embed.get_conversation_thread",
2120
+ "embed.get_output",
2095
2121
  "embed.get_resource_policy",
2096
2122
  "embed.get_runtime_bootstrap",
2097
2123
  "embed.list_agent_computer_files",
2098
2124
  "embed.list_agent_threads",
2099
2125
  "embed.list_agent_threads_multi",
2100
2126
  "embed.list_conversation_computer_files",
2127
+ "embed.list_outputs",
2101
2128
  "embed.open_conversation_submission",
2102
2129
  "embed.read_agent_computer_file",
2103
2130
  "embed.read_conversation_computer_file",
@@ -2207,8 +2234,10 @@ var SDK_OPERATION_IDS = [
2207
2234
  "runs.get",
2208
2235
  "runs.get_context",
2209
2236
  "runs.get_events",
2237
+ "runs.get_output",
2210
2238
  "runs.get_trace",
2211
- "runs.get_tree"
2239
+ "runs.get_tree",
2240
+ "runs.list_outputs"
2212
2241
  ];
2213
2242
 
2214
2243
  Object.defineProperty(exports, "CONTRACT_HASH", {