@agents24/node 0.5.34 → 0.5.36

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 (43) hide show
  1. package/README.md +5 -1
  2. package/compatibility.json +6 -6
  3. package/dist/bff.cjs +65 -1
  4. package/dist/bff.cjs.map +1 -1
  5. package/dist/bff.d.cts +1 -1
  6. package/dist/bff.d.ts +1 -1
  7. package/dist/bff.js +65 -1
  8. package/dist/bff.js.map +1 -1
  9. package/dist/{client-CY0o68YO.d.cts → client-YSS2tctB.d.cts} +289 -3
  10. package/dist/{client-CY0o68YO.d.ts → client-YSS2tctB.d.ts} +289 -3
  11. package/dist/index.cjs +213 -7
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +3 -3
  14. package/dist/index.d.ts +3 -3
  15. package/dist/index.js +213 -7
  16. package/dist/index.js.map +1 -1
  17. package/dist/types/agents.d.ts +4 -0
  18. package/dist/types/agents.d.ts.map +1 -1
  19. package/dist/types/bff-conversation-submission.d.ts.map +1 -1
  20. package/dist/types/bff-multi-agent.d.ts.map +1 -1
  21. package/dist/types/bff-single-agent.d.ts.map +1 -1
  22. package/dist/types/embed-run-wait.d.ts +4 -1
  23. package/dist/types/embed-run-wait.d.ts.map +1 -1
  24. package/dist/types/embed-types.d.ts +8 -0
  25. package/dist/types/embed-types.d.ts.map +1 -1
  26. package/dist/types/embed.d.ts.map +1 -1
  27. package/dist/types/generated/dictation.d.ts +99 -0
  28. package/dist/types/generated/dictation.d.ts.map +1 -0
  29. package/dist/types/generated/embed.d.ts +15 -1
  30. package/dist/types/generated/embed.d.ts.map +1 -1
  31. package/dist/types/generated/ingestion-types.d.ts +2 -0
  32. package/dist/types/generated/ingestion-types.d.ts.map +1 -1
  33. package/dist/types/generated/manifest.d.ts +1 -1
  34. package/dist/types/generated/manifest.d.ts.map +1 -1
  35. package/dist/types/generated/model-capabilities.d.ts +2 -2
  36. package/dist/types/generated/model-capabilities.d.ts.map +1 -1
  37. package/dist/types/generated/personal-skills.d.ts +174 -0
  38. package/dist/types/generated/personal-skills.d.ts.map +1 -0
  39. package/dist/types/generated/run-usage.d.ts +2 -0
  40. package/dist/types/generated/run-usage.d.ts.map +1 -1
  41. package/dist/types/types.d.ts +39 -0
  42. package/dist/types/types.d.ts.map +1 -1
  43. package/package.json +2 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@agents24/node`
2
2
 
3
- Last Updated: 2026-10-21
3
+ Last Updated: 2026-11-08
4
4
 
5
5
  `@agents24/node/relay` exports `createArtifactRelay()` for one outbound app-profile connection serving multiple draft/published Artifacts. `relayClients` manages durable client identity, status, revocation, and short-lived tickets. Persist the client ID outside conversation state and pass `relay_client_id` at initial run admission. Local URLs and signing secrets stay in the application. See [the relay contract](https://github.com/agents24/talmudpedia/blob/main/docs/design-docs/shared_artifact_relay.md).
6
6
 
@@ -107,3 +107,7 @@ if (records.length) {
107
107
  ## Organization model routing
108
108
 
109
109
  `agents24.models` exposes the official model library and BYOK routes: `list`, `get`, `listOfferings`, `addProvider`, `selectProvider`, `updateProvider`, and `removeProvider`. BYOK creation requires an exact compatible offering and either an existing credential reference or an inline credential stored encrypted by the platform. Route selection is explicit and supports `expected_revision` for concurrent-update protection. Organization API keys have full organization permissions; they do not grant platform administration.
110
+
111
+ ## Interactive completion observation
112
+
113
+ Use `embed.waitForAgentRun(agentId, runId, scope, { observation: "stream", timeoutMs: 120000 })` to wake on durable run completion without polling backoff. It reads the authoritative final snapshot, preserves the full customer/integration/chat scope, and resumes its cursor after an observation lease ends. Timeout or abort stops observation without cancelling the run. The existing default `observation: "poll"` retains 250ms–2s backoff. `GraphDefinition.workflow_contract.exports` types selected node-output declarations.
@@ -1,5 +1,5 @@
1
1
  {
2
- "contractHash": "b9b9a3f464ed29f9df64462c3104802c5e9a4e7d3ed6f4ecfc078295e4458ed5",
2
+ "contractHash": "76d00faccd919f2bbb5f0bf7c51f21121f66a2a61b64f6cb9498f32917233cc7",
3
3
  "contractVersion": "0.3.0",
4
4
  "corpus": "conformance/v1/corpus.json",
5
5
  "generatedBy": "@agents24/sdk-contract",
@@ -19,7 +19,7 @@
19
19
  "runtime": "run-stream.v3"
20
20
  },
21
21
  "@agents24/node": {
22
- "contract": "b9b9a3f464ed29f9df64462c3104802c5e9a4e7d3ed6f4ecfc078295e4458ed5",
22
+ "contract": "76d00faccd919f2bbb5f0bf7c51f21121f66a2a61b64f6cb9498f32917233cc7",
23
23
  "node": "^22.0.0 || ^24.0.0"
24
24
  },
25
25
  "@agents24/react": {
@@ -31,7 +31,7 @@
31
31
  "protocolOwner": "@agents24/client"
32
32
  },
33
33
  "agents24": {
34
- "contract": "b9b9a3f464ed29f9df64462c3104802c5e9a4e7d3ed6f4ecfc078295e4458ed5",
34
+ "contract": "76d00faccd919f2bbb5f0bf7c51f21121f66a2a61b64f6cb9498f32917233cc7",
35
35
  "python": ">=3.10"
36
36
  }
37
37
  },
@@ -47,8 +47,8 @@
47
47
  },
48
48
  "schemaVersion": "agents24.compatibility.v1",
49
49
  "targetOperationCounts": {
50
- "client": 38,
51
- "node": 202,
52
- "python": 196
50
+ "client": 41,
51
+ "node": 222,
52
+ "python": 216
53
53
  }
54
54
  }
package/dist/bff.cjs CHANGED
@@ -298,6 +298,7 @@ async function submitConversationStream(input) {
298
298
  input: value.input,
299
299
  attachment_ids: value.attachmentIds,
300
300
  client_submission_id: value.clientSubmissionId,
301
+ ...stringValue(body.dictationSessionId) ? { dictation_session_id: stringValue(body.dictationSessionId) } : {},
301
302
  ...input.requestedAgentId ? { requested_agent_id: input.requestedAgentId } : {},
302
303
  ...value.requestedModelId ? { requested_model_id: value.requestedModelId } : {},
303
304
  ...resolution.chatScope === void 0 ? {} : { chat_scope: resolution.chatScope },
@@ -714,6 +715,40 @@ function createAgents24BffHandlerWithResolver(options, resolveCustomerIdentity)
714
715
  if (request.method === "GET" && path === "/bootstrap") {
715
716
  const raw = await embed.getRuntimeBootstrap(agentId, agentVersionId, runtimeTarget);
716
717
  response = json(bootstrapDocument(raw, agentVersionId));
718
+ } else if (request.method === "POST" && path === "/dictation-sessions") {
719
+ if (!idempotencyKey) throw new BffInputError(400, "IDEMPOTENCY_REQUIRED", "A dictation operation ID is required.");
720
+ response = json(await embed.createDictationSession(agentId, {
721
+ external_user_id: customerPrincipalRef,
722
+ integration_id: integrationId,
723
+ ...principal.externalSessionId ? { external_session_id: principal.externalSessionId } : {},
724
+ ...resolution.chatScope === void 0 ? {} : { chat_scope: resolution.chatScope },
725
+ ...agentVersionId ? { agent_version_id: agentVersionId } : {},
726
+ runtime_target: runtimeTarget,
727
+ origin: new URL(request.url).origin
728
+ }, { idempotencyKey, signal: request.signal }));
729
+ } else if (path.startsWith("/dictation-sessions/")) {
730
+ const match = /^\/dictation-sessions\/([^/]+)(\/cancel)?$/.exec(path);
731
+ if (!match) throw new BffInputError(404, "NOT_FOUND", "Dictation session is unavailable.");
732
+ const sessionId = decodeURIComponent(match[1]);
733
+ const scope = {
734
+ external_user_id: customerPrincipalRef,
735
+ integration_id: integrationId,
736
+ ...principal.externalSessionId ? { external_session_id: principal.externalSessionId } : {},
737
+ ...resolution.chatScope === void 0 ? {} : { chat_scope: resolution.chatScope },
738
+ ...agentVersionId ? { agent_version_id: agentVersionId } : {},
739
+ runtime_target: runtimeTarget
740
+ };
741
+ if (request.method === "POST" && match[2]) response = json(await embed.cancelDictationSession(agentId, sessionId, scope, { signal: request.signal }));
742
+ else if (request.method === "GET" && !match[2]) response = json(await embed.getDictationSession(agentId, sessionId, {
743
+ externalUserId: customerPrincipalRef,
744
+ integrationId,
745
+ externalSessionId: principal.externalSessionId,
746
+ chatScope: resolution.chatScope,
747
+ runtimeTarget,
748
+ agentVersionId,
749
+ signal: request.signal
750
+ }));
751
+ else throw new BffInputError(405, "METHOD_NOT_ALLOWED", "The operation is unavailable.");
717
752
  } else if (request.method === "GET" && path === "/resource-policy") {
718
753
  response = json(await embed.getResourcePolicy(agentId, {
719
754
  external_user_id: customerPrincipalRef,
@@ -750,6 +785,7 @@ function createAgents24BffHandlerWithResolver(options, resolveCustomerIdentity)
750
785
  ...resolution.trustedContext === void 0 ? {} : { trustedContext: resolution.trustedContext },
751
786
  ...stringValue(body.requestedModelId) ? { requestedModelId: stringValue(body.requestedModelId) } : {},
752
787
  ...resolution.knowledgeNamespaces === void 0 ? {} : { knowledgeNamespaces: resolution.knowledgeNamespaces },
788
+ ...stringValue(body.dictationSessionId) ? { dictationSessionId: stringValue(body.dictationSessionId) } : {},
753
789
  ...body.requestedOutputs === void 0 ? {} : { requestedOutputs: requestedOutputNames(body.requestedOutputs) },
754
790
  toolInputs: objectValue(body.toolInputs),
755
791
  ...body.metadata === void 0 ? {} : { metadata: objectValue(body.metadata) }
@@ -767,6 +803,7 @@ function createAgents24BffHandlerWithResolver(options, resolveCustomerIdentity)
767
803
  attachment_ids: attachmentIds,
768
804
  ...stringValue(body.requestedModelId) ? { requested_model_id: stringValue(body.requestedModelId) } : {},
769
805
  ...resolution.knowledgeNamespaces === void 0 ? {} : { knowledge_namespaces: resolution.knowledgeNamespaces },
806
+ ...stringValue(body.dictationSessionId) ? { dictation_session_id: stringValue(body.dictationSessionId) } : {},
770
807
  ...body.requestedOutputs === void 0 ? {} : { requested_outputs: requestedOutputNames(body.requestedOutputs) },
771
808
  tool_inputs: objectValue(body.toolInputs),
772
809
  ...body.metadata === void 0 ? {} : { metadata: objectValue(body.metadata) },
@@ -816,6 +853,7 @@ function createAgents24BffHandlerWithResolver(options, resolveCustomerIdentity)
816
853
  onControl: control,
817
854
  leaseSeconds: 60,
818
855
  streamFeatures: url.searchParams.get("stream_features") || "",
856
+ onPreview: (frame) => write(frame),
819
857
  ...url.searchParams.get("thread_id") ? { threadId: url.searchParams.get("thread_id") } : {}
820
858
  });
821
859
  }, void 0, void 0, streamFailure(request, "run.attach"), request.signal);
@@ -902,7 +940,15 @@ function createAgents24BffHandlerWithResolver(options, resolveCustomerIdentity)
902
940
  response = json(await embed.submitAgentThreadMessage(
903
941
  agentId,
904
942
  threadId,
905
- { ...threadIdentity, integrationId, ...messageBody(body), ...resolution.trustedContext === void 0 ? {} : { trustedContext: resolution.trustedContext }, ...resolution.customerTenant === void 0 ? {} : { customerTenant: resolution.customerTenant }, ...resolution.knowledgeNamespaces === void 0 ? {} : { knowledgeNamespaces: resolution.knowledgeNamespaces }, agentVersionId: agentVersionId ?? null },
943
+ {
944
+ ...threadIdentity,
945
+ integrationId,
946
+ ...messageBody(body),
947
+ ...resolution.trustedContext === void 0 ? {} : { trustedContext: resolution.trustedContext },
948
+ ...resolution.customerTenant === void 0 ? {} : { customerTenant: resolution.customerTenant },
949
+ ...resolution.knowledgeNamespaces === void 0 ? {} : { knowledgeNamespaces: resolution.knowledgeNamespaces },
950
+ agentVersionId: agentVersionId ?? null
951
+ },
906
952
  { idempotencyKey }
907
953
  ));
908
954
  } else if (/^\/threads\/[^/]+\/messages\/[^/]+$/.test(path) && request.method === "PATCH") {
@@ -1005,6 +1051,17 @@ function createAgents24BffHandlerWithResolver(options, resolveCustomerIdentity)
1005
1051
  response = json(await embed.uploadAgentAttachments(agentId, {
1006
1052
  ...threadIdentity,
1007
1053
  files,
1054
+ ...form.has("transcript_presentations") ? { transcriptPresentations: (() => {
1055
+ const value = stringValue(form.get("transcript_presentations"));
1056
+ let parsed;
1057
+ try {
1058
+ parsed = JSON.parse(value || "null");
1059
+ } catch {
1060
+ throw new BffInputError(400, "INVALID_REQUEST", "Invalid transcript presentation.");
1061
+ }
1062
+ if (!Array.isArray(parsed) || parsed.length !== files.length || parsed.some((item) => item !== "attachment" && item !== "dictation")) throw new BffInputError(400, "INVALID_REQUEST", "Invalid transcript presentation.");
1063
+ return parsed;
1064
+ })() } : {},
1008
1065
  ...stringValue(form.get("thread_id")) ? { threadId: stringValue(form.get("thread_id")) } : {},
1009
1066
  integrationId,
1010
1067
  ...resolution.chatScope === void 0 ? {} : { chatScope: resolution.chatScope },
@@ -1199,6 +1256,12 @@ function createResolvedAgents24BffHandler(options, sharedIdentity) {
1199
1256
  const runId = routeId(path, /^\/runs\/([^/]+)\/outputs/, "runId");
1200
1257
  return dispatchToAgent(await resolveRunAgent(runId));
1201
1258
  }
1259
+ if (path === "/dictation-sessions" || /^\/dictation-sessions\/[^/]+(?:\/cancel)?$/.test(path)) {
1260
+ const message = request.method === "POST" ? await requestJson(request) : void 0;
1261
+ const selected = await requestedAgent(message?.requestedAgentId || url.searchParams.get("requestedAgentId"));
1262
+ assertWritableAgent(selected.agentId, historical);
1263
+ return dispatchToAgent(selected.agentId, message);
1264
+ }
1202
1265
  if (request.method === "POST" && path === "/chat/stream") {
1203
1266
  const body = await requestJson(request);
1204
1267
  const threadId = stringValue(body.threadId);
@@ -1233,6 +1296,7 @@ function createResolvedAgents24BffHandler(options, sharedIdentity) {
1233
1296
  client_submission_id: stringValue(body.clientSubmissionId),
1234
1297
  ...body.relayClientId === null ? { relay_client_id: null } : stringValue(body.relayClientId) ? { relay_client_id: stringValue(body.relayClientId) } : {},
1235
1298
  attachment_ids: attachmentIds,
1299
+ ...stringValue(body.dictationSessionId) ? { dictation_session_id: stringValue(body.dictationSessionId) } : {},
1236
1300
  ...body.requestedOutputs === void 0 ? {} : { requested_outputs: requestedOutputNames(body.requestedOutputs) },
1237
1301
  ...stringValue(body.requestedModelId) ? { requested_model_id: stringValue(body.requestedModelId) } : {},
1238
1302
  ...resolution.knowledgeNamespaces === void 0 ? {} : { knowledge_namespaces: resolution.knowledgeNamespaces },