@paradow/ledge 0.31.0 → 0.33.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/dist/cli/{action-CFYJM2A2.js → action-QW2ZQQBN.js} +4 -4
  2. package/dist/cli/{attach-23PTEIAA.js → attach-ULTYWCJ7.js} +9 -9
  3. package/dist/cli/{bridge-UJKWEKA5.js → bridge-CSLF7EW6.js} +1 -1
  4. package/dist/cli/{chunk-TCJG3EHB.js → chunk-3DB3VOMM.js} +2 -2
  5. package/dist/cli/{chunk-YI4V7YVW.js → chunk-4HXJQEUN.js} +3 -3
  6. package/dist/cli/{chunk-MIPE2FWL.js → chunk-4VNKZOC2.js} +1 -1
  7. package/dist/cli/{chunk-6YBIZZQG.js → chunk-ASYAWVFW.js} +1 -1
  8. package/dist/cli/{chunk-WF27BASF.js → chunk-CCSUP5ZI.js} +2 -2
  9. package/dist/cli/{chunk-NXNIRIGI.js → chunk-CPERVAPQ.js} +5 -5
  10. package/dist/cli/{chunk-HNC5Q5PV.js → chunk-CSLVBADC.js} +3 -3
  11. package/dist/cli/chunk-E3LXONBI.js +6 -0
  12. package/dist/cli/{chunk-HEYHVOD6.js → chunk-GXL3X7M7.js} +2 -2
  13. package/dist/cli/{chunk-TLFKLMBN.js → chunk-JEGPTNWV.js} +1 -1
  14. package/dist/cli/{chunk-HUY4CFMX.js → chunk-NWIICISV.js} +2 -2
  15. package/dist/cli/{chunk-GMG3ROBU.js → chunk-PZ3F4QH3.js} +38 -12
  16. package/dist/cli/{chunk-MYIBYAZC.js → chunk-WXE2NOE5.js} +12 -3
  17. package/dist/cli/{chunk-QXH2L4UH.js → chunk-XOZD4BP5.js} +3 -3
  18. package/dist/cli/{daemon-WW2P7RDV.js → daemon-5GT545BB.js} +7 -7
  19. package/dist/cli/{decide-HLRD37PW.js → decide-PFHHOCFZ.js} +4 -4
  20. package/dist/cli/{handover-56M4LIOP.js → handover-EMO6JT7O.js} +4 -4
  21. package/dist/cli/{hook-UJVKYSQ5.js → hook-W2BU74H5.js} +9 -9
  22. package/dist/cli/index.js +16 -16
  23. package/dist/cli/{launch-GIPQDPAC.js → launch-LP7YJR5N.js} +9 -9
  24. package/dist/cli/{send-HWZHE65N.js → send-NEI4X33R.js} +4 -4
  25. package/dist/cli/{status-V6ITP7VT.js → status-U2HGGKHF.js} +2 -2
  26. package/dist/cli/{task-N53TM34B.js → task-PDDCE23D.js} +4 -4
  27. package/dist/cli/{team-CZFZ24P6.js → team-S3ASP22H.js} +6 -6
  28. package/dist/cli/{tui-K32C34XI.js → tui-UPMRMCPC.js} +20 -18
  29. package/dist/cli/{version-QIFJVKAQ.js → version-LUMK3Z3T.js} +1 -1
  30. package/dist/cli/{who-NIOLHHB3.js → who-NM3GPAPJ.js} +3 -3
  31. package/package.json +1 -1
  32. package/dist/cli/chunk-WY5WSK2D.js +0 -6
@@ -8,10 +8,10 @@ import {
8
8
  resultLine,
9
9
  runClose,
10
10
  runOnClient
11
- } from "./chunk-QXH2L4UH.js";
12
- import "./chunk-TLFKLMBN.js";
13
- import "./chunk-6YBIZZQG.js";
14
- import "./chunk-MYIBYAZC.js";
11
+ } from "./chunk-XOZD4BP5.js";
12
+ import "./chunk-JEGPTNWV.js";
13
+ import "./chunk-ASYAWVFW.js";
14
+ import "./chunk-WXE2NOE5.js";
15
15
  import "./chunk-HOOHS3MX.js";
16
16
  import "./chunk-U67V476Y.js";
17
17
  export {
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  attachEnv
3
- } from "./chunk-NXNIRIGI.js";
4
- import "./chunk-GMG3ROBU.js";
3
+ } from "./chunk-CPERVAPQ.js";
4
+ import "./chunk-PZ3F4QH3.js";
5
5
  import "./chunk-OLLQBK6N.js";
6
- import "./chunk-HUY4CFMX.js";
7
- import "./chunk-TCJG3EHB.js";
8
- import "./chunk-MIPE2FWL.js";
9
- import "./chunk-TLFKLMBN.js";
6
+ import "./chunk-NWIICISV.js";
7
+ import "./chunk-3DB3VOMM.js";
8
+ import "./chunk-4VNKZOC2.js";
9
+ import "./chunk-JEGPTNWV.js";
10
10
  import {
11
11
  connect
12
- } from "./chunk-6YBIZZQG.js";
12
+ } from "./chunk-ASYAWVFW.js";
13
13
  import {
14
14
  PROTOCOL_PORT,
15
15
  backendOf
16
- } from "./chunk-MYIBYAZC.js";
17
- import "./chunk-WY5WSK2D.js";
16
+ } from "./chunk-WXE2NOE5.js";
17
+ import "./chunk-E3LXONBI.js";
18
18
  import {
19
19
  realTmux
20
20
  } from "./chunk-NLL2EQJ2.js";
@@ -7,7 +7,7 @@ import {
7
7
  parseClientMessage,
8
8
  parseServerMessage,
9
9
  readDaemonToken
10
- } from "./chunk-MYIBYAZC.js";
10
+ } from "./chunk-WXE2NOE5.js";
11
11
  import "./chunk-HOOHS3MX.js";
12
12
  import "./chunk-U67V476Y.js";
13
13
 
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ledgeTitleRest
3
- } from "./chunk-TLFKLMBN.js";
3
+ } from "./chunk-JEGPTNWV.js";
4
4
  import {
5
5
  cleanTopic,
6
6
  isArchived,
7
7
  sessionTitle
8
- } from "./chunk-MYIBYAZC.js";
8
+ } from "./chunk-WXE2NOE5.js";
9
9
 
