@tangle-network/agent-app 4.0.13 → 4.0.15

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 (32) hide show
  1. package/dist/billing/identity-bound.d.ts +14 -9
  2. package/dist/billing/index.js +1 -1
  3. package/dist/chat-routes/detached-turn.d.ts +1 -1
  4. package/dist/chat-routes/failure-wording.d.ts +3 -4
  5. package/dist/chat-routes/index.js +5 -5
  6. package/dist/chat-routes/index.js.map +1 -1
  7. package/dist/{chunk-XCUT2I52.js → chunk-5QQBQS7W.js} +8 -2
  8. package/dist/{chunk-XCUT2I52.js.map → chunk-5QQBQS7W.js.map} +1 -1
  9. package/dist/{chunk-GWATTXFR.js → chunk-FYF564KJ.js} +2 -2
  10. package/dist/{chunk-QPD42X6A.js → chunk-G4NHCLYA.js} +17 -9
  11. package/dist/chunk-G4NHCLYA.js.map +1 -0
  12. package/dist/{chunk-TMWUWKLU.js → chunk-GE242CLI.js} +2 -2
  13. package/dist/{chunk-RNDWCT4O.js → chunk-MZZMOGFN.js} +101 -89
  14. package/dist/{chunk-RNDWCT4O.js.map → chunk-MZZMOGFN.js.map} +1 -1
  15. package/dist/{chunk-CD4SJXYC.js → chunk-RFXROORA.js} +12 -12
  16. package/dist/chunk-RFXROORA.js.map +1 -0
  17. package/dist/platform/delegated-keys.d.ts +5 -1
  18. package/dist/platform/index.js +8 -2
  19. package/dist/platform/index.js.map +1 -1
  20. package/dist/preset-cloudflare/index.js +3 -3
  21. package/dist/public-consultation/index.js +3 -3
  22. package/dist/runtime/index.js +2 -2
  23. package/dist/runtime/router-turn.js +1 -1
  24. package/dist/spend/delegate-budget.d.ts +4 -0
  25. package/dist/spend/index.js.map +1 -1
  26. package/dist/turn-health/index.js +3 -1
  27. package/dist/turn-health/index.js.map +1 -1
  28. package/package.json +1 -1
  29. package/dist/chunk-CD4SJXYC.js.map +0 -1
  30. package/dist/chunk-QPD42X6A.js.map +0 -1
  31. /package/dist/{chunk-GWATTXFR.js.map → chunk-FYF564KJ.js.map} +0 -0
  32. /package/dist/{chunk-TMWUWKLU.js.map → chunk-GE242CLI.js.map} +0 -0
