@spine-event-engine/ai-vercel-ax 2.0.0-snapshot.24 → 2.0.0-snapshot.26

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/REFERENCE.md CHANGED
@@ -18,7 +18,7 @@ stateless input, and `reasoning.encrypted_content`. Local functions use a
18
18
  `maxOutputTokens` ceiling or native-schema mode fails with
19
19
  `UNSUPPORTED_CAPABILITY` before an inference attempt. The existing API-key
20
20
  OpenAI and Anthropic profiles continue to support explicit token ceilings.
21
- The profile retains ordered typed response items for continuation and replay;
21
+ The profile retains ordered typed response items for continuation within the running invocation;
22
22
  only `response.completed` admits output. Provider failure, incomplete output,
23
23
  refusal, and missing terminal responses remain recorded failures.
24
24
 
@@ -52,7 +52,7 @@ Pass a cancellation signal to `complete()` when the application may close while
52
52
  sign-in is finishing. Cancellation also invalidates a grant whose credential save
53
53
  finishes late. The application must still close its browser callback listener.
54
54
 
55
- The generation path uses Ax to render requests, correct invalid output subject to any configured model-request ceiling, and continue after recorded tool proposals. Direct Vercel provider streams carry native descriptor-derived JSON schemas or prompt-and-validate instructions. The adapter preserves raw output, ordered provider tool proposals, actual model identity when reported, token usage with absent counts distinct from zero, and safe failure categories. For Anthropic Messages, the response journal also records ordered text, signed thinking, redacted thinking, and tool blocks. The adapter rebuilds the exact assistant block order from that journal for tool and correction requests, including after replay; incomplete thinking never authorizes a continuation. It journals each physical attempt before tool authorization or a second model request. A runtime denial ends with `TOOL_FAILED`; an unresolved tool write ends with `TOOL_OUTCOME_UNKNOWN`. Neither becomes a fabricated tool result.
55
+ The generation path uses Ax to render requests, correct invalid output subject to any configured model-request ceiling, and continue after recorded tool proposals. Direct Vercel provider streams carry native descriptor-derived JSON schemas or prompt-and-validate instructions. The adapter preserves raw output, ordered provider tool proposals, actual model identity when reported, token usage with absent counts distinct from zero, and safe failure categories. For Anthropic Messages, the live response sequence also records ordered text, signed thinking, redacted thinking, and tool blocks. The adapter rebuilds the exact assistant block order from that sequence for tool and correction requests during the running invocation; incomplete thinking never authorizes a continuation. It records each physical attempt before tool authorization or a second model request. A runtime denial ends with `TOOL_FAILED`; an unresolved tool write ends with `TOOL_OUTCOME_UNKNOWN`. Neither becomes a fabricated tool result.
56
56
 
57
57
  Anthropic uses `@ai-sdk/anthropic@4.0.72` and the exact `/messages` endpoint under the authorized credential-free base URL. In native-schema mode the adapter forces `providerOptions.anthropic.structuredOutputMode: "outputFormat"`; it never asks the SDK to substitute a JSON tool. The tested exact native model IDs are `claude-sonnet-4-5`, `claude-sonnet-4-5-20250929`, `claude-haiku-4-5`, `claude-haiku-4-5-20251001`, `claude-opus-4-5`, `claude-opus-4-5-20251101`, `claude-sonnet-4-6`, `claude-opus-4-6`, `claude-opus-4-7`, `claude-opus-4-8`, `claude-sonnet-5`, `claude-opus-5`, `claude-sonnet-5-5`, `claude-opus-5-5`, `claude-fable-5`, and `claude-fable-5-1`. Other model IDs in native mode return a recorded `UNSUPPORTED_CAPABILITY` before an attempt or fetch. Prompt-and-validate remains available for other Anthropic model IDs, subject to actual provider access. The provider's native schema lowering relaxes some pattern and numeric bounds and oneof constraints; the recorded request retains the original descriptor schema and Anthropic lowering revision, and local Protobuf/application validation remains definitive. Credentials are supplied by trusted connection callbacks using the provider's `apiKey` or `authToken` setting; the Anthropic profile has no OAuth or subscription-login flow.