10
10
  // src/daemon/seat.ts
11
11
  function teammates(team, sessions) {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  CODEX_HOOK_VAR
3
- } from "./chunk-TLFKLMBN.js";
3
+ } from "./chunk-JEGPTNWV.js";
4
4
  import {
5
5
  connect
6
- } from "./chunk-6YBIZZQG.js";
6
+ } from "./chunk-ASYAWVFW.js";
7
7
  import {
8
8
  LEDGE_GIVER,
9
9
  TASK_TEXT_MAX,
10
10
  TASK_TITLE_MAX
11
- } from "./chunk-MYIBYAZC.js";
11
+ } from "./chunk-WXE2NOE5.js";
12
12
 
13
13
  // src/cli/task.ts
14
14
  import { randomUUID } from "crypto";
@@ -2,7 +2,7 @@ import {
2
2
  ROLE_LABEL_MAX,
3
3
  ROLE_PROMPT_MAX,
4
4
  RoleSchema
5
- } from "./chunk-MYIBYAZC.js";
5
+ } from "./chunk-WXE2NOE5.js";
6
6
  import {
7
7
  log
8
8
  } from "./chunk-6IYPRUQG.js";
@@ -4,7 +4,7 @@ import {
4
4
  SUMMARY_MAX,
5
5
  parseServerMessage,
6
6
  readDaemonToken
7
- } from "./chunk-MYIBYAZC.js";
7
+ } from "./chunk-WXE2NOE5.js";
8
8
 
9
9
  // src/client.ts
10
10
  import WebSocket from "ws";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  connect
3
- } from "./chunk-6YBIZZQG.js";
3
+ } from "./chunk-ASYAWVFW.js";
4
4
  import {
5
5
  isArchived
6
- } from "./chunk-MYIBYAZC.js";
6
+ } from "./chunk-WXE2NOE5.js";
7
7
 
8
8
  // src/cli/who.ts
9
9
  import { basename } from "path";
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  EFFORT_ARGS,
3
3
  MODEL_ARGS
4
- } from "./chunk-GMG3ROBU.js";
4
+ } from "./chunk-PZ3F4QH3.js";
5
5
  import {
6
6
  findRole
7
- } from "./chunk-MIPE2FWL.js";
7
+ } from "./chunk-4VNKZOC2.js";
8
8
  import {
9
9
  exitFile,
10
10
  spawnSession
11
- } from "./chunk-TLFKLMBN.js";
11
+ } from "./chunk-JEGPTNWV.js";
12
12
  import {
13
13
  DaemonRefusedError,
14
14
  connect
15
- } from "./chunk-6YBIZZQG.js";
15
+ } from "./chunk-ASYAWVFW.js";
16
16
  import {
17
17
  PROTOCOL_PORT,
18
18
  autonomyArgs
19
- } from "./chunk-MYIBYAZC.js";
19
+ } from "./chunk-WXE2NOE5.js";
20
20
  import {
21
21
  realTmux
22
22
  } from "./chunk-NLL2EQJ2.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  CODEX_HOOK_VAR
3
- } from "./chunk-TLFKLMBN.js";
3
+ } from "./chunk-JEGPTNWV.js";
4
4
  import {
5
5
  connect
6
- } from "./chunk-6YBIZZQG.js";
6
+ } from "./chunk-ASYAWVFW.js";
7
7
  import {
8
8
  BRIEF_MAX
9
- } from "./chunk-MYIBYAZC.js";
9
+ } from "./chunk-WXE2NOE5.js";
10
10
 
11
11
  // src/cli/handover.ts
12
12
  import { randomUUID } from "crypto";
@@ -0,0 +1,6 @@
1
+ // src/version.ts
2
+ var LEDGE_VERSION = true ? "0.33.0" : "0.0.0-dev";
3
+
4
+ export {
5
+ LEDGE_VERSION
6
+ };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  CODEX_HOOK_VAR
3
- } from "./chunk-TLFKLMBN.js";
3
+ } from "./chunk-JEGPTNWV.js";
4
4
  import {
5
5
  connect,
6
6
  sendMessageAndAwaitAck
7
- } from "./chunk-6YBIZZQG.js";
7
+ } from "./chunk-ASYAWVFW.js";
8
8
 
9
9
  // src/cli/send.ts
10
10
  import { randomUUID } from "crypto";
@@ -3,7 +3,7 @@ import {
3
3
  SESSION_KEY_VAR,
4
4
  pickName,
5
5
  sessionKey
6
- } from "./chunk-MYIBYAZC.js";
6
+ } from "./chunk-WXE2NOE5.js";
7
7
  import {
8
8
  paths
9
9
  } from "./chunk-HOOHS3MX.js";
@@ -8,12 +8,12 @@ import {
8
8
  readSmall,
9
9
  repoRoot,
10
10
  scalarValue
11
- } from "./chunk-MIPE2FWL.js";
11
+ } from "./chunk-4VNKZOC2.js";
12
12
  import {
13
13
  SeatsSchema,
14
14
  TeamNameSchema,
15
15
  TemplateIdSchema
16
- } from "./chunk-MYIBYAZC.js";
16
+ } from "./chunk-WXE2NOE5.js";
17
17
  import {
18
18
  log
19
19
  } from "./chunk-6IYPRUQG.js";
