@deepagents/experimental 7.10.1 → 7.10.2
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/index.js +22 -1
- package/dist/index.js.map +2 -2
- package/dist/zukhruf/index.js +22 -1
- package/dist/zukhruf/index.js.map +2 -2
- package/dist/zukhruf/plugins/conversation-scheduling/index.js +3 -0
- package/dist/zukhruf/plugins/conversation-scheduling/index.js.map +3 -3
- package/dist/zukhruf/plugins/schedules/index.js +3 -0
- package/dist/zukhruf/plugins/schedules/index.js.map +3 -3
- package/dist/zukhruf/runtime/conversation-sandboxes.d.ts +2 -1
- package/dist/zukhruf/runtime/conversation-sandboxes.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/zukhruf/index.js
CHANGED
|
@@ -4385,6 +4385,7 @@ function isSkill(value) {
|
|
|
4385
4385
|
}
|
|
4386
4386
|
|
|
4387
4387
|
// packages/experimental/src/zukhruf/runtime/conversation-sandboxes.ts
|
|
4388
|
+
import { SandboxNotFoundError } from "@deepagents/context";
|
|
4388
4389
|
var ConversationSandboxes = class {
|
|
4389
4390
|
// One memoized acquisition for each declaration and conversation.
|
|
4390
4391
|
#held = /* @__PURE__ */ new Map();
|
|
@@ -4395,7 +4396,8 @@ var ConversationSandboxes = class {
|
|
|
4395
4396
|
context.userId
|
|
4396
4397
|
]);
|
|
4397
4398
|
const held = this.#held.get(key);
|
|
4398
|
-
if (held !== void 0)
|
|
4399
|
+
if (held !== void 0)
|
|
4400
|
+
return this.#existing(key, held, declaration, context);
|
|
4399
4401
|
const acquiring = declaration.sandbox(context).catch((error) => {
|
|
4400
4402
|
this.#held.delete(key);
|
|
4401
4403
|
throw error;
|
|
@@ -4403,6 +4405,25 @@ var ConversationSandboxes = class {
|
|
|
4403
4405
|
this.#held.set(key, () => acquiring);
|
|
4404
4406
|
return acquiring;
|
|
4405
4407
|
}
|
|
4408
|
+
/**
|
|
4409
|
+
* Checked before the turn, not left to its first command: the turn's tools
|
|
4410
|
+
* are bound to this handle, so a sandbox found gone mid-turn fails the
|
|
4411
|
+
* model's tool call instead of acquiring a new sandbox.
|
|
4412
|
+
*/
|
|
4413
|
+
async #existing(key, held, declaration, context) {
|
|
4414
|
+
const handle = await held();
|
|
4415
|
+
try {
|
|
4416
|
+
await handle.sandbox.run({ command: "true" });
|
|
4417
|
+
return handle;
|
|
4418
|
+
} catch (error) {
|
|
4419
|
+
if (!(error instanceof SandboxNotFoundError)) throw error;
|
|
4420
|
+
}
|
|
4421
|
+
if (this.#held.get(key) === held) {
|
|
4422
|
+
this.#held.delete(key);
|
|
4423
|
+
await handle.sandbox.dispose();
|
|
4424
|
+
}
|
|
4425
|
+
return this.acquire(declaration, context);
|
|
4426
|
+
}
|
|
4406
4427
|
async [Symbol.asyncDispose]() {
|
|
4407
4428
|
await using handles = new AsyncDisposableStack();
|
|
4408
4429
|
const acquired = await Promise.allSettled(
|