58
58
 
@@ -66,21 +66,21 @@ If neither is supplied, or a supplied operation ceiling exceeds the supplied
66
66
  capacity, preparation fails with `UNSUPPORTED_CAPABILITY` before inference.
67
67
  The capacity does not become an application limit. Anthropic lowering revision 3
68
68
  records the effective value in `promptJson.provider.maxTokens`; the request
69
- digest and replay comparison include it. Before sending, the adapter checks that
69
+ digest and live request validation include it. Before sending, the adapter checks that
70
70
  the SDK's materialized `max_tokens` matches this recorded value. SDK clamping or
71
71
  thinking-related adjustments cannot silently change it.
72
72
 
73
73
  The decision path uses the pinned non-generative OpenRouter Jev protocol with SDK retries disabled. It forwards declared probability and score precision to definitive runtime admission and records that precision in `DecisionResponse`, including explicit zero versus absence. It does not use Ax chat correction for decisions.
74
74
 
75
- The adapter guards each provider fetch by the authorized route, existing attempt ticket, durable pre-send record, cancellation, execution fence, and any configured deadline or input/output byte ceilings. The guarded fetch counts response bytes after the platform fetch has decoded transfer and content encoding; the count includes protocol framing and error response bodies. It reads one platform chunk at a time, so a chunk that crosses a configured ceiling may already have arrived before it is discarded. Any configured retained-output ceiling also counts Anthropic signatures, encrypted blocks, and serialized block overhead. The runtime supplies authenticated selection, durable journal and budget callbacks, definitive Proto/application validation, tool policy and intent handling, and recovery. Direct use of a factory outside that runtime does not provide those guarantees.
75
+ The adapter guards each provider fetch by the authorized route, existing attempt ticket, live pre-send admission, cancellation, execution fence, and any configured deadline or input/output byte ceilings. The guarded fetch counts response bytes after the platform fetch has decoded transfer and content encoding; the count includes protocol framing and error response bodies. It reads one platform chunk at a time, so a chunk that crosses a configured ceiling may already have arrived before it is discarded. Any configured retained-output ceiling also counts Anthropic signatures, encrypted blocks, and serialized block overhead. The runtime supplies authenticated selection, live audit and budget callbacks, definitive Proto/application validation, tool policy and intent handling for the running invocation. Direct use of a factory outside that runtime does not provide those guarantees.
76
76
 
