@wjarka/cezarion 0.14.4 → 0.14.5-pr465.718
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 +7 -1
- package/dist/automations/types.d.ts +4 -0
- package/dist/contract/automations.d.ts +16 -0
- package/dist/contract/delegation.d.ts +1 -0
- package/dist/contract/index.js +9 -1
- package/dist/contract/runs.d.ts +17 -2
- package/dist/contract/skills.d.ts +2 -0
- package/dist/contract/workflows.d.ts +12 -0
- package/dist/delegation/cli.js +65 -4
- package/dist/delegation/cli.js.map +1 -1
- package/dist/delegation/execution-identity.d.ts +92 -4
- package/dist/delegation/execution-identity.js +40 -10
- package/dist/delegation/execution-identity.js.map +1 -1
- package/dist/delegation/provision.js +5 -2
- package/dist/delegation/provision.js.map +1 -1
- package/dist/delegation/routes.d.ts +1 -0
- package/dist/delegation/service.js +95 -13
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/runs/store.d.ts +2 -0
- package/dist/server/server.d.ts +140 -0
- package/dist/server/server.js +6 -5
- package/dist/server/server.js.map +1 -1
- package/dist/workflows/load.d.ts +2 -0
- package/dist/workflows/load.js +5 -0
- package/dist/workflows/load.js.map +1 -1
- package/dist/workflows/run.d.ts +41 -2
- package/dist/workflows/run.js +200 -60
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/types.d.ts +6 -0
- package/dist/workflows/types.js +5 -1
- package/dist/workflows/types.js.map +1 -1
- package/package.json +3 -3
- package/web/dist/assets/{agent-accounts-BxBsIXGa.js → agent-accounts-lP_xK83o.js} +1 -1
- package/web/dist/assets/{alert-dialog-BOp2HnnL.js → alert-dialog-CmDuefYh.js} +1 -1
- package/web/dist/assets/{collapsible-bb0csfMs.js → collapsible-BqX8REmY.js} +1 -1
- package/web/dist/assets/{commit-list-DOWYQ7G6.js → commit-list-DnEGP74O.js} +1 -1
- package/web/dist/assets/{compare-variants-B1XteHt-.js → compare-variants-BBhRe7Nl.js} +1 -1
- package/web/dist/assets/{diff-BjLZHKfD2.js → diff-0GBum40Q2.js} +2 -2
- package/web/dist/assets/{diff-controls-DaO836o4.js → diff-controls-HwWHHait.js} +1 -1
- package/web/dist/assets/{diff-stat-DpHwISUB.js → diff-stat-mNkhAc5m.js} +1 -1
- package/web/dist/assets/{diff-view-BaYxuP8L.js → diff-view-DW64doDY.js} +1 -1
- package/web/dist/assets/{dropdown-menu-DAmCVaLJ.js → dropdown-menu-sZjYPcLh.js} +1 -1
- package/web/dist/assets/{git-toolbar-rk3doc2w.js → git-toolbar-DBW5EIcY.js} +1 -1
- package/web/dist/assets/{github-BhnijVvD.js → github-CEDjL0TU.js} +1 -1
- package/web/dist/assets/{image-preview-CFHgISfb.js → image-preview-DZicGNkU.js} +1 -1
- package/web/dist/assets/index-B3x4B4ST.js +7 -0
- package/web/dist/assets/{markdown-Ir62-VMS.js → markdown-AY2K3kIV.js} +1 -1
- package/web/dist/assets/pill-CcJqA1cL.js +1 -0
- package/web/dist/assets/{project-router-CvFAMDcP.js → project-router-SwsXRKXs.js} +1 -1
- package/web/dist/assets/{prompt-templates-BGGpAIzb.js → prompt-templates-iV2WD2jy.js} +1 -1
- package/web/dist/assets/{repo-git-QEHH7y-w.js → repo-git-B4oY3JUa.js} +1 -1
- package/web/dist/assets/{run-diff-DrQsmf3-.js → run-diff-DPUNj56q.js} +1 -1
- package/web/dist/assets/run-header-DbDluWoV.js +1 -0
- package/web/dist/assets/{skills-DOT1odMt.js → skills-BaAfSBev.js} +1 -1
- package/web/dist/assets/{tab-link-CkIV8ixq.js → tab-link-DSftvkZS.js} +1 -1
- package/web/dist/assets/{task-changes-CUQTi97I.js → task-changes-SmAZVpEr.js} +1 -1
- package/web/dist/assets/{task-commits-D_N8-awD.js → task-commits-jXKupow3.js} +1 -1
- package/web/dist/assets/{task-files-CfYcMt07.js → task-files-DuoG-2bS.js} +1 -1
- package/web/dist/assets/{task-thread-Bnd_Pc07.js → task-thread-BuXrVB9K.js} +6 -6
- package/web/dist/assets/{textarea-DfvlPIgO.js → textarea-CxRdTWlq.js} +1 -1
- package/web/dist/assets/{thread-loading-B0WsjYr0.js → thread-loading-JlP6dUpX.js} +1 -1
- package/web/dist/assets/{token-metrics-BLzFUb8F.js → token-metrics-Z3UFYbuD.js} +1 -1
- package/web/dist/assets/{utils-GZNjgma4.js → utils-CUnaAifW.js} +1 -1
- package/web/dist/assets/{workflows-C1I-xV9B.js → workflows-CRzqBjK0.js} +3 -3
- package/web/dist/assets/{zoomable-image-COhBxkky.js → zoomable-image-DUE1KFJ0.js} +1 -1
- package/web/dist/index.html +13 -13
- package/web/dist/assets/index-DTsigc4h.js +0 -7
- package/web/dist/assets/pill-BoBISMI9.js +0 -1
- package/web/dist/assets/run-header-BKeByMek.js +0 -1
package/README.md
CHANGED
|
@@ -472,6 +472,7 @@ The provisioned command has these forms (the session instructions supply the abs
|
|
|
472
472
|
```sh
|
|
473
473
|
cez worker spawn --baseline parent-head --request-id <UUID> 'Implement the assigned change'
|
|
474
474
|
cez worker spawn --baseline parent-head --request-id <UUID> --backend codex --effort high --context-file ./selected-context.txt 'Review the parser'
|
|
475
|
+
cez worker spawn --baseline parent-head --request-id <UUID> --workflow review 'Review the parser change'
|
|
475
476
|
cez worker inspect <worker-id>
|
|
476
477
|
cez worker steer <worker-id> 'Consider this additional constraint'
|
|
477
478
|
cez worker diff <worker-id>
|
|
@@ -492,7 +493,9 @@ cez worker stop <worker-id>
|
|
|
492
493
|
cez worker destroy <worker-id>
|
|
493
494
|
```
|
|
494
495
|
|
|
495
|
-
Commands return bounded JSON and a nonzero exit on failure or incomplete cleanup. Spawn requires a committed baseline (`parent-head` or an explicit ref) and pins its SHA at acceptance; dirty parent edits are excluded. Optional `--context '<text>'` or `--context-file <UTF-8-file>` supplies selected context, not the parent's conversation. The two flags are mutually exclusive, and combined task/context text is limited to 100,000 characters. The API also accepts up to 32 pinned-baseline file or parent-attachment references, with at most 8 MiB of copied attachments. Inspect reports worker-local input locations. Reuse a request ID only with the same task, baseline, context, backend, model and
|
|
496
|
+
Use `cez worker --help` to list operations and flags, or `cez worker <operation> --help` for one operation. Explicit help prints human-readable text and exits successfully without an active delegation session. Commands otherwise return bounded JSON and a nonzero exit on failure or incomplete cleanup. Spawn requires a committed baseline (`parent-head` or an explicit ref) and pins its SHA at acceptance; dirty parent edits are excluded. Optional `--context '<text>'` or `--context-file <UTF-8-file>` supplies selected context, not the parent's conversation. The two flags are mutually exclusive, and combined task/context text is limited to 100,000 characters. The API also accepts up to 32 pinned-baseline file or parent-attachment references, with at most 8 MiB of copied attachments. Inspect reports worker-local input locations. Reuse a request ID only with the same task, baseline, context, backend, model, effort and workflow when retrying a lost response. There are at most 32 accepted creations per parent, counting destroyed workers, and 32 undelivered steering messages per worker.
|
|
497
|
+
|
|
498
|
+
`--workflow <name>` runs a catalog workflow inside the worker: the built-in `quick-task` or any `.ai/cezar/workflows/*.yaml` by name, with its agent and check steps, `skill:` bodies and `onFail` loops, so a repo's `review.yaml` becomes a dedicated reviewer. Omitted `--workflow` runs `quick-task` exactly as before. `--backend`, `--model` and `--effort` fill only the steps that leave those fields unset; a step's own `allowedTools`/`bashAllowlist` narrow the parent's grants and never widen them. An unknown name is refused. Agent steps may mix runners: at spawn every agent step is resolved and pinned separately, so an implement-with-codex, review-with-claude chain runs each step under its own runner, account, model, effort and grants. A step's optional `agentProfile` names the account it runs under (an id the registry does not know is refused); same-backend steps otherwise inherit the parent's account and other runners resolve their project/default one. Run-level columns show the first agent step.
|
|
496
499
|
|
|
497
500
|
Omitted `--backend` inherits the parent's active backend. Same-backend workers inherit omitted model/account/effort; `--backend <claude|codex|opencode|pi|cursor>` selecting another backend resolves that backend's project/default account and model without forwarding another provider's settings. `--model <model>` selects a supported model, subject to existing locks. `--effort <low|medium|high|xhigh|max>` pins reasoning effort on same-backend and mixed-backend spawn; omitted `--effort` still inherits the parent pin on same-backend spawn and drops it on mixed-backend spawn. Accepted identity and grants remain fixed across queuing, restart and Continue, including explicit empty grants. Changing or deleting an account registry entry does not rebind a worker. Missing accepted identity evidence or account homes, incompatible Claude state-file layouts, and conflicting later model locks refuse execution explicitly. Credentials and vendor configuration are never copied; each worker receives its own delegation credential, and unspecified native models stay unspecified.
|
|
498
501
|
|
|
@@ -527,6 +530,7 @@ steps:
|
|
|
527
530
|
prompt: "{{task}}"
|
|
528
531
|
skill: project-conventions # optional — from .ai/skills or .ai/cezar/skills
|
|
529
532
|
# model: opus # optional per-step model override
|
|
533
|
+
# effort: high # optional per-step effort: low · medium · high · xhigh · max
|
|
530
534
|
# runner: codex # optional per-step backend: claude · codex · opencode · pi
|
|
531
535
|
# allowedTools: [Read, Edit, Write, Grep, Glob, Bash]
|
|
532
536
|
- id: verify
|
|
@@ -713,10 +717,12 @@ steps:
|
|
|
713
717
|
name: Implement
|
|
714
718
|
prompt: "{{task}}"
|
|
715
719
|
runner: codex # one vendor writes the code…
|
|
720
|
+
effort: medium # …with a cheaper reasoning pass
|
|
716
721
|
- id: review
|
|
717
722
|
name: Cross-review
|
|
718
723
|
prompt: "Review the diff produced for: {{task}}. Fix real issues only."
|
|
719
724
|
runner: claude # …another one reviews it
|
|
725
|
+
effort: high # …with more reasoning for review
|
|
720
726
|
- id: verify
|
|
721
727
|
name: Verify
|
|
722
728
|
command: "npm test"
|
|
@@ -24,6 +24,7 @@ export declare const automationTaskSchema: z.ZodObject<{
|
|
|
24
24
|
prompt: z.ZodOptional<z.ZodString>;
|
|
25
25
|
skill: z.ZodOptional<z.ZodString>;
|
|
26
26
|
model: z.ZodOptional<z.ZodString>;
|
|
27
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
27
28
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
28
29
|
claude: "claude";
|
|
29
30
|
codex: "codex";
|
|
@@ -31,6 +32,7 @@ export declare const automationTaskSchema: z.ZodObject<{
|
|
|
31
32
|
opencode: "opencode";
|
|
32
33
|
pi: "pi";
|
|
33
34
|
}>>;
|
|
35
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
34
36
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
37
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
38
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -86,6 +88,7 @@ export declare const automationDefinitionSchema: z.ZodObject<{
|
|
|
86
88
|
prompt: z.ZodOptional<z.ZodString>;
|
|
87
89
|
skill: z.ZodOptional<z.ZodString>;
|
|
88
90
|
model: z.ZodOptional<z.ZodString>;
|
|
91
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
89
92
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
90
93
|
claude: "claude";
|
|
91
94
|
codex: "codex";
|
|
@@ -93,6 +96,7 @@ export declare const automationDefinitionSchema: z.ZodObject<{
|
|
|
93
96
|
opencode: "opencode";
|
|
94
97
|
pi: "pi";
|
|
95
98
|
}>>;
|
|
99
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
96
100
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
97
101
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
102
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -65,6 +65,7 @@ export declare const automationTaskSchema: z.ZodObject<{
|
|
|
65
65
|
prompt: z.ZodOptional<z.ZodString>;
|
|
66
66
|
skill: z.ZodOptional<z.ZodString>;
|
|
67
67
|
model: z.ZodOptional<z.ZodString>;
|
|
68
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
68
69
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
69
70
|
claude: "claude";
|
|
70
71
|
codex: "codex";
|
|
@@ -72,6 +73,7 @@ export declare const automationTaskSchema: z.ZodObject<{
|
|
|
72
73
|
opencode: "opencode";
|
|
73
74
|
pi: "pi";
|
|
74
75
|
}>>;
|
|
76
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
75
77
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
76
78
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
77
79
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -130,6 +132,7 @@ export declare const automationDefinitionSchema: z.ZodObject<{
|
|
|
130
132
|
prompt: z.ZodOptional<z.ZodString>;
|
|
131
133
|
skill: z.ZodOptional<z.ZodString>;
|
|
132
134
|
model: z.ZodOptional<z.ZodString>;
|
|
135
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
133
136
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
134
137
|
claude: "claude";
|
|
135
138
|
codex: "codex";
|
|
@@ -137,6 +140,7 @@ export declare const automationDefinitionSchema: z.ZodObject<{
|
|
|
137
140
|
opencode: "opencode";
|
|
138
141
|
pi: "pi";
|
|
139
142
|
}>>;
|
|
143
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
140
144
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
145
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
142
146
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -288,6 +292,7 @@ export declare const automationListEntrySchema: z.ZodObject<{
|
|
|
288
292
|
prompt: z.ZodOptional<z.ZodString>;
|
|
289
293
|
skill: z.ZodOptional<z.ZodString>;
|
|
290
294
|
model: z.ZodOptional<z.ZodString>;
|
|
295
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
291
296
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
292
297
|
claude: "claude";
|
|
293
298
|
codex: "codex";
|
|
@@ -295,6 +300,7 @@ export declare const automationListEntrySchema: z.ZodObject<{
|
|
|
295
300
|
opencode: "opencode";
|
|
296
301
|
pi: "pi";
|
|
297
302
|
}>>;
|
|
303
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
298
304
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
299
305
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
300
306
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -436,6 +442,7 @@ export declare const automationsResponseSchema: z.ZodObject<{
|
|
|
436
442
|
prompt: z.ZodOptional<z.ZodString>;
|
|
437
443
|
skill: z.ZodOptional<z.ZodString>;
|
|
438
444
|
model: z.ZodOptional<z.ZodString>;
|
|
445
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
439
446
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
440
447
|
claude: "claude";
|
|
441
448
|
codex: "codex";
|
|
@@ -443,6 +450,7 @@ export declare const automationsResponseSchema: z.ZodObject<{
|
|
|
443
450
|
opencode: "opencode";
|
|
444
451
|
pi: "pi";
|
|
445
452
|
}>>;
|
|
453
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
446
454
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
447
455
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
448
456
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -569,6 +577,7 @@ export declare const automationResponseSchema: z.ZodObject<{
|
|
|
569
577
|
prompt: z.ZodOptional<z.ZodString>;
|
|
570
578
|
skill: z.ZodOptional<z.ZodString>;
|
|
571
579
|
model: z.ZodOptional<z.ZodString>;
|
|
580
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
572
581
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
573
582
|
claude: "claude";
|
|
574
583
|
codex: "codex";
|
|
@@ -576,6 +585,7 @@ export declare const automationResponseSchema: z.ZodObject<{
|
|
|
576
585
|
opencode: "opencode";
|
|
577
586
|
pi: "pi";
|
|
578
587
|
}>>;
|
|
588
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
579
589
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
580
590
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
581
591
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -639,6 +649,7 @@ export declare const automationDetailResponseSchema: z.ZodObject<{
|
|
|
639
649
|
prompt: z.ZodOptional<z.ZodString>;
|
|
640
650
|
skill: z.ZodOptional<z.ZodString>;
|
|
641
651
|
model: z.ZodOptional<z.ZodString>;
|
|
652
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
642
653
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
643
654
|
claude: "claude";
|
|
644
655
|
codex: "codex";
|
|
@@ -646,6 +657,7 @@ export declare const automationDetailResponseSchema: z.ZodObject<{
|
|
|
646
657
|
opencode: "opencode";
|
|
647
658
|
pi: "pi";
|
|
648
659
|
}>>;
|
|
660
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
649
661
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
650
662
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
651
663
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -845,6 +857,7 @@ export declare const createAutomationInputSchema: z.ZodObject<{
|
|
|
845
857
|
prompt: z.ZodOptional<z.ZodString>;
|
|
846
858
|
skill: z.ZodOptional<z.ZodString>;
|
|
847
859
|
model: z.ZodOptional<z.ZodString>;
|
|
860
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
848
861
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
849
862
|
claude: "claude";
|
|
850
863
|
codex: "codex";
|
|
@@ -852,6 +865,7 @@ export declare const createAutomationInputSchema: z.ZodObject<{
|
|
|
852
865
|
opencode: "opencode";
|
|
853
866
|
pi: "pi";
|
|
854
867
|
}>>;
|
|
868
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
855
869
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
856
870
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
857
871
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -913,6 +927,7 @@ export declare const updateAutomationInputSchema: z.ZodObject<{
|
|
|
913
927
|
prompt: z.ZodOptional<z.ZodString>;
|
|
914
928
|
skill: z.ZodOptional<z.ZodString>;
|
|
915
929
|
model: z.ZodOptional<z.ZodString>;
|
|
930
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
916
931
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
917
932
|
claude: "claude";
|
|
918
933
|
codex: "codex";
|
|
@@ -920,6 +935,7 @@ export declare const updateAutomationInputSchema: z.ZodObject<{
|
|
|
920
935
|
opencode: "opencode";
|
|
921
936
|
pi: "pi";
|
|
922
937
|
}>>;
|
|
938
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
923
939
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
924
940
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
925
941
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -927,6 +927,7 @@ export declare const workerSpawnRequestSchema: z.ZodObject<{
|
|
|
927
927
|
}>>;
|
|
928
928
|
model: z.ZodOptional<z.ZodString>;
|
|
929
929
|
effort: z.ZodOptional<z.ZodString>;
|
|
930
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
930
931
|
}, z.core.$strict>;
|
|
931
932
|
export type WorkerSpawnRequest = z.infer<typeof workerSpawnRequestSchema>;
|
|
932
933
|
export declare const workerSteerRequestSchema: z.ZodObject<{
|
package/dist/contract/index.js
CHANGED
|
@@ -228,7 +228,9 @@ var workerSpawnRequestSchema = z3.object({
|
|
|
228
228
|
context: workerContextSchema.optional(),
|
|
229
229
|
backend: workerBackendSchema.optional(),
|
|
230
230
|
model: z3.string().trim().min(1).max(512).optional(),
|
|
231
|
-
effort: effortFieldSchema
|
|
231
|
+
effort: effortFieldSchema,
|
|
232
|
+
/** Catalog workflow name (built-in quick-task or `.ai/cezar/workflows/*.yaml`, #451). Absent means quick-task. */
|
|
233
|
+
workflow: z3.string().trim().min(1).max(200).optional()
|
|
232
234
|
}).strict().refine((request) => request.task.length + (request.context?.text?.length ?? 0) <= 1e5, { message: "Combined task and context exceed 100000 characters" });
|
|
233
235
|
var workerSteerRequestSchema = z3.object({
|
|
234
236
|
text: z3.string().max(1e5).refine((text) => text.trim().length > 0)
|
|
@@ -731,8 +733,11 @@ var workflowStepDefSchema = z8.object({
|
|
|
731
733
|
prompt: z8.string().optional(),
|
|
732
734
|
skill: z8.string().optional(),
|
|
733
735
|
model: z8.string().optional(),
|
|
736
|
+
effort: z8.string().max(32).optional(),
|
|
734
737
|
/** Per-step agent backend override (falls back to the task / config default). */
|
|
735
738
|
runner: runnerSchema.optional(),
|
|
739
|
+
/** Agent account id for this step (spec 2026-07-29-agent-profiles); resolved per step for owned workers (#452). */
|
|
740
|
+
agentProfile: z8.string().min(1).max(64).optional(),
|
|
736
741
|
allowedTools: z8.array(z8.string()).optional(),
|
|
737
742
|
bashAllowlist: z8.array(z8.string()).optional(),
|
|
738
743
|
// check step
|
|
@@ -1037,6 +1042,9 @@ var runRecordSchema = z9.object({
|
|
|
1037
1042
|
workflowDef: workflowDefSchema.optional()
|
|
1038
1043
|
});
|
|
1039
1044
|
var apiRunSchema = runRecordSchema.extend({
|
|
1045
|
+
/** Read-only GET /runs/:id verdict: null permits Finish, a string explains refusal.
|
|
1046
|
+
* Absent on lists, stored records and mutation responses; absence is not permission. */
|
|
1047
|
+
finishBlocked: z9.string().nullable().optional(),
|
|
1040
1048
|
/** Server-resolved Cursor CLI command, including the configured executable. Never persisted. */
|
|
1041
1049
|
cliResumeCommand: z9.string().optional(),
|
|
1042
1050
|
usage: processUsageSchema.optional()
|
package/dist/contract/runs.d.ts
CHANGED
|
@@ -678,6 +678,7 @@ export declare const runRecordSchema: z.ZodObject<{
|
|
|
678
678
|
prompt: z.ZodOptional<z.ZodString>;
|
|
679
679
|
skill: z.ZodOptional<z.ZodString>;
|
|
680
680
|
model: z.ZodOptional<z.ZodString>;
|
|
681
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
681
682
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
682
683
|
claude: "claude";
|
|
683
684
|
codex: "codex";
|
|
@@ -685,6 +686,7 @@ export declare const runRecordSchema: z.ZodObject<{
|
|
|
685
686
|
opencode: "opencode";
|
|
686
687
|
pi: "pi";
|
|
687
688
|
}>>;
|
|
689
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
688
690
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
689
691
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
690
692
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -704,8 +706,8 @@ export type RunRecord = z.infer<typeof runRecordSchema>;
|
|
|
704
706
|
/**
|
|
705
707
|
* What `GET /runs` and `GET /runs/:id` answer: the stored record plus host-derived fields.
|
|
706
708
|
* The live `usage` sample is absent for finished runs and wherever `ps` yields nothing.
|
|
707
|
-
* Cursor resume commands use the server executable override.
|
|
708
|
-
* or attached by mutation routes.
|
|
709
|
+
* Cursor resume commands use the server executable override. Finish eligibility is computed
|
|
710
|
+
* only for detail reads. These fields are never persisted or attached by mutation routes.
|
|
709
711
|
*/
|
|
710
712
|
export declare const apiRunSchema: z.ZodObject<{
|
|
711
713
|
id: z.ZodString;
|
|
@@ -1253,6 +1255,7 @@ export declare const apiRunSchema: z.ZodObject<{
|
|
|
1253
1255
|
prompt: z.ZodOptional<z.ZodString>;
|
|
1254
1256
|
skill: z.ZodOptional<z.ZodString>;
|
|
1255
1257
|
model: z.ZodOptional<z.ZodString>;
|
|
1258
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
1256
1259
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
1257
1260
|
claude: "claude";
|
|
1258
1261
|
codex: "codex";
|
|
@@ -1260,6 +1263,7 @@ export declare const apiRunSchema: z.ZodObject<{
|
|
|
1260
1263
|
opencode: "opencode";
|
|
1261
1264
|
pi: "pi";
|
|
1262
1265
|
}>>;
|
|
1266
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
1263
1267
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1264
1268
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1265
1269
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -1274,6 +1278,7 @@ export declare const apiRunSchema: z.ZodObject<{
|
|
|
1274
1278
|
}>;
|
|
1275
1279
|
path: z.ZodOptional<z.ZodString>;
|
|
1276
1280
|
}, z.core.$strip>>;
|
|
1281
|
+
finishBlocked: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1277
1282
|
cliResumeCommand: z.ZodOptional<z.ZodString>;
|
|
1278
1283
|
usage: z.ZodOptional<z.ZodObject<{
|
|
1279
1284
|
cpuPct: z.ZodNumber;
|
|
@@ -2074,6 +2079,7 @@ export declare const createRunResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2074
2079
|
prompt: z.ZodOptional<z.ZodString>;
|
|
2075
2080
|
skill: z.ZodOptional<z.ZodString>;
|
|
2076
2081
|
model: z.ZodOptional<z.ZodString>;
|
|
2082
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
2077
2083
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
2078
2084
|
claude: "claude";
|
|
2079
2085
|
codex: "codex";
|
|
@@ -2081,6 +2087,7 @@ export declare const createRunResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2081
2087
|
opencode: "opencode";
|
|
2082
2088
|
pi: "pi";
|
|
2083
2089
|
}>>;
|
|
2090
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
2084
2091
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2085
2092
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2086
2093
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -2642,6 +2649,7 @@ export declare const createRunResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2642
2649
|
prompt: z.ZodOptional<z.ZodString>;
|
|
2643
2650
|
skill: z.ZodOptional<z.ZodString>;
|
|
2644
2651
|
model: z.ZodOptional<z.ZodString>;
|
|
2652
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
2645
2653
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
2646
2654
|
claude: "claude";
|
|
2647
2655
|
codex: "codex";
|
|
@@ -2649,6 +2657,7 @@ export declare const createRunResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2649
2657
|
opencode: "opencode";
|
|
2650
2658
|
pi: "pi";
|
|
2651
2659
|
}>>;
|
|
2660
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
2652
2661
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2653
2662
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2654
2663
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -3417,6 +3426,7 @@ export declare const pickVariantResponseSchema: z.ZodObject<{
|
|
|
3417
3426
|
prompt: z.ZodOptional<z.ZodString>;
|
|
3418
3427
|
skill: z.ZodOptional<z.ZodString>;
|
|
3419
3428
|
model: z.ZodOptional<z.ZodString>;
|
|
3429
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
3420
3430
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
3421
3431
|
claude: "claude";
|
|
3422
3432
|
codex: "codex";
|
|
@@ -3424,6 +3434,7 @@ export declare const pickVariantResponseSchema: z.ZodObject<{
|
|
|
3424
3434
|
opencode: "opencode";
|
|
3425
3435
|
pi: "pi";
|
|
3426
3436
|
}>>;
|
|
3437
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
3427
3438
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3428
3439
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3429
3440
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -3512,6 +3523,7 @@ export declare const createRunInputBaseSchema: z.ZodObject<{
|
|
|
3512
3523
|
prompt: z.ZodOptional<z.ZodString>;
|
|
3513
3524
|
skill: z.ZodOptional<z.ZodString>;
|
|
3514
3525
|
model: z.ZodOptional<z.ZodString>;
|
|
3526
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
3515
3527
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
3516
3528
|
claude: "claude";
|
|
3517
3529
|
codex: "codex";
|
|
@@ -3519,6 +3531,7 @@ export declare const createRunInputBaseSchema: z.ZodObject<{
|
|
|
3519
3531
|
opencode: "opencode";
|
|
3520
3532
|
pi: "pi";
|
|
3521
3533
|
}>>;
|
|
3534
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
3522
3535
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3523
3536
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3524
3537
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -3563,6 +3576,7 @@ export declare const createRunInputSchema: z.ZodObject<{
|
|
|
3563
3576
|
prompt: z.ZodOptional<z.ZodString>;
|
|
3564
3577
|
skill: z.ZodOptional<z.ZodString>;
|
|
3565
3578
|
model: z.ZodOptional<z.ZodString>;
|
|
3579
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
3566
3580
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
3567
3581
|
claude: "claude";
|
|
3568
3582
|
codex: "codex";
|
|
@@ -3570,6 +3584,7 @@ export declare const createRunInputSchema: z.ZodObject<{
|
|
|
3570
3584
|
opencode: "opencode";
|
|
3571
3585
|
pi: "pi";
|
|
3572
3586
|
}>>;
|
|
3587
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
3573
3588
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3574
3589
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3575
3590
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -613,6 +613,7 @@ export declare const startTodoResponseSchema: z.ZodObject<{
|
|
|
613
613
|
prompt: z.ZodOptional<z.ZodString>;
|
|
614
614
|
skill: z.ZodOptional<z.ZodString>;
|
|
615
615
|
model: z.ZodOptional<z.ZodString>;
|
|
616
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
616
617
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
617
618
|
claude: "claude";
|
|
618
619
|
codex: "codex";
|
|
@@ -620,6 +621,7 @@ export declare const startTodoResponseSchema: z.ZodObject<{
|
|
|
620
621
|
opencode: "opencode";
|
|
621
622
|
pi: "pi";
|
|
622
623
|
}>>;
|
|
624
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
623
625
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
624
626
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
625
627
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -21,6 +21,7 @@ export declare const workflowStepDefSchema: z.ZodObject<{
|
|
|
21
21
|
prompt: z.ZodOptional<z.ZodString>;
|
|
22
22
|
skill: z.ZodOptional<z.ZodString>;
|
|
23
23
|
model: z.ZodOptional<z.ZodString>;
|
|
24
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
24
25
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
25
26
|
claude: "claude";
|
|
26
27
|
codex: "codex";
|
|
@@ -28,6 +29,7 @@ export declare const workflowStepDefSchema: z.ZodObject<{
|
|
|
28
29
|
opencode: "opencode";
|
|
29
30
|
pi: "pi";
|
|
30
31
|
}>>;
|
|
32
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
31
33
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
32
34
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
35
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -47,6 +49,7 @@ export declare const workflowDefSchema: z.ZodObject<{
|
|
|
47
49
|
prompt: z.ZodOptional<z.ZodString>;
|
|
48
50
|
skill: z.ZodOptional<z.ZodString>;
|
|
49
51
|
model: z.ZodOptional<z.ZodString>;
|
|
52
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
50
53
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
51
54
|
claude: "claude";
|
|
52
55
|
codex: "codex";
|
|
@@ -54,6 +57,7 @@ export declare const workflowDefSchema: z.ZodObject<{
|
|
|
54
57
|
opencode: "opencode";
|
|
55
58
|
pi: "pi";
|
|
56
59
|
}>>;
|
|
60
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
57
61
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
58
62
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
63
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -88,6 +92,7 @@ export declare const workflowsResponseSchema: z.ZodObject<{
|
|
|
88
92
|
prompt: z.ZodOptional<z.ZodString>;
|
|
89
93
|
skill: z.ZodOptional<z.ZodString>;
|
|
90
94
|
model: z.ZodOptional<z.ZodString>;
|
|
95
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
91
96
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
92
97
|
claude: "claude";
|
|
93
98
|
codex: "codex";
|
|
@@ -95,6 +100,7 @@ export declare const workflowsResponseSchema: z.ZodObject<{
|
|
|
95
100
|
opencode: "opencode";
|
|
96
101
|
pi: "pi";
|
|
97
102
|
}>>;
|
|
103
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
98
104
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
99
105
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
100
106
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -130,6 +136,7 @@ export declare const saveWorkflowInputSchema: z.ZodObject<{
|
|
|
130
136
|
prompt: z.ZodOptional<z.ZodString>;
|
|
131
137
|
skill: z.ZodOptional<z.ZodString>;
|
|
132
138
|
model: z.ZodOptional<z.ZodString>;
|
|
139
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
133
140
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
134
141
|
claude: "claude";
|
|
135
142
|
codex: "codex";
|
|
@@ -137,6 +144,7 @@ export declare const saveWorkflowInputSchema: z.ZodObject<{
|
|
|
137
144
|
opencode: "opencode";
|
|
138
145
|
pi: "pi";
|
|
139
146
|
}>>;
|
|
147
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
140
148
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
149
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
142
150
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -165,6 +173,7 @@ export declare const parsedWorkflowSchema: z.ZodObject<{
|
|
|
165
173
|
prompt: z.ZodOptional<z.ZodString>;
|
|
166
174
|
skill: z.ZodOptional<z.ZodString>;
|
|
167
175
|
model: z.ZodOptional<z.ZodString>;
|
|
176
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
168
177
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
169
178
|
claude: "claude";
|
|
170
179
|
codex: "codex";
|
|
@@ -172,6 +181,7 @@ export declare const parsedWorkflowSchema: z.ZodObject<{
|
|
|
172
181
|
opencode: "opencode";
|
|
173
182
|
pi: "pi";
|
|
174
183
|
}>>;
|
|
184
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
175
185
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
176
186
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
177
187
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -206,6 +216,7 @@ export declare const planResponseSchema: z.ZodObject<{
|
|
|
206
216
|
prompt: z.ZodOptional<z.ZodString>;
|
|
207
217
|
skill: z.ZodOptional<z.ZodString>;
|
|
208
218
|
model: z.ZodOptional<z.ZodString>;
|
|
219
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
209
220
|
runner: z.ZodOptional<z.ZodEnum<{
|
|
210
221
|
claude: "claude";
|
|
211
222
|
codex: "codex";
|
|
@@ -213,6 +224,7 @@ export declare const planResponseSchema: z.ZodObject<{
|
|
|
213
224
|
opencode: "opencode";
|
|
214
225
|
pi: "pi";
|
|
215
226
|
}>>;
|
|
227
|
+
agentProfile: z.ZodOptional<z.ZodString>;
|
|
216
228
|
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
217
229
|
bashAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
218
230
|
command: z.ZodOptional<z.ZodString>;
|
package/dist/delegation/cli.js
CHANGED
|
@@ -18,13 +18,13 @@ const responseSchemas = { send: conversationSendResultSchema, progress: conversa
|
|
|
18
18
|
stop: workerStopResultSchema, destroy: workerDestroyResultSchema, diff: workerDiffSchema, wait: workerWaitResultSchema, 'cancel-wait': workerCancelWaitResultSchema };
|
|
19
19
|
const RESPONSE_BYTES = 3_145_728;
|
|
20
20
|
const CLI_FLAG = {
|
|
21
|
-
requestId: '--request-id', baseline: '--baseline', backend: '--backend', model: '--model', effort: '--effort',
|
|
21
|
+
requestId: '--request-id', baseline: '--baseline', backend: '--backend', model: '--model', effort: '--effort', workflow: '--workflow',
|
|
22
22
|
timeoutSeconds: '--timeout-seconds', mode: '--mode', kind: '--kind', id: '--id', context: '--context',
|
|
23
23
|
requestIds: '--request', workerIds: 'worker-id', workerId: 'worker-id', waitId: 'wait-id', recipientRunId: 'recipient-run-id',
|
|
24
24
|
task: 'task', text: 'text',
|
|
25
25
|
};
|
|
26
26
|
const WORKER_USAGE = { operations: [
|
|
27
|
-
{ name: 'spawn', positionals: 1, required: ['--baseline', '--request-id'], optional: ['--backend', '--model', '--effort', '--context', '--context-file'] },
|
|
27
|
+
{ name: 'spawn', positionals: 1, required: ['--baseline', '--request-id'], optional: ['--workflow', '--backend', '--model', '--effort', '--context', '--context-file'] },
|
|
28
28
|
{ name: 'inspect', positionals: 1 },
|
|
29
29
|
{ name: 'steer', positionals: 2 },
|
|
30
30
|
{ name: 'stop', positionals: 1 },
|
|
@@ -42,6 +42,57 @@ const WORKER_USAGE = { operations: [
|
|
|
42
42
|
{ name: 'wait-requests', positionals: 1, optional: ['--mode', '--timeout-seconds'] },
|
|
43
43
|
{ name: 'cancel-request', positionals: 1 },
|
|
44
44
|
] };
|
|
45
|
+
const WORKER_HELP = {
|
|
46
|
+
spawn: { args: '"<task>" --baseline <ref> --request-id <UUID>', description: 'Create an owned worker from a committed baseline.' },
|
|
47
|
+
inspect: { args: '<worker-id>', description: 'Show worker state and input locations.' },
|
|
48
|
+
steer: { args: '<worker-id> "<text>"', description: 'Send instructions to a running worker.' },
|
|
49
|
+
stop: { args: '<worker-id>', description: 'Stop a worker.' },
|
|
50
|
+
destroy: { args: '<worker-id>', description: 'Remove owned worker resources after collecting results.' },
|
|
51
|
+
diff: { args: '<worker-id>', description: 'Show the bounded worker diff.' },
|
|
52
|
+
collect: { args: '<worker-id>', description: 'Collect the latest worker results; does not merge changes.' },
|
|
53
|
+
wait: { args: '<worker-id>... | --request <UUID> [--request <UUID>...]', description: 'Register a wait for workers or message requests, then end your turn.' },
|
|
54
|
+
'cancel-wait': { args: '<wait-id>', description: 'Cancel a wait without cancelling requests or workers.' },
|
|
55
|
+
send: { args: '<recipient-run-id> "<text>" --id <UUID> --kind <request|progress>', description: 'Send a request requiring a reply, or a progress update.' },
|
|
56
|
+
progress: { args: '<recipient-run-id> "<text>" --id <UUID>', description: 'Send an update without a reply obligation.' },
|
|
57
|
+
'follow-up': { args: '<recipient-run-id> "<text>" --id <UUID> --request-id <UUID>', description: 'Clarify an existing request.' },
|
|
58
|
+
reply: { args: '<recipient-run-id> "<text>" --id <UUID> --request-id <UUID>', description: 'Reply to an existing request.' },
|
|
59
|
+
conversation: { args: '<recipient-run-id>', description: 'Inspect conversation messages and outcomes.' },
|
|
60
|
+
'wait-requests': { args: '<request-id>...', description: 'Register a wait for message requests, then end your turn.' },
|
|
61
|
+
'cancel-request': { args: '<request-id>', description: 'Cancel a request obligation.' },
|
|
62
|
+
};
|
|
63
|
+
const WORKER_FLAG_HELP = {
|
|
64
|
+
'--baseline': '<ref> Committed ref or parent-head; excludes dirty edits.',
|
|
65
|
+
'--request-id': '<UUID> Spawn retry ID, or request being followed up/replied to.',
|
|
66
|
+
'--backend': '<name> claude | codex | opencode | pi | cursor.',
|
|
67
|
+
'--model': '<model> Model override.',
|
|
68
|
+
'--effort': '<level> low | medium | high | xhigh | max | auto.',
|
|
69
|
+
'--workflow': '<name> Catalog workflow to run (built-in quick-task or .ai/cezar/workflows); default quick-task.',
|
|
70
|
+
'--context': '<text> Selected context; mutually exclusive with --context-file.',
|
|
71
|
+
'--context-file': '<path> UTF-8 context file; mutually exclusive with --context.',
|
|
72
|
+
'--mode': '<one|any|all> Wait mode (default any); one requires one target.',
|
|
73
|
+
'--timeout-seconds': '<1-1800> Wait or request deadline (default 600 seconds).',
|
|
74
|
+
'--request': '<UUID> Request to wait for; repeat for multiple requests.',
|
|
75
|
+
'--id': '<UUID> Message ID; reuse only for an exact retry.',
|
|
76
|
+
'--kind': '<request|progress> Whether the message requires an explicit reply.',
|
|
77
|
+
};
|
|
78
|
+
function workerHelp(operation) {
|
|
79
|
+
const operations = WORKER_USAGE.operations.filter(entry => operation === undefined || entry.name === operation);
|
|
80
|
+
const names = [...new Set(operations.map(entry => entry.name))];
|
|
81
|
+
const flags = [...new Set(operations.flatMap(entry => [...(entry.required ?? []), ...(entry.optional ?? [])]))];
|
|
82
|
+
return [
|
|
83
|
+
'cezar worker — manage owned coding workers and conversations', '', 'Usage:',
|
|
84
|
+
...names.flatMap(name => {
|
|
85
|
+
const help = WORKER_HELP[name];
|
|
86
|
+
return [` cez worker ${name} ${help.args}`, ` ${help.description}`];
|
|
87
|
+
}), '', 'Options:',
|
|
88
|
+
...flags.map(flag => ` ${flag} ${WORKER_FLAG_HELP[flag]}`),
|
|
89
|
+
' -h, --help Show help without a delegation session.', '',
|
|
90
|
+
'Required flags are shown in each synopsis. Other flags are optional.',
|
|
91
|
+
'Use cez worker <operation> --help for operation help.',
|
|
92
|
+
'Commands require an active cezar delegation session and return JSON.',
|
|
93
|
+
'Explicit help prints text and exits successfully; invalid commands return JSON errors.',
|
|
94
|
+
].join('\n');
|
|
95
|
+
}
|
|
45
96
|
class WorkerCliError extends Error {
|
|
46
97
|
}
|
|
47
98
|
function cliName(path) {
|
|
@@ -108,16 +159,25 @@ export async function runWorkerCommand(argv, env) {
|
|
|
108
159
|
console.log(token ? json.replaceAll(token, '[REDACTED]') : json);
|
|
109
160
|
};
|
|
110
161
|
try {
|
|
111
|
-
if (argv.length ===
|
|
162
|
+
if (argv.length === 1 && (argv[0] === '-h' || argv[0] === '--help')) {
|
|
163
|
+
console.log(workerHelp());
|
|
164
|
+
return 0;
|
|
165
|
+
}
|
|
166
|
+
if (argv.length === 0) {
|
|
112
167
|
print({ code: 'invalid_input', error: 'Invalid worker command arguments', usage: WORKER_USAGE });
|
|
113
168
|
return 1;
|
|
114
169
|
}
|
|
115
170
|
const operation = argv[0] === 'collect' ? 'collect' : argv[0] === 'cancel-wait' ? 'cancel-wait' : z.union([workerOperationSchema, conversationOperationSchema]).parse(argv[0]);
|
|
116
171
|
const { values, positionals } = parseArgs({ args: argv.slice(1), allowPositionals: true, strict: true, options: {
|
|
117
|
-
|
|
172
|
+
help: { type: 'boolean', short: 'h' },
|
|
173
|
+
...(operation === 'spawn' ? { baseline: { type: 'string' }, 'request-id': { type: 'string' }, workflow: { type: 'string' }, backend: { type: 'string' }, model: { type: 'string' }, effort: { type: 'string' }, context: { type: 'string' }, 'context-file': { type: 'string' } } : {}),
|
|
118
174
|
...(['send', 'progress', 'reply', 'follow-up'].includes(operation) ? { id: { type: 'string' }, kind: { type: 'string' }, 'request-id': { type: 'string' }, 'timeout-seconds': { type: 'string' } } : {}),
|
|
119
175
|
...(operation === 'wait' || operation === 'wait-requests' ? { request: { type: 'string', multiple: true }, 'timeout-seconds': { type: 'string' }, mode: { type: 'string' } } : {}),
|
|
120
176
|
} });
|
|
177
|
+
if (values.help) {
|
|
178
|
+
console.log(workerHelp(operation));
|
|
179
|
+
return 0;
|
|
180
|
+
}
|
|
121
181
|
let path = operation;
|
|
122
182
|
let body;
|
|
123
183
|
if (operation === 'send' || operation === 'progress' || operation === 'reply' || operation === 'follow-up') {
|
|
@@ -145,6 +205,7 @@ export async function runWorkerCommand(argv, env) {
|
|
|
145
205
|
body = workerSpawnRequestSchema.parse({ task: positionals[0], baseline: values.baseline, requestId: values['request-id'],
|
|
146
206
|
...(values.backend === undefined ? {} : { backend: values.backend }), ...(values.model === undefined ? {} : { model: values.model }),
|
|
147
207
|
...(values.effort === undefined ? {} : { effort: values.effort }),
|
|
208
|
+
...(values.workflow === undefined ? {} : { workflow: values.workflow }),
|
|
148
209
|
...(contextText === undefined ? {} : { context: { text: contextText } }),
|
|
149
210
|
});
|
|
150
211
|
}
|