@paradow/ledge-relay 0.69.1 → 0.70.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.
@@ -150,6 +150,17 @@ var BackgroundCommandSchema = z4.object({
150
150
  });
151
151
  var TopicSourceSchema = z4.enum(["user", "pane", "prompt"]);
152
152
  var SESSION_LABEL_MAX = 40;
153
+ var AgentWhereSchema = z4.object({
154
+ /** The agent's process: the one its terminal or pane runs. */
155
+ pid: z4.number().int().positive(),
156
+ /** Field 22 of /proc/<pid>/stat (its start in clock ticks since boot): a reused pid never matches it. */
157
+ pidStart: z4.number().int().nonnegative(),
158
+ /** Its tmux pane, when it runs in one: the server's socket path (first field of $TMUX) and the pane id ($TMUX_PANE). */
159
+ tmux: z4.object({ socket: z4.string().startsWith("/").max(1024), pane: z4.string().regex(/^%\d+$/) }).strict().optional()
160
+ }).strict();
161
+ var AdoptStepSchema = z4.enum(["attaching", "waiting", "stopping", "resuming"]);
162
+ var AdoptPathSchema = z4.enum(["pane", "resume"]);
163
+ var AdoptFailureSchema = z4.enum(["unsupported", "busy", "not_located", "no_conversation", "pane_not_found", "process_gone", "stop_failed", "resume_failed", "cancelled"]);
153
164
  var SessionSchema = z4.object({
154
165
  /** Origin is annotated by the overlay, never used as an unqualified session id on the wire. */
155
166
  machineId: z4.string().optional(),
@@ -179,6 +190,10 @@ var SessionSchema = z4.object({
179
190
  /** The OpenRig seat this agent is: its session name (`dev-build@starter`), its rig, and its role (`dev.build`) once OpenRig named it. */
180
191
  rig: z4.object({ seat: z4.string(), name: z4.string(), role: z4.string().optional() }).optional(),
181
192
  tmuxSession: z4.string().nullable(),
193
+ /** Where an agent Ledge did not launch runs (its hook's latest word): kept while it is read-only, and once its pane is adopted. */
194
+ where: AgentWhereSchema.optional(),
195
+ /** A « Rattacher à Ledge » under way: its step, its path, since when. */
196
+ adopting: z4.object({ step: AdoptStepSchema, path: AdoptPathSchema, since: z4.string().datetime() }).optional(),
182
197
  /** Left out for a tmux session. `omp-rpc`: no pane, nothing to attach to; the daemon holds the process (see `agentSessionFile`). */
183
198
  backend: BackendSchema.optional(),
184
199
  state: SessionStateSchema,
@@ -2331,7 +2346,10 @@ var ThreadItemSchema = z27.discriminatedUnion("kind", [
2331
2346
  text: z27.string(),
2332
2347
  /** An OpenRig block that is not a message: a row handed to this seat or passed by it (`handoff`, `outgoing` for its own),
2333
2348
  * a row unblocked, OpenRig's own notice, or an unreadable block; `text` is the body (unreadable: the block as is). */
2334
- rig: RigInfoSchema.optional()
2349
+ rig: RigInfoSchema.optional(),
2350
+ /** The moment the session was brought into Ledge (« Rattacher à Ledge », spec 2026-12-01 rattacher): driven in its tmux pane, or
2351
+ * resumed on the same conversation. A front that knows it says it in its own words; an older one shows `text`. */
2352
+ adopted: z27.enum(["pane", "resume"]).optional()
2335
2353
  })
2336
2354
  ]);
2337
2355
 
@@ -2744,6 +2762,8 @@ var DaemonInfoSchema = z33.object({
2744
2762
  omp: z33.boolean().optional(),
2745
2763
  /** Takes `session.model`: a live session's model and effort changed (#58, lot 2). */
2746
2764
  modelSwitch: z33.boolean().optional(),
2765
+ /** Takes `session.adopt`: « Rattacher à Ledge » (spec 2026-12-01 rattacher). */
2766
+ adopt: z33.boolean().optional(),
2747
2767
  /** Answers `session.commands`: the slash commands a session's agent offers. */
2748
2768
  commands: z33.boolean().optional(),
2749
2769
  /** Takes `approval` on an OMP `session.launch` (auto mode). */
@@ -2858,6 +2878,8 @@ var ServerMessageSchema = z33.discriminatedUnion("type", [
2858
2878
  SessionAsideSchema,
2859
2879
  /** Answer to the requester of a `session.launch`: the session exists (its `session.updated` is broadcast as usual). */
2860
2880
  z33.object({ type: z33.literal("session.launched"), id: z33.string() }),
2881
+ /** Answer to the requester of a `session.adopt`: the session is Ledge's now; on `resume` the requester opens its terminal. */
2882
+ z33.object({ type: z33.literal("session.adopted"), id: z33.string(), path: AdoptPathSchema }),
2861
2883
  z33.object({ type: z33.literal("recents"), recents: z33.array(RecentSchema) }),
2862
2884
  /** Answer to the requester of a `folder.list` or `folder.create`: `path` resolved (`~` expanded), `parent` null at the
2863
2885
  * root, `entries` its subfolders by name (hidden ones left out). A failure keeps the asked path and says why in `error`,
@@ -3080,8 +3102,12 @@ var ClientMessageSchema = z33.discriminatedUnion("type", [
3080
3102
  agent: ToolSchema.optional(),
3081
3103
  cwd: z33.string().optional(),
3082
3104
  /** The OpenRig seat the agent runs in (`OPENRIG_SESSION_NAME`, `pod-member@rig`), when OpenRig launched it. */
3083
- rigSeat: RigSeatNameSchema.optional()
3105
+ rigSeat: RigSeatNameSchema.optional(),
3106
+ /** Where the agent runs, from an agent Ledge did not launch (spec 2026-12-01 rattacher §2). */
3107
+ where: AgentWhereSchema.optional()
3084
3108
  }),
3109
+ /** « Rattacher à Ledge » on a read-only session (spec 2026-12-01 rattacher §3); `cancel` withdraws one still `waiting`. */
3110
+ z33.object({ type: z33.literal("session.adopt"), id: z33.string(), cancel: z33.literal(true).optional() }),
3085
3111
  z33.object({ type: z33.literal("session.unregister"), id: z33.string(), exitCode: z33.number().int().nullable() }),
3086
3112
  z33.object({ type: z33.literal("snapshot.request") }),
3087
3113
  /** #40: the chat, its cards and the operator's point left Ledge. An older front's message still parses, by its name only, so
@@ -3381,7 +3407,27 @@ var RiskSchema = z39.enum(["low", "high"]);
3381
3407
  var RiskReasonSchema = z39.enum(["question", "read_only_command", "edit_inside_folder", "pushes", "destroys", "deploys", "publishes", "pipes_to_shell", "network", "writes_outside_folder", "sensitive_path", "unsafe_flag", "shell_syntax", "script", "plan", "unknown"]);
3382
3408
  var OperationIdSchema = z39.string().uuid();
3383
3409
  var OperationStatusSchema = z39.enum(["received", "applied", "rejected", "failed"]);
3384
- var OperationReasonSchema = z39.enum([...RefusalCodeSchema.options, "untypable", "confirm_required", "conflict", "assertion_invalid", "assertion_expired", "scheduled", "folder_taken", "not_found", "not_pending", ...ModelRefusalSchema.options]);
3410
+ var OperationReasonSchema = z39.enum([
3411
+ ...RefusalCodeSchema.options,
3412
+ "untypable",
3413
+ "confirm_required",
3414
+ "conflict",
3415
+ "assertion_invalid",
3416
+ "assertion_expired",
3417
+ "scheduled",
3418
+ "folder_taken",
3419
+ "not_found",
3420
+ "not_pending",
3421
+ ...ModelRefusalSchema.options,
3422
+ /** « Rattacher à Ledge »'s own (AdoptFailureSchema), those the lists above do not already have. */
3423
+ "unsupported",
3424
+ "not_located",
3425
+ "pane_not_found",
3426
+ "process_gone",
3427
+ "stop_failed",
3428
+ "resume_failed",
3429
+ "cancelled"
3430
+ ]);
3385
3431
  var CapabilitiesSchema = z39.object({
3386
3432
  /** A question can be answered in free text. */
3387
3433
  freeTextAnswer: z39.boolean(),
@@ -3438,6 +3484,10 @@ var PhoneSessionSchema = SwitchableSessionSchema.pick({
3438
3484
  checklist: PhoneChecklistSummarySchema.optional(),
3439
3485
  /** Started without Ledge (`hook_only`): the phone can neither close nor resume it. */
3440
3486
  readOnly: z39.literal(true).optional(),
3487
+ /** « Rattacher à Ledge » on a read-only session: what it would do (`adoptPlan`, spec 2026-12-01 rattacher §3.3); absent, not offered. */
3488
+ adopt: z39.enum(["pane", "resume", "not_located"]).optional(),
3489
+ /** A « Rattacher à Ledge » under way: its step. */
3490
+ adopting: z39.object({ step: AdoptStepSchema }).strict().optional(),
3441
3491
  /** Its room in the Atelier (`daemon.atelier`): the user's project it belongs to, placed by the PC as the desktop places it; absent: none (« Sans projet »). */
3442
3492
  projectId: ProjectIdSchema.optional(),
3443
3493
  /** The OpenRig seat it is (`daemon.atelier`): its rig and its role once OpenRig named it. Never the seat's folder. */
@@ -3712,6 +3762,9 @@ var PhoneClientMessageSchema = z39.discriminatedUnion("type", [
3712
3762
  z39.object({ type: z39.literal("session.resume"), op: OperationIdSchema, id: sessionId, assertion: AssertionSchema.optional() }),
3713
3763
  /** Changes a live session's model and effort, `null` for the agent's own default; answered by `operation.result` and, when refused, `session.model.failed`. */
3714
3764
  z39.object({ type: z39.literal("session.model"), op: OperationIdSchema, id: sessionId, model: ModelIdSchema.nullable(), effort: EffortSchema.nullable() }),
3765
+ /** « Rattacher à Ledge » on a read-only session (`cancel`: withdraws one still waiting); answered by `operation.result`, then
3766
+ * `session.adopted` or `session.adopt.failed`. */
3767
+ z39.object({ type: z39.literal("session.adopt"), op: OperationIdSchema, id: sessionId, cancel: z39.literal(true).optional() }),
3715
3768
  /** One message to several sessions (ids); answered by `operation.result` with `sent` and `refused`. */
3716
3769
  z39.object({ type: z39.literal("session.broadcast"), op: OperationIdSchema, sessions: z39.array(sessionId).min(1).max(BROADCAST_SESSIONS_MAX), text: z39.string().trim().min(1).max(MESSAGE_MAX) }).strict(),
3717
3770
  /** The models an agent offers on the PC. */
@@ -3925,6 +3978,8 @@ var PhoneServerMessageSchema = z39.discriminatedUnion("type", [
3925
3978
  restart: z39.literal(true).optional(),
3926
3979
  /** The daemon takes `session.close` and `session.resume`. */
3927
3980
  sessionClose: z39.literal(true).optional(),
3981
+ /** The daemon takes `session.adopt` (« Rattacher à Ledge »). */
3982
+ adopt: z39.literal(true).optional(),
3928
3983
  /** The daemon streams a session's terminal (`term.open`). */
3929
3984
  terminal: z39.literal(true).optional(),
3930
3985
  /** The PC lets a phone type into a terminal (`term.hold`): its setting is on. */
@@ -4028,6 +4083,17 @@ var PhoneServerMessageSchema = z39.discriminatedUnion("type", [
4028
4083
  z39.object({ type: z39.literal("models.listing"), tool: ToolSchema, models: z39.array(PhoneModelChoiceSchema).max(40), error: z39.literal(true).optional() }),
4029
4084
  /** A model change that was accepted and then failed (the agent could not restart). */
4030
4085
  z39.object({ type: z39.literal("session.model.failed"), id: z39.string(), reason: ModelRefusalSchema }),
4086
+ /** A « Rattacher à Ledge » done: the session is Ledge's now (`resume`: it was restarted on its conversation in Ledge's tmux). */
4087
+ z39.object({ type: z39.literal("session.adopted"), id: z39.string(), path: AdoptPathSchema }),
4088
+ /** A « Rattacher à Ledge » that was accepted and then did not happen. */
4089
+ z39.object({
4090
+ type: z39.literal("session.adopt.failed"),
4091
+ id: z39.string(),
4092
+ reason: AdoptFailureSchema,
4093
+ /** `resume_failed`: the exit code of the resumed agent that quit at once (« claude a quitté au démarrage (code 1) »), when
4094
+ * known. Never the daemon's own words, which may hold a path. */
4095
+ exitCode: z39.number().int().optional()
4096
+ }),
4031
4097
  /** A session's slash commands; `error`: they could not be read (the agent is not listed, or did not answer in time): a command typed by hand still goes. */
4032
4098
  z39.object({ type: z39.literal("session.commands.listing"), id: z39.string(), commands: z39.array(PhoneSlashCommandSchema).max(PHONE_COMMANDS_MAX), error: z39.literal(true).optional() }),
4033
4099
  /** A queue row's state, answering `openrig.row`: `row`, or `error`. */
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  parsePublicUrl,
8
8
  startRelay,
9
9
  startupErrorLine
10
- } from "./chunk-YIXJHVVJ.js";
10
+ } from "./chunk-WLFSST3N.js";
11
11
 
12
12
  // src/cli.ts
13
13
  import { chmodSync as chmodSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync3, realpathSync } from "fs";
package/dist/main.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  loadConfig,
3
3
  startRelay,
4
4
  startupErrorLine
5
- } from "./chunk-YIXJHVVJ.js";
5
+ } from "./chunk-WLFSST3N.js";
6
6
 
7
7
  // src/main.ts
8
8
  function die(msg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paradow/ledge-relay",
3
- "version": "0.69.1",
3
+ "version": "0.70.1",
4
4
  "license": "PolyForm-Noncommercial-1.0.0",
5
5
  "repository": {
6
6
  "type": "git",