reasonix 0.48.0 → 0.49.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/README.md +9 -0
- package/dashboard/dist/app.js +123 -16
- package/dashboard/dist/app.js.map +1 -1
- package/dist/cli/{acp-4ROCGYNH.js → acp-WFQIC6SO.js} +52 -135
- package/dist/cli/acp-WFQIC6SO.js.map +1 -0
- package/dist/cli/chat-D32JGNVH.js +51 -0
- package/dist/cli/{chunk-S2RMQULY.js → chunk-23ZPCIPR.js} +12 -9
- package/dist/cli/chunk-23ZPCIPR.js.map +1 -0
- package/dist/cli/{chunk-TKVXTQ3T.js → chunk-3ZZXQ3CZ.js} +27 -27
- package/dist/cli/chunk-3ZZXQ3CZ.js.map +1 -0
- package/dist/cli/{chunk-5OHHAQ4W.js → chunk-7AST3QQ3.js} +2 -2
- package/dist/cli/{chunk-MRZG4GBF.js → chunk-7JTKBJ2G.js} +3 -3
- package/dist/cli/{chunk-X53B3JIX.js → chunk-7X4JJOO7.js} +2 -61
- package/dist/cli/{chunk-X53B3JIX.js.map → chunk-7X4JJOO7.js.map} +1 -1
- package/dist/cli/{chunk-MOJYKO2A.js → chunk-ASOLXV67.js} +3 -3
- package/dist/cli/{chunk-7M4YYMKW.js → chunk-AWEULQG6.js} +49 -56
- package/dist/cli/{chunk-7M4YYMKW.js.map → chunk-AWEULQG6.js.map} +1 -1
- package/dist/cli/{chunk-HR5NBKEM.js → chunk-DFX5ZH5L.js} +2 -2
- package/dist/cli/{chunk-3WGTGXO4.js → chunk-GNS7BAT2.js} +4 -4
- package/dist/cli/chunk-GNS7BAT2.js.map +1 -0
- package/dist/cli/{chunk-TE5UIIFL.js → chunk-J2IHQGPQ.js} +12 -6
- package/dist/cli/chunk-J2IHQGPQ.js.map +1 -0
- package/dist/cli/{chunk-I4M5QJNL.js → chunk-JGTX4RRQ.js} +3 -3
- package/dist/cli/{chunk-FY4S7TJZ.js → chunk-JNTMOX7G.js} +10 -2
- package/dist/cli/chunk-JNTMOX7G.js.map +1 -0
- package/dist/cli/{chunk-OB4BUJBL.js → chunk-MGTBP7GG.js} +5 -2
- package/dist/cli/chunk-MGTBP7GG.js.map +1 -0
- package/dist/cli/{chunk-OPYALNTT.js → chunk-MQWO32ZD.js} +387 -184
- package/dist/cli/chunk-MQWO32ZD.js.map +1 -0
- package/dist/cli/{chunk-2QSTA2QV.js → chunk-O5LIHAMP.js} +8 -4
- package/dist/cli/chunk-O5LIHAMP.js.map +1 -0
- package/dist/cli/{chunk-NMQSUNLB.js → chunk-PB3MAFEI.js} +6 -3
- package/dist/cli/chunk-PB3MAFEI.js.map +1 -0
- package/dist/cli/{chunk-H4CCXMDD.js → chunk-PEMG6CUB.js} +2 -2
- package/dist/cli/{chunk-RUDBUHO4.js → chunk-PXBQ6IZ7.js} +3 -3
- package/dist/cli/{chunk-J2TQAWOM.js → chunk-Q46B3Z7H.js} +25 -10
- package/dist/cli/{chunk-J2TQAWOM.js.map → chunk-Q46B3Z7H.js.map} +1 -1
- package/dist/cli/{chunk-6MZTZO7A.js → chunk-QF32ROX2.js} +2152 -2613
- package/dist/cli/chunk-QF32ROX2.js.map +1 -0
- package/dist/cli/{chunk-OG5JANQ4.js → chunk-QX5TWXRZ.js} +2 -2
- package/dist/cli/{chunk-V4Y732RQ.js → chunk-TAIKVL35.js} +2 -2
- package/dist/cli/{chunk-B5CZL2SE.js → chunk-TEDWJKEI.js} +4 -9
- package/dist/cli/chunk-TEDWJKEI.js.map +1 -0
- package/dist/cli/{chunk-EMMENC4O.js → chunk-U5XQDCK7.js} +5 -5
- package/dist/cli/{chunk-DOWEOA6E.js → chunk-W46ZMNKO.js} +3 -3
- package/dist/cli/{chunk-CDVSFSAK.js → chunk-WMTMMSXU.js} +184 -8
- package/dist/cli/chunk-WMTMMSXU.js.map +1 -0
- package/dist/cli/{chunk-YW63N3ZR.js → chunk-YEF7C4XI.js} +270 -96
- package/dist/cli/chunk-YEF7C4XI.js.map +1 -0
- package/dist/cli/{chunk-JMDE6IO3.js → chunk-ZAEJWKXB.js} +2 -2
- package/dist/cli/chunk-ZWHSHFDP.js +6173 -0
- package/dist/cli/chunk-ZWHSHFDP.js.map +1 -0
- package/dist/cli/{code-PMPJWXEO.js → code-R4IHI7SR.js} +30 -30
- package/dist/cli/{commands-QS6TG4G3.js → commands-DRHFCYMO.js} +4 -4
- package/dist/cli/{commit-XPRSKUBF.js → commit-AG5KB4YP.js} +3 -3
- package/dist/cli/{desktop-562OPWIU.js → desktop-JGL6GORA.js} +60 -23
- package/dist/cli/desktop-JGL6GORA.js.map +1 -0
- package/dist/cli/{diff-I6W4AUWJ.js → diff-4Z7ETWZO.js} +9 -9
- package/dist/cli/{doctor-6XVZKT4U.js → doctor-VA3RHQLB.js} +9 -9
- package/dist/cli/index.js +37 -36
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/{mcp-7W7ANO2Y.js → mcp-LZO4HXFA.js} +34 -23
- package/dist/cli/mcp-LZO4HXFA.js.map +1 -0
- package/dist/cli/{mcp-browse-LA4I4YIZ.js → mcp-browse-C3GXVMYZ.js} +3 -3
- package/dist/cli/{mcp-inspect-LWXXU7BY.js → mcp-inspect-ZMYUNFDS.js} +2 -2
- package/dist/cli/{prompt-RKZD4X6Y.js → prompt-MC3U5KRP.js} +5 -4
- package/dist/cli/{prune-sessions-SEWX7GP6.js → prune-sessions-OEPFH4N6.js} +11 -7
- package/dist/cli/prune-sessions-OEPFH4N6.js.map +1 -0
- package/dist/cli/{replay-2X7MVXOI.js → replay-4TP7ZUMZ.js} +10 -10
- package/dist/cli/{run-TPKXIJ27.js → run-6MXQYBOE.js} +16 -15
- package/dist/cli/run-6MXQYBOE.js.map +1 -0
- package/dist/cli/{server-NHQ3QXOZ.js → server-Z3IMJNNI.js} +65 -12
- package/dist/cli/server-Z3IMJNNI.js.map +1 -0
- package/dist/cli/{sessions-2A4DGSHA.js → sessions-NXQ5SAV7.js} +18 -18
- package/dist/cli/sessions-NXQ5SAV7.js.map +1 -0
- package/dist/cli/{setup-GOLP7J4C.js → setup-LHZELI6I.js} +6 -6
- package/dist/cli/{stats-CGDAFDKI.js → stats-SUIJ3QWY.js} +6 -6
- package/dist/cli/{version-FIL4ZFOS.js → version-BIFONEUB.js} +13 -13
- package/dist/index.d.ts +71 -17
- package/dist/index.js +1040 -391
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
- package/dist/cli/acp-4ROCGYNH.js.map +0 -1
- package/dist/cli/chat-GZNB5625.js +0 -51
- package/dist/cli/chunk-2QSTA2QV.js.map +0 -1
- package/dist/cli/chunk-3WGTGXO4.js.map +0 -1
- package/dist/cli/chunk-6MZTZO7A.js.map +0 -1
- package/dist/cli/chunk-B5CZL2SE.js.map +0 -1
- package/dist/cli/chunk-CDVSFSAK.js.map +0 -1
- package/dist/cli/chunk-FY4S7TJZ.js.map +0 -1
- package/dist/cli/chunk-NMQSUNLB.js.map +0 -1
- package/dist/cli/chunk-OB4BUJBL.js.map +0 -1
- package/dist/cli/chunk-OPYALNTT.js.map +0 -1
- package/dist/cli/chunk-S2RMQULY.js.map +0 -1
- package/dist/cli/chunk-TE5UIIFL.js.map +0 -1
- package/dist/cli/chunk-TKVXTQ3T.js.map +0 -1
- package/dist/cli/chunk-WZGNXR6E.js +0 -2020
- package/dist/cli/chunk-WZGNXR6E.js.map +0 -1
- package/dist/cli/chunk-YW63N3ZR.js.map +0 -1
- package/dist/cli/desktop-562OPWIU.js.map +0 -1
- package/dist/cli/mcp-7W7ANO2Y.js.map +0 -1
- package/dist/cli/prune-sessions-SEWX7GP6.js.map +0 -1
- package/dist/cli/run-TPKXIJ27.js.map +0 -1
- package/dist/cli/server-NHQ3QXOZ.js.map +0 -1
- package/dist/cli/sessions-2A4DGSHA.js.map +0 -1
- /package/dist/cli/{chat-GZNB5625.js.map → chat-D32JGNVH.js.map} +0 -0
- /package/dist/cli/{chunk-5OHHAQ4W.js.map → chunk-7AST3QQ3.js.map} +0 -0
- /package/dist/cli/{chunk-MRZG4GBF.js.map → chunk-7JTKBJ2G.js.map} +0 -0
- /package/dist/cli/{chunk-MOJYKO2A.js.map → chunk-ASOLXV67.js.map} +0 -0
- /package/dist/cli/{chunk-HR5NBKEM.js.map → chunk-DFX5ZH5L.js.map} +0 -0
- /package/dist/cli/{chunk-I4M5QJNL.js.map → chunk-JGTX4RRQ.js.map} +0 -0
- /package/dist/cli/{chunk-H4CCXMDD.js.map → chunk-PEMG6CUB.js.map} +0 -0
- /package/dist/cli/{chunk-RUDBUHO4.js.map → chunk-PXBQ6IZ7.js.map} +0 -0
- /package/dist/cli/{chunk-OG5JANQ4.js.map → chunk-QX5TWXRZ.js.map} +0 -0
- /package/dist/cli/{chunk-V4Y732RQ.js.map → chunk-TAIKVL35.js.map} +0 -0
- /package/dist/cli/{chunk-EMMENC4O.js.map → chunk-U5XQDCK7.js.map} +0 -0
- /package/dist/cli/{chunk-DOWEOA6E.js.map → chunk-W46ZMNKO.js.map} +0 -0
- /package/dist/cli/{chunk-JMDE6IO3.js.map → chunk-ZAEJWKXB.js.map} +0 -0
- /package/dist/cli/{code-PMPJWXEO.js.map → code-R4IHI7SR.js.map} +0 -0
- /package/dist/cli/{commands-QS6TG4G3.js.map → commands-DRHFCYMO.js.map} +0 -0
- /package/dist/cli/{commit-XPRSKUBF.js.map → commit-AG5KB4YP.js.map} +0 -0
- /package/dist/cli/{diff-I6W4AUWJ.js.map → diff-4Z7ETWZO.js.map} +0 -0
- /package/dist/cli/{doctor-6XVZKT4U.js.map → doctor-VA3RHQLB.js.map} +0 -0
- /package/dist/cli/{mcp-browse-LA4I4YIZ.js.map → mcp-browse-C3GXVMYZ.js.map} +0 -0
- /package/dist/cli/{mcp-inspect-LWXXU7BY.js.map → mcp-inspect-ZMYUNFDS.js.map} +0 -0
- /package/dist/cli/{prompt-RKZD4X6Y.js.map → prompt-MC3U5KRP.js.map} +0 -0
- /package/dist/cli/{replay-2X7MVXOI.js.map → replay-4TP7ZUMZ.js.map} +0 -0
- /package/dist/cli/{setup-GOLP7J4C.js.map → setup-LHZELI6I.js.map} +0 -0
- /package/dist/cli/{stats-CGDAFDKI.js.map → stats-SUIJ3QWY.js.map} +0 -0
- /package/dist/cli/{version-FIL4ZFOS.js.map → version-BIFONEUB.js.map} +0 -0
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __cr } from 'node:module'; if (typeof globalThis.require === 'undefined') { globalThis.require = __cr(import.meta.url); }
|
|
3
|
-
import "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
import "./chunk-MQWO32ZD.js";
|
|
4
|
+
import "./chunk-7AST3QQ3.js";
|
|
5
|
+
import "./chunk-7JTKBJ2G.js";
|
|
6
6
|
import "./chunk-HIYTRCSW.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-O5LIHAMP.js";
|
|
8
8
|
import "./chunk-6OWJV3YW.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-J2IHQGPQ.js";
|
|
10
10
|
import "./chunk-25T6CVUP.js";
|
|
11
11
|
import "./chunk-2UQP6H6T.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-ZWHSHFDP.js";
|
|
13
|
+
import "./chunk-JNTMOX7G.js";
|
|
14
|
+
import "./chunk-PB3MAFEI.js";
|
|
15
15
|
import "./chunk-S4XVGLRW.js";
|
|
16
16
|
import {
|
|
17
17
|
listSessions,
|
|
18
18
|
loadSessionMessages,
|
|
19
19
|
sessionPath
|
|
20
20
|
} from "./chunk-RRXUIPWG.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-ZAEJWKXB.js";
|
|
22
|
+
import "./chunk-QX5TWXRZ.js";
|
|
23
23
|
import {
|
|
24
24
|
t
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-YEF7C4XI.js";
|
|
26
|
+
import "./chunk-WMTMMSXU.js";
|
|
27
27
|
import "./chunk-XXC2BYTV.js";
|
|
28
28
|
import "./chunk-TUK7OWJA.js";
|
|
29
29
|
|
|
@@ -41,7 +41,7 @@ function listAll() {
|
|
|
41
41
|
console.log(t("sessions.emptyHint"));
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
console.log("
|
|
44
|
+
console.log(t("sessions.listHeader"));
|
|
45
45
|
console.log("");
|
|
46
46
|
console.log(` ${"name".padEnd(22)} ${"msgs".padStart(6)} ${"size".padStart(8)} modified`);
|
|
47
47
|
console.log(` ${"\u2500".repeat(60)}`);
|
|
@@ -55,15 +55,15 @@ function listAll() {
|
|
|
55
55
|
if (details.length > 0) console.log(` ${details.join(" \xB7 ")}`);
|
|
56
56
|
}
|
|
57
57
|
console.log("");
|
|
58
|
-
console.log("
|
|
59
|
-
console.log("
|
|
58
|
+
console.log(t("sessions.inspectHint"));
|
|
59
|
+
console.log(t("sessions.resumeHint"));
|
|
60
60
|
}
|
|
61
61
|
function inspectSession(name, verbose) {
|
|
62
62
|
const path = sessionPath(name);
|
|
63
63
|
const messages = loadSessionMessages(name);
|
|
64
64
|
if (messages.length === 0) {
|
|
65
|
-
console.error(
|
|
66
|
-
console.error(
|
|
65
|
+
console.error(t("sessions.noSession", { name }));
|
|
66
|
+
console.error(t("sessions.lookedAt", { path }));
|
|
67
67
|
process.exit(1);
|
|
68
68
|
}
|
|
69
69
|
console.log(`[session] ${name} ${messages.length} messages ${path}`);
|
|
@@ -117,4 +117,4 @@ function truncate(s, max) {
|
|
|
117
117
|
export {
|
|
118
118
|
sessionsCommand
|
|
119
119
|
};
|
|
120
|
-
//# sourceMappingURL=sessions-
|
|
120
|
+
//# sourceMappingURL=sessions-NXQ5SAV7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/cli/commands/sessions.ts"],"sourcesContent":["import { t } from \"../../i18n/index.js\";\nimport { listSessions, loadSessionMessages, sessionPath } from \"../../index.js\";\nimport type { ChatMessage, SessionInfo } from \"../../index.js\";\n\nexport interface SessionsOptions {\n /** When present, inspect that session instead of listing. */\n name?: string;\n /** Include assistant tool-call metadata in the inspect output. */\n verbose?: boolean;\n}\n\nexport function sessionsCommand(opts: SessionsOptions): void {\n if (opts.name) {\n inspectSession(opts.name, !!opts.verbose);\n } else {\n listAll();\n }\n}\n\nfunction listAll(): void {\n const items = listSessions();\n if (items.length === 0) {\n console.log(t(\"sessions.emptyHint\"));\n return;\n }\n console.log(t(\"sessions.listHeader\"));\n console.log(\"\");\n console.log(` ${\"name\".padEnd(22)} ${\"msgs\".padStart(6)} ${\"size\".padStart(8)} modified`);\n console.log(` ${\"─\".repeat(60)}`);\n for (const s of items) {\n const sizeKb = `${(s.size / 1024).toFixed(1)} KB`;\n const when = s.mtime.toISOString().replace(\"T\", \" \").slice(0, 16);\n console.log(\n ` ${s.name.padEnd(22)} ${String(s.messageCount).padStart(6)} ${sizeKb.padStart(8)} ${when}`,\n );\n const details = sessionDetails(s);\n if (details.length > 0) console.log(` ${details.join(\" · \")}`);\n }\n console.log(\"\");\n console.log(t(\"sessions.inspectHint\"));\n console.log(t(\"sessions.resumeHint\"));\n}\n\nfunction inspectSession(name: string, verbose: boolean): void {\n const path = sessionPath(name);\n const messages = loadSessionMessages(name);\n if (messages.length === 0) {\n console.error(t(\"sessions.noSession\", { name }));\n console.error(t(\"sessions.lookedAt\", { path }));\n process.exit(1);\n }\n\n console.log(`[session] ${name} ${messages.length} messages ${path}`);\n console.log(\"\");\n\n let turnIndex = 0;\n for (const msg of messages) {\n renderMessage(msg, turnIndex, verbose);\n // Roughly bump \"turn\" after each user message so the reader can follow\n // the conversation shape without the transcript's richer turn numbering.\n if (msg.role === \"user\") turnIndex++;\n }\n}\n\nfunction renderMessage(msg: ChatMessage, turnIdx: number, verbose: boolean): void {\n const turn = turnIdx > 0 ? `[t${turnIdx}]` : \"[start]\";\n const content = typeof msg.content === \"string\" ? msg.content : \"\";\n const flat = oneLine(content);\n\n if (msg.role === \"user\") {\n console.log(`${turn} USER: ${flat}`);\n } else if (msg.role === \"assistant\") {\n console.log(`${turn} AGENT: ${flat || \"(tool call only)\"}`);\n if (verbose && msg.tool_calls?.length) {\n for (const tc of msg.tool_calls) {\n console.log(\n ` → call ${tc.function?.name} ${truncate(tc.function?.arguments ?? \"\", 80)}`,\n );\n }\n }\n } else if (msg.role === \"tool\") {\n console.log(`${turn} TOOL ${msg.name ?? \"?\"}: ${truncate(flat, 160)}`);\n } else if (msg.role === \"system\") {\n if (verbose) console.log(`${turn} SYSTEM: ${truncate(flat, 160)}`);\n // otherwise suppress — session's system prompt is usually session-wide\n // boilerplate.\n }\n}\n\nfunction oneLine(s: string, max = 200): string {\n const collapsed = s.replace(/\\s+/g, \" \").trim();\n return collapsed.length > max ? `${collapsed.slice(0, max)}…` : collapsed;\n}\n\nfunction sessionDetails(s: SessionInfo): string[] {\n const details: string[] = [];\n if (s.meta.summary) details.push(`summary: ${oneLine(s.meta.summary, 88)}`);\n if (s.meta.workspace) details.push(`workspace: ${workspaceLabel(s.meta.workspace)}`);\n if (s.meta.branch) details.push(`branch: ${truncate(s.meta.branch, 40)}`);\n return details;\n}\n\nfunction workspaceLabel(workspace: string): string {\n const trimmed = workspace.replace(/[\\\\/]+$/, \"\");\n const label = trimmed.split(/[\\\\/]+/).at(-1) ?? trimmed;\n return truncate(label || workspace, 40);\n}\n\nfunction truncate(s: string, max: number): string {\n return s.length <= max ? s : `${s.slice(0, max)}…`;\n}\n"],"mappings":"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","names":[]}
|
|
@@ -3,11 +3,11 @@ import { createRequire as __cr } from 'node:module'; if (typeof globalThis.requi
|
|
|
3
3
|
import {
|
|
4
4
|
MultiSelect,
|
|
5
5
|
SingleSelect
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-W46ZMNKO.js";
|
|
7
7
|
import {
|
|
8
8
|
ThemeProvider,
|
|
9
9
|
useTheme
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PXBQ6IZ7.js";
|
|
11
11
|
import {
|
|
12
12
|
Box_default,
|
|
13
13
|
Text,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
source_default,
|
|
17
17
|
use_app_default,
|
|
18
18
|
use_input_default
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7X4JJOO7.js";
|
|
20
20
|
import {
|
|
21
21
|
PRESET_DESCRIPTIONS
|
|
22
22
|
} from "./chunk-LGEKVMMV.js";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
onLanguageChange,
|
|
35
35
|
setLanguage,
|
|
36
36
|
t
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-YEF7C4XI.js";
|
|
38
38
|
import {
|
|
39
39
|
defaultConfigPath,
|
|
40
40
|
isPlausibleKey,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
redactKey,
|
|
47
47
|
resolveThemePreference,
|
|
48
48
|
writeConfig
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-WMTMMSXU.js";
|
|
50
50
|
import {
|
|
51
51
|
__toESM
|
|
52
52
|
} from "./chunk-TUK7OWJA.js";
|
|
@@ -615,4 +615,4 @@ async function setupCommand(opts = {}) {
|
|
|
615
615
|
export {
|
|
616
616
|
setupCommand
|
|
617
617
|
};
|
|
618
|
-
//# sourceMappingURL=setup-
|
|
618
|
+
//# sourceMappingURL=setup-LHZELI6I.js.map
|
|
@@ -3,14 +3,14 @@ import { createRequire as __cr } from 'node:module'; if (typeof globalThis.requi
|
|
|
3
3
|
import {
|
|
4
4
|
renderDashboard,
|
|
5
5
|
statsCommand
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-ASOLXV67.js";
|
|
7
|
+
import "./chunk-ZAEJWKXB.js";
|
|
8
|
+
import "./chunk-QX5TWXRZ.js";
|
|
9
|
+
import "./chunk-YEF7C4XI.js";
|
|
10
|
+
import "./chunk-WMTMMSXU.js";
|
|
11
11
|
import "./chunk-TUK7OWJA.js";
|
|
12
12
|
export {
|
|
13
13
|
renderDashboard,
|
|
14
14
|
statsCommand
|
|
15
15
|
};
|
|
16
|
-
//# sourceMappingURL=stats-
|
|
16
|
+
//# sourceMappingURL=stats-SUIJ3QWY.js.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __cr } from 'node:module'; if (typeof globalThis.require === 'undefined') { globalThis.require = __cr(import.meta.url); }
|
|
3
|
-
import "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
import "./chunk-MQWO32ZD.js";
|
|
4
|
+
import "./chunk-7AST3QQ3.js";
|
|
5
|
+
import "./chunk-7JTKBJ2G.js";
|
|
6
6
|
import "./chunk-HIYTRCSW.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-O5LIHAMP.js";
|
|
8
8
|
import "./chunk-6OWJV3YW.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-J2IHQGPQ.js";
|
|
10
10
|
import "./chunk-25T6CVUP.js";
|
|
11
11
|
import "./chunk-2UQP6H6T.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-ZWHSHFDP.js";
|
|
13
|
+
import "./chunk-JNTMOX7G.js";
|
|
14
|
+
import "./chunk-PB3MAFEI.js";
|
|
15
15
|
import "./chunk-S4XVGLRW.js";
|
|
16
16
|
import "./chunk-RRXUIPWG.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-ZAEJWKXB.js";
|
|
18
|
+
import "./chunk-QX5TWXRZ.js";
|
|
19
|
+
import "./chunk-YEF7C4XI.js";
|
|
20
|
+
import "./chunk-WMTMMSXU.js";
|
|
21
21
|
import {
|
|
22
22
|
VERSION
|
|
23
23
|
} from "./chunk-XXC2BYTV.js";
|
|
@@ -30,4 +30,4 @@ function versionCommand() {
|
|
|
30
30
|
export {
|
|
31
31
|
versionCommand
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=version-
|
|
33
|
+
//# sourceMappingURL=version-BIFONEUB.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -343,6 +343,10 @@ declare function projectSettingsPath(projectRoot: string): string;
|
|
|
343
343
|
interface LoadHookSettingsOptions {
|
|
344
344
|
/** Absolute project root, if any. Without it, only global hooks load. */
|
|
345
345
|
projectRoot?: string;
|
|
346
|
+
/** Override config path for tests. */
|
|
347
|
+
configPath?: string;
|
|
348
|
+
/** Tests and intentionally trusted callers can opt in without touching config. */
|
|
349
|
+
trustProjectHooks?: boolean;
|
|
346
350
|
/** Override `~` for tests. */
|
|
347
351
|
homeDir?: string;
|
|
348
352
|
}
|
|
@@ -580,7 +584,7 @@ type EventRole = "assistant_delta" | "assistant_final"
|
|
|
580
584
|
| "tool_start" | "tool" | "done" | "error" | "warning"
|
|
581
585
|
/** Transient indicator for silent phases; UI clears on next primary event. */
|
|
582
586
|
| "status"
|
|
583
|
-
/** Mid-turn steer injected as
|
|
587
|
+
/** Mid-turn steer injected as queued user guidance without aborting the current turn. */
|
|
584
588
|
| "steer";
|
|
585
589
|
interface LoopEvent {
|
|
586
590
|
turn: number;
|
|
@@ -649,10 +653,42 @@ declare class VolatileScratch {
|
|
|
649
653
|
reset(): void;
|
|
650
654
|
}
|
|
651
655
|
|
|
656
|
+
/** Sliding-window limits for per-session tool dispatch, with aggregate and per-tool buckets. */
|
|
657
|
+
interface ToolRateLimitBucketConfig {
|
|
658
|
+
maxCalls?: number;
|
|
659
|
+
windowSeconds?: number;
|
|
660
|
+
}
|
|
661
|
+
interface ToolRateLimitConfig {
|
|
662
|
+
enabled?: boolean;
|
|
663
|
+
aggregate?: ToolRateLimitBucketConfig;
|
|
664
|
+
tools?: Record<string, false | ToolRateLimitBucketConfig>;
|
|
665
|
+
}
|
|
666
|
+
interface NormalizedToolRateLimitBucket {
|
|
667
|
+
maxCalls: number;
|
|
668
|
+
windowSeconds: number;
|
|
669
|
+
}
|
|
670
|
+
interface NormalizedToolRateLimitConfig {
|
|
671
|
+
aggregate: NormalizedToolRateLimitBucket;
|
|
672
|
+
tools: Record<string, false | NormalizedToolRateLimitBucket>;
|
|
673
|
+
}
|
|
674
|
+
type ToolRateLimitOption = false | ToolRateLimitConfig;
|
|
675
|
+
|
|
676
|
+
/** Tracks files the model has had byte-exact visibility into this session. `edit_file` and `multi_edit` consult it before mutating, so the SEARCH text matches the on-disk bytes the model actually saw — not what it guessed. */
|
|
677
|
+
declare class ReadTracker {
|
|
678
|
+
private readonly _seen;
|
|
679
|
+
private static norm;
|
|
680
|
+
markRead(abs: string): void;
|
|
681
|
+
hasRead(abs: string): boolean;
|
|
682
|
+
reset(): void;
|
|
683
|
+
get size(): number;
|
|
684
|
+
}
|
|
685
|
+
|
|
652
686
|
interface ToolCallContext {
|
|
653
687
|
signal?: AbortSignal;
|
|
654
688
|
/** Inject a mock PauseGate for tests. When absent, tools use the singleton. */
|
|
655
689
|
confirmationGate?: PauseGate;
|
|
690
|
+
/** Per-session tracker of files the model has read. Filesystem tools mark on read/write, edit_file/multi_edit consult before mutating. */
|
|
691
|
+
readTracker?: ReadTracker;
|
|
656
692
|
}
|
|
657
693
|
interface ToolDefinition<A = any, R = any> {
|
|
658
694
|
name: string;
|
|
@@ -671,6 +707,7 @@ interface ToolDefinition<A = any, R = any> {
|
|
|
671
707
|
interface ToolRegistryOptions {
|
|
672
708
|
/** Auto-flatten + re-nest at dispatch; default true. */
|
|
673
709
|
autoFlatten?: boolean;
|
|
710
|
+
rateLimit?: ToolRateLimitOption;
|
|
674
711
|
}
|
|
675
712
|
type ToolCallAuditEvent = {
|
|
676
713
|
name: string;
|
|
@@ -689,6 +726,7 @@ declare class ToolRegistry {
|
|
|
689
726
|
private readonly _interceptors;
|
|
690
727
|
private _auditListener;
|
|
691
728
|
private _resultAugmenter;
|
|
729
|
+
private readonly _rateLimiter;
|
|
692
730
|
/** Per-tool fingerprint of the last call that failed schema validation. Cleared by any successful validation for that tool. */
|
|
693
731
|
private readonly _lastMalformed;
|
|
694
732
|
/** Per-tool fingerprint of the last host-side gate rejection. */
|
|
@@ -707,6 +745,7 @@ declare class ToolRegistry {
|
|
|
707
745
|
setResultAugmenter(fn: ToolResultAugmenter | null): void;
|
|
708
746
|
/** True when an augmenter is already wired — lets late-installing callers skip clobbering an earlier one. */
|
|
709
747
|
get hasResultAugmenter(): boolean;
|
|
748
|
+
get rateLimitPolicy(): false | NormalizedToolRateLimitConfig;
|
|
710
749
|
register<A, R>(def: ToolDefinition<A, R>): this;
|
|
711
750
|
/** Drop a registered tool. Returns true if the name was present. Used by MCP hot-unbridge. */
|
|
712
751
|
unregister(name: string): boolean;
|
|
@@ -724,6 +763,8 @@ declare class ToolRegistry {
|
|
|
724
763
|
maxResultTokens?: number;
|
|
725
764
|
/** Inject a mock PauseGate for tests. */
|
|
726
765
|
confirmationGate?: PauseGate;
|
|
766
|
+
/** Session-scoped read tracker; filesystem tools mark on read/write, edit_file/multi_edit gate on it. */
|
|
767
|
+
readTracker?: ReadTracker;
|
|
727
768
|
}): Promise<string>;
|
|
728
769
|
private _augmentResult;
|
|
729
770
|
/** Records the failed call's fingerprint; on the 2nd consecutive identical malformed call to the same tool, returns a sharper error that tells the model to stop retrying. */
|
|
@@ -767,6 +808,8 @@ declare class CacheFirstLoop {
|
|
|
767
808
|
readonly scratch: VolatileScratch;
|
|
768
809
|
readonly stats: SessionStats;
|
|
769
810
|
readonly repair: ToolCallRepair;
|
|
811
|
+
/** Files the model has read this session; gates edit_file / multi_edit so SEARCH text matches on-disk bytes. Cleared on fold / mechanical truncate (the model's byte-level view of the elided history is gone). In-memory only — naturally empty on resume. */
|
|
812
|
+
readonly readTracker: ReadTracker;
|
|
770
813
|
model: string;
|
|
771
814
|
stream: boolean;
|
|
772
815
|
reasoningEffort: "high" | "max";
|
|
@@ -788,12 +831,12 @@ declare class CacheFirstLoop {
|
|
|
788
831
|
private _turnAbort;
|
|
789
832
|
/** Authoritative running-id set — UI cards consult this instead of trusting end-event delivery. Insert at dispatch entry, delete in finally. */
|
|
790
833
|
private readonly _inflight;
|
|
791
|
-
/** Typeahead steer
|
|
792
|
-
private
|
|
834
|
+
/** Typeahead steer messages set by the UI; step() consumes one at each iter boundary. */
|
|
835
|
+
private readonly _steerQueue;
|
|
793
836
|
/** Set true when a steer was consumed this turn; cleared on next step() entry. */
|
|
794
837
|
private _steerConsumed;
|
|
795
838
|
/** UI calls this to inject a mid-turn steer message without aborting the current turn.
|
|
796
|
-
* New text resets steerConsumed
|
|
839
|
+
* New text resets steerConsumed because a fresh steer is queued. */
|
|
797
840
|
steer(text: string | null): void;
|
|
798
841
|
/** True when a steer was consumed this turn (UI gate to avoid double-submit). */
|
|
799
842
|
get steerConsumed(): boolean;
|
|
@@ -1105,6 +1148,7 @@ interface PricingOverride {
|
|
|
1105
1148
|
output?: number;
|
|
1106
1149
|
}
|
|
1107
1150
|
interface RateLimitConfig {
|
|
1151
|
+
/** Client-side self-throttle in requests/minute — paces outbound chat calls with a min-interval timer. NOT a DeepSeek-enforced limit: DeepSeek's actual cap is concurrency, not RPM (500 for v4-pro, 2500 for v4-flash, account-wide), surfaced as HTTP 429. Set this only to be a polite neighbor on shared infra; single-user CLI rarely needs it. */
|
|
1108
1152
|
rpm?: number;
|
|
1109
1153
|
}
|
|
1110
1154
|
interface ProxyConfig {
|
|
@@ -1112,6 +1156,8 @@ interface ProxyConfig {
|
|
|
1112
1156
|
disabled?: boolean;
|
|
1113
1157
|
/** Additional NO_PROXY patterns (curl syntax). Additive on top of env NO_PROXY and the default DeepSeek-bypass whitelist. */
|
|
1114
1158
|
noProxy?: string[];
|
|
1159
|
+
/** When false, route api.deepseek.com / *.deepseek.com through the proxy too (issue #1497 — corporate firewalls that block direct egress). Default true preserves the clash/v2ray US-exit-IP 403 fix. Env `REASONIX_PROXY_DEEPSEEK_DIRECT` overrides. */
|
|
1160
|
+
bypassDeepSeekDirect?: boolean;
|
|
1115
1161
|
}
|
|
1116
1162
|
interface ReasonixConfig {
|
|
1117
1163
|
apiKey?: string;
|
|
@@ -1144,11 +1190,11 @@ interface ReasonixConfig {
|
|
|
1144
1190
|
session?: string | null;
|
|
1145
1191
|
setupCompleted?: boolean;
|
|
1146
1192
|
search?: boolean;
|
|
1147
|
-
/** Web search engine backend: "
|
|
1148
|
-
webSearchEngine?: "
|
|
1193
|
+
/** Web search engine backend: "bing" (default, scrapes cn.bing.com), "searxng" (self-hosted SearXNG), "metaso" (Metaso API), "tavily" (LLM-friendly API, free tier), "perplexity" (Perplexity AI), or "exa" (Exa API). */
|
|
1194
|
+
webSearchEngine?: "bing" | "searxng" | "metaso" | "tavily" | "perplexity" | "exa";
|
|
1149
1195
|
/** Base URL for SearXNG instance (default http://localhost:8080). */
|
|
1150
1196
|
webSearchEndpoint?: string;
|
|
1151
|
-
/** Metaso API key. Falls back to METASO_API_KEY env var
|
|
1197
|
+
/** Metaso API key. Falls back to METASO_API_KEY env var. */
|
|
1152
1198
|
metasoApiKey?: string;
|
|
1153
1199
|
/** Tavily API key. Falls back to TAVILY_API_KEY env var. No baked-in default — free tier is 1000/mo per account, sharing would burn out. */
|
|
1154
1200
|
tavilyApiKey?: string;
|
|
@@ -1158,6 +1204,8 @@ interface ReasonixConfig {
|
|
|
1158
1204
|
exaApiKey?: string;
|
|
1159
1205
|
/** TUI mouse-wheel scrolling via SGR mouse tracking. Default true. Set false to fall back to native terminal drag-select for copy (then wheel is terminal-dependent — most terminals translate wheel→arrow in alt-screen, some don't). */
|
|
1160
1206
|
mouseTracking?: boolean;
|
|
1207
|
+
/** Rows scrolled per single SGR mouse-wheel report. Default 1 — most terminals emit 2-5 reports per physical notch, so 1 already produces 2-5 rows per notch (#1419). Bump to 3-5 only if your terminal emits one report per notch and scrolling feels slow (#1494). Clamped to [1, 10]. */
|
|
1208
|
+
mouseWheelRows?: number;
|
|
1161
1209
|
dashboard?: {
|
|
1162
1210
|
/** Pin the embedded dashboard to a fixed port — required for stable SSH tunnels. 0/absent → ephemeral. */
|
|
1163
1211
|
port?: number;
|
|
@@ -1179,6 +1227,8 @@ interface ReasonixConfig {
|
|
|
1179
1227
|
projects?: {
|
|
1180
1228
|
[absoluteRootDir: string]: {
|
|
1181
1229
|
shellAllowed?: string[];
|
|
1230
|
+
/** Project-scoped hooks are arbitrary shell commands; load only after explicit trust. */
|
|
1231
|
+
hooksTrusted?: boolean;
|
|
1182
1232
|
/** Absolute directory prefixes the user pre-approved for outside-sandbox file access (#684). */
|
|
1183
1233
|
pathAllowed?: string[];
|
|
1184
1234
|
};
|
|
@@ -1206,6 +1256,7 @@ interface ReasonixConfig {
|
|
|
1206
1256
|
/** Per-app proxy override. Layered on top of HTTPS_PROXY / NO_PROXY env vars + the default DeepSeek-bypass whitelist. */
|
|
1207
1257
|
proxy?: ProxyConfig;
|
|
1208
1258
|
rateLimit?: RateLimitConfig;
|
|
1259
|
+
toolRateLimit?: ToolRateLimitConfig;
|
|
1209
1260
|
/** Host-enforced engineering lifecycle. Defaults to off so opt-outs pay zero prefix cost. */
|
|
1210
1261
|
engineeringLifecycle?: {
|
|
1211
1262
|
mode?: EngineeringLifecycleMode;
|
|
@@ -1223,7 +1274,7 @@ interface CustomMemoryTypeConfig {
|
|
|
1223
1274
|
priority?: "low" | "medium" | "high";
|
|
1224
1275
|
expires?: "project_end";
|
|
1225
1276
|
}
|
|
1226
|
-
declare function loadMetasoApiKey(path?: string): string;
|
|
1277
|
+
declare function loadMetasoApiKey(path?: string): string | undefined;
|
|
1227
1278
|
/** Perplexity API key — env > config > undefined. Get one at https://perplexity.ai/settings/api */
|
|
1228
1279
|
declare function loadPerplexityApiKey(path?: string): string | undefined;
|
|
1229
1280
|
/** Exa API key — env > config > undefined. Free 1000/mo signup at https://exa.ai */
|
|
@@ -1656,10 +1707,7 @@ declare function runCommand(cmd: string, opts: {
|
|
|
1656
1707
|
}): Promise<RunCommandResult>;
|
|
1657
1708
|
interface ResolveExecutableOptions {
|
|
1658
1709
|
platform?: NodeJS.Platform;
|
|
1659
|
-
env?:
|
|
1660
|
-
PATH?: string;
|
|
1661
|
-
PATHEXT?: string;
|
|
1662
|
-
};
|
|
1710
|
+
env?: Record<string, string | undefined>;
|
|
1663
1711
|
isFile?: (path: string) => boolean;
|
|
1664
1712
|
pathDelimiter?: string;
|
|
1665
1713
|
}
|
|
@@ -1717,7 +1765,7 @@ declare class NeedsConfirmationError extends Error {
|
|
|
1717
1765
|
declare function registerShellTools(registry: ToolRegistry, opts: ShellToolsOptions): ToolRegistry;
|
|
1718
1766
|
declare function formatCommandResult(cmd: string, r: RunCommandResult): string;
|
|
1719
1767
|
|
|
1720
|
-
/** web_search uses
|
|
1768
|
+
/** web_search uses Bing (cn.bing.com — works from CN without proxy); web_fetch sniffs HTML to text. */
|
|
1721
1769
|
|
|
1722
1770
|
interface SearchResult {
|
|
1723
1771
|
title: string;
|
|
@@ -1743,8 +1791,8 @@ interface WebFetchOptions {
|
|
|
1743
1791
|
interface WebSearchOptions {
|
|
1744
1792
|
topK?: number;
|
|
1745
1793
|
signal?: AbortSignal;
|
|
1746
|
-
/** Backend engine: "
|
|
1747
|
-
engine?: "
|
|
1794
|
+
/** Backend engine: "bing" (scrapes cn.bing.com HTML — default, works from CN without proxy), "searxng" (self-hosted SearXNG), "metaso" (Metaso API), "tavily" (LLM-friendly JSON API), "perplexity" (Perplexity AI), or "exa" (Exa API). */
|
|
1795
|
+
engine?: "bing" | "searxng" | "metaso" | "tavily" | "perplexity" | "exa";
|
|
1748
1796
|
/** Base URL for SearXNG. Default http://localhost:8080. */
|
|
1749
1797
|
endpoint?: string;
|
|
1750
1798
|
}
|
|
@@ -1753,7 +1801,7 @@ declare function webSearch(query: string, opts?: WebSearchOptions): Promise<Sear
|
|
|
1753
1801
|
/** Parse SearXNG HTML search results using node-html-parser. */
|
|
1754
1802
|
declare function parseSearxngHtmlResults(html: string): SearchResult[];
|
|
1755
1803
|
/** Title-anchor + snippet-paragraph passes paired positionally — robust to attribute reorder. */
|
|
1756
|
-
declare function
|
|
1804
|
+
declare function parseBingResults(html: string): SearchResult[];
|
|
1757
1805
|
declare function webFetch(url: string, opts?: WebFetchOptions): Promise<PageContent>;
|
|
1758
1806
|
declare function htmlToText(html: string): string;
|
|
1759
1807
|
interface WebToolsOptions {
|
|
@@ -2351,7 +2399,11 @@ type SectionResult<T> = {
|
|
|
2351
2399
|
/** Caller owns initialize() / close() — keeps this pure so tests can feed a FakeMcpTransport. */
|
|
2352
2400
|
declare function inspectMcpServer(client: McpClient): Promise<InspectionReport>;
|
|
2353
2401
|
|
|
2402
|
+
/** Read/write preserves the file's original encoding so edit_file on GB18030 (CN Windows) or UTF-8-BOM files doesn't silently convert or fail SEARCH on mangled decode (issue #1445). */
|
|
2403
|
+
type FileEncoding = "utf8" | "utf8-bom" | "gb18030";
|
|
2404
|
+
|
|
2354
2405
|
/** SEARCH must match byte-for-byte; empty SEARCH = create new file. No fuzzy match — silent wrong edit beats a missing one. */
|
|
2406
|
+
|
|
2355
2407
|
interface EditBlock {
|
|
2356
2408
|
/** Path as written by the model — relative to rootDir, or absolute. */
|
|
2357
2409
|
path: string;
|
|
@@ -2389,6 +2441,8 @@ interface EditSnapshot {
|
|
|
2389
2441
|
path: string;
|
|
2390
2442
|
/** `null` = file didn't exist; restore means delete. */
|
|
2391
2443
|
prevContent: string | null;
|
|
2444
|
+
/** Encoding the file used before the edit. Required to round-trip GB18030 / UTF-8-BOM on restore. */
|
|
2445
|
+
prevEncoding?: FileEncoding;
|
|
2392
2446
|
}
|
|
2393
2447
|
/** De-duped by path — one "before" snapshot per file even with multiple blocks. */
|
|
2394
2448
|
declare function snapshotBeforeEdits(blocks: EditBlock[], rootDir: string): EditSnapshot[];
|
|
@@ -2558,4 +2612,4 @@ declare function aggregateUsage(records: UsageRecord[], opts?: AggregateOptions)
|
|
|
2558
2612
|
/** File-size helper for the stats header — "1.2 MB" etc. Returns "" if missing. */
|
|
2559
2613
|
declare function formatLogSize(path?: string): string;
|
|
2560
2614
|
|
|
2561
|
-
export { AT_MENTION_PATTERN, AT_PICKER_PREFIX, type AggregateOptions, AppendOnlyLog, type AppendUsageInput, type ApplyResult, type ApplyStatus, type AtMentionExpansion, type AtMentionOptions, type BridgeOptions, type BridgeResult, CODE_SYSTEM_PROMPT, CacheFirstLoop, type CacheFirstLoopOptions, type CallToolResult, type ChatMessage, type ChatResponse, type ChoiceOption, ChoiceRequestedError, type ChoiceToolOptions, type CodeSystemPromptOptions, DEFAULT_AT_DIR_MAX_ENTRIES, DEFAULT_AT_MENTION_MAX_BYTES, DEFAULT_MAX_RESULT_CHARS, DEFAULT_MAX_RESULT_TOKENS, DEFAULT_PICKER_IGNORE_DIRS, DEFAULT_SPAWN_STORM_THRESHOLD, DeepSeekClient, type DeepSeekClientOptions, type RenderOptions as DiffRenderOptions, type DiffReport, type DiffSide, type DirEntry, type EditBlock, type EditSnapshot, type EventRole, type FileWithStats, type FilesystemToolsOptions, type FlattenDecision, type FlattenOptions, type GetLatestVersionOptions, type GetPromptResult, HOOK_EVENTS, HOOK_SETTINGS_DIRNAME, HOOK_SETTINGS_FILENAME, type HookConfig, type HookEvent, type HookOutcome, type HookPayload, type HookReport, type HookScope, type HookSettings, type HookSpawnInput, type HookSpawnResult, type HookSpawner, ImmutablePrefix, type ImmutablePrefixOptions, type InitializeResult, type InspectionReport, type InstallSource, type JSONSchema, type JsonRpcMessage, type JsonRpcRequest, type JsonRpcResponse, LATEST_CACHE_TTL_MS, LATEST_FETCH_TIMEOUT_MS, type ListDirectoryOptions, type ListFilesOptions, type ListPromptsResult, type ListResourcesResult, type ListToolsResult, type LoadHookSettingsOptions, type LoopEvent, MCP_PROTOCOL_VERSION, MEMORY_INDEX_FILE, MEMORY_INDEX_MAX_CHARS, McpClient, type McpClientOptions, type McpContentBlock, type McpProgressHandler, type McpProgressInfo, type McpPrompt, type McpPromptArgument, type McpPromptMessage, type McpPromptResourceBlock, type McpResource, type McpResourceContents, type McpResourceContentsBlob, type McpResourceContentsText, type McpSpec, type McpTool, type McpToolSchema, type McpTransport, type MemoryEntry, type MemoryScope, MemoryStore, type MemoryStoreOptions, type MemoryToolsOptions, type MemoryType, type WriteInput as MemoryWriteInput, NeedsConfirmationError, PROJECT_MEMORY_FILE, PROJECT_MEMORY_FILES, PROJECT_MEMORY_MAX_CHARS, type PageContent, type ParsedAtQuery, type PickerCandidate, PlanProposedError, PlanRevisionProposedError, type PlanStep, type PlanStepRisk, type PlanToolOptions, type ProgressNotificationParams, type ProjectMemory, type RankPickerOptions, type ReadResourceResult, type ReadTranscriptResult, type ReasonixConfig, type ReconfigurableOptions, type RepairReport, type ReplayStats, type ResolvedHook, type RetryInfo, type RetryOptions, type Role, type RunCommandResult, type RunHooksOptions, type ScavengeOptions, type ScavengeResult, type SearchResult, type SectionResult, type SessionInfo, SessionStats, type SessionSummary, type ShellToolsOptions, type SpawnDistillation, type SseMcpSpec, SseTransport, type SseTransportOptions, type StdioMcpSpec, StdioTransport, type StdioTransportOptions, type StepCompletion, StormBreaker, type StreamChunk, type StreamWalkOptions, type StreamableHttpMcpSpec, StreamableHttpTransport, type StreamableHttpTransportOptions, type SubagentEvent, type SubagentResult, type SubagentResultLike, type SubagentSessionSummary, type SubagentSink, SubagentTelemetry, type SubagentToolOptions, type TodoItem, type TodoStatus, type TodoToolOptions, type ToolCall, type ToolCallContext, ToolCallRepair, type ToolCallRepairOptions, type ToolDefinition, type ToolFunctionSpec, ToolRegistry, type ToolSpec, type TranscriptMeta, type TranscriptRecord, type TruncationRepairResult, type TurnPair, type TurnStats, USER_MEMORY_DIR, Usage, type UsageAggregate, type UsageBucket, type UsageRecord, VERSION, VolatileScratch, type WebFetchOptions, type WebSearchOptions, type WebToolsOptions, aggregateUsage, analyzeSchema, appendSessionMessage, appendUsage, applyEditBlock, applyEditBlocks, applyMemoryStack, applyProjectMemory, applyUserMemory, bridgeMcpTools, bucketCacheHitRatio, bucketSavingsFraction, claudeEquivalentCost, codeSystemPrompt, compareVersions, computeReplayStats, computeSpawnDistillation, costUsd, countSpawnStorms, decideOutcome, defaultConfigPath, defaultUsageLogPath, deleteSession, detectAtPicker, detectInstallSource, detectNpmInstallPrefix, detectShellOperator, diffTranscripts, expandAtMentions, fetchWithRetry, findProjectMemoryPath, fixToolCallPairing, flattenMcpResult, flattenSchema, forkRegistryExcluding, formatCommandResult, formatHookOutcomeMessage, formatLogSize, formatLoopError, formatSearchResults, getLatestVersion, globalSettingsPath, healLoadedMessages, healLoadedMessagesByTokens, htmlToText, injectPowerShellUtf8, inputCostUsd, inspectMcpServer, isAllowed, isJsonRpcError, isNpxInstall, isPlausibleKey, listDirectory, listFilesSync, listFilesWithStatsAsync, listFilesWithStatsSync, listSessions, loadApiKey, loadBaseUrl, loadDotenv, loadExaApiKey, loadHooks, loadMetasoApiKey, loadPerplexityApiKey, loadSessionMessages, matchesTool, memoryEnabled, nestArguments, openTranscriptFile, outputCostUsd, parseAtQuery, parseEditBlocks, parseMcpSpec,
|
|
2615
|
+
export { AT_MENTION_PATTERN, AT_PICKER_PREFIX, type AggregateOptions, AppendOnlyLog, type AppendUsageInput, type ApplyResult, type ApplyStatus, type AtMentionExpansion, type AtMentionOptions, type BridgeOptions, type BridgeResult, CODE_SYSTEM_PROMPT, CacheFirstLoop, type CacheFirstLoopOptions, type CallToolResult, type ChatMessage, type ChatResponse, type ChoiceOption, ChoiceRequestedError, type ChoiceToolOptions, type CodeSystemPromptOptions, DEFAULT_AT_DIR_MAX_ENTRIES, DEFAULT_AT_MENTION_MAX_BYTES, DEFAULT_MAX_RESULT_CHARS, DEFAULT_MAX_RESULT_TOKENS, DEFAULT_PICKER_IGNORE_DIRS, DEFAULT_SPAWN_STORM_THRESHOLD, DeepSeekClient, type DeepSeekClientOptions, type RenderOptions as DiffRenderOptions, type DiffReport, type DiffSide, type DirEntry, type EditBlock, type EditSnapshot, type EventRole, type FileWithStats, type FilesystemToolsOptions, type FlattenDecision, type FlattenOptions, type GetLatestVersionOptions, type GetPromptResult, HOOK_EVENTS, HOOK_SETTINGS_DIRNAME, HOOK_SETTINGS_FILENAME, type HookConfig, type HookEvent, type HookOutcome, type HookPayload, type HookReport, type HookScope, type HookSettings, type HookSpawnInput, type HookSpawnResult, type HookSpawner, ImmutablePrefix, type ImmutablePrefixOptions, type InitializeResult, type InspectionReport, type InstallSource, type JSONSchema, type JsonRpcMessage, type JsonRpcRequest, type JsonRpcResponse, LATEST_CACHE_TTL_MS, LATEST_FETCH_TIMEOUT_MS, type ListDirectoryOptions, type ListFilesOptions, type ListPromptsResult, type ListResourcesResult, type ListToolsResult, type LoadHookSettingsOptions, type LoopEvent, MCP_PROTOCOL_VERSION, MEMORY_INDEX_FILE, MEMORY_INDEX_MAX_CHARS, McpClient, type McpClientOptions, type McpContentBlock, type McpProgressHandler, type McpProgressInfo, type McpPrompt, type McpPromptArgument, type McpPromptMessage, type McpPromptResourceBlock, type McpResource, type McpResourceContents, type McpResourceContentsBlob, type McpResourceContentsText, type McpSpec, type McpTool, type McpToolSchema, type McpTransport, type MemoryEntry, type MemoryScope, MemoryStore, type MemoryStoreOptions, type MemoryToolsOptions, type MemoryType, type WriteInput as MemoryWriteInput, NeedsConfirmationError, PROJECT_MEMORY_FILE, PROJECT_MEMORY_FILES, PROJECT_MEMORY_MAX_CHARS, type PageContent, type ParsedAtQuery, type PickerCandidate, PlanProposedError, PlanRevisionProposedError, type PlanStep, type PlanStepRisk, type PlanToolOptions, type ProgressNotificationParams, type ProjectMemory, type RankPickerOptions, type ReadResourceResult, type ReadTranscriptResult, type ReasonixConfig, type ReconfigurableOptions, type RepairReport, type ReplayStats, type ResolvedHook, type RetryInfo, type RetryOptions, type Role, type RunCommandResult, type RunHooksOptions, type ScavengeOptions, type ScavengeResult, type SearchResult, type SectionResult, type SessionInfo, SessionStats, type SessionSummary, type ShellToolsOptions, type SpawnDistillation, type SseMcpSpec, SseTransport, type SseTransportOptions, type StdioMcpSpec, StdioTransport, type StdioTransportOptions, type StepCompletion, StormBreaker, type StreamChunk, type StreamWalkOptions, type StreamableHttpMcpSpec, StreamableHttpTransport, type StreamableHttpTransportOptions, type SubagentEvent, type SubagentResult, type SubagentResultLike, type SubagentSessionSummary, type SubagentSink, SubagentTelemetry, type SubagentToolOptions, type TodoItem, type TodoStatus, type TodoToolOptions, type ToolCall, type ToolCallContext, ToolCallRepair, type ToolCallRepairOptions, type ToolDefinition, type ToolFunctionSpec, ToolRegistry, type ToolSpec, type TranscriptMeta, type TranscriptRecord, type TruncationRepairResult, type TurnPair, type TurnStats, USER_MEMORY_DIR, Usage, type UsageAggregate, type UsageBucket, type UsageRecord, VERSION, VolatileScratch, type WebFetchOptions, type WebSearchOptions, type WebToolsOptions, aggregateUsage, analyzeSchema, appendSessionMessage, appendUsage, applyEditBlock, applyEditBlocks, applyMemoryStack, applyProjectMemory, applyUserMemory, bridgeMcpTools, bucketCacheHitRatio, bucketSavingsFraction, claudeEquivalentCost, codeSystemPrompt, compareVersions, computeReplayStats, computeSpawnDistillation, costUsd, countSpawnStorms, decideOutcome, defaultConfigPath, defaultUsageLogPath, deleteSession, detectAtPicker, detectInstallSource, detectNpmInstallPrefix, detectShellOperator, diffTranscripts, expandAtMentions, fetchWithRetry, findProjectMemoryPath, fixToolCallPairing, flattenMcpResult, flattenSchema, forkRegistryExcluding, formatCommandResult, formatHookOutcomeMessage, formatLogSize, formatLoopError, formatSearchResults, getLatestVersion, globalSettingsPath, healLoadedMessages, healLoadedMessagesByTokens, htmlToText, injectPowerShellUtf8, inputCostUsd, inspectMcpServer, isAllowed, isJsonRpcError, isNpxInstall, isPlausibleKey, listDirectory, listFilesSync, listFilesWithStatsAsync, listFilesWithStatsSync, listSessions, loadApiKey, loadBaseUrl, loadDotenv, loadExaApiKey, loadHooks, loadMetasoApiKey, loadPerplexityApiKey, loadSessionMessages, matchesTool, memoryEnabled, nestArguments, openTranscriptFile, outputCostUsd, parseAtQuery, parseBingResults, parseEditBlocks, parseMcpSpec, parseSearxngHtmlResults, parseTranscript, prepareSpawn, projectHash, projectSettingsPath, quoteForCmdExe, rankPickerCandidates, readConfig, readProjectMemory, readTranscript, readUsageLog, recordFromLoopEvent, redactKey, registerChoiceTool, registerFilesystemTools, registerMemoryTools, registerPlanTool, registerShellTools, registerSubagentTool, registerTodoTool, registerWebTools, renderMarkdown as renderDiffMarkdown, renderSummaryTable as renderDiffSummary, repairTruncatedJson, replayFromFile, resolveExecutable, resolveProjectMemoryWritePath, restoreSnapshots, runCommand, runHooks, sanitizeMemoryName, sanitizeName as sanitizeSessionName, saveApiKey, saveBaseUrl, scavengeToolCalls, sessionPath, sessionsDir, similarity, snapshotBeforeEdits, stripHallucinatedToolMarkup, summarizeSubagentSession, tokenizeCommand, truncateForModel, truncateForModelByTokens, walkFilesStream, webFetch, webSearch, withUtf8Codepage, writeConfig, writeMeta, writeRecord };
|