@paradow/ledge 0.16.0 → 0.17.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.
Files changed (32) hide show
  1. package/README.md +2 -0
  2. package/dist/cli/{attach-5H727FCW.js → attach-EYIX7FZN.js} +7 -7
  3. package/dist/cli/{bridge-LXMOQN6Q.js → bridge-6UHCD76N.js} +2 -2
  4. package/dist/cli/{chunk-MQICEVKR.js → chunk-36KJUV62.js} +6 -6
  5. package/dist/cli/chunk-5ZCHFGCV.js +115 -0
  6. package/dist/cli/{chunk-QJVODYJ5.js → chunk-AQ25HFBP.js} +40 -2
  7. package/dist/cli/{chunk-R5462SQM.js → chunk-ELLXOV4Q.js} +2 -1
  8. package/dist/cli/{chunk-BNKPXSUY.js → chunk-JQZHXVIZ.js} +1 -1
  9. package/dist/cli/{chunk-2H5FJH4Q.js → chunk-LAUNHDTX.js} +2 -2
  10. package/dist/cli/{chunk-DBSCO3HI.js → chunk-NC5YAEJB.js} +56 -7
  11. package/dist/cli/{chunk-S4ANPQGA.js → chunk-OVJL2QTN.js} +2 -2
  12. package/dist/cli/{chunk-TB47EHML.js → chunk-Q7YNLP66.js} +2 -2
  13. package/dist/cli/{chunk-Q5WWH7FG.js → chunk-QD27W6W5.js} +681 -630
  14. package/dist/cli/chunk-V2H7UD2N.js +6 -0
  15. package/dist/cli/{chunk-H36JD4E3.js → chunk-VE4LGNXX.js} +2 -2
  16. package/dist/cli/{chunk-DEXDXDO4.js → chunk-VVK4I6B5.js} +1 -1
  17. package/dist/cli/{daemon-HWAHX4RR.js → daemon-QEJLAIBT.js} +355 -40
  18. package/dist/cli/{hook-LY2YTK5U.js → hook-AE5HC6AS.js} +18 -15
  19. package/dist/cli/index.js +30 -11
  20. package/dist/cli/{launch-UQEFFPBN.js → launch-B4G5OFBV.js} +7 -7
  21. package/dist/cli/send-2OZ3YZRV.js +18 -0
  22. package/dist/cli/{setup-3N2EOJXS.js → setup-2VM4GCDJ.js} +4 -4
  23. package/dist/cli/{status-ZQSYXILE.js → status-3VJAO6UL.js} +3 -3
  24. package/dist/cli/task-PMKNYP6M.js +18 -0
  25. package/dist/cli/tui-DWA2EDC2.js +3561 -0
  26. package/dist/cli/{uninstall-W2OMKU3B.js → uninstall-AKUWE33D.js} +4 -4
  27. package/dist/cli/{version-5DA7G7HN.js → version-WOGCIZY3.js} +1 -1
  28. package/dist/cli/who-37TNDYVA.js +11 -0
  29. package/package.json +7 -1
  30. package/dist/cli/chunk-CBKKOJIG.js +0 -6
  31. package/dist/cli/send-EY63XQXI.js +0 -14
  32. package/dist/cli/who-VGIMGQNS.js +0 -11
@@ -1,33 +1,35 @@
1
1
  import {
2
2
  parseLedgeCommand,
3
+ readOnClient,
3
4
  sendOnClient
4
- } from "./chunk-QJVODYJ5.js";
5
+ } from "./chunk-AQ25HFBP.js";
6
+ import {
7
+ taskOnClient
8
+ } from "./chunk-5ZCHFGCV.js";
5
9
  import {
6
10
  formatWho
7
- } from "./chunk-TB47EHML.js";
11
+ } from "./chunk-Q7YNLP66.js";
8
12
  import {
9
13
  connect,
10
14
  sendMessageAndAwaitAck
11
- } from "./chunk-DEXDXDO4.js";
15
+ } from "./chunk-VVK4I6B5.js";
12
16
  import {
13
17
  QUESTION_TOOLS,
14
18
  gitInfo,
15
19
  messageNote,
16
20
  readPeers,
17
21
  resolveTarget
18
- } from "./chunk-DBSCO3HI.js";
22
+ } from "./chunk-NC5YAEJB.js";
19
23
  import {
20
24
  CODEX_ENV_VAR,
21
25
  CODEX_HOOK_VAR,
22
26
  codexPlan
23
- } from "./chunk-H36JD4E3.js";
24
- import {
25
- MESSAGE_MAX
26
- } from "./chunk-Q5WWH7FG.js";
27
+ } from "./chunk-VE4LGNXX.js";
28
+ import "./chunk-QD27W6W5.js";
27
29
  import {
28
30
  log
29
- } from "./chunk-BNKPXSUY.js";
30
- import "./chunk-R5462SQM.js";
31
+ } from "./chunk-JQZHXVIZ.js";
32
+ import "./chunk-ELLXOV4Q.js";
31
33
 
