zidane 7.1.5 → 7.1.8
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/README.md +4 -0
- package/dist/{acp-DbYGzaVK.js → acp-BxRfclPQ.js} +3 -3
- package/dist/{acp-DbYGzaVK.js.map → acp-BxRfclPQ.js.map} +1 -1
- package/dist/acp-cli.js +2 -2
- package/dist/acp.d.ts +1 -1
- package/dist/acp.js +1 -1
- package/dist/{agent-BlGt76qk.js → agent-CJbmpTmA.js} +94 -106
- package/dist/agent-CJbmpTmA.js.map +1 -0
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/{approvals-BznYVVGD.js → approvals-DMxUgyVd.js} +27 -16
- package/dist/approvals-DMxUgyVd.js.map +1 -0
- package/dist/chat/pure.d.ts +3 -3
- package/dist/chat.d.ts +5 -5
- package/dist/chat.js +2 -2
- package/dist/contexts/daytona.d.ts +1 -1
- package/dist/contexts/e2b.d.ts +1 -1
- package/dist/daemon-cli.js +1 -1
- package/dist/eval.d.ts +1 -1
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.js +1 -1
- package/dist/{fetch-url-ma-5_p0p.js → fetch-url-DX75gpL0.js} +3 -2
- package/dist/fetch-url-DX75gpL0.js.map +1 -0
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/{index-D9ntsW7o.d.ts → index-BMOl2Bog.d.ts} +5 -5
- package/dist/index-BMOl2Bog.d.ts.map +1 -0
- package/dist/{index-Dw8ruU-j.d.ts → index-DCYh6lOp.d.ts} +56 -5
- package/dist/index-DCYh6lOp.d.ts.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/{ipc-CNrpBs9P.js → ipc-BqEflvqC.js} +2 -2
- package/dist/{ipc-CNrpBs9P.js.map → ipc-BqEflvqC.js.map} +1 -1
- package/dist/ipc.d.ts +5 -5
- package/dist/ipc.js +3 -3
- package/dist/mcp.d.ts +1 -1
- package/dist/output/stream-json.d.ts +1 -1
- package/dist/output/terminal.d.ts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +1 -1
- package/dist/prompts-Pqc3JdW_.d.ts +116 -0
- package/dist/prompts-Pqc3JdW_.d.ts.map +1 -0
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/arcee.d.ts +1 -1
- package/dist/providers/baseten.d.ts +1 -1
- package/dist/providers/cerebras.d.ts +1 -1
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/openai-compat.d.ts +1 -1
- package/dist/providers/openai.d.ts +1 -1
- package/dist/providers/openrouter.d.ts +1 -1
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/restate.d.ts +15 -3
- package/dist/restate.d.ts.map +1 -1
- package/dist/restate.js +26 -13
- package/dist/restate.js.map +1 -1
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/{shell-path-3tZ2lyQ2.js → shell-path-DeSQjoHJ.js} +4 -4
- package/dist/{shell-path-3tZ2lyQ2.js.map → shell-path-DeSQjoHJ.js.map} +1 -1
- package/dist/skills.d.ts +1 -1
- package/dist/{tool-formatters-CJoSmRjH.d.ts → tool-formatters-BDm0tjgy.d.ts} +2 -2
- package/dist/{tool-formatters-CJoSmRjH.d.ts.map → tool-formatters-BDm0tjgy.d.ts.map} +1 -1
- package/dist/tools/fetch-url.d.ts +1 -1
- package/dist/tools/fetch-url.d.ts.map +1 -1
- package/dist/tools/fetch-url.js +1 -1
- package/dist/tools/prompts.d.ts +2 -0
- package/dist/tools/prompts.js +164 -0
- package/dist/tools/prompts.js.map +1 -0
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js +3 -3
- package/dist/tools/web-search.js.map +1 -1
- package/dist/tools.d.ts +3 -2
- package/dist/tools.js +3 -2
- package/dist/{transcript-anchors-nWzUc3WT.d.ts → transcript-anchors-DjcEsOYq.d.ts} +2 -2
- package/dist/{transcript-anchors-nWzUc3WT.d.ts.map → transcript-anchors-DjcEsOYq.d.ts.map} +1 -1
- package/dist/tui.d.ts +3 -3
- package/dist/tui.js +3 -3
- package/dist/{turn-operations-GRw5vbtr.d.ts → turn-operations-Rqk3E0Ue.d.ts} +3 -3
- package/dist/{turn-operations-GRw5vbtr.d.ts.map → turn-operations-Rqk3E0Ue.d.ts.map} +1 -1
- package/dist/types.d.ts +3 -2
- package/docs/ARCHITECTURE.md +14 -2
- package/docs/SKILL.md +31 -1
- package/package.json +6 -1
- package/dist/agent-BlGt76qk.js.map +0 -1
- package/dist/approvals-BznYVVGD.js.map +0 -1
- package/dist/fetch-url-ma-5_p0p.js.map +0 -1
- package/dist/index-D9ntsW7o.d.ts.map +0 -1
- package/dist/index-Dw8ruU-j.d.ts.map +0 -1
package/dist/restate.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { L as buildAliasMaps } from "./openai-compat-Dy56weK8.js";
|
|
2
2
|
import { i as coerceToolResultContent, l as toolOutputByteLength, u as toolResultToText } from "./types-CWgENVLY.js";
|
|
3
|
-
import { At as reserveChildLabel, a as stagedToolState, ar as hydrateReadStateFromSessionAsync, i as isToolStateOps } from "./agent-
|
|
3
|
+
import { At as reserveChildLabel, a as stagedToolState, ar as hydrateReadStateFromSessionAsync, i as isToolStateOps } from "./agent-CJbmpTmA.js";
|
|
4
4
|
import { r as formatTokenUsage } from "./stats-DAKBEKjc.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
//#region src/restate/awakeable.ts
|
|
@@ -22,15 +22,28 @@ import { createHash } from "node:crypto";
|
|
|
22
22
|
*/
|
|
23
23
|
function awakeableWithTimeout(ctx, options = {}) {
|
|
24
24
|
const awakeable = ctx.awakeable();
|
|
25
|
-
const timeoutMs = options.timeoutMs;
|
|
26
|
-
if (typeof timeoutMs !== "number" || !Number.isFinite(timeoutMs) || timeoutMs <= 0) return awakeable;
|
|
27
|
-
const timer = ctx.sleep(timeoutMs);
|
|
28
|
-
const raced = options.promises ? options.promises.race([awakeable.promise, timer]) : Promise.race([awakeable.promise, timer]);
|
|
29
25
|
return {
|
|
30
26
|
id: awakeable.id,
|
|
31
|
-
promise:
|
|
27
|
+
promise: raceWithTimeout(ctx, awakeable.promise, options)
|
|
32
28
|
};
|
|
33
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Race an already-minted awakeable promise against a durable
|
|
32
|
+
* `ctx.sleep(timeoutMs)`. Split out from {@link awakeableWithTimeout} so a
|
|
33
|
+
* caller that must run journaled steps between minting and parking (see
|
|
34
|
+
* `restateWaitBackground`) can arm the race at park time: a
|
|
35
|
+
* `RestatePromise.race` starts awaiting the SDK's single-waiter progress
|
|
36
|
+
* channel as soon as it is built, so building it early and then awaiting a
|
|
37
|
+
* `ctx.run` is two concurrent waiters — `awaitNext already pending`.
|
|
38
|
+
*
|
|
39
|
+
* Without a positive `timeoutMs` the promise is returned untouched.
|
|
40
|
+
*/
|
|
41
|
+
function raceWithTimeout(ctx, promise, options = {}) {
|
|
42
|
+
const timeoutMs = options.timeoutMs;
|
|
43
|
+
if (typeof timeoutMs !== "number" || !Number.isFinite(timeoutMs) || timeoutMs <= 0) return promise;
|
|
44
|
+
const timer = ctx.sleep(timeoutMs);
|
|
45
|
+
return (options.promises ? options.promises.race([promise, timer]) : Promise.race([promise, timer])).then((value) => value === void 0 ? null : value);
|
|
46
|
+
}
|
|
34
47
|
//#endregion
|
|
35
48
|
//#region src/restate/awakeable-tool.ts
|
|
36
49
|
/**
|
|
@@ -1491,7 +1504,7 @@ function entryToExit(entry) {
|
|
|
1491
1504
|
}
|
|
1492
1505
|
/**
|
|
1493
1506
|
* Park on `promise` until it settles, the caller aborts, or (already handled
|
|
1494
|
-
* by `
|
|
1507
|
+
* by `raceWithTimeout`) the durable deadline elapses. Abort and rejection
|
|
1495
1508
|
* both resolve `null` — the `waitBackground` seam's contract is "exit info, or
|
|
1496
1509
|
* null when the task didn't cleanly exit before we stopped waiting".
|
|
1497
1510
|
*/
|
|
@@ -1532,10 +1545,7 @@ function restateWaitBackground(options) {
|
|
|
1532
1545
|
}, runOpts);
|
|
1533
1546
|
return exit;
|
|
1534
1547
|
};
|
|
1535
|
-
const awakeable =
|
|
1536
|
-
...timeoutMs !== void 0 ? { timeoutMs } : {},
|
|
1537
|
-
...options.promises ? { promises: options.promises } : {}
|
|
1538
|
-
});
|
|
1548
|
+
const awakeable = ctx.awakeable();
|
|
1539
1549
|
const marker = await ctx.run(`${entry}-register`, async () => {
|
|
1540
1550
|
options.replayTracker?.markLive();
|
|
1541
1551
|
await register(awakeable.id, taskId, handle);
|
|
@@ -1551,10 +1561,13 @@ function restateWaitBackground(options) {
|
|
|
1551
1561
|
}, runOpts)).find((e) => e.taskId === taskId);
|
|
1552
1562
|
if (!found) return finalize(null, awakeable.id);
|
|
1553
1563
|
if (found.status !== "running") return finalize(entryToExit(found), awakeable.id);
|
|
1554
|
-
return finalize(await parkUntilAbort(awakeable.promise,
|
|
1564
|
+
return finalize(await parkUntilAbort(raceWithTimeout(ctx, awakeable.promise, {
|
|
1565
|
+
...timeoutMs !== void 0 ? { timeoutMs } : {},
|
|
1566
|
+
...options.promises ? { promises: options.promises } : {}
|
|
1567
|
+
}), signal), awakeable.id);
|
|
1555
1568
|
};
|
|
1556
1569
|
}
|
|
1557
1570
|
//#endregion
|
|
1558
|
-
export { DEFAULT_TOOL_STATE_KEY, awakeableWithTimeout, createReplayTracker, deterministicUuid, replayAwareAbort, restateAwakeableTool, restateBehavior, restateClock, restateMcpToolWrap, restateProvider, restateSessionStore, restateSpawnTool, restateTool, restateToolBatchExecutor, restateToolStateStore, restateWaitBackground, shouldRethrowRestateControlError, wrapAgentTools };
|
|
1571
|
+
export { DEFAULT_TOOL_STATE_KEY, awakeableWithTimeout, createReplayTracker, deterministicUuid, raceWithTimeout, replayAwareAbort, restateAwakeableTool, restateBehavior, restateClock, restateMcpToolWrap, restateProvider, restateSessionStore, restateSpawnTool, restateTool, restateToolBatchExecutor, restateToolStateStore, restateWaitBackground, shouldRethrowRestateControlError, wrapAgentTools };
|
|
1559
1572
|
|
|
1560
1573
|
//# sourceMappingURL=restate.js.map
|