reasonix 0.50.1 → 0.51.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.css +1 -1
- package/dashboard/dist/app.js +24 -22
- package/dashboard/dist/app.js.map +1 -1
- package/dist/cli/{acp-6B25WIFF.js → acp-XEUHGG7X.js} +34 -31
- package/dist/cli/acp-XEUHGG7X.js.map +1 -0
- package/dist/cli/chat-NJ2Q5KHG.js +50 -0
- package/dist/cli/{chunk-OPGWCKKU.js → chunk-2HVTBFCI.js} +3 -3
- package/dist/cli/{chunk-AJIZ5KFK.js → chunk-2WUEAI2I.js} +3 -3
- package/dist/cli/{chunk-I4Q3QT4W.js → chunk-36BM7INR.js} +2 -2
- package/dist/cli/{chunk-3RNFYDDM.js → chunk-3BTK5BHI.js} +11 -7
- package/dist/cli/chunk-3BTK5BHI.js.map +1 -0
- package/dist/cli/{chunk-GMSAB2TC.js → chunk-3YRTIWFX.js} +2 -2
- package/dist/cli/{chunk-NLRC3DWQ.js → chunk-544J4PXD.js} +5 -5
- package/dist/cli/{chunk-7WITYWKN.js → chunk-5AIDYVH2.js} +2 -2
- package/dist/cli/{chunk-ALCOQP6R.js → chunk-5BBC6YMV.js} +5 -5
- package/dist/cli/{chunk-S4XVGLRW.js → chunk-6UNHNVJR.js} +72 -5
- package/dist/cli/chunk-6UNHNVJR.js.map +1 -0
- package/dist/cli/{chunk-IK6WWRIX.js → chunk-6XWXIVQ3.js} +38 -22
- package/dist/cli/chunk-6XWXIVQ3.js.map +1 -0
- package/dist/cli/{chunk-AAHB2PFX.js → chunk-7YB26OQO.js} +4 -4
- package/dist/cli/chunk-7YB26OQO.js.map +1 -0
- package/dist/cli/{chunk-MXWPAPZW.js → chunk-A5PBEIJ7.js} +53 -10
- package/dist/cli/chunk-A5PBEIJ7.js.map +1 -0
- package/dist/cli/{chunk-FQSQFCBI.js → chunk-BA5R6BAE.js} +2 -2
- package/dist/cli/{chunk-XWPZHWC2.js → chunk-BM6BBFAV.js} +2 -2
- package/dist/cli/{chunk-CAGKEGNE.js → chunk-BOWSNGQC.js} +52 -140
- package/dist/cli/chunk-BOWSNGQC.js.map +1 -0
- package/dist/cli/{chunk-EZ57UEZQ.js → chunk-C2MRSJTV.js} +2 -2
- package/dist/cli/{chunk-PYIZZAVQ.js → chunk-DVD67FXQ.js} +1716 -4
- package/dist/cli/chunk-DVD67FXQ.js.map +1 -0
- package/dist/cli/{chunk-ZAXMJANP.js → chunk-EAMXOWUW.js} +3 -3
- package/dist/cli/{chunk-TX652NBA.js → chunk-EWVFGYT6.js} +2 -2
- package/dist/cli/{chunk-IBRTU5WO.js → chunk-FP7IOWBQ.js} +18 -1182
- package/dist/cli/chunk-FP7IOWBQ.js.map +1 -0
- package/dist/cli/{chunk-I6FBSTTR.js → chunk-HGK57NBN.js} +9 -353
- package/dist/cli/chunk-HGK57NBN.js.map +1 -0
- package/dist/cli/chunk-JHWQDJZA.js +80 -0
- package/dist/cli/chunk-JHWQDJZA.js.map +1 -0
- package/dist/cli/{chunk-X2BQZQEE.js → chunk-K3QJ3GKI.js} +3 -3
- package/dist/cli/{chunk-GPUH2BNM.js → chunk-K4YQFULP.js} +612 -254
- package/dist/cli/chunk-K4YQFULP.js.map +1 -0
- package/dist/cli/chunk-L3VPEESB.js +31 -0
- package/dist/cli/chunk-L3VPEESB.js.map +1 -0
- package/dist/cli/{chunk-ENFBF6HI.js → chunk-N4SEBLU4.js} +383 -5
- package/dist/cli/chunk-N4SEBLU4.js.map +1 -0
- package/dist/cli/chunk-NRROJXXT.js +879 -0
- package/dist/cli/chunk-NRROJXXT.js.map +1 -0
- package/dist/cli/{chunk-3KRRTLC5.js → chunk-R6KIHEF3.js} +1619 -1036
- package/dist/cli/chunk-R6KIHEF3.js.map +1 -0
- package/dist/cli/{chunk-VVMY4M7J.js → chunk-SBHF5NWD.js} +27 -4
- package/dist/cli/chunk-SBHF5NWD.js.map +1 -0
- package/dist/cli/{chunk-OWA42BKS.js → chunk-SXSAWOB7.js} +14 -14
- package/dist/cli/{chunk-6IUMTRFP.js → chunk-UMZ6KHTS.js} +2 -2
- package/dist/cli/{chunk-7X4JJOO7.js → chunk-UO6E7FN3.js} +69 -5
- package/dist/cli/{chunk-7X4JJOO7.js.map → chunk-UO6E7FN3.js.map} +1 -1
- package/dist/cli/{chunk-3ZZXQ3CZ.js → chunk-UPW544V3.js} +2 -2
- package/dist/cli/{chunk-XJZWMU5P.js → chunk-WPOKBW5E.js} +2 -2
- package/dist/cli/{chunk-WSBFVOCO.js → chunk-Z3MKG7MQ.js} +2 -2
- package/dist/cli/{code-TBK2TASK.js → code-BMXLBC7D.js} +37 -36
- package/dist/cli/{code-TBK2TASK.js.map → code-BMXLBC7D.js.map} +1 -1
- package/dist/cli/{commands-NXTKSQTN.js → commands-E4RZXMF6.js} +5 -5
- package/dist/cli/{commit-IR5SPP7A.js → commit-KSRQ64IL.js} +3 -3
- package/dist/cli/{config-XK5WQGTS.js → config-QNDONOTU.js} +4 -2
- package/dist/cli/{desktop-5NTQBADL.js → desktop-H3ZHIMDA.js} +83 -37
- package/dist/cli/desktop-H3ZHIMDA.js.map +1 -0
- package/dist/cli/{diff-JNYX5BSZ.js → diff-I4PYI43W.js} +9 -9
- package/dist/cli/{doctor-IKYLUFXX.js → doctor-Y2E4MY2F.js} +12 -12
- package/dist/cli/{events-HSC57ONU.js → events-47HOT7ZA.js} +5 -5
- package/dist/cli/find-in-code-YLEIK5FK.js +145 -0
- package/dist/cli/find-in-code-YLEIK5FK.js.map +1 -0
- package/dist/cli/index.js +95 -44
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/{mcp-BDJJWOCD.js → mcp-76DK63ZB.js} +3 -3
- package/dist/cli/{mcp-browse-NJRZDI6V.js → mcp-browse-SDNUGO74.js} +3 -3
- package/dist/cli/{mcp-inspect-Y62NWZQL.js → mcp-inspect-BL5DEO5M.js} +3 -3
- package/dist/cli/{prompt-UTOIFUQC.js → prompt-JLATI3P7.js} +5 -5
- package/dist/cli/{prune-sessions-UCUD4XAP.js → prune-sessions-WHZDFUKD.js} +4 -4
- package/dist/cli/{replay-VVIN64MN.js → replay-MHXS7C7Z.js} +10 -10
- package/dist/cli/{run-76OBDZFB.js → run-SXNCPRJE.js} +22 -22
- package/dist/cli/{server-SZZDKTH2.js → server-GEHOE6CO.js} +61 -35
- package/dist/cli/server-GEHOE6CO.js.map +1 -0
- package/dist/cli/{sessions-FZTGRCM5.js → sessions-EPBFYISL.js} +18 -18
- package/dist/cli/{setup-4UNENGOE.js → setup-IW2XR5XI.js} +8 -7
- package/dist/cli/setup-IW2XR5XI.js.map +1 -0
- package/dist/cli/{stats-F4NDOD7D.js → stats-4WB4XHBP.js} +6 -6
- package/dist/cli/symbols-UQ274IOB.js +167 -0
- package/dist/cli/symbols-UQ274IOB.js.map +1 -0
- package/dist/cli/version-4SP3DLLH.js +33 -0
- package/dist/index.d.ts +25 -6
- package/dist/index.js +2700 -578
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/scripts/postinstall.mjs +3 -5
- package/dist/cli/acp-6B25WIFF.js.map +0 -1
- package/dist/cli/chat-7WASPB4O.js +0 -50
- package/dist/cli/chunk-3KRRTLC5.js.map +0 -1
- package/dist/cli/chunk-3RNFYDDM.js.map +0 -1
- package/dist/cli/chunk-AAHB2PFX.js.map +0 -1
- package/dist/cli/chunk-CAGKEGNE.js.map +0 -1
- package/dist/cli/chunk-ENFBF6HI.js.map +0 -1
- package/dist/cli/chunk-GPUH2BNM.js.map +0 -1
- package/dist/cli/chunk-I6FBSTTR.js.map +0 -1
- package/dist/cli/chunk-IBRTU5WO.js.map +0 -1
- package/dist/cli/chunk-IK6WWRIX.js.map +0 -1
- package/dist/cli/chunk-MXWPAPZW.js.map +0 -1
- package/dist/cli/chunk-PYIZZAVQ.js.map +0 -1
- package/dist/cli/chunk-S4XVGLRW.js.map +0 -1
- package/dist/cli/chunk-VVMY4M7J.js.map +0 -1
- package/dist/cli/desktop-5NTQBADL.js.map +0 -1
- package/dist/cli/server-SZZDKTH2.js.map +0 -1
- package/dist/cli/setup-4UNENGOE.js.map +0 -1
- package/dist/cli/version-LUVTWHLL.js +0 -33
- /package/dist/cli/{chat-7WASPB4O.js.map → chat-NJ2Q5KHG.js.map} +0 -0
- /package/dist/cli/{chunk-OPGWCKKU.js.map → chunk-2HVTBFCI.js.map} +0 -0
- /package/dist/cli/{chunk-AJIZ5KFK.js.map → chunk-2WUEAI2I.js.map} +0 -0
- /package/dist/cli/{chunk-I4Q3QT4W.js.map → chunk-36BM7INR.js.map} +0 -0
- /package/dist/cli/{chunk-GMSAB2TC.js.map → chunk-3YRTIWFX.js.map} +0 -0
- /package/dist/cli/{chunk-NLRC3DWQ.js.map → chunk-544J4PXD.js.map} +0 -0
- /package/dist/cli/{chunk-7WITYWKN.js.map → chunk-5AIDYVH2.js.map} +0 -0
- /package/dist/cli/{chunk-ALCOQP6R.js.map → chunk-5BBC6YMV.js.map} +0 -0
- /package/dist/cli/{chunk-FQSQFCBI.js.map → chunk-BA5R6BAE.js.map} +0 -0
- /package/dist/cli/{chunk-XWPZHWC2.js.map → chunk-BM6BBFAV.js.map} +0 -0
- /package/dist/cli/{chunk-EZ57UEZQ.js.map → chunk-C2MRSJTV.js.map} +0 -0
- /package/dist/cli/{chunk-ZAXMJANP.js.map → chunk-EAMXOWUW.js.map} +0 -0
- /package/dist/cli/{chunk-TX652NBA.js.map → chunk-EWVFGYT6.js.map} +0 -0
- /package/dist/cli/{chunk-X2BQZQEE.js.map → chunk-K3QJ3GKI.js.map} +0 -0
- /package/dist/cli/{chunk-OWA42BKS.js.map → chunk-SXSAWOB7.js.map} +0 -0
- /package/dist/cli/{chunk-6IUMTRFP.js.map → chunk-UMZ6KHTS.js.map} +0 -0
- /package/dist/cli/{chunk-3ZZXQ3CZ.js.map → chunk-UPW544V3.js.map} +0 -0
- /package/dist/cli/{chunk-XJZWMU5P.js.map → chunk-WPOKBW5E.js.map} +0 -0
- /package/dist/cli/{chunk-WSBFVOCO.js.map → chunk-Z3MKG7MQ.js.map} +0 -0
- /package/dist/cli/{commands-NXTKSQTN.js.map → commands-E4RZXMF6.js.map} +0 -0
- /package/dist/cli/{commit-IR5SPP7A.js.map → commit-KSRQ64IL.js.map} +0 -0
- /package/dist/cli/{config-XK5WQGTS.js.map → config-QNDONOTU.js.map} +0 -0
- /package/dist/cli/{diff-JNYX5BSZ.js.map → diff-I4PYI43W.js.map} +0 -0
- /package/dist/cli/{doctor-IKYLUFXX.js.map → doctor-Y2E4MY2F.js.map} +0 -0
- /package/dist/cli/{events-HSC57ONU.js.map → events-47HOT7ZA.js.map} +0 -0
- /package/dist/cli/{mcp-BDJJWOCD.js.map → mcp-76DK63ZB.js.map} +0 -0
- /package/dist/cli/{mcp-browse-NJRZDI6V.js.map → mcp-browse-SDNUGO74.js.map} +0 -0
- /package/dist/cli/{mcp-inspect-Y62NWZQL.js.map → mcp-inspect-BL5DEO5M.js.map} +0 -0
- /package/dist/cli/{prompt-UTOIFUQC.js.map → prompt-JLATI3P7.js.map} +0 -0
- /package/dist/cli/{prune-sessions-UCUD4XAP.js.map → prune-sessions-WHZDFUKD.js.map} +0 -0
- /package/dist/cli/{replay-VVIN64MN.js.map → replay-MHXS7C7Z.js.map} +0 -0
- /package/dist/cli/{run-76OBDZFB.js.map → run-SXNCPRJE.js.map} +0 -0
- /package/dist/cli/{sessions-FZTGRCM5.js.map → sessions-EPBFYISL.js.map} +0 -0
- /package/dist/cli/{stats-F4NDOD7D.js.map → stats-4WB4XHBP.js.map} +0 -0
- /package/dist/cli/{version-LUVTWHLL.js.map → version-4SP3DLLH.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
require_react,
|
|
7
7
|
stripAnsi,
|
|
8
8
|
use_stdout_default
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UO6E7FN3.js";
|
|
10
10
|
import {
|
|
11
11
|
__toESM
|
|
12
12
|
} from "./chunk-TUK7OWJA.js";
|
|
@@ -93,4 +93,4 @@ export {
|
|
|
93
93
|
Bar,
|
|
94
94
|
stringWidth
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-UPW544V3.js.map
|
|
@@ -3,7 +3,7 @@ import { createRequire as __cr } from 'node:module'; if (typeof globalThis.requi
|
|
|
3
3
|
import {
|
|
4
4
|
sanitizeName,
|
|
5
5
|
sessionsDir
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6XWXIVQ3.js";
|
|
7
7
|
|
|
8
8
|
// src/adapters/event-sink-jsonl.ts
|
|
9
9
|
import { chmodSync, createWriteStream, mkdirSync } from "fs";
|
|
@@ -51,4 +51,4 @@ export {
|
|
|
51
51
|
eventLogPath,
|
|
52
52
|
openEventSink
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=chunk-
|
|
54
|
+
//# sourceMappingURL=chunk-WPOKBW5E.js.map
|
|
@@ -3,7 +3,7 @@ import { createRequire as __cr } from 'node:module'; if (typeof globalThis.requi
|
|
|
3
3
|
import {
|
|
4
4
|
indexCompatible,
|
|
5
5
|
querySemantic
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7YB26OQO.js";
|
|
7
7
|
|
|
8
8
|
// src/index/semantic/tool.ts
|
|
9
9
|
async function registerSemanticSearchTool(registry, opts) {
|
|
@@ -93,4 +93,4 @@ export {
|
|
|
93
93
|
registerSemanticSearchTool,
|
|
94
94
|
bootstrapSemanticSearchInCodeMode
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-Z3MKG7MQ.js.map
|
|
@@ -2,58 +2,61 @@
|
|
|
2
2
|
import { createRequire as __cr } from 'node:module'; if (typeof globalThis.require === 'undefined') { globalThis.require = __cr(import.meta.url); }
|
|
3
3
|
import {
|
|
4
4
|
chatCommand
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-R6KIHEF3.js";
|
|
6
|
+
import "./chunk-UPW544V3.js";
|
|
7
7
|
import "./chunk-JMBMLOBP.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-K3QJ3GKI.js";
|
|
9
|
+
import "./chunk-SZ5XES2N.js";
|
|
10
|
+
import "./chunk-3BTK5BHI.js";
|
|
11
|
+
import "./chunk-WPOKBW5E.js";
|
|
10
12
|
import "./chunk-XJXDHAES.js";
|
|
11
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-5BBC6YMV.js";
|
|
12
14
|
import {
|
|
13
15
|
buildCodeToolset
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-NRROJXXT.js";
|
|
17
|
+
import "./chunk-Z3MKG7MQ.js";
|
|
18
|
+
import "./chunk-BM6BBFAV.js";
|
|
19
|
+
import "./chunk-5AIDYVH2.js";
|
|
18
20
|
import "./chunk-SVD4UPRQ.js";
|
|
19
21
|
import {
|
|
20
22
|
markPhase
|
|
21
23
|
} from "./chunk-ZZM6QJ4W.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-I4Q3QT4W.js";
|
|
24
|
-
import "./chunk-NLRC3DWQ.js";
|
|
24
|
+
import "./chunk-K4YQFULP.js";
|
|
25
25
|
import "./chunk-7YPMTE3U.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-36BM7INR.js";
|
|
27
|
+
import "./chunk-544J4PXD.js";
|
|
28
|
+
import "./chunk-UMZ6KHTS.js";
|
|
29
|
+
import "./chunk-3YRTIWFX.js";
|
|
30
|
+
import "./chunk-BA5R6BAE.js";
|
|
31
|
+
import "./chunk-HGK57NBN.js";
|
|
28
32
|
import {
|
|
29
33
|
detectForeignAgentPlatform
|
|
30
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-N4SEBLU4.js";
|
|
31
35
|
import "./chunk-FEZK652I.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-SBHF5NWD.js";
|
|
37
|
+
import "./chunk-2HVTBFCI.js";
|
|
38
|
+
import "./chunk-UO6E7FN3.js";
|
|
35
39
|
import "./chunk-PLHAZOLZ.js";
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-L3VPEESB.js";
|
|
41
|
+
import "./chunk-SXSAWOB7.js";
|
|
42
|
+
import "./chunk-EWVFGYT6.js";
|
|
43
|
+
import "./chunk-7YB26OQO.js";
|
|
39
44
|
import "./chunk-Q46B3Z7H.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-BOWSNGQC.js";
|
|
46
|
+
import "./chunk-C2MRSJTV.js";
|
|
47
|
+
import "./chunk-25T6CVUP.js";
|
|
48
|
+
import "./chunk-2WUEAI2I.js";
|
|
49
|
+
import "./chunk-6UNHNVJR.js";
|
|
43
50
|
import {
|
|
44
51
|
sanitizeName
|
|
45
|
-
} from "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-25T6CVUP.js";
|
|
52
|
+
} from "./chunk-6XWXIVQ3.js";
|
|
53
|
+
import "./chunk-XXC2BYTV.js";
|
|
48
54
|
import {
|
|
49
55
|
loadDotenv
|
|
50
56
|
} from "./chunk-2UQP6H6T.js";
|
|
51
|
-
import "./chunk-X2BQZQEE.js";
|
|
52
|
-
import "./chunk-GMSAB2TC.js";
|
|
53
|
-
import "./chunk-FQSQFCBI.js";
|
|
54
57
|
import {
|
|
55
58
|
t
|
|
56
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-DVD67FXQ.js";
|
|
57
60
|
import {
|
|
58
61
|
DEFAULT_MODEL,
|
|
59
62
|
bridgeEndpointEnv,
|
|
@@ -61,9 +64,7 @@ import {
|
|
|
61
64
|
normalizeMcpConfig,
|
|
62
65
|
readConfig,
|
|
63
66
|
specToRaw
|
|
64
|
-
} from "./chunk-
|
|
65
|
-
import "./chunk-SZ5XES2N.js";
|
|
66
|
-
import "./chunk-XXC2BYTV.js";
|
|
67
|
+
} from "./chunk-A5PBEIJ7.js";
|
|
67
68
|
import "./chunk-TUK7OWJA.js";
|
|
68
69
|
|
|
69
70
|
// src/cli/commands/code.tsx
|
|
@@ -74,7 +75,7 @@ async function codeCommand(opts = {}) {
|
|
|
74
75
|
const resolvedModel = opts.model?.trim() || loadModel() || DEFAULT_MODEL;
|
|
75
76
|
loadDotenv();
|
|
76
77
|
bridgeEndpointEnv();
|
|
77
|
-
const { codeSystemPrompt } = await import("./prompt-
|
|
78
|
+
const { codeSystemPrompt } = await import("./prompt-JLATI3P7.js");
|
|
78
79
|
const rootDir = resolve(opts.dir ?? process.cwd());
|
|
79
80
|
const session = opts.noSession ? void 0 : `code-${sanitizeName(basename(rootDir))}`;
|
|
80
81
|
markPhase("semantic_bootstrap_start");
|
|
@@ -158,4 +159,4 @@ async function codeCommand(opts = {}) {
|
|
|
158
159
|
export {
|
|
159
160
|
codeCommand
|
|
160
161
|
};
|
|
161
|
-
//# sourceMappingURL=code-
|
|
162
|
+
//# sourceMappingURL=code-BMXLBC7D.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/commands/code.tsx"],"sourcesContent":["/** `reasonix code [dir]` — native filesystem tools + code system prompt, wraps `chat`. */\n\nimport { readFileSync } from \"node:fs\";\nimport { basename, resolve } from \"node:path\";\nimport { buildCodeToolset } from \"../../code/setup.js\";\nimport {\n DEFAULT_MODEL,\n bridgeEndpointEnv,\n loadModel,\n normalizeMcpConfig,\n readConfig,\n} from \"../../config.js\";\nimport { loadDotenv } from \"../../env.js\";\nimport { t } from \"../../i18n/index.js\";\nimport { specToRaw } from \"../../mcp/spec.js\";\nimport { detectForeignAgentPlatform } from \"../../memory/project.js\";\nimport { sanitizeName } from \"../../memory/session.js\";\nimport { markPhase } from \"../startup-profile.js\";\nimport { chatCommand } from \"./chat.js\";\n\nexport interface CodeOptions {\n /** Directory to root the filesystem tools at. Defaults to process.cwd(). */\n dir?: string;\n /** Override the default `smart` model. */\n model?: string;\n /** Disable session persistence. */\n noSession?: boolean;\n /** Transcript file for replay/diff. */\n transcript?: string;\n /** Skip the session picker — always resume prior messages. */\n forceResume?: boolean;\n /** Skip the session picker — always wipe prior messages and start fresh. */\n forceNew?: boolean;\n /**\n * Soft USD spend cap. Off by default. Same semantics as `chat`:\n * warns at 80%, refuses next turn at 100%. Mid-session adjustable\n * via `/budget <usd>` slash command.\n */\n budgetUsd?: number;\n /** Suppress the auto-launched embedded web dashboard. */\n noDashboard?: boolean;\n /** When true and the dashboard is enabled, open its URL in the system default browser as soon as the server is ready. */\n openDashboard?: boolean;\n /** Pin the dashboard to a fixed port. `undefined` keeps ephemeral assignment. */\n dashboardPort?: number;\n /** Dashboard bind address (#968). `undefined` keeps the default 127.0.0.1. */\n dashboardHost?: string;\n /** Stable dashboard URL token (#968). `undefined` mints a fresh per-boot token. */\n dashboardToken?: string;\n /** Inline string appended to the code system prompt after the generated base prompt. */\n systemAppend?: string;\n /** Path to a UTF-8 text file whose contents are appended to the code system prompt. */\n systemAppendFile?: string;\n /** Disable SGR mouse tracking so the terminal keeps native selection and right-click behavior. */\n noMouse?: boolean;\n}\n\nexport async function codeCommand(opts: CodeOptions = {}): Promise<void> {\n markPhase(\"code_command_enter\");\n const resolvedModel = opts.model?.trim() || loadModel() || DEFAULT_MODEL;\n // Bridge .env + ~/.reasonix/config.json into process.env so buildCodeToolset's\n // eager DeepSeekClient constructions (subagent client; semantic embedder) can\n // pick up a key the user already configured via `reasonix setup`. chatCommand\n // does the same dance — code.tsx wraps chatCommand but must also seed env\n // before buildCodeToolset runs, which is BEFORE chatCommand.\n loadDotenv();\n bridgeEndpointEnv();\n const { codeSystemPrompt } = await import(\"../../code/prompt.js\");\n const rootDir = resolve(opts.dir ?? process.cwd());\n // Per-directory session so switching projects doesn't mix histories.\n // `code-<sanitized-basename>` fits the session name rules without\n // truncating most project names.\n const session = opts.noSession ? undefined : `code-${sanitizeName(basename(rootDir))}`;\n\n markPhase(\"semantic_bootstrap_start\");\n const { tools, jobs, registerRooted, reBootstrapSemantic, semantic } = await buildCodeToolset({\n rootDir,\n });\n markPhase(\n semantic.enabled ? \"semantic_bootstrap_done_enabled\" : \"semantic_bootstrap_done_skipped\",\n );\n\n process.stderr.write(\n `${t(\"startup.codeRooted\", {\n rootDir,\n session: session ?? t(\"startup.ephemeral\"),\n tools: tools.size,\n semantic: semantic.enabled ? t(\"startup.semanticOn\") : \"\",\n })}\\n`,\n );\n\n const foreign = detectForeignAgentPlatform(rootDir);\n if (foreign) {\n process.stderr.write(t(\"code.workspaceConflict\", { platforms: foreign.join(\", \") }));\n }\n\n // Belt-and-suspenders cleanup: even though spawn(detached:false)\n // should tie child processes to the parent's lifetime, Windows cmd.exe\n // wrappers occasionally leak. We DON'T install SIGINT/SIGTERM\n // handlers here — that overrode Node's default \"exit on Ctrl+C\" with\n // a silent no-op, which made Ctrl+C feel broken in the TUI. App.tsx\n // owns the SIGINT path now (it shows the quit-armed banner and calls\n // exit() on confirmation); this 'exit' hook just guarantees the job\n // registry is drained on the way out, regardless of which exit path\n // fired.\n process.once(\"exit\", () => {\n void jobs.shutdown();\n });\n\n let systemAppendFileContents: string | undefined;\n if (opts.systemAppend !== undefined && opts.systemAppend.trim().length === 0) {\n process.stderr.write(t(\"code.systemAppendEmpty\"));\n }\n if (opts.systemAppendFile) {\n const filePath = resolve(opts.systemAppendFile);\n try {\n systemAppendFileContents = readFileSync(filePath, \"utf8\");\n } catch (err) {\n const e = err as NodeJS.ErrnoException;\n const errorDetails = e.code ? `[${e.code}] ${e.message}` : e.message;\n process.stderr.write(t(\"code.systemAppendFileReadError\", { filePath, errorDetails }));\n process.exit(1);\n }\n }\n\n // The rebuilder is re-invoked on `/new` and `/cwd`. `currentRoot` is the live\n // pointer; `/cwd` updates it via `onRootChange` so the rebuild picks up the\n // new workspace's REASONIX.md / memory without restarting the loop.\n let currentRoot = rootDir;\n let semanticEnabled = semantic.enabled;\n const codeRebuildSystem = () =>\n codeSystemPrompt(currentRoot, {\n hasSemanticSearch: semanticEnabled,\n systemAppend: opts.systemAppend,\n systemAppendFile: systemAppendFileContents,\n modelId: resolvedModel,\n });\n await chatCommand({\n model: resolvedModel,\n budgetUsd: opts.budgetUsd,\n system: codeRebuildSystem(),\n rebuildSystem: codeRebuildSystem,\n transcript: opts.transcript,\n session,\n seedTools: tools,\n codeMode: {\n rootDir,\n jobs,\n reregisterTools: registerRooted,\n reBootstrapSemantic: async (root: string) => {\n const r = await reBootstrapSemantic(root);\n semanticEnabled = r.enabled;\n return r;\n },\n onRootChange: (newRoot: string) => {\n currentRoot = newRoot;\n },\n },\n mcp: normalizeMcpConfig(readConfig()).map(specToRaw),\n forceResume: opts.forceResume,\n forceNew: opts.forceNew,\n noDashboard: opts.noDashboard,\n openDashboard: opts.openDashboard,\n dashboardPort: opts.dashboardPort,\n dashboardHost: opts.dashboardHost,\n dashboardToken: opts.dashboardToken,\n noMouse: opts.noMouse,\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/cli/commands/code.tsx"],"sourcesContent":["/** `reasonix code [dir]` — native filesystem tools + code system prompt, wraps `chat`. */\n\nimport { readFileSync } from \"node:fs\";\nimport { basename, resolve } from \"node:path\";\nimport { buildCodeToolset } from \"../../code/setup.js\";\nimport {\n DEFAULT_MODEL,\n bridgeEndpointEnv,\n loadModel,\n normalizeMcpConfig,\n readConfig,\n} from \"../../config.js\";\nimport { loadDotenv } from \"../../env.js\";\nimport { t } from \"../../i18n/index.js\";\nimport { specToRaw } from \"../../mcp/spec.js\";\nimport { detectForeignAgentPlatform } from \"../../memory/project.js\";\nimport { sanitizeName } from \"../../memory/session.js\";\nimport { markPhase } from \"../startup-profile.js\";\nimport { chatCommand } from \"./chat.js\";\n\nexport interface CodeOptions {\n /** Directory to root the filesystem tools at. Defaults to process.cwd(). */\n dir?: string;\n /** Override the default `smart` model. */\n model?: string;\n /** Disable session persistence. */\n noSession?: boolean;\n /** Transcript file for replay/diff. */\n transcript?: string;\n /** Skip the session picker — always resume prior messages. */\n forceResume?: boolean;\n /** Skip the session picker — always wipe prior messages and start fresh. */\n forceNew?: boolean;\n /**\n * Soft USD spend cap. Off by default. Same semantics as `chat`:\n * warns at 80%, refuses next turn at 100%. Mid-session adjustable\n * via `/budget <usd>` slash command.\n */\n budgetUsd?: number;\n /** Suppress the auto-launched embedded web dashboard. */\n noDashboard?: boolean;\n /** When true and the dashboard is enabled, open its URL in the system default browser as soon as the server is ready. */\n openDashboard?: boolean;\n /** Pin the dashboard to a fixed port. `undefined` keeps ephemeral assignment. */\n dashboardPort?: number;\n /** Dashboard bind address (#968). `undefined` keeps the default 127.0.0.1. */\n dashboardHost?: string;\n /** Stable dashboard URL token (#968). `undefined` mints a fresh per-boot token. */\n dashboardToken?: string;\n /** Inline string appended to the code system prompt after the generated base prompt. */\n systemAppend?: string;\n /** Path to a UTF-8 text file whose contents are appended to the code system prompt. */\n systemAppendFile?: string;\n /** Disable SGR mouse tracking so the terminal keeps native selection and right-click behavior. */\n noMouse?: boolean;\n}\n\nexport async function codeCommand(opts: CodeOptions = {}): Promise<void> {\n markPhase(\"code_command_enter\");\n const resolvedModel = opts.model?.trim() || loadModel() || DEFAULT_MODEL;\n // Bridge .env + ~/.reasonix/config.json into process.env so buildCodeToolset's\n // eager DeepSeekClient constructions (subagent client; semantic embedder) can\n // pick up a key the user already configured via `reasonix setup`. chatCommand\n // does the same dance — code.tsx wraps chatCommand but must also seed env\n // before buildCodeToolset runs, which is BEFORE chatCommand.\n loadDotenv();\n bridgeEndpointEnv();\n const { codeSystemPrompt } = await import(\"../../code/prompt.js\");\n const rootDir = resolve(opts.dir ?? process.cwd());\n // Per-directory session so switching projects doesn't mix histories.\n // `code-<sanitized-basename>` fits the session name rules without\n // truncating most project names.\n const session = opts.noSession ? undefined : `code-${sanitizeName(basename(rootDir))}`;\n\n markPhase(\"semantic_bootstrap_start\");\n const { tools, jobs, registerRooted, reBootstrapSemantic, semantic } = await buildCodeToolset({\n rootDir,\n });\n markPhase(\n semantic.enabled ? \"semantic_bootstrap_done_enabled\" : \"semantic_bootstrap_done_skipped\",\n );\n\n process.stderr.write(\n `${t(\"startup.codeRooted\", {\n rootDir,\n session: session ?? t(\"startup.ephemeral\"),\n tools: tools.size,\n semantic: semantic.enabled ? t(\"startup.semanticOn\") : \"\",\n })}\\n`,\n );\n\n const foreign = detectForeignAgentPlatform(rootDir);\n if (foreign) {\n process.stderr.write(t(\"code.workspaceConflict\", { platforms: foreign.join(\", \") }));\n }\n\n // Belt-and-suspenders cleanup: even though spawn(detached:false)\n // should tie child processes to the parent's lifetime, Windows cmd.exe\n // wrappers occasionally leak. We DON'T install SIGINT/SIGTERM\n // handlers here — that overrode Node's default \"exit on Ctrl+C\" with\n // a silent no-op, which made Ctrl+C feel broken in the TUI. App.tsx\n // owns the SIGINT path now (it shows the quit-armed banner and calls\n // exit() on confirmation); this 'exit' hook just guarantees the job\n // registry is drained on the way out, regardless of which exit path\n // fired.\n process.once(\"exit\", () => {\n void jobs.shutdown();\n });\n\n let systemAppendFileContents: string | undefined;\n if (opts.systemAppend !== undefined && opts.systemAppend.trim().length === 0) {\n process.stderr.write(t(\"code.systemAppendEmpty\"));\n }\n if (opts.systemAppendFile) {\n const filePath = resolve(opts.systemAppendFile);\n try {\n systemAppendFileContents = readFileSync(filePath, \"utf8\");\n } catch (err) {\n const e = err as NodeJS.ErrnoException;\n const errorDetails = e.code ? `[${e.code}] ${e.message}` : e.message;\n process.stderr.write(t(\"code.systemAppendFileReadError\", { filePath, errorDetails }));\n process.exit(1);\n }\n }\n\n // The rebuilder is re-invoked on `/new` and `/cwd`. `currentRoot` is the live\n // pointer; `/cwd` updates it via `onRootChange` so the rebuild picks up the\n // new workspace's REASONIX.md / memory without restarting the loop.\n let currentRoot = rootDir;\n let semanticEnabled = semantic.enabled;\n const codeRebuildSystem = () =>\n codeSystemPrompt(currentRoot, {\n hasSemanticSearch: semanticEnabled,\n systemAppend: opts.systemAppend,\n systemAppendFile: systemAppendFileContents,\n modelId: resolvedModel,\n });\n await chatCommand({\n model: resolvedModel,\n budgetUsd: opts.budgetUsd,\n system: codeRebuildSystem(),\n rebuildSystem: codeRebuildSystem,\n transcript: opts.transcript,\n session,\n seedTools: tools,\n codeMode: {\n rootDir,\n jobs,\n reregisterTools: registerRooted,\n reBootstrapSemantic: async (root: string) => {\n const r = await reBootstrapSemantic(root);\n semanticEnabled = r.enabled;\n return r;\n },\n onRootChange: (newRoot: string) => {\n currentRoot = newRoot;\n },\n },\n mcp: normalizeMcpConfig(readConfig()).map(specToRaw),\n forceResume: opts.forceResume,\n forceNew: opts.forceNew,\n noDashboard: opts.noDashboard,\n openDashboard: opts.openDashboard,\n dashboardPort: opts.dashboardPort,\n dashboardHost: opts.dashboardHost,\n dashboardToken: opts.dashboardToken,\n noMouse: opts.noMouse,\n });\n}\n"],"mappings":"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","names":[]}
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
checkOllamaStatus,
|
|
5
5
|
pullOllamaModel,
|
|
6
6
|
startOllamaDaemon
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EWVFGYT6.js";
|
|
8
8
|
import {
|
|
9
9
|
buildIndex
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-7YB26OQO.js";
|
|
11
|
+
import "./chunk-6UNHNVJR.js";
|
|
12
12
|
import {
|
|
13
13
|
loadIndexConfig,
|
|
14
14
|
resolveSemanticEmbeddingConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-A5PBEIJ7.js";
|
|
16
16
|
import "./chunk-TUK7OWJA.js";
|
|
17
17
|
|
|
18
18
|
// src/cli/commands/index.ts
|
|
@@ -353,4 +353,4 @@ function makeTtyWriter() {
|
|
|
353
353
|
export {
|
|
354
354
|
indexCommand
|
|
355
355
|
};
|
|
356
|
-
//# sourceMappingURL=commands-
|
|
356
|
+
//# sourceMappingURL=commands-E4RZXMF6.js.map
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { createRequire as __cr } from 'node:module'; if (typeof globalThis.require === 'undefined') { globalThis.require = __cr(import.meta.url); }
|
|
3
3
|
import {
|
|
4
4
|
DeepSeekClient
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-C2MRSJTV.js";
|
|
6
6
|
import "./chunk-25T6CVUP.js";
|
|
7
7
|
import {
|
|
8
8
|
loadDotenv
|
|
9
9
|
} from "./chunk-2UQP6H6T.js";
|
|
10
10
|
import {
|
|
11
11
|
loadEndpoint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-A5PBEIJ7.js";
|
|
13
13
|
import "./chunk-TUK7OWJA.js";
|
|
14
14
|
|
|
15
15
|
// src/cli/commands/commit.ts
|
|
@@ -288,4 +288,4 @@ async function commitCommand(opts = {}) {
|
|
|
288
288
|
export {
|
|
289
289
|
commitCommand
|
|
290
290
|
};
|
|
291
|
-
//# sourceMappingURL=commit-
|
|
291
|
+
//# sourceMappingURL=commit-KSRQ64IL.js.map
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
loadEngineeringLifecycleMode,
|
|
27
27
|
loadExaApiKey,
|
|
28
28
|
loadFilesystemOutlineThresholdBytes,
|
|
29
|
+
loadHistoryScrollMode,
|
|
29
30
|
loadIndexConfig,
|
|
30
31
|
loadIndexUserConfig,
|
|
31
32
|
loadJavaSourceEnabled,
|
|
@@ -94,7 +95,7 @@ import {
|
|
|
94
95
|
webSearchEndpoint,
|
|
95
96
|
webSearchEngine,
|
|
96
97
|
writeConfig
|
|
97
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-A5PBEIJ7.js";
|
|
98
99
|
import "./chunk-TUK7OWJA.js";
|
|
99
100
|
export {
|
|
100
101
|
DEFAULT_MODEL,
|
|
@@ -122,6 +123,7 @@ export {
|
|
|
122
123
|
loadEngineeringLifecycleMode,
|
|
123
124
|
loadExaApiKey,
|
|
124
125
|
loadFilesystemOutlineThresholdBytes,
|
|
126
|
+
loadHistoryScrollMode,
|
|
125
127
|
loadIndexConfig,
|
|
126
128
|
loadIndexUserConfig,
|
|
127
129
|
loadJavaSourceEnabled,
|
|
@@ -191,4 +193,4 @@ export {
|
|
|
191
193
|
webSearchEngine,
|
|
192
194
|
writeConfig
|
|
193
195
|
};
|
|
194
|
-
//# sourceMappingURL=config-
|
|
196
|
+
//# sourceMappingURL=config-QNDONOTU.js.map
|
|
@@ -1,19 +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 {
|
|
4
|
+
collectMemoryEntriesForWorkspace,
|
|
5
|
+
readMemoryEntryDetail
|
|
6
|
+
} from "./chunk-JHWQDJZA.js";
|
|
3
7
|
import {
|
|
4
8
|
QQChannel,
|
|
5
9
|
createMcpRuntime
|
|
6
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5BBC6YMV.js";
|
|
7
11
|
import {
|
|
8
12
|
applyPlanMode,
|
|
9
13
|
buildCodeToolset
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-NRROJXXT.js";
|
|
15
|
+
import "./chunk-Z3MKG7MQ.js";
|
|
12
16
|
import {
|
|
13
17
|
Eventizer,
|
|
14
18
|
autoResolveVerdict
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-BM6BBFAV.js";
|
|
20
|
+
import "./chunk-5AIDYVH2.js";
|
|
17
21
|
import "./chunk-SVD4UPRQ.js";
|
|
18
22
|
import {
|
|
19
23
|
CacheFirstLoop,
|
|
@@ -22,49 +26,53 @@ import {
|
|
|
22
26
|
listFilesWithStatsAsync,
|
|
23
27
|
parseAtQuery,
|
|
24
28
|
rankPickerCandidates
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-I4Q3QT4W.js";
|
|
27
|
-
import "./chunk-NLRC3DWQ.js";
|
|
29
|
+
} from "./chunk-K4YQFULP.js";
|
|
28
30
|
import "./chunk-7YPMTE3U.js";
|
|
31
|
+
import "./chunk-36BM7INR.js";
|
|
32
|
+
import "./chunk-544J4PXD.js";
|
|
29
33
|
import {
|
|
30
34
|
pauseGate,
|
|
31
35
|
toApprovalPrompt
|
|
32
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-UMZ6KHTS.js";
|
|
37
|
+
import "./chunk-3YRTIWFX.js";
|
|
38
|
+
import "./chunk-BA5R6BAE.js";
|
|
33
39
|
import {
|
|
34
|
-
MemoryStore,
|
|
35
40
|
codeSystemPrompt
|
|
36
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-HGK57NBN.js";
|
|
37
42
|
import {
|
|
38
43
|
SkillStore
|
|
39
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-N4SEBLU4.js";
|
|
40
45
|
import "./chunk-FEZK652I.js";
|
|
41
46
|
import "./chunk-PLHAZOLZ.js";
|
|
42
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-L3VPEESB.js";
|
|
48
|
+
import "./chunk-7YB26OQO.js";
|
|
43
49
|
import {
|
|
44
50
|
countTokensBounded
|
|
45
|
-
} from "./chunk-
|
|
46
|
-
import
|
|
47
|
-
|
|
51
|
+
} from "./chunk-BOWSNGQC.js";
|
|
52
|
+
import {
|
|
53
|
+
DeepSeekClient,
|
|
54
|
+
pickPrimaryBalance
|
|
55
|
+
} from "./chunk-C2MRSJTV.js";
|
|
56
|
+
import "./chunk-25T6CVUP.js";
|
|
57
|
+
import "./chunk-2WUEAI2I.js";
|
|
58
|
+
import "./chunk-6UNHNVJR.js";
|
|
48
59
|
import {
|
|
49
60
|
deleteSession,
|
|
50
61
|
listSessionsForWorkspace,
|
|
51
62
|
loadSessionMessages,
|
|
52
63
|
loadSessionMeta,
|
|
53
64
|
patchSessionMeta,
|
|
65
|
+
patchSessionWorkspaceIfMissing,
|
|
54
66
|
sessionPath,
|
|
55
67
|
timestampSuffix
|
|
56
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-6XWXIVQ3.js";
|
|
57
69
|
import {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} from "./chunk-EZ57UEZQ.js";
|
|
61
|
-
import "./chunk-25T6CVUP.js";
|
|
70
|
+
VERSION
|
|
71
|
+
} from "./chunk-XXC2BYTV.js";
|
|
62
72
|
import {
|
|
63
73
|
loadDotenv
|
|
64
74
|
} from "./chunk-2UQP6H6T.js";
|
|
65
|
-
import "./chunk-
|
|
66
|
-
import "./chunk-FQSQFCBI.js";
|
|
67
|
-
import "./chunk-PYIZZAVQ.js";
|
|
75
|
+
import "./chunk-DVD67FXQ.js";
|
|
68
76
|
import {
|
|
69
77
|
DEFAULT_MODEL,
|
|
70
78
|
bridgeEndpointEnv,
|
|
@@ -100,10 +108,7 @@ import {
|
|
|
100
108
|
saveWorkspaceDir,
|
|
101
109
|
webSearchEngine,
|
|
102
110
|
writeConfig
|
|
103
|
-
} from "./chunk-
|
|
104
|
-
import {
|
|
105
|
-
VERSION
|
|
106
|
-
} from "./chunk-XXC2BYTV.js";
|
|
111
|
+
} from "./chunk-A5PBEIJ7.js";
|
|
107
112
|
import "./chunk-TUK7OWJA.js";
|
|
108
113
|
|
|
109
114
|
// src/cli/commands/desktop.ts
|
|
@@ -282,6 +287,39 @@ function tailLines(s, n) {
|
|
|
282
287
|
const lines = s.split(/\r?\n/);
|
|
283
288
|
return lines.slice(-n).join("\n");
|
|
284
289
|
}
|
|
290
|
+
var LOADED_RECENT_MESSAGE_WINDOW = 200;
|
|
291
|
+
var LOADED_MIN_ELIDE_CHARS = 4096;
|
|
292
|
+
var LOADED_ELIDED_PREFIX = "[elided \u2014 older than the last ";
|
|
293
|
+
function elideLoadedField(value) {
|
|
294
|
+
if (value.length <= LOADED_MIN_ELIDE_CHARS) return value;
|
|
295
|
+
if (value.startsWith(LOADED_ELIDED_PREFIX)) return value;
|
|
296
|
+
return `${LOADED_ELIDED_PREFIX}${LOADED_RECENT_MESSAGE_WINDOW} messages; ${value.length.toLocaleString()} chars dropped to save memory. Full content is on disk in the session log.]`;
|
|
297
|
+
}
|
|
298
|
+
function elideLoadedMessages(messages) {
|
|
299
|
+
if (messages.length < LOADED_RECENT_MESSAGE_WINDOW) return messages;
|
|
300
|
+
const cutoff = messages.length - LOADED_RECENT_MESSAGE_WINDOW;
|
|
301
|
+
return messages.map((msg, i) => {
|
|
302
|
+
if (i >= cutoff || msg.kind !== "assistant") return msg;
|
|
303
|
+
return {
|
|
304
|
+
...msg,
|
|
305
|
+
segments: msg.segments.map((segment) => {
|
|
306
|
+
switch (segment.kind) {
|
|
307
|
+
case "reasoning":
|
|
308
|
+
case "text":
|
|
309
|
+
return { ...segment, text: elideLoadedField(segment.text) };
|
|
310
|
+
case "tool":
|
|
311
|
+
return {
|
|
312
|
+
...segment,
|
|
313
|
+
args: elideLoadedField(segment.args),
|
|
314
|
+
...segment.result !== void 0 ? { result: elideLoadedField(segment.result) } : {}
|
|
315
|
+
};
|
|
316
|
+
default:
|
|
317
|
+
return segment;
|
|
318
|
+
}
|
|
319
|
+
})
|
|
320
|
+
};
|
|
321
|
+
});
|
|
322
|
+
}
|
|
285
323
|
function buildLoadedMessages(records) {
|
|
286
324
|
const out = [];
|
|
287
325
|
let turn = 0;
|
|
@@ -327,7 +365,7 @@ function buildLoadedMessages(records) {
|
|
|
327
365
|
}
|
|
328
366
|
}
|
|
329
367
|
}
|
|
330
|
-
return out;
|
|
368
|
+
return elideLoadedMessages(out);
|
|
331
369
|
}
|
|
332
370
|
function emitSettings(tab) {
|
|
333
371
|
const ep = loadEndpoint();
|
|
@@ -388,7 +426,8 @@ function emitSessions(tab) {
|
|
|
388
426
|
name: s.name,
|
|
389
427
|
messageCount: s.messageCount,
|
|
390
428
|
mtime: s.mtime.toISOString(),
|
|
391
|
-
summary: s.meta.summary
|
|
429
|
+
summary: s.meta.summary,
|
|
430
|
+
workspaceStatus: s.workspaceStatus
|
|
392
431
|
}));
|
|
393
432
|
emit({ type: "$sessions", items }, tab.id);
|
|
394
433
|
} catch (err) {
|
|
@@ -440,12 +479,7 @@ function emitMcpSpecs(tab) {
|
|
|
440
479
|
}
|
|
441
480
|
function emitMemory(tab) {
|
|
442
481
|
try {
|
|
443
|
-
const
|
|
444
|
-
const entries = store.list().map((e) => ({
|
|
445
|
-
name: e.name,
|
|
446
|
-
scope: e.scope,
|
|
447
|
-
description: e.description
|
|
448
|
-
}));
|
|
482
|
+
const entries = collectMemoryEntriesForWorkspace(tab.rootDir);
|
|
449
483
|
emit({ type: "$memory", entries }, tab.id);
|
|
450
484
|
} catch (err) {
|
|
451
485
|
emit({ type: "$error", message: `memory_get failed: ${err.message}` }, tab.id);
|
|
@@ -1741,6 +1775,7 @@ ${found.body}${argsLine}`;
|
|
|
1741
1775
|
if (msg.cmd === "session_load") {
|
|
1742
1776
|
try {
|
|
1743
1777
|
const records = loadSessionMessages(msg.name);
|
|
1778
|
+
const backfilledWorkspace = patchSessionWorkspaceIfMissing(msg.name, tab.rootDir);
|
|
1744
1779
|
const meta = loadSessionMeta(msg.name);
|
|
1745
1780
|
if (tab.aborter) tab.switching = true;
|
|
1746
1781
|
abortTurn(tab);
|
|
@@ -1775,6 +1810,7 @@ ${found.body}${argsLine}`;
|
|
|
1775
1810
|
},
|
|
1776
1811
|
tab.id
|
|
1777
1812
|
);
|
|
1813
|
+
if (backfilledWorkspace) emitSessions(tab);
|
|
1778
1814
|
} catch (err) {
|
|
1779
1815
|
process.stderr.write(`session_load: "${msg.name}" threw \u2014 ${err.message}
|
|
1780
1816
|
`);
|
|
@@ -1782,6 +1818,15 @@ ${found.body}${argsLine}`;
|
|
|
1782
1818
|
}
|
|
1783
1819
|
return;
|
|
1784
1820
|
}
|
|
1821
|
+
if (msg.cmd === "memory_read") {
|
|
1822
|
+
try {
|
|
1823
|
+
const detail = readMemoryEntryDetail({ path: msg.path }, tab.rootDir);
|
|
1824
|
+
emit({ type: "$memory_detail", detail }, tab.id);
|
|
1825
|
+
} catch (err) {
|
|
1826
|
+
emit({ type: "$error", message: `memory_read failed: ${err.message}` }, tab.id);
|
|
1827
|
+
}
|
|
1828
|
+
return;
|
|
1829
|
+
}
|
|
1785
1830
|
if (msg.cmd === "new_chat") {
|
|
1786
1831
|
if (tab.aborter) tab.switching = true;
|
|
1787
1832
|
abortTurn(tab);
|
|
@@ -2074,9 +2119,10 @@ ${found.body}${argsLine}`;
|
|
|
2074
2119
|
});
|
|
2075
2120
|
}
|
|
2076
2121
|
export {
|
|
2122
|
+
buildLoadedMessages,
|
|
2077
2123
|
desktopCommand,
|
|
2078
2124
|
installDesktopCrashGuards,
|
|
2079
2125
|
normalizeSessionTitle,
|
|
2080
2126
|
writeAllSync
|
|
2081
2127
|
};
|
|
2082
|
-
//# sourceMappingURL=desktop-
|
|
2128
|
+
//# sourceMappingURL=desktop-H3ZHIMDA.js.map
|