@tangle-network/agent-app 4.0.14 → 4.0.16
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/dist/billing/identity-bound.d.ts +5 -9
- package/dist/billing/index.js +1 -1
- package/dist/chat-routes/detached-turn.d.ts +1 -1
- package/dist/chat-routes/failure-wording.d.ts +3 -4
- package/dist/chat-routes/index.js +3 -3
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/{chunk-UXVSX5N6.js → chunk-CM5W7U7S.js} +9 -5
- package/dist/chunk-CM5W7U7S.js.map +1 -0
- package/dist/{chunk-TMWUWKLU.js → chunk-GE242CLI.js} +2 -2
- package/dist/{chunk-RNDWCT4O.js → chunk-MZZMOGFN.js} +101 -89
- package/dist/{chunk-RNDWCT4O.js.map → chunk-MZZMOGFN.js.map} +1 -1
- package/dist/{chunk-FAI54DBZ.js → chunk-RFXROORA.js} +11 -11
- package/dist/chunk-RFXROORA.js.map +1 -0
- package/dist/platform/delegated-keys.d.ts +1 -0
- package/dist/platform/index.js +2 -1
- package/dist/platform/index.js.map +1 -1
- package/dist/preset-cloudflare/index.js +3 -3
- package/dist/public-consultation/index.js +2 -2
- package/dist/turn-health/index.js +3 -1
- package/dist/turn-health/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-FAI54DBZ.js.map +0 -1
- package/dist/chunk-UXVSX5N6.js.map +0 -1
- /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-
|
|
67
|
+
} from "./chunk-MZZMOGFN.js";
|
|
68
68
|
import {
|
|
69
69
|
normalizeClientTurnId,
|
|
70
70
|
resolveChatTurn
|
|
@@ -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,
|
|
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 :
|
|
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
|
|
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
|
-
...
|
|
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
|
|
2665
|
-
const snapshot = trace.finish(
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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-
|
|
3668
|
+
//# sourceMappingURL=chunk-RFXROORA.js.map
|