@bridge4dev/runner 0.65.0 → 0.66.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.
@@ -235,11 +235,11 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
235
235
  token: string;
236
236
  }>>;
237
237
  }, "strip", z.ZodTypeAny, {
238
- mode: "ask" | "plan" | "auto" | "full";
239
- agent: "CLAUDE" | "CODEX";
240
- status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
238
+ mode: "plan" | "ask" | "auto" | "full";
241
239
  id: string;
240
+ status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
242
241
  kind: "TICKET" | "CHAT";
242
+ agent: "CLAUDE" | "CODEX";
243
243
  model: string | null;
244
244
  effort: string | null;
245
245
  prompt: string;
@@ -286,10 +286,10 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
286
286
  baseSha?: string | undefined;
287
287
  } | undefined;
288
288
  }, {
289
- agent: "CLAUDE" | "CODEX";
290
- status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
291
289
  id: string;
290
+ status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
292
291
  kind: "TICKET" | "CHAT";
292
+ agent: "CLAUDE" | "CODEX";
293
293
  prompt: string;
294
294
  providerSessionId: string | null;
295
295
  workspace: {
@@ -316,7 +316,7 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
316
316
  url: string;
317
317
  token: string;
318
318
  } | undefined;
319
- mode?: "ask" | "plan" | "auto" | "full" | undefined;
319
+ mode?: "plan" | "ask" | "auto" | "full" | undefined;
320
320
  workMode?: unknown;
321
321
  model?: string | null | undefined;
322
322
  effort?: string | null | undefined;
@@ -385,8 +385,8 @@ export declare const QuestionAnswerArgsSchema: z.ZodObject<{
385
385
  }>, "many">>;
386
386
  readonly text: z.ZodOptional<z.ZodString>;
387
387
  }, "strip", z.ZodTypeAny, {
388
- askId: string;
389
388
  action: "answer" | "discuss";
389
+ askId: string;
390
390
  text?: string | undefined;
391
391
  answers?: {
392
392
  values: string[];
@@ -395,8 +395,8 @@ export declare const QuestionAnswerArgsSchema: z.ZodObject<{
395
395
  notes?: string | undefined;
396
396
  }[] | undefined;
397
397
  }, {
398
- askId: string;
399
398
  action: "answer" | "discuss";
399
+ askId: string;
400
400
  text?: string | undefined;
401
401
  answers?: {
402
402
  values: string[];
@@ -685,11 +685,11 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
685
685
  token: string;
686
686
  }>>;
687
687
  }, "strip", z.ZodTypeAny, {
688
- mode: "ask" | "plan" | "auto" | "full";
689
- agent: "CLAUDE" | "CODEX";
690
- status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
688
+ mode: "plan" | "ask" | "auto" | "full";
691
689
  id: string;
690
+ status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
692
691
  kind: "TICKET" | "CHAT";
692
+ agent: "CLAUDE" | "CODEX";
693
693
  model: string | null;
694
694
  effort: string | null;
695
695
  prompt: string;
@@ -736,10 +736,10 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
736
736
  baseSha?: string | undefined;
737
737
  } | undefined;
738
738
  }, {
739
- agent: "CLAUDE" | "CODEX";
740
- status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
741
739
  id: string;
740
+ status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
742
741
  kind: "TICKET" | "CHAT";
742
+ agent: "CLAUDE" | "CODEX";
743
743
  prompt: string;
744
744
  providerSessionId: string | null;
745
745
  workspace: {
@@ -766,7 +766,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
766
766
  url: string;
767
767
  token: string;
768
768
  } | undefined;
769
- mode?: "ask" | "plan" | "auto" | "full" | undefined;
769
+ mode?: "plan" | "ask" | "auto" | "full" | undefined;
770
770
  workMode?: unknown;
771
771
  model?: string | null | undefined;
772
772
  effort?: string | null | undefined;
@@ -785,11 +785,11 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
785
785
  }, "strip", z.ZodTypeAny, {
786
786
  type: "hello_ack";
787
787
  sessions: {
788
- mode: "ask" | "plan" | "auto" | "full";
789
- agent: "CLAUDE" | "CODEX";
790
- status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
788
+ mode: "plan" | "ask" | "auto" | "full";
791
789
  id: string;
790
+ status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
792
791
  kind: "TICKET" | "CHAT";
792
+ agent: "CLAUDE" | "CODEX";
793
793
  model: string | null;
794
794
  effort: string | null;
795
795
  prompt: string;
@@ -842,10 +842,10 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
842
842
  }, {
843
843
  type: "hello_ack";
844
844
  sessions: {
845
- agent: "CLAUDE" | "CODEX";
846
- status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
847
845
  id: string;
846
+ status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
848
847
  kind: "TICKET" | "CHAT";
848
+ agent: "CLAUDE" | "CODEX";
849
849
  prompt: string;
850
850
  providerSessionId: string | null;
851
851
  workspace: {
@@ -872,7 +872,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
872
872
  url: string;
873
873
  token: string;
874
874
  } | undefined;
875
- mode?: "ask" | "plan" | "auto" | "full" | undefined;
875
+ mode?: "plan" | "ask" | "auto" | "full" | undefined;
876
876
  workMode?: unknown;
877
877
  model?: string | null | undefined;
878
878
  effort?: string | null | undefined;
@@ -1154,11 +1154,11 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
1154
1154
  token: string;
1155
1155
  }>>;
1156
1156
  }, "strip", z.ZodTypeAny, {
1157
- mode: "ask" | "plan" | "auto" | "full";
1158
- agent: "CLAUDE" | "CODEX";
1159
- status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
1157
+ mode: "plan" | "ask" | "auto" | "full";
1160
1158
  id: string;
1159
+ status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
1161
1160
  kind: "TICKET" | "CHAT";
1161
+ agent: "CLAUDE" | "CODEX";
1162
1162
  model: string | null;
1163
1163
  effort: string | null;
1164
1164
  prompt: string;
@@ -1205,10 +1205,10 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
1205
1205
  baseSha?: string | undefined;
1206
1206
  } | undefined;
1207
1207
  }, {
1208
- agent: "CLAUDE" | "CODEX";
1209
- status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
1210
1208
  id: string;
1209
+ status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
1211
1210
  kind: "TICKET" | "CHAT";
1211
+ agent: "CLAUDE" | "CODEX";
1212
1212
  prompt: string;
1213
1213
  providerSessionId: string | null;
1214
1214
  workspace: {
@@ -1235,7 +1235,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
1235
1235
  url: string;
1236
1236
  token: string;
1237
1237
  } | undefined;
1238
- mode?: "ask" | "plan" | "auto" | "full" | undefined;
1238
+ mode?: "plan" | "ask" | "auto" | "full" | undefined;
1239
1239
  workMode?: unknown;
1240
1240
  model?: string | null | undefined;
1241
1241
  effort?: string | null | undefined;
@@ -1253,11 +1253,11 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
1253
1253
  }>;
