reasonix 0.48.1 → 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/dashboard/dist/app.js +123 -16
- package/dashboard/dist/app.js.map +1 -1
- package/dist/cli/{acp-QJGGHQLA.js → acp-WFQIC6SO.js} +18 -18
- package/dist/cli/chat-D32JGNVH.js +51 -0
- package/dist/cli/{chunk-TIJ4ZHD6.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-H2F4LDNH.js → chunk-7AST3QQ3.js} +2 -2
- package/dist/cli/{chunk-XMR2VCGT.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-WKOXKCF3.js → chunk-ASOLXV67.js} +3 -3
- package/dist/cli/{chunk-43ROGEX2.js → chunk-AWEULQG6.js} +10 -9
- package/dist/cli/{chunk-43ROGEX2.js.map → chunk-AWEULQG6.js.map} +1 -1
- package/dist/cli/{chunk-5AW6NIHU.js → chunk-DFX5ZH5L.js} +2 -2
- package/dist/cli/{chunk-4E2BHJU4.js → chunk-GNS7BAT2.js} +2 -2
- package/dist/cli/{chunk-5U5LMMFF.js → chunk-J2IHQGPQ.js} +12 -6
- package/dist/cli/chunk-J2IHQGPQ.js.map +1 -0
- package/dist/cli/{chunk-O3AGYTG2.js → chunk-JGTX4RRQ.js} +3 -3
- package/dist/cli/{chunk-SLAFMXAZ.js → chunk-JNTMOX7G.js} +2 -2
- package/dist/cli/{chunk-RCLS63KE.js → chunk-MGTBP7GG.js} +2 -2
- package/dist/cli/{chunk-JFBGSWQB.js → chunk-MQWO32ZD.js} +323 -159
- package/dist/cli/chunk-MQWO32ZD.js.map +1 -0
- package/dist/cli/{chunk-FD7SNDWW.js → chunk-O5LIHAMP.js} +8 -4
- package/dist/cli/chunk-O5LIHAMP.js.map +1 -0
- package/dist/cli/{chunk-PJIQIYTV.js → chunk-PB3MAFEI.js} +3 -3
- package/dist/cli/{chunk-NQZ5U37J.js → chunk-PEMG6CUB.js} +2 -2
- package/dist/cli/{chunk-KH5JIJJD.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-DABAOQSV.js → chunk-QF32ROX2.js} +1260 -1754
- package/dist/cli/chunk-QF32ROX2.js.map +1 -0
- package/dist/cli/{chunk-IKSYVBBZ.js → chunk-QX5TWXRZ.js} +2 -2
- package/dist/cli/{chunk-R7U44O3Y.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-EO6RPTJG.js → chunk-U5XQDCK7.js} +5 -5
- package/dist/cli/{chunk-SWUMD2LX.js → chunk-W46ZMNKO.js} +3 -3
- package/dist/cli/{chunk-FPME5QOO.js → chunk-WMTMMSXU.js} +166 -5
- package/dist/cli/chunk-WMTMMSXU.js.map +1 -0
- package/dist/cli/{chunk-PIC5HJRD.js → chunk-YEF7C4XI.js} +154 -86
- package/dist/cli/chunk-YEF7C4XI.js.map +1 -0
- package/dist/cli/{chunk-3FULTFRB.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-OKA5YPOH.js → code-R4IHI7SR.js} +30 -30
- package/dist/cli/{commands-3U6PUVSS.js → commands-DRHFCYMO.js} +4 -4
- package/dist/cli/{commit-HFB7SRBU.js → commit-AG5KB4YP.js} +3 -3
- package/dist/cli/{desktop-G7UMW3CJ.js → desktop-JGL6GORA.js} +19 -19
- package/dist/cli/{diff-PGXW4YZD.js → diff-4Z7ETWZO.js} +9 -9
- package/dist/cli/{doctor-WWJFLVCB.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-Y3VKIK3T.js → mcp-LZO4HXFA.js} +34 -23
- package/dist/cli/mcp-LZO4HXFA.js.map +1 -0
- package/dist/cli/{mcp-browse-4IN2QIFR.js → mcp-browse-C3GXVMYZ.js} +3 -3
- package/dist/cli/{mcp-inspect-BUXFXDHB.js → mcp-inspect-ZMYUNFDS.js} +2 -2
- package/dist/cli/{prompt-US57R6BA.js → prompt-MC3U5KRP.js} +5 -5
- 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-EQJMZRB3.js → replay-4TP7ZUMZ.js} +10 -10
- package/dist/cli/{run-KVEI66TR.js → run-6MXQYBOE.js} +16 -15
- package/dist/cli/run-6MXQYBOE.js.map +1 -0
- package/dist/cli/{server-D6C4GHWN.js → server-Z3IMJNNI.js} +63 -12
- package/dist/cli/server-Z3IMJNNI.js.map +1 -0
- package/dist/cli/{sessions-TGVS2RQZ.js → sessions-NXQ5SAV7.js} +18 -18
- package/dist/cli/sessions-NXQ5SAV7.js.map +1 -0
- package/dist/cli/{setup-WLKX6GGG.js → setup-LHZELI6I.js} +6 -6
- package/dist/cli/{stats-TCD7Q6MB.js → stats-SUIJ3QWY.js} +6 -6
- package/dist/cli/{version-BCWWS2OU.js → version-BIFONEUB.js} +13 -13
- package/dist/index.d.ts +63 -15
- package/dist/index.js +855 -360
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/cli/chat-ZXF227MP.js +0 -51
- package/dist/cli/chunk-5U5LMMFF.js.map +0 -1
- package/dist/cli/chunk-6FRNXWDZ.js +0 -2265
- package/dist/cli/chunk-6FRNXWDZ.js.map +0 -1
- package/dist/cli/chunk-B5CZL2SE.js.map +0 -1
- package/dist/cli/chunk-DABAOQSV.js.map +0 -1
- package/dist/cli/chunk-FD7SNDWW.js.map +0 -1
- package/dist/cli/chunk-FPME5QOO.js.map +0 -1
- package/dist/cli/chunk-JFBGSWQB.js.map +0 -1
- package/dist/cli/chunk-PIC5HJRD.js.map +0 -1
- package/dist/cli/chunk-TIJ4ZHD6.js.map +0 -1
- package/dist/cli/chunk-TKVXTQ3T.js.map +0 -1
- package/dist/cli/mcp-Y3VKIK3T.js.map +0 -1
- package/dist/cli/prune-sessions-SEWX7GP6.js.map +0 -1
- package/dist/cli/run-KVEI66TR.js.map +0 -1
- package/dist/cli/server-D6C4GHWN.js.map +0 -1
- package/dist/cli/sessions-TGVS2RQZ.js.map +0 -1
- /package/dist/cli/{acp-QJGGHQLA.js.map → acp-WFQIC6SO.js.map} +0 -0
- /package/dist/cli/{chat-ZXF227MP.js.map → chat-D32JGNVH.js.map} +0 -0
- /package/dist/cli/{chunk-H2F4LDNH.js.map → chunk-7AST3QQ3.js.map} +0 -0
- /package/dist/cli/{chunk-XMR2VCGT.js.map → chunk-7JTKBJ2G.js.map} +0 -0
- /package/dist/cli/{chunk-WKOXKCF3.js.map → chunk-ASOLXV67.js.map} +0 -0
- /package/dist/cli/{chunk-5AW6NIHU.js.map → chunk-DFX5ZH5L.js.map} +0 -0
- /package/dist/cli/{chunk-4E2BHJU4.js.map → chunk-GNS7BAT2.js.map} +0 -0
- /package/dist/cli/{chunk-O3AGYTG2.js.map → chunk-JGTX4RRQ.js.map} +0 -0
- /package/dist/cli/{chunk-SLAFMXAZ.js.map → chunk-JNTMOX7G.js.map} +0 -0
- /package/dist/cli/{chunk-RCLS63KE.js.map → chunk-MGTBP7GG.js.map} +0 -0
- /package/dist/cli/{chunk-PJIQIYTV.js.map → chunk-PB3MAFEI.js.map} +0 -0
- /package/dist/cli/{chunk-NQZ5U37J.js.map → chunk-PEMG6CUB.js.map} +0 -0
- /package/dist/cli/{chunk-KH5JIJJD.js.map → chunk-PXBQ6IZ7.js.map} +0 -0
- /package/dist/cli/{chunk-IKSYVBBZ.js.map → chunk-QX5TWXRZ.js.map} +0 -0
- /package/dist/cli/{chunk-R7U44O3Y.js.map → chunk-TAIKVL35.js.map} +0 -0
- /package/dist/cli/{chunk-EO6RPTJG.js.map → chunk-U5XQDCK7.js.map} +0 -0
- /package/dist/cli/{chunk-SWUMD2LX.js.map → chunk-W46ZMNKO.js.map} +0 -0
- /package/dist/cli/{chunk-3FULTFRB.js.map → chunk-ZAEJWKXB.js.map} +0 -0
- /package/dist/cli/{code-OKA5YPOH.js.map → code-R4IHI7SR.js.map} +0 -0
- /package/dist/cli/{commands-3U6PUVSS.js.map → commands-DRHFCYMO.js.map} +0 -0
- /package/dist/cli/{commit-HFB7SRBU.js.map → commit-AG5KB4YP.js.map} +0 -0
- /package/dist/cli/{desktop-G7UMW3CJ.js.map → desktop-JGL6GORA.js.map} +0 -0
- /package/dist/cli/{diff-PGXW4YZD.js.map → diff-4Z7ETWZO.js.map} +0 -0
- /package/dist/cli/{doctor-WWJFLVCB.js.map → doctor-VA3RHQLB.js.map} +0 -0
- /package/dist/cli/{mcp-browse-4IN2QIFR.js.map → mcp-browse-C3GXVMYZ.js.map} +0 -0
- /package/dist/cli/{mcp-inspect-BUXFXDHB.js.map → mcp-inspect-ZMYUNFDS.js.map} +0 -0
- /package/dist/cli/{prompt-US57R6BA.js.map → prompt-MC3U5KRP.js.map} +0 -0
- /package/dist/cli/{replay-EQJMZRB3.js.map → replay-4TP7ZUMZ.js.map} +0 -0
- /package/dist/cli/{setup-WLKX6GGG.js.map → setup-LHZELI6I.js.map} +0 -0
- /package/dist/cli/{stats-TCD7Q6MB.js.map → stats-SUIJ3QWY.js.map} +0 -0
- /package/dist/cli/{version-BCWWS2OU.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
|
@@ -584,7 +584,7 @@ type EventRole = "assistant_delta" | "assistant_final"
|
|
|
584
584
|
| "tool_start" | "tool" | "done" | "error" | "warning"
|
|
585
585
|
/** Transient indicator for silent phases; UI clears on next primary event. */
|
|
586
586
|
| "status"
|
|
587
|
-
/** Mid-turn steer injected as
|
|
587
|
+
/** Mid-turn steer injected as queued user guidance without aborting the current turn. */
|
|
588
588
|
| "steer";
|
|
589
589
|
interface LoopEvent {
|
|
590
590
|
turn: number;
|
|
@@ -653,10 +653,42 @@ declare class VolatileScratch {
|
|
|
653
653
|
reset(): void;
|
|
654
654
|
}
|
|
655
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
|
+
|
|
656
686
|
interface ToolCallContext {
|
|
657
687
|
signal?: AbortSignal;
|
|
658
688
|
/** Inject a mock PauseGate for tests. When absent, tools use the singleton. */
|
|
659
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;
|
|
660
692
|
}
|
|
661
693
|
interface ToolDefinition<A = any, R = any> {
|
|
662
694
|
name: string;
|
|
@@ -675,6 +707,7 @@ interface ToolDefinition<A = any, R = any> {
|
|
|
675
707
|
interface ToolRegistryOptions {
|
|
676
708
|
/** Auto-flatten + re-nest at dispatch; default true. */
|
|
677
709
|
autoFlatten?: boolean;
|
|
710
|
+
rateLimit?: ToolRateLimitOption;
|
|
678
711
|
}
|
|
679
712
|
type ToolCallAuditEvent = {
|
|
680
713
|
name: string;
|
|
@@ -693,6 +726,7 @@ declare class ToolRegistry {
|
|
|
693
726
|
private readonly _interceptors;
|
|
694
727
|
private _auditListener;
|
|
695
728
|
private _resultAugmenter;
|
|
729
|
+
private readonly _rateLimiter;
|
|
696
730
|
/** Per-tool fingerprint of the last call that failed schema validation. Cleared by any successful validation for that tool. */
|
|
697
731
|
private readonly _lastMalformed;
|
|
698
732
|
/** Per-tool fingerprint of the last host-side gate rejection. */
|
|
@@ -711,6 +745,7 @@ declare class ToolRegistry {
|
|
|
711
745
|
setResultAugmenter(fn: ToolResultAugmenter | null): void;
|
|
712
746
|
/** True when an augmenter is already wired — lets late-installing callers skip clobbering an earlier one. */
|
|
713
747
|
get hasResultAugmenter(): boolean;
|
|
748
|
+
get rateLimitPolicy(): false | NormalizedToolRateLimitConfig;
|
|
714
749
|
register<A, R>(def: ToolDefinition<A, R>): this;
|
|
715
750
|
/** Drop a registered tool. Returns true if the name was present. Used by MCP hot-unbridge. */
|
|
716
751
|
unregister(name: string): boolean;
|
|
@@ -728,6 +763,8 @@ declare class ToolRegistry {
|
|
|
728
763
|
maxResultTokens?: number;
|
|
729
764
|
/** Inject a mock PauseGate for tests. */
|
|
730
765
|
confirmationGate?: PauseGate;
|
|
766
|
+
/** Session-scoped read tracker; filesystem tools mark on read/write, edit_file/multi_edit gate on it. */
|
|
767
|
+
readTracker?: ReadTracker;
|
|
731
768
|
}): Promise<string>;
|
|
732
769
|
private _augmentResult;
|
|
733
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. */
|
|
@@ -771,6 +808,8 @@ declare class CacheFirstLoop {
|
|
|
771
808
|
readonly scratch: VolatileScratch;
|
|
772
809
|
readonly stats: SessionStats;
|
|
773
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;
|
|
774
813
|
model: string;
|
|
775
814
|
stream: boolean;
|
|
776
815
|
reasoningEffort: "high" | "max";
|
|
@@ -792,12 +831,12 @@ declare class CacheFirstLoop {
|
|
|
792
831
|
private _turnAbort;
|
|
793
832
|
/** Authoritative running-id set — UI cards consult this instead of trusting end-event delivery. Insert at dispatch entry, delete in finally. */
|
|
794
833
|
private readonly _inflight;
|
|
795
|
-
/** Typeahead steer
|
|
796
|
-
private
|
|
834
|
+
/** Typeahead steer messages set by the UI; step() consumes one at each iter boundary. */
|
|
835
|
+
private readonly _steerQueue;
|
|
797
836
|
/** Set true when a steer was consumed this turn; cleared on next step() entry. */
|
|
798
837
|
private _steerConsumed;
|
|
799
838
|
/** UI calls this to inject a mid-turn steer message without aborting the current turn.
|
|
800
|
-
* New text resets steerConsumed
|
|
839
|
+
* New text resets steerConsumed because a fresh steer is queued. */
|
|
801
840
|
steer(text: string | null): void;
|
|
802
841
|
/** True when a steer was consumed this turn (UI gate to avoid double-submit). */
|
|
803
842
|
get steerConsumed(): boolean;
|
|
@@ -1109,6 +1148,7 @@ interface PricingOverride {
|
|
|
1109
1148
|
output?: number;
|
|
1110
1149
|
}
|
|
1111
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. */
|
|
1112
1152
|
rpm?: number;
|
|
1113
1153
|
}
|
|
1114
1154
|
interface ProxyConfig {
|
|
@@ -1116,6 +1156,8 @@ interface ProxyConfig {
|
|
|
1116
1156
|
disabled?: boolean;
|
|
1117
1157
|
/** Additional NO_PROXY patterns (curl syntax). Additive on top of env NO_PROXY and the default DeepSeek-bypass whitelist. */
|
|
1118
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;
|
|
1119
1161
|
}
|
|
1120
1162
|
interface ReasonixConfig {
|
|
1121
1163
|
apiKey?: string;
|
|
@@ -1148,8 +1190,8 @@ interface ReasonixConfig {
|
|
|
1148
1190
|
session?: string | null;
|
|
1149
1191
|
setupCompleted?: boolean;
|
|
1150
1192
|
search?: boolean;
|
|
1151
|
-
/** Web search engine backend: "
|
|
1152
|
-
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";
|
|
1153
1195
|
/** Base URL for SearXNG instance (default http://localhost:8080). */
|
|
1154
1196
|
webSearchEndpoint?: string;
|
|
1155
1197
|
/** Metaso API key. Falls back to METASO_API_KEY env var. */
|
|
@@ -1162,6 +1204,8 @@ interface ReasonixConfig {
|
|
|
1162
1204
|
exaApiKey?: string;
|
|
1163
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). */
|
|
1164
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;
|
|
1165
1209
|
dashboard?: {
|
|
1166
1210
|
/** Pin the embedded dashboard to a fixed port — required for stable SSH tunnels. 0/absent → ephemeral. */
|
|
1167
1211
|
port?: number;
|
|
@@ -1212,6 +1256,7 @@ interface ReasonixConfig {
|
|
|
1212
1256
|
/** Per-app proxy override. Layered on top of HTTPS_PROXY / NO_PROXY env vars + the default DeepSeek-bypass whitelist. */
|
|
1213
1257
|
proxy?: ProxyConfig;
|
|
1214
1258
|
rateLimit?: RateLimitConfig;
|
|
1259
|
+
toolRateLimit?: ToolRateLimitConfig;
|
|
1215
1260
|
/** Host-enforced engineering lifecycle. Defaults to off so opt-outs pay zero prefix cost. */
|
|
1216
1261
|
engineeringLifecycle?: {
|
|
1217
1262
|
mode?: EngineeringLifecycleMode;
|
|
@@ -1662,10 +1707,7 @@ declare function runCommand(cmd: string, opts: {
|
|
|
1662
1707
|
}): Promise<RunCommandResult>;
|
|
1663
1708
|
interface ResolveExecutableOptions {
|
|
1664
1709
|
platform?: NodeJS.Platform;
|
|
1665
|
-
env?:
|
|
1666
|
-
PATH?: string;
|
|
1667
|
-
PATHEXT?: string;
|
|
1668
|
-
};
|
|
1710
|
+
env?: Record<string, string | undefined>;
|
|
1669
1711
|
isFile?: (path: string) => boolean;
|
|
1670
1712
|
pathDelimiter?: string;
|
|
1671
1713
|
}
|
|
@@ -1723,7 +1765,7 @@ declare class NeedsConfirmationError extends Error {
|
|
|
1723
1765
|
declare function registerShellTools(registry: ToolRegistry, opts: ShellToolsOptions): ToolRegistry;
|
|
1724
1766
|
declare function formatCommandResult(cmd: string, r: RunCommandResult): string;
|
|
1725
1767
|
|
|
1726
|
-
/** web_search uses
|
|
1768
|
+
/** web_search uses Bing (cn.bing.com — works from CN without proxy); web_fetch sniffs HTML to text. */
|
|
1727
1769
|
|
|
1728
1770
|
interface SearchResult {
|
|
1729
1771
|
title: string;
|
|
@@ -1749,8 +1791,8 @@ interface WebFetchOptions {
|
|
|
1749
1791
|
interface WebSearchOptions {
|
|
1750
1792
|
topK?: number;
|
|
1751
1793
|
signal?: AbortSignal;
|
|
1752
|
-
/** Backend engine: "
|
|
1753
|
-
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";
|
|
1754
1796
|
/** Base URL for SearXNG. Default http://localhost:8080. */
|
|
1755
1797
|
endpoint?: string;
|
|
1756
1798
|
}
|
|
@@ -1759,7 +1801,7 @@ declare function webSearch(query: string, opts?: WebSearchOptions): Promise<Sear
|
|
|
1759
1801
|
/** Parse SearXNG HTML search results using node-html-parser. */
|
|
1760
1802
|
declare function parseSearxngHtmlResults(html: string): SearchResult[];
|
|
1761
1803
|
/** Title-anchor + snippet-paragraph passes paired positionally — robust to attribute reorder. */
|
|
1762
|
-
declare function
|
|
1804
|
+
declare function parseBingResults(html: string): SearchResult[];
|
|
1763
1805
|
declare function webFetch(url: string, opts?: WebFetchOptions): Promise<PageContent>;
|
|
1764
1806
|
declare function htmlToText(html: string): string;
|
|
1765
1807
|
interface WebToolsOptions {
|
|
@@ -2357,7 +2399,11 @@ type SectionResult<T> = {
|
|
|
2357
2399
|
/** Caller owns initialize() / close() — keeps this pure so tests can feed a FakeMcpTransport. */
|
|
2358
2400
|
declare function inspectMcpServer(client: McpClient): Promise<InspectionReport>;
|
|
2359
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
|
+
|
|
2360
2405
|
/** SEARCH must match byte-for-byte; empty SEARCH = create new file. No fuzzy match — silent wrong edit beats a missing one. */
|
|
2406
|
+
|
|
2361
2407
|
interface EditBlock {
|
|
2362
2408
|
/** Path as written by the model — relative to rootDir, or absolute. */
|
|
2363
2409
|
path: string;
|
|
@@ -2395,6 +2441,8 @@ interface EditSnapshot {
|
|
|
2395
2441
|
path: string;
|
|
2396
2442
|
/** `null` = file didn't exist; restore means delete. */
|
|
2397
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;
|
|
2398
2446
|
}
|
|
2399
2447
|
/** De-duped by path — one "before" snapshot per file even with multiple blocks. */
|
|
2400
2448
|
declare function snapshotBeforeEdits(blocks: EditBlock[], rootDir: string): EditSnapshot[];
|
|
@@ -2564,4 +2612,4 @@ declare function aggregateUsage(records: UsageRecord[], opts?: AggregateOptions)
|
|
|
2564
2612
|
/** File-size helper for the stats header — "1.2 MB" etc. Returns "" if missing. */
|
|
2565
2613
|
declare function formatLogSize(path?: string): string;
|
|
2566
2614
|
|
|
2567
|
-
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 };
|