@@ -15,7 +15,7 @@ import {
15
15
  templateId,
16
16
  templateText,
17
17
  writeDefinition
18
- } from "./chunk-HUY4CFMX.js";
18
+ } from "./chunk-NWIICISV.js";
19
19
  import {
20
20
  NO_ALWAYS,
21
21
  NO_NOTE,
@@ -47,12 +47,12 @@ import {
47
47
  shownCommand,
48
48
  teammates,
49
49
  withImages
50
- } from "./chunk-TCJG3EHB.js";
50
+ } from "./chunk-3DB3VOMM.js";
51
51
  import {
52
52
  findRole,
53
53
  frontMatter,
54
54
  loadRole
55
- } from "./chunk-MIPE2FWL.js";
55
+ } from "./chunk-4VNKZOC2.js";
56
56
  import {
57
57
  PARENT_AGENT_VARS,
58
58
  agentEnv,
@@ -62,7 +62,7 @@ import {
62
62
  labelTranscript,
63
63
  resumeLabel,
64
64
  spawnSession
65
- } from "./chunk-TLFKLMBN.js";
65
+ } from "./chunk-JEGPTNWV.js";
66
66
  import {
67
67
  ACTIONS,
68
68
  ATTACHMENT_ID,
@@ -161,10 +161,10 @@ import {
161
161
  teamsPurpose,
162
162
  tokenEquals,
163
163
  transmissions
164
- } from "./chunk-MYIBYAZC.js";
164
+ } from "./chunk-WXE2NOE5.js";
165
165
  import {
166
166
  LEDGE_VERSION
167
- } from "./chunk-WY5WSK2D.js";
167
+ } from "./chunk-E3LXONBI.js";
168
168
  import {
169
169
  log
170
170
  } from "./chunk-6IYPRUQG.js";
