@paradow/ledge-relay 0.63.0 → 0.65.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.
@@ -1093,7 +1093,10 @@ var ACTION_IDS = [
1093
1093
  "rig.send",
1094
1094
  "brain.answer",
1095
1095
  "session.handover",
1096
- "pr.fix"
1096
+ "pr.fix",
1097
+ "session.topic",
1098
+ "session.move",
1099
+ "session.delete"
1097
1100
  ];
1098
1101
  var ActionIdSchema = z11.enum(ACTION_IDS);
1099
1102
  var def = (d) => d;
@@ -1376,8 +1379,50 @@ var ACTIONS = [
1376
1379
  summary: "demander \xE0 la session d'une pull request suivie de corriger son pipeline en \xE9chec (pr, son id de prs.md ; session, sinon la plus active de la branche)",
1377
1380
  when: "seulement quand l'utilisateur demande explicitement de faire corriger une pull request ou son pipeline, et que prs.md la montre suivie",
1378
1381
  example: { pr: "github.com/alice/api#226" }
1382
+ }),
1383
+ // The CLI's own (chat: false): what Desktop's « Gérer la session » does and the chat never proposes, so a session (the user's
1384
+ // « chef ») can tidy the others up from its shell.
1385
+ def({
1386
+ id: "session.topic",
1387
+ args: z11.object({ session: SessionRef, topic: z11.string().trim().max(500) }),
1388
+ card: "generic",
1389
+ phone: null,
1390
+ risk: "reversible",
1391
+ max: 8,
1392
+ chat: false,
1393
+ cli: 'ledge rename <session> "<sujet>"',
1394
+ summary: "changer le sujet d'une session (son nom d'agent ne change pas) ; un sujet vide rend la main au sujet automatique",
1395
+ when: "quand l'utilisateur demande de renommer une session",
1396
+ example: { session: "Nova", topic: "Pagination de /invoices" }
1397
+ }),
1398
+ def({
1399
+ id: "session.move",
1400
+ args: z11.object({ session: SessionRef, project: z11.string().trim().min(1).max(80) }),
1401
+ card: "generic",
1402
+ phone: null,
1403
+ risk: "reversible",
1404
+ max: 8,
1405
+ chat: false,
1406
+ cli: "ledge move <session> <projet>",
1407
+ summary: "ranger une session dans un projet (son id ou son nom) : son dossier y est rattach\xE9, comme \xAB Ranger dans\u2026 \xBB de Desktop",
1408
+ when: "quand l'utilisateur demande de ranger ou de d\xE9placer une session dans un projet",
1409
+ example: { session: "Nova", project: "iptv" }
1410
+ }),
1411
+ def({
1412
+ id: "session.delete",
1413
+ args: z11.object({ session: SessionRef }),
1414
+ card: "generic",
1415
+ phone: null,
1416
+ risk: "destructive",
1417
+ max: 8,
1418
+ chat: false,
1419
+ cli: "ledge delete <session> --yes",
1420
+ summary: "supprimer une session pour de bon, archiv\xE9e ou non (son agent est arr\xEAt\xE9) ; irr\xE9versible",
1421
+ when: "seulement quand l'utilisateur le lance lui-m\xEAme",
1422
+ example: { session: "Nova" }
1379
1423
  })
1380
1424
  ];
1425
+ var CHAT_ACTIONS = ACTIONS.filter((a) => a.chat !== false);
1381
1426
  var byId = new Map(ACTIONS.map((a) => [a.id, a]));
1382
1427
  var ActionBlockSchema = z11.object({ action: z11.string().trim().min(1).max(40), args: z11.record(z11.unknown()).default({}) });
1383
1428
 
