@tangle-network/agent-app 0.46.51 → 0.46.53
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 +1 -1
- package/dist/{chunk-TCNH6XDK.js → chunk-T374KO42.js} +9 -36
- package/dist/chunk-T374KO42.js.map +1 -0
- package/dist/preset-cloudflare/detached-turn-workflow.d.ts +0 -28
- package/dist/preset-cloudflare/index.d.ts +1 -1
- package/dist/preset-cloudflare/index.js +1 -37
- package/dist/preset-cloudflare/index.js.map +1 -1
- package/dist/sandbox/index.d.ts +0 -1
- package/dist/sandbox/index.js +1 -3
- package/package.json +1 -1
- package/dist/chunk-TCNH6XDK.js.map +0 -1
- package/dist/sandbox/session-turn.d.ts +0 -41
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
flattenHistory,
|
|
113
113
|
readSandboxBinaryBytes,
|
|
114
114
|
statSandboxFileSize
|
|
115
|
-
} from "../chunk-
|
|
115
|
+
} from "../chunk-T374KO42.js";
|
|
116
116
|
import "../chunk-MCYJON3F.js";
|
|
117
117
|
import "../chunk-LWSJK546.js";
|
|
118
118
|
import "../chunk-P5PIAQVS.js";
|
|
@@ -155,36 +155,6 @@ async function readSandboxBinaryBytes(box, absolutePath, expectedSize, options)
|
|
|
155
155
|
return { succeeded: true, value: { bytes, size: expectedSize } };
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
// src/sandbox/session-turn.ts
|
|
159
|
-
function stableId(value, field) {
|
|
160
|
-
const normalized = value.trim();
|
|
161
|
-
if (!normalized) throw new Error(`Sandbox session turn requires a non-empty ${field}`);
|
|
162
|
-
return normalized;
|
|
163
|
-
}
|
|
164
|
-
async function admitSandboxSessionTurn(options) {
|
|
165
|
-
const sessionId = stableId(options.sessionId, "sessionId");
|
|
166
|
-
const turnId = stableId(options.turnId, "turnId");
|
|
167
|
-
if (options.message.parts.length === 0) {
|
|
168
|
-
throw new Error("Sandbox session turn requires at least one message part");
|
|
169
|
-
}
|
|
170
|
-
const created = await options.box.createSession({
|
|
171
|
-
sessionId,
|
|
172
|
-
backend: options.backend,
|
|
173
|
-
...options.title !== void 0 ? { title: options.title } : {}
|
|
174
|
-
});
|
|
175
|
-
if (!isExpectedSession(created, sessionId)) {
|
|
176
|
-
throw new Error(`Sandbox returned a different session for ${sessionId}`);
|
|
177
|
-
}
|
|
178
|
-
const receipt = await created.session.sendMessage(
|
|
179
|
-
{ ...options.message, turnId },
|
|
180
|
-
options.sendOptions
|
|
181
|
-
);
|
|
182
|
-
return { sessionId, turnId, receipt };
|
|
183
|
-
}
|
|
184
|
-
function isExpectedSession(created, sessionId) {
|
|
185
|
-
return created.info.id === sessionId && created.session.id === sessionId;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
158
|
// src/sandbox/recovery.ts
|
|
189
159
|
var EGRESS_PROXY_RECOVERY_REQUIRED = "EGRESS_PROXY_RECOVERY_REQUIRED";
|
|
190
160
|
var EGRESS_PROXY_RECOVERY_PHASE = "egress_proxy_recovery";
|
|
@@ -2702,12 +2672,16 @@ async function driveSandboxTurn(shell, box, message, options) {
|
|
|
2702
2672
|
sessionId: options.sessionId,
|
|
2703
2673
|
...options.turnId ? { turnId: options.turnId } : {},
|
|
2704
2674
|
...options.wallCapMs !== void 0 ? { wallCapMs: options.wallCapMs } : {},
|
|
2705
|
-
...options.executionId ? { executionId: options.executionId } : {},
|
|
2706
2675
|
...options.timeoutMs !== void 0 ? { timeoutMs: options.timeoutMs } : {},
|
|
2707
2676
|
...options.signal ? { signal: options.signal } : {},
|
|
2708
|
-
//
|
|
2709
|
-
//
|
|
2710
|
-
backend: {
|
|
2677
|
+
// A durable caller with a session-gateway consumer can handle these events;
|
|
2678
|
+
// callers without one should omit interactions so the run stays unattended.
|
|
2679
|
+
backend: {
|
|
2680
|
+
type: harness,
|
|
2681
|
+
profile,
|
|
2682
|
+
...model ? { model } : {},
|
|
2683
|
+
...options.interactions ? { interactions: options.interactions } : {}
|
|
2684
|
+
}
|
|
2711
2685
|
});
|
|
2712
2686
|
emitSandboxActivity(options.spend, box);
|
|
2713
2687
|
return ok(drive);
|
|
@@ -2765,7 +2739,6 @@ export {
|
|
|
2765
2739
|
shellQuote,
|
|
2766
2740
|
statSandboxFileSize,
|
|
2767
2741
|
readSandboxBinaryBytes,
|
|
2768
|
-
admitSandboxSessionTurn,
|
|
2769
2742
|
EGRESS_PROXY_RECOVERY_REQUIRED,
|
|
2770
2743
|
EGRESS_PROXY_RECOVERY_PHASE,
|
|
2771
2744
|
WORKSPACE_SANDBOX_MISSING,
|
|
@@ -2860,4 +2833,4 @@ export {
|
|
|
2860
2833
|
isTerminalPromptEvent,
|
|
2861
2834
|
detectInteractiveQuestion
|
|
2862
2835
|
};
|
|
2863
|
-
//# sourceMappingURL=chunk-
|
|
2836
|
+
//# sourceMappingURL=chunk-T374KO42.js.map
|