@@ -1637,6 +1637,11 @@ function startPoller(opts) {
1637
1637
  // src/daemon/relay.ts
1638
1638
  var free = (s) => !!s && (s.state === "idle" || s.state === "error") && !s.pending;
1639
1639
  var stopped = (name) => `${name} stopped before it got the instruction`;
1640
+ var STOPPED_CODE = "ended";
1641
+ var codeOf = (e) => {
1642
+ const c = e?.code;
1643
+ return typeof c === "string" && c.length <= 40 ? c : "failed";
1644
+ };
1640
1645
  function createRelay(d) {
1641
1646
  const now = d.now ?? (() => (/* @__PURE__ */ new Date()).toISOString());
1642
1647
  const typing = d.typing ?? /* @__PURE__ */ new Set();
@@ -1661,14 +1666,21 @@ function createRelay(d) {
1661
1666
  sending.add(qid);
1662
1667
  try {
1663
1668
  let refused;
1669
+ let code = "failed";
1664
1670
  try {
1665
- refused = await d.replyTo(r.id, r.text);
1671
+ const answer = await d.replyTo(r.id, r.text);
1672
+ if (answer === null || typeof answer === "string") refused = answer;
1673
+ else {
1674
+ refused = answer.message;
1675
+ code = answer.code ?? "failed";
1676
+ }
1666
1677
  } catch (e) {
1667
1678
  refused = e.message;
1679
+ code = codeOf(e);
1668
1680
  }
1669
1681
  if (refused) {
1670
1682
  log(`relay ${qid} to ${r.id} failed: ${refused}`);
1671
- mark(thread, qid, { error: refused });
1683
+ mark(thread, qid, { error: refused, code });
1672
1684
  } else mark(thread, qid, { status: "sent", sentAt: now() });
1673
1685
  return refused;
1674
1686
  } finally {
@@ -1698,7 +1710,7 @@ function createRelay(d) {
1698
1710
  const s = c.type === "updated" ? c.session : void 0;
1699
1711
  if (!s || s.state === "exited") {
1700
1712
  for (const x of q) if (!sending.has(x.qid)) {
1701
- mark(x.thread, x.qid, { error: stopped(x.relay.name) });
1713
+ mark(x.thread, x.qid, { error: stopped(x.relay.name), code: STOPPED_CODE });
1702
1714
  }
1703
1715
  return;
1704
1716
  }
@@ -1717,7 +1729,7 @@ function createRelay(d) {
1717
1729
  const s = d.store.get(r.id);
1718
1730
  if (!s || s.state === "exited") {
1719
1731
  const m = stopped(r.name);
1720
- mark(thread, qid, { error: m });
1732
+ mark(thread, qid, { error: m, code: STOPPED_CODE });
1721
1733
  throw new Error(m);
1722
1734
  }
1723
1735
  if (open5(r.id)) {
@@ -5881,7 +5893,7 @@ function toPhoneTurn(t) {
5881
5893
  if (proposals.length > 0) out.proposals = proposals;
5882
5894
  if (t.relay && t.relay.text.length <= TOOL_TEXT_MAX) {
5883
5895
  const r = t.relay;
5884
- out.relay = { id: r.id, name: r.name, tool: r.tool, text: r.text, ...r.status ? { status: r.status } : {}, ...r.sentAt ? { sentAt: r.sentAt } : {}, ...r.error !== void 0 ? { failed: true } : {} };
5896
+ out.relay = { id: r.id, name: r.name, tool: r.tool, text: r.text, ...r.status ? { status: r.status } : {}, ...r.sentAt ? { sentAt: r.sentAt } : {}, ...r.error !== void 0 ? { failed: true, ...r.code ? { code: r.code } : {} } : {} };
5885
5897
  }
5886
5898
  if (t.team) {
5887
5899
  const tm = t.team;
@@ -7197,6 +7209,16 @@ function createPhoneGateway(deps) {
7197
7209
  }
7198
7210
  return { status: "applied" };
7199
7211
  };
7212
+ const chatRelayCancel = (deviceId, msg) => {
7213
+ const turn = ownTurn(deviceId, msg.qid);
7214
+ if (!turn?.relay || !deps.relay) return { status: "rejected", reason: "unknown_session" };
7215
+ try {
7216
+ deps.relay.cancel(msg.qid);
7217
+ } catch {
7218
+ return { status: "rejected", reason: "stale" };
7219
+ }
7220
+ return { status: "applied" };
7221
+ };
7200
7222
  const chatLaunch = async (deviceId, msg) => {
7201
7223
  const turn = ownTurn(deviceId, msg.qid);
7202
7224
  if (!turn || !deps.launchChat) return { status: "rejected", reason: "unknown_session" };
@@ -7415,6 +7437,7 @@ function createPhoneGateway(deps) {
7415
7437
  return { status: "applied" };
7416
7438
  }
7417
7439
  if (msg.type === "chat.relay") return chatRelay(deviceId, msg);
7440
+ if (msg.type === "chat.relay.cancel") return chatRelayCancel(deviceId, msg);
7418
7441
  if (msg.type === "chat.launch") return chatLaunch(deviceId, msg);
7419
7442
  if (msg.type === "chat.close") return chatClose(deviceId, msg);
7420
7443
  if (msg.type === "chat.act") return chatAct(deviceId, msg);
@@ -8152,7 +8175,10 @@ async function startServer(opts) {
8152
8175
  history?.recordSent(id, m);
8153
8176
  }, mark: (id, rid, status) => history?.markSent(id, rid, status) }
8154
8177
  });
8155
- const relay = createRelay({ threads: cardThreads, store, replyTo: replyText, now, typing, closing, next: (id) => mailbox.kick(id) });
8178
+ const relay = createRelay({ threads: cardThreads, store, replyTo: async (id, text) => {
8179
+ const r = await replyTo(id, text);
8180
+ return r && { message: r.message, code: r.code };
8181
+ }, now, typing, closing, next: (id) => mailbox.kick(id) });
8156
8182
  const teams = createTeamsLive({ store, now, onLeft: toldOfLeaving, onPurged: (t) => tasks.forgetTeam(t.id), ...opts.teams ? { journal: opts.teams } : {} });
8157
8183
  function toldOfLeaving(id, t, why, to) {
8158
8184
  const s = store.get(id);
@@ -225,12 +225,15 @@ var MachineIdSchema = z5.string().regex(/^[a-zA-Z0-9_-]{1,64}$/);
225
225
  var MachineSchema = z5.object({
226
226
  id: MachineIdSchema,
227
227
  label: z5.string().trim().min(1).max(80),
228
- ssh: SshAliasSchema.optional()
228
+ ssh: SshAliasSchema.optional(),
229
+ /** Kept in the list but never connected to: no peer, no retry, no session shown until it is enabled again. */
230
+ disabled: z5.boolean().optional()
229
231
  });
230
232
  var MachinesSchema = z5.array(MachineSchema).min(1).max(20).superRefine((list, ctx) => {
231
233
  if (list[0]?.id !== "local" || list[0].ssh !== void 0) ctx.addIssue({ code: "custom", message: "the first machine is local, without ssh", path: [0] });
232
234
  const ids = /* @__PURE__ */ new Set(), aliases = /* @__PURE__ */ new Set();
233
235
  list.forEach((m, i) => {
236
+ if (i === 0 && m.disabled) ctx.addIssue({ code: "custom", message: "the local machine cannot be disabled", path: [0, "disabled"] });
234
237
  if (i > 0 && !m.ssh) ctx.addIssue({ code: "custom", message: "a remote machine needs an ssh alias", path: [i, "ssh"] });
235
238
  if (ids.has(m.id)) ctx.addIssue({ code: "custom", message: `duplicate id ${m.id}`, path: [i, "id"] });
236
239
  ids.add(m.id);
@@ -968,7 +971,9 @@ var ChatRelaySchema = z13.object({
968
971
  text: z13.string().min(1),
969
972
  status: z13.enum(["queued", "sent"]).optional(),
970
973
  sentAt: z13.string().datetime().optional(),
971
- error: z13.string().optional()
974
+ error: z13.string().optional(),
975
+ /** Why it failed, as a code a front words itself (a RefusalCode, `ended`, or `failed` for the machinery); goes with `error`. */
976
+ code: z13.string().max(40).optional()
972
977
  });
973
978
  var ChatCloseSchema = z13.object({
974
979
  id: z13.string().min(1),
@@ -2033,7 +2038,9 @@ var PhoneChatRelaySchema = z26.object({
2033
2038
  text: z26.string().max(TOOL_TEXT_MAX),
2034
2039
  status: z26.enum(["queued", "sent"]).optional(),
2035
2040
  sentAt: z26.string().datetime().optional(),
2036
- failed: z26.literal(true).optional()
2041
+ failed: z26.literal(true).optional(),
2042
+ /** With `failed`: why, as the PC's code (never its text). */
2043
+ code: z26.string().max(40).optional()
2037
2044
  }).strict();
2038
2045
  var CloseHowSchema = z26.enum(["exit", "killed"]);
2039
2046
  var PhoneChatCloseSchema = z26.object({
@@ -2221,6 +2228,8 @@ var PhoneClientMessageSchema = z26.discriminatedUnion("type", [
2221
2228
  AttachmentPutSchema.pick({ type: true, requestId: true }).extend({ image: ImageUploadSchema.extend({ data: z26.string().min(1).max(b64Max(ATTACHMENT_MAX)) }) }),
2222
2229
  AttachmentGetSchema.pick({ type: true, requestId: true, attachment: true, preview: true }),
2223
2230
  z26.object({ type: z26.literal("chat.relay"), op: OperationIdSchema, qid: OperationIdSchema }),
2231
+ /** Takes the card's queued instruction back out of the queue, as the local `session.relay.cancel`. */
2232
+ z26.object({ type: z26.literal("chat.relay.cancel"), op: OperationIdSchema, qid: OperationIdSchema }),
2224
2233
  z26.object({ type: z26.literal("chat.launch"), op: OperationIdSchema, qid: OperationIdSchema, rows: CardRowsSchema.optional(), assertion: AssertionSchema.optional() }),
2225
2234
  z26.object({ type: z26.literal("chat.close"), op: OperationIdSchema, qid: OperationIdSchema, rows: CardRowsSchema.optional(), assertion: AssertionSchema.optional() }),
2226
2235
  /** The turn's team card (roles spec §3.8): launched like a session card, with the device check (purpose `launch`, the turn). */
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  CODEX_HOOK_VAR
3
- } from "./chunk-TLFKLMBN.js";
3
+ } from "./chunk-JEGPTNWV.js";
4
4
  import {
5
5
  connect
6
- } from "./chunk-6YBIZZQG.js";
6
+ } from "./chunk-ASYAWVFW.js";
7
7
  import {
8
8
  SESSION_KEY_VAR,
9
9
  actionById
10
- } from "./chunk-MYIBYAZC.js";
10
+ } from "./chunk-WXE2NOE5.js";
11
11
 
12
12
  // src/cli/action.ts
13
13
  import { randomUUID } from "crypto";
@@ -9,9 +9,9 @@ import {
9
9
  startServer,
10
10
  tasksJournal,
11
11
  teamsJournal
12
- } from "./chunk-GMG3ROBU.js";
12
+ } from "./chunk-PZ3F4QH3.js";
13
13
  import "./chunk-OLLQBK6N.js";
14
- import "./chunk-HUY4CFMX.js";
14
+ import "./chunk-NWIICISV.js";
15
15
  import {
16
16
  QUESTION_TOOLS,
17
17
  crossSession,
@@ -26,11 +26,11 @@ import {
26
26
  readPeers,
27
27
  reduce,
28
28
  stripNote
29
- } from "./chunk-TCJG3EHB.js";
30
- import "./chunk-MIPE2FWL.js";
29
+ } from "./chunk-3DB3VOMM.js";
30
+ import "./chunk-4VNKZOC2.js";
31
31
  import {
32
32
  agentMessages
33
- } from "./chunk-TLFKLMBN.js";
33
+ } from "./chunk-JEGPTNWV.js";
34
34
  import {
35
35
  DEFAULT_RELAY_URL,
36
36
  DevicePollResponseSchema,
@@ -44,10 +44,10 @@ import {
44
44
  SealedFrameSchema,
45
45
  SessionSchema,
46
46
  backendOf
47
- } from "./chunk-MYIBYAZC.js";
47
+ } from "./chunk-WXE2NOE5.js";
48
48
  import {
49
49
  LEDGE_VERSION
50
- } from "./chunk-WY5WSK2D.js";
50
+ } from "./chunk-E3LXONBI.js";
51
51
  import {
52
52
  SERVICE,
53
53
  inDaemonService,
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  runOnClient
3
- } from "./chunk-QXH2L4UH.js";
3
+ } from "./chunk-XOZD4BP5.js";
4
4
  import {
5
5
  CODEX_HOOK_VAR
6
- } from "./chunk-TLFKLMBN.js";
6
+ } from "./chunk-JEGPTNWV.js";
7
7
  import {
8
8
  connect
9
- } from "./chunk-6YBIZZQG.js";
9
+ } from "./chunk-ASYAWVFW.js";
10
10
  import {
11
11
  LEDGE_GIVER,
12
12
  TASK_TEXT_MAX
13
- } from "./chunk-MYIBYAZC.js";
13
+ } from "./chunk-WXE2NOE5.js";
14
14
  import "./chunk-HOOHS3MX.js";
15
15
  import "./chunk-U67V476Y.js";
16
16
 
@@ -3,10 +3,10 @@ import {
3
3
  handoverArgs,
4
4
  handoverOnClient,
5
5
  runHandover
6
- } from "./chunk-HNC5Q5PV.js";
7
- import "./chunk-TLFKLMBN.js";
8
- import "./chunk-6YBIZZQG.js";
9
- import "./chunk-MYIBYAZC.js";
6
+ } from "./chunk-CSLVBADC.js";
7
+ import "./chunk-JEGPTNWV.js";
8
+ import "./chunk-ASYAWVFW.js";
9
+ import "./chunk-WXE2NOE5.js";
10
10
  import "./chunk-HOOHS3MX.js";
11
11
  import "./chunk-U67V476Y.js";
12
12
  export {
@@ -11,37 +11,37 @@ import {
11
11
  takeImages,
12
12
  teamChangeLine,
13
13
  teammates
14
- } from "./chunk-TCJG3EHB.js";
14
+ } from "./chunk-3DB3VOMM.js";
15
15
  import {
16
16
  findRole
17
- } from "./chunk-MIPE2FWL.js";
17
+ } from "./chunk-4VNKZOC2.js";
18
18
  import {
19
19
  parseLedgeCommand,
20
20
  readOnClient,
21
21
  sendOnClient
22
- } from "./chunk-HEYHVOD6.js";
22
+ } from "./chunk-GXL3X7M7.js";
23
23
  import {
24
24
  taskOnClient
25
- } from "./chunk-YI4V7YVW.js";
25
+ } from "./chunk-4HXJQEUN.js";
26
26
  import {
27
27
  handoverOnClient
28
- } from "./chunk-HNC5Q5PV.js";
28
+ } from "./chunk-CSLVBADC.js";
29
29
  import {
30
30
  CODEX_ENV_VAR,
31
31
  CODEX_HOOK_VAR,
32
32
  codexPlan
33
- } from "./chunk-TLFKLMBN.js";
33
+ } from "./chunk-JEGPTNWV.js";
34
34
  import {
35
35
  formatWho
36
- } from "./chunk-WF27BASF.js";
36
+ } from "./chunk-CCSUP5ZI.js";
37
37
  import {
38
38
  connect,
39
39
  sendMessageAndAwaitAck
40
- } from "./chunk-6YBIZZQG.js";
40
+ } from "./chunk-ASYAWVFW.js";
41
41
  import {
42
42
  MESSAGE_MAX,
43
43
  taskClosed
44
- } from "./chunk-MYIBYAZC.js";
44
+ } from "./chunk-WXE2NOE5.js";
45
45
  import {
46
46
  log
47
47
  } from "./chunk-6IYPRUQG.js";