@@ -43,6 +43,7 @@ import {
43
43
  assistantRowIdForTurn,
44
44
  concatStreams,
45
45
  createAssistantDraftWriter,
46
+ failureCode,
46
47
  failureCodeOf,
47
48
  failureIds,
48
49
  failureReason,
@@ -55,7 +56,6 @@ import {
55
56
  providerRetryNotice,
56
57
  resolveEmptyTurnRetries,
57
58
  rowIdOf,
58
- sandboxStreamErrorCode,
59
59
  sandboxStreamFailureDiagnostic,
60
60
  serverFailureData,
61
61
  storeSupportsDraftPersistence,
@@ -64,7 +64,7 @@ import {
64
64
  transformVisibleTextParts,
65
65
  withStreamHeartbeat,
66
66
  withoutToolList
67
- } from "./chunk-RNDWCT4O.js";
67
+ } from "./chunk-MZZMOGFN.js";
68
68
  import {
69
69
  normalizeClientTurnId,
70
70
  resolveChatTurn
@@ -143,7 +143,7 @@ import {
143
143
  composeRouterTurnPromptSections,
144
144
  narratesBefore,
145
145
  runRouterTurn
146
- } from "./chunk-XCUT2I52.js";
146
+ } from "./chunk-5QQBQS7W.js";
147
147
  import {
148
148
  createIntelligenceTurnTraceSink,
149
149
  createTurnTrace,
@@ -1317,10 +1317,10 @@ function createSandboxChatProducer(options) {
1317
1317
  }
1318
1318
  if (event.type === "error") {
1319
1319
  const reason = failureReason(record);
1320
- const view = person.view(reason, asString(event.data?.code), event.data?.statusCode ?? event.data?.status, failureIds(event.data));
1320
+ const view = person.view(reason, failureCode(record), event.data?.statusCode ?? event.data?.status, failureIds(event.data));
1321
1321
  const errorContent = failureText(view, projectionState.fullText);
1322
1322
  if (options.errorNotice) {
1323
- const code = view.class === "model_key_refused" ? MODEL_KEY_REFUSED_CODE : sandboxStreamErrorCode(event.data);
1323
+ const code = view.class === "model_key_refused" ? MODEL_KEY_REFUSED_CODE : failureCode(record) ?? "sandbox.stream_error";
1324
1324
  yield* emitErrorNotice(errorContent, code);
1325
1325
  } else if (options.includeErrorText !== false) {
1326
1326
  const errorDelta = projectionState.fullText ? `
@@ -2332,12 +2332,12 @@ function settledTurnTiming(turnStreamId, at, trace) {
2332
2332
  ...at.firstVisibleAt === void 0 ? {} : { firstVisibleMs: at.firstVisibleAt - at.startedAt },
2333
2333
  ...at.firstTextAt === void 0 ? {} : { firstTextMs: at.firstTextAt - at.startedAt }
2334
2334
  };
2335
- const failureCode = at.failure ? readableTurnFailure(at.failure.error, at.failure.data) : void 0;
2335
+ const failureCode2 = at.failure ? readableTurnFailure(at.failure.error, at.failure.data) : void 0;
2336
2336
  noteMeasuredTurnFacts(turnStreamId, {
2337
2337
  requestReceivedAt: at.requestAt,
2338
2338
  ...measured,
2339
2339
  ...at.model ? { model: at.model } : {},
2340
- ...failureCode ? { failureCode } : {}
2340
+ ...failureCode2 ? { failureCode: failureCode2 } : {}
2341
2341
  });
2342
2342
  return { ...measured, trace };
2343
2343
  }
@@ -2661,8 +2661,8 @@ async function prepareAdmittedTurn(options, trace, log, tenantId, userId, payloa
2661
2661
  function createTurnSettlement(state, trace, options, executionId, traceSink, identity, traceOptions, context, turnStreamId, log, ctx, userMessageId) {
2662
2662
  const assistantRowId = () => state.assistantMessageId ?? state.draft?.rowId() ?? null;
2663
2663
  const endTrace = (failed, terminalError) => {
2664
- const failureCode = failed ? failureCodeOf(state.lastFailureData) ?? (terminalError instanceof Error ? terminalError.name : "turn_failed") : void 0;
2665
- const snapshot = trace.finish(failureCode === void 0 ? {} : { error: failureCode });
2664
+ const failureCode2 = failed ? failureCodeOf(state.lastFailureData) ?? (terminalError instanceof Error ? terminalError.name : "turn_failed") : void 0;
2665
+ const snapshot = trace.finish(failureCode2 === void 0 ? {} : { error: failureCode2 });
2666
2666
  if (state.traceEnded) return snapshot;
2667
2667
  state.traceEnded = true;
2668
2668
  const handedOff = state.completionHandoff || state.legacyHandoff;
@@ -2672,7 +2672,7 @@ function createTurnSettlement(state, trace, options, executionId, traceSink, ide
2672
2672
  executionId,
2673
2673
  otlpTraceId: otlpTraceId(snapshot.traceId),
2674
2674
  failed,
2675
- ...failureCode ? { failureCode } : {},
2675
+ ...failureCode2 ? { failureCode: failureCode2 } : {},
2676
2676
  ...handedOff ? { handedOff: true } : {},
2677
2677
  ...state.gatedTurn ? { gated: true } : {},
2678
2678
  ...snapshot.summary
@@ -2686,7 +2686,7 @@ function createTurnSettlement(state, trace, options, executionId, traceSink, ide
2686
2686
  "tangle.turn.failed": failed,
2687
2687
  ...state.gatedTurn ? { "tangle.turn.gated": true } : {},
2688
2688
  ...handedOff ? { "tangle.turn.handed_off": true } : {},
2689
- ...failureCode ? { "tangle.turn.failure_code": failureCode } : {},
2689
+ ...failureCode2 ? { "tangle.turn.failure_code": failureCode2 } : {},
2690
2690
  ...traceOptions?.labels?.({ identity, executionId, context }) ?? {}
2691
2691
  });
2692
2692
  }
@@ -3665,4 +3665,4 @@ export {
3665
3665
  createChatTurnRoutes,
3666
3666
  streamChatRouteAsSandboxEvents
3667
3667
  };
3668
- //# sourceMappingURL=chunk-CD4SJXYC.js.map
3668
+ //# sourceMappingURL=chunk-RFXROORA.js.map