@@ -1777,7 +1822,9 @@ ${rule.path}`;
1777
1822
  });
1778
1823
  return out;
1779
1824
  }
1780
- var ProjectsSchema = z20.object({ projects: z20.array(ProjectSchema).max(100), rules: z20.array(RuleSchema).max(1e3) }).superRefine((p, ctx) => {
1825
+ var SESSION_ORDER_MAX = 500;
1826
+ var SessionOrderSchema = z20.record(z20.string().max(64), z20.array(z20.string().min(1).max(300)).max(SESSION_ORDER_MAX));
1827
+ var ProjectsSchema = z20.object({ projects: z20.array(ProjectSchema).max(100), rules: z20.array(RuleSchema).max(1e3), order: SessionOrderSchema.optional() }).superRefine((p, ctx) => {
1781
1828
  for (const problem of projectsProblems(p)) ctx.addIssue({ code: "custom", message: problem.code, path: problem.path });
1782
1829
  });
1783
1830
 
@@ -2403,7 +2450,9 @@ var RefusalCodeSchema = z31.enum([
2403
2450
  "attachments_not_accepted",
2404
2451
  /** Issue #2: a project is saved with at least one folder (`folder_required`), and keeps its last one (`last_folder`). */
2405
2452
  "folder_required",
2406
- "last_folder"
2453
+ "last_folder",
2454
+ /** Issue #15: a name given at launch is taken (nameRefusal). */
2455
+ "name_taken"
2407
2456
  ]);
2408
2457
 
2409
2458
  // ../../packages/protocol/src/forge.ts
@@ -3005,6 +3054,8 @@ var ClientMessageSchema = z33.discriminatedUnion("type", [
3005
3054
  z33.object({ type: z33.literal("machines.set"), machines: MachinesSchema }),
3006
3055
  /** Replaces the local daemon's projects and rules as a whole; refused unless valid. */
3007
3056
  z33.object({ type: z33.literal("projects.set"), projects: ProjectsSchema }),
3057
+ /** Issue #16: one project's sessions' order (its id, or NO_PROJECT ''), as session keys (placeSessions); answered by `projects`. */
3058
+ z33.object({ type: z33.literal("sessions.order"), project: z33.string().max(64), ids: z33.array(z33.string().min(1).max(300)).max(SESSION_ORDER_MAX) }),
3008
3059
  /** Replaces the island's settings as a whole; refused unless valid. */
3009
3060
  z33.object({ type: z33.literal("island.set"), prefs: IslandPrefsSchema }),
3010
3061
  /** Mobile access (lot 3), local fronts only. A changed `relayUrl` drops the relay session. */
@@ -3289,7 +3340,7 @@ var RiskSchema = z39.enum(["low", "high"]);
3289
3340
  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"]);
3290
3341
  var OperationIdSchema = z39.string().uuid();
3291
3342
  var OperationStatusSchema = z39.enum(["received", "applied", "rejected", "failed"]);
3292
- var OperationReasonSchema = z39.enum([...RefusalCodeSchema.options, "untypable", "confirm_required", "conflict", "assertion_invalid", "assertion_expired", "scheduled", "name_taken", "folder_taken", "not_found", "not_pending", ...ModelRefusalSchema.options]);
3343
+ var OperationReasonSchema = z39.enum([...RefusalCodeSchema.options, "untypable", "confirm_required", "conflict", "assertion_invalid", "assertion_expired", "scheduled", "folder_taken", "not_found", "not_pending", ...ModelRefusalSchema.options]);
3293
3344
  var CapabilitiesSchema = z39.object({
3294
3345
  /** A question can be answered in free text. */
3295
3346
  freeTextAnswer: z39.boolean(),
@@ -3302,6 +3353,7 @@ var CapabilitiesByToolSchema = z39.object({ claude: CapabilitiesSchema, codex: C
3302
3353
  var PhonePendingSchema = PendingSchema.extend({ key: z39.string().max(64), risk: RiskSchema, riskReason: RiskReasonSchema, cut: z39.literal(true).optional() });
3303
3354
  var SwitchableSessionSchema = SessionSchema.extend({ canSwitch: z39.literal(true).optional() });
3304
3355
  var PhoneProjectSchema = z39.object({ id: ProjectIdSchema, name: z39.string().max(80), color: ProjectColorSchema });
3356
+ var PhoneSessionOrderSchema = z39.record(z39.string().max(64), z39.array(z39.string().max(200)).max(SESSION_ORDER_MAX));
3305
3357
  var PHONE_PROJECTS_MAX = 100;
3306
3358
  var PHONE_RIG_NAME_MAX = 100;
3307
3359
  var PhoneSessionSchema = SwitchableSessionSchema.pick({
@@ -3488,7 +3540,9 @@ var PhoneLaunchSchema = z39.object({
3488
3540
  prompt: z39.string().trim().min(1).max(MESSAGE_MAX),
3489
3541
  model: ModelIdSchema.optional(),
3490
3542
  effort: EffortSchema.optional(),
3491
- approval: OmpApprovalSchema.optional()
3543
+ approval: OmpApprovalSchema.optional(),
3544
+ /** Issue #15: the session's name (its address), cleaned as every name; taken: refused `name_taken`. Absent: the first free one. */
3545
+ name: z39.string().max(200).optional()
3492
3546
  }).strict();
3493
3547
  var PcActionSchema = z39.enum(["update", "restart"]);
3494
3548
  var PHONE_FOLDER_ENTRIES_MAX = 500;
@@ -3639,6 +3693,9 @@ var PhoneClientMessageSchema = z39.discriminatedUnion("type", [
3639
3693
  */
3640
3694
  z39.object({ type: z39.literal("project.edit"), op: OperationIdSchema, id: ProjectIdSchema, name: ProjectNameSchema.optional(), color: ProjectColorSchema.optional() }).strict(),
3641
3695
  z39.object({ type: z39.literal("project.order"), op: OperationIdSchema, ids: z39.array(ProjectIdSchema).min(1).max(PHONE_PROJECTS_MAX) }).strict(),
3696
+ /** Issue #16: some of a project's sessions (`project` null: « Sans projet ») in a new order, this PC's ids; the others keep their
3697
+ * places (placeSessions). A session not in that project, or one gone, makes it stale. */
3698
+ z39.object({ type: z39.literal("session.order"), op: OperationIdSchema, project: ProjectIdSchema.nullable(), ids: z39.array(z39.string().min(1).max(200)).min(1).max(SESSION_ORDER_MAX) }).strict(),
3642
3699
  /** Issue #2: with its first folder (`path`, of this PC) and the device's check over that name and folder (`newProjectSubject`). A
3643
3700
  * create without it, from an older phone, is refused `folder_required`. */
3644
3701
  z39.object({
@@ -3840,6 +3897,8 @@ var PhoneServerMessageSchema = z39.discriminatedUnion("type", [
3840
3897
  projectFolders: z39.literal(true).optional(),
3841
3898
  /** The daemon takes `project.edit`, `project.order`, `project.create` and `project.delete` (Réglages › Projets). */
3842
3899
  projectEdit: z39.literal(true).optional(),
3900
+ /** Issue #16: the snapshot and `projects` carry `sessionOrder`, and the daemon takes `session.order`. */
3901
+ sessionOrder: z39.literal(true).optional(),
3843
3902
  /** The daemon takes `device.prefs` and `context.set` (the phone's Réglages); the device then carries its `prefs`. */
3844
3903
  settings: z39.literal(true).optional(),
3845
3904
  /** The daemon sends `usage.state` (its harnesses' limits). */
@@ -3858,6 +3917,7 @@ var PhoneServerMessageSchema = z39.discriminatedUnion("type", [
3858
3917
  }),
3859
3918
  /** The user's projects (`daemon.atelier`), whole, in their order: absent from an older PC's snapshot. */
3860
3919
  projects: z39.array(PhoneProjectSchema).max(PHONE_PROJECTS_MAX).optional(),
3920
+ sessionOrder: PhoneSessionOrderSchema.optional(),
3861
3921
  device: z39.object({
3862
3922
  confirm: z39.boolean(),
3863
3923
  /** Its passkey can bring it back after a reinstall: without it, « Mettre à jour la passkey ». */
@@ -3892,7 +3952,7 @@ var PhoneServerMessageSchema = z39.discriminatedUnion("type", [
3892
3952
  z39.object({ type: z39.literal("session.updated"), session: PhoneSessionSchema }),
3893
3953
  /** The user's projects changed (a name, a colour, one added or removed, the order) (`daemon.atelier`): the list, whole. A session placed
3894
3954
  * elsewhere by the change follows as its own `session.updated`, after this. */
3895
- z39.object({ type: z39.literal("projects"), projects: z39.array(PhoneProjectSchema).max(PHONE_PROJECTS_MAX) }),
3955
+ z39.object({ type: z39.literal("projects"), projects: z39.array(PhoneProjectSchema).max(PHONE_PROJECTS_MAX), sessionOrder: PhoneSessionOrderSchema.optional() }),
3896
3956
  z39.object({ type: z39.literal("session.removed"), id: z39.string() }),
3897
3957
  /** A session's checklist, sent to the phone that watches it; `null`: it has none (any more). */
3898
3958
  z39.object({ type: z39.literal("session.checklist"), id: z39.string(), checklist: PhoneChecklistSchema.nullable() }),
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  parsePublicUrl,
8
8
  startRelay,
9
9
  startupErrorLine
10
- } from "./chunk-KNMT653U.js";
10
+ } from "./chunk-ELUIOWWS.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-KNMT653U.js";
5
+ } from "./chunk-ELUIOWWS.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.63.0",
3
+ "version": "0.65.0",
4
4
  "license": "PolyForm-Noncommercial-1.0.0",
5
5
  "repository": {
6
6
  "type": "git",