77
- The optional MCP protocol factory uses the pinned Vercel MCP client with a custom HTTP or stdio transport. A session negotiates and discovers allowlisted tools before advertisement; accepted descriptions, input schemas, optional output schemas, and their server/tool mapping are recorded in the prepared generation request. A successful result with an advertised output schema must contain matching structured JSON; an MCP `isError` result remains a tool error without fabricating successful structured data. The adapter validates arguments against the discovered input schema and requires a runtime-reserved tool-call ticket before a physical `tools/call`. Runtime policy still decides whether a call is authorized and whether its effect is read or write. Every setup and call message uses a runtime reservation, counts decoded response bytes including errors and crossing chunks, and awaits `finishMessage` before passing a response to the MCP client. HTTP uses the configured POST endpoint without redirects, automatic GET subscriptions, or transport retries. Stdio uses a configured executable without a shell. Tool timeouts and argument/result byte ceilings are optional application settings. Setup and tool traffic obey any configured shared byte ceiling. Without one, the adapter does not add a response-size cap. Discovery follows continuation cursors without a page or tool-count ceiling; repeated cursors and duplicate tool names are rejected. Descriptions and schemas have no framework size or nesting ceiling. Unsupported schema features and binary/resource results fail explicitly. The initial MCP result contract accepts text and structured JSON only. Credential-free session identity hashes the full configured HTTP URL or the stdio executable, argument array and working directory; it does not expose those raw values, headers, or environment. The runtime must persist authorization, reservations, intent and results for durable recovery; this factory alone does not provide those guarantees.
77
+ The optional MCP protocol factory uses the pinned Vercel MCP client with a custom HTTP or stdio transport. A session negotiates and discovers allowlisted tools before advertisement; accepted descriptions, input schemas, optional output schemas, and their server/tool mapping are recorded in the prepared generation request. A successful result with an advertised output schema must contain matching structured JSON; an MCP `isError` result remains a tool error without fabricating successful structured data. The adapter validates arguments against the discovered input schema and requires a runtime-reserved tool-call ticket before a physical `tools/call`. Runtime policy still decides whether a call is authorized and whether its effect is read or write. Every setup and call message uses a runtime reservation, counts decoded response bytes including errors and crossing chunks, and awaits `finishMessage` before passing a response to the MCP client. HTTP uses the configured POST endpoint without redirects, automatic GET subscriptions, or transport retries. Stdio uses a configured executable without a shell. Tool timeouts and argument/result byte ceilings are optional application settings. Setup and tool traffic obey any configured shared byte ceiling. Without one, the adapter does not add a response-size cap. Discovery follows continuation cursors without a page or tool-count ceiling; repeated cursors and duplicate tool names are rejected. Descriptions and schemas have no framework size or nesting ceiling. Unsupported schema features and binary/resource results fail explicitly. The initial MCP result contract accepts text and structured JSON only. Credential-free session identity hashes the full configured HTTP URL or the stdio executable, argument array and working directory; it does not expose those raw values, headers, or environment. The runtime must retain authorization, reservations, intent, and results for the running invocation and append genuine audit records; this factory alone does not provide those guarantees.
78
78
 
