@bridge4dev/runner 0.46.1 → 0.47.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 +44 -2
- package/dist/adapters/claude.js +6 -2
- package/dist/agent-auto-update.d.ts +75 -0
- package/dist/agent-auto-update.js +134 -0
- package/dist/agent-binary.d.ts +48 -0
- package/dist/agent-binary.js +55 -0
- package/dist/agent-cleanup.d.ts +78 -0
- package/dist/agent-cleanup.js +184 -0
- package/dist/agent-install.d.ts +140 -0
- package/dist/agent-install.js +475 -0
- package/dist/agent-registry.d.ts +223 -0
- package/dist/agent-registry.js +131 -0
- package/dist/agent-versions.d.ts +93 -0
- package/dist/agent-versions.js +157 -0
- package/dist/auth-relay.d.ts +9 -1
- package/dist/auth-relay.js +3 -1
- package/dist/commit-message.js +5 -0
- package/dist/config.d.ts +44 -4
- package/dist/config.js +43 -0
- package/dist/index.js +46 -12
- package/dist/protocol.d.ts +155 -28
- package/dist/protocol.js +33 -1
- package/dist/recipe-schema.d.ts +12 -12
- package/dist/self-update.d.ts +14 -0
- package/dist/self-update.js +45 -13
- package/dist/supervisor.d.ts +155 -2
- package/dist/supervisor.js +393 -8
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/protocol.d.ts
CHANGED
|
@@ -30,6 +30,31 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
30
30
|
* behaviour every runner had before this release.
|
|
31
31
|
*/
|
|
32
32
|
pausedUntil: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
33
|
+
/**
|
|
34
|
+
* The newest published version of THIS session's agent — Р13, §4.8.
|
|
35
|
+
*
|
|
36
|
+
* The API sends it only when the machine's «Auto-update agents» switch is on,
|
|
37
|
+
* so **the absence of this field is the off position**. That is why the switch
|
|
38
|
+
* needs no frame, no acknowledgement and no capability handshake: a runner
|
|
39
|
+
* older than 0.47.0 drops the field (this schema is not `.strict()`), and a
|
|
40
|
+
* runner that is told nothing does nothing.
|
|
41
|
+
*
|
|
42
|
+
* Never a package name, a URL or a command — only a version, and only for the
|
|
43
|
+
* agent this session is starting. Everything about WHAT gets installed comes
|
|
44
|
+
* from the registry compiled into this build (§6).
|
|
45
|
+
*
|
|
46
|
+
* `.catch(undefined)` like its neighbours: this rides inside `hello_ack`,
|
|
47
|
+
* which carries every session of the server, so one malformed value must cost
|
|
48
|
+
* its own session at most — and here «cost» means «no auto-update», the
|
|
49
|
+
* behaviour of every runner shipped before this one.
|
|
50
|
+
*
|
|
51
|
+
* The version pattern is stated HERE as well as inside `installAgent`, and the
|
|
52
|
+
* duplication is the point: §6 says the server may pick the version and
|
|
53
|
+
* nothing else, so the boundary that first reads the value is the boundary
|
|
54
|
+
* that should refuse anything which is not a plain `x.y.z`. Anything else
|
|
55
|
+
* arrives as `undefined`, which is the same as «auto-update is off».
|
|
56
|
+
*/
|
|
57
|
+
agentLatestVersion: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
33
58
|
workspace: z.ZodObject<{
|
|
34
59
|
id: z.ZodString;
|
|
35
60
|
path: z.ZodString;
|
|
@@ -75,9 +100,9 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
75
100
|
budgetUsd: z.ZodNullable<z.ZodNumber>;
|
|
76
101
|
budgetMinutes: z.ZodNullable<z.ZodNumber>;
|
|
77
102
|
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
path: string;
|
|
78
104
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
79
105
|
id: string;
|
|
80
|
-
path: string;
|
|
81
106
|
projectId: string;
|
|
82
107
|
budgetUsd: number | null;
|
|
83
108
|
budgetMinutes: number | null;
|
|
@@ -88,9 +113,9 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
88
113
|
agentAllowForcePush?: boolean | undefined;
|
|
89
114
|
agentAllowDestructiveGit?: boolean | undefined;
|
|
90
115
|
}, {
|
|
116
|
+
path: string;
|
|
91
117
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
92
118
|
id: string;
|
|
93
|
-
path: string;
|
|
94
119
|
projectId: string;
|
|
95
120
|
budgetUsd: number | null;
|
|
96
121
|
budgetMinutes: number | null;
|
|
@@ -181,9 +206,9 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
181
206
|
}>>;
|
|
182
207
|
}, "strip", z.ZodTypeAny, {
|
|
183
208
|
mode: "ask" | "plan" | "auto" | "full";
|
|
209
|
+
agent: "CLAUDE" | "CODEX";
|
|
184
210
|
id: string;
|
|
185
211
|
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
186
|
-
agent: "CLAUDE" | "CODEX";
|
|
187
212
|
kind: "TICKET" | "CHAT";
|
|
188
213
|
model: string | null;
|
|
189
214
|
effort: string | null;
|
|
@@ -195,9 +220,9 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
195
220
|
activeMsBase: number;
|
|
196
221
|
extraBudgetMinutes: number | null;
|
|
197
222
|
workspace: {
|
|
223
|
+
path: string;
|
|
198
224
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
199
225
|
id: string;
|
|
200
|
-
path: string;
|
|
201
226
|
projectId: string;
|
|
202
227
|
budgetUsd: number | null;
|
|
203
228
|
budgetMinutes: number | null;
|
|
@@ -218,6 +243,7 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
218
243
|
token: string;
|
|
219
244
|
} | undefined;
|
|
220
245
|
pausedUntil?: string | null | undefined;
|
|
246
|
+
agentLatestVersion?: string | undefined;
|
|
221
247
|
skipAgentPrompt?: boolean | undefined;
|
|
222
248
|
branchHint?: string | undefined;
|
|
223
249
|
branchPlan?: {
|
|
@@ -228,16 +254,16 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
228
254
|
} | undefined;
|
|
229
255
|
workMode?: "DIRECT" | "BRANCH" | undefined;
|
|
230
256
|
}, {
|
|
257
|
+
agent: "CLAUDE" | "CODEX";
|
|
231
258
|
id: string;
|
|
232
259
|
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
233
|
-
agent: "CLAUDE" | "CODEX";
|
|
234
260
|
kind: "TICKET" | "CHAT";
|
|
235
261
|
prompt: string;
|
|
236
262
|
providerSessionId: string | null;
|
|
237
263
|
workspace: {
|
|
264
|
+
path: string;
|
|
238
265
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
239
266
|
id: string;
|
|
240
|
-
path: string;
|
|
241
267
|
projectId: string;
|
|
242
268
|
budgetUsd: number | null;
|
|
243
269
|
budgetMinutes: number | null;
|
|
@@ -266,6 +292,7 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
266
292
|
activeMsBase?: number | undefined;
|
|
267
293
|
extraBudgetMinutes?: number | null | undefined;
|
|
268
294
|
pausedUntil?: unknown;
|
|
295
|
+
agentLatestVersion?: unknown;
|
|
269
296
|
skipAgentPrompt?: unknown;
|
|
270
297
|
branchHint?: unknown;
|
|
271
298
|
branchPlan?: unknown;
|
|
@@ -421,6 +448,31 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
421
448
|
* behaviour every runner had before this release.
|
|
422
449
|
*/
|
|
423
450
|
pausedUntil: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
451
|
+
/**
|
|
452
|
+
* The newest published version of THIS session's agent — Р13, §4.8.
|
|
453
|
+
*
|
|
454
|
+
* The API sends it only when the machine's «Auto-update agents» switch is on,
|
|
455
|
+
* so **the absence of this field is the off position**. That is why the switch
|
|
456
|
+
* needs no frame, no acknowledgement and no capability handshake: a runner
|
|
457
|
+
* older than 0.47.0 drops the field (this schema is not `.strict()`), and a
|
|
458
|
+
* runner that is told nothing does nothing.
|
|
459
|
+
*
|
|
460
|
+
* Never a package name, a URL or a command — only a version, and only for the
|
|
461
|
+
* agent this session is starting. Everything about WHAT gets installed comes
|
|
462
|
+
* from the registry compiled into this build (§6).
|
|
463
|
+
*
|
|
464
|
+
* `.catch(undefined)` like its neighbours: this rides inside `hello_ack`,
|
|
465
|
+
* which carries every session of the server, so one malformed value must cost
|
|
466
|
+
* its own session at most — and here «cost» means «no auto-update», the
|
|
467
|
+
* behaviour of every runner shipped before this one.
|
|
468
|
+
*
|
|
469
|
+
* The version pattern is stated HERE as well as inside `installAgent`, and the
|
|
470
|
+
* duplication is the point: §6 says the server may pick the version and
|
|
471
|
+
* nothing else, so the boundary that first reads the value is the boundary
|
|
472
|
+
* that should refuse anything which is not a plain `x.y.z`. Anything else
|
|
473
|
+
* arrives as `undefined`, which is the same as «auto-update is off».
|
|
474
|
+
*/
|
|
475
|
+
agentLatestVersion: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
424
476
|
workspace: z.ZodObject<{
|
|
425
477
|
id: z.ZodString;
|
|
426
478
|
path: z.ZodString;
|
|
@@ -466,9 +518,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
466
518
|
budgetUsd: z.ZodNullable<z.ZodNumber>;
|
|
467
519
|
budgetMinutes: z.ZodNullable<z.ZodNumber>;
|
|
468
520
|
}, "strip", z.ZodTypeAny, {
|
|
521
|
+
path: string;
|
|
469
522
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
470
523
|
id: string;
|
|
471
|
-
path: string;
|
|
472
524
|
projectId: string;
|
|
473
525
|
budgetUsd: number | null;
|
|
474
526
|
budgetMinutes: number | null;
|
|
@@ -479,9 +531,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
479
531
|
agentAllowForcePush?: boolean | undefined;
|
|
480
532
|
agentAllowDestructiveGit?: boolean | undefined;
|
|
481
533
|
}, {
|
|
534
|
+
path: string;
|
|
482
535
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
483
536
|
id: string;
|
|
484
|
-
path: string;
|
|
485
537
|
projectId: string;
|
|
486
538
|
budgetUsd: number | null;
|
|
487
539
|
budgetMinutes: number | null;
|
|
@@ -572,9 +624,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
572
624
|
}>>;
|
|
573
625
|
}, "strip", z.ZodTypeAny, {
|
|
574
626
|
mode: "ask" | "plan" | "auto" | "full";
|
|
627
|
+
agent: "CLAUDE" | "CODEX";
|
|
575
628
|
id: string;
|
|
576
629
|
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
577
|
-
agent: "CLAUDE" | "CODEX";
|
|
578
630
|
kind: "TICKET" | "CHAT";
|
|
579
631
|
model: string | null;
|
|
580
632
|
effort: string | null;
|
|
@@ -586,9 +638,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
586
638
|
activeMsBase: number;
|
|
587
639
|
extraBudgetMinutes: number | null;
|
|
588
640
|
workspace: {
|
|
641
|
+
path: string;
|
|
589
642
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
590
643
|
id: string;
|
|
591
|
-
path: string;
|
|
592
644
|
projectId: string;
|
|
593
645
|
budgetUsd: number | null;
|
|
594
646
|
budgetMinutes: number | null;
|
|
@@ -609,6 +661,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
609
661
|
token: string;
|
|
610
662
|
} | undefined;
|
|
611
663
|
pausedUntil?: string | null | undefined;
|
|
664
|
+
agentLatestVersion?: string | undefined;
|
|
612
665
|
skipAgentPrompt?: boolean | undefined;
|
|
613
666
|
branchHint?: string | undefined;
|
|
614
667
|
branchPlan?: {
|
|
@@ -619,16 +672,16 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
619
672
|
} | undefined;
|
|
620
673
|
workMode?: "DIRECT" | "BRANCH" | undefined;
|
|
621
674
|
}, {
|
|
675
|
+
agent: "CLAUDE" | "CODEX";
|
|
622
676
|
id: string;
|
|
623
677
|
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
624
|
-
agent: "CLAUDE" | "CODEX";
|
|
625
678
|
kind: "TICKET" | "CHAT";
|
|
626
679
|
prompt: string;
|
|
627
680
|
providerSessionId: string | null;
|
|
628
681
|
workspace: {
|
|
682
|
+
path: string;
|
|
629
683
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
630
684
|
id: string;
|
|
631
|
-
path: string;
|
|
632
685
|
projectId: string;
|
|
633
686
|
budgetUsd: number | null;
|
|
634
687
|
budgetMinutes: number | null;
|
|
@@ -657,6 +710,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
657
710
|
activeMsBase?: number | undefined;
|
|
658
711
|
extraBudgetMinutes?: number | null | undefined;
|
|
659
712
|
pausedUntil?: unknown;
|
|
713
|
+
agentLatestVersion?: unknown;
|
|
660
714
|
skipAgentPrompt?: unknown;
|
|
661
715
|
branchHint?: unknown;
|
|
662
716
|
branchPlan?: unknown;
|
|
@@ -668,9 +722,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
668
722
|
serverId: string;
|
|
669
723
|
sessions: {
|
|
670
724
|
mode: "ask" | "plan" | "auto" | "full";
|
|
725
|
+
agent: "CLAUDE" | "CODEX";
|
|
671
726
|
id: string;
|
|
672
727
|
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
673
|
-
agent: "CLAUDE" | "CODEX";
|
|
674
728
|
kind: "TICKET" | "CHAT";
|
|
675
729
|
model: string | null;
|
|
676
730
|
effort: string | null;
|
|
@@ -682,9 +736,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
682
736
|
activeMsBase: number;
|
|
683
737
|
extraBudgetMinutes: number | null;
|
|
684
738
|
workspace: {
|
|
739
|
+
path: string;
|
|
685
740
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
686
741
|
id: string;
|
|
687
|
-
path: string;
|
|
688
742
|
projectId: string;
|
|
689
743
|
budgetUsd: number | null;
|
|
690
744
|
budgetMinutes: number | null;
|
|
@@ -705,6 +759,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
705
759
|
token: string;
|
|
706
760
|
} | undefined;
|
|
707
761
|
pausedUntil?: string | null | undefined;
|
|
762
|
+
agentLatestVersion?: string | undefined;
|
|
708
763
|
skipAgentPrompt?: boolean | undefined;
|
|
709
764
|
branchHint?: string | undefined;
|
|
710
765
|
branchPlan?: {
|
|
@@ -721,16 +776,16 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
721
776
|
serverName: string;
|
|
722
777
|
serverId: string;
|
|
723
778
|
sessions: {
|
|
779
|
+
agent: "CLAUDE" | "CODEX";
|
|
724
780
|
id: string;
|
|
725
781
|
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
726
|
-
agent: "CLAUDE" | "CODEX";
|
|
727
782
|
kind: "TICKET" | "CHAT";
|
|
728
783
|
prompt: string;
|
|
729
784
|
providerSessionId: string | null;
|
|
730
785
|
workspace: {
|
|
786
|
+
path: string;
|
|
731
787
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
732
788
|
id: string;
|
|
733
|
-
path: string;
|
|
734
789
|
projectId: string;
|
|
735
790
|
budgetUsd: number | null;
|
|
736
791
|
budgetMinutes: number | null;
|
|
@@ -759,6 +814,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
759
814
|
activeMsBase?: number | undefined;
|
|
760
815
|
extraBudgetMinutes?: number | null | undefined;
|
|
761
816
|
pausedUntil?: unknown;
|
|
817
|
+
agentLatestVersion?: unknown;
|
|
762
818
|
skipAgentPrompt?: unknown;
|
|
763
819
|
branchHint?: unknown;
|
|
764
820
|
branchPlan?: unknown;
|
|
@@ -825,6 +881,31 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
825
881
|
* behaviour every runner had before this release.
|
|
826
882
|
*/
|
|
827
883
|
pausedUntil: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
884
|
+
/**
|
|
885
|
+
* The newest published version of THIS session's agent — Р13, §4.8.
|
|
886
|
+
*
|
|
887
|
+
* The API sends it only when the machine's «Auto-update agents» switch is on,
|
|
888
|
+
* so **the absence of this field is the off position**. That is why the switch
|
|
889
|
+
* needs no frame, no acknowledgement and no capability handshake: a runner
|
|
890
|
+
* older than 0.47.0 drops the field (this schema is not `.strict()`), and a
|
|
891
|
+
* runner that is told nothing does nothing.
|
|
892
|
+
*
|
|
893
|
+
* Never a package name, a URL or a command — only a version, and only for the
|
|
894
|
+
* agent this session is starting. Everything about WHAT gets installed comes
|
|
895
|
+
* from the registry compiled into this build (§6).
|
|
896
|
+
*
|
|
897
|
+
* `.catch(undefined)` like its neighbours: this rides inside `hello_ack`,
|
|
898
|
+
* which carries every session of the server, so one malformed value must cost
|
|
899
|
+
* its own session at most — and here «cost» means «no auto-update», the
|
|
900
|
+
* behaviour of every runner shipped before this one.
|
|
901
|
+
*
|
|
902
|
+
* The version pattern is stated HERE as well as inside `installAgent`, and the
|
|
903
|
+
* duplication is the point: §6 says the server may pick the version and
|
|
904
|
+
* nothing else, so the boundary that first reads the value is the boundary
|
|
905
|
+
* that should refuse anything which is not a plain `x.y.z`. Anything else
|
|
906
|
+
* arrives as `undefined`, which is the same as «auto-update is off».
|
|
907
|
+
*/
|
|
908
|
+
agentLatestVersion: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
828
909
|
workspace: z.ZodObject<{
|
|
829
910
|
id: z.ZodString;
|
|
830
911
|
path: z.ZodString;
|
|
@@ -870,9 +951,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
870
951
|
budgetUsd: z.ZodNullable<z.ZodNumber>;
|
|
871
952
|
budgetMinutes: z.ZodNullable<z.ZodNumber>;
|
|
872
953
|
}, "strip", z.ZodTypeAny, {
|
|
954
|
+
path: string;
|
|
873
955
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
874
956
|
id: string;
|
|
875
|
-
path: string;
|
|
876
957
|
projectId: string;
|
|
877
958
|
budgetUsd: number | null;
|
|
878
959
|
budgetMinutes: number | null;
|
|
@@ -883,9 +964,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
883
964
|
agentAllowForcePush?: boolean | undefined;
|
|
884
965
|
agentAllowDestructiveGit?: boolean | undefined;
|
|
885
966
|
}, {
|
|
967
|
+
path: string;
|
|
886
968
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
887
969
|
id: string;
|
|
888
|
-
path: string;
|
|
889
970
|
projectId: string;
|
|
890
971
|
budgetUsd: number | null;
|
|
891
972
|
budgetMinutes: number | null;
|
|
@@ -976,9 +1057,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
976
1057
|
}>>;
|
|
977
1058
|
}, "strip", z.ZodTypeAny, {
|
|
978
1059
|
mode: "ask" | "plan" | "auto" | "full";
|
|
1060
|
+
agent: "CLAUDE" | "CODEX";
|
|
979
1061
|
id: string;
|
|
980
1062
|
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
981
|
-
agent: "CLAUDE" | "CODEX";
|
|
982
1063
|
kind: "TICKET" | "CHAT";
|
|
983
1064
|
model: string | null;
|
|
984
1065
|
effort: string | null;
|
|
@@ -990,9 +1071,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
990
1071
|
activeMsBase: number;
|
|
991
1072
|
extraBudgetMinutes: number | null;
|
|
992
1073
|
workspace: {
|
|
1074
|
+
path: string;
|
|
993
1075
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
994
1076
|
id: string;
|
|
995
|
-
path: string;
|
|
996
1077
|
projectId: string;
|
|
997
1078
|
budgetUsd: number | null;
|
|
998
1079
|
budgetMinutes: number | null;
|
|
@@ -1013,6 +1094,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
1013
1094
|
token: string;
|
|
1014
1095
|
} | undefined;
|
|
1015
1096
|
pausedUntil?: string | null | undefined;
|
|
1097
|
+
agentLatestVersion?: string | undefined;
|
|
1016
1098
|
skipAgentPrompt?: boolean | undefined;
|
|
1017
1099
|
branchHint?: string | undefined;
|
|
1018
1100
|
branchPlan?: {
|
|
@@ -1023,16 +1105,16 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
1023
1105
|
} | undefined;
|
|
1024
1106
|
workMode?: "DIRECT" | "BRANCH" | undefined;
|
|
1025
1107
|
}, {
|
|
1108
|
+
agent: "CLAUDE" | "CODEX";
|
|
1026
1109
|
id: string;
|
|
1027
1110
|
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
1028
|
-
agent: "CLAUDE" | "CODEX";
|
|
1029
1111
|
kind: "TICKET" | "CHAT";
|
|
1030
1112
|
prompt: string;
|
|
1031
1113
|
providerSessionId: string | null;
|
|
1032
1114
|
workspace: {
|
|
1115
|
+
path: string;
|
|
1033
1116
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
1034
1117
|
id: string;
|
|
1035
|
-
path: string;
|
|
1036
1118
|
projectId: string;
|
|
1037
1119
|
budgetUsd: number | null;
|
|
1038
1120
|
budgetMinutes: number | null;
|
|
@@ -1061,6 +1143,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
1061
1143
|
activeMsBase?: number | undefined;
|
|
1062
1144
|
extraBudgetMinutes?: number | null | undefined;
|
|
1063
1145
|
pausedUntil?: unknown;
|
|
1146
|
+
agentLatestVersion?: unknown;
|
|
1064
1147
|
skipAgentPrompt?: unknown;
|
|
1065
1148
|
branchHint?: unknown;
|
|
1066
1149
|
branchPlan?: unknown;
|
|
@@ -1070,9 +1153,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
1070
1153
|
type: "session_start";
|
|
1071
1154
|
session: {
|
|
1072
1155
|
mode: "ask" | "plan" | "auto" | "full";
|
|
1156
|
+
agent: "CLAUDE" | "CODEX";
|
|
1073
1157
|
id: string;
|
|
1074
1158
|
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
1075
|
-
agent: "CLAUDE" | "CODEX";
|
|
1076
1159
|
kind: "TICKET" | "CHAT";
|
|
1077
1160
|
model: string | null;
|
|
1078
1161
|
effort: string | null;
|
|
@@ -1084,9 +1167,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
1084
1167
|
activeMsBase: number;
|
|
1085
1168
|
extraBudgetMinutes: number | null;
|
|
1086
1169
|
workspace: {
|
|
1170
|
+
path: string;
|
|
1087
1171
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
1088
1172
|
id: string;
|
|
1089
|
-
path: string;
|
|
1090
1173
|
projectId: string;
|
|
1091
1174
|
budgetUsd: number | null;
|
|
1092
1175
|
budgetMinutes: number | null;
|
|
@@ -1107,6 +1190,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
1107
1190
|
token: string;
|
|
1108
1191
|
} | undefined;
|
|
1109
1192
|
pausedUntil?: string | null | undefined;
|
|
1193
|
+
agentLatestVersion?: string | undefined;
|
|
1110
1194
|
skipAgentPrompt?: boolean | undefined;
|
|
1111
1195
|
branchHint?: string | undefined;
|
|
1112
1196
|
branchPlan?: {
|
|
@@ -1120,16 +1204,16 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
1120
1204
|
}, {
|
|
1121
1205
|
type: "session_start";
|
|
1122
1206
|
session: {
|
|
1207
|
+
agent: "CLAUDE" | "CODEX";
|
|
1123
1208
|
id: string;
|
|
1124
1209
|
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
1125
|
-
agent: "CLAUDE" | "CODEX";
|
|
1126
1210
|
kind: "TICKET" | "CHAT";
|
|
1127
1211
|
prompt: string;
|
|
1128
1212
|
providerSessionId: string | null;
|
|
1129
1213
|
workspace: {
|
|
1214
|
+
path: string;
|
|
1130
1215
|
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
1131
1216
|
id: string;
|
|
1132
|
-
path: string;
|
|
1133
1217
|
projectId: string;
|
|
1134
1218
|
budgetUsd: number | null;
|
|
1135
1219
|
budgetMinutes: number | null;
|
|
@@ -1158,6 +1242,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
1158
1242
|
activeMsBase?: number | undefined;
|
|
1159
1243
|
extraBudgetMinutes?: number | null | undefined;
|
|
1160
1244
|
pausedUntil?: unknown;
|
|
1245
|
+
agentLatestVersion?: unknown;
|
|
1161
1246
|
skipAgentPrompt?: unknown;
|
|
1162
1247
|
branchHint?: unknown;
|
|
1163
1248
|
branchPlan?: unknown;
|
|
@@ -1365,16 +1450,16 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
1365
1450
|
name: string;
|
|
1366
1451
|
type: "command";
|
|
1367
1452
|
requestId: string;
|
|
1453
|
+
args?: Record<string, unknown> | undefined;
|
|
1368
1454
|
sessionId?: string | undefined;
|
|
1369
1455
|
workspaceId?: string | undefined;
|
|
1370
|
-
args?: Record<string, unknown> | undefined;
|
|
1371
1456
|
}, {
|
|
1372
1457
|
name: string;
|
|
1373
1458
|
type: "command";
|
|
1374
1459
|
requestId: string;
|
|
1460
|
+
args?: Record<string, unknown> | undefined;
|
|
1375
1461
|
sessionId?: string | undefined;
|
|
1376
1462
|
workspaceId?: string | undefined;
|
|
1377
|
-
args?: Record<string, unknown> | undefined;
|
|
1378
1463
|
}>, z.ZodObject<{
|
|
1379
1464
|
type: z.ZodLiteral<"verify_report_ack">;
|
|
1380
1465
|
runId: z.ZodString;
|
|
@@ -1524,6 +1609,48 @@ export type RunnerFrame = {
|
|
|
1524
1609
|
*/
|
|
1525
1610
|
blockingIds: string[];
|
|
1526
1611
|
maxSessions: number;
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1614
|
+
* Which agent CLIs this machine has, and which version of each (Р3, Р7).
|
|
1615
|
+
*
|
|
1616
|
+
* A frame of its own rather than a field of `hello`, and that is the whole
|
|
1617
|
+
* design decision: capabilities are computed once per process and replayed on
|
|
1618
|
+
* every reconnect (`ws-client.ts`), so a version put there would be frozen
|
|
1619
|
+
* at daemon start and would never move after an install. This frame is sent
|
|
1620
|
+
* after each `hello_ack`, after an install, and once an hour.
|
|
1621
|
+
*
|
|
1622
|
+
* It carries no package name, URL or command — only names from the registry
|
|
1623
|
+
* mirror and plain versions. The server is not the thing that knows how an
|
|
1624
|
+
* agent is installed; this runner is (§6 of the plan).
|
|
1625
|
+
*/
|
|
1626
|
+
| {
|
|
1627
|
+
type: 'agent_versions';
|
|
1628
|
+
/**
|
|
1629
|
+
* When the MACHINE measured this, ISO.
|
|
1630
|
+
*
|
|
1631
|
+
* Load-bearing: frames without a session id take the gateway's unordered
|
|
1632
|
+
* fast path, so two of these can be handled out of order. The API keeps
|
|
1633
|
+
* the newer measurement and drops the older one by this field.
|
|
1634
|
+
*/
|
|
1635
|
+
at: string;
|
|
1636
|
+
/** Why it was sent: a plain measurement, our button, or auto-update. */
|
|
1637
|
+
reason: 'measured' | 'manual' | 'auto';
|
|
1638
|
+
/**
|
|
1639
|
+
* Keyed by the registry's wire name. `version: null` = not installed;
|
|
1640
|
+
* `probeFailed` = the binary is there and would not answer, which is a
|
|
1641
|
+
* third state and must never be read as absence.
|
|
1642
|
+
*/
|
|
1643
|
+
agents: Record<string, {
|
|
1644
|
+
version: string | null;
|
|
1645
|
+
managedBy: string;
|
|
1646
|
+
probeFailed?: boolean;
|
|
1647
|
+
}>;
|
|
1648
|
+
/** What an install actually changed, for the audit trail (Р14). */
|
|
1649
|
+
changed?: {
|
|
1650
|
+
agent: string;
|
|
1651
|
+
from: string | null;
|
|
1652
|
+
to: string;
|
|
1653
|
+
};
|
|
1527
1654
|
} | {
|
|
1528
1655
|
type: 'pong';
|
|
1529
1656
|
};
|
package/dist/protocol.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { AGENT_DB_VALUES, AGENT_VERSION_PATTERN } from './agent-registry.js';
|
|
2
3
|
// Wire protocol with the DevBridge API (mirror of
|
|
3
4
|
// packages/api/src/modules/dev-orchestration/dev-orchestration.schema.ts —
|
|
4
5
|
// the API side is the source of truth).
|
|
5
6
|
export const SessionDescriptorSchema = z.object({
|
|
6
7
|
id: z.string().uuid(),
|
|
7
8
|
kind: z.enum(['TICKET', 'CHAT']),
|
|
8
|
-
|
|
9
|
+
// The agents this build has adapters for — from the registry mirror, so a
|
|
10
|
+
// list that grew in `@devbridge/shared` cannot be forgotten here (Р15).
|
|
11
|
+
agent: z.enum(AGENT_DB_VALUES),
|
|
9
12
|
status: z.enum([
|
|
10
13
|
'STARTING',
|
|
11
14
|
'RUNNING',
|
|
@@ -56,6 +59,35 @@ export const SessionDescriptorSchema = z.object({
|
|
|
56
59
|
* behaviour every runner had before this release.
|
|
57
60
|
*/
|
|
58
61
|
pausedUntil: z.string().max(40).nullable().optional().catch(undefined),
|
|
62
|
+
/**
|
|
63
|
+
* The newest published version of THIS session's agent — Р13, §4.8.
|
|
64
|
+
*
|
|
65
|
+
* The API sends it only when the machine's «Auto-update agents» switch is on,
|
|
66
|
+
* so **the absence of this field is the off position**. That is why the switch
|
|
67
|
+
* needs no frame, no acknowledgement and no capability handshake: a runner
|
|
68
|
+
* older than 0.47.0 drops the field (this schema is not `.strict()`), and a
|
|
69
|
+
* runner that is told nothing does nothing.
|
|
70
|
+
*
|
|
71
|
+
* Never a package name, a URL or a command — only a version, and only for the
|
|
72
|
+
* agent this session is starting. Everything about WHAT gets installed comes
|
|
73
|
+
* from the registry compiled into this build (§6).
|
|
74
|
+
*
|
|
75
|
+
* `.catch(undefined)` like its neighbours: this rides inside `hello_ack`,
|
|
76
|
+
* which carries every session of the server, so one malformed value must cost
|
|
77
|
+
* its own session at most — and here «cost» means «no auto-update», the
|
|
78
|
+
* behaviour of every runner shipped before this one.
|
|
79
|
+
*
|
|
80
|
+
* The version pattern is stated HERE as well as inside `installAgent`, and the
|
|
81
|
+
* duplication is the point: §6 says the server may pick the version and
|
|
82
|
+
* nothing else, so the boundary that first reads the value is the boundary
|
|
83
|
+
* that should refuse anything which is not a plain `x.y.z`. Anything else
|
|
84
|
+
* arrives as `undefined`, which is the same as «auto-update is off».
|
|
85
|
+
*/
|
|
86
|
+
agentLatestVersion: z
|
|
87
|
+
.string()
|
|
88
|
+
.regex(new RegExp(AGENT_VERSION_PATTERN))
|
|
89
|
+
.optional()
|
|
90
|
+
.catch(undefined),
|
|
59
91
|
workspace: z.object({
|
|
60
92
|
id: z.string().uuid(),
|
|
61
93
|
path: z.string(),
|
package/dist/recipe-schema.d.ts
CHANGED
|
@@ -129,17 +129,17 @@ export declare const ProjectRecipeSchema: z.ZodObject<{
|
|
|
129
129
|
timeoutSec?: number | undefined;
|
|
130
130
|
}>>;
|
|
131
131
|
}, "strip", z.ZodTypeAny, {
|
|
132
|
-
|
|
132
|
+
install?: {
|
|
133
133
|
run: string;
|
|
134
134
|
env?: Record<string, string> | undefined;
|
|
135
135
|
timeoutSec?: number | undefined;
|
|
136
136
|
} | undefined;
|
|
137
|
-
|
|
137
|
+
verify?: {
|
|
138
138
|
run: string;
|
|
139
139
|
env?: Record<string, string> | undefined;
|
|
140
140
|
timeoutSec?: number | undefined;
|
|
141
141
|
} | undefined;
|
|
142
|
-
|
|
142
|
+
build?: {
|
|
143
143
|
run: string;
|
|
144
144
|
env?: Record<string, string> | undefined;
|
|
145
145
|
timeoutSec?: number | undefined;
|
|
@@ -155,17 +155,17 @@ export declare const ProjectRecipeSchema: z.ZodObject<{
|
|
|
155
155
|
timeoutSec?: number | undefined;
|
|
156
156
|
} | undefined;
|
|
157
157
|
}, {
|
|
158
|
-
|
|
158
|
+
install?: {
|
|
159
159
|
run: string;
|
|
160
160
|
env?: Record<string, string> | undefined;
|
|
161
161
|
timeoutSec?: number | undefined;
|
|
162
162
|
} | undefined;
|
|
163
|
-
|
|
163
|
+
verify?: {
|
|
164
164
|
run: string;
|
|
165
165
|
env?: Record<string, string> | undefined;
|
|
166
166
|
timeoutSec?: number | undefined;
|
|
167
167
|
} | undefined;
|
|
168
|
-
|
|
168
|
+
build?: {
|
|
169
169
|
run: string;
|
|
170
170
|
env?: Record<string, string> | undefined;
|
|
171
171
|
timeoutSec?: number | undefined;
|
|
@@ -214,17 +214,17 @@ export declare const ProjectRecipeSchema: z.ZodObject<{
|
|
|
214
214
|
}, "strip", z.ZodTypeAny, {
|
|
215
215
|
version: 1;
|
|
216
216
|
steps: {
|
|
217
|
-
|
|
217
|
+
install?: {
|
|
218
218
|
run: string;
|
|
219
219
|
env?: Record<string, string> | undefined;
|
|
220
220
|
timeoutSec?: number | undefined;
|
|
221
221
|
} | undefined;
|
|
222
|
-
|
|
222
|
+
verify?: {
|
|
223
223
|
run: string;
|
|
224
224
|
env?: Record<string, string> | undefined;
|
|
225
225
|
timeoutSec?: number | undefined;
|
|
226
226
|
} | undefined;
|
|
227
|
-
|
|
227
|
+
build?: {
|
|
228
228
|
run: string;
|
|
229
229
|
env?: Record<string, string> | undefined;
|
|
230
230
|
timeoutSec?: number | undefined;
|
|
@@ -263,17 +263,17 @@ export declare const ProjectRecipeSchema: z.ZodObject<{
|
|
|
263
263
|
} | undefined;
|
|
264
264
|
notes?: string | undefined;
|
|
265
265
|
steps?: {
|
|
266
|
-
|
|
266
|
+
install?: {
|
|
267
267
|
run: string;
|
|
268
268
|
env?: Record<string, string> | undefined;
|
|
269
269
|
timeoutSec?: number | undefined;
|
|
270
270
|
} | undefined;
|
|
271
|
-
|
|
271
|
+
verify?: {
|
|
272
272
|
run: string;
|
|
273
273
|
env?: Record<string, string> | undefined;
|
|
274
274
|
timeoutSec?: number | undefined;
|
|
275
275
|
} | undefined;
|
|
276
|
-
|
|
276
|
+
build?: {
|
|
277
277
|
run: string;
|
|
278
278
|
env?: Record<string, string> | undefined;
|
|
279
279
|
timeoutSec?: number | undefined;
|
package/dist/self-update.d.ts
CHANGED
|
@@ -45,6 +45,12 @@ export interface SelfUpdateOptions {
|
|
|
45
45
|
packageDir?: string | null;
|
|
46
46
|
/** Test seam: is this process supervised (defaults to autodetect). */
|
|
47
47
|
supervised?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Test seam for C4: whether this build runs sessions on the Claude binary
|
|
50
|
+
* bundled with it. Both branches must be provable — the `false` one is what
|
|
51
|
+
* stops every future runner update from rolling itself back.
|
|
52
|
+
*/
|
|
53
|
+
bundledClaude?: boolean;
|
|
48
54
|
/**
|
|
49
55
|
* Test seam for the resource-limits drop-in. Injected rather than called
|
|
50
56
|
* directly because the real one writes into `$HOME` — a test that exercised
|
|
@@ -134,4 +140,12 @@ export declare function manualUpdateCommand(tarballUrl: string, options?: {
|
|
|
134
140
|
packageDir?: string | null;
|
|
135
141
|
}): string;
|
|
136
142
|
export declare function selfUpdate(options: SelfUpdateOptions): Promise<SelfUpdateOutcome>;
|
|
143
|
+
/**
|
|
144
|
+
* The same reading of a failed child process, for `agent-install.ts`.
|
|
145
|
+
*
|
|
146
|
+
* Exported rather than copied: installing an agent CLI shells out to the very
|
|
147
|
+
* same npm, and a second implementation would drift into reporting the ERESOLVE
|
|
148
|
+
* wall this one exists to suppress.
|
|
149
|
+
*/
|
|
150
|
+
export declare function describeCommandFailure(error: unknown): string;
|
|
137
151
|
//# sourceMappingURL=self-update.d.ts.map
|