zidane 5.13.13 → 5.13.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/acp-cli.js +8 -7
- package/dist/acp-cli.js.map +1 -1
- package/dist/{acp-CqXcM2Km.js → acp-eGzYbNGF.js} +8 -8
- package/dist/{acp-CqXcM2Km.js.map → acp-eGzYbNGF.js.map} +1 -1
- package/dist/acp.d.ts +2 -2
- package/dist/acp.js +1 -1
- package/dist/{agent-NkKgz5Dh.d.ts → agent-CNIOsTUg.d.ts} +44 -2
- package/dist/agent-CNIOsTUg.d.ts.map +1 -0
- package/dist/{auth-CGTf8v1_.js → auth-D9rP8khI.js} +2 -2
- package/dist/{auth-CGTf8v1_.js.map → auth-D9rP8khI.js.map} +1 -1
- package/dist/chat/pure.d.ts +3 -3
- package/dist/chat.d.ts +6 -6
- package/dist/chat.js +3 -3
- package/dist/contexts/daytona.d.ts +22 -4
- package/dist/contexts/daytona.d.ts.map +1 -1
- package/dist/contexts/daytona.js +6 -5
- package/dist/contexts/daytona.js.map +1 -1
- package/dist/contexts/docker.js +2 -1
- package/dist/contexts/docker.js.map +1 -1
- package/dist/contexts/e2b.d.ts +2 -2
- package/dist/contexts/sandbox.d.ts +2 -0
- package/dist/contexts/sandbox.js +55 -0
- package/dist/contexts/sandbox.js.map +1 -0
- package/dist/{contexts-DHi8LPCp.js → contexts-BebciJyQ.js} +3 -53
- package/dist/contexts-BebciJyQ.js.map +1 -0
- package/dist/contexts.d.ts +2 -1
- package/dist/contexts.js +2 -1
- package/dist/{errors-BpPfMo_4.js → errors-DJUxZg9b.js} +3 -2
- package/dist/{errors-BpPfMo_4.js.map → errors-DJUxZg9b.js.map} +1 -1
- package/dist/eval.d.ts +1 -1
- package/dist/eval.js +3 -3
- package/dist/{fetch-url-Cgbq-HYx.js → fetch-url-CWE8X5OD.js} +2 -2
- package/dist/{fetch-url-Cgbq-HYx.js.map → fetch-url-CWE8X5OD.js.map} +1 -1
- package/dist/{glob-DCWXy_tr.js → glob-D56-KpBp.js} +2 -12
- package/dist/glob-D56-KpBp.js.map +1 -0
- package/dist/glob-shell-rJMoCIGb.js +21 -0
- package/dist/glob-shell-rJMoCIGb.js.map +1 -0
- package/dist/{headless-C6Idunwh.js → headless-HAFnYaDY.js} +6 -6
- package/dist/{headless-C6Idunwh.js.map → headless-HAFnYaDY.js.map} +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/{index-BgB_425D.d.ts → index-Bzh-W2RD.d.ts} +26 -8
- package/dist/index-Bzh-W2RD.d.ts.map +1 -0
- package/dist/{index-BFY7mcar.d.ts → index-DuB7Cf02.d.ts} +2 -2
- package/dist/{index-BFY7mcar.d.ts.map → index-DuB7Cf02.d.ts.map} +1 -1
- package/dist/index-HQJDOWvo.d.ts +7 -0
- package/dist/index-HQJDOWvo.d.ts.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/{interpolate-ConAiXGy.js → interpolate-BtIgcCuz.js} +2 -2
- package/dist/{interpolate-ConAiXGy.js.map → interpolate-BtIgcCuz.js.map} +1 -1
- package/dist/{logger-LQmSBfD_.d.ts → logger-HOG4EGv6.d.ts} +2 -2
- package/dist/{logger-LQmSBfD_.d.ts.map → logger-HOG4EGv6.d.ts.map} +1 -1
- package/dist/{login-DE-_d045.js → login-CCA-1lgK.js} +2 -2
- package/dist/{login-DE-_d045.js.map → login-CCA-1lgK.js.map} +1 -1
- package/dist/{mcp-2OGi_NQu.js → mcp-Dn5W65Lv.js} +2 -2
- package/dist/{mcp-2OGi_NQu.js.map → mcp-Dn5W65Lv.js.map} +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{messages-U_87Z7GH.js → messages-FUqY3pci.js} +2 -2
- package/dist/{messages-U_87Z7GH.js.map → messages-FUqY3pci.js.map} +1 -1
- package/dist/output/stream-json.d.ts +2 -2
- package/dist/output/stream-json.js +1 -1
- package/dist/output/terminal.d.ts +2 -2
- package/dist/{presets-eC4VwuHh.js → presets-DDRkelUs.js} +2 -2
- package/dist/{presets-eC4VwuHh.js.map → presets-DDRkelUs.js.map} +1 -1
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +1 -1
- package/dist/{providers-DyMPTo51.js → providers-BPVOGmde.js} +13 -5
- package/dist/providers-BPVOGmde.js.map +1 -0
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +2 -2
- package/dist/restate.d.ts +38 -2
- package/dist/restate.d.ts.map +1 -1
- package/dist/restate.js +22 -0
- package/dist/restate.js.map +1 -1
- package/dist/{index-CF15aqlk.d.ts → sandbox-B-bMq3K6.d.ts} +2 -5
- package/dist/sandbox-B-bMq3K6.d.ts.map +1 -0
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/session/sqlite.js +1 -1
- package/dist/{session-DQ4bEncf.js → session-C0D4p0Gy.js} +2 -2
- package/dist/{session-DQ4bEncf.js.map → session-C0D4p0Gy.js.map} +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/session.js +2 -2
- package/dist/skills.d.ts +2 -2
- package/dist/skills.js +1 -1
- package/dist/{tool-formatters-DvtGhbJN.d.ts → tool-formatters-B4Ll4Xpz.d.ts} +2 -2
- package/dist/{tool-formatters-DvtGhbJN.d.ts.map → tool-formatters-B4Ll4Xpz.d.ts.map} +1 -1
- package/dist/tools/fetch-url.d.ts +1 -1
- package/dist/tools/fetch-url.js +1 -1
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/tools/web-search.js +2 -2
- package/dist/{tools-BvATiiCO.js → tools-BwqbsLcJ.js} +83 -26
- package/dist/tools-BwqbsLcJ.js.map +1 -0
- package/dist/tools.d.ts +2 -2
- package/dist/tools.js +1 -1
- package/dist/{transcript-anchors-DFmfOesU.d.ts → transcript-anchors-CRnGrkTd.d.ts} +4 -4
- package/dist/{transcript-anchors-DFmfOesU.d.ts.map → transcript-anchors-CRnGrkTd.d.ts.map} +1 -1
- package/dist/{transcript-anchors-Cn1Unhn-.js → transcript-anchors-dPvyuqmU.js} +9 -9
- package/dist/{transcript-anchors-Cn1Unhn-.js.map → transcript-anchors-dPvyuqmU.js.map} +1 -1
- package/dist/tui.d.ts +3 -3
- package/dist/tui.js +10 -10
- package/dist/tui.js.map +1 -1
- package/dist/{turn-operations-DWUN8cHo.d.ts → turn-operations-DYbhKmSu.d.ts} +3 -3
- package/dist/{turn-operations-DWUN8cHo.d.ts.map → turn-operations-DYbhKmSu.d.ts.map} +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/types.js +1 -1
- package/docs/ARCHITECTURE.md +2 -0
- package/docs/CHAT.md +3 -3
- package/docs/RESTATE.md +58 -0
- package/docs/SKILL.md +1 -0
- package/docs/TUI.md +1 -1
- package/package.json +6 -1
- package/dist/agent-NkKgz5Dh.d.ts.map +0 -1
- package/dist/contexts-DHi8LPCp.js.map +0 -1
- package/dist/glob-DCWXy_tr.js.map +0 -1
- package/dist/index-BgB_425D.d.ts.map +0 -1
- package/dist/index-CF15aqlk.d.ts.map +0 -1
- package/dist/providers-DyMPTo51.js.map +0 -1
- package/dist/tools-BvATiiCO.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { F as canonicalizePrompt, O as appendStaticSection, P as buildPromptMessage, R as fnv1aBase36, a as detectTurnInterruption, c as filterUnresolvedToolUses, d as remintDuplicateToolCallIds, f as resolveContentRefsInMessages, j as renderSystemForWire, n as SYNTHETIC_TOOL_RESULT_PLACEHOLDER, o as ensureEndsWithUserMessage, s as ensureToolResultPairing } from "./messages-
|
|
1
|
+
import { F as canonicalizePrompt, O as appendStaticSection, P as buildPromptMessage, R as fnv1aBase36, a as detectTurnInterruption, c as filterUnresolvedToolUses, d as remintDuplicateToolCallIds, f as resolveContentRefsInMessages, j as renderSystemForWire, n as SYNTHETIC_TOOL_RESULT_PLACEHOLDER, o as ensureEndsWithUserMessage, s as ensureToolResultPairing } from "./messages-FUqY3pci.js";
|
|
2
2
|
import { n as estimateTokens, r as utf8ByteLength } from "./utils-ngQzYzZD.js";
|
|
3
3
|
import { t as buildContextBreakdown } from "./context-breakdown-kO-pDsay.js";
|
|
4
4
|
import { a as formatTaskStatus, i as formatDuration, o as formatTaskSummary, s as previewLine } from "./format-BNOXpl-1.js";
|
|
5
|
-
import {
|
|
5
|
+
import { n as createProcessContext, t as resolveDetachedTasksCapability } from "./contexts-BebciJyQ.js";
|
|
6
6
|
import { a as toolOutputBudgetByteLength, i as documentBlockMarker, o as toolOutputByteLength, s as toolResultToText, t as DEFAULT_AGENT_CLOCK } from "./types-CyVGdbia.js";
|
|
7
7
|
import { i as styleReplacementForVia, n as resolveOldString, r as stripLineNumberPrefixes, t as describeVia } from "./edit-utils-EGosADZq.js";
|
|
8
8
|
import { a as markReadStateElided, n as getToolDedupState, o as readStateKey, r as hashContent, s as resolveReadStateMap, t as getReadState } from "./read-state-CLK9yVpm.js";
|
|
9
|
-
import { i as AgentProviderError, l as errorMessage, m as toTypedError, n as AgentBudgetExceededError, o as AgentToolPairingError, t as AgentAbortedError, u as isAbortLikeError } from "./errors-
|
|
9
|
+
import { i as AgentProviderError, l as errorMessage, m as toTypedError, n as AgentBudgetExceededError, o as AgentToolPairingError, t as AgentAbortedError, u as isAbortLikeError } from "./errors-DJUxZg9b.js";
|
|
10
10
|
import { n as reconcileImageMediaType } from "./media-sniff-Bn76JxAu.js";
|
|
11
11
|
import { n as writeFileAtomicAsync } from "./atomic-write-Bgtr5JPu.js";
|
|
12
|
-
import { S as escapeXml, d as buildCatalog, n as stripShellInterpolations, p as installAllowedToolsGate, r as resolveSkills, t as interpolateShellCommands, v as validateResourcePathReal, x as createSkillActivationState } from "./interpolate-
|
|
12
|
+
import { S as escapeXml, d as buildCatalog, n as stripShellInterpolations, p as installAllowedToolsGate, r as resolveSkills, t as interpolateShellCommands, v as validateResourcePathReal, x as createSkillActivationState } from "./interpolate-BtIgcCuz.js";
|
|
13
13
|
import { n as flattenTurns, r as formatTokenUsage, t as effectiveInputFromTurn } from "./stats-DAKBEKjc.js";
|
|
14
|
-
import { n as connectMcpServers, s as wrapDiscoveredMcpTools } from "./mcp-
|
|
14
|
+
import { n as connectMcpServers, s as wrapDiscoveredMcpTools } from "./mcp-Dn5W65Lv.js";
|
|
15
15
|
import { n as shellQuote, t as alwaysQuote } from "./shell-quote-BmnhZmdM.js";
|
|
16
16
|
import { isAbsolute, join, resolve } from "node:path";
|
|
17
17
|
import { createHooks } from "hookable";
|
|
@@ -927,8 +927,8 @@ function anchorPreviewFor(turn) {
|
|
|
927
927
|
*
|
|
928
928
|
* The turn's role is `'user'` so it sits at a conversational boundary
|
|
929
929
|
* the way the model expects. The caller is responsible for
|
|
930
|
-
* `session.appendTurns([turn])`. The id
|
|
931
|
-
* `
|
|
930
|
+
* `session.appendTurns([turn])`. The id defaults to `crypto.randomUUID()`
|
|
931
|
+
* (override via `input.id` for durable-execution replay stability).
|
|
932
932
|
*
|
|
933
933
|
* Typical use after running `compactConversation`:
|
|
934
934
|
*
|
|
@@ -946,7 +946,7 @@ function anchorPreviewFor(turn) {
|
|
|
946
946
|
function summaryToTurn(input) {
|
|
947
947
|
const compactedAt = input.compactedAt ?? Date.now();
|
|
948
948
|
return {
|
|
949
|
-
id: crypto.randomUUID(),
|
|
949
|
+
id: input.id ?? crypto.randomUUID(),
|
|
950
950
|
role: "user",
|
|
951
951
|
content: [{
|
|
952
952
|
type: "compact-summary",
|
|
@@ -1653,17 +1653,18 @@ async function buildPostCompactAttachments(opts) {
|
|
|
1653
1653
|
output: sc.body
|
|
1654
1654
|
});
|
|
1655
1655
|
}
|
|
1656
|
-
const
|
|
1656
|
+
const clock = opts.clock ?? DEFAULT_AGENT_CLOCK;
|
|
1657
|
+
const now = await clock.now();
|
|
1657
1658
|
const tag = opts.runId ? { runId: opts.runId } : {};
|
|
1658
1659
|
return {
|
|
1659
1660
|
turns: [{
|
|
1660
|
-
id:
|
|
1661
|
+
id: clock.randomUUID(),
|
|
1661
1662
|
role: "assistant",
|
|
1662
1663
|
content: assistantBlocks,
|
|
1663
1664
|
createdAt: now,
|
|
1664
1665
|
...tag
|
|
1665
1666
|
}, {
|
|
1666
|
-
id:
|
|
1667
|
+
id: clock.randomUUID(),
|
|
1667
1668
|
role: "user",
|
|
1668
1669
|
content: userBlocks,
|
|
1669
1670
|
createdAt: now + 1,
|
|
@@ -1676,6 +1677,8 @@ async function buildPostCompactAttachments(opts) {
|
|
|
1676
1677
|
}
|
|
1677
1678
|
//#endregion
|
|
1678
1679
|
//#region src/loop-persistence.ts
|
|
1680
|
+
/** Upper bound on the error message embedded in a persistence-failure stub. */
|
|
1681
|
+
const MAX_PERSIST_ERROR_CHARS = 500;
|
|
1679
1682
|
/**
|
|
1680
1683
|
* Bytes of head content included in the inline preview block. 2 KiB matches
|
|
1681
1684
|
* Claude Code's `PREVIEW_SIZE_BYTES` — enough for the model to identify the
|
|
@@ -1767,10 +1770,10 @@ function resolveMcpWarningsDir(opts) {
|
|
|
1767
1770
|
* routed write (`input.writeBlob`, e.g. a sandbox `writeFile`) is not atomic;
|
|
1768
1771
|
* see the field doc for why that's safe here.
|
|
1769
1772
|
*
|
|
1770
|
-
* `ToolResultContent[]` results
|
|
1771
|
-
*
|
|
1772
|
-
*
|
|
1773
|
-
*
|
|
1773
|
+
* Text-only `ToolResultContent[]` results are flattened and persisted as
|
|
1774
|
+
* text. Mixed structured content still bypasses persistence because the inline
|
|
1775
|
+
* image/document bytes are the point of the call and a mixed result is not
|
|
1776
|
+
* representable as a single `.txt` file without dropping media.
|
|
1774
1777
|
*/
|
|
1775
1778
|
async function maybePersistToolResult(input) {
|
|
1776
1779
|
if (!input.threshold || input.threshold <= 0) return {
|
|
@@ -1781,7 +1784,8 @@ async function maybePersistToolResult(input) {
|
|
|
1781
1784
|
kind: "skip",
|
|
1782
1785
|
reason: "excluded"
|
|
1783
1786
|
};
|
|
1784
|
-
|
|
1787
|
+
const persistableOutput = textForPersistence(input.output);
|
|
1788
|
+
if (persistableOutput === null) return {
|
|
1785
1789
|
kind: "skip",
|
|
1786
1790
|
reason: "unsupported-shape"
|
|
1787
1791
|
};
|
|
@@ -1793,26 +1797,34 @@ async function maybePersistToolResult(input) {
|
|
|
1793
1797
|
kind: "skip",
|
|
1794
1798
|
reason: "unsafe-call-id"
|
|
1795
1799
|
};
|
|
1796
|
-
const originalBytes = toolOutputByteLength(
|
|
1800
|
+
const originalBytes = toolOutputByteLength(persistableOutput);
|
|
1797
1801
|
if (originalBytes <= input.threshold) return {
|
|
1798
1802
|
kind: "skip",
|
|
1799
1803
|
reason: "under-threshold"
|
|
1800
1804
|
};
|
|
1801
1805
|
const persistedPath = join(input.persistDir, `${input.callId}.txt`);
|
|
1802
1806
|
try {
|
|
1803
|
-
await (input.writeBlob ?? writeAtomic)(persistedPath,
|
|
1807
|
+
await (input.writeBlob ?? writeAtomic)(persistedPath, persistableOutput);
|
|
1804
1808
|
} catch (err) {
|
|
1809
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
1805
1810
|
return {
|
|
1806
1811
|
kind: "error",
|
|
1807
1812
|
reason: "write-failed",
|
|
1808
|
-
error
|
|
1813
|
+
error,
|
|
1814
|
+
originalBytes,
|
|
1815
|
+
output: buildPersistenceUnavailableStub({
|
|
1816
|
+
toolName: input.toolName,
|
|
1817
|
+
originalBytes,
|
|
1818
|
+
output: persistableOutput,
|
|
1819
|
+
error
|
|
1820
|
+
})
|
|
1809
1821
|
};
|
|
1810
1822
|
}
|
|
1811
1823
|
const stub = buildPersistedStub({
|
|
1812
1824
|
toolName: input.toolName,
|
|
1813
1825
|
originalBytes,
|
|
1814
1826
|
persistedPath,
|
|
1815
|
-
output:
|
|
1827
|
+
output: persistableOutput
|
|
1816
1828
|
});
|
|
1817
1829
|
let evicted;
|
|
1818
1830
|
if (!input.writeBlob && typeof input.maxBytes === "number" && Number.isFinite(input.maxBytes) && input.maxBytes > 0) evicted = await enforcePersistDirCap(input.persistDir, input.maxBytes);
|
|
@@ -1937,6 +1949,25 @@ function buildPersistedStub(input) {
|
|
|
1937
1949
|
].join("\n");
|
|
1938
1950
|
}
|
|
1939
1951
|
/**
|
|
1952
|
+
* Render a bounded fallback when persistence was enabled but the blob write
|
|
1953
|
+
* failed. The full output is intentionally NOT kept inline: when this path
|
|
1954
|
+
* fires, preserving the context-window guarantee is more important than
|
|
1955
|
+
* recoverability of a failed best-effort spill.
|
|
1956
|
+
*/
|
|
1957
|
+
function buildPersistenceUnavailableStub(input) {
|
|
1958
|
+
const { slice: previewSlice, bytes: previewBytes } = sliceFirstBytes(input.output, PERSISTENCE_PREVIEW_BYTES);
|
|
1959
|
+
const previewMarker = previewSlice.length < input.output.length ? `\n…(${input.originalBytes - previewBytes} more bytes omitted because persistence failed)` : "";
|
|
1960
|
+
const reason = input.error.message.length > MAX_PERSIST_ERROR_CHARS ? `${input.error.message.slice(0, MAX_PERSIST_ERROR_CHARS)}…` : input.error.message;
|
|
1961
|
+
return [
|
|
1962
|
+
`<persisted-output-unavailable tool="${escapeXml(input.toolName)}" bytes="${input.originalBytes}" reason="write-failed">`,
|
|
1963
|
+
`Full output could not be saved to disk, so it was omitted from inline context. Error: ${escapeXml(reason)}`,
|
|
1964
|
+
"",
|
|
1965
|
+
"Preview:",
|
|
1966
|
+
`${previewSlice}${previewMarker}`,
|
|
1967
|
+
"</persisted-output-unavailable>"
|
|
1968
|
+
].join("\n");
|
|
1969
|
+
}
|
|
1970
|
+
/**
|
|
1940
1971
|
* Remove every persisted blob belonging to a session. Called by the chat
|
|
1941
1972
|
* layer from its session-delete path so closing a session frees the disk
|
|
1942
1973
|
* footprint alongside the SQLite row.
|
|
@@ -2074,6 +2105,15 @@ function sliceFirstBytes(text, cap) {
|
|
|
2074
2105
|
bytes
|
|
2075
2106
|
};
|
|
2076
2107
|
}
|
|
2108
|
+
function textForPersistence(output) {
|
|
2109
|
+
if (typeof output === "string") return output;
|
|
2110
|
+
const parts = [];
|
|
2111
|
+
for (const block of output) {
|
|
2112
|
+
if (block.type !== "text") return null;
|
|
2113
|
+
parts.push(block.text);
|
|
2114
|
+
}
|
|
2115
|
+
return parts.join("\n");
|
|
2116
|
+
}
|
|
2077
2117
|
//#endregion
|
|
2078
2118
|
//#region src/tools/validation.ts
|
|
2079
2119
|
const TRUE_STRINGS = new Set([
|
|
@@ -3688,7 +3728,9 @@ async function maybeAutoCompact(ctx, turn, lastTurnUsage, state) {
|
|
|
3688
3728
|
summary: result.summary,
|
|
3689
3729
|
replacesTurnIds: result.summarizedTurnIds,
|
|
3690
3730
|
model: result.model,
|
|
3691
|
-
usage: result.usage
|
|
3731
|
+
usage: result.usage,
|
|
3732
|
+
compactedAt: await ctx.clock.now(),
|
|
3733
|
+
id: ctx.clock.randomUUID()
|
|
3692
3734
|
});
|
|
3693
3735
|
let restoredFiles = 0;
|
|
3694
3736
|
let restoredSkills = 0;
|
|
@@ -3701,6 +3743,7 @@ async function maybeAutoCompact(ctx, turn, lastTurnUsage, state) {
|
|
|
3701
3743
|
execution: ctx.execution,
|
|
3702
3744
|
handle: ctx.handle,
|
|
3703
3745
|
signal: ctx.signal,
|
|
3746
|
+
clock: ctx.clock,
|
|
3704
3747
|
...ctx.runId ? { runId: ctx.runId } : {}
|
|
3705
3748
|
});
|
|
3706
3749
|
restorationTurns = built.turns;
|
|
@@ -4705,7 +4748,10 @@ async function emitToolResult(ctx, params) {
|
|
|
4705
4748
|
writeBlob: executionBlobWriter(ctx)
|
|
4706
4749
|
});
|
|
4707
4750
|
if (outcome.kind === "persisted") output = outcome.output;
|
|
4708
|
-
else if (outcome.kind === "error"
|
|
4751
|
+
else if (outcome.kind === "error") {
|
|
4752
|
+
if (process.env.ZIDANE_DEBUG) process.stderr.write(`[zidane/loop] persistence write failed for ${name}/${callId}: ${outcome.error.message}\n`);
|
|
4753
|
+
output = outcome.output;
|
|
4754
|
+
}
|
|
4709
4755
|
}
|
|
4710
4756
|
output = stripImagesForNonVision(ctx.provider, output);
|
|
4711
4757
|
await ctx.hooks.callHook("tool:after", {
|
|
@@ -7026,6 +7072,7 @@ const HOOK_EVENT_SET = new Set([
|
|
|
7026
7072
|
"background:reassign",
|
|
7027
7073
|
"background:stall",
|
|
7028
7074
|
"background:reconcile",
|
|
7075
|
+
"execution:ready",
|
|
7029
7076
|
"skills:resolve",
|
|
7030
7077
|
"skills:catalog",
|
|
7031
7078
|
"skills:activate",
|
|
@@ -7390,7 +7437,7 @@ function validateAndPrepareResume(session, prompt, hasPendingTaskNotifications =
|
|
|
7390
7437
|
}
|
|
7391
7438
|
return resumeFilteredTurns;
|
|
7392
7439
|
}
|
|
7393
|
-
function createAgent({ provider, name: agentName, system: agentSystem, tools: agentTools, toolAliases, behavior: agentBehavior, execution, mcpServers, session, readState: agentReadState, skills: agentSkills, mcpConnector, mcpToolWrap, eager, hooks: initialHooks, clock: agentClock, toolKill }) {
|
|
7440
|
+
function createAgent({ provider, name: agentName, system: agentSystem, tools: agentTools, toolAliases, behavior: agentBehavior, execution, handle: injectedHandle, mcpServers, session, readState: agentReadState, skills: agentSkills, mcpConnector, mcpToolWrap, eager, hooks: initialHooks, clock: agentClock, toolKill }) {
|
|
7394
7441
|
const hooks = createHooks();
|
|
7395
7442
|
const executionContext = execution ?? createProcessContext();
|
|
7396
7443
|
const sourceTools = agentTools ?? {};
|
|
@@ -7417,7 +7464,9 @@ function createAgent({ provider, name: agentName, system: agentSystem, tools: ag
|
|
|
7417
7464
|
const pendingStallNotifications = /* @__PURE__ */ new Map();
|
|
7418
7465
|
const notifiedTaskIds = /* @__PURE__ */ new Set();
|
|
7419
7466
|
const toolCancels = createToolCancelRegistry(toolKill?.defaultMessage !== void 0 ? { defaultMessage: toolKill.defaultMessage } : {});
|
|
7420
|
-
let executionHandle = null;
|
|
7467
|
+
let executionHandle = injectedHandle ?? null;
|
|
7468
|
+
const executionHandleInjected = injectedHandle !== void 0;
|
|
7469
|
+
let executionReadyFired = false;
|
|
7421
7470
|
let mcpConnection = null;
|
|
7422
7471
|
let lastContextAssembly = null;
|
|
7423
7472
|
let mcpWarmupPromise = null;
|
|
@@ -7548,6 +7597,7 @@ function createAgent({ provider, name: agentName, system: agentSystem, tools: ag
|
|
|
7548
7597
|
perRunUnregisters.push(hooks.hook(event, fn));
|
|
7549
7598
|
}
|
|
7550
7599
|
}
|
|
7600
|
+
const spawnedThisCall = !executionHandle;
|
|
7551
7601
|
if (!executionHandle) {
|
|
7552
7602
|
const spawnTimeoutMs = resolveTimeoutMs(resolvedBehavior.spawnTimeoutMs, DEFAULT_SPAWN_TIMEOUT_MS, resolvedBehavior.maxWallMs);
|
|
7553
7603
|
executionHandle = await withTimeout(executionContext.spawn(), {
|
|
@@ -7556,6 +7606,13 @@ function createAgent({ provider, name: agentName, system: agentSystem, tools: ag
|
|
|
7556
7606
|
message: `Execution context spawn timed out after ${spawnTimeoutMs}ms (configurable via \`spawnTimeoutMs\`).`
|
|
7557
7607
|
});
|
|
7558
7608
|
}
|
|
7609
|
+
if (!executionReadyFired) {
|
|
7610
|
+
executionReadyFired = true;
|
|
7611
|
+
await hooks.callHook("execution:ready", {
|
|
7612
|
+
handle: executionHandle,
|
|
7613
|
+
spawned: spawnedThisCall
|
|
7614
|
+
});
|
|
7615
|
+
}
|
|
7559
7616
|
if (allMcpServers.length > 0 && !mcpConnection) await warmup({
|
|
7560
7617
|
mcpConnectTimeoutMs: resolvedBehavior.mcpConnectTimeoutMs,
|
|
7561
7618
|
maxWallMs: resolvedBehavior.maxWallMs
|
|
@@ -8318,7 +8375,7 @@ function createAgent({ provider, name: agentName, system: agentSystem, tools: ag
|
|
|
8318
8375
|
await settleWithinTimeout("destroy: mcp close", mcpConnection.close(), destroyTimeoutMs);
|
|
8319
8376
|
mcpConnection = null;
|
|
8320
8377
|
}
|
|
8321
|
-
if (executionHandle) {
|
|
8378
|
+
if (executionHandle && !executionHandleInjected) {
|
|
8322
8379
|
await settleWithinTimeout("destroy: execution destroy", executionContext.destroy(executionHandle), destroyTimeoutMs);
|
|
8323
8380
|
executionHandle = null;
|
|
8324
8381
|
}
|
|
@@ -10199,4 +10256,4 @@ const writeFile$1 = {
|
|
|
10199
10256
|
//#endregion
|
|
10200
10257
|
export { sliceForCompaction as $, PERSISTED_STUB_PREFIX as A, selectFilesFromSession as B, normalizeShellCommand as C, TOOL_USE_CANCELLED_MESSAGE as D, SHELL_CASCADE_CANCEL_MESSAGE as E, resolveMcpWarningsDir as F, TRAILER as G, compactConversation as H, resolvePersistDir as I, buildFullCompactPrompt as J, buildCompactPrompt as K, resolveTasksDir as L, buildPersistedStub as M, cleanupPersistedSession as N, TOOL_USE_SKIPPED_MESSAGE as O, maybePersistToolResult as P, anchorPreviewFor as Q, buildPostCompactAttachments as R, defaultRepeatGuardTracked as S, INTERRUPT_MESSAGE_FOR_TOOL_USE as T, BASE_INSTRUCTIONS as U, selectRecentFiles as V, NO_TOOLS_PREAMBLE as W, buildUpToCompactPrompt as X, buildTailCompactPrompt as Y, ANCHOR_PREVIEW_MAX_CHARS as Z, createSkillsReadTool as _, multiEdit as a, OperationTimeoutError as at, tailTruncate as b, grep as c, OUTPUT_RESERVE_TOKENS as ct, createAgent as d, stripImagesFromTurns as et, WAIT_TASK_TIMED_OUT_PREFIX as f, createSkillsRunScriptTool as g, createSkillsUseTool as h, readFile$1 as i, CompactPromptTooLongError as it, PERSISTENCE_PREVIEW_BYTES as j, validateToolArgs as k, glob as l, effectiveContextWindow as lt, createToolSearchTool as m, createSpawnTool as n, truncateHeadForPtlRetry as nt, listFiles as o, withTimeout as ot, waitTask as p, buildFromCompactPrompt as q, shellKill as r, CompactInvalidInputError as rt, createInteractionTool as s, AUTO_COMPACT_MIN_GROWTH_FRACTION as st, writeFile$1 as t, summaryToTurn as tt, edit as u, shouldAutoCompact as ut, createShellTool as v, stableStringify as w, defaultRepeatGuardNormalize as x, shell as y, selectFilesFromReadState as z };
|
|
10201
10258
|
|
|
10202
|
-
//# sourceMappingURL=tools-
|
|
10259
|
+
//# sourceMappingURL=tools-BwqbsLcJ.js.map
|