@paradow/ledge 0.17.0 → 0.19.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/README.md +7 -1
- package/assets/ledge.ico +0 -0
- package/dist/cli/{attach-EYIX7FZN.js → attach-3BKQSEWC.js} +12 -7
- package/dist/cli/{bridge-6UHCD76N.js → bridge-APNFBPNE.js} +2 -2
- package/dist/cli/chunk-3EIRKAX7.js +165 -0
- package/dist/cli/chunk-3HCID6NW.js +145 -0
- package/dist/cli/{chunk-JQZHXVIZ.js → chunk-43D6NMYH.js} +1 -1
- package/dist/cli/chunk-4RD7OJ2J.js +6 -0
- package/dist/cli/{chunk-ELLXOV4Q.js → chunk-7ZAA75HG.js} +1 -1
- package/dist/cli/{chunk-5ZCHFGCV.js → chunk-BVBX222F.js} +9 -7
- package/dist/cli/{chunk-OVJL2QTN.js → chunk-FQZ3IX6E.js} +2 -2
- package/dist/cli/{chunk-VVK4I6B5.js → chunk-GXFU4XAX.js} +1 -1
- package/dist/cli/chunk-HP3G2TYJ.js +1772 -0
- package/dist/cli/{chunk-NC5YAEJB.js → chunk-KKNE7BFZ.js} +55 -3
- package/dist/cli/{chunk-36KJUV62.js → chunk-LOOOHYZR.js} +38 -12
- package/dist/cli/{chunk-VE4LGNXX.js → chunk-TRTS24PF.js} +23 -5
- package/dist/cli/{chunk-Q7YNLP66.js → chunk-WCS24ICX.js} +5 -3
- package/dist/cli/{chunk-LAUNHDTX.js → chunk-WJ6YMZTT.js} +2 -2
- package/dist/cli/{daemon-QEJLAIBT.js → chunk-WP77O5LC.js} +6045 -7228
- package/dist/cli/chunk-Y5DJ5INP.js +60 -0
- package/dist/cli/{chunk-AQ25HFBP.js → chunk-ZUYOA55W.js} +5 -4
- package/dist/cli/daemon-66EUIZ3J.js +2240 -0
- package/dist/cli/handover-UXISKYPS.js +16 -0
- package/dist/cli/{hook-AE5HC6AS.js → hook-5UAARBWU.js} +86 -25
- package/dist/cli/index.js +30 -16
- package/dist/cli/launch-YQYCDZ7N.js +34 -0
- package/dist/cli/{send-2OZ3YZRV.js → send-NLVR6PL2.js} +5 -5
- package/dist/cli/{setup-2VM4GCDJ.js → setup-EEIXRAMU.js} +4 -4
- package/dist/cli/{status-3VJAO6UL.js → status-2OCYHOWZ.js} +3 -3
- package/dist/cli/{task-PMKNYP6M.js → task-AOOWHPMN.js} +5 -5
- package/dist/cli/team-TVNSVYWW.js +101 -0
- package/dist/cli/{tui-DWA2EDC2.js → tui-6JY7IS4D.js} +985 -125
- package/dist/cli/{uninstall-AKUWE33D.js → uninstall-UUN7LIIT.js} +4 -4
- package/dist/cli/{version-WOGCIZY3.js → version-XSEI3V2C.js} +1 -1
- package/dist/cli/who-52MENZTT.js +11 -0
- package/package.json +2 -2
- package/dist/cli/chunk-QD27W6W5.js +0 -1474
- package/dist/cli/chunk-V2H7UD2N.js +0 -6
- package/dist/cli/launch-B4G5OFBV.js +0 -27
- package/dist/cli/who-37TNDYVA.js +0 -11
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CODEX_HOOK_VAR
|
|
3
|
+
} from "./chunk-TRTS24PF.js";
|
|
4
|
+
import {
|
|
5
|
+
connect
|
|
6
|
+
} from "./chunk-GXFU4XAX.js";
|
|
7
|
+
import {
|
|
8
|
+
BRIEF_MAX
|
|
9
|
+
} from "./chunk-HP3G2TYJ.js";
|
|
10
|
+
|
|
11
|
+
// src/cli/handover.ts
|
|
12
|
+
import { randomUUID } from "crypto";
|
|
13
|
+
var HANDOVER_USAGE = `ledge handover "<bilan>" ton bilan de rel\xE8ve, quand Ledge te le demande (fait, en cours, suite, pi\xE8ges, fichiers cl\xE9s)
|
|
14
|
+
ledge handover show relire le bilan de la session dont tu as pris la rel\xE8ve`;
|
|
15
|
+
var HANDOVER_MS = 4e3;
|
|
16
|
+
function handoverArgs(args) {
|
|
17
|
+
if (args.length === 1 && args[0] === "show") return { op: "show" };
|
|
18
|
+
const text = args.join(" ").trim();
|
|
19
|
+
if (!args.length || !text || text.length > BRIEF_MAX) return void 0;
|
|
20
|
+
return { op: "brief", text };
|
|
21
|
+
}
|
|
22
|
+
async function handoverOnClient(client, args, by, ms) {
|
|
23
|
+
const op = handoverArgs(args);
|
|
24
|
+
if (!op) return { line: HANDOVER_USAGE, code: 1 };
|
|
25
|
+
try {
|
|
26
|
+
const rid = randomUUID();
|
|
27
|
+
client.send(op.op === "show" ? { type: "handover.show", rid, by } : { type: "handover.brief", rid, by, text: op.text });
|
|
28
|
+
const r = await client.next("handover.result", ms);
|
|
29
|
+
if (r.reason !== void 0) return { line: `refus\xE9 : ${r.reason}`, code: 1 };
|
|
30
|
+
return op.op === "show" ? { line: r.text ?? "", code: 0 } : { line: "bilan re\xE7u : Ledge lance la session qui prend ta rel\xE8ve et lui passe tes t\xE2ches. Arr\xEAte-toi l\xE0.", code: 0 };
|
|
31
|
+
} catch (e) {
|
|
32
|
+
return { line: `pas de r\xE9ponse de Ledge : ${e.message}`, code: 1 };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function runHandover(args, opts = {}) {
|
|
36
|
+
if (!handoverArgs(args)) return { line: HANDOVER_USAGE, code: args.length ? 1 : 0 };
|
|
37
|
+
const env = opts.env ?? process.env;
|
|
38
|
+
const by = env[CODEX_HOOK_VAR] || env.LEDGE_SESSION;
|
|
39
|
+
if (!by) return { line: "ledge handover ne marche que dans une session lanc\xE9e par Ledge", code: 1 };
|
|
40
|
+
const deadline = Date.now() + (opts.timeoutMs ?? HANDOVER_MS);
|
|
41
|
+
const left = () => Math.max(0, deadline - Date.now());
|
|
42
|
+
let client;
|
|
43
|
+
try {
|
|
44
|
+
client = await connect({ port: opts.port, timeoutMs: left() });
|
|
45
|
+
} catch {
|
|
46
|
+
return { line: "daemon not running (start a session with `ledge claude`, or run `ledge daemon`)", code: 1 };
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
return await handoverOnClient(client, args, by, left());
|
|
50
|
+
} finally {
|
|
51
|
+
await client.close();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
HANDOVER_USAGE,
|
|
57
|
+
handoverArgs,
|
|
58
|
+
handoverOnClient,
|
|
59
|
+
runHandover
|
|
60
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CODEX_HOOK_VAR
|
|
3
|
+
} from "./chunk-TRTS24PF.js";
|
|
1
4
|
import {
|
|
2
5
|
connect,
|
|
3
6
|
sendMessageAndAwaitAck
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
CODEX_HOOK_VAR
|
|
7
|
-
} from "./chunk-VE4LGNXX.js";
|
|
7
|
+
} from "./chunk-GXFU4XAX.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/send.ts
|
|
10
10
|
import { randomUUID } from "crypto";
|
|
@@ -131,6 +131,7 @@ function parseLedgeCommand(command) {
|
|
|
131
131
|
if (words[1] === "send") return { cmd: "send", args: words.slice(2) };
|
|
132
132
|
if (words[1] === "read") return { cmd: "read", args: words.slice(2) };
|
|
133
133
|
if (words[1] === "task") return { cmd: "task", args: words.slice(2) };
|
|
134
|
+
if (words[1] === "handover") return { cmd: "handover", args: words.slice(2) };
|
|
134
135
|
return void 0;
|
|
135
136
|
}
|
|
136
137
|
|