@paradow/ledge 0.7.0 → 0.8.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/dist/cli/{attach-P6CWCJ2R.js → attach-KTZOG7E5.js} +4 -4
- package/dist/cli/{bridge-ZYR3IBVM.js → bridge-QKQW7UD6.js} +1 -1
- package/dist/cli/{chunk-MK7NEXY7.js → chunk-6ZKNEJND.js} +1 -1
- package/dist/cli/{chunk-HR6VWBLT.js → chunk-7AKUPFMS.js} +3 -3
- package/dist/cli/chunk-CCB5DTOS.js +6 -0
- package/dist/cli/{chunk-4BBKLTDB.js → chunk-KJWMK65Y.js} +3 -1
- package/dist/cli/{chunk-GZFSUQZJ.js → chunk-Y5TCZTFL.js} +18 -1
- package/dist/cli/{chunk-3TXM4DM7.js → chunk-ZPANTZKC.js} +1 -1
- package/dist/cli/{daemon-GREPJUOS.js → daemon-MSDX3HWZ.js} +18 -5
- package/dist/cli/{hook-ZVXQ3MGS.js → hook-BBVUY4RK.js} +4 -4
- package/dist/cli/index.js +7 -7
- package/dist/cli/{launch-PIFVOOJV.js → launch-RWT4EWWI.js} +4 -4
- package/dist/cli/{status-RVD4U2XH.js → status-L2GROM4J.js} +2 -2
- package/dist/cli/{version-X3LYAGKA.js → version-VOKMNNLW.js} +1 -1
- package/package.json +1 -1
- package/dist/cli/chunk-KD7LKXIF.js +0 -6
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachEnv
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-7AKUPFMS.js";
|
|
4
|
+
import "./chunk-ZPANTZKC.js";
|
|
5
5
|
import {
|
|
6
6
|
realTmux
|
|
7
7
|
} from "./chunk-3TNPEAMR.js";
|
|
8
8
|
import "./chunk-L6IGH4LF.js";
|
|
9
9
|
import {
|
|
10
10
|
connect
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6ZKNEJND.js";
|
|
12
12
|
import {
|
|
13
13
|
PROTOCOL_PORT
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KJWMK65Y.js";
|
|
15
15
|
|
|
16
16
|
// src/cli/attach.ts
|
|
17
17
|
import { spawn } from "child_process";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exitFile,
|
|
3
3
|
spawnSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZPANTZKC.js";
|
|
5
5
|
import {
|
|
6
6
|
realTmux
|
|
7
7
|
} from "./chunk-3TNPEAMR.js";
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
} from "./chunk-L6IGH4LF.js";
|
|
12
12
|
import {
|
|
13
13
|
connect
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6ZKNEJND.js";
|
|
15
15
|
import {
|
|
16
16
|
PROTOCOL_PORT
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KJWMK65Y.js";
|
|
18
18
|
|
|
19
19
|
// src/cli/launch.ts
|
|
20
20
|
import { spawn } from "child_process";
|
|
@@ -30,7 +30,9 @@ var HelperSchema = z.object({
|
|
|
30
30
|
id: z.string(),
|
|
31
31
|
kind: z.string(),
|
|
32
32
|
task: z.string(),
|
|
33
|
-
state: SessionStateSchema
|
|
33
|
+
state: SessionStateSchema,
|
|
34
|
+
/** When this helper finished; retained across daemon restarts until its five-minute expiry. */
|
|
35
|
+
finishedAt: z.string().datetime().optional()
|
|
34
36
|
});
|
|
35
37
|
var TopicSourceSchema = z.enum(["user", "pane", "prompt"]);
|
|
36
38
|
var SessionSchema = z.object({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cleanTopic,
|
|
3
3
|
sessionTitle
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KJWMK65Y.js";
|
|
5
5
|
|
|
6
6
|
// src/daemon/crossSession.ts
|
|
7
7
|
var FIRST_LINE = /^Another Claude session sent a message:\s*\n/;
|
|
@@ -151,6 +151,23 @@ function withTopic(s, text, source) {
|
|
|
151
151
|
return { ...next, title: sessionTitle(next) };
|
|
152
152
|
}
|
|
153
153
|
function reduce(s, ev) {
|
|
154
|
+
const next = reduceEvent(s, ev);
|
|
155
|
+
if (next === s) return s;
|
|
156
|
+
let changed = false;
|
|
157
|
+
const helpers = next.helpers.map((h) => {
|
|
158
|
+
if (h.state === "exited" || next.state === "exited") {
|
|
159
|
+
if (h.state === "exited" && h.finishedAt) return h;
|
|
160
|
+
changed = true;
|
|
161
|
+
return { ...h, state: "exited", finishedAt: h.finishedAt ?? next.exitedAt ?? ev.at };
|
|
162
|
+
}
|
|
163
|
+
if (!h.finishedAt) return h;
|
|
164
|
+
changed = true;
|
|
165
|
+
const { finishedAt: _gone, ...active } = h;
|
|
166
|
+
return active;
|
|
167
|
+
});
|
|
168
|
+
return changed ? { ...next, helpers } : next;
|
|
169
|
+
}
|
|
170
|
+
function reduceEvent(s, ev) {
|
|
154
171
|
if (ev.agentSessionId && !ev.helperId && ev.agentSessionId !== s.agentSessionId) s = { ...s, agentSessionId: ev.agentSessionId };
|
|
155
172
|
if (s.state === "exited") return s;
|
|
156
173
|
s = endCursorHelpers(s, ev);
|
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
QUESTION_TOOLS,
|
|
3
3
|
crossSession,
|
|
4
4
|
reduce
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Y5TCZTFL.js";
|
|
6
6
|
import {
|
|
7
7
|
agentMessages,
|
|
8
8
|
claudePlan,
|
|
9
9
|
spawnSession
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZPANTZKC.js";
|
|
11
11
|
import {
|
|
12
12
|
LEDGE_VERSION
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CCB5DTOS.js";
|
|
14
14
|
import {
|
|
15
15
|
SERVICE,
|
|
16
16
|
inDaemonService,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
pendingKey,
|
|
53
53
|
pickName,
|
|
54
54
|
projectOf
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-KJWMK65Y.js";
|
|
56
56
|
|
|
57
57
|
// src/daemon/index.ts
|
|
58
58
|
import { writeFile as writeFile5, rm as rm5 } from "fs/promises";
|
|
@@ -1341,6 +1341,7 @@ async function gitSummary(cwd, exec = execGit) {
|
|
|
1341
1341
|
// src/daemon/poller.ts
|
|
1342
1342
|
var DETECT_LINES = 60;
|
|
1343
1343
|
var REST_MS = 2e3;
|
|
1344
|
+
var HELPER_RETENTION_MS = 5 * 60 * 1e3;
|
|
1344
1345
|
function startPoller(opts) {
|
|
1345
1346
|
const { store, tmux } = opts;
|
|
1346
1347
|
const adapterFor2 = opts.adapterFor ?? adapterFor;
|
|
@@ -1372,7 +1373,9 @@ function startPoller(opts) {
|
|
|
1372
1373
|
const deadCheck = t - lastDeadCheck >= deadCheckMs;
|
|
1373
1374
|
if (deadCheck) lastDeadCheck = t;
|
|
1374
1375
|
for (const id of previews.keys()) if (!store.get(id)) previews.delete(id);
|
|
1375
|
-
for (const
|
|
1376
|
+
for (const snapshot of store.all()) {
|
|
1377
|
+
const s = store.get(snapshot.id);
|
|
1378
|
+
if (!s) continue;
|
|
1376
1379
|
try {
|
|
1377
1380
|
await pollOne(s, t, deadCheck);
|
|
1378
1381
|
} catch (e) {
|
|
@@ -1384,6 +1387,16 @@ function startPoller(opts) {
|
|
|
1384
1387
|
}
|
|
1385
1388
|
}
|
|
1386
1389
|
async function pollOne(s, t, deadCheck) {
|
|
1390
|
+
const helpers = s.helpers.flatMap((h2) => {
|
|
1391
|
+
if (s.pending?.helperId === h2.id || h2.state !== "exited" && s.state !== "exited") return [h2];
|
|
1392
|
+
const finishedAt = h2.finishedAt ?? s.exitedAt ?? s.lastActivityAt;
|
|
1393
|
+
if (t - Date.parse(finishedAt) >= HELPER_RETENTION_MS) return [];
|
|
1394
|
+
return h2.finishedAt && h2.state === "exited" ? [h2] : [{ ...h2, state: "exited", finishedAt }];
|
|
1395
|
+
});
|
|
1396
|
+
if (helpers.length !== s.helpers.length || helpers.some((h2, i) => h2 !== s.helpers[i])) {
|
|
1397
|
+
s = { ...s, helpers };
|
|
1398
|
+
store.upsert(s);
|
|
1399
|
+
}
|
|
1387
1400
|
if (s.state === "exited") {
|
|
1388
1401
|
forget(s.id);
|
|
1389
1402
|
if (!s.archivedAt && s.exitedAt) {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
QUESTION_TOOLS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y5TCZTFL.js";
|
|
4
4
|
import {
|
|
5
5
|
CODEX_ENV_VAR,
|
|
6
6
|
CODEX_HOOK_VAR,
|
|
7
7
|
codexPlan
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZPANTZKC.js";
|
|
9
9
|
import {
|
|
10
10
|
log
|
|
11
11
|
} from "./chunk-L6IGH4LF.js";
|
|
12
12
|
import {
|
|
13
13
|
connect
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-6ZKNEJND.js";
|
|
15
|
+
import "./chunk-KJWMK65Y.js";
|
|
16
16
|
|
|
17
17
|
// src/cli/hook.ts
|
|
18
18
|
import { readFileSync, openSync, fstatSync, readSync, closeSync } from "fs";
|
package/dist/cli/index.js
CHANGED
|
@@ -16,7 +16,7 @@ async function hookMain(args) {
|
|
|
16
16
|
try {
|
|
17
17
|
const chunks = [];
|
|
18
18
|
for await (const c of process.stdin) chunks.push(c);
|
|
19
|
-
const { runHook } = await import("./hook-
|
|
19
|
+
const { runHook } = await import("./hook-BBVUY4RK.js");
|
|
20
20
|
await runHook(event, Buffer.concat(chunks).toString("utf8"), { tool });
|
|
21
21
|
} catch {
|
|
22
22
|
}
|
|
@@ -26,7 +26,7 @@ async function main(argv) {
|
|
|
26
26
|
const [cmd, ...rest] = argv;
|
|
27
27
|
switch (cmd) {
|
|
28
28
|
case "daemon": {
|
|
29
|
-
const { startDaemon } = await import("./daemon-
|
|
29
|
+
const { startDaemon } = await import("./daemon-MSDX3HWZ.js");
|
|
30
30
|
await startDaemon();
|
|
31
31
|
await new Promise(() => {
|
|
32
32
|
});
|
|
@@ -34,7 +34,7 @@ async function main(argv) {
|
|
|
34
34
|
}
|
|
35
35
|
case "--version":
|
|
36
36
|
case "version": {
|
|
37
|
-
const { LEDGE_VERSION } = await import("./version-
|
|
37
|
+
const { LEDGE_VERSION } = await import("./version-VOKMNNLW.js");
|
|
38
38
|
console.log(LEDGE_VERSION);
|
|
39
39
|
return 0;
|
|
40
40
|
}
|
|
@@ -50,23 +50,23 @@ async function main(argv) {
|
|
|
50
50
|
return r.ok ? 0 : 1;
|
|
51
51
|
}
|
|
52
52
|
case "status": {
|
|
53
|
-
const { printStatus } = await import("./status-
|
|
53
|
+
const { printStatus } = await import("./status-L2GROM4J.js");
|
|
54
54
|
console.log(await printStatus());
|
|
55
55
|
return 0;
|
|
56
56
|
}
|
|
57
57
|
case "bridge": {
|
|
58
|
-
const { bridge } = await import("./bridge-
|
|
58
|
+
const { bridge } = await import("./bridge-QKQW7UD6.js");
|
|
59
59
|
await bridge();
|
|
60
60
|
return 0;
|
|
61
61
|
}
|
|
62
62
|
case "claude":
|
|
63
63
|
case "codex":
|
|
64
64
|
case "cursor": {
|
|
65
|
-
const { launch } = await import("./launch-
|
|
65
|
+
const { launch } = await import("./launch-RWT4EWWI.js");
|
|
66
66
|
return launch(cmd, rest);
|
|
67
67
|
}
|
|
68
68
|
case "attach": {
|
|
69
|
-
const { attach } = await import("./attach-
|
|
69
|
+
const { attach } = await import("./attach-KTZOG7E5.js");
|
|
70
70
|
return attach(rest[0] ?? "");
|
|
71
71
|
}
|
|
72
72
|
default:
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
ensureDaemon,
|
|
6
6
|
launch,
|
|
7
7
|
parseLaunchArgs
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7AKUPFMS.js";
|
|
9
9
|
import {
|
|
10
10
|
agentEnv,
|
|
11
11
|
exitFile
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZPANTZKC.js";
|
|
13
13
|
import "./chunk-3TNPEAMR.js";
|
|
14
14
|
import "./chunk-L6IGH4LF.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-6ZKNEJND.js";
|
|
16
|
+
import "./chunk-KJWMK65Y.js";
|
|
17
17
|
export {
|
|
18
18
|
DaemonError,
|
|
19
19
|
agentEnv,
|
package/package.json
CHANGED