@bridge4dev/runner 0.29.0 → 0.31.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/dist/adapters/claude.js +257 -8
- package/dist/adapters/codex.js +93 -4
- package/dist/adapters/types.d.ts +64 -3
- package/dist/adapters/types.js +31 -0
- package/dist/agent-prompt.d.ts +75 -0
- package/dist/agent-prompt.js +252 -0
- package/dist/index.js +10 -0
- package/dist/policy.d.ts +61 -0
- package/dist/policy.js +56 -6
- package/dist/protocol.d.ts +92 -12
- package/dist/protocol.js +18 -0
- package/dist/supervisor.d.ts +33 -1
- package/dist/supervisor.js +221 -5
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/protocol.d.ts
CHANGED
|
@@ -26,6 +26,18 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
26
26
|
* every project the moment a runner updated ahead of its API.
|
|
27
27
|
*/
|
|
28
28
|
agentAutoCommit: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
/**
|
|
30
|
+
* The project's own prompt file, relative to `path` — its contents reach
|
|
31
|
+
* the agent as SYSTEM-prompt text (see `agent-prompt.ts` for why the level
|
|
32
|
+
* matters).
|
|
33
|
+
*
|
|
34
|
+
* `.catch(undefined)` for the same reason as `branchHint` and `branchPlan`:
|
|
35
|
+
* this field travels inside `hello_ack`, which carries EVERY session of the
|
|
36
|
+
* server, so a malformed value must cost its own session's prompt at most —
|
|
37
|
+
* never the frame (QA-100 MAJOR-1). The runner re-validates the path from
|
|
38
|
+
* scratch anyway; the bounds here only keep nonsense off the wire.
|
|
39
|
+
*/
|
|
40
|
+
agentPromptPath: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
29
41
|
budgetUsd: z.ZodNullable<z.ZodNumber>;
|
|
30
42
|
budgetMinutes: z.ZodNullable<z.ZodNumber>;
|
|
31
43
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -36,6 +48,7 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
36
48
|
budgetUsd: number | null;
|
|
37
49
|
budgetMinutes: number | null;
|
|
38
50
|
agentAutoCommit?: boolean | undefined;
|
|
51
|
+
agentPromptPath?: string | null | undefined;
|
|
39
52
|
}, {
|
|
40
53
|
id: string;
|
|
41
54
|
path: string;
|
|
@@ -44,7 +57,14 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
44
57
|
budgetUsd: number | null;
|
|
45
58
|
budgetMinutes: number | null;
|
|
46
59
|
agentAutoCommit?: boolean | undefined;
|
|
60
|
+
agentPromptPath?: unknown;
|
|
47
61
|
}>;
|
|
62
|
+
/**
|
|
63
|
+
* «Run this one without the project's agent prompt.» Absent means no — both
|
|
64
|
+
* because an older API never sends it and because that is the default a human
|
|
65
|
+
* gets when they do not touch the checkbox.
|
|
66
|
+
*/
|
|
67
|
+
skipAgentPrompt: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
48
68
|
tickets: z.ZodArray<z.ZodObject<{
|
|
49
69
|
id: z.ZodString;
|
|
50
70
|
number: z.ZodNumber;
|
|
@@ -119,8 +139,8 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
119
139
|
}>>;
|
|
120
140
|
}, "strip", z.ZodTypeAny, {
|
|
121
141
|
mode: "ask" | "plan" | "auto" | "full";
|
|
122
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
123
142
|
id: string;
|
|
143
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
124
144
|
agent: "CLAUDE" | "CODEX";
|
|
125
145
|
kind: "TICKET" | "CHAT";
|
|
126
146
|
model: string | null;
|
|
@@ -140,6 +160,7 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
140
160
|
budgetUsd: number | null;
|
|
141
161
|
budgetMinutes: number | null;
|
|
142
162
|
agentAutoCommit?: boolean | undefined;
|
|
163
|
+
agentPromptPath?: string | null | undefined;
|
|
143
164
|
};
|
|
144
165
|
tickets: {
|
|
145
166
|
number: number;
|
|
@@ -150,6 +171,7 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
150
171
|
url: string;
|
|
151
172
|
token: string;
|
|
152
173
|
} | undefined;
|
|
174
|
+
skipAgentPrompt?: boolean | undefined;
|
|
153
175
|
branchHint?: string | undefined;
|
|
154
176
|
branchPlan?: {
|
|
155
177
|
branch: string;
|
|
@@ -159,8 +181,8 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
159
181
|
} | undefined;
|
|
160
182
|
workMode?: "DIRECT" | "BRANCH" | undefined;
|
|
161
183
|
}, {
|
|
162
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
163
184
|
id: string;
|
|
185
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
164
186
|
agent: "CLAUDE" | "CODEX";
|
|
165
187
|
kind: "TICKET" | "CHAT";
|
|
166
188
|
prompt: string;
|
|
@@ -173,6 +195,7 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
173
195
|
budgetUsd: number | null;
|
|
174
196
|
budgetMinutes: number | null;
|
|
175
197
|
agentAutoCommit?: boolean | undefined;
|
|
198
|
+
agentPromptPath?: unknown;
|
|
176
199
|
};
|
|
177
200
|
tickets: {
|
|
178
201
|
number: number;
|
|
@@ -191,6 +214,7 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
191
214
|
costUsd?: number | undefined;
|
|
192
215
|
activeMsBase?: number | undefined;
|
|
193
216
|
extraBudgetMinutes?: number | null | undefined;
|
|
217
|
+
skipAgentPrompt?: unknown;
|
|
194
218
|
branchHint?: unknown;
|
|
195
219
|
branchPlan?: unknown;
|
|
196
220
|
workMode?: unknown;
|
|
@@ -228,6 +252,18 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
228
252
|
* every project the moment a runner updated ahead of its API.
|
|
229
253
|
*/
|
|
230
254
|
agentAutoCommit: z.ZodOptional<z.ZodBoolean>;
|
|
255
|
+
/**
|
|
256
|
+
* The project's own prompt file, relative to `path` — its contents reach
|
|
257
|
+
* the agent as SYSTEM-prompt text (see `agent-prompt.ts` for why the level
|
|
258
|
+
* matters).
|
|
259
|
+
*
|
|
260
|
+
* `.catch(undefined)` for the same reason as `branchHint` and `branchPlan`:
|
|
261
|
+
* this field travels inside `hello_ack`, which carries EVERY session of the
|
|
262
|
+
* server, so a malformed value must cost its own session's prompt at most —
|
|
263
|
+
* never the frame (QA-100 MAJOR-1). The runner re-validates the path from
|
|
264
|
+
* scratch anyway; the bounds here only keep nonsense off the wire.
|
|
265
|
+
*/
|
|
266
|
+
agentPromptPath: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
231
267
|
budgetUsd: z.ZodNullable<z.ZodNumber>;
|
|
232
268
|
budgetMinutes: z.ZodNullable<z.ZodNumber>;
|
|
233
269
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -238,6 +274,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
238
274
|
budgetUsd: number | null;
|
|
239
275
|
budgetMinutes: number | null;
|
|
240
276
|
agentAutoCommit?: boolean | undefined;
|
|
277
|
+
agentPromptPath?: string | null | undefined;
|
|
241
278
|
}, {
|
|
242
279
|
id: string;
|
|
243
280
|
path: string;
|
|
@@ -246,7 +283,14 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
246
283
|
budgetUsd: number | null;
|
|
247
284
|
budgetMinutes: number | null;
|
|
248
285
|
agentAutoCommit?: boolean | undefined;
|
|
286
|
+
agentPromptPath?: unknown;
|
|
249
287
|
}>;
|
|
288
|
+
/**
|
|
289
|
+
* «Run this one without the project's agent prompt.» Absent means no — both
|
|
290
|
+
* because an older API never sends it and because that is the default a human
|
|
291
|
+
* gets when they do not touch the checkbox.
|
|
292
|
+
*/
|
|
293
|
+
skipAgentPrompt: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
250
294
|
tickets: z.ZodArray<z.ZodObject<{
|
|
251
295
|
id: z.ZodString;
|
|
252
296
|
number: z.ZodNumber;
|
|
@@ -321,8 +365,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
321
365
|
}>>;
|
|
322
366
|
}, "strip", z.ZodTypeAny, {
|
|
323
367
|
mode: "ask" | "plan" | "auto" | "full";
|
|
324
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
325
368
|
id: string;
|
|
369
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
326
370
|
agent: "CLAUDE" | "CODEX";
|
|
327
371
|
kind: "TICKET" | "CHAT";
|
|
328
372
|
model: string | null;
|
|
@@ -342,6 +386,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
342
386
|
budgetUsd: number | null;
|
|
343
387
|
budgetMinutes: number | null;
|
|
344
388
|
agentAutoCommit?: boolean | undefined;
|
|
389
|
+
agentPromptPath?: string | null | undefined;
|
|
345
390
|
};
|
|
346
391
|
tickets: {
|
|
347
392
|
number: number;
|
|
@@ -352,6 +397,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
352
397
|
url: string;
|
|
353
398
|
token: string;
|
|
354
399
|
} | undefined;
|
|
400
|
+
skipAgentPrompt?: boolean | undefined;
|
|
355
401
|
branchHint?: string | undefined;
|
|
356
402
|
branchPlan?: {
|
|
357
403
|
branch: string;
|
|
@@ -361,8 +407,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
361
407
|
} | undefined;
|
|
362
408
|
workMode?: "DIRECT" | "BRANCH" | undefined;
|
|
363
409
|
}, {
|
|
364
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
365
410
|
id: string;
|
|
411
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
366
412
|
agent: "CLAUDE" | "CODEX";
|
|
367
413
|
kind: "TICKET" | "CHAT";
|
|
368
414
|
prompt: string;
|
|
@@ -375,6 +421,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
375
421
|
budgetUsd: number | null;
|
|
376
422
|
budgetMinutes: number | null;
|
|
377
423
|
agentAutoCommit?: boolean | undefined;
|
|
424
|
+
agentPromptPath?: unknown;
|
|
378
425
|
};
|
|
379
426
|
tickets: {
|
|
380
427
|
number: number;
|
|
@@ -393,6 +440,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
393
440
|
costUsd?: number | undefined;
|
|
394
441
|
activeMsBase?: number | undefined;
|
|
395
442
|
extraBudgetMinutes?: number | null | undefined;
|
|
443
|
+
skipAgentPrompt?: unknown;
|
|
396
444
|
branchHint?: unknown;
|
|
397
445
|
branchPlan?: unknown;
|
|
398
446
|
workMode?: unknown;
|
|
@@ -403,8 +451,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
403
451
|
serverId: string;
|
|
404
452
|
sessions: {
|
|
405
453
|
mode: "ask" | "plan" | "auto" | "full";
|
|
406
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
407
454
|
id: string;
|
|
455
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
408
456
|
agent: "CLAUDE" | "CODEX";
|
|
409
457
|
kind: "TICKET" | "CHAT";
|
|
410
458
|
model: string | null;
|
|
@@ -424,6 +472,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
424
472
|
budgetUsd: number | null;
|
|
425
473
|
budgetMinutes: number | null;
|
|
426
474
|
agentAutoCommit?: boolean | undefined;
|
|
475
|
+
agentPromptPath?: string | null | undefined;
|
|
427
476
|
};
|
|
428
477
|
tickets: {
|
|
429
478
|
number: number;
|
|
@@ -434,6 +483,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
434
483
|
url: string;
|
|
435
484
|
token: string;
|
|
436
485
|
} | undefined;
|
|
486
|
+
skipAgentPrompt?: boolean | undefined;
|
|
437
487
|
branchHint?: string | undefined;
|
|
438
488
|
branchPlan?: {
|
|
439
489
|
branch: string;
|
|
@@ -449,8 +499,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
449
499
|
serverName: string;
|
|
450
500
|
serverId: string;
|
|
451
501
|
sessions: {
|
|
452
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
453
502
|
id: string;
|
|
503
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
454
504
|
agent: "CLAUDE" | "CODEX";
|
|
455
505
|
kind: "TICKET" | "CHAT";
|
|
456
506
|
prompt: string;
|
|
@@ -463,6 +513,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
463
513
|
budgetUsd: number | null;
|
|
464
514
|
budgetMinutes: number | null;
|
|
465
515
|
agentAutoCommit?: boolean | undefined;
|
|
516
|
+
agentPromptPath?: unknown;
|
|
466
517
|
};
|
|
467
518
|
tickets: {
|
|
468
519
|
number: number;
|
|
@@ -481,6 +532,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
481
532
|
costUsd?: number | undefined;
|
|
482
533
|
activeMsBase?: number | undefined;
|
|
483
534
|
extraBudgetMinutes?: number | null | undefined;
|
|
535
|
+
skipAgentPrompt?: unknown;
|
|
484
536
|
branchHint?: unknown;
|
|
485
537
|
branchPlan?: unknown;
|
|
486
538
|
workMode?: unknown;
|
|
@@ -542,6 +594,18 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
542
594
|
* every project the moment a runner updated ahead of its API.
|
|
543
595
|
*/
|
|
544
596
|
agentAutoCommit: z.ZodOptional<z.ZodBoolean>;
|
|
597
|
+
/**
|
|
598
|
+
* The project's own prompt file, relative to `path` — its contents reach
|
|
599
|
+
* the agent as SYSTEM-prompt text (see `agent-prompt.ts` for why the level
|
|
600
|
+
* matters).
|
|
601
|
+
*
|
|
602
|
+
* `.catch(undefined)` for the same reason as `branchHint` and `branchPlan`:
|
|
603
|
+
* this field travels inside `hello_ack`, which carries EVERY session of the
|
|
604
|
+
* server, so a malformed value must cost its own session's prompt at most —
|
|
605
|
+
* never the frame (QA-100 MAJOR-1). The runner re-validates the path from
|
|
606
|
+
* scratch anyway; the bounds here only keep nonsense off the wire.
|
|
607
|
+
*/
|
|
608
|
+
agentPromptPath: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
545
609
|
budgetUsd: z.ZodNullable<z.ZodNumber>;
|
|
546
610
|
budgetMinutes: z.ZodNullable<z.ZodNumber>;
|
|
547
611
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -552,6 +616,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
552
616
|
budgetUsd: number | null;
|
|
553
617
|
budgetMinutes: number | null;
|
|
554
618
|
agentAutoCommit?: boolean | undefined;
|
|
619
|
+
agentPromptPath?: string | null | undefined;
|
|
555
620
|
}, {
|
|
556
621
|
id: string;
|
|
557
622
|
path: string;
|
|
@@ -560,7 +625,14 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
560
625
|
budgetUsd: number | null;
|
|
561
626
|
budgetMinutes: number | null;
|
|
562
627
|
agentAutoCommit?: boolean | undefined;
|
|
628
|
+
agentPromptPath?: unknown;
|
|
563
629
|
}>;
|
|
630
|
+
/**
|
|
631
|
+
* «Run this one without the project's agent prompt.» Absent means no — both
|
|
632
|
+
* because an older API never sends it and because that is the default a human
|
|
633
|
+
* gets when they do not touch the checkbox.
|
|
634
|
+
*/
|
|
635
|
+
skipAgentPrompt: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
564
636
|
tickets: z.ZodArray<z.ZodObject<{
|
|
565
637
|
id: z.ZodString;
|
|
566
638
|
number: z.ZodNumber;
|
|
@@ -635,8 +707,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
635
707
|
}>>;
|
|
636
708
|
}, "strip", z.ZodTypeAny, {
|
|
637
709
|
mode: "ask" | "plan" | "auto" | "full";
|
|
638
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
639
710
|
id: string;
|
|
711
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
640
712
|
agent: "CLAUDE" | "CODEX";
|
|
641
713
|
kind: "TICKET" | "CHAT";
|
|
642
714
|
model: string | null;
|
|
@@ -656,6 +728,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
656
728
|
budgetUsd: number | null;
|
|
657
729
|
budgetMinutes: number | null;
|
|
658
730
|
agentAutoCommit?: boolean | undefined;
|
|
731
|
+
agentPromptPath?: string | null | undefined;
|
|
659
732
|
};
|
|
660
733
|
tickets: {
|
|
661
734
|
number: number;
|
|
@@ -666,6 +739,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
666
739
|
url: string;
|
|
667
740
|
token: string;
|
|
668
741
|
} | undefined;
|
|
742
|
+
skipAgentPrompt?: boolean | undefined;
|
|
669
743
|
branchHint?: string | undefined;
|
|
670
744
|
branchPlan?: {
|
|
671
745
|
branch: string;
|
|
@@ -675,8 +749,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
675
749
|
} | undefined;
|
|
676
750
|
workMode?: "DIRECT" | "BRANCH" | undefined;
|
|
677
751
|
}, {
|
|
678
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
679
752
|
id: string;
|
|
753
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
680
754
|
agent: "CLAUDE" | "CODEX";
|
|
681
755
|
kind: "TICKET" | "CHAT";
|
|
682
756
|
prompt: string;
|
|
@@ -689,6 +763,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
689
763
|
budgetUsd: number | null;
|
|
690
764
|
budgetMinutes: number | null;
|
|
691
765
|
agentAutoCommit?: boolean | undefined;
|
|
766
|
+
agentPromptPath?: unknown;
|
|
692
767
|
};
|
|
693
768
|
tickets: {
|
|
694
769
|
number: number;
|
|
@@ -707,6 +782,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
707
782
|
costUsd?: number | undefined;
|
|
708
783
|
activeMsBase?: number | undefined;
|
|
709
784
|
extraBudgetMinutes?: number | null | undefined;
|
|
785
|
+
skipAgentPrompt?: unknown;
|
|
710
786
|
branchHint?: unknown;
|
|
711
787
|
branchPlan?: unknown;
|
|
712
788
|
workMode?: unknown;
|
|
@@ -715,8 +791,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
715
791
|
type: "session_start";
|
|
716
792
|
session: {
|
|
717
793
|
mode: "ask" | "plan" | "auto" | "full";
|
|
718
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
719
794
|
id: string;
|
|
795
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
720
796
|
agent: "CLAUDE" | "CODEX";
|
|
721
797
|
kind: "TICKET" | "CHAT";
|
|
722
798
|
model: string | null;
|
|
@@ -736,6 +812,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
736
812
|
budgetUsd: number | null;
|
|
737
813
|
budgetMinutes: number | null;
|
|
738
814
|
agentAutoCommit?: boolean | undefined;
|
|
815
|
+
agentPromptPath?: string | null | undefined;
|
|
739
816
|
};
|
|
740
817
|
tickets: {
|
|
741
818
|
number: number;
|
|
@@ -746,6 +823,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
746
823
|
url: string;
|
|
747
824
|
token: string;
|
|
748
825
|
} | undefined;
|
|
826
|
+
skipAgentPrompt?: boolean | undefined;
|
|
749
827
|
branchHint?: string | undefined;
|
|
750
828
|
branchPlan?: {
|
|
751
829
|
branch: string;
|
|
@@ -758,8 +836,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
758
836
|
}, {
|
|
759
837
|
type: "session_start";
|
|
760
838
|
session: {
|
|
761
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
762
839
|
id: string;
|
|
840
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
763
841
|
agent: "CLAUDE" | "CODEX";
|
|
764
842
|
kind: "TICKET" | "CHAT";
|
|
765
843
|
prompt: string;
|
|
@@ -772,6 +850,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
772
850
|
budgetUsd: number | null;
|
|
773
851
|
budgetMinutes: number | null;
|
|
774
852
|
agentAutoCommit?: boolean | undefined;
|
|
853
|
+
agentPromptPath?: unknown;
|
|
775
854
|
};
|
|
776
855
|
tickets: {
|
|
777
856
|
number: number;
|
|
@@ -790,6 +869,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
790
869
|
costUsd?: number | undefined;
|
|
791
870
|
activeMsBase?: number | undefined;
|
|
792
871
|
extraBudgetMinutes?: number | null | undefined;
|
|
872
|
+
skipAgentPrompt?: unknown;
|
|
793
873
|
branchHint?: unknown;
|
|
794
874
|
branchPlan?: unknown;
|
|
795
875
|
workMode?: unknown;
|
|
@@ -815,9 +895,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
815
895
|
fileSize: number;
|
|
816
896
|
}>, "many">>>;
|
|
817
897
|
}, "strip", z.ZodTypeAny, {
|
|
898
|
+
text: string;
|
|
818
899
|
sessionId: string;
|
|
819
900
|
type: "session_message";
|
|
820
|
-
text: string;
|
|
821
901
|
attachments?: {
|
|
822
902
|
id: string;
|
|
823
903
|
fileName: string;
|
|
@@ -825,9 +905,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
825
905
|
fileSize: number;
|
|
826
906
|
}[] | undefined;
|
|
827
907
|
}, {
|
|
908
|
+
text: string;
|
|
828
909
|
sessionId: string;
|
|
829
910
|
type: "session_message";
|
|
830
|
-
text: string;
|
|
831
911
|
attachments?: unknown;
|
|
832
912
|
}>, z.ZodObject<{
|
|
833
913
|
type: z.ZodLiteral<"permission_answer">;
|
package/dist/protocol.js
CHANGED
|
@@ -52,9 +52,27 @@ export const SessionDescriptorSchema = z.object({
|
|
|
52
52
|
* every project the moment a runner updated ahead of its API.
|
|
53
53
|
*/
|
|
54
54
|
agentAutoCommit: z.boolean().optional(),
|
|
55
|
+
/**
|
|
56
|
+
* The project's own prompt file, relative to `path` — its contents reach
|
|
57
|
+
* the agent as SYSTEM-prompt text (see `agent-prompt.ts` for why the level
|
|
58
|
+
* matters).
|
|
59
|
+
*
|
|
60
|
+
* `.catch(undefined)` for the same reason as `branchHint` and `branchPlan`:
|
|
61
|
+
* this field travels inside `hello_ack`, which carries EVERY session of the
|
|
62
|
+
* server, so a malformed value must cost its own session's prompt at most —
|
|
63
|
+
* never the frame (QA-100 MAJOR-1). The runner re-validates the path from
|
|
64
|
+
* scratch anyway; the bounds here only keep nonsense off the wire.
|
|
65
|
+
*/
|
|
66
|
+
agentPromptPath: z.string().max(300).nullable().optional().catch(undefined),
|
|
55
67
|
budgetUsd: z.number().nullable(),
|
|
56
68
|
budgetMinutes: z.number().nullable(),
|
|
57
69
|
}),
|
|
70
|
+
/**
|
|
71
|
+
* «Run this one without the project's agent prompt.» Absent means no — both
|
|
72
|
+
* because an older API never sends it and because that is the default a human
|
|
73
|
+
* gets when they do not touch the checkbox.
|
|
74
|
+
*/
|
|
75
|
+
skipAgentPrompt: z.boolean().optional().catch(undefined),
|
|
58
76
|
tickets: z.array(z.object({ id: z.string().uuid(), number: z.number(), title: z.string() })),
|
|
59
77
|
// Branch the API would like this session to use (derived from its ticket
|
|
60
78
|
// group). Optional: an older API omits it and the runner keeps its
|
package/dist/supervisor.d.ts
CHANGED
|
@@ -118,6 +118,26 @@ export declare class Supervisor {
|
|
|
118
118
|
* stay queued rather than be marked delivered (session 9).
|
|
119
119
|
*/
|
|
120
120
|
private launchAgent;
|
|
121
|
+
/**
|
|
122
|
+
* The project's own prompt file, read fresh for THIS agent process.
|
|
123
|
+
*
|
|
124
|
+
* Read per launch rather than per session on purpose: a system prompt only
|
|
125
|
+
* ever changes when the process restarts, so «edit the file, then press
|
|
126
|
+
* Continue» is the honest contract, and re-reading is what makes it true.
|
|
127
|
+
*
|
|
128
|
+
* Every outcome is said out loud. The whole point of moving the project's
|
|
129
|
+
* rules into the system prompt is that they can no longer be quietly
|
|
130
|
+
* outranked — so «the prompt did not load» must never be indistinguishable
|
|
131
|
+
* from «the prompt loaded». Supervisor notices repeat on every launch (only
|
|
132
|
+
* ADAPTER notices are de-duplicated — gotcha #148), which is exactly what is
|
|
133
|
+
* wanted here: each agent process either has the prompt or does not.
|
|
134
|
+
*
|
|
135
|
+
* Returns the text AND the absolute file, because layer 1 needs the second to
|
|
136
|
+
* refuse writes to it: in `workMode: DIRECT` the project folder is the
|
|
137
|
+
* agent's own working directory, so without that rule a session could rewrite
|
|
138
|
+
* the prompt it will itself be started with next time (QA-130 MAJOR-3).
|
|
139
|
+
*/
|
|
140
|
+
private resolveAgentPrompt;
|
|
121
141
|
/** Warn the user when this share of the budget is gone. */
|
|
122
142
|
private static readonly BUDGET_WARN_RATIO;
|
|
123
143
|
/** Is the agent actually working right now (i.e. should the clock run)? */
|
|
@@ -317,6 +337,10 @@ export declare class Supervisor {
|
|
|
317
337
|
private interruptSession;
|
|
318
338
|
/** Live model / interaction-mode switch (persisted for the next relaunch). */
|
|
319
339
|
private applySettings;
|
|
340
|
+
/** Is a turn (or a question the agent is parked on) in flight right now? */
|
|
341
|
+
private isMidTurn;
|
|
342
|
+
/** The three live setters, in the order that lets an explicit pick win. */
|
|
343
|
+
private applyLiveSettings;
|
|
320
344
|
private stopSession;
|
|
321
345
|
private reconcile;
|
|
322
346
|
/**
|
|
@@ -404,6 +428,14 @@ export declare function composeInitialPrompt(descriptor: SessionDescriptor): str
|
|
|
404
428
|
* A repository that wants both agents equipped ships both files, or symlinks
|
|
405
429
|
* one to the other. That is a repository convention and not something a runner
|
|
406
430
|
* should paper over.
|
|
431
|
+
*
|
|
432
|
+
* `agentPrompt` is the one exception, and it is an exception for a reason this
|
|
433
|
+
* function cannot do anything about: `CLAUDE.md` and `AGENTS.md` arrive at the
|
|
434
|
+
* USER level, and a project's standing process rules have to sit at the system
|
|
435
|
+
* level to survive both a compaction and a rule the CLI states about itself
|
|
436
|
+
* (`agent-prompt.ts`). It arrives here already read and already checked — this
|
|
437
|
+
* function still opens no files — and it goes LAST, so a project overrides us
|
|
438
|
+
* exactly the way `CLAUDE.md` does by being read last.
|
|
407
439
|
*/
|
|
408
|
-
export declare function composeWorkspaceContext(descriptor: SessionDescriptor): string;
|
|
440
|
+
export declare function composeWorkspaceContext(descriptor: SessionDescriptor, agentPrompt?: string): string;
|
|
409
441
|
//# sourceMappingURL=supervisor.d.ts.map
|