@agents24/node 0.5.30 → 0.5.32
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.
- package/compatibility.json +5 -5
- package/dist/artifacts.cjs +12 -0
- package/dist/artifacts.cjs.map +1 -1
- package/dist/artifacts.d.cts +13 -1
- package/dist/artifacts.d.ts +13 -1
- package/dist/artifacts.js +12 -1
- package/dist/artifacts.js.map +1 -1
- package/dist/bff.cjs +188 -130
- package/dist/bff.cjs.map +1 -1
- package/dist/bff.d.cts +16 -6
- package/dist/bff.d.ts +16 -6
- package/dist/bff.js +188 -131
- package/dist/bff.js.map +1 -1
- package/dist/{client-BIn7miCx.d.cts → client-BhE-CjMz.d.cts} +119 -15
- package/dist/{client-BIn7miCx.d.ts → client-BhE-CjMz.d.ts} +119 -15
- package/dist/index.cjs +55 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +56 -9
- package/dist/index.js.map +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.js.map +1 -1
- package/dist/types/agents.d.ts.map +1 -1
- package/dist/types/artifacts.d.ts +12 -0
- package/dist/types/artifacts.d.ts.map +1 -1
- package/dist/types/bff-agent-resolution.d.ts +19 -0
- package/dist/types/bff-agent-resolution.d.ts.map +1 -1
- package/dist/types/bff-bootstrap.d.ts +17 -0
- package/dist/types/bff-bootstrap.d.ts.map +1 -0
- package/dist/types/bff-conversation-submission.d.ts +16 -0
- package/dist/types/bff-conversation-submission.d.ts.map +1 -0
- package/dist/types/bff-errors.d.ts +1 -1
- package/dist/types/bff-errors.d.ts.map +1 -1
- package/dist/types/bff-multi-agent.d.ts +11 -0
- package/dist/types/bff-multi-agent.d.ts.map +1 -0
- package/dist/types/bff-request.d.ts +3 -1
- package/dist/types/bff-request.d.ts.map +1 -1
- package/dist/types/bff-resolver.d.ts +9 -0
- package/dist/types/bff-resolver.d.ts.map +1 -0
- package/dist/types/bff-single-agent.d.ts +5 -0
- package/dist/types/bff-single-agent.d.ts.map +1 -0
- package/dist/types/bff.d.ts +2 -4
- package/dist/types/bff.d.ts.map +1 -1
- package/dist/types/embed-types.d.ts +13 -0
- package/dist/types/embed-types.d.ts.map +1 -1
- package/dist/types/embed.d.ts +2 -2
- package/dist/types/embed.d.ts.map +1 -1
- package/dist/types/generated/embed.d.ts +8 -0
- package/dist/types/generated/embed.d.ts.map +1 -0
- package/dist/types/generated/ingestion-types.d.ts +20 -0
- package/dist/types/generated/ingestion-types.d.ts.map +1 -1
- package/dist/types/generated/manifest.d.ts +1 -1
- package/dist/types/generated/manifest.d.ts.map +1 -1
- package/dist/types/streams.d.ts +1 -1
- package/dist/types/streams.d.ts.map +1 -1
- package/dist/types/types.d.ts +64 -1
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -195,8 +195,18 @@ async function consumePayloads(response, onPayload, signal, onControl) {
|
|
|
195
195
|
reader.releaseLock();
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
async function consumeRuntimeEventStream(response, onEvent, signal, onControl) {
|
|
198
|
+
async function consumeRuntimeEventStream(response, onEvent, signal, onControl, onPreview) {
|
|
199
199
|
await consumePayloads(response, async (payload) => {
|
|
200
|
+
if (payload.includes('"assistant-preview.v1"')) {
|
|
201
|
+
const value = protocol.parseProtocolJson(payload);
|
|
202
|
+
if (value?.version === "assistant-preview.v1") {
|
|
203
|
+
const preview = protocol.parseAssistantPreview(value);
|
|
204
|
+
if (preview) {
|
|
205
|
+
await onPreview?.(preview);
|
|
206
|
+
}
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
200
210
|
const event = protocol.parseRuntimeSsePayload(payload);
|
|
201
211
|
if (onEvent) await onEvent(event);
|
|
202
212
|
}, signal, onControl);
|
|
@@ -208,6 +218,10 @@ async function consumeThreadSummaryEventStream(response, onEvent, signal, onCont
|
|
|
208
218
|
}
|
|
209
219
|
|
|
210
220
|
// src/agents.ts
|
|
221
|
+
function runBody(payload) {
|
|
222
|
+
const { customerTenant, ...wire } = payload;
|
|
223
|
+
return { ...wire, ...customerTenant === void 0 ? {} : { customer_tenant: customerTenant } };
|
|
224
|
+
}
|
|
211
225
|
var AgentsNamespace = class {
|
|
212
226
|
constructor(http) {
|
|
213
227
|
this.http = http;
|
|
@@ -244,7 +258,7 @@ var AgentsNamespace = class {
|
|
|
244
258
|
return this.http.requestJson(`/agents/${agentId}/publish`, { method: "POST", body: {}, options, mutation: true });
|
|
245
259
|
}
|
|
246
260
|
startRun(agentId, payload, options) {
|
|
247
|
-
return this.http.requestJson(`/agents/${agentId}/run`, { method: "POST", body: payload, options, mutation: true });
|
|
261
|
+
return this.http.requestJson(`/agents/${agentId}/run`, { method: "POST", body: runBody(payload), options, mutation: true });
|
|
248
262
|
}
|
|
249
263
|
listThreadMessages(agentId, threadId, query) {
|
|
250
264
|
return this.http.requestJson(`/agents/${encodeURIComponent(agentId)}/threads/${encodeURIComponent(threadId)}/messages`, { query });
|
|
@@ -296,7 +310,7 @@ var AgentsNamespace = class {
|
|
|
296
310
|
const response = await this.http.fetchOrThrow(this.http.url(`/agents/${agentId}/stream`, { mode, stream_features: "assistant-completion-v1" }), {
|
|
297
311
|
method: "POST",
|
|
298
312
|
headers: this.http.streamHeaders(),
|
|
299
|
-
body: JSON.stringify(payload),
|
|
313
|
+
body: JSON.stringify(runBody(payload)),
|
|
300
314
|
signal: options.signal
|
|
301
315
|
}, "Failed to connect to the agent stream endpoint.");
|
|
302
316
|
await assertOk(response);
|
|
@@ -646,7 +660,34 @@ var EmbedDelegationsNamespace = class {
|
|
|
646
660
|
});
|
|
647
661
|
}
|
|
648
662
|
};
|
|
663
|
+
|
|
664
|
+
// src/generated/embed.ts
|
|
649
665
|
var EmbedNamespace = class extends EmbedDelegationsNamespace {
|
|
666
|
+
completeToolInvocation(invocationId, request, options) {
|
|
667
|
+
return this.http.requestJson(`/public/embed/tool-invocations/${encodeURIComponent(invocationId)}/completion`, {
|
|
668
|
+
method: "POST",
|
|
669
|
+
body: request,
|
|
670
|
+
options,
|
|
671
|
+
mutation: true
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
async openConversationSubmission(threadId, request, options) {
|
|
675
|
+
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
|
+
{ method: "POST", headers: this.http.streamHeaders(void 0, options, true), body: JSON.stringify(request), signal: options?.signal },
|
|
678
|
+
"Failed to connect to the conversation endpoint."
|
|
679
|
+
);
|
|
680
|
+
await assertOk(response);
|
|
681
|
+
return response;
|
|
682
|
+
}
|
|
683
|
+
bootstrapRuntime(request) {
|
|
684
|
+
return this.http.requestJson("/public/embed/runtime/bootstrap", {
|
|
685
|
+
method: "POST",
|
|
686
|
+
body: request
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
var EmbedNamespace2 = class extends EmbedNamespace {
|
|
650
691
|
constructor(http) {
|
|
651
692
|
super(http);
|
|
652
693
|
}
|
|
@@ -656,6 +697,7 @@ var EmbedNamespace = class extends EmbedDelegationsNamespace {
|
|
|
656
697
|
startAgentRun(agentId, payload, options) {
|
|
657
698
|
return this.http.requestJson(`/public/embed/agents/${agentId}/runs`, {
|
|
658
699
|
method: "POST",
|
|
700
|
+
query: { stream_features: options?.streamFeatures },
|
|
659
701
|
body: this.namespacePayload(payload),
|
|
660
702
|
options,
|
|
661
703
|
mutation: true
|
|
@@ -666,15 +708,16 @@ var EmbedNamespace = class extends EmbedDelegationsNamespace {
|
|
|
666
708
|
}
|
|
667
709
|
namespacePayload(payload) {
|
|
668
710
|
if (!payload || typeof payload !== "object") return payload;
|
|
669
|
-
const { knowledgeNamespaces, chatScope, ...wire } = payload;
|
|
711
|
+
const { knowledgeNamespaces, chatScope, customerTenant, ...wire } = payload;
|
|
670
712
|
return {
|
|
671
713
|
...wire,
|
|
714
|
+
...customerTenant === void 0 ? {} : { customer_tenant: customerTenant },
|
|
672
715
|
...knowledgeNamespaces === void 0 ? {} : { knowledge_namespaces: knowledgeNamespaces },
|
|
673
716
|
...chatScope === void 0 ? {} : { chat_scope: chatScope }
|
|
674
717
|
};
|
|
675
718
|
}
|
|
676
719
|
async stream(path, payload, onEvent, options) {
|
|
677
|
-
const response = await this.http.fetchOrThrow(this.http.url(path, { stream_features: "assistant-completion-v1", lease_seconds: options.leaseSeconds }), {
|
|
720
|
+
const response = await this.http.fetchOrThrow(this.http.url(path, { stream_features: options.streamFeatures ?? "assistant-completion-v1", lease_seconds: options.leaseSeconds }), {
|
|
678
721
|
method: "POST",
|
|
679
722
|
headers: this.http.streamHeaders(void 0, options, true),
|
|
680
723
|
body: JSON.stringify(this.namespacePayload(payload)),
|
|
@@ -698,7 +741,7 @@ var EmbedNamespace = class extends EmbedDelegationsNamespace {
|
|
|
698
741
|
await consumeRuntimeEventStream(response, async (event) => {
|
|
699
742
|
runId ||= event.run_id;
|
|
700
743
|
if (onEvent) await onEvent(event);
|
|
701
|
-
}, options.signal);
|
|
744
|
+
}, options.signal, options.onControl, options.onPreview);
|
|
702
745
|
return { threadId: response.headers.get("X-Thread-ID"), runId };
|
|
703
746
|
}
|
|
704
747
|
resumeAgentRun(agentId, runId, payload, options) {
|
|
@@ -805,6 +848,7 @@ var EmbedNamespace = class extends EmbedDelegationsNamespace {
|
|
|
805
848
|
attachment_ids: payload.attachmentIds ?? [],
|
|
806
849
|
requested_model_id: payload.requestedModelId,
|
|
807
850
|
knowledge_namespaces: payload.knowledgeNamespaces,
|
|
851
|
+
customer_tenant: payload.customerTenant,
|
|
808
852
|
execution_limits: payload.executionLimits,
|
|
809
853
|
tool_inputs: payload.toolInputs ?? {},
|
|
810
854
|
...payload.metadata === void 0 ? {} : { metadata: payload.metadata }
|
|
@@ -1590,7 +1634,7 @@ var IngestionJobsNamespace = class {
|
|
|
1590
1634
|
start(request, options) {
|
|
1591
1635
|
return this.http.requestJson("/admin/pipelines/jobs", {
|
|
1592
1636
|
method: "POST",
|
|
1593
|
-
body: (({ knowledgeNamespaces, ...wire }) => ({ ...wire, ...knowledgeNamespaces === void 0 ? {} : { knowledge_namespaces: knowledgeNamespaces } }))(request),
|
|
1637
|
+
body: (({ knowledgeNamespaces, customerTenant, ...wire }) => ({ ...wire, ...knowledgeNamespaces === void 0 ? {} : { knowledge_namespaces: knowledgeNamespaces }, ...customerTenant === void 0 ? {} : { customer_tenant: customerTenant } }))(request),
|
|
1594
1638
|
options,
|
|
1595
1639
|
mutation: true
|
|
1596
1640
|
});
|
|
@@ -1945,7 +1989,7 @@ var Agents24 = class extends GeneratedIntegrationNamespaces {
|
|
|
1945
1989
|
super(http);
|
|
1946
1990
|
this.agents = new AgentsNamespace(http);
|
|
1947
1991
|
this.relayClients = new RelayClientsNamespace(http);
|
|
1948
|
-
this.embed = new
|
|
1992
|
+
this.embed = new EmbedNamespace2(http);
|
|
1949
1993
|
this.runs = new RunsNamespace(http);
|
|
1950
1994
|
this.delegations = new DelegationsNamespace(http);
|
|
1951
1995
|
this.resourcePackages = new ResourcePackagesNamespace(http);
|
|
@@ -2033,7 +2077,9 @@ var SDK_OPERATION_IDS = [
|
|
|
2033
2077
|
"delegations.inspect",
|
|
2034
2078
|
"delegations.list",
|
|
2035
2079
|
"embed.attach_agent_run",
|
|
2080
|
+
"embed.bootstrap_runtime",
|
|
2036
2081
|
"embed.cancel_agent_run",
|
|
2082
|
+
"embed.complete_tool_invocation",
|
|
2037
2083
|
"embed.create_agent_computer_content_access",
|
|
2038
2084
|
"embed.create_attachment_content_access",
|
|
2039
2085
|
"embed.create_conversation_computer_content_access",
|
|
@@ -2051,6 +2097,7 @@ var SDK_OPERATION_IDS = [
|
|
|
2051
2097
|
"embed.list_agent_threads",
|
|
2052
2098
|
"embed.list_agent_threads_multi",
|
|
2053
2099
|
"embed.list_conversation_computer_files",
|
|
2100
|
+
"embed.open_conversation_submission",
|
|
2054
2101
|
"embed.read_agent_computer_file",
|
|
2055
2102
|
"embed.read_conversation_computer_file",
|
|
2056
2103
|
"embed.resolve_agent_alias",
|