package/dist/cli/index.js CHANGED
@@ -25,7 +25,7 @@ async function hookMain(args) {
25
25
  try {
26
26
  const chunks = [];
27
27
  for await (const c of process.stdin) chunks.push(c);
28
- const { runHook } = await import("./hook-UJVKYSQ5.js");
28
+ const { runHook } = await import("./hook-W2BU74H5.js");
29
29
  const out = await runHook(event, Buffer.concat(chunks).toString("utf8"), { tool });
30
30
  if (out) process.stdout.write(`${out}
31
31
  `);
@@ -37,7 +37,7 @@ async function main(argv) {
37
37
  const [cmd, ...rest] = argv;
38
38
  switch (cmd) {
39
39
  case "daemon": {
40
- const { startDaemon } = await import("./daemon-WW2P7RDV.js");
40
+ const { startDaemon } = await import("./daemon-5GT545BB.js");
41
41
  await startDaemon();
42
42
  await new Promise(() => {
43
43
  });
@@ -45,7 +45,7 @@ async function main(argv) {
45
45
  }
46
46
  case "--version":
47
47
  case "version": {
48
- const { LEDGE_VERSION } = await import("./version-QIFJVKAQ.js");
48
+ const { LEDGE_VERSION } = await import("./version-LUMK3Z3T.js");
49
49
  console.log(LEDGE_VERSION);
50
50
  return 0;
51
51
  }
@@ -66,74 +66,74 @@ async function main(argv) {
66
66
  return r.ok ? 0 : 1;
67
67
  }
68
68
  case "status": {
69
- const { printStatus } = await import("./status-V6ITP7VT.js");
69
+ const { printStatus } = await import("./status-U2HGGKHF.js");
70
70
  console.log(await printStatus());
71
71
  return 0;
72
72
  }
73
73
  case "who": {
74
- const { printWho } = await import("./who-NIOLHHB3.js");
74
+ const { printWho } = await import("./who-NM3GPAPJ.js");
75
75
  console.log(await printWho());
76
76
  return 0;
77
77
  }
78
78
  case "send": {
79
- const { sendMessage } = await import("./send-HWZHE65N.js");
79
+ const { sendMessage } = await import("./send-NEI4X33R.js");
80
80
  const r = await sendMessage(rest);
81
81
  console.log(r.line);
82
82
  return r.code;
83
83
  }
84
84
  case "read": {
85
- const { readMessage } = await import("./send-HWZHE65N.js");
85
+ const { readMessage } = await import("./send-NEI4X33R.js");
86
86
  const r = await readMessage(rest);
87
87
  console.log(r.line);
88
88
  return r.code;
89
89
  }
90
90
  case "task": {
91
- const { runTask } = await import("./task-N53TM34B.js");
91
+ const { runTask } = await import("./task-PDDCE23D.js");
92
92
  const r = await runTask(rest);
93
93
  console.log(r.line);
94
94
  return r.code;
95
95
  }
96
96
  case "decide": {
97
- const { runDecide } = await import("./decide-HLRD37PW.js");
97
+ const { runDecide } = await import("./decide-PFHHOCFZ.js");
98
98
  const r = await runDecide(rest);
99
99
  console.log(r.line);
100
100
  return r.code;
101
101
  }
102
102
  case "handover": {
103
- const { runHandover } = await import("./handover-56M4LIOP.js");
103
+ const { runHandover } = await import("./handover-EMO6JT7O.js");
104
104
  const r = await runHandover(rest);
105
105
  console.log(r.line);
106
106
  return r.code;
107
107
  }
108
108
  case "close": {
109
- const { runClose } = await import("./action-CFYJM2A2.js");
109
+ const { runClose } = await import("./action-QW2ZQQBN.js");
110
110
  const r = await runClose(rest);
111
111
  console.log(r.line);
112
112
  return r.code;
113
113
  }
114
114
  case "team": {
115
- const { runTeam } = await import("./team-CZFZ24P6.js");
115
+ const { runTeam } = await import("./team-S3ASP22H.js");
116
116
  const r = await runTeam(rest);
117
117
  console.log(r.line);
118
118
  return r.code;
119
119
  }
120
120
  case "tui": {
121
- const { runTui } = await import("./tui-K32C34XI.js");
121
+ const { runTui } = await import("./tui-UPMRMCPC.js");
122
122
  return runTui(rest);
123
123
  }
124
124
  case "bridge": {
125
- const { bridge } = await import("./bridge-UJKWEKA5.js");
125
+ const { bridge } = await import("./bridge-CSLF7EW6.js");
126
126
  await bridge();
127
127
  return 0;
128
128
  }
129
129
  case "claude":
130
130
  case "codex":
131
131
  case "cursor": {
132
- const { launch } = await import("./launch-GIPQDPAC.js");
132
+ const { launch } = await import("./launch-LP7YJR5N.js");
133
133
  return launch(cmd, rest);
134
134
  }
135
135
  case "attach": {
136
- const { attach } = await import("./attach-23PTEIAA.js");
136
+ const { attach } = await import("./attach-ULTYWCJ7.js");
137
137
  return attach(rest.find((a) => !a.startsWith("--")) ?? "", { readOnly: rest.includes("--read-only") });
138
138
  }
139
139
  default:
@@ -6,19 +6,19 @@ import {
6
6
  launch,
7
7
  parseLaunchArgs,
8
8
  roleArgs
9
- } from "./chunk-NXNIRIGI.js";
10
- import "./chunk-GMG3ROBU.js";
9
+ } from "./chunk-CPERVAPQ.js";
10
+ import "./chunk-PZ3F4QH3.js";
11
11
  import "./chunk-OLLQBK6N.js";
12
- import "./chunk-HUY4CFMX.js";
13
- import "./chunk-TCJG3EHB.js";
14
- import "./chunk-MIPE2FWL.js";
12
+ import "./chunk-NWIICISV.js";
13
+ import "./chunk-3DB3VOMM.js";
14
+ import "./chunk-4VNKZOC2.js";
15
15
  import {
16
16
  agentEnv,
17
17
  exitFile
18
- } from "./chunk-TLFKLMBN.js";
19
- import "./chunk-6YBIZZQG.js";
20
- import "./chunk-MYIBYAZC.js";
21
- import "./chunk-WY5WSK2D.js";
18
+ } from "./chunk-JEGPTNWV.js";
19
+ import "./chunk-ASYAWVFW.js";
20
+ import "./chunk-WXE2NOE5.js";
21
+ import "./chunk-E3LXONBI.js";
22
22
  import "./chunk-NLL2EQJ2.js";
23
23
  import "./chunk-6IYPRUQG.js";
24
24
  import "./chunk-HOOHS3MX.js";
@@ -4,10 +4,10 @@ import {
4
4
  readOnClient,
5
5
  sendMessage,
6
6
  sendOnClient
7
- } from "./chunk-HEYHVOD6.js";
8
- import "./chunk-TLFKLMBN.js";
9
- import "./chunk-6YBIZZQG.js";
10
- import "./chunk-MYIBYAZC.js";
7
+ } from "./chunk-GXL3X7M7.js";
8
+ import "./chunk-JEGPTNWV.js";
9
+ import "./chunk-ASYAWVFW.js";
10
+ import "./chunk-WXE2NOE5.js";
11
11
  import "./chunk-HOOHS3MX.js";
12
12
  import "./chunk-U67V476Y.js";
13
13
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  connect
3
- } from "./chunk-6YBIZZQG.js";
4
- import "./chunk-MYIBYAZC.js";
3
+ } from "./chunk-ASYAWVFW.js";
4
+ import "./chunk-WXE2NOE5.js";
5
5
  import "./chunk-HOOHS3MX.js";