1254
1254
  }, "strip", z.ZodTypeAny, {
1255
1255
  session: {
1256
- mode: "ask" | "plan" | "auto" | "full";
1257
- agent: "CLAUDE" | "CODEX";
1258
- status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
1256
+ mode: "plan" | "ask" | "auto" | "full";
1259
1257
  id: string;
1258
+ status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
1260
1259
  kind: "TICKET" | "CHAT";
1260
+ agent: "CLAUDE" | "CODEX";
1261
1261
  model: string | null;
1262
1262
  effort: string | null;
1263
1263
  prompt: string;
@@ -1307,10 +1307,10 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
1307
1307
  type: "session_start";
1308
1308
  }, {
1309
1309
  session: {
1310
- agent: "CLAUDE" | "CODEX";
1311
- status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
1312
1310
  id: string;
1311
+ status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
1313
1312
  kind: "TICKET" | "CHAT";
1313
+ agent: "CLAUDE" | "CODEX";
1314
1314
  prompt: string;
1315
1315
  providerSessionId: string | null;
1316
1316
  workspace: {
@@ -1337,7 +1337,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
1337
1337
  url: string;
1338
1338
  token: string;
1339
1339
  } | undefined;
1340
- mode?: "ask" | "plan" | "auto" | "full" | undefined;
1340
+ mode?: "plan" | "ask" | "auto" | "full" | undefined;
1341
1341
  workMode?: unknown;
1342
1342
  model?: string | null | undefined;
1343
1343
  effort?: string | null | undefined;
@@ -1440,8 +1440,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
1440
1440
  }, "strip", z.ZodTypeAny, {
1441
1441
  sessionId: string;
1442
1442
  type: "question_answer";
1443
- askId: string;
1444
1443
  action: "answer" | "discuss";
1444
+ askId: string;
1445
1445
  text?: string | undefined;
1446
1446
  answers?: {
1447
1447
  values: string[];
@@ -1452,8 +1452,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
1452
1452
  }, {
1453
1453
  sessionId: string;
1454
1454
  type: "question_answer";
1455
- askId: string;
1456
1455
  action: "answer" | "discuss";
1456
+ askId: string;
1457
1457
  text?: string | undefined;
1458
1458
  answers?: {
1459
1459
  values: string[];
@@ -1513,8 +1513,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
1513
1513
  }, "strip", z.ZodTypeAny, {
1514
1514
  type: "workspace_settings";
1515
1515
  workspaceId: string;
1516
- agentAutoCommit?: boolean | undefined;
1517
1516
  trustMode?: "STRICT" | "NORMAL" | "AUTO" | undefined;
1517
+ agentAutoCommit?: boolean | undefined;
1518
1518
  agentPushBan?: boolean | undefined;
1519
1519
  agentProtectedBranches?: string[] | undefined;
1520
1520
  agentAllowForcePush?: boolean | undefined;
@@ -1523,8 +1523,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
1523
1523
  }, {
1524
1524
  type: "workspace_settings";
1525
1525
  workspaceId: string;
1526
- agentAutoCommit?: boolean | undefined;
1527
1526
  trustMode?: "STRICT" | "NORMAL" | "AUTO" | undefined;
1527
+ agentAutoCommit?: boolean | undefined;
1528
1528
  agentPushBan?: boolean | undefined;
1529
1529
  agentProtectedBranches?: string[] | undefined;
1530
1530
  agentAllowForcePush?: boolean | undefined;
@@ -1539,13 +1539,13 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
1539
1539
  }, "strip", z.ZodTypeAny, {
1540
1540
  sessionId: string;
1541
1541
  type: "session_settings";
1542
- mode?: "ask" | "plan" | "auto" | "full" | undefined;
1542
+ mode?: "plan" | "ask" | "auto" | "full" | undefined;
1543
1543
  model?: string | undefined;
1544
1544
  effort?: string | null | undefined;
1545
1545
  }, {
1546
1546
  sessionId: string;
1547
1547
  type: "session_settings";
1548
- mode?: "ask" | "plan" | "auto" | "full" | undefined;
1548
+ mode?: "plan" | "ask" | "auto" | "full" | undefined;
1549
1549
  model?: string | undefined;
1550
1550
  effort?: string | null | undefined;
1551
1551
  }>, z.ZodObject<{
package/dist/protocol.js CHANGED
@@ -430,7 +430,9 @@ export const GatewayFrameSchema = z.discriminatedUnion('type', [
430
430
  // git_branches, update_from_base, git_push, git_refs, workspace_state,
431
431
  // recipe_state, verify_start, verify_status, verify_cancel,
432
432
  // preview_checkout, preview_stop, propose_commit_message, git_stage,
433
- // git_unstage, git_discard, git_pull, git_merge_abort, fs_publish.
433
+ // git_unstage, git_discard, git_pull, git_merge_abort, fs_publish,
434
+ // agent_accounts, agent_account_login_start, agent_account_login_code,
435
+ // agent_account_activate, agent_account_forget (#422).
434
436
  name: z.string().min(1).max(64),
435
437
  workspaceId: z.string().optional(),
436
438
  sessionId: z.string().optional(),
@@ -300,6 +300,13 @@ export declare function sanitizeCageId(id: string): string;
300
300
  * normal case and the marker appears only while the old scope is still there.
301
301
  */
302
302
  export declare function sessionScopeUnit(id: string, attempt?: number): string;
303
+ /**
304
+ * Is there a cgroup by this unit's name — that is, processes still in it?
305
+ *
306
+ * `dirOf` is the test seam: the answer depends on a cgroup tree, and a suite
307
+ * has none. Everything else about this function is one `stat`.
308
+ */
309
+ export declare function cageCgroupExists(unit: string, dirOf?: (unit: string) => string | null): boolean;
303
310
  /**
304
311
  * The systemd release that added `--expand-environment=`.
305
312
  *
@@ -433,6 +440,16 @@ export declare function buildCagedSpawn(input: {
433
440
  id: string;
434
441
  command: string;
435
442
  args: string[];
443
+ },
444
+ /**
445
+ * The two things this function does to the machine besides building a command
446
+ * line, as seams (#431): whether a cage of that name still exists, and what to
447
+ * do about it. A suite has neither a cgroup tree nor a systemd to answer.
448
+ */
449
+ io?: {
450
+ cageExists?: (unit: string) => boolean;
451
+ cageLiveness?: (unit: string) => ScopeLiveness;
452
+ stopCage?: (unit: string) => void;
436
453
  }): CagedSpawn;
437
454
  /**
438
455
  * Did this process die in the window before `systemd-run` handed over?
@@ -628,6 +645,23 @@ export declare function markScopeOomKillsSeen(id: string, oomKills: number): voi
628
645
  * thing and must not word it differently.
629
646
  */
630
647
  export declare function stoppedProcesses(count: number, where?: 'it' | 'this one'): string;
648
+ /**
649
+ * What the feed says when the runner takes a session's cage down with itself
650
+ * (#431).
651
+ *
652
+ * Next to {@link stoppedProcesses} and for the same reason: two places that
653
+ * count the same thing must not word it differently. This one counts COMMANDS,
654
+ * because that is what a person can act on — «7 processes» is the same build
655
+ * said in a way nobody can use.
656
+ *
657
+ * The middle sentence is the part that matters. A command that outlives the
658
+ * process which started it cannot hand its output back to anybody: the pipe
659
+ * died with the agent, and the agent that comes back is a different process
660
+ * with a different tool call. Stopping it is not a loss, it is the refusal to
661
+ * keep a zombie — but the person has to be told, or they will wait for a build
662
+ * that nobody is going to report.
663
+ */
664
+ export declare function restartStoppedCommands(count: number): string;
631
665
  /**
632
666
  * Snapshot the cgroup's verdict before systemd can take it away.
633
667
  *
@@ -669,6 +703,21 @@ export declare function releaseSessionScope(unit: string | null, id?: string, sy
669
703
  * worth nothing, and a hung `systemctl` must not hold a failing session open.
670
704
  */
671
705
  export declare function memoryDeathSentence(id: string, capMs?: number): Promise<string | null>;
706
+ /**
707
+ * Stop a cage and let systemd forget its name — the other half of killing the
708
+ * agent (#431, грабля §524).
709
+ *
710
+ * {@link releaseSessionScope} is the path for a process that ENDED: it reads
711
+ * the verdict first and only stops what is left. This one is for the two
712
+ * moments where there is nothing to read and no time to read it — the daemon
713
+ * going down, and a start that found its own name still taken. It asks for the
714
+ * stop and nothing else.
715
+ *
716
+ * Worth knowing on the shutdown path: once `stop` has been accepted, the job
717
+ * belongs to systemd. A caller that gives up waiting still gets the cage
718
+ * stopped — it simply does not get to see it happen.
719
+ */
720
+ export declare function stopSessionScope(unit: string | null, systemctl?: Systemctl): Promise<boolean>;
672
721
  /** Unit names of every `devbridge-session-*.scope` systemd still knows about. */
673
722
  export declare function listSessionScopeUnits(systemctl?: Systemctl): Promise<string[]>;
674
723
  export interface SessionScopeInfo {