32
34
  // src/cli/hook.ts
33
35
  import { readFileSync, openSync, fstatSync, readSync, closeSync } from "fs";
@@ -320,7 +322,9 @@ function identityContext(s) {
320
322
  return [
321
323
  `Tu es ${s.name}, ${where} : une session lanc\xE9e par Ledge (${s.tool}). Les autres sessions Ledge te connaissent sous le nom ${s.name}.`,
322
324
  "Pour voir les autres sessions (nom, outil, \xE9tat, projet, branche, sujet), lance `ledge who`.",
323
- s.tool === "claude" ? "Pour \xE9crire \xE0 une autre session Ledge, Claude ou Codex, utilise son nom Ledge (donn\xE9 par `ledge who`) comme adresse SendMessage : Ledge le transmet. `ListAgents` montre les noms internes de Claude, pas les noms Ledge." : "Pour \xE9crire \xE0 une autre session Ledge, lance `ledge send <nom> \"<message>\"` (seul, sans && ni |). Ledge ex\xE9cute lui-m\xEAme `ledge send` et `ledge who` : leur r\xE9sultat t'arrive comme \xAB Command blocked by PreToolUse hook: \u2026 \xBB, c'est la r\xE9ponse, pas une erreur."
325
+ s.tool === "claude" ? "Pour \xE9crire \xE0 une autre session Ledge, Claude ou Codex, utilise son nom Ledge (donn\xE9 par `ledge who`) comme adresse SendMessage : Ledge le transmet. `ListAgents` montre les noms internes de Claude, pas les noms Ledge." : "Pour \xE9crire \xE0 une autre session Ledge, lance `ledge send <nom> \"<message>\"` (seul, sans && ni |). Ledge ex\xE9cute lui-m\xEAme `ledge send`, `ledge read`, `ledge task` et `ledge who` : leur r\xE9sultat t'arrive comme \xAB Command blocked by PreToolUse hook: \u2026 \xBB, c'est la r\xE9ponse, pas une erreur.",
326
+ "Un long message d'une autre session t'arrive en aper\xE7u avec son id : lance `ledge read <id>` pour le lire en entier. Une `<ledge-notice>` te dit qu'un de tes messages n'a pas pu \xEAtre remis.",
327
+ 'Un message sert \xE0 pr\xE9venir ; pour confier un travail qui ne doit pas se perdre, lance plut\xF4t `ledge task give <nom> "<titre>" "<d\xE9tail>"` (`ledge task` pour le reste). Une `<ledge-task>` t\'en confie une, ou te dit comment une des tiennes a fini : quand on t\'en confie une, prends-la (`ledge task take <id>`) et termine-la toujours (`ledge task done <id> "<r\xE9sultat>"`, ou `refuse`).'
324
328
  ].join("\n");
325
329
  }
326
330
  async function identity(agent, cwd, known, deadline) {
@@ -357,7 +361,6 @@ async function relayMessage(client, from, toolUseId, input, deadline) {
357
361
  return JSON.stringify({ hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "allow", updatedInput } });
358
362
  }
359
363
  const tool = r.target.tool;
360
- if (tool !== "codex" && input.message.length > MESSAGE_MAX) return void 0;
361
364
  const summary = str(input.summary);
362
365
  const ack = await sendMessageAndAwaitAck(client, { type: "session.message", rid: toolUseId, from, to, text: input.message, ...summary ? { summary } : {}, intercept: true }, left());
363
366
  const target = `${to} (${tool})`;
@@ -368,9 +371,9 @@ async function runLedgeCommand(client, cmd, from, deadline) {
368
371
  const left = () => Math.max(0, deadline - Date.now());
369
372
  let line;
370
373
  if (cmd.cmd === "who") line = formatWho((await client.next("snapshot", left())).sessions, from);
371
- else {
372
- line = (await sendOnClient(client, cmd.args, from, left())).line;
373
- }
374
+ else if (cmd.cmd === "read") line = (await readOnClient(client, cmd.args, from, left())).line;
375
+ else if (cmd.cmd === "task") line = (await taskOnClient(client, cmd.args, from, left())).line;
376
+ else line = (await sendOnClient(client, cmd.args, from, left())).line;
374
377
  return deny(line);
375
378
  }