6
6
  import "./chunk-U67V476Y.js";
7
7
 
@@ -4,10 +4,10 @@ import {
4
4
  runTask,
5
5
  taskArgs,
6
6
  taskOnClient
7
- } from "./chunk-YI4V7YVW.js";
8
- import "./chunk-TLFKLMBN.js";
9
- import "./chunk-6YBIZZQG.js";
10
- import "./chunk-MYIBYAZC.js";
7
+ } from "./chunk-4HXJQEUN.js";
8
+ import "./chunk-JEGPTNWV.js";
9
+ import "./chunk-ASYAWVFW.js";
10
+ import "./chunk-WXE2NOE5.js";
11
11
  import "./chunk-HOOHS3MX.js";
12
12
  import "./chunk-U67V476Y.js";
13
13
  export {
@@ -4,20 +4,20 @@ import {
4
4
  callerOf,
5
5
  resultLine,
6
6
  runOnClient
7
- } from "./chunk-QXH2L4UH.js";
7
+ } from "./chunk-XOZD4BP5.js";
8
8
  import {
9
9
  listDefinitions
10
- } from "./chunk-HUY4CFMX.js";
11
- import "./chunk-MIPE2FWL.js";
12
- import "./chunk-TLFKLMBN.js";
10
+ } from "./chunk-NWIICISV.js";
11
+ import "./chunk-4VNKZOC2.js";
12
+ import "./chunk-JEGPTNWV.js";
13
13
  import {
14
14
  connect
15
- } from "./chunk-6YBIZZQG.js";
15
+ } from "./chunk-ASYAWVFW.js";
16
16
  import {
17
17
  RoleIdSchema,
18
18
  SeatsSchema,
19
19
  ToolSchema
20
- } from "./chunk-MYIBYAZC.js";
20
+ } from "./chunk-WXE2NOE5.js";
21
21
  import "./chunk-6IYPRUQG.js";
