@wjarka/cezarion 0.14.9-dev.1015 → 0.14.9-dev.1020
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/core/ask.d.ts +2 -3
- package/dist/core/ask.js +16 -10
- package/dist/core/ask.js.map +1 -1
- package/dist/delegation/routes.d.ts +50 -50
- package/dist/delegation/transport.d.ts +50 -50
- package/dist/runs/store.d.ts +10 -0
- package/dist/runs/store.js +21 -0
- package/dist/runs/store.js.map +1 -1
- package/dist/server/server.d.ts +1245 -1245
- package/dist/server/server.js +6 -3
- package/dist/server/server.js.map +1 -1
- package/package.json +3 -3
- package/scripts/mock-claude.mjs +5 -1
- package/scripts/mock-codex-app-server.mjs +6 -1
- package/scripts/mock-cursor-acp.mjs +2 -1
- package/scripts/mock-opencode-serve.mjs +7 -1
- package/scripts/mock-pi-rpc.mjs +7 -1
- package/web/dist/assets/{commit-list-DcstMSP2.js → commit-list-Clrt2fri.js} +1 -1
- package/web/dist/assets/{compare-variants-BSTikfuI.js → compare-variants-94hIoU8f.js} +1 -1
- package/web/dist/assets/{github-CNmPdhB_.js → github-Dpgdq0PM.js} +1 -1
- package/web/dist/assets/{index-DzY_fd2W.js → index-BKYnjMUh.js} +6 -6
- package/web/dist/assets/{repo-git-D1svWVbB.js → repo-git-BET_qb78.js} +1 -1
- package/web/dist/assets/{skills-CJvSNmFw.js → skills-CXRLxn_l.js} +1 -1
- package/web/dist/assets/{task-changes-CUl7-JXd.js → task-changes-B2uYO3RP.js} +1 -1
- package/web/dist/assets/{task-commits-BJRxgIVH.js → task-commits-Wd4pSn4p.js} +1 -1
- package/web/dist/assets/{task-files-CKgtm7WB.js → task-files-CG6gafc9.js} +1 -1
- package/web/dist/assets/{task-thread-DjtgrCED.js → task-thread-D00PqkWx.js} +2 -1
- package/web/dist/assets/{workflows-GtbSAkW7.js → workflows-D12QL21-.js} +1 -1
- package/web/dist/index.html +1 -1
package/dist/core/ask.d.ts
CHANGED
|
@@ -33,9 +33,8 @@ export declare function parseAskRequest(value: unknown): AskRequest | null;
|
|
|
33
33
|
/**
|
|
34
34
|
* The AskUser control marker: a trailing `CEZ:ASK <compact-json>` line (a
|
|
35
35
|
* sibling of `CEZ:DONE` / `CEZ:MONITORING`). Detected on the *assembled* turn
|
|
36
|
-
* text so delta-streaming backends can't split it
|
|
37
|
-
*
|
|
38
|
-
* to the last `}` at end-of-text.
|
|
36
|
+
* text so delta-streaming backends can't split it. The marker must begin the
|
|
37
|
+
* last nonempty line; mentions in prose or quoted logs are ordinary text.
|
|
39
38
|
*/
|
|
40
39
|
export declare const ASK_MARKER_RE: RegExp;
|
|
41
40
|
/**
|
package/dist/core/ask.js
CHANGED
|
@@ -13,14 +13,19 @@ export function parseAskRequest(value) {
|
|
|
13
13
|
/**
|
|
14
14
|
* The AskUser control marker: a trailing `CEZ:ASK <compact-json>` line (a
|
|
15
15
|
* sibling of `CEZ:DONE` / `CEZ:MONITORING`). Detected on the *assembled* turn
|
|
16
|
-
* text so delta-streaming backends can't split it
|
|
17
|
-
*
|
|
18
|
-
* to the last `}` at end-of-text.
|
|
16
|
+
* text so delta-streaming backends can't split it. The marker must begin the
|
|
17
|
+
* last nonempty line; mentions in prose or quoted logs are ordinary text.
|
|
19
18
|
*/
|
|
20
|
-
export const ASK_MARKER_RE = /CEZ:ASK[ \t]+(\{[\
|
|
19
|
+
export const ASK_MARKER_RE = /(?:^|\n)CEZ:ASK[ \t]+(\{[^\r\n]*\})\s*$/;
|
|
21
20
|
/** Looser than `ASK_MARKER_RE` so diagnostics can distinguish a malformed
|
|
22
21
|
* trailing marker from ordinary assistant prose. */
|
|
23
|
-
const ASK_MARKER_CANDIDATE_RE =
|
|
22
|
+
const ASK_MARKER_CANDIDATE_RE = /^CEZ:ASK[ \t]+(.*)$/;
|
|
23
|
+
function finalAskLine(text) {
|
|
24
|
+
const trimmed = text.trimEnd();
|
|
25
|
+
const lineStart = trimmed.lastIndexOf('\n') + 1;
|
|
26
|
+
const match = ASK_MARKER_CANDIDATE_RE.exec(trimmed.slice(lineStart));
|
|
27
|
+
return match?.[1] === undefined ? null : { prefix: trimmed.slice(0, lineStart), payload: match[1] };
|
|
28
|
+
}
|
|
24
29
|
function isRecord(value) {
|
|
25
30
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
26
31
|
}
|
|
@@ -144,16 +149,16 @@ function issuesOf(error) {
|
|
|
144
149
|
* rejected so the raw fallback stays readable.
|
|
145
150
|
*/
|
|
146
151
|
export function parseAskMarkerResult(turnText) {
|
|
147
|
-
const match =
|
|
148
|
-
if (!match
|
|
152
|
+
const match = finalAskLine(turnText);
|
|
153
|
+
if (!match)
|
|
149
154
|
return { kind: 'none' };
|
|
150
155
|
let raw;
|
|
151
156
|
let repaired = false;
|
|
152
157
|
try {
|
|
153
|
-
raw = JSON.parse(match
|
|
158
|
+
raw = JSON.parse(match.payload);
|
|
154
159
|
}
|
|
155
160
|
catch (error) {
|
|
156
|
-
const closed = closeUnbalancedJson(match
|
|
161
|
+
const closed = closeUnbalancedJson(match.payload);
|
|
157
162
|
try {
|
|
158
163
|
if (closed === null)
|
|
159
164
|
throw error;
|
|
@@ -209,6 +214,7 @@ export function stripAskMarker(text, allowRepair = true) {
|
|
|
209
214
|
const result = parseAskMarkerResult(text);
|
|
210
215
|
if (result.kind !== 'valid' || (!allowRepair && result.repaired))
|
|
211
216
|
return text;
|
|
212
|
-
|
|
217
|
+
const marker = finalAskLine(text);
|
|
218
|
+
return marker ? marker.prefix.trimEnd() : text;
|
|
213
219
|
}
|
|
214
220
|
//# sourceMappingURL=ask.js.map
|
package/dist/core/ask.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask.js","sourceRoot":"","sources":["../../src/core/ask.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAq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E,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjF,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACzD,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,WAAW,GAAG,IAAI;IAC7D,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,CAAC,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9E,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC"}
|
|
@@ -486,18 +486,6 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
486
486
|
} & {
|
|
487
487
|
"/:workerId": {
|
|
488
488
|
$get: {
|
|
489
|
-
output: {
|
|
490
|
-
error: string;
|
|
491
|
-
code?: "invalid_input" | undefined;
|
|
492
|
-
};
|
|
493
|
-
outputFormat: "json";
|
|
494
|
-
status: 400;
|
|
495
|
-
input: {
|
|
496
|
-
param: {
|
|
497
|
-
workerId: string;
|
|
498
|
-
};
|
|
499
|
-
};
|
|
500
|
-
} | {
|
|
501
489
|
output: {
|
|
502
490
|
workerId: string;
|
|
503
491
|
parentRunId: string;
|
|
@@ -574,11 +562,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
574
562
|
workerId: string;
|
|
575
563
|
};
|
|
576
564
|
};
|
|
577
|
-
}
|
|
578
|
-
};
|
|
579
|
-
} & {
|
|
580
|
-
"/:workerId/collect": {
|
|
581
|
-
$post: {
|
|
565
|
+
} | {
|
|
582
566
|
output: {
|
|
583
567
|
error: string;
|
|
584
568
|
code?: "invalid_input" | undefined;
|
|
@@ -589,10 +573,12 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
589
573
|
param: {
|
|
590
574
|
workerId: string;
|
|
591
575
|
};
|
|
592
|
-
} & {
|
|
593
|
-
json: Record<string, never>;
|
|
594
576
|
};
|
|
595
|
-
}
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
} & {
|
|
580
|
+
"/:workerId/collect": {
|
|
581
|
+
$post: {
|
|
596
582
|
output: {
|
|
597
583
|
workerId: string;
|
|
598
584
|
parentRunId: string;
|
|
@@ -694,11 +680,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
694
680
|
} & {
|
|
695
681
|
json: Record<string, never>;
|
|
696
682
|
};
|
|
697
|
-
}
|
|
698
|
-
};
|
|
699
|
-
} & {
|
|
700
|
-
"/:workerId/steer": {
|
|
701
|
-
$post: {
|
|
683
|
+
} | {
|
|
702
684
|
output: {
|
|
703
685
|
error: string;
|
|
704
686
|
code?: "invalid_input" | undefined;
|
|
@@ -710,11 +692,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
710
692
|
workerId: string;
|
|
711
693
|
};
|
|
712
694
|
} & {
|
|
713
|
-
json:
|
|
714
|
-
text: string;
|
|
715
|
-
};
|
|
695
|
+
json: Record<string, never>;
|
|
716
696
|
};
|
|
717
|
-
}
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
} & {
|
|
700
|
+
"/:workerId/steer": {
|
|
701
|
+
$post: {
|
|
718
702
|
output: {
|
|
719
703
|
workerId: string;
|
|
720
704
|
state: "delivered" | "queued";
|
|
@@ -730,11 +714,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
730
714
|
text: string;
|
|
731
715
|
};
|
|
732
716
|
};
|
|
733
|
-
}
|
|
734
|
-
};
|
|
735
|
-
} & {
|
|
736
|
-
"/:workerId/stop": {
|
|
737
|
-
$post: {
|
|
717
|
+
} | {
|
|
738
718
|
output: {
|
|
739
719
|
error: string;
|
|
740
720
|
code?: "invalid_input" | undefined;
|
|
@@ -746,9 +726,15 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
746
726
|
workerId: string;
|
|
747
727
|
};
|
|
748
728
|
} & {
|
|
749
|
-
json:
|
|
729
|
+
json: {
|
|
730
|
+
text: string;
|
|
731
|
+
};
|
|
750
732
|
};
|
|
751
|
-
}
|
|
733
|
+
};
|
|
734
|
+
};
|
|
735
|
+
} & {
|
|
736
|
+
"/:workerId/stop": {
|
|
737
|
+
$post: {
|
|
752
738
|
output: {
|
|
753
739
|
workerId: string;
|
|
754
740
|
state: "stopping" | "terminated";
|
|
@@ -762,11 +748,7 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
762
748
|
} & {
|
|
763
749
|
json: Record<string, never>;
|
|
764
750
|
};
|
|
765
|
-
}
|
|
766
|
-
};
|
|
767
|
-
} & {
|
|
768
|
-
"/:workerId/destroy": {
|
|
769
|
-
$post: {
|
|
751
|
+
} | {
|
|
770
752
|
output: {
|
|
771
753
|
error: string;
|
|
772
754
|
code?: "invalid_input" | undefined;
|
|
@@ -780,7 +762,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
780
762
|
} & {
|
|
781
763
|
json: Record<string, never>;
|
|
782
764
|
};
|
|
783
|
-
}
|
|
765
|
+
};
|
|
766
|
+
};
|
|
767
|
+
} & {
|
|
768
|
+
"/:workerId/destroy": {
|
|
769
|
+
$post: {
|
|
784
770
|
output: {
|
|
785
771
|
workerId: string;
|
|
786
772
|
state: "complete" | "incomplete";
|
|
@@ -803,6 +789,20 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
803
789
|
} & {
|
|
804
790
|
json: Record<string, never>;
|
|
805
791
|
};
|
|
792
|
+
} | {
|
|
793
|
+
output: {
|
|
794
|
+
error: string;
|
|
795
|
+
code?: "invalid_input" | undefined;
|
|
796
|
+
};
|
|
797
|
+
outputFormat: "json";
|
|
798
|
+
status: 400;
|
|
799
|
+
input: {
|
|
800
|
+
param: {
|
|
801
|
+
workerId: string;
|
|
802
|
+
};
|
|
803
|
+
} & {
|
|
804
|
+
json: Record<string, never>;
|
|
805
|
+
};
|
|
806
806
|
} | {
|
|
807
807
|
output: {
|
|
808
808
|
workerId: string;
|
|
@@ -832,11 +832,13 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
832
832
|
"/:workerId/diff": {
|
|
833
833
|
$get: {
|
|
834
834
|
output: {
|
|
835
|
-
|
|
836
|
-
|
|
835
|
+
workerId: string;
|
|
836
|
+
baselineSha: string;
|
|
837
|
+
diff: string;
|
|
838
|
+
truncated: boolean;
|
|
837
839
|
};
|
|
838
840
|
outputFormat: "json";
|
|
839
|
-
status:
|
|
841
|
+
status: 200;
|
|
840
842
|
input: {
|
|
841
843
|
param: {
|
|
842
844
|
workerId: string;
|
|
@@ -844,13 +846,11 @@ export declare function createDelegationRoutes(service: DelegationService, crede
|
|
|
844
846
|
};
|
|
845
847
|
} | {
|
|
846
848
|
output: {
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
diff: string;
|
|
850
|
-
truncated: boolean;
|
|
849
|
+
error: string;
|
|
850
|
+
code?: "invalid_input" | undefined;
|
|
851
851
|
};
|
|
852
852
|
outputFormat: "json";
|
|
853
|
-
status:
|
|
853
|
+
status: 400;
|
|
854
854
|
input: {
|
|
855
855
|
param: {
|
|
856
856
|
workerId: string;
|
|
@@ -461,6 +461,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
461
461
|
} & {
|
|
462
462
|
"/:workerId": {
|
|
463
463
|
$get: {
|
|
464
|
+
output: {
|
|
465
|
+
error: string;
|
|
466
|
+
code?: "invalid_input" | undefined;
|
|
467
|
+
};
|
|
468
|
+
outputFormat: "json";
|
|
469
|
+
status: 400;
|
|
470
|
+
input: {
|
|
471
|
+
param: {
|
|
472
|
+
workerId: string;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
} | {
|
|
464
476
|
output: {
|
|
465
477
|
workerId: string;
|
|
466
478
|
parentRunId: string;
|
|
@@ -537,7 +549,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
537
549
|
workerId: string;
|
|
538
550
|
};
|
|
539
551
|
};
|
|
540
|
-
}
|
|
552
|
+
};
|
|
553
|
+
};
|
|
554
|
+
} & {
|
|
555
|
+
"/:workerId/collect": {
|
|
556
|
+
$post: {
|
|
541
557
|
output: {
|
|
542
558
|
error: string;
|
|
543
559
|
code?: "invalid_input" | undefined;
|
|
@@ -548,12 +564,10 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
548
564
|
param: {
|
|
549
565
|
workerId: string;
|
|
550
566
|
};
|
|
567
|
+
} & {
|
|
568
|
+
json: Record<string, never>;
|
|
551
569
|
};
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
} & {
|
|
555
|
-
"/:workerId/collect": {
|
|
556
|
-
$post: {
|
|
570
|
+
} | {
|
|
557
571
|
output: {
|
|
558
572
|
workerId: string;
|
|
559
573
|
parentRunId: string;
|
|
@@ -655,7 +669,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
655
669
|
} & {
|
|
656
670
|
json: Record<string, never>;
|
|
657
671
|
};
|
|
658
|
-
}
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
} & {
|
|
675
|
+
"/:workerId/steer": {
|
|
676
|
+
$post: {
|
|
659
677
|
output: {
|
|
660
678
|
error: string;
|
|
661
679
|
code?: "invalid_input" | undefined;
|
|
@@ -667,13 +685,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
667
685
|
workerId: string;
|
|
668
686
|
};
|
|
669
687
|
} & {
|
|
670
|
-
json:
|
|
688
|
+
json: {
|
|
689
|
+
text: string;
|
|
690
|
+
};
|
|
671
691
|
};
|
|
672
|
-
}
|
|
673
|
-
};
|
|
674
|
-
} & {
|
|
675
|
-
"/:workerId/steer": {
|
|
676
|
-
$post: {
|
|
692
|
+
} | {
|
|
677
693
|
output: {
|
|
678
694
|
workerId: string;
|
|
679
695
|
state: "delivered" | "queued";
|
|
@@ -689,7 +705,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
689
705
|
text: string;
|
|
690
706
|
};
|
|
691
707
|
};
|
|
692
|
-
}
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
} & {
|
|
711
|
+
"/:workerId/stop": {
|
|
712
|
+
$post: {
|
|
693
713
|
output: {
|
|
694
714
|
error: string;
|
|
695
715
|
code?: "invalid_input" | undefined;
|
|
@@ -701,15 +721,9 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
701
721
|
workerId: string;
|
|
702
722
|
};
|
|
703
723
|
} & {
|
|
704
|
-
json:
|
|
705
|
-
text: string;
|
|
706
|
-
};
|
|
724
|
+
json: Record<string, never>;
|
|
707
725
|
};
|
|
708
|
-
}
|
|
709
|
-
};
|
|
710
|
-
} & {
|
|
711
|
-
"/:workerId/stop": {
|
|
712
|
-
$post: {
|
|
726
|
+
} | {
|
|
713
727
|
output: {
|
|
714
728
|
workerId: string;
|
|
715
729
|
state: "stopping" | "terminated";
|
|
@@ -723,7 +737,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
723
737
|
} & {
|
|
724
738
|
json: Record<string, never>;
|
|
725
739
|
};
|
|
726
|
-
}
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
} & {
|
|
743
|
+
"/:workerId/destroy": {
|
|
744
|
+
$post: {
|
|
727
745
|
output: {
|
|
728
746
|
error: string;
|
|
729
747
|
code?: "invalid_input" | undefined;
|
|
@@ -737,11 +755,7 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
737
755
|
} & {
|
|
738
756
|
json: Record<string, never>;
|
|
739
757
|
};
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
|
-
} & {
|
|
743
|
-
"/:workerId/destroy": {
|
|
744
|
-
$post: {
|
|
758
|
+
} | {
|
|
745
759
|
output: {
|
|
746
760
|
workerId: string;
|
|
747
761
|
state: "complete" | "incomplete";
|
|
@@ -764,20 +778,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
764
778
|
} & {
|
|
765
779
|
json: Record<string, never>;
|
|
766
780
|
};
|
|
767
|
-
} | {
|
|
768
|
-
output: {
|
|
769
|
-
error: string;
|
|
770
|
-
code?: "invalid_input" | undefined;
|
|
771
|
-
};
|
|
772
|
-
outputFormat: "json";
|
|
773
|
-
status: 400;
|
|
774
|
-
input: {
|
|
775
|
-
param: {
|
|
776
|
-
workerId: string;
|
|
777
|
-
};
|
|
778
|
-
} & {
|
|
779
|
-
json: Record<string, never>;
|
|
780
|
-
};
|
|
781
781
|
} | {
|
|
782
782
|
output: {
|
|
783
783
|
workerId: string;
|
|
@@ -807,13 +807,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
807
807
|
"/:workerId/diff": {
|
|
808
808
|
$get: {
|
|
809
809
|
output: {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
diff: string;
|
|
813
|
-
truncated: boolean;
|
|
810
|
+
error: string;
|
|
811
|
+
code?: "invalid_input" | undefined;
|
|
814
812
|
};
|
|
815
813
|
outputFormat: "json";
|
|
816
|
-
status:
|
|
814
|
+
status: 400;
|
|
817
815
|
input: {
|
|
818
816
|
param: {
|
|
819
817
|
workerId: string;
|
|
@@ -821,11 +819,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
821
819
|
};
|
|
822
820
|
} | {
|
|
823
821
|
output: {
|
|
824
|
-
|
|
825
|
-
|
|
822
|
+
workerId: string;
|
|
823
|
+
baselineSha: string;
|
|
824
|
+
diff: string;
|
|
825
|
+
truncated: boolean;
|
|
826
826
|
};
|
|
827
827
|
outputFormat: "json";
|
|
828
|
-
status:
|
|
828
|
+
status: 200;
|
|
829
829
|
input: {
|
|
830
830
|
param: {
|
|
831
831
|
workerId: string;
|
package/dist/runs/store.d.ts
CHANGED
|
@@ -1282,6 +1282,16 @@ export declare class RunStore extends EventEmitter {
|
|
|
1282
1282
|
setRepoHandle(handle: RepoHandle | null): void;
|
|
1283
1283
|
listRuns(): RunRecord[];
|
|
1284
1284
|
getRun(id: string): RunRecord | undefined;
|
|
1285
|
+
/**
|
|
1286
|
+
* The workers a root run owns, newest first, read off its own `receipts` (#659). Every
|
|
1287
|
+
* `createOwnedRun` writes the receipt and the worker record in one transaction, and the
|
|
1288
|
+
* receipt list is capped at 32, so this is a bounded lookup rather than a walk of the whole
|
|
1289
|
+
* project index. An ordinary or worker run owns nothing and costs one map read; a receipt
|
|
1290
|
+
* whose record has been deleted is skipped, never invented. A parent quarantined to
|
|
1291
|
+
* `invalid` has no readable receipts and reports none, which is also what the cockpit
|
|
1292
|
+
* assumes for that role.
|
|
1293
|
+
*/
|
|
1294
|
+
listOwnedWorkers(parentId: string): RunRecord[];
|
|
1285
1295
|
/** The run an idempotent start already created (#504), archived or not. A deleted run is gone
|
|
1286
1296
|
* with its record, so a retry after deletion honestly creates a fresh one. */
|
|
1287
1297
|
findRunByClientRequestId(clientRequestId: string): RunRecord | undefined;
|
package/dist/runs/store.js
CHANGED
|
@@ -792,6 +792,27 @@ export class RunStore extends EventEmitter {
|
|
|
792
792
|
getRun(id) {
|
|
793
793
|
return this.runs.get(id);
|
|
794
794
|
}
|
|
795
|
+
/**
|
|
796
|
+
* The workers a root run owns, newest first, read off its own `receipts` (#659). Every
|
|
797
|
+
* `createOwnedRun` writes the receipt and the worker record in one transaction, and the
|
|
798
|
+
* receipt list is capped at 32, so this is a bounded lookup rather than a walk of the whole
|
|
799
|
+
* project index. An ordinary or worker run owns nothing and costs one map read; a receipt
|
|
800
|
+
* whose record has been deleted is skipped, never invented. A parent quarantined to
|
|
801
|
+
* `invalid` has no readable receipts and reports none, which is also what the cockpit
|
|
802
|
+
* assumes for that role.
|
|
803
|
+
*/
|
|
804
|
+
listOwnedWorkers(parentId) {
|
|
805
|
+
const parent = this.runs.get(parentId);
|
|
806
|
+
if (parent?.delegation?.role !== 'root')
|
|
807
|
+
return [];
|
|
808
|
+
const workers = [];
|
|
809
|
+
for (const receipt of parent.delegation.receipts) {
|
|
810
|
+
const worker = this.runs.get(receipt.workerId);
|
|
811
|
+
if (worker?.delegation?.role === 'worker' && worker.delegation.parentRunId === parentId)
|
|
812
|
+
workers.push(worker);
|
|
813
|
+
}
|
|
814
|
+
return workers.sort((a, b) => b.createdAt.localeCompare(a.createdAt));
|
|
815
|
+
}
|
|
795
816
|
/** The run an idempotent start already created (#504), archived or not. A deleted run is gone
|
|
796
817
|
* with its record, so a retry after deletion honestly creates a fresh one. */
|
|
797
818
|
findRunByClientRequestId(clientRequestId) {
|