zidane 6.6.3 → 7.0.0
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-BQqhozmt.js → acp-Wr8l4IDI.js} +7 -180
- package/dist/acp-Wr8l4IDI.js.map +1 -0
- package/dist/acp-cli.js +6 -6
- package/dist/acp.d.ts +1 -1
- package/dist/acp.d.ts.map +1 -1
- package/dist/acp.js +2 -1
- package/dist/{agent-DTxH7RHW.js → agent-C-camKQW.js} +162 -12
- package/dist/agent-C-camKQW.js.map +1 -0
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/{anthropic-DRNRnd6W.js → anthropic-BDOGzhtj.js} +3 -3
- package/dist/{anthropic-DRNRnd6W.js.map → anthropic-BDOGzhtj.js.map} +1 -1
- package/dist/{transcript-anchors-BjH-68k2.js → approvals-CqqxE5Vh.js} +4924 -275
- package/dist/approvals-CqqxE5Vh.js.map +1 -0
- package/dist/{auth-7rv6ZfWk.js → auth-BdwDROYg.js} +12 -8
- package/dist/{auth-7rv6ZfWk.js.map → auth-BdwDROYg.js.map} +1 -1
- package/dist/chat/pure.d.ts +221 -4
- package/dist/chat/pure.d.ts.map +1 -0
- package/dist/chat/pure.js +4 -2
- package/dist/chat.d.ts +6 -2911
- package/dist/chat.js +8 -261
- package/dist/{context-transport-D8yeGdpd.js → context-transport-BqYwzJYE.js} +2 -2
- package/dist/{context-transport-D8yeGdpd.js.map → context-transport-BqYwzJYE.js.map} +1 -1
- package/dist/contexts/daytona.d.ts +2 -1
- package/dist/contexts/daytona.d.ts.map +1 -1
- package/dist/contexts/daytona.js +14 -3
- package/dist/contexts/daytona.js.map +1 -1
- package/dist/contexts/e2b.d.ts +1 -1
- package/dist/contexts/e2b.js +1 -1
- package/dist/daemon-cli.d.ts +1 -0
- package/dist/daemon-cli.js +90 -0
- package/dist/daemon-cli.js.map +1 -0
- package/dist/eval.d.ts +1 -1
- package/dist/eval.js +1 -1
- package/dist/extensions.d.ts +2 -2
- package/dist/extensions.js +2 -2
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +4 -4
- package/dist/{index-D0O-QO7Z.d.ts → index-B-FSaM3_.d.ts} +2863 -2375
- package/dist/index-B-FSaM3_.d.ts.map +1 -0
- package/dist/index-DgdzXRPH.d.ts +3590 -0
- package/dist/index-DgdzXRPH.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -1179
- package/dist/ipc-CIv87xuH.js +331 -0
- package/dist/ipc-CIv87xuH.js.map +1 -0
- package/dist/ipc.d.ts +849 -0
- package/dist/ipc.d.ts.map +1 -0
- package/dist/ipc.js +4 -0
- package/dist/json-rpc-rSWMUh9b.js +192 -0
- package/dist/json-rpc-rSWMUh9b.js.map +1 -0
- package/dist/{logger-DBX9uYOw.js → logger--C1VQjwJ.js} +3 -13
- package/dist/logger--C1VQjwJ.js.map +1 -0
- package/dist/logs-view-CWG8aUAG.js +44 -0
- package/dist/logs-view-CWG8aUAG.js.map +1 -0
- package/dist/{mcp-CVtSQTWg.js → mcp-BIWa57eY.js} +3 -3
- package/dist/{mcp-CVtSQTWg.js.map → mcp-BIWa57eY.js.map} +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{messages-CZMUuKzo.js → messages-21XfHxyF.js} +3 -3
- package/dist/{messages-CZMUuKzo.js.map → messages-21XfHxyF.js.map} +1 -1
- package/dist/{openai-compat-BoTi-9fd.js → openai-compat-DY-AKxCg.js} +2 -2
- package/dist/{openai-compat-BoTi-9fd.js.map → openai-compat-DY-AKxCg.js.map} +1 -1
- package/dist/output/stream-json.d.ts +1 -1
- package/dist/output/terminal.d.ts +1 -1
- package/dist/{plugins-onDvTHEm.js → plugins-B531Tz5b.js} +2 -2
- package/dist/{plugins-onDvTHEm.js.map → plugins-B531Tz5b.js.map} +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +1 -1
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/anthropic.js +1 -1
- package/dist/providers/arcee.d.ts +1 -1
- package/dist/providers/arcee.js +1 -1
- package/dist/providers/baseten.d.ts +1 -1
- package/dist/providers/baseten.js +1 -1
- package/dist/providers/cerebras.d.ts +1 -1
- package/dist/providers/cerebras.js +1 -1
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/local.js +1 -1
- package/dist/providers/openai-compat.d.ts +1 -1
- package/dist/providers/openai-compat.js +1 -1
- package/dist/providers/openai.d.ts +1 -1
- package/dist/providers/openai.js +3 -3
- package/dist/providers/openrouter.d.ts +1 -1
- package/dist/providers/openrouter.js +1 -1
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers/xai.js +1 -1
- package/dist/{providers-CmhdtD7w.js → providers-DX91jwir.js} +2 -2
- package/dist/{providers-CmhdtD7w.js.map → providers-DX91jwir.js.map} +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +3 -3
- package/dist/restate.d.ts +1 -1
- package/dist/restate.js +8 -8
- package/dist/restate.js.map +1 -1
- package/dist/server-DJqp9dIR.js +1317 -0
- package/dist/server-DJqp9dIR.js.map +1 -0
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/session/sqlite.d.ts.map +1 -1
- package/dist/session/sqlite.js +42 -4
- package/dist/session/sqlite.js.map +1 -1
- package/dist/{session-CyRLSsVa.js → session-K3icbPH9.js} +8 -2
- package/dist/session-K3icbPH9.js.map +1 -0
- package/dist/session.d.ts +1 -1
- package/dist/session.js +2 -2
- package/dist/{skills-BMGH_KK1.js → skills-PJyiSRCp.js} +3 -21
- package/dist/skills-PJyiSRCp.js.map +1 -0
- package/dist/skills.d.ts +1 -1
- package/dist/skills.js +1 -1
- package/dist/src-DzzhE2YO.js +2461 -0
- package/dist/src-DzzhE2YO.js.map +1 -0
- package/dist/todo-edits-Dw2oO2ON.js +378 -0
- package/dist/todo-edits-Dw2oO2ON.js.map +1 -0
- package/dist/{tool-formatters-NrzD6Fkk.d.ts → tool-formatters-DO56YBBw.d.ts} +104 -4
- package/dist/tool-formatters-DO56YBBw.d.ts.map +1 -0
- package/dist/tools/fetch-url.d.ts +1 -1
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +1 -1
- package/dist/{transcript-anchors-UhC58Tmj.d.ts → transcript-anchors-DXqWWGbq.d.ts} +53 -4
- package/dist/transcript-anchors-DXqWWGbq.d.ts.map +1 -0
- package/dist/tui.d.ts +94 -13
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +2241 -1009
- package/dist/tui.js.map +1 -1
- package/dist/{turn-operations-mMxDRgLY.js → turn-operations-CZLsNgw-.js} +896 -11
- package/dist/turn-operations-CZLsNgw-.js.map +1 -0
- package/dist/{turn-operations-Cuc9pwiB.d.ts → turn-operations-DKFYWP3O.d.ts} +501 -4
- package/dist/turn-operations-DKFYWP3O.d.ts.map +1 -0
- package/dist/{types-BIarq1qE.js → types-CWgENVLY.js} +24 -2
- package/dist/types-CWgENVLY.js.map +1 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/xml-D5HBhJle.js +22 -0
- package/dist/xml-D5HBhJle.js.map +1 -0
- package/docs/CHAT.md +39 -0
- package/docs/IPC.md +420 -0
- package/docs/TUI.md +62 -0
- package/package.json +8 -2
- package/dist/acp-BQqhozmt.js.map +0 -1
- package/dist/agent-DTxH7RHW.js.map +0 -1
- package/dist/chat.d.ts.map +0 -1
- package/dist/chat.js.map +0 -1
- package/dist/index-D0O-QO7Z.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inline-autocomplete-D0MPvBaS.js +0 -596
- package/dist/inline-autocomplete-D0MPvBaS.js.map +0 -1
- package/dist/logger-DBX9uYOw.js.map +0 -1
- package/dist/login-CB23LyI1.js +0 -707
- package/dist/login-CB23LyI1.js.map +0 -1
- package/dist/session-CyRLSsVa.js.map +0 -1
- package/dist/skills-BMGH_KK1.js.map +0 -1
- package/dist/tool-formatters-NrzD6Fkk.d.ts.map +0 -1
- package/dist/transcript-anchors-BjH-68k2.js.map +0 -1
- package/dist/transcript-anchors-UhC58Tmj.d.ts.map +0 -1
- package/dist/turn-operations-Cuc9pwiB.d.ts.map +0 -1
- package/dist/turn-operations-mMxDRgLY.js.map +0 -1
- package/dist/types-BIarq1qE.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as rewriteMessagesToWire, H as toWireName, I as augmentMcpDoubleUnderscoreAliases, L as buildAliasMaps, M as buildPromptMessage, N as canonicalizePrompt, R as buildSanitizedWireAliases, V as toCanonicalName, z as rewriteContentToCanonical } from "./openai-compat-
|
|
2
|
-
import { a as
|
|
1
|
+
import { B as rewriteMessagesToWire, H as toWireName, I as augmentMcpDoubleUnderscoreAliases, L as buildAliasMaps, M as buildPromptMessage, N as canonicalizePrompt, R as buildSanitizedWireAliases, V as toCanonicalName, z as rewriteContentToCanonical } from "./openai-compat-DY-AKxCg.js";
|
|
2
|
+
import { a as documentBlockMarker, c as toolOutputBudgetByteLength, l as toolOutputByteLength, o as isWireTurn, s as sanitizeToolResultMetadata, t as DEFAULT_AGENT_CLOCK, u as toolResultToText } from "./types-CWgENVLY.js";
|
|
3
3
|
import { a as stripLineNumberPrefixes, i as resolveOldString, n as buildContextBreakdown, o as styleReplacementForVia, r as describeVia, t as buildContextSegments } from "./context-segments-CJCtJ9sU.js";
|
|
4
4
|
import { n as estimateTokens, r as utf8ByteLength } from "./utils-ngQzYzZD.js";
|
|
5
5
|
import { a as formatDuration, c as previewLine, o as formatTaskStatus, s as formatTaskSummary } from "./format-BF745pLL.js";
|
|
@@ -8,15 +8,16 @@ import { i as isOutputExceededMessage } from "./output-cap-C9zukcCj.js";
|
|
|
8
8
|
import { r as createProcessContext, t as resolveDetachedTasksCapability } from "./contexts-BSFQVclW.js";
|
|
9
9
|
import { n as shellQuote, t as alwaysQuote } from "./shell-quote-BmnhZmdM.js";
|
|
10
10
|
import { a as AgentProviderError, d as isAbortLikeError, g as toTypedError, i as AgentLengthResumeExhaustedError, n as AgentBudgetExceededError, p as isTransientTransportError, s as AgentToolPairingError, t as AgentAbortedError, u as errorMessage } from "./errors-DKiMrOKq.js";
|
|
11
|
-
import {
|
|
11
|
+
import { E as buildCatalog, L as projectUserPaths, O as installAllowedToolsGate, P as validateResourcePathReal, _ as lastLine, a as interpolateShellCommands, b as resolveSubdirRoot, g as fetchInstallSource, h as defaultWhich, k as createSkillActivationState, m as defaultExec, n as resolveSkills, o as stripShellInterpolations, p as InstallSourceError, v as parseInstallSource, y as resolveNpmVersion } from "./skills-PJyiSRCp.js";
|
|
12
12
|
import { n as writeFileAtomicAsync, t as writeFileAtomic } from "./atomic-write-B7zr1ddF.js";
|
|
13
|
-
import { p as resolveStorageDirs, r as loadAgentPlugin } from "./plugins-
|
|
14
|
-
import { r as createLogger, t as consoleSink } from "./logger
|
|
13
|
+
import { p as resolveStorageDirs, r as loadAgentPlugin } from "./plugins-B531Tz5b.js";
|
|
14
|
+
import { r as createLogger, t as consoleSink } from "./logger--C1VQjwJ.js";
|
|
15
|
+
import { t as escapeXml } from "./xml-D5HBhJle.js";
|
|
15
16
|
import { n as reconcileImageMediaType } from "./media-sniff-UKijEaiQ.js";
|
|
16
|
-
import { f as wrapDiscoveredMcpTools, i as deriveMcpToolMeta, n as connectMcpServers, s as nonOwningMcpView } from "./mcp-
|
|
17
|
+
import { f as wrapDiscoveredMcpTools, i as deriveMcpToolMeta, n as connectMcpServers, s as nonOwningMcpView } from "./mcp-BIWa57eY.js";
|
|
17
18
|
import { appendStaticSection, renderSystemForWire } from "./prompt.js";
|
|
18
|
-
import { a as detectTurnInterruption, c as ensureToolResultPairing, l as filterUnresolvedToolUses, m as resolveContentRefsInMessages, n as SYNTHETIC_TOOL_RESULT_PLACEHOLDER, p as remintDuplicateToolCallIds, s as ensureEndsWithUserMessage } from "./messages-
|
|
19
|
-
import { a as getExtensionSessionState, c as setExtensionSessionState, l as withExtensionSession, n as currentExtensionSession, r as deleteExtensionSessionState, s as resumeChainRunIds } from "./session-
|
|
19
|
+
import { a as detectTurnInterruption, c as ensureToolResultPairing, l as filterUnresolvedToolUses, m as resolveContentRefsInMessages, n as SYNTHETIC_TOOL_RESULT_PLACEHOLDER, p as remintDuplicateToolCallIds, s as ensureEndsWithUserMessage } from "./messages-21XfHxyF.js";
|
|
20
|
+
import { a as getExtensionSessionState, c as setExtensionSessionState, l as withExtensionSession, n as currentExtensionSession, r as deleteExtensionSessionState, s as resumeChainRunIds } from "./session-K3icbPH9.js";
|
|
20
21
|
import { n as flattenTurns, r as formatTokenUsage, t as effectiveInputFromTurn } from "./stats-DAKBEKjc.js";
|
|
21
22
|
import { a as settleWithinTimeout, i as resolveTimeoutMs, n as abortableSleep, o as withInactivityTimeout, r as linkAbortSignal, s as withTimeout$1, t as OperationTimeoutError } from "./timeout-CjOG2mea.js";
|
|
22
23
|
import { createRequire } from "node:module";
|
|
@@ -1464,6 +1465,129 @@ function shouldAutoCompact(input) {
|
|
|
1464
1465
|
};
|
|
1465
1466
|
}
|
|
1466
1467
|
//#endregion
|
|
1468
|
+
//#region src/extensions/bus.ts
|
|
1469
|
+
/** Serialized-payload cap, enforced at emit AND at the daemon trust boundary. */
|
|
1470
|
+
const EXTENSION_BUS_MAX_PAYLOAD_BYTES = 64 * 1024;
|
|
1471
|
+
/** Last-seen seq window per extension — bounds dedupe memory. */
|
|
1472
|
+
const SEEN_WINDOW = 128;
|
|
1473
|
+
/** Byte length of the JSON serialization, or `null` when not serializable. */
|
|
1474
|
+
function serializedPayloadBytes(payload) {
|
|
1475
|
+
let text;
|
|
1476
|
+
try {
|
|
1477
|
+
text = JSON.stringify(payload);
|
|
1478
|
+
} catch {
|
|
1479
|
+
return null;
|
|
1480
|
+
}
|
|
1481
|
+
if (typeof text !== "string") return null;
|
|
1482
|
+
return Buffer.byteLength(text, "utf8");
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Dedupe key for one envelope. Nonce-stamped envelopes key on
|
|
1486
|
+
* `(nonce, seq)`; nonce-less ones (older peers) on seq alone — the nonced
|
|
1487
|
+
* key always contains a `:` and a stringified seq never does, so the two
|
|
1488
|
+
* namespaces can't collide.
|
|
1489
|
+
*/
|
|
1490
|
+
function seenKey(nonce, seq) {
|
|
1491
|
+
return nonce === void 0 ? String(seq) : `${nonce}:${seq}`;
|
|
1492
|
+
}
|
|
1493
|
+
function createExtensionBus() {
|
|
1494
|
+
const channels = /* @__PURE__ */ new Map();
|
|
1495
|
+
const emitListeners = /* @__PURE__ */ new Set();
|
|
1496
|
+
const nonce = crypto.randomUUID();
|
|
1497
|
+
function markSeen(state, key) {
|
|
1498
|
+
state.seenSet.add(key);
|
|
1499
|
+
state.seenOrder.push(key);
|
|
1500
|
+
while (state.seenOrder.length > SEEN_WINDOW) {
|
|
1501
|
+
const evicted = state.seenOrder.shift();
|
|
1502
|
+
if (evicted !== void 0) state.seenSet.delete(evicted);
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
function fanOut(state, msg) {
|
|
1506
|
+
for (const fn of [...state.subscribers]) try {
|
|
1507
|
+
fn(msg);
|
|
1508
|
+
} catch {}
|
|
1509
|
+
}
|
|
1510
|
+
return {
|
|
1511
|
+
claim(extensionId) {
|
|
1512
|
+
let state = channels.get(extensionId);
|
|
1513
|
+
if (state) {
|
|
1514
|
+
state.generation += 1;
|
|
1515
|
+
state.subscribers = /* @__PURE__ */ new Set();
|
|
1516
|
+
} else {
|
|
1517
|
+
state = {
|
|
1518
|
+
generation: 0,
|
|
1519
|
+
subscribers: /* @__PURE__ */ new Set(),
|
|
1520
|
+
seenOrder: [],
|
|
1521
|
+
seenSet: /* @__PURE__ */ new Set(),
|
|
1522
|
+
nextSeq: Math.floor(Math.random() * 2147483647)
|
|
1523
|
+
};
|
|
1524
|
+
channels.set(extensionId, state);
|
|
1525
|
+
}
|
|
1526
|
+
const generation = state.generation;
|
|
1527
|
+
const live = () => channels.get(extensionId)?.generation === generation;
|
|
1528
|
+
return {
|
|
1529
|
+
emit(payload, opts) {
|
|
1530
|
+
if (!live()) return false;
|
|
1531
|
+
const bytes = serializedPayloadBytes(payload);
|
|
1532
|
+
if (bytes === null || bytes > 65536) return false;
|
|
1533
|
+
const current = channels.get(extensionId);
|
|
1534
|
+
const seq = current.nextSeq++;
|
|
1535
|
+
markSeen(current, seenKey(nonce, seq));
|
|
1536
|
+
const sessionId = typeof opts?.sessionId === "string" ? opts.sessionId : void 0;
|
|
1537
|
+
fanOut(current, {
|
|
1538
|
+
payload,
|
|
1539
|
+
...sessionId !== void 0 ? { sessionId } : {},
|
|
1540
|
+
origin: "local"
|
|
1541
|
+
});
|
|
1542
|
+
const envelope = {
|
|
1543
|
+
extensionId,
|
|
1544
|
+
...sessionId !== void 0 ? { sessionId } : {},
|
|
1545
|
+
payload,
|
|
1546
|
+
seq,
|
|
1547
|
+
nonce
|
|
1548
|
+
};
|
|
1549
|
+
for (const fn of [...emitListeners]) try {
|
|
1550
|
+
fn(envelope);
|
|
1551
|
+
} catch {}
|
|
1552
|
+
return true;
|
|
1553
|
+
},
|
|
1554
|
+
onMessage(fn) {
|
|
1555
|
+
if (!live() || typeof fn !== "function") return () => {};
|
|
1556
|
+
channels.get(extensionId).subscribers.add(fn);
|
|
1557
|
+
return () => {
|
|
1558
|
+
channels.get(extensionId)?.subscribers.delete(fn);
|
|
1559
|
+
};
|
|
1560
|
+
},
|
|
1561
|
+
close() {
|
|
1562
|
+
if (live()) channels.get(extensionId).subscribers.clear();
|
|
1563
|
+
}
|
|
1564
|
+
};
|
|
1565
|
+
},
|
|
1566
|
+
deliver(envelope) {
|
|
1567
|
+
const state = channels.get(envelope.extensionId);
|
|
1568
|
+
if (!state) return false;
|
|
1569
|
+
const key = seenKey(envelope.nonce, envelope.seq);
|
|
1570
|
+
if (state.seenSet.has(key)) {
|
|
1571
|
+
if (process.env.ZIDANE_DEBUG) process.stderr.write(`[zidane/extensions] bus dedupe drop: ${envelope.extensionId} key=${key}\n`);
|
|
1572
|
+
return false;
|
|
1573
|
+
}
|
|
1574
|
+
markSeen(state, key);
|
|
1575
|
+
fanOut(state, {
|
|
1576
|
+
payload: envelope.payload,
|
|
1577
|
+
...envelope.sessionId !== void 0 ? { sessionId: envelope.sessionId } : {},
|
|
1578
|
+
origin: "remote"
|
|
1579
|
+
});
|
|
1580
|
+
return true;
|
|
1581
|
+
},
|
|
1582
|
+
onEmit(fn) {
|
|
1583
|
+
emitListeners.add(fn);
|
|
1584
|
+
return () => {
|
|
1585
|
+
emitListeners.delete(fn);
|
|
1586
|
+
};
|
|
1587
|
+
}
|
|
1588
|
+
};
|
|
1589
|
+
}
|
|
1590
|
+
//#endregion
|
|
1467
1591
|
//#region src/extensions/config.ts
|
|
1468
1592
|
/**
|
|
1469
1593
|
* Exhaustiveness guard for the `ExtensionConfigItem` union: a future item
|
|
@@ -2318,6 +2442,13 @@ const KEYBINDING_DEFS = [
|
|
|
2318
2442
|
description: "open the context-usage breakdown (what is taking up the context window)",
|
|
2319
2443
|
group: "Global"
|
|
2320
2444
|
},
|
|
2445
|
+
{
|
|
2446
|
+
action: "openMainSession",
|
|
2447
|
+
default: "ctrl+u",
|
|
2448
|
+
label: "Jump to main session",
|
|
2449
|
+
description: "jump to (or lazily create) the pinned \"Main\" orchestration session for the current directory; requires the \"Main session (orchestration)\" and \"Use daemon runtime\" settings",
|
|
2450
|
+
group: "Global"
|
|
2451
|
+
},
|
|
2321
2452
|
{
|
|
2322
2453
|
action: "openUsagePanel",
|
|
2323
2454
|
default: "ctrl+p",
|
|
@@ -6832,6 +6963,13 @@ async function buildExtensionRegistry(loaded, options = {}) {
|
|
|
6832
6963
|
const candidates = [];
|
|
6833
6964
|
/** Generation-scoped HUD writers, cleared (guarded) at dispose. */
|
|
6834
6965
|
const hudWriters = [];
|
|
6966
|
+
/**
|
|
6967
|
+
* Bus channels claimed by THIS build (`'ipc'`-permitted extensions only),
|
|
6968
|
+
* closed at dispose so a retired generation's subscribers are dropped.
|
|
6969
|
+
* Without a host-supplied bus, a build-local one keeps loopback working.
|
|
6970
|
+
*/
|
|
6971
|
+
const bus = options.bus ?? createExtensionBus();
|
|
6972
|
+
const busChannels = [];
|
|
6835
6973
|
const extensionNameOwners = /* @__PURE__ */ new Set();
|
|
6836
6974
|
for (const entry of loaded) {
|
|
6837
6975
|
if (extensionNameOwners.has(entry.name)) {
|
|
@@ -6893,6 +7031,8 @@ async function buildExtensionRegistry(loaded, options = {}) {
|
|
|
6893
7031
|
const abort = new AbortController();
|
|
6894
7032
|
const hudWriter = isDisabled ? void 0 : options.hud?.claim(entry.name);
|
|
6895
7033
|
if (hudWriter) hudWriters.push(hudWriter);
|
|
7034
|
+
const busChannel = !isDisabled && entry.definition.permissions?.includes("ipc") ? bus.claim(entry.name) : void 0;
|
|
7035
|
+
if (busChannel) busChannels.push(busChannel);
|
|
6896
7036
|
const ctx = makeContext({
|
|
6897
7037
|
definition: entry.definition,
|
|
6898
7038
|
source: entry.source,
|
|
@@ -6904,6 +7044,7 @@ async function buildExtensionRegistry(loaded, options = {}) {
|
|
|
6904
7044
|
disabled: isDisabled,
|
|
6905
7045
|
...options.readSettings !== void 0 ? { readSettings: options.readSettings } : {},
|
|
6906
7046
|
...hudWriter !== void 0 ? { hudWriter } : {},
|
|
7047
|
+
...busChannel !== void 0 ? { busChannel } : {},
|
|
6907
7048
|
...!isDisabled && options.promptBridge !== void 0 ? { promptBridge: options.promptBridge } : {},
|
|
6908
7049
|
...!isDisabled && options.hostRuntime !== void 0 ? { hostRuntime: options.hostRuntime } : {},
|
|
6909
7050
|
paths: resolveContextPaths(options)
|
|
@@ -7012,6 +7153,7 @@ async function buildExtensionRegistry(loaded, options = {}) {
|
|
|
7012
7153
|
if (disposed) return;
|
|
7013
7154
|
disposed = true;
|
|
7014
7155
|
for (const writer of hudWriters) writer.clear();
|
|
7156
|
+
for (const channel of busChannels) channel.close();
|
|
7015
7157
|
await disposeLoadedExtensions([...active, ...inactive], sink);
|
|
7016
7158
|
} });
|
|
7017
7159
|
}
|
|
@@ -7397,7 +7539,7 @@ function partitionExtensionCatalog(loaded, inactive) {
|
|
|
7397
7539
|
};
|
|
7398
7540
|
}
|
|
7399
7541
|
function makeContext(opts) {
|
|
7400
|
-
const { definition, source, dir, logger, gate, signal, sinks, readSettings, paths, hudWriter, promptBridge, hostRuntime, disabled = false } = opts;
|
|
7542
|
+
const { definition, source, dir, logger, gate, signal, sinks, readSettings, paths, hudWriter, promptBridge, hostRuntime, busChannel, disabled = false } = opts;
|
|
7401
7543
|
function guardOpen(method) {
|
|
7402
7544
|
if (gate.open) return true;
|
|
7403
7545
|
logger.warn("registration after setup() resolved — call ignored", { method });
|
|
@@ -8052,7 +8194,13 @@ function makeContext(opts) {
|
|
|
8052
8194
|
} : block);
|
|
8053
8195
|
return hostRuntime?.current()?.appendNote(namespaced) ?? false;
|
|
8054
8196
|
},
|
|
8055
|
-
workspace: createWorkspaceSurface(async () => await hostRuntime?.current()?.workspace?.() ?? null, () => hostRuntime?.current()?.workspaceAvailable?.())
|
|
8197
|
+
workspace: createWorkspaceSurface(async () => await hostRuntime?.current()?.workspace?.() ?? null, () => hostRuntime?.current()?.workspaceAvailable?.()),
|
|
8198
|
+
...busChannel ? { bus: {
|
|
8199
|
+
emit: (payload, emitOpts) => {
|
|
8200
|
+
if (!busChannel.emit(payload, emitOpts)) logger.warn(`bus.emit dropped: payload not JSON-serializable or over ${EXTENSION_BUS_MAX_PAYLOAD_BYTES} bytes`);
|
|
8201
|
+
},
|
|
8202
|
+
onMessage: (fn) => busChannel.onMessage(fn)
|
|
8203
|
+
} } : {}
|
|
8056
8204
|
};
|
|
8057
8205
|
}
|
|
8058
8206
|
function resolveContextPaths(options) {
|
|
@@ -8101,6 +8249,7 @@ async function discoverAndBuildExtensionRegistry(opts = {}) {
|
|
|
8101
8249
|
...opts.hud !== void 0 ? { hud: opts.hud } : {},
|
|
8102
8250
|
...opts.promptBridge !== void 0 ? { promptBridge: opts.promptBridge } : {},
|
|
8103
8251
|
...opts.hostRuntime !== void 0 ? { hostRuntime: opts.hostRuntime } : {},
|
|
8252
|
+
...opts.bus !== void 0 ? { bus: opts.bus } : {},
|
|
8104
8253
|
...disabled ? { disabled } : {},
|
|
8105
8254
|
...opts.readSettings !== void 0 ? { readSettings: opts.readSettings } : {},
|
|
8106
8255
|
...opts.cwd !== void 0 ? { cwd: opts.cwd } : {},
|
|
@@ -12970,6 +13119,7 @@ async function executeTurn(ctx, turn, priorUsage) {
|
|
|
12970
13119
|
}
|
|
12971
13120
|
}
|
|
12972
13121
|
if (turnTtftMs !== void 0 && result.usage.timeToFirstTokenMs === void 0) result.usage.timeToFirstTokenMs = turnTtftMs;
|
|
13122
|
+
if (result.usage.streamDurationMs === void 0) result.usage.streamDurationMs = Date.now() - streamStartedAt;
|
|
12973
13123
|
const assistantTurn = {
|
|
12974
13124
|
id: turnId,
|
|
12975
13125
|
runId: ctx.runId,
|
|
@@ -17063,6 +17213,6 @@ function createAgent(rawOptions) {
|
|
|
17063
17213
|
};
|
|
17064
17214
|
}
|
|
17065
17215
|
//#endregion
|
|
17066
|
-
export { installExtensionFromSpec as $, groupBindings as $t, selectFilesFromSession as A,
|
|
17216
|
+
export { installExtensionFromSpec as $, groupBindings as $t, selectFilesFromSession as A, EXTENSION_BUS_MAX_PAYLOAD_BYTES as An, createSkillsReadTool as At, buildUpToCompactPrompt as B, stableStringify as Bn, matchModelEntries as Bt, resolveLegacySessionDir as C, coerceExtensionConfigInput as Cn, waitTask as Ct, resolveTasksDir as D, resolveExtensionConfigValue as Dn, reserveChildLabel as Dt, resolveSessionDir as E, resolveExtensionConfig as En, isSpawnTool as Et, TRAILER as F, effectiveContextWindow as Fn, readFile$1 as Ft, summaryToTurn as G, readStateKey as Gn, edit as Gt, anchorPreviewFor as H, hashContent as Hn, createInteractionTool as Ht, buildCompactPrompt as I, shouldAutoCompact as In, looksBinary as It, CompactPromptTooLongError as J, KEYBINDING_DEFS as Jt, truncateHeadForPtlRetry as K, resolveReadStateMap as Kn, validateToolArgs as Kt, buildFromCompactPrompt as L, defaultRepeatGuardNormalize as Ln, multiEdit as Lt, compactConversation as M, serializedPayloadBytes as Mn, createShellTool as Mt, BASE_INSTRUCTIONS as N, AUTO_COMPACT_MIN_GROWTH_FRACTION as Nn, shell as Nt, buildPostCompactAttachments as O, sanitizeExtensionConfigActionPatch as On, createSkillsUseTool as Ot, NO_TOOLS_PREAMBLE as P, OUTPUT_RESERVE_TOKENS as Pn, tailTruncate as Pt, fetchExtensionSource as Q, formatBindingForDisplay as Qt, buildFullCompactPrompt as R, defaultRepeatGuardTracked as Rn, createModelSearchTool as Rt, resolveLegacyPersistDir as S, clampExtensionConfigNumber as Sn, WAIT_TASK_TIMED_OUT_PREFIX as St, resolvePersistDir as T, isValidExtensionConfigValue as Tn, createSpawnTool as Tt, sliceForCompaction as U, hydrateReadStateFromSession as Un, grep as Ut, ANCHOR_PREVIEW_MAX_CHARS as V, getReadState as Vn, listFiles as Vt, stripImagesFromTurns as W, hydrateReadStateFromSessionAsync as Wn, glob as Wt, createExtensionPromptBridge as X, KEYBINDING_KEY_COL_WIDTH as Xt, EMPTY_EXTENSION_REGISTRY as Y, KEYBINDING_DEF_BY_ACTION as Yt, ExtensionInstallError as Z, ensureKeybindingsFile as Zt, buildPersistedStub as _, parseExtensionScanPathEnv as _n, composePresets as _t, stagedToolState as a, readKeybindingsRaw as an, createExtensionHud as at, migrateSessionArtifactDirs as b, setDebugLogSink as bn, basic_default as bt, INTERRUPT_MESSAGE_FOR_TOOL_USE as c, ALTERNATE_CRED_KEY_SUFFIX as cn, buildExtensionRegistry as ct, TOOL_USE_SKIPPED_MESSAGE as d, registerExtensionHostModules as dn, filterExtensionRegistry as dt, keybindingsPath as en, listExtensionCandidates as et, applyCompactSummaryCutoff as f, ENTRY_CANDIDATES as fn, filterRegistryPlugins as ft, PERSISTENCE_PREVIEW_BYTES as g, isExtensionDefinition as gn, createWorkspaceSurface as gt, PERSISTED_STUB_PREFIX as h, inlineLoadedExtension as hn, createExtensionHostRuntimeBridge as ht, isToolStateOps as i, readKeybindings as in, updateInstalledExtension as it, selectRecentFiles as j, createExtensionBus as jn, shellKill as jt, selectFilesFromReadState as k, toWireConfigSchema as kn, createSkillsRunScriptTool as kt, SHELL_CASCADE_CANCEL_MESSAGE as l, alternateCredKey as ln, composeExtensionPreset as lt, renderStaleReadNotice as m, discoverExtensions as mn, partitionExtensionCatalog as mt, DEFAULT_MAX_VALUE_BYTES as n, mergeKeybindings as nn, readExtensionInstallProvenance as nt, normalizeProviders as o, resolveExtensionKeybindings as on, discoverAndBuildExtensionRegistry as ot, collectNewlyStaleReadPaths as p, defaultExtensionScanPaths as pn, mergeContributions as pt, CompactInvalidInputError as q, DEFAULT_KEYBINDINGS as qt, createToolStateController as r, parseBindingSpec as rn, removeInstalledExtension as rt, resolveModelTargets as s, stripJsonComments as sn, buildExtensionPreset as st, createAgent as t, matchesBinding as tn, parseExtensionInstallSource as tt, TOOL_USE_CANCELLED_MESSAGE as u, isReservedCredKey as un, disposeExtensionRegistry as ut, cleanupPersistedSession as v, scanExtensionDirectories as vn, definePreset as vt, resolveMcpWarningsDir as w, isValidExtensionConfigItem as wn, createToolSearchTool as wt, rehomePersistedStubs as x, defineExtension as xn, writeFile$1 as xt, maybePersistToolResult as y, createDebugLog as yn, basicTools as yt, buildTailCompactPrompt as z, normalizeShellCommand as zn, formatModelLine as zt };
|
|
17067
17217
|
|
|
17068
|
-
//# sourceMappingURL=agent-
|
|
17218
|
+
//# sourceMappingURL=agent-C-camKQW.js.map
|