79
79
  See the [MCP configuration example](../ai/REFERENCE.md#configure-an-mcp-lookup) for the public server registration, per-tool permission and capability allowlist.
80
80
 
81
81
  The built-in capability descriptors identify the tested provider protocol, schema or decision-output mode, guarded-fetch revision, ticket cancellation/deadline behavior, and one-call-per-ticket retry contract. The factories reject incomplete or changed descriptors. A custom provider model must route its exact Responses, Messages, or Decisions request through the supplied scoped `fetch`, honor the published model interface, and avoid separate SDK retries; the descriptor alone cannot verify a custom model's internal network behavior.
82
82
 
83
- The credential-free protocol tests use the pinned `@ax-llm/ax@25.0.0`, `ai@7.0.128`, `@ai-sdk/openai@4.0.84`, `@ai-sdk/anthropic@4.0.72`, and `@openrouter/ai-sdk-provider@3.1.0`. They exercise actual SDK request shapes against local fetch fixtures, correction and tool continuation, invalid and truncated output, usage, cancellation, byte limits, journal barriers, and no-retry decisions. Run `pnpm exec vitest run packages/ai-vercel-ax/test` from the repository root.
83
+ The credential-free protocol tests use the pinned `@ax-llm/ax@25.0.0`, `ai@7.0.128`, `@ai-sdk/openai@4.0.84`, `@ai-sdk/anthropic@4.0.72`, and `@openrouter/ai-sdk-provider@3.1.0`. They exercise actual SDK request shapes against local fetch fixtures, correction and tool continuation, invalid and truncated output, usage, cancellation, byte limits, live attempt barriers, and no-retry decisions. Run `pnpm exec vitest run packages/ai-vercel-ax/test` from the repository root.
84
84
 
85
85
  The published AI SDK and Ax declarations produce errors under TypeScript 6 with `exactOptionalPropertyTypes`. This optional adapter's source-and-test tooling compilation and the private provider BlackBox test use `skipLibCheck: true` for vendor declarations; authored code keeps the repository's other strict checks. The general framework tooling compilation keeps `skipLibCheck: false`. The public model boundary uses direct `@ai-sdk/provider` V3/V4 interfaces. The adapter tooling compilation checks the provider boundary fixture's assignments and type equality against those pinned SDK interfaces.
86
86
 
@@ -251,7 +251,7 @@ remote references and unsupported keywords before a model request. Discovery
251
251
  traffic is counted against any application-configured byte ceiling.
252
252
  Denied MCP connection authorization becomes a saved, nonretryable
253
253
  `AUTHENTICATION_REQUIRED` Agent result. Unsupported tool discovery
254
- becomes `UNSUPPORTED_CAPABILITY` during setup. Transport, cancellation, journal,
254
+ becomes `UNSUPPORTED_CAPABILITY` during setup. Transport, cancellation, audit,
255
255
  and storage faults in that setup still reject the execution rather than becoming
256
256
  model results. Later tool-call failures have their separate recorded tool
257
257
  outcomes.
@@ -1 +1 @@
1
- {"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../src/adapter/decision.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAIjB,MAAM,oCAAoC,CAAC;AAsY5C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS,kBAAkB,KAAG,OAAO,CAAC,gBAAgB,CAuB3F,CAAC"}
1
+ {"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../src/adapter/decision.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAGjB,MAAM,oCAAoC,CAAC;AAkX5C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS,kBAAkB,KAAG,OAAO,CAAC,gBAAgB,CAsB3F,CAAC"}
@@ -14,11 +14,9 @@
14
14
  import { create, toJsonString } from "@bufbuild/protobuf";
15
15
  import { createHash } from "node:crypto";
16
16
  import { experimental_decide } from "ai";
17
- import { AnyMessages } from "@spine-event-engine/core";
18
- import { assertAiOutcomeContext } from "@spine-event-engine/ai/spi/adapter";
17
+ import { AnyPacker } from "@spine-event-engine/core";
19
18
  import { AiContentDigestSchema, AiDiagnosticIdSchema, AiOutcome, AiTokenCountSchema, AiUsageSchema, DecisionAlternativeKeySchema, DecisionAnswerSchema, DecisionChoiceSchema, DecisionDistributionSchema, DecisionProbabilitySchema, DecisionQuestionIdSchema, DecisionQuestionKind, DecisionQuestionSchema, DecisionRequestSchema, DecisionResponseSchema, DecisionRoundingSchema, } from "@spine-event-engine/proto/agent";
20
19
  import { providerConnection } from "./factory.js";
21
- import { replayFailure } from "./replay-failure.js";
22
20
  import { scheduleBoundedDeadline } from "./deadline.js";
23
21
  /**
24
22
  * @param question Application decision contract.
@@ -67,7 +65,7 @@ const requestContent = (request) => {
67
65
  questions,
68
66
  });
69
67
  return create(DecisionRequestSchema, {
70
- input: AnyMessages.pack(request.definition.input, request.input),
68
+ input: AnyPacker.pack(request.definition.input, request.input),
71
69
  questions,
72
70
  digest: create(AiContentDigestSchema, {
73
71
  value: createHash("sha256").update(encoded).digest("hex"),
@@ -192,7 +190,7 @@ const decisionResponse = (request, decision, admission, failure) => {
192
190
  answers: Object.entries(decision.answers).map(([id, answer]) => answerContent(answer, id)),
193
191
  outcome: admission.ok ? AiOutcome.ADMITTED : AiOutcome.INVALID_OUTPUT,
194
192
  ...(admission.ok
195
- ? { admittedOutput: AnyMessages.pack(request.definition.output, admission.value) }
193
+ ? { admittedOutput: AnyPacker.pack(request.definition.output, admission.value) }
196
194
  : {}),
197
195
  ...(failure
198
196
  ? { diagnosticId: create(AiDiagnosticIdSchema, { value: failure.diagnosticId }) }
@@ -309,23 +307,6 @@ const providerDecision = async (request, ticket) => {
309
307
  }
310
308
  return decide(request, result, ticket);
311
309
  };
312
- /**
313
- * Returns a saved typed decision without consuming another attempt ticket.
314
- */
315
- const replayDecision = (request, replay) => {
316
- const response = replay.response;
317
- if (response.$typeName !== "spine.ts.agent.DecisionResponse")
318
- throw new TypeError("Saved attempt response kind mismatch");
319
- assertAiOutcomeContext(response);
320
- if (response.outcome === AiOutcome.ADMITTED) {
321
- const output = response.admittedOutput &&
322
- AnyMessages.unpack(response.admittedOutput, request.definition.output);
323
- if (!output)
324
- throw new TypeError("Saved decision output missing");
325
- return { ok: true, value: output };
326
- }
327
- return { ok: false, failure: replayFailure(replay) };
328
- };
329
310
  /**
330
311
  * Executes one non-generative Jev decision without SDK retries.
331
312
  *
@@ -338,8 +319,6 @@ export const executeDecision = async (request) => {
338
319
  kind: "decision",
339
320
  content: requestContent(request),
340
321
  });
341
- if ("kind" in attempt)
342
- return replayDecision(request, attempt);
343
322
  const ticket = attempt;
344
323
  const expired = ticketFailure(request, ticket);
345
324
  if (expired)
@@ -1 +1 @@
1
- {"version":3,"file":"decision.js","sourceRoot":"","sources":["../../src/adapter/decision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE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eAAO,MAAM,iBAAiB,GAAU,SAAS,kBAAkB,KAAG,OAAO,CAAC,gBAAgB,CA2B7F,CAAC"}
1
+ {"version":3,"file":"generation.d.ts","sourceRoot":"","sources":["../../src/adapter/generation.ts"],"names":[],"mappings":"AA+BA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EAGtB,MAAM,oCAAoC,CAAC;AA23C5C;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAU,SAAS,kBAAkB,KAAG,OAAO,CAAC,gBAAgB,CA2B7F,CAAC"}
@@ -14,13 +14,12 @@
14
14
  import { create, toJsonString } from "@bufbuild/protobuf";
15
15
  import { createHash } from "node:crypto";
16
16
  import { AxGen, axMCPToolInputSchemaToFunctionSchema as axToolSchema, } from "@ax-llm/ax";
17
- import { AnyMessages } from "@spine-event-engine/core";
18
- import { assertAiOutcomeContext, deriveOutputSchema, } from "@spine-event-engine/ai/spi/adapter";
17
+ import { AnyPacker } from "@spine-event-engine/core";
18
+ import { deriveOutputSchema, } from "@spine-event-engine/ai/spi/adapter";
19
19
  import { AiAttemptIdSchema, AiContentDigestSchema, AiDiagnosticIdSchema, AiOutcome, AiProviderModelNameSchema as ProviderNameSchema, AiTokenCountSchema, AiUsageSchema, GenerationRequestSchema, GenerationResponseSchema, AnthropicAssistantContentSchema, OpenAiAssistantContentSchema as OpenAiContentSchema, OpenAiMessageItem_Phase as OpenAiPhase, } from "@spine-event-engine/proto/agent";
20
20
  import { AxVercelBridge } from "./bridge.js";
21
21
  import { providerConnection } from "./factory.js";
22
22
  import { canonicalJsonValue } from "./mcp-protocol.js";
23
- import { replayFailure } from "./replay-failure.js";
24
23
  import { collectModelStream, StreamCollectionError, } from "./streamed-model.js";
25
24
  const nativeAnthropicModels = new Set([
26
25
  "claude-sonnet-4-5",
@@ -369,7 +368,7 @@ const requestContent = (request, prepared, schema, previous, settings) => {
369
368
  const outputSchemaJson = JSON.stringify(schema);
370
369
  const promptJson = preparedPromptJson(request, prepared, instructions, settings);
371
370
  return create(GenerationRequestSchema, {
372
- input: AnyMessages.pack(definition.input, request.input),
371
+ input: AnyPacker.pack(definition.input, request.input),
373
372
  instructions,
374
373
  outputSchemaJson,
375
374
  promptJson,
@@ -501,7 +500,7 @@ const responseContent = (partial, outcome, failure, output, schema) => create(Ge
501
500
  ...(partial.openaiContent !== undefined
502
501
  ? { openaiContent: typedOpenAiContent(partial.openaiContent) }
503
502
  : {}),
504
- ...(output ? { admittedOutput: AnyMessages.pack(schema, output) } : {}),
503
+ ...(output ? { admittedOutput: AnyPacker.pack(schema, output) } : {}),
505
504
  ...(failure
506
505
  ? { diagnosticId: create(AiDiagnosticIdSchema, { value: failure.diagnosticId }) }
507
506
  : {}),
@@ -872,7 +871,7 @@ const coherentProposals = (partial, request) => {
872
871
  return true;
873
872
  };
874
873
  /**
875
- * Replays only proposals whose exact response crossed the journal barrier.
874
+ * Continues the active turn with proposals recorded during this model call.
876
875
  *
877
876
  * @param partial Recorded provider content.
878
877
  * @returns Ax function-call continuation with received text.
@@ -891,226 +890,6 @@ const toolContinuation = (partial) => ({
891
890
  },
892
891
  ],
893
892
  });
894
- /**
895
- * Replays one saved response without admitting a new transport request.
896
- *
897
- * @param request Selected typed capability.
898
- * @param state Ax continuation and validation state.
899
- * @param replay Complete durable attempt record.
900
- * @returns Equivalent Ax response for correction or continuation.
901
- */
902
- const replayGeneration = (request, state, replay) => {
903
- const response = replay.response;
904
- if (response.$typeName !== "spine.ts.agent.GenerationResponse")
905
- throw new TypeError("Saved attempt response kind mismatch");
906
- assertAiOutcomeContext(response);
907
- assertSavedAnthropicContent(request, response);
908
- assertOpenAiReceipt(request, response);
909
- if (response.outcome === AiOutcome.ADMITTED)
910
- return replayAdmittedGeneration(request, state, response);
911
- const partial = {
912
- text: response.rawOutput,
913
- toolCalls: response.toolCalls.map((call) => ({
914
- id: call.providerCallId,
915
- name: call.toolName,
916
- input: call.argumentsJson,
917
- })),
918
- ...(response.openaiContent
919
- ? { openaiContent: projectedOpenAiContent(response.openaiContent) }
920
- : {}),
921
- };
922
- if (response.outcome === AiOutcome.TOOL_REQUESTED)
923
- return replayToolProposals(request, state, replay.id, partial, response);
924
- state.failure = replayFailure(replay);
925
- if (response.outcome !== AiOutcome.INVALID_OUTPUT || !replay.issues?.length)
926
- throw new Error("Saved generation failure terminates this attempt");
927
- state.admission = { ok: false, issues: replay.issues };
928
- state.assistantTurns.push({ response, axContent: axCandidate(response.rawOutput) });
929
- return {
930
- results: [{ index: 0, content: axCandidate(response.rawOutput), finishReason: "stop" }],
931
- };
932
- };
933
- /**
934
- * Checks whether saved Anthropic blocks are complete enough to resume.
935
- *
936
- * @param request Selected typed capability.
937
- * @param response Saved generation response.
938
- */
939
- const assertSavedAnthropicContent = (request, response) => {
940
- if (providerConnection(request.model).capabilities.id !== "anthropic-messages-v1")
941
- return;
942
- if (!response.anthropicContent)
943
- throw new TypeError("Saved Anthropic content missing");
944
- if ((response.outcome === AiOutcome.TOOL_REQUESTED ||
945
- response.outcome === AiOutcome.INVALID_OUTPUT) &&
946
- response.anthropicContent.blocks.some((block) => (block.content.case === "thinking" && !block.content.value.signature) ||
947
- (block.content.case === "redactedThinking" && !block.content.value.data)))
948
- throw new TypeError("Saved Anthropic content incomplete");
949
- };
950
- /**
951
- * Rebuilds bounded typed items for saved digest and projection checks.
952
- *
953
- * @param content Saved Responses receipt.
954
- * @returns Ordered provider item projection.
955
- */
956
- const projectedOpenAiContent = (content) => ({
957
- complete: content.complete,
958
- items: content.items.map(projectedOpenAiItem),
959
- });
960
- /**
961
- * @param item Durable typed item.
962
- * @returns Bounded response projection.
963
- */
964
- const projectedOpenAiItem = (item) => {
965
- if (item.content.case === "reasoning")
966
- return {
967
- type: "reasoning",
968
- id: item.itemId,
969
- summary: item.content.value.summary,
970
- encryptedContent: item.content.value.encryptedContent,
971
- };
972
- if (item.content.case === "functionCall") {
973
- const call = item.content.value.call;
974
- if (!call)
975
- throw new TypeError("Saved Responses call missing");
976
- return {
977
- type: "function_call",
978
- id: item.itemId,
979
- call: { id: call.providerCallId, name: call.toolName, input: call.argumentsJson },
980
- namespace: item.content.value.namespace,
981
- };
982
- }
983
- if (item.content.case === "message")
984
- return {
985
- type: "message",
986
- id: item.itemId,
987
- phase: item.content.value.phase === OpenAiPhase.COMMENTARY
988
- ? "commentary"
989
- : item.content.value.phase === OpenAiPhase.FINAL_ANSWER
990
- ? "final_answer"
991
- : "",
992
- parts: item.content.value.parts.map((part) => ({
993
- type: part.content.case === "outputText" ? "output_text" : "refusal",
994
- text: part.content.value ?? "",
995
- })),
996
- };
997
- throw new TypeError("Saved Responses item missing");
998
- };
999
- /**
1000
- * Checks the complete typed provider receipt before replay or continuation.
1001
- *
1002
- * @param request Selected authenticated profile.
1003
- * @param response Durable generation receipt.
1004
- */
1005
- const assertOpenAiReceipt = (request, response) => {
1006
- if (providerConnection(request.model).capabilities.id !== "chatgpt-plan-responses-v1")
1007
- return;
1008
- if (!response.openaiContent)
1009
- throw new TypeError("Saved Responses content missing");
1010
- const content = projectedOpenAiContent(response.openaiContent);
1011
- assertOpenAiItems(content, response);
1012
- if (!content.complete &&
1013
- (response.outcome === AiOutcome.ADMITTED ||
1014
- response.outcome === AiOutcome.TOOL_REQUESTED ||
1015
- response.outcome === AiOutcome.INVALID_OUTPUT))
1016
- throw new TypeError("Saved Responses content incomplete");
1017
- assertOpenAiProjection(content, response);
1018
- };
1019
- /**
1020
- * @param content Typed provider receipt.
1021
- */
1022
- const assertOpenAiItems = (content, response) => {
1023
- const ids = new Set();
1024
- for (const item of content.items) {
1025
- if (!item.id || ids.has(item.id))
1026
- throw new TypeError("Saved Responses item ID invalid");
1027
- ids.add(item.id);
1028
- if (item.type === "reasoning" && !item.encryptedContent)
1029
- throw new TypeError("Saved Responses reasoning incomplete");
1030
- if (item.type === "function_call" && item.namespace !== "spine_mcp")
1031
- throw new TypeError("Saved Responses namespace invalid");
1032
- if (item.type === "message" &&
1033
- item.parts.some((part) => part.type === "refusal") &&
1034
- (content.complete ||
1035
- (response.outcome !== AiOutcome.FAILED && response.outcome !== AiOutcome.REFUSED)))
1036
- throw new TypeError("Saved Responses refusal");
1037
- }
1038
- };
1039
- /**
1040
- * @param content Typed provider receipt.
1041
- * @param response Saved response projection.
1042
- */
1043
- const assertOpenAiProjection = (content, response) => {
1044
- const text = content.items
1045
- .flatMap((item) => item.type === "message"
1046
- ? item.parts.filter((part) => part.type === "output_text").map((part) => part.text)
1047
- : [])
1048
- .join("");
1049
- const calls = content.items.flatMap((item) => (item.type === "function_call" ? [item.call] : []));
1050
- const partialFailure = !content.complete &&
1051
- (response.outcome === AiOutcome.FAILED || response.outcome === AiOutcome.REFUSED);
1052
- if (!(partialFailure ? response.rawOutput.startsWith(text) : text === response.rawOutput) ||
1053
- !(partialFailure
1054
- ? calls.length <= response.toolCalls.length
1055
- : calls.length === response.toolCalls.length) ||
1056
- calls.some((call, index) => call.id !== response.toolCalls[index]?.providerCallId ||
1057
- call.name !== response.toolCalls[index].toolName ||
1058
- call.input !== response.toolCalls[index].argumentsJson) ||
1059
- response.digest?.value !== savedOpenAiDigest(content, response))
1060
- throw new TypeError("Saved Responses projection changed");
1061
- };
1062
- /**
1063
- * @param content Durable typed receipt projection.
1064
- * @param response Durable standard response fields.
1065
- * @returns Digest of both projections.
1066
- */
1067
- const savedOpenAiDigest = (content, response) => responseDigest({
1068
- text: response.rawOutput,
1069
- toolCalls: response.toolCalls.map((call) => ({
1070
- id: call.providerCallId,
1071
- name: call.toolName,
1072
- input: call.argumentsJson,
1073
- })),
1074
- openaiContent: content,
1075
- }).value;
1076
- /**
1077
- * Rebuilds a saved admitted generation without provider dispatch.
1078
- *
1079
- * @param request Selected typed capability.
1080
- * @param state Ax continuation and validation state.
1081
- * @param response Saved admitted generation response.
1082
- * @returns Equivalent Ax response with admitted application output.
1083
- */
1084
- const replayAdmittedGeneration = (request, state, response) => {
1085
- const output = response.admittedOutput &&
1086
- AnyMessages.unpack(response.admittedOutput, request.definition.output);
1087
- if (!output)
1088
- throw new TypeError("Saved generation output missing");
1089
- state.admission = { ok: true, value: output };
1090
- return {
1091
- results: [
1092
- {
1093
- index: 0,
1094
- content: axCandidate(toJsonString(request.definition.output, output)),
1095
- finishReason: "stop",
1096
- },
1097
- ],
1098
- };
1099
- };
1100
- /**
1101
- * Rebuilds only a previously journaled coherent tool proposal queue.
1102
- */
1103
- const replayToolProposals = (request, state, ticketId, partial, response) => {
1104
- if (!coherentProposals(partial, request))
1105
- throw new TypeError("Saved tool proposals invalid");
1106
- for (const call of partial.toolCalls) {
1107
- const queue = state.pendingCalls.get(call.name) ?? [];
1108
- queue.push({ ticketId, providerCallId: call.id, input: call.input });
1109
- state.pendingCalls.set(call.name, queue);
1110
- }
1111
- state.assistantTurns.push({ response, axContent: partial.text });
1112
- return toolContinuation(partial);
1113
- };
1114
893
  /**
1115
894
  * @param request Selected execution.
1116
895
  * @param state Program state.
@@ -1160,6 +939,7 @@ const runtimeFunctions = (request, state) => {
1160
939
  providerCallId: next.providerCallId,
1161
940
  server: tool.server,
1162
941
  tool: tool.tool,
942
+ providerToolName: tool.modelName,
1163
943
  argumentsJson: next.input,
1164
944
  }));
1165
945
  if (result.outcome !== AiOutcome.ADMITTED || result.toolError) {
@@ -1238,17 +1018,6 @@ const chat = async (request, state, prepared, schema) => {
1238
1018
  const settings = chatgptPlanOptions(request) ?? anthropicOptions(request);
1239
1019
  const content = requestContent(request, prepared, schema, state.previous, settings);
1240
1020
  const attempt = await runtimeBarrier(state, () => request.control.beginAttempt({ kind: "generation", content }));
1241
- if ("kind" in attempt) {
1242
- state.previous = { id: attempt.id };
1243
- try {
1244
- return replayGeneration(request, state, attempt);
1245
- }
1246
- catch (error) {
1247
- if (!state.failure)
1248
- state.barrierFailed = true;
1249
- throw error;
1250
- }
1251
- }
1252
1021
  const ticket = attempt;
1253
1022
  state.previous = ticket;
1254
1023
  await admitGenerationTicket(request, state, ticket);