@openacp/cli 2026.330.2 → 2026.331.1
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 +17 -0
- package/dist/adapter-ELG3VRZ3.js +14 -0
- package/dist/{agent-catalog-SZQQERV7.js → agent-catalog-UYD26QDK.js} +3 -3
- package/dist/{api-client-XTLRRFPX.js → api-client-PEMHYL5U.js} +2 -2
- package/dist/{api-server-JLBDKCU4.js → api-server-DATG2KBR.js} +3 -3
- package/dist/api-server-L5Z7XACW.js +7 -0
- package/dist/chunk-23SRIVG4.js +50 -0
- package/dist/chunk-23SRIVG4.js.map +1 -0
- package/dist/{chunk-YIGBJFJL.js → chunk-7GXEMMEV.js} +15 -15
- package/dist/{chunk-QWVHCTCA.js → chunk-7U6IZIJP.js} +37 -23
- package/dist/chunk-7U6IZIJP.js.map +1 -0
- package/dist/{chunk-FCTC7KDT.js → chunk-7YIKTRSM.js} +14 -10
- package/dist/chunk-7YIKTRSM.js.map +1 -0
- package/dist/{chunk-MITTQMGZ.js → chunk-BYCJQPMN.js} +5 -5
- package/dist/chunk-BYCJQPMN.js.map +1 -0
- package/dist/{chunk-5ZNBNIK3.js → chunk-EWVXSTQK.js} +193 -53
- package/dist/chunk-EWVXSTQK.js.map +1 -0
- package/dist/{chunk-UWH7KIAA.js → chunk-FPKQYCQS.js} +88 -13
- package/dist/chunk-FPKQYCQS.js.map +1 -0
- package/dist/{chunk-GEOXPGCO.js → chunk-K6UY5M75.js} +12 -9
- package/dist/chunk-K6UY5M75.js.map +1 -0
- package/dist/{chunk-KDU3ZEWT.js → chunk-KGAQW6F4.js} +12 -3
- package/dist/chunk-KGAQW6F4.js.map +1 -0
- package/dist/{chunk-7RKPIM3E.js → chunk-LRV56K2M.js} +205 -16
- package/dist/chunk-LRV56K2M.js.map +1 -0
- package/dist/{chunk-V2YZWYXT.js → chunk-MDJHCCFS.js} +18 -17
- package/dist/chunk-MDJHCCFS.js.map +1 -0
- package/dist/chunk-NHD5XDD2.js +686 -0
- package/dist/chunk-NHD5XDD2.js.map +1 -0
- package/dist/{chunk-APS6UEFU.js → chunk-NJX75BLK.js} +1 -1
- package/dist/chunk-NJX75BLK.js.map +1 -0
- package/dist/{chunk-5HKQCYOI.js → chunk-NOEAJNTK.js} +14 -3
- package/dist/chunk-NOEAJNTK.js.map +1 -0
- package/dist/chunk-ON7HB5O7.js +58 -0
- package/dist/chunk-ON7HB5O7.js.map +1 -0
- package/dist/{chunk-5OCGO27U.js → chunk-OSBZXY2W.js} +2 -1
- package/dist/chunk-OSBZXY2W.js.map +1 -0
- package/dist/{chunk-PA6MNBG4.js → chunk-P3HHJANC.js} +32 -13
- package/dist/chunk-P3HHJANC.js.map +1 -0
- package/dist/{chunk-BTJHGSLM.js → chunk-R2YLDQLI.js} +9 -10
- package/dist/chunk-R2YLDQLI.js.map +1 -0
- package/dist/{chunk-CFUJGWOP.js → chunk-SSLVNCEA.js} +27 -3
- package/dist/chunk-SSLVNCEA.js.map +1 -0
- package/dist/{chunk-MPGEHTGE.js → chunk-TGP34LQN.js} +9 -7
- package/dist/chunk-TGP34LQN.js.map +1 -0
- package/dist/{chunk-TMVTSWVH.js → chunk-VUSCVRJL.js} +2 -1
- package/dist/chunk-VUSCVRJL.js.map +1 -0
- package/dist/chunk-XRJUS6FE.js +53 -0
- package/dist/chunk-XRJUS6FE.js.map +1 -0
- package/dist/{chunk-W4LK6WJP.js → chunk-YZCKSNRN.js} +24 -17
- package/dist/chunk-YZCKSNRN.js.map +1 -0
- package/dist/{chunk-3NAFXVQM.js → chunk-ZIRH6QWW.js} +7 -5
- package/dist/chunk-ZIRH6QWW.js.map +1 -0
- package/dist/cli.d.ts +11 -0
- package/dist/cli.js +334 -140
- package/dist/cli.js.map +1 -1
- package/dist/config-X4UP7H6R.js +13 -0
- package/dist/config-editor-7BENRVG5.js +11 -0
- package/dist/{config-registry-ZXAIJNYB.js → config-registry-M3FFWEVM.js} +3 -2
- package/dist/context-FVGCU5TI.js +9 -0
- package/dist/core-plugins-JSY2I44L.js +25 -0
- package/dist/{daemon-XFEMMJSZ.js → daemon-UOSRDEXW.js} +8 -3
- package/dist/doctor-6DLACBR4.js +10 -0
- package/dist/{file-service-HHB3JQIO.js → file-service-FQQYME7M.js} +2 -2
- package/dist/index.d.ts +265 -32
- package/dist/index.js +44 -33
- package/dist/index.js.map +1 -1
- package/dist/{install-cloudflared-JRJ4BSOM.js → install-cloudflared-LNS5L5FR.js} +5 -4
- package/dist/install-cloudflared-LNS5L5FR.js.map +1 -0
- package/dist/{install-context-EHYV5WRY.js → install-context-KZO5FR4D.js} +4 -3
- package/dist/install-context-KZO5FR4D.js.map +1 -0
- package/dist/{install-jq-ISTGT263.js → install-jq-SN4IA5K4.js} +3 -3
- package/dist/instance-context-FLCE7VZ4.js +13 -0
- package/dist/instance-registry-SW5FWKHO.js +7 -0
- package/dist/{main-L2M4NTJY.js → main-D7M2AKRM.js} +91 -48
- package/dist/main-D7M2AKRM.js.map +1 -0
- package/dist/{plugin-create-EHL76ZZG.js → plugin-create-HFKS23JY.js} +4 -2
- package/dist/{plugin-create-EHL76ZZG.js.map → plugin-create-HFKS23JY.js.map} +1 -1
- package/dist/{post-upgrade-Y26S2ZQ7.js → post-upgrade-F4YPMTUT.js} +6 -6
- package/dist/{security-2BA265LN.js → security-O4XGN2CM.js} +2 -2
- package/dist/{setup-E6BNEYCS.js → setup-44WLBIOT.js} +209 -22
- package/dist/setup-44WLBIOT.js.map +1 -0
- package/dist/{speech-SG62JYIF.js → speech-GHTSWDAN.js} +2 -2
- package/dist/telegram-D7ASLVEB.js +7 -0
- package/dist/telegram-D7ASLVEB.js.map +1 -0
- package/dist/tunnel-ALJDPFDQ.js +10 -0
- package/dist/tunnel-ALJDPFDQ.js.map +1 -0
- package/dist/{tunnel-service-ZMO4THKE.js → tunnel-service-TBAHDXMF.js} +41 -547
- package/dist/tunnel-service-TBAHDXMF.js.map +1 -0
- package/package.json +1 -1
- package/dist/adapter-4U6MC5ZS.js +0 -13
- package/dist/api-server-5VNYFWJE.js +0 -7
- package/dist/chunk-3NAFXVQM.js.map +0 -1
- package/dist/chunk-4WXALZA3.js +0 -45
- package/dist/chunk-4WXALZA3.js.map +0 -1
- package/dist/chunk-5HKQCYOI.js.map +0 -1
- package/dist/chunk-5OCGO27U.js.map +0 -1
- package/dist/chunk-5ZNBNIK3.js.map +0 -1
- package/dist/chunk-7RKPIM3E.js.map +0 -1
- package/dist/chunk-APS6UEFU.js.map +0 -1
- package/dist/chunk-BTJHGSLM.js.map +0 -1
- package/dist/chunk-CFUJGWOP.js.map +0 -1
- package/dist/chunk-FCTC7KDT.js.map +0 -1
- package/dist/chunk-GEOXPGCO.js.map +0 -1
- package/dist/chunk-KDU3ZEWT.js.map +0 -1
- package/dist/chunk-MITTQMGZ.js.map +0 -1
- package/dist/chunk-MPGEHTGE.js.map +0 -1
- package/dist/chunk-PA6MNBG4.js.map +0 -1
- package/dist/chunk-QWVHCTCA.js.map +0 -1
- package/dist/chunk-TMVTSWVH.js.map +0 -1
- package/dist/chunk-UWH7KIAA.js.map +0 -1
- package/dist/chunk-V2YZWYXT.js.map +0 -1
- package/dist/chunk-W4LK6WJP.js.map +0 -1
- package/dist/config-KN6NKKPF.js +0 -20
- package/dist/config-editor-76RVZS4B.js +0 -10
- package/dist/context-NXXW62NJ.js +0 -9
- package/dist/core-plugins-OCHKGCIZ.js +0 -22
- package/dist/doctor-AV6AUO22.js +0 -9
- package/dist/install-cloudflared-JRJ4BSOM.js.map +0 -1
- package/dist/install-context-EHYV5WRY.js.map +0 -1
- package/dist/main-L2M4NTJY.js.map +0 -1
- package/dist/setup-E6BNEYCS.js.map +0 -1
- package/dist/telegram-EAVRDNFU.js +0 -7
- package/dist/tunnel-HWJ27WDH.js +0 -7
- package/dist/tunnel-service-ZMO4THKE.js.map +0 -1
- /package/dist/{adapter-4U6MC5ZS.js.map → adapter-ELG3VRZ3.js.map} +0 -0
- /package/dist/{agent-catalog-SZQQERV7.js.map → agent-catalog-UYD26QDK.js.map} +0 -0
- /package/dist/{api-client-XTLRRFPX.js.map → api-client-PEMHYL5U.js.map} +0 -0
- /package/dist/{api-server-5VNYFWJE.js.map → api-server-DATG2KBR.js.map} +0 -0
- /package/dist/{api-server-JLBDKCU4.js.map → api-server-L5Z7XACW.js.map} +0 -0
- /package/dist/{chunk-YIGBJFJL.js.map → chunk-7GXEMMEV.js.map} +0 -0
- /package/dist/{config-KN6NKKPF.js.map → config-X4UP7H6R.js.map} +0 -0
- /package/dist/{config-editor-76RVZS4B.js.map → config-editor-7BENRVG5.js.map} +0 -0
- /package/dist/{config-registry-ZXAIJNYB.js.map → config-registry-M3FFWEVM.js.map} +0 -0
- /package/dist/{context-NXXW62NJ.js.map → context-FVGCU5TI.js.map} +0 -0
- /package/dist/{core-plugins-OCHKGCIZ.js.map → core-plugins-JSY2I44L.js.map} +0 -0
- /package/dist/{daemon-XFEMMJSZ.js.map → daemon-UOSRDEXW.js.map} +0 -0
- /package/dist/{doctor-AV6AUO22.js.map → doctor-6DLACBR4.js.map} +0 -0
- /package/dist/{file-service-HHB3JQIO.js.map → file-service-FQQYME7M.js.map} +0 -0
- /package/dist/{install-jq-ISTGT263.js.map → install-jq-SN4IA5K4.js.map} +0 -0
- /package/dist/{security-2BA265LN.js.map → instance-context-FLCE7VZ4.js.map} +0 -0
- /package/dist/{speech-SG62JYIF.js.map → instance-registry-SW5FWKHO.js.map} +0 -0
- /package/dist/{post-upgrade-Y26S2ZQ7.js.map → post-upgrade-F4YPMTUT.js.map} +0 -0
- /package/dist/{telegram-EAVRDNFU.js.map → security-O4XGN2CM.js.map} +0 -0
- /package/dist/{tunnel-HWJ27WDH.js.map → speech-GHTSWDAN.js.map} +0 -0
package/README.md
CHANGED
|
@@ -49,11 +49,26 @@ Your Codebase
|
|
|
49
49
|
|
|
50
50
|
## Quick Start
|
|
51
51
|
|
|
52
|
+
```bash
|
|
53
|
+
# macOS / Linux
|
|
54
|
+
curl -fsSL https://raw.githubusercontent.com/Open-ACP/OpenACP/main/scripts/install.sh | bash
|
|
55
|
+
|
|
56
|
+
# Windows
|
|
57
|
+
powershell -c "irm https://raw.githubusercontent.com/Open-ACP/OpenACP/main/scripts/install.ps1 | iex"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Works on macOS, Linux & Windows. Installs Node.js (if needed) and everything else for you.
|
|
61
|
+
|
|
62
|
+
<details>
|
|
63
|
+
<summary>Or install via npm</summary>
|
|
64
|
+
|
|
52
65
|
```bash
|
|
53
66
|
npm install -g @openacp/cli
|
|
54
67
|
openacp
|
|
55
68
|
```
|
|
56
69
|
|
|
70
|
+
</details>
|
|
71
|
+
|
|
57
72
|
The interactive setup wizard walks you through everything:
|
|
58
73
|
|
|
59
74
|
1. Choose your platform (Telegram, Discord, Slack, or multiple)
|
|
@@ -83,12 +98,14 @@ That's it. Send a message to your bot and start coding.
|
|
|
83
98
|
- **Session persistence** — Sessions survive restarts, with configurable TTL
|
|
84
99
|
- **Permission control** — Approve or deny agent actions via buttons, with optional auto-approve
|
|
85
100
|
- **Real-time streaming** — See agent thinking, tool calls, and output as they happen
|
|
101
|
+
- **Agent switching** — Switch agents mid-conversation with `/switch`; history carries over automatically
|
|
86
102
|
|
|
87
103
|
### Developer Tools
|
|
88
104
|
|
|
89
105
|
- **Tunnel & port forwarding** — Expose local ports to the internet (Cloudflare, ngrok, bore, Tailscale)
|
|
90
106
|
- **Built-in file viewer** — Monaco Editor with syntax highlighting, diffs, and markdown preview
|
|
91
107
|
- **Session transfer** — Move sessions between terminal and chat (`/handoff`)
|
|
108
|
+
- **Agent switch** — Change which AI agent handles your session mid-conversation (`/switch`)
|
|
92
109
|
- **Voice & speech** — Send voice messages, get spoken responses (Groq STT + Edge TTS)
|
|
93
110
|
- **Usage tracking** — Token counts, cost reports, optional monthly budget limits
|
|
94
111
|
- **Context resume** — Resume sessions with full conversation history
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TelegramAdapter
|
|
3
|
+
} from "./chunk-EWVXSTQK.js";
|
|
4
|
+
import "./chunk-AFKX424Q.js";
|
|
5
|
+
import "./chunk-K6UY5M75.js";
|
|
6
|
+
import "./chunk-NOEAJNTK.js";
|
|
7
|
+
import "./chunk-YZCKSNRN.js";
|
|
8
|
+
import "./chunk-NJX75BLK.js";
|
|
9
|
+
import "./chunk-R6KZYF7D.js";
|
|
10
|
+
import "./chunk-ON7HB5O7.js";
|
|
11
|
+
export {
|
|
12
|
+
TelegramAdapter
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=adapter-ELG3VRZ3.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentCatalog
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MDJHCCFS.js";
|
|
4
4
|
import "./chunk-566W6INH.js";
|
|
5
|
-
import "./chunk-ZSLHHQPQ.js";
|
|
6
5
|
import "./chunk-R6KZYF7D.js";
|
|
6
|
+
import "./chunk-ZSLHHQPQ.js";
|
|
7
7
|
export {
|
|
8
8
|
AgentCatalog
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=agent-catalog-
|
|
10
|
+
//# sourceMappingURL=agent-catalog-UYD26QDK.js.map
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
readApiPort,
|
|
4
4
|
readApiSecret,
|
|
5
5
|
removeStalePortFile
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XRJUS6FE.js";
|
|
7
7
|
export {
|
|
8
8
|
apiCall,
|
|
9
9
|
readApiPort,
|
|
10
10
|
readApiSecret,
|
|
11
11
|
removeStalePortFile
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=api-client-
|
|
13
|
+
//# sourceMappingURL=api-client-PEMHYL5U.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ApiServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-R2YLDQLI.js";
|
|
4
4
|
import "./chunk-FNRSWA2K.js";
|
|
5
|
-
import "./chunk-ZSLHHQPQ.js";
|
|
6
5
|
import "./chunk-R6KZYF7D.js";
|
|
6
|
+
import "./chunk-ZSLHHQPQ.js";
|
|
7
7
|
export {
|
|
8
8
|
ApiServer
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=api-server-
|
|
10
|
+
//# sourceMappingURL=api-server-DATG2KBR.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/core/instance-registry.ts
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
var InstanceRegistry = class {
|
|
5
|
+
constructor(registryPath) {
|
|
6
|
+
this.registryPath = registryPath;
|
|
7
|
+
}
|
|
8
|
+
data = { version: 1, instances: {} };
|
|
9
|
+
async load() {
|
|
10
|
+
try {
|
|
11
|
+
const raw = fs.readFileSync(this.registryPath, "utf-8");
|
|
12
|
+
const parsed = JSON.parse(raw);
|
|
13
|
+
if (parsed.version === 1 && parsed.instances) {
|
|
14
|
+
this.data = parsed;
|
|
15
|
+
}
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async save() {
|
|
20
|
+
const dir = path.dirname(this.registryPath);
|
|
21
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
22
|
+
fs.writeFileSync(this.registryPath, JSON.stringify(this.data, null, 2));
|
|
23
|
+
}
|
|
24
|
+
register(id, root) {
|
|
25
|
+
this.data.instances[id] = { id, root };
|
|
26
|
+
}
|
|
27
|
+
remove(id) {
|
|
28
|
+
delete this.data.instances[id];
|
|
29
|
+
}
|
|
30
|
+
get(id) {
|
|
31
|
+
return this.data.instances[id];
|
|
32
|
+
}
|
|
33
|
+
getByRoot(root) {
|
|
34
|
+
return Object.values(this.data.instances).find((e) => e.root === root);
|
|
35
|
+
}
|
|
36
|
+
list() {
|
|
37
|
+
return Object.values(this.data.instances);
|
|
38
|
+
}
|
|
39
|
+
uniqueId(baseId) {
|
|
40
|
+
if (!this.data.instances[baseId]) return baseId;
|
|
41
|
+
let n = 2;
|
|
42
|
+
while (this.data.instances[`${baseId}-${n}`]) n++;
|
|
43
|
+
return `${baseId}-${n}`;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
InstanceRegistry
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=chunk-23SRIVG4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/instance-registry.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\n\nexport interface InstanceRegistryEntry {\n id: string\n root: string\n}\n\ninterface RegistryData {\n version: 1\n instances: Record<string, InstanceRegistryEntry>\n}\n\nexport class InstanceRegistry {\n private data: RegistryData = { version: 1, instances: {} }\n\n constructor(private registryPath: string) {}\n\n async load(): Promise<void> {\n try {\n const raw = fs.readFileSync(this.registryPath, 'utf-8')\n const parsed = JSON.parse(raw) as RegistryData\n if (parsed.version === 1 && parsed.instances) {\n this.data = parsed\n }\n } catch {\n // File doesn't exist or invalid — start fresh\n }\n }\n\n async save(): Promise<void> {\n const dir = path.dirname(this.registryPath)\n fs.mkdirSync(dir, { recursive: true })\n fs.writeFileSync(this.registryPath, JSON.stringify(this.data, null, 2))\n }\n\n register(id: string, root: string): void {\n this.data.instances[id] = { id, root }\n }\n\n remove(id: string): void {\n delete this.data.instances[id]\n }\n\n get(id: string): InstanceRegistryEntry | undefined {\n return this.data.instances[id]\n }\n\n getByRoot(root: string): InstanceRegistryEntry | undefined {\n return Object.values(this.data.instances).find((e) => e.root === root)\n }\n\n list(): InstanceRegistryEntry[] {\n return Object.values(this.data.instances)\n }\n\n uniqueId(baseId: string): string {\n if (!this.data.instances[baseId]) return baseId\n let n = 2\n while (this.data.instances[`${baseId}-${n}`]) n++\n return `${baseId}-${n}`\n }\n}\n"],"mappings":";AAAA,OAAO,QAAQ;AACf,OAAO,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;AACF;","names":[]}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
api_server_default
|
|
3
|
+
} from "./chunk-KGAQW6F4.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
telegram_default
|
|
6
|
+
} from "./chunk-SSLVNCEA.js";
|
|
7
7
|
import {
|
|
8
8
|
tunnel_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
api_server_default
|
|
12
|
-
} from "./chunk-KDU3ZEWT.js";
|
|
13
|
-
import {
|
|
14
|
-
security_default
|
|
15
|
-
} from "./chunk-5OCGO27U.js";
|
|
9
|
+
} from "./chunk-P3HHJANC.js";
|
|
16
10
|
import {
|
|
17
11
|
file_service_default
|
|
18
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZIRH6QWW.js";
|
|
19
13
|
import {
|
|
20
14
|
context_default
|
|
21
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FPKQYCQS.js";
|
|
22
16
|
import {
|
|
23
17
|
speech_default
|
|
24
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-VUSCVRJL.js";
|
|
19
|
+
import {
|
|
20
|
+
notifications_default
|
|
21
|
+
} from "./chunk-3EWTPOF7.js";
|
|
22
|
+
import {
|
|
23
|
+
security_default
|
|
24
|
+
} from "./chunk-OSBZXY2W.js";
|
|
25
25
|
|
|
26
26
|
// src/plugins/core-plugins.ts
|
|
27
27
|
var corePlugins = [
|
|
@@ -41,4 +41,4 @@ var corePlugins = [
|
|
|
41
41
|
export {
|
|
42
42
|
corePlugins
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
44
|
+
//# sourceMappingURL=chunk-7GXEMMEV.js.map
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
expandHome
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YZCKSNRN.js";
|
|
4
4
|
|
|
5
5
|
// src/cli/daemon.ts
|
|
6
6
|
import { spawn } from "child_process";
|
|
7
7
|
import * as fs from "fs";
|
|
8
8
|
import * as path from "path";
|
|
9
9
|
import * as os from "os";
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
var DEFAULT_ROOT = path.join(os.homedir(), ".openacp");
|
|
11
|
+
function getPidPath(root) {
|
|
12
|
+
const base = root ?? DEFAULT_ROOT;
|
|
13
|
+
return path.join(base, "openacp.pid");
|
|
14
|
+
}
|
|
15
|
+
function getLogDir(root) {
|
|
16
|
+
const base = root ?? DEFAULT_ROOT;
|
|
17
|
+
return path.join(base, "logs");
|
|
18
|
+
}
|
|
19
|
+
function getRunningMarker(root) {
|
|
20
|
+
const base = root ?? DEFAULT_ROOT;
|
|
21
|
+
return path.join(base, "running");
|
|
22
|
+
}
|
|
13
23
|
function writePidFile(pidPath, pid) {
|
|
14
24
|
const dir = path.dirname(pidPath);
|
|
15
25
|
fs.mkdirSync(dir, { recursive: true });
|
|
@@ -41,7 +51,7 @@ function isProcessRunning(pidPath) {
|
|
|
41
51
|
return false;
|
|
42
52
|
}
|
|
43
53
|
}
|
|
44
|
-
function getStatus(pidPath =
|
|
54
|
+
function getStatus(pidPath = getPidPath()) {
|
|
45
55
|
const pid = readPidFile(pidPath);
|
|
46
56
|
if (pid === null) return { running: false };
|
|
47
57
|
try {
|
|
@@ -52,13 +62,13 @@ function getStatus(pidPath = DEFAULT_PID_PATH) {
|
|
|
52
62
|
return { running: false };
|
|
53
63
|
}
|
|
54
64
|
}
|
|
55
|
-
function startDaemon(pidPath =
|
|
56
|
-
markRunning();
|
|
65
|
+
function startDaemon(pidPath = getPidPath(), logDir, instanceRoot) {
|
|
66
|
+
markRunning(instanceRoot);
|
|
57
67
|
if (isProcessRunning(pidPath)) {
|
|
58
68
|
const pid = readPidFile(pidPath);
|
|
59
69
|
return { error: `Already running (PID ${pid})` };
|
|
60
70
|
}
|
|
61
|
-
const resolvedLogDir = logDir ? expandHome(logDir) :
|
|
71
|
+
const resolvedLogDir = logDir ? expandHome(logDir) : getLogDir(instanceRoot);
|
|
62
72
|
fs.mkdirSync(resolvedLogDir, { recursive: true });
|
|
63
73
|
const logFile = path.join(resolvedLogDir, "openacp.log");
|
|
64
74
|
const cliPath = path.resolve(process.argv[1]);
|
|
@@ -67,7 +77,11 @@ function startDaemon(pidPath = DEFAULT_PID_PATH, logDir) {
|
|
|
67
77
|
const err = fs.openSync(logFile, "a");
|
|
68
78
|
const child = spawn(nodePath, [cliPath, "--daemon-child"], {
|
|
69
79
|
detached: true,
|
|
70
|
-
stdio: ["ignore", out, err]
|
|
80
|
+
stdio: ["ignore", out, err],
|
|
81
|
+
env: {
|
|
82
|
+
...process.env,
|
|
83
|
+
...instanceRoot ? { OPENACP_INSTANCE_ROOT: instanceRoot } : {}
|
|
84
|
+
}
|
|
71
85
|
});
|
|
72
86
|
fs.closeSync(out);
|
|
73
87
|
fs.closeSync(err);
|
|
@@ -91,7 +105,7 @@ function isProcessAlive(pid) {
|
|
|
91
105
|
return "dead";
|
|
92
106
|
}
|
|
93
107
|
}
|
|
94
|
-
async function stopDaemon(pidPath =
|
|
108
|
+
async function stopDaemon(pidPath = getPidPath(), instanceRoot) {
|
|
95
109
|
const pid = readPidFile(pidPath);
|
|
96
110
|
if (pid === null) return { stopped: false, error: "Not running (no PID file)" };
|
|
97
111
|
const status = isProcessAlive(pid);
|
|
@@ -108,7 +122,7 @@ async function stopDaemon(pidPath = DEFAULT_PID_PATH) {
|
|
|
108
122
|
} catch (e) {
|
|
109
123
|
return { stopped: false, error: `Failed to stop: ${e.message}` };
|
|
110
124
|
}
|
|
111
|
-
clearRunning();
|
|
125
|
+
clearRunning(instanceRoot);
|
|
112
126
|
const POLL_INTERVAL = 100;
|
|
113
127
|
const TIMEOUT = 5e3;
|
|
114
128
|
const start = Date.now();
|
|
@@ -139,24 +153,25 @@ async function stopDaemon(pidPath = DEFAULT_PID_PATH) {
|
|
|
139
153
|
}
|
|
140
154
|
return { stopped: false, pid, error: "Process did not exit after SIGKILL (possible uninterruptible I/O). PID file retained." };
|
|
141
155
|
}
|
|
142
|
-
function
|
|
143
|
-
|
|
156
|
+
function markRunning(root) {
|
|
157
|
+
const marker = getRunningMarker(root);
|
|
158
|
+
fs.mkdirSync(path.dirname(marker), { recursive: true });
|
|
159
|
+
fs.writeFileSync(marker, "");
|
|
144
160
|
}
|
|
145
|
-
function
|
|
146
|
-
fs.mkdirSync(path.dirname(RUNNING_MARKER), { recursive: true });
|
|
147
|
-
fs.writeFileSync(RUNNING_MARKER, "");
|
|
148
|
-
}
|
|
149
|
-
function clearRunning() {
|
|
161
|
+
function clearRunning(root) {
|
|
150
162
|
try {
|
|
151
|
-
fs.unlinkSync(
|
|
163
|
+
fs.unlinkSync(getRunningMarker(root));
|
|
152
164
|
} catch {
|
|
153
165
|
}
|
|
154
166
|
}
|
|
155
|
-
function shouldAutoStart() {
|
|
156
|
-
return fs.existsSync(
|
|
167
|
+
function shouldAutoStart(root) {
|
|
168
|
+
return fs.existsSync(getRunningMarker(root));
|
|
157
169
|
}
|
|
158
170
|
|
|
159
171
|
export {
|
|
172
|
+
getPidPath,
|
|
173
|
+
getLogDir,
|
|
174
|
+
getRunningMarker,
|
|
160
175
|
writePidFile,
|
|
161
176
|
readPidFile,
|
|
162
177
|
removePidFile,
|
|
@@ -164,9 +179,8 @@ export {
|
|
|
164
179
|
getStatus,
|
|
165
180
|
startDaemon,
|
|
166
181
|
stopDaemon,
|
|
167
|
-
getPidPath,
|
|
168
182
|
markRunning,
|
|
169
183
|
clearRunning,
|
|
170
184
|
shouldAutoStart
|
|
171
185
|
};
|
|
172
|
-
//# sourceMappingURL=chunk-
|
|
186
|
+
//# sourceMappingURL=chunk-7U6IZIJP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/cli/daemon.ts"],"sourcesContent":["import { spawn } from 'node:child_process'\nimport * as fs from 'node:fs'\nimport * as path from 'node:path'\nimport * as os from 'node:os'\nimport { expandHome } from '../core/config/config.js'\n\nconst DEFAULT_ROOT = path.join(os.homedir(), '.openacp')\n\nexport function getPidPath(root?: string): string {\n const base = root ?? DEFAULT_ROOT\n return path.join(base, 'openacp.pid')\n}\n\nexport function getLogDir(root?: string): string {\n const base = root ?? DEFAULT_ROOT\n return path.join(base, 'logs')\n}\n\nexport function getRunningMarker(root?: string): string {\n const base = root ?? DEFAULT_ROOT\n return path.join(base, 'running')\n}\n\nexport function writePidFile(pidPath: string, pid: number): void {\n const dir = path.dirname(pidPath)\n fs.mkdirSync(dir, { recursive: true })\n fs.writeFileSync(pidPath, String(pid))\n}\n\nexport function readPidFile(pidPath: string): number | null {\n try {\n const content = fs.readFileSync(pidPath, 'utf-8').trim()\n const pid = parseInt(content, 10)\n return isNaN(pid) ? null : pid\n } catch {\n return null\n }\n}\n\nexport function removePidFile(pidPath: string): void {\n try {\n fs.unlinkSync(pidPath)\n } catch {\n // ignore if already gone\n }\n}\n\nexport function isProcessRunning(pidPath: string): boolean {\n const pid = readPidFile(pidPath)\n if (pid === null) return false\n try {\n process.kill(pid, 0)\n return true\n } catch {\n // Process not running, clean up stale PID file\n removePidFile(pidPath)\n return false\n }\n}\n\nexport function getStatus(pidPath: string = getPidPath()): { running: boolean; pid?: number } {\n const pid = readPidFile(pidPath)\n if (pid === null) return { running: false }\n try {\n process.kill(pid, 0)\n return { running: true, pid }\n } catch {\n removePidFile(pidPath)\n return { running: false }\n }\n}\n\nexport function startDaemon(pidPath: string = getPidPath(), logDir?: string, instanceRoot?: string): { pid: number } | { error: string } {\n // Mark as running so auto-start works on next boot\n markRunning(instanceRoot)\n\n // Check if already running\n if (isProcessRunning(pidPath)) {\n const pid = readPidFile(pidPath)!\n return { error: `Already running (PID ${pid})` }\n }\n\n const resolvedLogDir = logDir ? expandHome(logDir) : getLogDir(instanceRoot)\n fs.mkdirSync(resolvedLogDir, { recursive: true })\n const logFile = path.join(resolvedLogDir, 'openacp.log')\n\n // Find the CLI entry point\n const cliPath = path.resolve(process.argv[1])\n const nodePath = process.execPath\n\n const out = fs.openSync(logFile, 'a')\n const err = fs.openSync(logFile, 'a')\n\n const child = spawn(nodePath, [cliPath, '--daemon-child'], {\n detached: true,\n stdio: ['ignore', out, err],\n env: {\n ...process.env,\n ...(instanceRoot ? { OPENACP_INSTANCE_ROOT: instanceRoot } : {}),\n },\n })\n\n // Close file descriptors in parent — child has its own copies\n fs.closeSync(out)\n fs.closeSync(err)\n\n if (!child.pid) {\n return { error: 'Failed to spawn daemon process' }\n }\n\n // PID file is written by the child process itself (in main.ts startServer)\n // to avoid race conditions and ensure consistency with LaunchAgent/systemd starts.\n // We still write it here as a fallback in case the child hasn't written it yet\n // when the parent needs to report the PID.\n writePidFile(pidPath, child.pid)\n child.unref()\n\n return { pid: child.pid }\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms))\n}\n\nfunction isProcessAlive(pid: number): 'alive' | 'dead' | 'eperm' {\n try {\n process.kill(pid, 0)\n return 'alive'\n } catch (e) {\n const err = e as NodeJS.ErrnoException\n if (err.code === 'EPERM') return 'eperm'\n return 'dead'\n }\n}\n\nexport async function stopDaemon(pidPath: string = getPidPath(), instanceRoot?: string): Promise<{ stopped: boolean; pid?: number; error?: string }> {\n const pid = readPidFile(pidPath)\n if (pid === null) return { stopped: false, error: 'Not running (no PID file)' }\n\n const status = isProcessAlive(pid)\n if (status === 'dead') {\n removePidFile(pidPath)\n return { stopped: false, error: 'Not running (stale PID file removed)' }\n }\n if (status === 'eperm') {\n removePidFile(pidPath)\n return { stopped: false, error: 'PID belongs to another process (stale PID file removed)' }\n }\n\n try {\n process.kill(pid, 'SIGTERM')\n } catch (e) {\n return { stopped: false, error: `Failed to stop: ${(e as Error).message}` }\n }\n\n clearRunning(instanceRoot)\n\n const POLL_INTERVAL = 100\n const TIMEOUT = 5000\n const start = Date.now()\n\n while (Date.now() - start < TIMEOUT) {\n await sleep(POLL_INTERVAL)\n const s = isProcessAlive(pid)\n if (s === 'dead' || s === 'eperm') {\n removePidFile(pidPath)\n return { stopped: true, pid }\n }\n }\n\n try {\n process.kill(pid, 'SIGKILL')\n } catch (e) {\n const err = e as NodeJS.ErrnoException\n if (err.code === 'EPERM') {\n return { stopped: false, pid, error: 'PID may have been reused by another process. Run `openacp status` to verify, or manually delete the PID file.' }\n }\n }\n\n const killStart = Date.now()\n while (Date.now() - killStart < 1000) {\n await sleep(POLL_INTERVAL)\n const s = isProcessAlive(pid)\n if (s === 'dead' || s === 'eperm') {\n removePidFile(pidPath)\n return { stopped: true, pid }\n }\n }\n\n // SIGKILL sent but process still alive after 1s — extremely rare (uninterruptible I/O).\n return { stopped: false, pid, error: 'Process did not exit after SIGKILL (possible uninterruptible I/O). PID file retained.' }\n}\n\n/** Mark that the daemon should auto-start on boot */\nexport function markRunning(root?: string): void {\n const marker = getRunningMarker(root)\n fs.mkdirSync(path.dirname(marker), { recursive: true })\n fs.writeFileSync(marker, '')\n}\n\n/** Remove running marker — daemon won't auto-start on boot */\nexport function clearRunning(root?: string): void {\n try { fs.unlinkSync(getRunningMarker(root)) } catch { /* ignore */ }\n}\n\n/** Check if the daemon was running before (should auto-start on boot) */\nexport function shouldAutoStart(root?: string): boolean {\n return fs.existsSync(getRunningMarker(root))\n}\n"],"mappings":";;;;;AAAA,SAAS,aAAa;AACtB,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,YAAY,QAAQ;AAGpB,IAAM,eAAoB,UAAQ,WAAQ,GAAG,UAAU;AAEhD,SAAS,WAAW,MAAuB;AAChD,QAAM,OAAO,QAAQ;AACrB,SAAY,UAAK,MAAM,aAAa;AACtC;AAEO,SAAS,UAAU,MAAuB;AAC/C,QAAM,OAAO,QAAQ;AACrB,SAAY,UAAK,MAAM,MAAM;AAC/B;AAEO,SAAS,iBAAiB,MAAuB;AACtD,QAAM,OAAO,QAAQ;AACrB,SAAY,UAAK,MA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,MAAqB;AAChD,MAAI;AAAE,IAAG,cAAW,iBAAiB,IAAI,CAAC;AAAA,EAAE,QAAQ;AAAA,EAAe;AACrE;AAGO,SAAS,gBAAgB,MAAwB;AACtD,SAAU,cAAW,iBAAiB,IAAI,CAAC;AAC7C;","names":["resolve"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
commandExists
|
|
3
|
-
} from "./chunk-ZSLHHQPQ.js";
|
|
4
1
|
import {
|
|
5
2
|
createChildLogger
|
|
6
3
|
} from "./chunk-R6KZYF7D.js";
|
|
4
|
+
import {
|
|
5
|
+
commandExists
|
|
6
|
+
} from "./chunk-ZSLHHQPQ.js";
|
|
7
7
|
|
|
8
8
|
// src/core/utils/install-binary.ts
|
|
9
9
|
import fs from "fs";
|
|
@@ -12,7 +12,7 @@ import https from "https";
|
|
|
12
12
|
import os from "os";
|
|
13
13
|
import { execSync } from "child_process";
|
|
14
14
|
var log = createChildLogger({ module: "binary-installer" });
|
|
15
|
-
var
|
|
15
|
+
var DEFAULT_BIN_DIR = path.join(os.homedir(), ".openacp", "bin");
|
|
16
16
|
var IS_WINDOWS = os.platform() === "win32";
|
|
17
17
|
function downloadFile(url, dest) {
|
|
18
18
|
return new Promise((resolve, reject) => {
|
|
@@ -63,9 +63,10 @@ function getDownloadUrl(spec) {
|
|
|
63
63
|
if (!binary) throw new Error(`${spec.name}: unsupported architecture ${arch} for ${platform}`);
|
|
64
64
|
return `${spec.githubBaseUrl}/${binary}`;
|
|
65
65
|
}
|
|
66
|
-
async function ensureBinary(spec) {
|
|
66
|
+
async function ensureBinary(spec, binDir) {
|
|
67
|
+
const resolvedBinDir = binDir ?? DEFAULT_BIN_DIR;
|
|
67
68
|
const binName = IS_WINDOWS ? `${spec.name}.exe` : spec.name;
|
|
68
|
-
const binPath = path.join(
|
|
69
|
+
const binPath = path.join(resolvedBinDir, binName);
|
|
69
70
|
if (commandExists(spec.name)) {
|
|
70
71
|
log.debug({ name: spec.name }, "Found in PATH");
|
|
71
72
|
return spec.name;
|
|
@@ -76,18 +77,21 @@ async function ensureBinary(spec) {
|
|
|
76
77
|
return binPath;
|
|
77
78
|
}
|
|
78
79
|
log.info({ name: spec.name }, "Not found, downloading from GitHub...");
|
|
79
|
-
fs.mkdirSync(
|
|
80
|
+
fs.mkdirSync(resolvedBinDir, { recursive: true });
|
|
80
81
|
const url = getDownloadUrl(spec);
|
|
81
82
|
const isArchive = spec.isArchive?.(url) ?? false;
|
|
82
|
-
const downloadDest = isArchive ? path.join(
|
|
83
|
+
const downloadDest = isArchive ? path.join(resolvedBinDir, `${spec.name}.tgz`) : binPath;
|
|
83
84
|
await downloadFile(url, downloadDest);
|
|
84
85
|
if (isArchive) {
|
|
85
|
-
execSync(`tar -xzf "${downloadDest}" -C "${
|
|
86
|
+
execSync(`tar -xzf "${downloadDest}" -C "${resolvedBinDir}"`, { stdio: "pipe" });
|
|
86
87
|
try {
|
|
87
88
|
fs.unlinkSync(downloadDest);
|
|
88
89
|
} catch {
|
|
89
90
|
}
|
|
90
91
|
}
|
|
92
|
+
if (!fs.existsSync(binPath)) {
|
|
93
|
+
throw new Error(`${spec.name}: binary not found at ${binPath} after download/extraction. The archive structure may have changed.`);
|
|
94
|
+
}
|
|
91
95
|
if (!IS_WINDOWS) {
|
|
92
96
|
fs.chmodSync(binPath, "755");
|
|
93
97
|
}
|
|
@@ -98,4 +102,4 @@ async function ensureBinary(spec) {
|
|
|
98
102
|
export {
|
|
99
103
|
ensureBinary
|
|
100
104
|
};
|
|
101
|
-
//# sourceMappingURL=chunk-
|
|
105
|
+
//# sourceMappingURL=chunk-7YIKTRSM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/utils/install-binary.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport https from 'node:https'\nimport os from 'node:os'\nimport { execSync } from 'node:child_process'\nimport { createChildLogger } from './log.js'\nimport { commandExists } from '../agents/agent-dependencies.js'\n\nconst log = createChildLogger({ module: 'binary-installer' })\n\nconst DEFAULT_BIN_DIR = path.join(os.homedir(), '.openacp', 'bin')\nconst IS_WINDOWS = os.platform() === 'win32'\n\nexport interface BinarySpec {\n name: string\n /** GitHub base URL for releases, e.g. \"https://github.com/jqlang/jq/releases/latest/download\" */\n githubBaseUrl: string\n /** Platform → arch → filename mapping */\n platforms: Record<string, Record<string, string>>\n /** If true, downloaded file is a .tgz archive that needs extraction */\n isArchive?: (url: string) => boolean\n}\n\nfunction downloadFile(url: string, dest: string): Promise<string> {\n return new Promise((resolve, reject) => {\n const file = fs.createWriteStream(dest)\n\n const cleanup = () => {\n try { if (fs.existsSync(dest)) fs.unlinkSync(dest) } catch { /* ignore */ }\n }\n\n https.get(url, (response) => {\n if (response.statusCode === 301 || response.statusCode === 302) {\n file.close(() => {\n cleanup()\n downloadFile(response.headers.location!, dest).then(resolve).catch(reject)\n })\n return\n }\n\n if (response.statusCode !== 200) {\n file.close(() => {\n cleanup()\n reject(new Error(`Download failed with status ${response.statusCode}`))\n })\n return\n }\n\n response.pipe(file)\n file.on('finish', () => file.close(() => resolve(dest)))\n file.on('error', (err) => {\n file.close(() => {\n cleanup()\n reject(err)\n })\n })\n }).on('error', (err) => {\n file.close(() => {\n cleanup()\n reject(err)\n })\n })\n })\n}\n\nfunction getDownloadUrl(spec: BinarySpec): string {\n const platform = os.platform()\n const arch = os.arch()\n const mapping = spec.platforms[platform]\n if (!mapping) throw new Error(`${spec.name}: unsupported platform ${platform}`)\n const binary = mapping[arch]\n if (!binary) throw new Error(`${spec.name}: unsupported architecture ${arch} for ${platform}`)\n return `${spec.githubBaseUrl}/${binary}`\n}\n\n/**\n * Ensure a binary is available.\n * 1. Check PATH first (respects user's system install)\n * 2. Check ~/.openacp/bin/\n * 3. Download from GitHub releases\n */\nexport async function ensureBinary(spec: BinarySpec, binDir?: string): Promise<string> {\n const resolvedBinDir = binDir ?? DEFAULT_BIN_DIR\n const binName = IS_WINDOWS ? `${spec.name}.exe` : spec.name\n const binPath = path.join(resolvedBinDir, binName)\n\n // 1. Check PATH first\n if (commandExists(spec.name)) {\n log.debug({ name: spec.name }, 'Found in PATH')\n return spec.name\n }\n\n // 2. Check our bin directory\n if (fs.existsSync(binPath)) {\n if (!IS_WINDOWS) fs.chmodSync(binPath, '755')\n log.debug({ name: spec.name, path: binPath }, 'Found in ~/.openacp/bin')\n return binPath\n }\n\n // 3. Download\n log.info({ name: spec.name }, 'Not found, downloading from GitHub...')\n fs.mkdirSync(resolvedBinDir, { recursive: true })\n\n const url = getDownloadUrl(spec)\n const isArchive = spec.isArchive?.(url) ?? false\n const downloadDest = isArchive ? path.join(resolvedBinDir, `${spec.name}.tgz`) : binPath\n\n await downloadFile(url, downloadDest)\n\n if (isArchive) {\n execSync(`tar -xzf \"${downloadDest}\" -C \"${resolvedBinDir}\"`, { stdio: 'pipe' })\n try { fs.unlinkSync(downloadDest) } catch { /* ignore */ }\n }\n\n // Validate the binary was actually produced\n if (!fs.existsSync(binPath)) {\n throw new Error(`${spec.name}: binary not found at ${binPath} after download/extraction. The archive structure may have changed.`)\n }\n\n if (!IS_WINDOWS) {\n fs.chmodSync(binPath, '755')\n }\n\n log.info({ name: spec.name, path: binPath }, 'Installed successfully')\n return binPath\n}\n"],"mappings":";;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,OAAO,QAAQ;AACf,SAAS,gBAAgB;AAIzB,IAAM,MAAM,kBAAkB,EAAE,QAAQ,mBAAmB,CAAC;AAE5D,IAAM,kBAAkB,KAAK,KAAK,GAAG,QAAQ,GAAG,YAAY,KAAK;AACjE,IAAM,aAAa,GAAG,SAAS,MAAM;AAYrC,SAAS,aAAa,KAAa,MAA+B;AAChE,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,OAAO,GAAG,kBAAkB,IAAI;AAEtC,UAAM,UAAU,MAAM;AACpB,UAAI;AAAE,YAAI,GAAG,WAAW,IAAI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2
|
CheckpointReader,
|
|
3
3
|
DEFAULT_MAX_TOKENS,
|
|
4
4
|
TOKENS_PER_TURN_ESTIMATE
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NJX75BLK.js";
|
|
6
6
|
|
|
7
7
|
// src/plugins/context/context-manager.ts
|
|
8
8
|
import * as os from "os";
|
|
@@ -47,8 +47,8 @@ var ContextCache = class {
|
|
|
47
47
|
var ContextManager = class {
|
|
48
48
|
providers = [];
|
|
49
49
|
cache;
|
|
50
|
-
constructor() {
|
|
51
|
-
this.cache = new ContextCache(path2.join(os.homedir(), ".openacp", "cache", "entire"));
|
|
50
|
+
constructor(cachePath) {
|
|
51
|
+
this.cache = new ContextCache(cachePath ?? path2.join(os.homedir(), ".openacp", "cache", "entire"));
|
|
52
52
|
}
|
|
53
53
|
register(provider) {
|
|
54
54
|
this.providers.push(provider);
|
|
@@ -68,7 +68,7 @@ var ContextManager = class {
|
|
|
68
68
|
return null;
|
|
69
69
|
}
|
|
70
70
|
async buildContext(query, options) {
|
|
71
|
-
const queryKey = `${query.type}:${query.value}:${options?.limit ?? ""}:${options?.maxTokens ?? ""}`;
|
|
71
|
+
const queryKey = `${query.type}:${query.value}:${options?.limit ?? ""}:${options?.maxTokens ?? ""}:${options?.labelAgent ?? ""}`;
|
|
72
72
|
const cached = this.cache.get(query.repoPath, queryKey);
|
|
73
73
|
if (cached) return cached;
|
|
74
74
|
for (const provider of this.providers) {
|
|
@@ -540,4 +540,4 @@ export {
|
|
|
540
540
|
ContextManager,
|
|
541
541
|
EntireProvider
|
|
542
542
|
};
|
|
543
|
-
//# sourceMappingURL=chunk-
|
|
543
|
+
//# sourceMappingURL=chunk-BYCJQPMN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/plugins/context/context-manager.ts","../../src/plugins/context/context-cache.ts","../../src/plugins/context/entire/message-cleaner.ts","../../src/plugins/context/entire/conversation-builder.ts","../../src/plugins/context/entire/entire-provider.ts"],"sourcesContent":["import * as os from \"node:os\";\nimport * as path from \"node:path\";\nimport type { ContextProvider, ContextQuery, ContextOptions, ContextResult, SessionListResult } from \"./context-provider.js\";\nimport { ContextCache } from \"./context-cache.js\";\n\nexport class ContextManager {\n private providers: ContextProvider[] = [];\n private cache: ContextCache;\n\n constructor(cachePath?: string) {\n this.cache = new ContextCache(cachePath ?? path.join(os.homedir(), \".openacp\", \"cache\", \"entire\"));\n }\n\n register(provider: ContextProvider): void {\n this.providers.push(provider);\n }\n\n async getProvider(repoPath: string): Promise<ContextProvider | null> {\n for (const provider of this.providers) {\n if (await provider.isAvailable(repoPath)) return provider;\n }\n return null;\n }\n\n async listSessions(query: ContextQuery): Promise<SessionListResult | null> {\n for (const provider of this.providers) {\n if (!(await provider.isAvailable(query.repoPath))) continue;\n const result = await provider.listSessions(query);\n if (result.sessions.length > 0) return result;\n }\n return null;\n }\n\n async buildContext(query: ContextQuery, options?: ContextOptions): Promise<ContextResult | null> {\n const queryKey = `${query.type}:${query.value}:${options?.limit ?? \"\"}:${options?.maxTokens ?? \"\"}:${options?.labelAgent ?? \"\"}`;\n const cached = this.cache.get(query.repoPath, queryKey);\n if (cached) return cached;\n\n for (const provider of this.providers) {\n if (!(await provider.isAvailable(query.repoPath))) continue;\n const result = await provider.buildContext(query, options);\n if (result && result.markdown) {\n this.cache.set(query.repoPath, queryKey, result);\n return result;\n }\n }\n return null;\n }\n}\n","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport * as crypto from \"node:crypto\";\nimport type { ContextResult } from \"./context-provider.js\";\n\nconst DEFAULT_TTL_MS = 60 * 60 * 1000;\n\nexport class ContextCache {\n constructor(private cacheDir: string, private ttlMs: number = DEFAULT_TTL_MS) {\n fs.mkdirSync(cacheDir, { recursive: true });\n }\n\n private keyHash(repoPath: string, queryKey: string): string {\n return crypto.createHash(\"sha256\").update(`${repoPath}:${queryKey}`).digest(\"hex\").slice(0, 16);\n }\n\n private filePath(repoPath: string, queryKey: string): string {\n return path.join(this.cacheDir, `${this.keyHash(repoPath, queryKey)}.json`);\n }\n\n get(repoPath: string, queryKey: string): ContextResult | null {\n const fp = this.filePath(repoPath, queryKey);\n try {\n const stat = fs.statSync(fp);\n if (Date.now() - stat.mtimeMs > this.ttlMs) { fs.unlinkSync(fp); return null; }\n return JSON.parse(fs.readFileSync(fp, \"utf-8\")) as ContextResult;\n } catch { return null; }\n }\n\n set(repoPath: string, queryKey: string, result: ContextResult): void {\n fs.writeFileSync(this.filePath(repoPath, queryKey), JSON.stringify(result));\n }\n}\n","const SYSTEM_TAG_PATTERNS: RegExp[] = [\n /<system-reminder>[\\s\\S]*?<\\/system-reminder>/g,\n /<local-command-caveat>[\\s\\S]*?<\\/local-command-caveat>/g,\n /<local-command-stdout>[\\s\\S]*?<\\/local-command-stdout>/g,\n /<command-name>[\\s\\S]*?<\\/command-name>/g,\n /<command-message>[\\s\\S]*?<\\/command-message>/g,\n /<user-prompt-submit-hook>[\\s\\S]*?<\\/user-prompt-submit-hook>/g,\n /<ide_selection>[\\s\\S]*?<\\/ide_selection>/g,\n /<ide_context>[\\s\\S]*?<\\/ide_context>/g,\n /<ide_opened_file>[\\s\\S]*?<\\/ide_opened_file>/g,\n /<cursor_context>[\\s\\S]*?<\\/cursor_context>/g,\n /<attached_files>[\\s\\S]*?<\\/attached_files>/g,\n /<repo_context>[\\s\\S]*?<\\/repo_context>/g,\n /<task-notification>[\\s\\S]*?<\\/task-notification>/g,\n];\n\nconst COMMAND_ARGS_RE = /<command-args>([\\s\\S]*?)<\\/command-args>/;\n\nexport function cleanSystemTags(text: string): string {\n const argsMatch = COMMAND_ARGS_RE.exec(text);\n const userArgs = argsMatch?.[1]?.trim() ?? \"\";\n text = text.replace(/<command-args>[\\s\\S]*?<\\/command-args>/g, \"\");\n for (const pat of SYSTEM_TAG_PATTERNS) {\n text = text.replace(new RegExp(pat.source, pat.flags), \"\");\n }\n text = text.trim();\n if (!text && userArgs) return userArgs;\n if (text && userArgs && text !== userArgs) return `${text}\\n${userArgs}`;\n return text || userArgs;\n}\n\nconst SKILL_INDICATORS = [\n \"Base directory for this skill:\",\n \"<HARD-GATE>\",\n \"## Checklist\",\n \"## Process Flow\",\n \"## Key Principles\",\n \"digraph brainstorming\",\n \"You MUST create a task for each\",\n];\n\nexport function isSkillPrompt(text: string): boolean {\n for (const indicator of SKILL_INDICATORS) {\n if (text.includes(indicator)) return true;\n }\n if (text.length > 2000) {\n const headerCount = (text.match(/## /g) || []).length;\n if (headerCount >= 3) return true;\n }\n return false;\n}\n\nexport function isNoiseMessage(text: string): boolean {\n const cleaned = cleanSystemTags(text);\n if (!cleaned) return true;\n if (/^(ready|ready\\.)$/i.test(cleaned)) return true;\n if (cleaned.includes(\"Tell your human partner that this command is deprecated\")) return true;\n if (cleaned.startsWith(\"Read the output file to retrieve the result:\")) return true;\n if (/^(opus|sonnet|haiku|claude)(\\[.*\\])?$/i.test(cleaned)) return true;\n return false;\n}\n","import type { ContextMode } from \"../context-provider.js\";\nimport { cleanSystemTags, isSkillPrompt, isNoiseMessage } from \"./message-cleaner.js\";\n\n// ─── Types ────────────────────────────────────────────────────────────────────\n\nexport interface AssistantPart {\n type: \"text\" | \"edit\" | \"write\";\n content?: string;\n file?: string;\n old?: string;\n new?: string;\n fileContent?: string;\n}\n\nexport interface Turn {\n userText: string;\n userTimestamp: string;\n assistantParts: AssistantPart[];\n}\n\nexport interface ParseResult {\n turns: Turn[];\n branch: string;\n firstTimestamp: string;\n lastTimestamp: string;\n}\n\nexport interface SessionMarkdownInput {\n markdown: string;\n startTime: string;\n endTime: string;\n agent: string;\n turns: number;\n branch: string;\n files: string[];\n}\n\n// ─── Mode selection ────────────────────────────────────────────────────────────\n\n/**\n * Select rendering mode based on total turn count.\n * ≤10 → full\n * 11-25 → balanced\n * >25 → compact\n */\nexport function selectMode(totalTurns: number): ContextMode {\n if (totalTurns <= 10) return \"full\";\n if (totalTurns <= 25) return \"balanced\";\n return \"compact\";\n}\n\n// ─── Token estimation ─────────────────────────────────────────────────────────\n\nexport function estimateTokens(text: string): number {\n return Math.floor(text.length / 4);\n}\n\n// ─── Path helpers ─────────────────────────────────────────────────────────────\n\nfunction shortenPath(fp: string): string {\n const parts = fp.split(\"/\");\n if (parts.length >= 2) return parts.slice(-2).join(\"/\");\n return fp;\n}\n\nfunction countLines(s: string): number {\n const trimmed = s.trim();\n if (!trimmed) return 0;\n return trimmed.split(\"\\n\").length;\n}\n\n// ─── Content extraction ───────────────────────────────────────────────────────\n\ntype ContentBlock = { type: string; [key: string]: unknown };\n\nfunction extractText(content: unknown): string {\n if (typeof content === \"string\") return content;\n if (Array.isArray(content)) {\n return content\n .filter((b): b is ContentBlock => typeof b === \"object\" && b !== null && (b as ContentBlock).type === \"text\")\n .map((b) => (b as unknown as { text: string }).text)\n .join(\"\\n\");\n }\n return \"\";\n}\n\nfunction extractContentBlocks(content: unknown): ContentBlock[] {\n if (typeof content === \"string\") return [{ type: \"text\", text: content }];\n if (Array.isArray(content)) {\n return content.filter((b): b is ContentBlock => typeof b === \"object\" && b !== null);\n }\n return [];\n}\n\nfunction isToolResultOnly(content: unknown): boolean {\n if (typeof content === \"string\") return false;\n if (!Array.isArray(content)) return true;\n for (const block of content) {\n if (typeof block === \"object\" && block !== null) {\n const b = block as ContentBlock;\n if (b.type === \"text\" && typeof b.text === \"string\" && (b.text as string).trim()) return false;\n if (b.type === \"image\") return false;\n }\n }\n return true;\n}\n\nfunction hasImage(content: unknown): boolean {\n if (!Array.isArray(content)) return false;\n return content.some((b) => typeof b === \"object\" && b !== null && (b as ContentBlock).type === \"image\");\n}\n\n// ─── Format functions ─────────────────────────────────────────────────────────\n\nfunction formatEditFull(filePath: string, oldStr: string, newStr: string): string {\n const lines: string[] = [];\n lines.push(`✏️ \\`${filePath}\\``);\n lines.push(\"```diff\");\n for (const line of oldStr.split(\"\\n\")) lines.push(`- ${line}`);\n for (const line of newStr.split(\"\\n\")) lines.push(`+ ${line}`);\n lines.push(\"```\");\n return lines.join(\"\\n\");\n}\n\nfunction formatEditBalanced(filePath: string, oldStr: string, newStr: string, maxDiffLines = 12): string {\n const oldLines = oldStr.split(\"\\n\");\n const newLines = newStr.split(\"\\n\");\n const total = oldLines.length + newLines.length;\n const lines: string[] = [];\n lines.push(`✏️ \\`${filePath}\\``);\n lines.push(\"```diff\");\n if (total <= maxDiffLines) {\n for (const line of oldLines) lines.push(`- ${line}`);\n for (const line of newLines) lines.push(`+ ${line}`);\n } else {\n const half = Math.floor(maxDiffLines / 2);\n for (const line of oldLines.slice(0, half)) lines.push(`- ${line}`);\n if (oldLines.length > half) lines.push(` ... (-${oldLines.length} lines total)`);\n for (const line of newLines.slice(0, half)) lines.push(`+ ${line}`);\n if (newLines.length > half) lines.push(` ... (+${newLines.length} lines total)`);\n }\n lines.push(\"```\");\n return lines.join(\"\\n\");\n}\n\nfunction formatEditCompact(filePath: string, oldStr: string, newStr: string): string {\n const oldLines = countLines(oldStr);\n const newLines = countLines(newStr);\n let firstNew = \"\";\n for (const line of newStr.split(\"\\n\")) {\n const stripped = line.trim();\n if (stripped && !stripped.startsWith(\"//\") && !stripped.startsWith(\"*\")) {\n firstNew = stripped.slice(0, 80);\n break;\n }\n }\n if (firstNew) {\n return `✏️ \\`${filePath}\\` (-${oldLines}/+${newLines} lines): \\`${firstNew}\\``;\n }\n return `✏️ \\`${filePath}\\` (-${oldLines}/+${newLines} lines)`;\n}\n\nfunction formatWriteFull(filePath: string, content: string): string {\n const lines: string[] = [];\n lines.push(`📝 \\`${filePath}\\``);\n lines.push(\"```\");\n lines.push(content);\n lines.push(\"```\");\n return lines.join(\"\\n\");\n}\n\nfunction formatWriteBalanced(filePath: string, content: string, maxLines = 15): string {\n const contentLines = content.split(\"\\n\");\n const lines: string[] = [];\n lines.push(`📝 \\`${filePath}\\` (${contentLines.length} lines)`);\n lines.push(\"```\");\n for (const line of contentLines.slice(0, maxLines)) lines.push(line);\n if (contentLines.length > maxLines) lines.push(`... (${contentLines.length - maxLines} more lines)`);\n lines.push(\"```\");\n return lines.join(\"\\n\");\n}\n\nfunction formatWriteCompact(filePath: string, content: string): string {\n const numLines = countLines(content);\n return `📝 \\`${filePath}\\` (${numLines} lines written)`;\n}\n\n// ─── Parser ───────────────────────────────────────────────────────────────────\n\ninterface RawEvent {\n type?: string;\n message?: { role?: string; content?: unknown };\n timestamp?: string;\n uuid?: string;\n parentUuid?: string | null;\n sessionId?: string;\n gitBranch?: string;\n}\n\nexport function parseJsonlToTurns(jsonl: string): ParseResult {\n const events: RawEvent[] = [];\n for (const rawLine of jsonl.split(\"\\n\")) {\n const line = rawLine.trim();\n if (!line) continue;\n try {\n events.push(JSON.parse(line) as RawEvent);\n } catch {\n // skip invalid JSON lines\n }\n }\n\n // Extract gitBranch from first event that has it\n let branch = \"unknown\";\n for (const e of events) {\n if (e.gitBranch) {\n branch = e.gitBranch;\n break;\n }\n }\n\n const convEvents = events.filter((e) => e.type === \"user\" || e.type === \"assistant\");\n\n const turns: Turn[] = [];\n let currentTurn: Turn | null = null;\n\n for (const e of convEvents) {\n const etype = e.type;\n const content = e.message?.content ?? [];\n const ts = e.timestamp ?? \"\";\n\n if (etype === \"user\") {\n if (isToolResultOnly(content)) continue;\n\n const text = extractText(content);\n\n if (isSkillPrompt(text)) continue;\n if (isNoiseMessage(text)) continue;\n\n const cleaned = cleanSystemTags(text);\n if (!cleaned) continue;\n\n // Push previous turn if any\n if (currentTurn) turns.push(currentTurn);\n\n const imgSuffix = hasImage(content) ? \" [image]\" : \"\";\n currentTurn = {\n userText: cleaned + imgSuffix,\n userTimestamp: ts,\n assistantParts: [],\n };\n } else if (etype === \"assistant\" && currentTurn) {\n const blocks = extractContentBlocks(content);\n let pendingText: string | null = null;\n\n for (const block of blocks) {\n const btype = block.type;\n\n if (btype === \"text\") {\n const text = typeof block.text === \"string\" ? (block.text as string).trim() : \"\";\n if (text) pendingText = text;\n } else if (btype === \"tool_use\") {\n const name = typeof block.name === \"string\" ? block.name : \"\";\n const inp = (typeof block.input === \"object\" && block.input !== null ? block.input : {}) as Record<string, string>;\n\n if (name === \"Edit\") {\n if (pendingText) {\n currentTurn.assistantParts.push({ type: \"text\", content: pendingText });\n pendingText = null;\n }\n currentTurn.assistantParts.push({\n type: \"edit\",\n file: shortenPath(inp.file_path ?? \"\"),\n old: inp.old_string ?? \"\",\n new: inp.new_string ?? \"\",\n });\n } else if (name === \"Write\") {\n if (pendingText) {\n currentTurn.assistantParts.push({ type: \"text\", content: pendingText });\n pendingText = null;\n }\n currentTurn.assistantParts.push({\n type: \"write\",\n file: shortenPath(inp.file_path ?? \"\"),\n fileContent: inp.content ?? \"\",\n });\n }\n // Skip Read, Bash, Grep, Glob, etc.\n }\n }\n\n if (pendingText) {\n currentTurn.assistantParts.push({ type: \"text\", content: pendingText });\n }\n }\n }\n\n if (currentTurn) turns.push(currentTurn);\n\n const firstTimestamp = turns[0]?.userTimestamp ?? \"\";\n const lastTimestamp = turns[turns.length - 1]?.userTimestamp ?? \"\";\n\n return { turns, branch, firstTimestamp, lastTimestamp };\n}\n\n// ─── Markdown builder ─────────────────────────────────────────────────────────\n\nexport function buildSessionMarkdown(turns: Turn[], mode: ContextMode): string {\n const out: string[] = [];\n\n for (let i = 0; i < turns.length; i++) {\n const turn = turns[i];\n const userText = turn.userText.trim();\n if (!userText) continue;\n\n out.push(`**User [${i + 1}]:**`);\n out.push(userText);\n out.push(\"\");\n\n let hasContent = false;\n\n for (const part of turn.assistantParts) {\n if (part.type === \"text\") {\n if (!hasContent) {\n out.push(\"**Assistant:**\");\n hasContent = true;\n }\n out.push(part.content ?? \"\");\n out.push(\"\");\n } else if (part.type === \"edit\") {\n if (!hasContent) {\n out.push(\"**Assistant:**\");\n hasContent = true;\n }\n const file = part.file ?? \"\";\n const oldStr = part.old ?? \"\";\n const newStr = part.new ?? \"\";\n if (mode === \"full\") {\n out.push(formatEditFull(file, oldStr, newStr));\n } else if (mode === \"balanced\") {\n out.push(formatEditBalanced(file, oldStr, newStr));\n } else {\n out.push(formatEditCompact(file, oldStr, newStr));\n }\n out.push(\"\");\n } else if (part.type === \"write\") {\n if (!hasContent) {\n out.push(\"**Assistant:**\");\n hasContent = true;\n }\n const file = part.file ?? \"\";\n const content = part.fileContent ?? \"\";\n if (mode === \"full\") {\n out.push(formatWriteFull(file, content));\n } else if (mode === \"balanced\") {\n out.push(formatWriteBalanced(file, content));\n } else {\n out.push(formatWriteCompact(file, content));\n }\n out.push(\"\");\n }\n }\n\n out.push(\"---\");\n out.push(\"\");\n }\n\n return out.join(\"\\n\");\n}\n\n// ─── Session merger ───────────────────────────────────────────────────────────\n\nconst DISCLAIMER = `> **Note:** This conversation history may contain outdated information. File contents, code, and project state may have changed since these sessions were recorded. Use this as context only — always verify against current files before acting.`;\n\nexport function mergeSessionsMarkdown(\n sessions: SessionMarkdownInput[],\n mode: ContextMode,\n title: string\n): string {\n // Sort sessions chronologically (oldest first)\n const sorted = [...sessions].sort((a, b) => a.startTime.localeCompare(b.startTime));\n\n const totalTurns = sorted.reduce((sum, s) => sum + s.turns, 0);\n const overallStart = sorted[0]?.startTime.slice(0, 16) ?? \"?\";\n const overallEnd = sorted[sorted.length - 1]?.endTime.slice(0, 16) ?? \"?\";\n\n const out: string[] = [];\n out.push(`# Conversation History from ${title}`);\n out.push(`${sorted.length} sessions | ${totalTurns} turns | ${overallStart} → ${overallEnd} | mode: ${mode}`);\n out.push(\"\");\n\n for (let i = 0; i < sorted.length; i++) {\n const s = sorted[i];\n const start = s.startTime.slice(0, 16);\n const end = s.endTime.slice(0, 16);\n out.push(`## Session Conversation History ${i + 1} — ${start} → ${end} (${s.agent}, ${s.turns} turns, branch: ${s.branch})`);\n out.push(\"\");\n out.push(s.markdown);\n }\n\n out.push(DISCLAIMER);\n out.push(\"\");\n\n return out.join(\"\\n\");\n}\n","import type { ContextProvider, ContextQuery, ContextOptions, ContextResult, SessionListResult, SessionInfo } from \"../context-provider.js\";\nimport type { ContextMode } from \"../context-provider.js\";\nimport { DEFAULT_MAX_TOKENS, TOKENS_PER_TURN_ESTIMATE } from \"../context-provider.js\";\nimport { CheckpointReader } from \"./checkpoint-reader.js\";\nimport { parseJsonlToTurns, buildSessionMarkdown, mergeSessionsMarkdown, selectMode, estimateTokens, type SessionMarkdownInput } from \"./conversation-builder.js\";\n\nexport class EntireProvider implements ContextProvider {\n readonly name = \"entire\";\n\n async isAvailable(repoPath: string): Promise<boolean> {\n return new CheckpointReader(repoPath).hasEntireBranch();\n }\n\n async listSessions(query: ContextQuery): Promise<SessionListResult> {\n const reader = new CheckpointReader(query.repoPath);\n const sessions = await this.resolveSessions(reader, query);\n const estimatedTokens = sessions.reduce((sum, s) => sum + s.turnCount * TOKENS_PER_TURN_ESTIMATE, 0);\n return { sessions, estimatedTokens };\n }\n\n async buildContext(query: ContextQuery, options?: ContextOptions): Promise<ContextResult> {\n const maxTokens = options?.maxTokens ?? DEFAULT_MAX_TOKENS;\n const reader = new CheckpointReader(query.repoPath);\n let sessions = await this.resolveSessions(reader, query);\n\n if (options?.limit && sessions.length > options.limit) {\n sessions = sessions.slice(-options.limit);\n }\n\n if (sessions.length === 0) {\n return { markdown: \"\", tokenEstimate: 0, sessionCount: 0, totalTurns: 0, mode: \"full\", truncated: false, timeRange: { start: \"\", end: \"\" } };\n }\n\n // Rebuild each session, cache parsed turns for potential re-render\n const parsedSessions: { session: SessionInfo; jsonl: string; }[] = [];\n for (const sess of sessions) {\n const jsonl = reader.getTranscript(sess.transcriptPath);\n if (jsonl) parsedSessions.push({ session: sess, jsonl });\n }\n\n if (parsedSessions.length === 0) {\n return { markdown: \"\", tokenEstimate: 0, sessionCount: 0, totalTurns: 0, mode: \"full\", truncated: false, timeRange: { start: \"\", end: \"\" } };\n }\n\n const totalTurns = parsedSessions.reduce((sum, ps) => {\n const parsed = parseJsonlToTurns(ps.jsonl);\n return sum + parsed.turns.length;\n }, 0);\n\n let mode = selectMode(totalTurns);\n const title = this.buildTitle(query);\n\n // Build markdown for each session\n let sessionMarkdowns = this.buildSessionMarkdowns(parsedSessions, mode);\n let merged = mergeSessionsMarkdown(sessionMarkdowns, mode, title);\n let tokens = estimateTokens(merged);\n\n // Auto-downgrade to compact if over budget\n if (tokens > maxTokens && mode !== \"compact\") {\n mode = \"compact\";\n sessionMarkdowns = this.buildSessionMarkdowns(parsedSessions, \"compact\");\n merged = mergeSessionsMarkdown(sessionMarkdowns, \"compact\", title);\n tokens = estimateTokens(merged);\n }\n\n // Truncate oldest sessions if still over budget\n let truncated = false;\n while (tokens > maxTokens && sessionMarkdowns.length > 1) {\n sessionMarkdowns = sessionMarkdowns.slice(1);\n truncated = true;\n merged = mergeSessionsMarkdown(sessionMarkdowns, mode, title);\n tokens = estimateTokens(merged);\n }\n\n const allTimes = sessionMarkdowns.flatMap(s => [s.startTime, s.endTime]).filter(Boolean).sort();\n const finalTurns = sessionMarkdowns.reduce((sum, s) => sum + s.turns, 0);\n\n return {\n markdown: merged,\n tokenEstimate: tokens,\n sessionCount: sessionMarkdowns.length,\n totalTurns: finalTurns,\n mode,\n truncated,\n timeRange: { start: allTimes[0] ?? \"\", end: allTimes[allTimes.length - 1] ?? \"\" },\n };\n }\n\n private buildSessionMarkdowns(parsedSessions: { session: SessionInfo; jsonl: string }[], mode: ContextMode): SessionMarkdownInput[] {\n return parsedSessions.map(ps => {\n const parsed = parseJsonlToTurns(ps.jsonl);\n return {\n markdown: buildSessionMarkdown(parsed.turns, mode),\n startTime: parsed.firstTimestamp,\n endTime: parsed.lastTimestamp,\n agent: ps.session.agent,\n turns: parsed.turns.length,\n branch: ps.session.branch,\n files: ps.session.filesTouched.map(f => f.split(\"/\").pop() ?? f),\n };\n });\n }\n\n private async resolveSessions(reader: CheckpointReader, query: ContextQuery): Promise<SessionInfo[]> {\n switch (query.type) {\n case \"branch\": return reader.resolveByBranch(query.value);\n case \"commit\": return reader.resolveByCommit(query.value);\n case \"pr\": return reader.resolveByPr(query.value);\n case \"checkpoint\": return reader.resolveByCheckpoint(query.value);\n case \"session\": return reader.resolveBySessionId(query.value);\n case \"latest\": return reader.resolveLatest(parseInt(query.value) || 5);\n default: return [];\n }\n }\n\n private buildTitle(query: ContextQuery): string {\n switch (query.type) {\n case \"pr\": return `PR #${query.value.replace(/.*\\/pull\\//, \"\")}`;\n case \"branch\": return `branch \\`${query.value}\\``;\n case \"commit\": return `commit \\`${query.value.slice(0, 8)}\\``;\n case \"checkpoint\": return `checkpoint \\`${query.value}\\``;\n case \"session\": return `session \\`${query.value.slice(0, 8)}...\\``;\n case \"latest\": return `latest ${query.value} sessions`;\n default: return \"unknown\";\n }\n }\n}\n"],"mappings":";;;;;;;AAAA,YAAY,QAAQ;AACpB,YAAYA,WAAU;;;ACDtB,YAAY,QAAQ;AACpB,YAAY,UAAU;AACtB,YAAY,YAAY;AAGxB,IAAM,iBAAiB,KAAK,KAAK;AAE1B,IAAM,eAAN,MAAmB;AAAA,EACxB,YAAoB,UAA0B,QAAgB,gBAAgB;AAA1D;AAA0B;AAC5C,IAAG,aAAU,UAAU,EAAE,WAAW,KAAK,CAAC;AAAA,EAC5C;AAAA,EAEQ,QAAQ,UAAkB,UAA0B;AAC1D,WAAc,kBAAW,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,QAAQ,EAAE,EAAE,OAAO,KAAK,EAAE,MAAM,GAAG,EAAE;AAAA,EAChG;AAAA,EAEQ,SAAS,UAAkB,UAA0B;AAC3D,WAAY,UAAK,KAAK,UAAU,GAAG,KAAK,QAAQ,UAAU,QAAQ,CAAC,OAAO;AAAA,EAC5E;AAAA,EAEA,IAAI,UAAkB,UAAwC;AAC5D,UAAM,KAAK,KAAK,SAAS,UAAU,QAAQ;AAC3C,QAAI;AACF,YAAM,OAAU,YAAS,EAAE;AAC3B,UAAI,KAAK,IAAI,IAAI,KAAK,UAAU,KAAK,OAAO;AAAE,QAAG,cAAW,EAAE;AAAG,eAAO;AAAA,MAAM;AAC9E,aAAO,KAAK,MAAS,gBAAa,IAAI,OAAO,CAAC;AAAA,IAChD,QAAQ;AAAE,aAAO;AAAA,IAA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