22
22
  import "./chunk-HOOHS3MX.js";
23
23
  import "./chunk-U67V476Y.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  attachEnv
3
- } from "./chunk-NXNIRIGI.js";
3
+ } from "./chunk-CPERVAPQ.js";
4
4
  import {
5
5
  imageInfo
6
- } from "./chunk-GMG3ROBU.js";
6
+ } from "./chunk-PZ3F4QH3.js";
7
7
  import {
8
8
  MAX_FRAME
9
9
  } from "./chunk-OLLQBK6N.js";
10
- import "./chunk-HUY4CFMX.js";
11
- import "./chunk-TCJG3EHB.js";
12
- import "./chunk-MIPE2FWL.js";
13
- import "./chunk-TLFKLMBN.js";
14
- import "./chunk-6YBIZZQG.js";
10
+ import "./chunk-NWIICISV.js";
11
+ import "./chunk-3DB3VOMM.js";
12
+ import "./chunk-4VNKZOC2.js";
13
+ import "./chunk-JEGPTNWV.js";
14
+ import "./chunk-ASYAWVFW.js";
15
15
  import {
16
16
  ACTION_ERROR_CODES,
17
17
  ATTACHMENTS_MAX,
@@ -44,8 +44,8 @@ import {
44
44
  readDaemonToken,
45
45
  taskClosed,
46
46
  transmissions
47
- } from "./chunk-MYIBYAZC.js";
48
- import "./chunk-WY5WSK2D.js";
47
+ } from "./chunk-WXE2NOE5.js";
48
+ import "./chunk-E3LXONBI.js";
49
49
  import "./chunk-NLL2EQJ2.js";
50
50
  import "./chunk-6IYPRUQG.js";