376
379
  async function runHook(eventName, stdin, opts = {}) {
package/dist/cli/index.js CHANGED
@@ -10,6 +10,9 @@ ledge uninstall [--purge] remove hooks, servi
10
10
  ledge status list sessions
11
11
  ledge who list the live sessions (name, tool, state, project, branch, topic)
12
12
  ledge send <nom> "<message>" [--summary <texte>] write to another Ledge session
13
+ ledge read <id> print a long message whole (the id is in its pointer)
14
+ ledge task <give|list|show|take|done|refuse|pass> \u2026 give another session work, take it, close it (ledge task: details)
15
+ ledge tui [--notify bell|osc9|off] follow and answer the sessions in this terminal
13
16
  ledge bridge exchange Ledge messages over SSH stdio
14
17
  ledge --version print the installed version`;
15
18
  async function hookMain(args) {
@@ -18,7 +21,7 @@ async function hookMain(args) {
18
21
  try {
19
22
  const chunks = [];
20
23
  for await (const c of process.stdin) chunks.push(c);
21
- const { runHook } = await import("./hook-LY2YTK5U.js");
24
+ const { runHook } = await import("./hook-AE5HC6AS.js");
22
25
  const out = await runHook(event, Buffer.concat(chunks).toString("utf8"), { tool });
23
26
  if (out) process.stdout.write(`${out}
24
27
  `);
@@ -30,7 +33,7 @@ async function main(argv) {
30
33
  const [cmd, ...rest] = argv;
31
34
  switch (cmd) {
32
35
  case "daemon": {
33
- const { startDaemon } = await import("./daemon-HWAHX4RR.js");
36
+ const { startDaemon } = await import("./daemon-QEJLAIBT.js");
34
37
  await startDaemon();
35
38
  await new Promise(() => {
36
39
  });
@@ -38,17 +41,17 @@ async function main(argv) {
38
41
  }
39
42
  case "--version":
40
43
  case "version": {
41
- const { LEDGE_VERSION } = await import("./version-5DA7G7HN.js");
44
+ const { LEDGE_VERSION } = await import("./version-WOGCIZY3.js");
42
45
  console.log(LEDGE_VERSION);
43
46
  return 0;
44
47
  }
45
48
  case "setup": {
46
- const { runSetup } = await import("./setup-3N2EOJXS.js");
49
+ const { runSetup } = await import("./setup-2VM4GCDJ.js");
47
50
  for (const l of await runSetup()) console.log(l);
48
51
  return 0;
49
52
  }
50
53
  case "uninstall": {
51
- const { runUninstall, uninstallArgs } = await import("./uninstall-W2OMKU3B.js");
54
+ const { runUninstall, uninstallArgs } = await import("./uninstall-AKUWE33D.js");
52
55
  const args = uninstallArgs(rest);
53
56
  if (!args) {
54
57
  console.log(USAGE);
@@ -59,34 +62,50 @@ async function main(argv) {
59
62
  return r.ok ? 0 : 1;
60
63
  }
61
64
  case "status": {
62
- const { printStatus } = await import("./status-ZQSYXILE.js");
65
+ const { printStatus } = await import("./status-3VJAO6UL.js");
63
66
  console.log(await printStatus());
64
67
  return 0;
65
68
  }
66
69
  case "who": {
67
- const { printWho } = await import("./who-VGIMGQNS.js");
70
+ const { printWho } = await import("./who-37TNDYVA.js");
68
71
  console.log(await printWho());
69
72
  return 0;
70
73
  }
71
74
  case "send": {
72
- const { sendMessage } = await import("./send-EY63XQXI.js");
75
+ const { sendMessage } = await import("./send-2OZ3YZRV.js");
73
76
  const r = await sendMessage(rest);
74
77
  console.log(r.line);
75
78
  return r.code;
76
79
  }
80
+ case "read": {
81
+ const { readMessage } = await import("./send-2OZ3YZRV.js");
82
+ const r = await readMessage(rest);
83
+ console.log(r.line);
84
+ return r.code;
85
+ }
86
+ case "task": {
87
+ const { runTask } = await import("./task-PMKNYP6M.js");
88
+ const r = await runTask(rest);
89
+ console.log(r.line);
90
+ return r.code;
91
+ }
92
+ case "tui": {
93
+ const { runTui } = await import("./tui-DWA2EDC2.js");
94
+ return runTui(rest);
95
+ }
77
96
  case "bridge": {
78
- const { bridge } = await import("./bridge-LXMOQN6Q.js");
97
+ const { bridge } = await import("./bridge-6UHCD76N.js");
79
98
  await bridge();
80
99
  return 0;
81
100
  }
82
101
  case "claude":
83
102
  case "codex":
84
103
  case "cursor": {
85
- const { launch } = await import("./launch-UQEFFPBN.js");
104
+ const { launch } = await import("./launch-B4G5OFBV.js");
86
105
  return launch(cmd, rest);
87
106
  }
88
107
  case "attach": {
89
- const { attach } = await import("./attach-5H727FCW.js");
108
+ const { attach } = await import("./attach-EYIX7FZN.js");
90
109
  return attach(rest.find((a) => !a.startsWith("--")) ?? "", { readOnly: rest.includes("--read-only") });
91
110
  }
92
111
  default:
@@ -5,16 +5,16 @@ import {
5
5
  ensureDaemon,
6
6
  launch,
7
7
  parseLaunchArgs
8
- } from "./chunk-MQICEVKR.js";
9
- import "./chunk-DEXDXDO4.js";
8
+ } from "./chunk-36KJUV62.js";
9
+ import "./chunk-VVK4I6B5.js";
10
10
  import {
11
11
  agentEnv,
12
12
  exitFile
13
- } from "./chunk-H36JD4E3.js";
14
- import "./chunk-Q5WWH7FG.js";
15
- import "./chunk-2H5FJH4Q.js";
16
- import "./chunk-BNKPXSUY.js";
17
- import "./chunk-R5462SQM.js";
13
+ } from "./chunk-VE4LGNXX.js";
14
+ import "./chunk-QD27W6W5.js";
15
+ import "./chunk-LAUNHDTX.js";
16
+ import "./chunk-JQZHXVIZ.js";
17
+ import "./chunk-ELLXOV4Q.js";
18
18
  export {
19
19
  DaemonError,
20
20
  agentEnv,
@@ -0,0 +1,18 @@
1
+ import {
2
+ parseLedgeCommand,
3
+ readMessage,
4
+ readOnClient,
5
+ sendMessage,
6
+ sendOnClient
7
+ } from "./chunk-AQ25HFBP.js";
8
+ import "./chunk-VVK4I6B5.js";
9
+ import "./chunk-VE4LGNXX.js";
10
+ import "./chunk-QD27W6W5.js";
11
+ import "./chunk-ELLXOV4Q.js";
12
+ export {
13
+ parseLedgeCommand,
14
+ readMessage,
15
+ readOnClient,
16
+ sendMessage,
17
+ sendOnClient
18
+ };
@@ -14,10 +14,10 @@ import {
14
14
  stopDetachedDaemon,
15
15
  systemdUnit,
16
16
  writeBin
17
- } from "./chunk-S4ANPQGA.js";
18
- import "./chunk-2H5FJH4Q.js";
19
- import "./chunk-BNKPXSUY.js";
20
- import "./chunk-R5462SQM.js";
17
+ } from "./chunk-OVJL2QTN.js";
18
+ import "./chunk-LAUNHDTX.js";
19
+ import "./chunk-JQZHXVIZ.js";
20
+ import "./chunk-ELLXOV4Q.js";
21
21
  export {
22
22
  BIN_MARK,
23
23
  CLAUDE_EVENTS,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  connect
3
- } from "./chunk-DEXDXDO4.js";
4
- import "./chunk-Q5WWH7FG.js";
5
- import "./chunk-R5462SQM.js";
3
+ } from "./chunk-VVK4I6B5.js";
4
+ import "./chunk-QD27W6W5.js";
5
+ import "./chunk-ELLXOV4Q.js";
6
6
 
7
7
  // src/cli/status.ts
8
8
  async function printStatus(opts = {}) {
@@ -0,0 +1,18 @@
1
+ import {
2
+ TASK_USAGE,
3
+ formatTask,
4
+ runTask,
5
+ taskArgs,
6
+ taskOnClient
7
+ } from "./chunk-5ZCHFGCV.js";
8
+ import "./chunk-VVK4I6B5.js";
9
+ import "./chunk-VE4LGNXX.js";
10
+ import "./chunk-QD27W6W5.js";
11
+ import "./chunk-ELLXOV4Q.js";
12
+ export {
13
+ TASK_USAGE,
14
+ formatTask,
15
+ runTask,
16
+ taskArgs,
17
+ taskOnClient
18
+ };