@paradow/ledge 0.5.4 → 0.7.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/dist/cli/{attach-QE22G2GY.js → attach-P6CWCJ2R.js} +6 -6
- package/dist/cli/{bridge-7RXMJSOP.js → bridge-ZYR3IBVM.js} +5 -2
- package/dist/cli/{chunk-XZMLFV6H.js → chunk-3TNPEAMR.js} +6 -1
- package/dist/cli/{chunk-U4RU6V35.js → chunk-3TXM4DM7.js} +4 -4
- package/dist/cli/chunk-4BBKLTDB.js +722 -0
- package/dist/cli/{chunk-NKBJ3LD4.js → chunk-GZFSUQZJ.js} +22 -3
- package/dist/cli/{chunk-ISPFJBJM.js → chunk-HR6VWBLT.js} +5 -5
- package/dist/cli/chunk-KD7LKXIF.js +6 -0
- package/dist/cli/{chunk-P2SHPHAN.js → chunk-L6IGH4LF.js} +1 -1
- package/dist/cli/{chunk-IDGN7JGC.js → chunk-MK7NEXY7.js} +1 -1
- package/dist/cli/{chunk-HGNMPXXR.js → chunk-Q5CLZPYJ.js} +2 -2
- package/dist/cli/{daemon-P5XWP2UC.js → daemon-GREPJUOS.js} +984 -164
- package/dist/cli/{hook-ARQEXMYY.js → hook-ZVXQ3MGS.js} +11 -9
- package/dist/cli/index.js +9 -9
- package/dist/cli/{launch-GRWEWGSC.js → launch-PIFVOOJV.js} +6 -6
- package/dist/cli/{setup-EXA6OG5W.js → setup-RMPIUCPH.js} +3 -3
- package/dist/cli/{status-6OOVUG3V.js → status-RVD4U2XH.js} +2 -2
- package/dist/cli/{uninstall-34TVL5BP.js → uninstall-GI4WT3UQ.js} +3 -3
- package/dist/cli/{version-G5DZ7PFI.js → version-X3LYAGKA.js} +1 -1
- package/package.json +1 -1
- package/dist/cli/chunk-BRJSMZ7B.js +0 -6
- package/dist/cli/chunk-E6ZQOGY4.js +0 -448
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cleanTopic,
|
|
3
3
|
sessionTitle
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4BBKLTDB.js";
|
|
5
|
+
|
|
6
|
+
// src/daemon/crossSession.ts
|
|
7
|
+
var FIRST_LINE = /^Another Claude session sent a message:\s*\n/;
|
|
8
|
+
var BLOCK = /<cross-session-message\b([^>]*)>([\s\S]*?)(?:<\/cross-session-message>|(?=\n[ \t]*<cross-session-message\b)|$)/g;
|
|
9
|
+
var ATTR = /([\w-]+)="([^"]*)"/g;
|
|
10
|
+
function crossSession(text) {
|
|
11
|
+
const body = text.trimStart().replace(FIRST_LINE, "");
|
|
12
|
+
if (!body.startsWith("<cross-session-message")) return void 0;
|
|
13
|
+
const out = [];
|
|
14
|
+
for (const m of body.matchAll(BLOCK)) {
|
|
15
|
+
const attrs = new Map([...m[1].matchAll(ATTR)].map((a) => [a[1], a[2]]));
|
|
16
|
+
const from = attrs.get("from");
|
|
17
|
+
const name = attrs.get("from-name");
|
|
18
|
+
if (from) out.push({ from, ...name ? { name } : {}, text: m[2].trim() });
|
|
19
|
+
}
|
|
20
|
+
return out.length ? out : void 0;
|
|
21
|
+
}
|
|
5
22
|
|
|
6
23
|
// src/daemon/state.ts
|
|
7
24
|
var HOOK_PRIORITY_MS = 2e3;
|
|
@@ -119,7 +136,7 @@ function withoutReply(s) {
|
|
|
119
136
|
return rest;
|
|
120
137
|
}
|
|
121
138
|
function samePending(a, b) {
|
|
122
|
-
return a.kind === b.kind && a.text === b.text && a.tool === b.tool && a.source === b.source && JSON.stringify(a.options) === JSON.stringify(b.options) && JSON.stringify(a.optionDetails) === JSON.stringify(b.optionDetails);
|
|
139
|
+
return a.kind === b.kind && a.text === b.text && a.body === b.body && a.tool === b.tool && a.source === b.source && JSON.stringify(a.options) === JSON.stringify(b.options) && JSON.stringify(a.optionDetails) === JSON.stringify(b.optionDetails);
|
|
123
140
|
}
|
|
124
141
|
function endCursorHelpers(s, ev) {
|
|
125
142
|
if (s.tool !== "cursor" || ev.source !== "hook" || ev.helperId || !s.helpers.some((h) => h.state === "working")) return s;
|
|
@@ -134,6 +151,7 @@ function withTopic(s, text, source) {
|
|
|
134
151
|
return { ...next, title: sessionTitle(next) };
|
|
135
152
|
}
|
|
136
153
|
function reduce(s, ev) {
|
|
154
|
+
if (ev.agentSessionId && !ev.helperId && ev.agentSessionId !== s.agentSessionId) s = { ...s, agentSessionId: ev.agentSessionId };
|
|
137
155
|
if (s.state === "exited") return s;
|
|
138
156
|
s = endCursorHelpers(s, ev);
|
|
139
157
|
const at = ev.at;
|
|
@@ -200,7 +218,7 @@ function reduce(s, ev) {
|
|
|
200
218
|
case "PreToolUse":
|
|
201
219
|
case "PermissionRequest":
|
|
202
220
|
case "Notification": {
|
|
203
|
-
if (ev.name === "UserPromptSubmit" && ev.text && !s.topic) s = withTopic(s, ev.text, "prompt");
|
|
221
|
+
if (ev.name === "UserPromptSubmit" && ev.text && !s.topic && !crossSession(ev.text)) s = withTopic(s, ev.text, "prompt");
|
|
204
222
|
const incoming = pendingFor(ev);
|
|
205
223
|
if (incoming) {
|
|
206
224
|
if (ev.name === "Notification" && s.pending?.source === "hook") return { ...s, lastHookAt: at, lastActivityAt: at };
|
|
@@ -218,6 +236,7 @@ function reduce(s, ev) {
|
|
|
218
236
|
}
|
|
219
237
|
|
|
220
238
|
export {
|
|
239
|
+
crossSession,
|
|
221
240
|
QUESTION_TOOLS,
|
|
222
241
|
reduce
|
|
223
242
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exitFile,
|
|
3
3
|
spawnSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3TXM4DM7.js";
|
|
5
5
|
import {
|
|
6
6
|
realTmux
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3TNPEAMR.js";
|
|
8
8
|
import {
|
|
9
9
|
ensureLedgeDir,
|
|
10
10
|
log
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-L6IGH4LF.js";
|
|
12
12
|
import {
|
|
13
13
|
connect
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MK7NEXY7.js";
|
|
15
15
|
import {
|
|
16
16
|
PROTOCOL_PORT
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4BBKLTDB.js";
|
|
18
18
|
|
|
19
19
|
// src/cli/launch.ts
|
|
20
20
|
import { spawn } from "child_process";
|
|
@@ -17,7 +17,7 @@ function ledgeDir() {
|
|
|
17
17
|
}
|
|
18
18
|
function paths() {
|
|
19
19
|
const dir = ledgeDir();
|
|
20
|
-
return { dir, tmuxConf: join(dir, "tmux.conf"), journal: join(dir, "sessions.json"), log: join(dir, "daemon.log"), pid: join(dir, "daemon.pid"), history: join(dir, "history") };
|
|
20
|
+
return { dir, tmuxConf: join(dir, "tmux.conf"), journal: join(dir, "sessions.json"), log: join(dir, "daemon.log"), pid: join(dir, "daemon.pid"), history: join(dir, "history"), machines: join(dir, "machines.json"), projects: join(dir, "projects.json"), island: join(dir, "island.json") };
|
|
21
21
|
}
|
|
22
22
|
async function ensureLedgeDir() {
|
|
23
23
|
const p = paths();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
run
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3TNPEAMR.js";
|
|
4
4
|
import {
|
|
5
5
|
ensureLedgeDir,
|
|
6
6
|
paths
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-L6IGH4LF.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/setup.ts
|
|
10
10
|
import { readFile as readFile2, writeFile, mkdir, rename, realpath, rm, stat, lstat, readlink, symlink, unlink } from "fs/promises";
|