@agents24/node 0.5.32 → 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.
Files changed (41) hide show
  1. package/compatibility.json +8 -8
  2. package/dist/bff.cjs +123 -14
  3. package/dist/bff.cjs.map +1 -1
  4. package/dist/bff.d.cts +3 -1
  5. package/dist/bff.d.ts +3 -1
  6. package/dist/bff.js +123 -14
  7. package/dist/bff.js.map +1 -1
  8. package/dist/{client-BhE-CjMz.d.cts → client-CY0o68YO.d.cts} +26 -0
  9. package/dist/{client-BhE-CjMz.d.ts → client-CY0o68YO.d.ts} +26 -0
  10. package/dist/index.cjs +37 -7
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +4 -4
  13. package/dist/index.d.ts +4 -4
  14. package/dist/index.js +37 -7
  15. package/dist/index.js.map +1 -1
  16. package/dist/types/agents.d.ts +1 -0
  17. package/dist/types/agents.d.ts.map +1 -1
  18. package/dist/types/bff-agent-resolution.d.ts +2 -0
  19. package/dist/types/bff-agent-resolution.d.ts.map +1 -1
  20. package/dist/types/bff-conversation-submission.d.ts.map +1 -1
  21. package/dist/types/bff-history.d.ts +17 -0
  22. package/dist/types/bff-history.d.ts.map +1 -0
  23. package/dist/types/bff-multi-agent.d.ts +1 -0
  24. package/dist/types/bff-multi-agent.d.ts.map +1 -1
  25. package/dist/types/bff-request.d.ts +2 -0
  26. package/dist/types/bff-request.d.ts.map +1 -1
  27. package/dist/types/bff-single-agent.d.ts.map +1 -1
  28. package/dist/types/bff-sse.d.ts +3 -0
  29. package/dist/types/bff-sse.d.ts.map +1 -1
  30. package/dist/types/bff.d.ts.map +1 -1
  31. package/dist/types/embed-types.d.ts +4 -0
  32. package/dist/types/embed-types.d.ts.map +1 -1
  33. package/dist/types/embed.d.ts +5 -0
  34. package/dist/types/embed.d.ts.map +1 -1
  35. package/dist/types/generated/manifest.d.ts +1 -1
  36. package/dist/types/generated/manifest.d.ts.map +1 -1
  37. package/dist/types/runs.d.ts +11 -0
  38. package/dist/types/runs.d.ts.map +1 -1
  39. package/dist/types/types.d.ts +6 -0
  40. package/dist/types/types.d.ts.map +1 -1
  41. package/package.json +2 -2
@@ -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;
@@ -143,6 +145,7 @@ type EmbedThreadMessageScope = {
143
145
  chatScope?: string;
144
146
  };
