@bridge4dev/runner 0.30.0 → 0.33.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 +162 -45
- package/dist/adapters/codex.js +42 -14
- package/dist/adapters/types.d.ts +25 -1
- package/dist/agent-prompt.d.ts +75 -0
- package/dist/agent-prompt.js +252 -0
- package/dist/index.js +23 -0
- package/dist/policy.d.ts +73 -1
- package/dist/policy.js +398 -53
- package/dist/protocol.d.ts +240 -30
- package/dist/protocol.js +56 -0
- package/dist/supervisor.d.ts +29 -1
- package/dist/supervisor.js +186 -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,25 +26,71 @@ 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>>>;
|
|
41
|
+
/**
|
|
42
|
+
* Session 18: the project's git policy for agents.
|
|
43
|
+
*
|
|
44
|
+
* `.optional().catch(undefined)` for the QA-100 MAJOR-1 reason above — this
|
|
45
|
+
* rides inside `hello_ack` with every session on the server, so a malformed
|
|
46
|
+
* value must cost its own session's policy at most, never the frame.
|
|
47
|
+
*
|
|
48
|
+
* «Costs its own session's policy» is safe here BECAUSE of the polarity in
|
|
49
|
+
* `policy.ts`: `agentPushBan` resolves `undefined` to «refuse», so a value
|
|
50
|
+
* this schema drops leaves the session strictly more restricted, never less.
|
|
51
|
+
* That property is the whole reason `.catch(undefined)` is acceptable on a
|
|
52
|
+
* security field, and it is why the resolution lives in exactly one
|
|
53
|
+
* function rather than at each point of use.
|
|
54
|
+
*/
|
|
55
|
+
agentPushBan: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
56
|
+
agentProtectedBranches: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
57
|
+
agentAllowForcePush: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
58
|
+
agentAllowDestructiveGit: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
29
59
|
budgetUsd: z.ZodNullable<z.ZodNumber>;
|
|
30
60
|
budgetMinutes: z.ZodNullable<z.ZodNumber>;
|
|
31
61
|
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
32
63
|
id: string;
|
|
33
64
|
path: string;
|
|
34
65
|
projectId: string;
|
|
35
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
36
66
|
budgetUsd: number | null;
|
|
37
67
|
budgetMinutes: number | null;
|
|
38
68
|
agentAutoCommit?: boolean | undefined;
|
|
69
|
+
agentPushBan?: boolean | undefined;
|
|
70
|
+
agentPromptPath?: string | null | undefined;
|
|
71
|
+
agentProtectedBranches?: string[] | undefined;
|
|
72
|
+
agentAllowForcePush?: boolean | undefined;
|
|
73
|
+
agentAllowDestructiveGit?: boolean | undefined;
|
|
39
74
|
}, {
|
|
75
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
40
76
|
id: string;
|
|
41
77
|
path: string;
|
|
42
78
|
projectId: string;
|
|
43
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
44
79
|
budgetUsd: number | null;
|
|
45
80
|
budgetMinutes: number | null;
|
|
46
81
|
agentAutoCommit?: boolean | undefined;
|
|
82
|
+
agentPushBan?: unknown;
|
|
83
|
+
agentPromptPath?: unknown;
|
|
84
|
+
agentProtectedBranches?: unknown;
|
|
85
|
+
agentAllowForcePush?: unknown;
|
|
86
|
+
agentAllowDestructiveGit?: unknown;
|
|
47
87
|
}>;
|
|
88
|
+
/**
|
|
89
|
+
* «Run this one without the project's agent prompt.» Absent means no — both
|
|
90
|
+
* because an older API never sends it and because that is the default a human
|
|
91
|
+
* gets when they do not touch the checkbox.
|
|
92
|
+
*/
|
|
93
|
+
skipAgentPrompt: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
48
94
|
tickets: z.ZodArray<z.ZodObject<{
|
|
49
95
|
id: z.ZodString;
|
|
50
96
|
number: z.ZodNumber;
|
|
@@ -119,8 +165,8 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
119
165
|
}>>;
|
|
120
166
|
}, "strip", z.ZodTypeAny, {
|
|
121
167
|
mode: "ask" | "plan" | "auto" | "full";
|
|
122
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
123
168
|
id: string;
|
|
169
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
124
170
|
agent: "CLAUDE" | "CODEX";
|
|
125
171
|
kind: "TICKET" | "CHAT";
|
|
126
172
|
model: string | null;
|
|
@@ -133,13 +179,18 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
133
179
|
activeMsBase: number;
|
|
134
180
|
extraBudgetMinutes: number | null;
|
|
135
181
|
workspace: {
|
|
182
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
136
183
|
id: string;
|
|
137
184
|
path: string;
|
|
138
185
|
projectId: string;
|
|
139
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
140
186
|
budgetUsd: number | null;
|
|
141
187
|
budgetMinutes: number | null;
|
|
142
188
|
agentAutoCommit?: boolean | undefined;
|
|
189
|
+
agentPushBan?: boolean | undefined;
|
|
190
|
+
agentPromptPath?: string | null | undefined;
|
|
191
|
+
agentProtectedBranches?: string[] | undefined;
|
|
192
|
+
agentAllowForcePush?: boolean | undefined;
|
|
193
|
+
agentAllowDestructiveGit?: boolean | undefined;
|
|
143
194
|
};
|
|
144
195
|
tickets: {
|
|
145
196
|
number: number;
|
|
@@ -150,6 +201,7 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
150
201
|
url: string;
|
|
151
202
|
token: string;
|
|
152
203
|
} | undefined;
|
|
204
|
+
skipAgentPrompt?: boolean | undefined;
|
|
153
205
|
branchHint?: string | undefined;
|
|
154
206
|
branchPlan?: {
|
|
155
207
|
branch: string;
|
|
@@ -159,20 +211,25 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
159
211
|
} | undefined;
|
|
160
212
|
workMode?: "DIRECT" | "BRANCH" | undefined;
|
|
161
213
|
}, {
|
|
162
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
163
214
|
id: string;
|
|
215
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
164
216
|
agent: "CLAUDE" | "CODEX";
|
|
165
217
|
kind: "TICKET" | "CHAT";
|
|
166
218
|
prompt: string;
|
|
167
219
|
providerSessionId: string | null;
|
|
168
220
|
workspace: {
|
|
221
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
169
222
|
id: string;
|
|
170
223
|
path: string;
|
|
171
224
|
projectId: string;
|
|
172
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
173
225
|
budgetUsd: number | null;
|
|
174
226
|
budgetMinutes: number | null;
|
|
175
227
|
agentAutoCommit?: boolean | undefined;
|
|
228
|
+
agentPushBan?: unknown;
|
|
229
|
+
agentPromptPath?: unknown;
|
|
230
|
+
agentProtectedBranches?: unknown;
|
|
231
|
+
agentAllowForcePush?: unknown;
|
|
232
|
+
agentAllowDestructiveGit?: unknown;
|
|
176
233
|
};
|
|
177
234
|
tickets: {
|
|
178
235
|
number: number;
|
|
@@ -191,6 +248,7 @@ export declare const SessionDescriptorSchema: z.ZodObject<{
|
|
|
191
248
|
costUsd?: number | undefined;
|
|
192
249
|
activeMsBase?: number | undefined;
|
|
193
250
|
extraBudgetMinutes?: number | null | undefined;
|
|
251
|
+
skipAgentPrompt?: unknown;
|
|
194
252
|
branchHint?: unknown;
|
|
195
253
|
branchPlan?: unknown;
|
|
196
254
|
workMode?: unknown;
|
|
@@ -228,25 +286,71 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
228
286
|
* every project the moment a runner updated ahead of its API.
|
|
229
287
|
*/
|
|
230
288
|
agentAutoCommit: z.ZodOptional<z.ZodBoolean>;
|
|
289
|
+
/**
|
|
290
|
+
* The project's own prompt file, relative to `path` — its contents reach
|
|
291
|
+
* the agent as SYSTEM-prompt text (see `agent-prompt.ts` for why the level
|
|
292
|
+
* matters).
|
|
293
|
+
*
|
|
294
|
+
* `.catch(undefined)` for the same reason as `branchHint` and `branchPlan`:
|
|
295
|
+
* this field travels inside `hello_ack`, which carries EVERY session of the
|
|
296
|
+
* server, so a malformed value must cost its own session's prompt at most —
|
|
297
|
+
* never the frame (QA-100 MAJOR-1). The runner re-validates the path from
|
|
298
|
+
* scratch anyway; the bounds here only keep nonsense off the wire.
|
|
299
|
+
*/
|
|
300
|
+
agentPromptPath: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
301
|
+
/**
|
|
302
|
+
* Session 18: the project's git policy for agents.
|
|
303
|
+
*
|
|
304
|
+
* `.optional().catch(undefined)` for the QA-100 MAJOR-1 reason above — this
|
|
305
|
+
* rides inside `hello_ack` with every session on the server, so a malformed
|
|
306
|
+
* value must cost its own session's policy at most, never the frame.
|
|
307
|
+
*
|
|
308
|
+
* «Costs its own session's policy» is safe here BECAUSE of the polarity in
|
|
309
|
+
* `policy.ts`: `agentPushBan` resolves `undefined` to «refuse», so a value
|
|
310
|
+
* this schema drops leaves the session strictly more restricted, never less.
|
|
311
|
+
* That property is the whole reason `.catch(undefined)` is acceptable on a
|
|
312
|
+
* security field, and it is why the resolution lives in exactly one
|
|
313
|
+
* function rather than at each point of use.
|
|
314
|
+
*/
|
|
315
|
+
agentPushBan: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
316
|
+
agentProtectedBranches: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
317
|
+
agentAllowForcePush: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
318
|
+
agentAllowDestructiveGit: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
231
319
|
budgetUsd: z.ZodNullable<z.ZodNumber>;
|
|
232
320
|
budgetMinutes: z.ZodNullable<z.ZodNumber>;
|
|
233
321
|
}, "strip", z.ZodTypeAny, {
|
|
322
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
234
323
|
id: string;
|
|
235
324
|
path: string;
|
|
236
325
|
projectId: string;
|
|
237
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
238
326
|
budgetUsd: number | null;
|
|
239
327
|
budgetMinutes: number | null;
|
|
240
328
|
agentAutoCommit?: boolean | undefined;
|
|
329
|
+
agentPushBan?: boolean | undefined;
|
|
330
|
+
agentPromptPath?: string | null | undefined;
|
|
331
|
+
agentProtectedBranches?: string[] | undefined;
|
|
332
|
+
agentAllowForcePush?: boolean | undefined;
|
|
333
|
+
agentAllowDestructiveGit?: boolean | undefined;
|
|
241
334
|
}, {
|
|
335
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
242
336
|
id: string;
|
|
243
337
|
path: string;
|
|
244
338
|
projectId: string;
|
|
245
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
246
339
|
budgetUsd: number | null;
|
|
247
340
|
budgetMinutes: number | null;
|
|
248
341
|
agentAutoCommit?: boolean | undefined;
|
|
342
|
+
agentPushBan?: unknown;
|
|
343
|
+
agentPromptPath?: unknown;
|
|
344
|
+
agentProtectedBranches?: unknown;
|
|
345
|
+
agentAllowForcePush?: unknown;
|
|
346
|
+
agentAllowDestructiveGit?: unknown;
|
|
249
347
|
}>;
|
|
348
|
+
/**
|
|
349
|
+
* «Run this one without the project's agent prompt.» Absent means no — both
|
|
350
|
+
* because an older API never sends it and because that is the default a human
|
|
351
|
+
* gets when they do not touch the checkbox.
|
|
352
|
+
*/
|
|
353
|
+
skipAgentPrompt: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
250
354
|
tickets: z.ZodArray<z.ZodObject<{
|
|
251
355
|
id: z.ZodString;
|
|
252
356
|
number: z.ZodNumber;
|
|
@@ -321,8 +425,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
321
425
|
}>>;
|
|
322
426
|
}, "strip", z.ZodTypeAny, {
|
|
323
427
|
mode: "ask" | "plan" | "auto" | "full";
|
|
324
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
325
428
|
id: string;
|
|
429
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
326
430
|
agent: "CLAUDE" | "CODEX";
|
|
327
431
|
kind: "TICKET" | "CHAT";
|
|
328
432
|
model: string | null;
|
|
@@ -335,13 +439,18 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
335
439
|
activeMsBase: number;
|
|
336
440
|
extraBudgetMinutes: number | null;
|
|
337
441
|
workspace: {
|
|
442
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
338
443
|
id: string;
|
|
339
444
|
path: string;
|
|
340
445
|
projectId: string;
|
|
341
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
342
446
|
budgetUsd: number | null;
|
|
343
447
|
budgetMinutes: number | null;
|
|
344
448
|
agentAutoCommit?: boolean | undefined;
|
|
449
|
+
agentPushBan?: boolean | undefined;
|
|
450
|
+
agentPromptPath?: string | null | undefined;
|
|
451
|
+
agentProtectedBranches?: string[] | undefined;
|
|
452
|
+
agentAllowForcePush?: boolean | undefined;
|
|
453
|
+
agentAllowDestructiveGit?: boolean | undefined;
|
|
345
454
|
};
|
|
346
455
|
tickets: {
|
|
347
456
|
number: number;
|
|
@@ -352,6 +461,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
352
461
|
url: string;
|
|
353
462
|
token: string;
|
|
354
463
|
} | undefined;
|
|
464
|
+
skipAgentPrompt?: boolean | undefined;
|
|
355
465
|
branchHint?: string | undefined;
|
|
356
466
|
branchPlan?: {
|
|
357
467
|
branch: string;
|
|
@@ -361,20 +471,25 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
361
471
|
} | undefined;
|
|
362
472
|
workMode?: "DIRECT" | "BRANCH" | undefined;
|
|
363
473
|
}, {
|
|
364
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
365
474
|
id: string;
|
|
475
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
366
476
|
agent: "CLAUDE" | "CODEX";
|
|
367
477
|
kind: "TICKET" | "CHAT";
|
|
368
478
|
prompt: string;
|
|
369
479
|
providerSessionId: string | null;
|
|
370
480
|
workspace: {
|
|
481
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
371
482
|
id: string;
|
|
372
483
|
path: string;
|
|
373
484
|
projectId: string;
|
|
374
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
375
485
|
budgetUsd: number | null;
|
|
376
486
|
budgetMinutes: number | null;
|
|
377
487
|
agentAutoCommit?: boolean | undefined;
|
|
488
|
+
agentPushBan?: unknown;
|
|
489
|
+
agentPromptPath?: unknown;
|
|
490
|
+
agentProtectedBranches?: unknown;
|
|
491
|
+
agentAllowForcePush?: unknown;
|
|
492
|
+
agentAllowDestructiveGit?: unknown;
|
|
378
493
|
};
|
|
379
494
|
tickets: {
|
|
380
495
|
number: number;
|
|
@@ -393,6 +508,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
393
508
|
costUsd?: number | undefined;
|
|
394
509
|
activeMsBase?: number | undefined;
|
|
395
510
|
extraBudgetMinutes?: number | null | undefined;
|
|
511
|
+
skipAgentPrompt?: unknown;
|
|
396
512
|
branchHint?: unknown;
|
|
397
513
|
branchPlan?: unknown;
|
|
398
514
|
workMode?: unknown;
|
|
@@ -403,8 +519,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
403
519
|
serverId: string;
|
|
404
520
|
sessions: {
|
|
405
521
|
mode: "ask" | "plan" | "auto" | "full";
|
|
406
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
407
522
|
id: string;
|
|
523
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
408
524
|
agent: "CLAUDE" | "CODEX";
|
|
409
525
|
kind: "TICKET" | "CHAT";
|
|
410
526
|
model: string | null;
|
|
@@ -417,13 +533,18 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
417
533
|
activeMsBase: number;
|
|
418
534
|
extraBudgetMinutes: number | null;
|
|
419
535
|
workspace: {
|
|
536
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
420
537
|
id: string;
|
|
421
538
|
path: string;
|
|
422
539
|
projectId: string;
|
|
423
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
424
540
|
budgetUsd: number | null;
|
|
425
541
|
budgetMinutes: number | null;
|
|
426
542
|
agentAutoCommit?: boolean | undefined;
|
|
543
|
+
agentPushBan?: boolean | undefined;
|
|
544
|
+
agentPromptPath?: string | null | undefined;
|
|
545
|
+
agentProtectedBranches?: string[] | undefined;
|
|
546
|
+
agentAllowForcePush?: boolean | undefined;
|
|
547
|
+
agentAllowDestructiveGit?: boolean | undefined;
|
|
427
548
|
};
|
|
428
549
|
tickets: {
|
|
429
550
|
number: number;
|
|
@@ -434,6 +555,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
434
555
|
url: string;
|
|
435
556
|
token: string;
|
|
436
557
|
} | undefined;
|
|
558
|
+
skipAgentPrompt?: boolean | undefined;
|
|
437
559
|
branchHint?: string | undefined;
|
|
438
560
|
branchPlan?: {
|
|
439
561
|
branch: string;
|
|
@@ -449,20 +571,25 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
449
571
|
serverName: string;
|
|
450
572
|
serverId: string;
|
|
451
573
|
sessions: {
|
|
452
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
453
574
|
id: string;
|
|
575
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
454
576
|
agent: "CLAUDE" | "CODEX";
|
|
455
577
|
kind: "TICKET" | "CHAT";
|
|
456
578
|
prompt: string;
|
|
457
579
|
providerSessionId: string | null;
|
|
458
580
|
workspace: {
|
|
581
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
459
582
|
id: string;
|
|
460
583
|
path: string;
|
|
461
584
|
projectId: string;
|
|
462
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
463
585
|
budgetUsd: number | null;
|
|
464
586
|
budgetMinutes: number | null;
|
|
465
587
|
agentAutoCommit?: boolean | undefined;
|
|
588
|
+
agentPushBan?: unknown;
|
|
589
|
+
agentPromptPath?: unknown;
|
|
590
|
+
agentProtectedBranches?: unknown;
|
|
591
|
+
agentAllowForcePush?: unknown;
|
|
592
|
+
agentAllowDestructiveGit?: unknown;
|
|
466
593
|
};
|
|
467
594
|
tickets: {
|
|
468
595
|
number: number;
|
|
@@ -481,6 +608,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
481
608
|
costUsd?: number | undefined;
|
|
482
609
|
activeMsBase?: number | undefined;
|
|
483
610
|
extraBudgetMinutes?: number | null | undefined;
|
|
611
|
+
skipAgentPrompt?: unknown;
|
|
484
612
|
branchHint?: unknown;
|
|
485
613
|
branchPlan?: unknown;
|
|
486
614
|
workMode?: unknown;
|
|
@@ -542,25 +670,71 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
542
670
|
* every project the moment a runner updated ahead of its API.
|
|
543
671
|
*/
|
|
544
672
|
agentAutoCommit: z.ZodOptional<z.ZodBoolean>;
|
|
673
|
+
/**
|
|
674
|
+
* The project's own prompt file, relative to `path` — its contents reach
|
|
675
|
+
* the agent as SYSTEM-prompt text (see `agent-prompt.ts` for why the level
|
|
676
|
+
* matters).
|
|
677
|
+
*
|
|
678
|
+
* `.catch(undefined)` for the same reason as `branchHint` and `branchPlan`:
|
|
679
|
+
* this field travels inside `hello_ack`, which carries EVERY session of the
|
|
680
|
+
* server, so a malformed value must cost its own session's prompt at most —
|
|
681
|
+
* never the frame (QA-100 MAJOR-1). The runner re-validates the path from
|
|
682
|
+
* scratch anyway; the bounds here only keep nonsense off the wire.
|
|
683
|
+
*/
|
|
684
|
+
agentPromptPath: z.ZodCatch<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
685
|
+
/**
|
|
686
|
+
* Session 18: the project's git policy for agents.
|
|
687
|
+
*
|
|
688
|
+
* `.optional().catch(undefined)` for the QA-100 MAJOR-1 reason above — this
|
|
689
|
+
* rides inside `hello_ack` with every session on the server, so a malformed
|
|
690
|
+
* value must cost its own session's policy at most, never the frame.
|
|
691
|
+
*
|
|
692
|
+
* «Costs its own session's policy» is safe here BECAUSE of the polarity in
|
|
693
|
+
* `policy.ts`: `agentPushBan` resolves `undefined` to «refuse», so a value
|
|
694
|
+
* this schema drops leaves the session strictly more restricted, never less.
|
|
695
|
+
* That property is the whole reason `.catch(undefined)` is acceptable on a
|
|
696
|
+
* security field, and it is why the resolution lives in exactly one
|
|
697
|
+
* function rather than at each point of use.
|
|
698
|
+
*/
|
|
699
|
+
agentPushBan: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
700
|
+
agentProtectedBranches: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
701
|
+
agentAllowForcePush: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
702
|
+
agentAllowDestructiveGit: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
545
703
|
budgetUsd: z.ZodNullable<z.ZodNumber>;
|
|
546
704
|
budgetMinutes: z.ZodNullable<z.ZodNumber>;
|
|
547
705
|
}, "strip", z.ZodTypeAny, {
|
|
706
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
548
707
|
id: string;
|
|
549
708
|
path: string;
|
|
550
709
|
projectId: string;
|
|
551
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
552
710
|
budgetUsd: number | null;
|
|
553
711
|
budgetMinutes: number | null;
|
|
554
712
|
agentAutoCommit?: boolean | undefined;
|
|
713
|
+
agentPushBan?: boolean | undefined;
|
|
714
|
+
agentPromptPath?: string | null | undefined;
|
|
715
|
+
agentProtectedBranches?: string[] | undefined;
|
|
716
|
+
agentAllowForcePush?: boolean | undefined;
|
|
717
|
+
agentAllowDestructiveGit?: boolean | undefined;
|
|
555
718
|
}, {
|
|
719
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
556
720
|
id: string;
|
|
557
721
|
path: string;
|
|
558
722
|
projectId: string;
|
|
559
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
560
723
|
budgetUsd: number | null;
|
|
561
724
|
budgetMinutes: number | null;
|
|
562
725
|
agentAutoCommit?: boolean | undefined;
|
|
726
|
+
agentPushBan?: unknown;
|
|
727
|
+
agentPromptPath?: unknown;
|
|
728
|
+
agentProtectedBranches?: unknown;
|
|
729
|
+
agentAllowForcePush?: unknown;
|
|
730
|
+
agentAllowDestructiveGit?: unknown;
|
|
563
731
|
}>;
|
|
732
|
+
/**
|
|
733
|
+
* «Run this one without the project's agent prompt.» Absent means no — both
|
|
734
|
+
* because an older API never sends it and because that is the default a human
|
|
735
|
+
* gets when they do not touch the checkbox.
|
|
736
|
+
*/
|
|
737
|
+
skipAgentPrompt: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
564
738
|
tickets: z.ZodArray<z.ZodObject<{
|
|
565
739
|
id: z.ZodString;
|
|
566
740
|
number: z.ZodNumber;
|
|
@@ -635,8 +809,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
635
809
|
}>>;
|
|
636
810
|
}, "strip", z.ZodTypeAny, {
|
|
637
811
|
mode: "ask" | "plan" | "auto" | "full";
|
|
638
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
639
812
|
id: string;
|
|
813
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
640
814
|
agent: "CLAUDE" | "CODEX";
|
|
641
815
|
kind: "TICKET" | "CHAT";
|
|
642
816
|
model: string | null;
|
|
@@ -649,13 +823,18 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
649
823
|
activeMsBase: number;
|
|
650
824
|
extraBudgetMinutes: number | null;
|
|
651
825
|
workspace: {
|
|
826
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
652
827
|
id: string;
|
|
653
828
|
path: string;
|
|
654
829
|
projectId: string;
|
|
655
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
656
830
|
budgetUsd: number | null;
|
|
657
831
|
budgetMinutes: number | null;
|
|
658
832
|
agentAutoCommit?: boolean | undefined;
|
|
833
|
+
agentPushBan?: boolean | undefined;
|
|
834
|
+
agentPromptPath?: string | null | undefined;
|
|
835
|
+
agentProtectedBranches?: string[] | undefined;
|
|
836
|
+
agentAllowForcePush?: boolean | undefined;
|
|
837
|
+
agentAllowDestructiveGit?: boolean | undefined;
|
|
659
838
|
};
|
|
660
839
|
tickets: {
|
|
661
840
|
number: number;
|
|
@@ -666,6 +845,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
666
845
|
url: string;
|
|
667
846
|
token: string;
|
|
668
847
|
} | undefined;
|
|
848
|
+
skipAgentPrompt?: boolean | undefined;
|
|
669
849
|
branchHint?: string | undefined;
|
|
670
850
|
branchPlan?: {
|
|
671
851
|
branch: string;
|
|
@@ -675,20 +855,25 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
675
855
|
} | undefined;
|
|
676
856
|
workMode?: "DIRECT" | "BRANCH" | undefined;
|
|
677
857
|
}, {
|
|
678
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
679
858
|
id: string;
|
|
859
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
680
860
|
agent: "CLAUDE" | "CODEX";
|
|
681
861
|
kind: "TICKET" | "CHAT";
|
|
682
862
|
prompt: string;
|
|
683
863
|
providerSessionId: string | null;
|
|
684
864
|
workspace: {
|
|
865
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
685
866
|
id: string;
|
|
686
867
|
path: string;
|
|
687
868
|
projectId: string;
|
|
688
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
689
869
|
budgetUsd: number | null;
|
|
690
870
|
budgetMinutes: number | null;
|
|
691
871
|
agentAutoCommit?: boolean | undefined;
|
|
872
|
+
agentPushBan?: unknown;
|
|
873
|
+
agentPromptPath?: unknown;
|
|
874
|
+
agentProtectedBranches?: unknown;
|
|
875
|
+
agentAllowForcePush?: unknown;
|
|
876
|
+
agentAllowDestructiveGit?: unknown;
|
|
692
877
|
};
|
|
693
878
|
tickets: {
|
|
694
879
|
number: number;
|
|
@@ -707,6 +892,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
707
892
|
costUsd?: number | undefined;
|
|
708
893
|
activeMsBase?: number | undefined;
|
|
709
894
|
extraBudgetMinutes?: number | null | undefined;
|
|
895
|
+
skipAgentPrompt?: unknown;
|
|
710
896
|
branchHint?: unknown;
|
|
711
897
|
branchPlan?: unknown;
|
|
712
898
|
workMode?: unknown;
|
|
@@ -715,8 +901,8 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
715
901
|
type: "session_start";
|
|
716
902
|
session: {
|
|
717
903
|
mode: "ask" | "plan" | "auto" | "full";
|
|
718
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
719
904
|
id: string;
|
|
905
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
720
906
|
agent: "CLAUDE" | "CODEX";
|
|
721
907
|
kind: "TICKET" | "CHAT";
|
|
722
908
|
model: string | null;
|
|
@@ -729,13 +915,18 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
729
915
|
activeMsBase: number;
|
|
730
916
|
extraBudgetMinutes: number | null;
|
|
731
917
|
workspace: {
|
|
918
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
732
919
|
id: string;
|
|
733
920
|
path: string;
|
|
734
921
|
projectId: string;
|
|
735
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
736
922
|
budgetUsd: number | null;
|
|
737
923
|
budgetMinutes: number | null;
|
|
738
924
|
agentAutoCommit?: boolean | undefined;
|
|
925
|
+
agentPushBan?: boolean | undefined;
|
|
926
|
+
agentPromptPath?: string | null | undefined;
|
|
927
|
+
agentProtectedBranches?: string[] | undefined;
|
|
928
|
+
agentAllowForcePush?: boolean | undefined;
|
|
929
|
+
agentAllowDestructiveGit?: boolean | undefined;
|
|
739
930
|
};
|
|
740
931
|
tickets: {
|
|
741
932
|
number: number;
|
|
@@ -746,6 +937,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
746
937
|
url: string;
|
|
747
938
|
token: string;
|
|
748
939
|
} | undefined;
|
|
940
|
+
skipAgentPrompt?: boolean | undefined;
|
|
749
941
|
branchHint?: string | undefined;
|
|
750
942
|
branchPlan?: {
|
|
751
943
|
branch: string;
|
|
@@ -758,20 +950,25 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
758
950
|
}, {
|
|
759
951
|
type: "session_start";
|
|
760
952
|
session: {
|
|
761
|
-
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
762
953
|
id: string;
|
|
954
|
+
status: "RUNNING" | "FAILED" | "STARTING" | "WAITING_INPUT" | "WAITING_PERMISSION" | "REVIEW" | "DONE" | "STOPPED";
|
|
763
955
|
agent: "CLAUDE" | "CODEX";
|
|
764
956
|
kind: "TICKET" | "CHAT";
|
|
765
957
|
prompt: string;
|
|
766
958
|
providerSessionId: string | null;
|
|
767
959
|
workspace: {
|
|
960
|
+
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
768
961
|
id: string;
|
|
769
962
|
path: string;
|
|
770
963
|
projectId: string;
|
|
771
|
-
trustMode: "STRICT" | "NORMAL" | "AUTO";
|
|
772
964
|
budgetUsd: number | null;
|
|
773
965
|
budgetMinutes: number | null;
|
|
774
966
|
agentAutoCommit?: boolean | undefined;
|
|
967
|
+
agentPushBan?: unknown;
|
|
968
|
+
agentPromptPath?: unknown;
|
|
969
|
+
agentProtectedBranches?: unknown;
|
|
970
|
+
agentAllowForcePush?: unknown;
|
|
971
|
+
agentAllowDestructiveGit?: unknown;
|
|
775
972
|
};
|
|
776
973
|
tickets: {
|
|
777
974
|
number: number;
|
|
@@ -790,6 +987,7 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
790
987
|
costUsd?: number | undefined;
|
|
791
988
|
activeMsBase?: number | undefined;
|
|
792
989
|
extraBudgetMinutes?: number | null | undefined;
|
|
990
|
+
skipAgentPrompt?: unknown;
|
|
793
991
|
branchHint?: unknown;
|
|
794
992
|
branchPlan?: unknown;
|
|
795
993
|
workMode?: unknown;
|
|
@@ -815,9 +1013,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
815
1013
|
fileSize: number;
|
|
816
1014
|
}>, "many">>>;
|
|
817
1015
|
}, "strip", z.ZodTypeAny, {
|
|
1016
|
+
text: string;
|
|
818
1017
|
sessionId: string;
|
|
819
1018
|
type: "session_message";
|
|
820
|
-
text: string;
|
|
821
1019
|
attachments?: {
|
|
822
1020
|
id: string;
|
|
823
1021
|
fileName: string;
|
|
@@ -825,9 +1023,9 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
825
1023
|
fileSize: number;
|
|
826
1024
|
}[] | undefined;
|
|
827
1025
|
}, {
|
|
1026
|
+
text: string;
|
|
828
1027
|
sessionId: string;
|
|
829
1028
|
type: "session_message";
|
|
830
|
-
text: string;
|
|
831
1029
|
attachments?: unknown;
|
|
832
1030
|
}>, z.ZodObject<{
|
|
833
1031
|
type: z.ZodLiteral<"permission_answer">;
|
|
@@ -925,16 +1123,28 @@ export declare const GatewayFrameSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
925
1123
|
workspaceId: z.ZodString;
|
|
926
1124
|
trustMode: z.ZodOptional<z.ZodEnum<["STRICT", "NORMAL", "AUTO"]>>;
|
|
927
1125
|
agentAutoCommit: z.ZodOptional<z.ZodBoolean>;
|
|
1126
|
+
agentPushBan: z.ZodOptional<z.ZodBoolean>;
|
|
1127
|
+
agentProtectedBranches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1128
|
+
agentAllowForcePush: z.ZodOptional<z.ZodBoolean>;
|
|
1129
|
+
agentAllowDestructiveGit: z.ZodOptional<z.ZodBoolean>;
|
|
928
1130
|
}, "strip", z.ZodTypeAny, {
|
|
929
1131
|
type: "workspace_settings";
|
|
930
1132
|
workspaceId: string;
|
|
931
|
-
agentAutoCommit?: boolean | undefined;
|
|
932
1133
|
trustMode?: "STRICT" | "NORMAL" | "AUTO" | undefined;
|
|
1134
|
+
agentAutoCommit?: boolean | undefined;
|
|
1135
|
+
agentPushBan?: boolean | undefined;
|
|
1136
|
+
agentProtectedBranches?: string[] | undefined;
|
|
1137
|
+
agentAllowForcePush?: boolean | undefined;
|
|
1138
|
+
agentAllowDestructiveGit?: boolean | undefined;
|
|
933
1139
|
}, {
|
|
934
1140
|
type: "workspace_settings";
|
|
935
1141
|
workspaceId: string;
|
|
936
|
-
agentAutoCommit?: boolean | undefined;
|
|
937
1142
|
trustMode?: "STRICT" | "NORMAL" | "AUTO" | undefined;
|
|
1143
|
+
agentAutoCommit?: boolean | undefined;
|
|
1144
|
+
agentPushBan?: boolean | undefined;
|
|
1145
|
+
agentProtectedBranches?: string[] | undefined;
|
|
1146
|
+
agentAllowForcePush?: boolean | undefined;
|
|
1147
|
+
agentAllowDestructiveGit?: boolean | undefined;
|
|
938
1148
|
}>, z.ZodObject<{
|
|
939
1149
|
type: z.ZodLiteral<"session_settings">;
|
|
940
1150
|
sessionId: z.ZodString;
|