51
51
  import {
@@ -574,13 +574,14 @@ function changeOf(was, now2) {
574
574
  }
575
575
 
576
576
  // ../fleet/src/fleet.ts
577
- var toWire = (list3) => list3.map(({ id, label, ssh }) => ({ id, label, ...ssh ? { ssh } : {} }));
577
+ var toWire = (list3) => list3.map(({ id, label, ssh, disabled }) => ({ id, label, ...ssh ? { ssh } : {}, ...disabled ? { disabled: true } : {} }));
578
578
  var OPERATIONS = /* @__PURE__ */ new Set(["session.launch", "session.relay", "session.relay.cancel", "session.close"]);
579
579
  function createFleetClient(config, makeClient = createDaemonClient, opts = {}) {
580
580
  const prefix = opts.prefix ?? "ledge";
581
581
  const HISTORY_KEY = `${prefix}.fleet.history`, MACHINES_KEY = `${prefix}.machines`;
582
582
  let configs = parseMachines(config), selected = configs[0].id, connected = false, configuring = false, state2 = [];
583
583
  const peers = /* @__PURE__ */ new Map();
584
+ const active = () => configs.filter((c) => !c.disabled);
584
585
  const machineMessages = /* @__PURE__ */ new Set();
585
586
  const messages = /* @__PURE__ */ new Set(), statuses = /* @__PURE__ */ new Set(), listeners2 = /* @__PURE__ */ new Set();
586
587
  const turns2 = /* @__PURE__ */ new Map(), bindings = /* @__PURE__ */ new Map();
@@ -710,7 +711,7 @@ function createFleetClient(config, makeClient = createDaemonClient, opts = {}) {
710
711
  const stateSessions = (p) => (stale(p) ? p.snapshot.sessions.map((s) => ({ ...s, offline: true })) : p.snapshot?.sessions ?? []).filter((s) => !isArchived(s));
711
712
  function refresh() {
712
713
  if (configuring) return;
713
- state2 = configs.map((c) => {
714
+ state2 = active().map((c) => {
714
715
  const p = peers.get(c.id);
715
716
  return { ...c, status: p.status, ready: available(p), recents: p.snapshot?.recents ?? [], sessions: stateSessions(p), launcher: p.snapshot?.launcher ?? null, version: p.snapshot?.daemon?.version, daemon: p.snapshot?.daemon, error: p.error };
716
717
  });
@@ -723,7 +724,7 @@ function createFleetClient(config, makeClient = createDaemonClient, opts = {}) {
723
724
  }
724
725
  function publish() {
725
726
  if (configuring) return;
726
- state2 = configs.map((c) => {
727
+ state2 = active().map((c) => {
727
728
  const p = peers.get(c.id);
728
729
  return { ...c, status: p.status, ready: available(p), recents: p.snapshot?.recents ?? [], sessions: stateSessions(p), launcher: p.snapshot?.launcher ?? null, version: p.snapshot?.daemon?.version, daemon: p.snapshot?.daemon, error: p.error };
729
730
  });
@@ -766,13 +767,13 @@ function createFleetClient(config, makeClient = createDaemonClient, opts = {}) {
766
767
  }
767
768
  function apply(next2) {
768
769
  configuring = true;
769
- for (const [id, p] of peers) if (!next2.some((c) => c.id === id && c.url === p.config.url && c.ssh === p.config.ssh)) {
770
+ for (const [id, p] of peers) if (!next2.some((c) => !c.disabled && c.id === id && c.url === p.config.url && c.ssh === p.config.ssh)) {
770
771
  p.client.close();
771
772
  p.off.forEach((off) => off());
772
773
  peers.delete(id);
773
774
  }
774
775
  configs = next2;
775
- for (const c of configs) {
776
+ for (const c of active()) {
776
777
  const p = peers.get(c.id);
777
778
  if (p) p.config = c;
778
779
  else add(c);
@@ -1062,7 +1063,7 @@ function createFleetClient(config, makeClient = createDaemonClient, opts = {}) {
1062
1063
  return;
1063
1064
  }
1064
1065
  if (m.request !== void 0 && OPERATIONS.has(m.request)) endOperation(machine);
1065
- emit2({ ...m, ...m.id ? { id: qualify(machine, m.id) } : {}, message: configs.length > 1 ? `${p.config.label}: ${m.message}` : m.message });
1066
+ emit2({ ...m, ...m.id ? { id: qualify(machine, m.id) } : {}, message: active().length > 1 ? `${p.config.label}: ${m.message}` : m.message });
1066
1067
  return;
1067
1068
  }
1068
1069
  if (m.type === "session.handover.result") {
@@ -1110,7 +1111,7 @@ function createFleetClient(config, makeClient = createDaemonClient, opts = {}) {
1110
1111
  }));
1111
1112
  if (connected) client.connect();
1112
1113
  }
1113
- for (const c of configs) add(c);
1114
+ for (const c of active()) add(c);
1114
1115
  function inventory() {
1115
1116
  return { machines: state2.map((m) => ({ id: m.id, label: m.label, online: m.ready, local: m.id === "local", sessions: m.sessions.slice(0, 500).map((s) => ({ id: s.id, name: s.name, project: s.repo ?? s.project, cwd: s.cwd, topic: s.topic, state: s.state, readOnly: s.source === "hook_only" })), folders: m.recents.slice(0, 100).map((r) => ({ project: r.project, cwd: r.cwd })) })), history: [...turns2.values()].slice(-30).map((t) => ({ question: t.question.slice(0, 2e4), answer: t.answer?.slice(0, 2e4), machineId: t.machineId })) };
1116
1117
  }
@@ -1163,7 +1164,7 @@ function createFleetClient(config, makeClient = createDaemonClient, opts = {}) {
1163
1164
  const context = inventory();
1164
1165
  turns2.set(msg.qid, { qid: msg.qid, question: msg.text, askedAt: (/* @__PURE__ */ new Date()).toISOString(), steps: [] });
1165
1166
  history();
1166
- if (configs.length === 1) {
1167
+ if (active().length === 1) {
1167
1168
  const p = peers.get("local");
1168
1169
  if (!available(p)) return fail(msg.qid, "Local is offline");
1169
1170
  bindings.set(msg.qid, { machine: "local", raw: msg.qid });
@@ -1216,7 +1217,7 @@ function createFleetClient(config, makeClient = createDaemonClient, opts = {}) {
1216
1217
  attachmentAsks.set(msg.requestId, machine);
1217
1218
  }
1218
1219
  if (msg.type === "document.read") {
1219
- if (configs.length > 1 && !msg.machineId && !msg.sessionId) {
1220
+ if (active().length > 1 && !msg.machineId && !msg.sessionId) {
1220
1221
  emit2({ type: "document.error", requestId: msg.requestId, path: msg.path, code: "read_failed" });
1221
1222
  return;
1222
1223
  }
@@ -1371,6 +1372,7 @@ function createFleetClient(config, makeClient = createDaemonClient, opts = {}) {
1371
1372
  localStorage.setItem(MACHINES_KEY, JSON.stringify(next2));
1372
1373
  apply(next2);
1373
1374
  },
1375
+ configured: () => configs,
1374
1376
  machinesSource: () => source2,
1375
1377
  probe: (ssh) => probeMachine(configs[0].url, ssh, { token: opts.token }),
1376
1378
  // The last try's error is forgotten: the machine is « connecting » until its next answer (a snapshot, or an error again).
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  LEDGE_VERSION
3
- } from "./chunk-WY5WSK2D.js";
3
+ } from "./chunk-E3LXONBI.js";
4
4
  import "./chunk-U67V476Y.js";
5
5
  export {
6
6
  LEDGE_VERSION
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  formatWho,
3
3
  printWho
4
- } from "./chunk-WF27BASF.js";
5
- import "./chunk-6YBIZZQG.js";
6
- import "./chunk-MYIBYAZC.js";
4
+ } from "./chunk-CCSUP5ZI.js";
5
+ import "./chunk-ASYAWVFW.js";
6
+ import "./chunk-WXE2NOE5.js";
7
7
  import "./chunk-HOOHS3MX.js";
8
8
  import "./chunk-U67V476Y.js";
9
9
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paradow/ledge",
3
- "version": "0.31.0",
3
+ "version": "0.33.0",
4
4
  "description": "Follow and answer your WSL agent sessions (Claude Code, Codex, Cursor Agent) from the Ledge island on Windows.",
5
5
  "type": "module",
6
6
  "bin": { "ledge": "dist/cli/index.js" },
@@ -1,6 +0,0 @@
1
- // src/version.ts
2
- var LEDGE_VERSION = true ? "0.31.0" : "0.0.0-dev";
3
-
4
- export {
5
- LEDGE_VERSION
6
- };