@tangle-network/agent-app 0.63.4 → 0.63.5
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/chat-routes/index.js +2 -2
- package/dist/{chunk-72ASTUPN.js → chunk-OCR36QGZ.js} +16 -8
- package/dist/{chunk-72ASTUPN.js.map → chunk-OCR36QGZ.js.map} +1 -1
- package/dist/{chunk-UXK5EBQT.js → chunk-XYSKMHWG.js} +2 -2
- package/dist/public-consultation/index.js +2 -2
- package/dist/sandbox/index.js +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-UXK5EBQT.js.map → chunk-XYSKMHWG.js.map} +0 -0
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
turnCarriesFiles,
|
|
72
72
|
turnPromptText,
|
|
73
73
|
withProducerStream
|
|
74
|
-
} from "../chunk-
|
|
74
|
+
} from "../chunk-XYSKMHWG.js";
|
|
75
75
|
import "../chunk-KH4QSBNI.js";
|
|
76
76
|
import {
|
|
77
77
|
sniffMimeFromName
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
import "../chunk-MM6RLOXF.js";
|
|
86
86
|
import {
|
|
87
87
|
flattenHistory
|
|
88
|
-
} from "../chunk-
|
|
88
|
+
} from "../chunk-OCR36QGZ.js";
|
|
89
89
|
import "../chunk-F4TUZYMX.js";
|
|
90
90
|
import {
|
|
91
91
|
assistantRowIdForTurn,
|
|
@@ -3228,6 +3228,7 @@ async function* detachedSandboxPromptEvents(box, prompt, options, backend) {
|
|
|
3228
3228
|
if (!sessionId || !executionId) {
|
|
3229
3229
|
throw new Error("streamSandboxPrompt detach requires stable sessionId and executionId");
|
|
3230
3230
|
}
|
|
3231
|
+
options.signal?.throwIfAborted();
|
|
3231
3232
|
const lastEventId = options.lastEventId?.trim() || void 0;
|
|
3232
3233
|
const turnId = options.turnId?.trim() || executionId;
|
|
3233
3234
|
const admission = lastEventId ? null : await box.dispatchPrompt(prompt, {
|
|
@@ -3242,20 +3243,24 @@ async function* detachedSandboxPromptEvents(box, prompt, options, backend) {
|
|
|
3242
3243
|
...options.ttlMs !== void 0 ? { ttlMs: options.ttlMs } : {},
|
|
3243
3244
|
...options.trace ? { traceId: options.trace.traceId } : {}
|
|
3244
3245
|
});
|
|
3245
|
-
|
|
3246
|
-
if (!admittedExecutionId) {
|
|
3247
|
-
throw new Error(`detached Sandbox dispatch for ${sessionId} returned no executionId`);
|
|
3248
|
-
}
|
|
3246
|
+
options.signal?.throwIfAborted();
|
|
3249
3247
|
if (admission?.dispatched === false) {
|
|
3250
3248
|
const cached = await box.findCompletedTurn(turnId, { sessionId });
|
|
3249
|
+
options.signal?.throwIfAborted();
|
|
3251
3250
|
if (cached) {
|
|
3252
|
-
|
|
3251
|
+
if (cached.turnId !== turnId || cached.sessionId !== sessionId) {
|
|
3252
|
+
throw new Error("sandbox.detached_completed_turn_identity_mismatch");
|
|
3253
|
+
}
|
|
3254
|
+
yield* cachedSandboxPromptEvents(cached, executionId);
|
|
3253
3255
|
return;
|
|
3254
3256
|
}
|
|
3255
3257
|
}
|
|
3258
|
+
if (admission && (admission.sessionId !== sessionId || admission.executionId !== executionId)) {
|
|
3259
|
+
throw new Error("sandbox.detached_admission_identity_mismatch");
|
|
3260
|
+
}
|
|
3256
3261
|
yield* box.streamPrompt("", {
|
|
3257
|
-
sessionId
|
|
3258
|
-
executionId
|
|
3262
|
+
sessionId,
|
|
3263
|
+
executionId,
|
|
3259
3264
|
lastEventId: lastEventId || "0",
|
|
3260
3265
|
...options.trace ? { traceId: options.trace.traceId } : {},
|
|
3261
3266
|
...options.signal ? { signal: options.signal } : {}
|
|
@@ -3418,6 +3423,7 @@ async function* resendRefusedDispatch(dispatch, signal) {
|
|
|
3418
3423
|
let firstSeenAt;
|
|
3419
3424
|
for (let attempts = 1; ; attempts += 1) {
|
|
3420
3425
|
try {
|
|
3426
|
+
signal?.throwIfAborted();
|
|
3421
3427
|
for await (const event of dispatch()) {
|
|
3422
3428
|
delivered = true;
|
|
3423
3429
|
yield event;
|
|
@@ -3445,7 +3451,9 @@ async function* resendRefusedDispatch(dispatch, signal) {
|
|
|
3445
3451
|
}
|
|
3446
3452
|
}
|
|
3447
3453
|
async function* streamSandboxPrompt(shell, box, message, options) {
|
|
3454
|
+
options?.signal?.throwIfAborted();
|
|
3448
3455
|
const backend = await resolveSandboxPromptBackend(shell, options ?? {}, "streamSandboxPrompt");
|
|
3456
|
+
options?.signal?.throwIfAborted();
|
|
3449
3457
|
const prompt = typeof message === "string" ? flattenHistory(message, options?.history) : mergeHistoryIntoParts(message, options?.history);
|
|
3450
3458
|
const dispatch = () => options?.detach ? detachedSandboxPromptEvents(box, prompt, options, backend) : box.streamPrompt(prompt, {
|
|
3451
3459
|
sessionId: options?.sessionId,
|
|
@@ -3748,4 +3756,4 @@ export {
|
|
|
3748
3756
|
sandboxPromptRunner,
|
|
3749
3757
|
createSandboxRunTool
|
|
3750
3758
|
};
|
|
3751
|
-
//# sourceMappingURL=chunk-
|
|
3759
|
+
//# sourceMappingURL=chunk-OCR36QGZ.js.map
|