145
147
  type EmbedThreadMessageSubmit = {
148
+ trustedContext?: Record<string, unknown>;
146
149
  customerTenant?: {
147
150
  issuer: string;
148
151
  subject: string;
@@ -158,6 +161,7 @@ type EmbedThreadMessageSubmit = {
158
161
  input: string;
159
162
  attachmentIds?: string[];
160
163
  requestedModelId?: string;
164
+ requestedOutputs?: readonly string[];
161
165
  toolInputs?: ToolInputOverrides;
162
166
  metadata?: Record<string, unknown>;
163
167
  };
@@ -634,6 +638,8 @@ type AgentStreamRequest = {
634
638
  attachment_ids?: string[];
635
639
  thread_id?: string;
636
640
  runtime_context?: Record<string, unknown>;
641
+ requestedOutputs?: string[];
642
+ requested_outputs?: string[];
637
643
  tool_inputs?: ToolInputOverrides;
638
644
  requested_model_id?: string;
639
645
  requested_model_node_id?: string;
@@ -658,6 +664,8 @@ type ControlPlaneAgentRunRequest = {
658
664
  messages?: Array<Record<string, unknown>>;
659
665
  thread_id?: string;
660
666
  runtime_context?: Record<string, unknown>;
667
+ requestedOutputs?: string[];
668
+ requested_outputs?: string[];
661
669
  tool_inputs?: ToolInputOverrides;
662
670
  requested_model_id?: string;
663
671
  requested_model_node_id?: string;
@@ -1592,6 +1600,7 @@ type ResourcePolicyQuotaScheduleResult = {
1592
1600
  };
1593
1601
  /** Authorized result of one embedded workflow; no model or checkpoint internals. */
1594
1602
  type EmbeddedRunSnapshot = {
1603
+ workflow_outputs?: _agents24_client.WorkflowOutputsPage;
1595
1604
  run_id: string;
1596
1605
  thread_id: string | null;
1597
1606
  status: "queued" | "pending" | "running" | "waiting" | "interrupted" | "cancelling" | "completed" | "failed" | "cancelled" | "paused";
@@ -1738,6 +1747,7 @@ declare class AgentsNamespace {
1738
1747
  mode: "queue" | "steer";
1739
1748
  input: string;
1740
1749
  attachmentIds?: string[];
1750
+ requestedOutputs?: string[];
1741
1751
  requestedAgentId?: string;
1742
1752
  requestedModelId?: string;
1743
1753
  relayClientId?: string | null;
@@ -1882,6 +1892,11 @@ declare class EmbedNamespace extends EmbedNamespace$1 {
1882
1892
  download?: boolean;
1883
1893
  }): Promise<ThreadComputerContentAccess>;
1884
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>;
1885
1900
  getAgentRun(agentId: string, runId: string, scope: RunContextOptions, options?: {
1886
1901
  signal?: AbortSignal;
1887
1902
  }): Promise<EmbeddedRunSnapshot>;
@@ -1940,6 +1955,17 @@ declare class ResourceInstallationsNamespace {
1940
1955
 
1941
1956
  declare class RunsNamespace {
1942
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
+ };
1943
1969
  constructor(http: Agents24HttpClient);
1944
1970
  get(runId: string, options?: {
1945
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;
@@ -143,6 +145,7 @@ type EmbedThreadMessageScope = {
143
145
  chatScope?: string;
144
146
  };
145
147
  type EmbedThreadMessageSubmit = {
148
+ trustedContext?: Record<string, unknown>;
146
149
  customerTenant?: {
147
150
  issuer: string;
148
151
  subject: string;
@@ -158,6 +161,7 @@ type EmbedThreadMessageSubmit = {
158
161
  input: string;
159
162
  attachmentIds?: string[];
160
163
  requestedModelId?: string;
164
+ requestedOutputs?: readonly string[];
161
165
  toolInputs?: ToolInputOverrides;
162
166
  metadata?: Record<string, unknown>;
163
167
  };
@@ -634,6 +638,8 @@ type AgentStreamRequest = {
634
638
  attachment_ids?: string[];
635
639
  thread_id?: string;
636
640
  runtime_context?: Record<string, unknown>;
641
+ requestedOutputs?: string[];
642
+ requested_outputs?: string[];
637
643
  tool_inputs?: ToolInputOverrides;
638
644
  requested_model_id?: string;
639
645
  requested_model_node_id?: string;
@@ -658,6 +664,8 @@ type ControlPlaneAgentRunRequest = {
658
664
  messages?: Array<Record<string, unknown>>;
659
665
  thread_id?: string;
660
666
  runtime_context?: Record<string, unknown>;
667
+ requestedOutputs?: string[];
668
+ requested_outputs?: string[];
661
669
  tool_inputs?: ToolInputOverrides;
662
670
  requested_model_id?: string;
663
671
  requested_model_node_id?: string;
@@ -1592,6 +1600,7 @@ type ResourcePolicyQuotaScheduleResult = {
1592
1600
  };
1593
1601
  /** Authorized result of one embedded workflow; no model or checkpoint internals. */
1594
1602
  type EmbeddedRunSnapshot = {
1603
+ workflow_outputs?: _agents24_client.WorkflowOutputsPage;
1595
1604
  run_id: string;
1596
1605
  thread_id: string | null;
1597
1606
  status: "queued" | "pending" | "running" | "waiting" | "interrupted" | "cancelling" | "completed" | "failed" | "cancelled" | "paused";
@@ -1738,6 +1747,7 @@ declare class AgentsNamespace {
1738
1747
  mode: "queue" | "steer";
1739
1748
  input: string;
1740
1749
  attachmentIds?: string[];
1750
+ requestedOutputs?: string[];
1741
1751
  requestedAgentId?: string;
1742
1752
  requestedModelId?: string;
1743
1753
  relayClientId?: string | null;
@@ -1882,6 +1892,11 @@ declare class EmbedNamespace extends EmbedNamespace$1 {
1882
1892
  download?: boolean;
1883
1893
  }): Promise<ThreadComputerContentAccess>;
1884
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>;
1885
1900
  getAgentRun(agentId: string, runId: string, scope: RunContextOptions, options?: {
1886
1901
  signal?: AbortSignal;
1887
1902
  }): Promise<EmbeddedRunSnapshot>;
@@ -1940,6 +1955,17 @@ declare class ResourceInstallationsNamespace {
1940
1955
 
1941
1956
  declare class RunsNamespace {
1942
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
+ };
1943
1969
  constructor(http: Agents24HttpClient);
1944
1970
  get(runId: string, options?: {
1945
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)),
@@ -849,7 +851,9 @@ var EmbedNamespace2 = class extends EmbedNamespace {
849
851
  requested_model_id: payload.requestedModelId,
850
852
  knowledge_namespaces: payload.knowledgeNamespaces,
851
853
  customer_tenant: payload.customerTenant,
854
+ ...payload.trustedContext === void 0 ? {} : { trusted_context: payload.trustedContext },
852
855
  execution_limits: payload.executionLimits,
856
+ ...payload.requestedOutputs === void 0 ? {} : { requested_outputs: payload.requestedOutputs },
853
857
  tool_inputs: payload.toolInputs ?? {},
854
858
  ...payload.metadata === void 0 ? {} : { metadata: payload.metadata }
855
859
  },
@@ -1029,6 +1033,16 @@ var EmbedNamespace2 = class extends EmbedNamespace {
1029
1033
  chat_scope: options.chatScope
1030
1034
  }, options: requestOptions, mutation: true });
1031
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
+ }
1032
1046
  getAgentRun(agentId, runId, scope, options = {}) {
1033
1047
  return this.http.requestJson(`/public/embed/agents/${encodeURIComponent(agentId)}/runs/${encodeURIComponent(runId)}`, {
1034
1048
  query: this.threadMessageQuery(scope),
@@ -1350,8 +1364,18 @@ var ResourceInstallationsNamespace = class {
1350
1364
  var RunsNamespace = class {
1351
1365
  constructor(http) {
1352
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
+ };
1353
1376
  }
1354
1377
  http;
1378
+ outputs;
1355
1379
  get(runId, options = {}) {
1356
1380
  return this.http.requestJson(`/agents/runs/${runId}`, { query: { include_tree: options.includeTree } });
1357
1381
  }
@@ -2049,6 +2073,8 @@ var SDK_OPERATION_IDS = [
2049
2073
  "client.resource_policy",
2050
2074
  "client.runs.attach",
2051
2075
  "client.runs.cancel",
2076
+ "client.runs.outputs.get",
2077
+ "client.runs.outputs.list",
2052
2078
  "client.runs.set_feedback",
2053
2079
  "client.sessions.anonymous",
2054
2080
  "client.sessions.backendExchange",
@@ -2091,12 +2117,14 @@ var SDK_OPERATION_IDS = [
2091
2117
  "embed.get_agent_thread",
2092
2118
  "embed.get_conversation_computer",
2093
2119
  "embed.get_conversation_thread",
2120
+ "embed.get_output",
2094
2121
  "embed.get_resource_policy",
2095
2122
  "embed.get_runtime_bootstrap",
2096
2123
  "embed.list_agent_computer_files",
2097
2124
  "embed.list_agent_threads",
2098
2125
  "embed.list_agent_threads_multi",
2099
2126
  "embed.list_conversation_computer_files",
2127
+ "embed.list_outputs",
2100
2128
  "embed.open_conversation_submission",
2101
2129
  "embed.read_agent_computer_file",
2102
2130
  "embed.read_conversation_computer_file",
@@ -2206,8 +2234,10 @@ var SDK_OPERATION_IDS = [
2206
2234
  "runs.get",
2207
2235
  "runs.get_context",
2208
2236
  "runs.get_events",
2237
+ "runs.get_output",
2209
2238
  "runs.get_trace",
2210
- "runs.get_tree"
2239
+ "runs.get_tree",
2240
+ "runs.list_outputs"
2211
2241
  ];
2212
2242
 
2213
2243
  Object.defineProperty(exports, "CONTRACT_HASH", {