jg-agent-hq 0.2.0 → 0.4.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/CHANGELOG.md +12 -0
- package/README.md +7 -4
- package/api/README.md +35 -17
- package/dist/actions/live/live.d.ts +4 -1
- package/dist/actions/live/live.js +22 -6
- package/dist/actions/reads.d.ts +1 -1
- package/dist/actions/reads.js +4 -2
- package/dist/contracts/actions/types.d.ts +6 -6
- package/dist/contracts/actions/types.js +1 -1
- package/dist/contracts/browser/index.d.ts +4 -0
- package/dist/contracts/browser/index.js +6 -0
- package/dist/contracts/browser/types.d.ts +2475 -0
- package/dist/contracts/browser/types.js +109 -0
- package/dist/contracts/handoffs/types.d.ts +5 -5
- package/dist/contracts/index.d.ts +4 -0
- package/dist/contracts/index.js +6 -0
- package/dist/contracts/plans/types.d.ts +25 -25
- package/dist/contracts/plans/types.js +9 -10
- package/dist/contracts/types.d.ts +96 -30
- package/dist/contracts/types.js +10 -2
- package/dist/handoffs/types.d.ts +6 -6
- package/dist/plans/admission.d.ts +2 -2
- package/dist/plans/admission.js +24 -16
- package/dist/plans/authority.d.ts +6 -0
- package/dist/plans/authority.js +39 -8
- package/dist/plans/finalization.d.ts +1 -1
- package/dist/plans/finalization.js +4 -3
- package/dist/plans/plans.d.ts +3 -3
- package/dist/plans/plans.js +9 -11
- package/dist/plans/reconciliation.js +3 -3
- package/dist/plans/revisions.d.ts +2 -2
- package/dist/plans/revisions.js +21 -3
- package/dist/plans/types.d.ts +4 -4
- package/dist/providers/claude/control/control.d.ts +1 -1
- package/dist/providers/claude/history/types.d.ts +39 -11
- package/dist/runtime/browser/browser.d.ts +8 -0
- package/dist/runtime/browser/browser.js +55 -0
- package/dist/runtime/browser/index.d.ts +1 -0
- package/dist/runtime/browser/index.js +2 -0
- package/dist/runtime/runtime.js +12 -1
- package/dist/runtime/types.d.ts +19 -1
- package/dist/store/browser/browser.model.d.ts +24 -0
- package/dist/store/browser/browser.model.js +75 -0
- package/dist/store/browser/index.d.ts +1 -0
- package/dist/store/browser/index.js +2 -0
- package/dist/store/control/types.d.ts +6 -6
- package/dist/store/plans/plans.model.d.ts +2 -2
- package/dist/store/plans/plans.model.js +1 -1
- package/dist/store/schema.sql +15 -2
- package/dist/store/store.js +4 -1
- package/dist/store/store.worker.js +11 -0
- package/dist/store/types.d.ts +1545 -510
- package/dist/store/types.js +17 -1
- package/errors/README.md +11 -1
- package/package.json +1 -1
|
@@ -53,7 +53,7 @@ export declare const HqRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
53
53
|
}, z.core.$strict>;
|
|
54
54
|
kind: z.ZodLiteral<"finalize">;
|
|
55
55
|
}, z.core.$strict>, z.ZodObject<{
|
|
56
|
-
milestoneId: z.ZodUUID
|
|
56
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
57
57
|
checks: z.ZodArray<z.ZodObject<{
|
|
58
58
|
command: z.ZodString;
|
|
59
59
|
outcome: z.ZodLiteral<"passed">;
|
|
@@ -239,7 +239,7 @@ export declare const HqRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
239
239
|
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
240
240
|
}, z.core.$strict>;
|
|
241
241
|
authorizationId: z.ZodUUID;
|
|
242
|
-
milestoneId: z.ZodUUID
|
|
242
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
243
243
|
mode: z.ZodEnum<{
|
|
244
244
|
supervised: "supervised";
|
|
245
245
|
auto: "auto";
|
|
@@ -464,7 +464,7 @@ export declare const HqRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
464
464
|
plan: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
465
465
|
kind: z.ZodLiteral<"execution">;
|
|
466
466
|
authorizationId: z.ZodUUID;
|
|
467
|
-
milestoneId: z.ZodUUID
|
|
467
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
468
468
|
mode: z.ZodEnum<{
|
|
469
469
|
supervised: "supervised";
|
|
470
470
|
auto: "auto";
|
|
@@ -483,7 +483,7 @@ export declare const HqRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
483
483
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
484
484
|
kind: z.ZodLiteral<"execution">;
|
|
485
485
|
authorizationId: z.ZodUUID;
|
|
486
|
-
milestoneId: z.ZodUUID
|
|
486
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
487
487
|
mode: z.ZodEnum<{
|
|
488
488
|
supervised: "supervised";
|
|
489
489
|
auto: "auto";
|
|
@@ -514,6 +514,9 @@ export declare const HqRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
514
514
|
}, z.core.$strict>, z.ZodObject<{
|
|
515
515
|
kind: z.ZodLiteral<"managed-thread">;
|
|
516
516
|
threadId: z.ZodUUID;
|
|
517
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
518
|
+
kind: z.ZodLiteral<"thread-plan">;
|
|
519
|
+
threadId: z.ZodUUID;
|
|
517
520
|
}, z.core.$strict>, z.ZodObject<{
|
|
518
521
|
kind: z.ZodLiteral<"managed-thread-name">;
|
|
519
522
|
name: z.ZodString;
|
|
@@ -536,6 +539,7 @@ export declare const HqRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
536
539
|
}, z.core.$strict>, z.ZodObject<{
|
|
537
540
|
kind: z.ZodLiteral<"live-items">;
|
|
538
541
|
threadId: z.ZodUUID;
|
|
542
|
+
afterRevision: z.ZodOptional<z.ZodNumber>;
|
|
539
543
|
}, z.core.$strict>], "kind">;
|
|
540
544
|
export type IHqRequest = z.infer<typeof HqRequestSchema>;
|
|
541
545
|
export type IHqRequestInput = z.input<typeof HqRequestSchema>;
|
|
@@ -597,6 +601,8 @@ export declare const HistoryItemSchema: z.ZodObject<{
|
|
|
597
601
|
}, z.core.$strip>;
|
|
598
602
|
export type IHistoryItem = z.infer<typeof HistoryItemSchema>;
|
|
599
603
|
export declare const LiveItemsSchema: z.ZodObject<{
|
|
604
|
+
revision: z.ZodNumber;
|
|
605
|
+
unchanged: z.ZodBoolean;
|
|
600
606
|
data: z.ZodArray<z.ZodObject<{
|
|
601
607
|
nativeId: z.ZodString;
|
|
602
608
|
turnId: z.ZodString;
|
|
@@ -687,6 +693,32 @@ export declare const RuntimeStatusSchema: z.ZodObject<{
|
|
|
687
693
|
}, z.core.$strip>;
|
|
688
694
|
export type IRuntimeStatus = z.infer<typeof RuntimeStatusSchema>;
|
|
689
695
|
export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
696
|
+
kind: z.ZodLiteral<"thread-plan">;
|
|
697
|
+
result: z.ZodNullable<z.ZodObject<{
|
|
698
|
+
directory: z.ZodString;
|
|
699
|
+
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
700
|
+
kind: z.ZodLiteral<"execution">;
|
|
701
|
+
authorizationId: z.ZodUUID;
|
|
702
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
703
|
+
mode: z.ZodEnum<{
|
|
704
|
+
supervised: "supervised";
|
|
705
|
+
auto: "auto";
|
|
706
|
+
}>;
|
|
707
|
+
revision: z.ZodObject<{
|
|
708
|
+
planDigest: z.ZodString;
|
|
709
|
+
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
710
|
+
}, z.core.$strict>;
|
|
711
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
712
|
+
kind: z.ZodLiteral<"planning">;
|
|
713
|
+
revisionId: z.ZodUUID;
|
|
714
|
+
invocationId: z.ZodUUID;
|
|
715
|
+
}, z.core.$strict>], "kind">>;
|
|
716
|
+
observedRevision: z.ZodObject<{
|
|
717
|
+
planDigest: z.ZodString;
|
|
718
|
+
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
719
|
+
}, z.core.$strict>;
|
|
720
|
+
}, z.core.$strict>>;
|
|
721
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
690
722
|
kind: z.ZodLiteral<"status">;
|
|
691
723
|
result: z.ZodObject<{
|
|
692
724
|
runtimeEpoch: z.ZodUUID;
|
|
@@ -797,7 +829,7 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
797
829
|
planDigest: z.ZodString;
|
|
798
830
|
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
799
831
|
}, z.core.$strict>;
|
|
800
|
-
fileHash: z.ZodString
|
|
832
|
+
fileHash: z.ZodNullable<z.ZodString>;
|
|
801
833
|
createdAt: z.ZodNumber;
|
|
802
834
|
}, z.core.$strict>>;
|
|
803
835
|
planApproval: z.ZodNullable<z.ZodObject<{
|
|
@@ -1017,7 +1049,7 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1017
1049
|
planDigest: z.ZodString;
|
|
1018
1050
|
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
1019
1051
|
}, z.core.$strict>;
|
|
1020
|
-
fileHash: z.ZodString
|
|
1052
|
+
fileHash: z.ZodNullable<z.ZodString>;
|
|
1021
1053
|
createdAt: z.ZodNumber;
|
|
1022
1054
|
}, z.core.$strict>>;
|
|
1023
1055
|
planApproval: z.ZodNullable<z.ZodObject<{
|
|
@@ -1205,7 +1237,7 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1205
1237
|
reference: z.ZodString;
|
|
1206
1238
|
}, z.core.$strict>;
|
|
1207
1239
|
}, z.core.$strict>;
|
|
1208
|
-
milestoneId: z.ZodUUID
|
|
1240
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
1209
1241
|
revision: z.ZodObject<{
|
|
1210
1242
|
planDigest: z.ZodString;
|
|
1211
1243
|
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
@@ -1213,7 +1245,7 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1213
1245
|
contractDigest: z.ZodString;
|
|
1214
1246
|
title: z.ZodString;
|
|
1215
1247
|
contract: z.ZodString;
|
|
1216
|
-
sharedDigest: z.ZodString
|
|
1248
|
+
sharedDigest: z.ZodNullable<z.ZodString>;
|
|
1217
1249
|
checkouts: z.ZodArray<z.ZodObject<{
|
|
1218
1250
|
repository: z.ZodString;
|
|
1219
1251
|
directory: z.ZodString;
|
|
@@ -1361,7 +1393,7 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1361
1393
|
planDigest: z.ZodString;
|
|
1362
1394
|
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
1363
1395
|
}, z.core.$strict>;
|
|
1364
|
-
fileHash: z.ZodString
|
|
1396
|
+
fileHash: z.ZodNullable<z.ZodString>;
|
|
1365
1397
|
createdAt: z.ZodNumber;
|
|
1366
1398
|
}, z.core.$strict>>;
|
|
1367
1399
|
planApproval: z.ZodNullable<z.ZodObject<{
|
|
@@ -1500,7 +1532,7 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1500
1532
|
}, z.core.$strict>>;
|
|
1501
1533
|
}, z.core.$strict>;
|
|
1502
1534
|
}, z.core.$strip>;
|
|
1503
|
-
content: z.ZodString
|
|
1535
|
+
content: z.ZodNullable<z.ZodString>;
|
|
1504
1536
|
}, z.core.$strip>, z.ZodObject<{
|
|
1505
1537
|
kind: z.ZodLiteral<"milestones">;
|
|
1506
1538
|
result: z.ZodObject<{
|
|
@@ -1581,7 +1613,7 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1581
1613
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1582
1614
|
kind: z.ZodLiteral<"execution">;
|
|
1583
1615
|
authorizationId: z.ZodUUID;
|
|
1584
|
-
milestoneId: z.ZodUUID
|
|
1616
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
1585
1617
|
mode: z.ZodEnum<{
|
|
1586
1618
|
supervised: "supervised";
|
|
1587
1619
|
auto: "auto";
|
|
@@ -1714,7 +1746,7 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1714
1746
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1715
1747
|
kind: z.ZodLiteral<"execution">;
|
|
1716
1748
|
authorizationId: z.ZodUUID;
|
|
1717
|
-
milestoneId: z.ZodUUID
|
|
1749
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
1718
1750
|
mode: z.ZodEnum<{
|
|
1719
1751
|
supervised: "supervised";
|
|
1720
1752
|
auto: "auto";
|
|
@@ -2051,7 +2083,7 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2051
2083
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2052
2084
|
kind: z.ZodLiteral<"execution">;
|
|
2053
2085
|
authorizationId: z.ZodUUID;
|
|
2054
|
-
milestoneId: z.ZodUUID
|
|
2086
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
2055
2087
|
mode: z.ZodEnum<{
|
|
2056
2088
|
supervised: "supervised";
|
|
2057
2089
|
auto: "auto";
|
|
@@ -2127,7 +2159,7 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2127
2159
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2128
2160
|
kind: z.ZodLiteral<"execution">;
|
|
2129
2161
|
authorizationId: z.ZodUUID;
|
|
2130
|
-
milestoneId: z.ZodUUID
|
|
2162
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
2131
2163
|
mode: z.ZodEnum<{
|
|
2132
2164
|
supervised: "supervised";
|
|
2133
2165
|
auto: "auto";
|
|
@@ -2315,7 +2347,7 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2315
2347
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2316
2348
|
kind: z.ZodLiteral<"execution">;
|
|
2317
2349
|
authorizationId: z.ZodUUID;
|
|
2318
|
-
milestoneId: z.ZodUUID
|
|
2350
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
2319
2351
|
mode: z.ZodEnum<{
|
|
2320
2352
|
supervised: "supervised";
|
|
2321
2353
|
auto: "auto";
|
|
@@ -2406,6 +2438,8 @@ export declare const HqResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2406
2438
|
}, z.core.$strip>, z.ZodObject<{
|
|
2407
2439
|
kind: z.ZodLiteral<"live-items">;
|
|
2408
2440
|
result: z.ZodObject<{
|
|
2441
|
+
revision: z.ZodNumber;
|
|
2442
|
+
unchanged: z.ZodBoolean;
|
|
2409
2443
|
data: z.ZodArray<z.ZodObject<{
|
|
2410
2444
|
nativeId: z.ZodString;
|
|
2411
2445
|
turnId: z.ZodString;
|
|
@@ -2496,7 +2530,7 @@ export declare const IpcRequestSchema: z.ZodObject<{
|
|
|
2496
2530
|
}, z.core.$strict>;
|
|
2497
2531
|
kind: z.ZodLiteral<"finalize">;
|
|
2498
2532
|
}, z.core.$strict>, z.ZodObject<{
|
|
2499
|
-
milestoneId: z.ZodUUID
|
|
2533
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
2500
2534
|
checks: z.ZodArray<z.ZodObject<{
|
|
2501
2535
|
command: z.ZodString;
|
|
2502
2536
|
outcome: z.ZodLiteral<"passed">;
|
|
@@ -2682,7 +2716,7 @@ export declare const IpcRequestSchema: z.ZodObject<{
|
|
|
2682
2716
|
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
2683
2717
|
}, z.core.$strict>;
|
|
2684
2718
|
authorizationId: z.ZodUUID;
|
|
2685
|
-
milestoneId: z.ZodUUID
|
|
2719
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
2686
2720
|
mode: z.ZodEnum<{
|
|
2687
2721
|
supervised: "supervised";
|
|
2688
2722
|
auto: "auto";
|
|
@@ -2907,7 +2941,7 @@ export declare const IpcRequestSchema: z.ZodObject<{
|
|
|
2907
2941
|
plan: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2908
2942
|
kind: z.ZodLiteral<"execution">;
|
|
2909
2943
|
authorizationId: z.ZodUUID;
|
|
2910
|
-
milestoneId: z.ZodUUID
|
|
2944
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
2911
2945
|
mode: z.ZodEnum<{
|
|
2912
2946
|
supervised: "supervised";
|
|
2913
2947
|
auto: "auto";
|
|
@@ -2926,7 +2960,7 @@ export declare const IpcRequestSchema: z.ZodObject<{
|
|
|
2926
2960
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2927
2961
|
kind: z.ZodLiteral<"execution">;
|
|
2928
2962
|
authorizationId: z.ZodUUID;
|
|
2929
|
-
milestoneId: z.ZodUUID
|
|
2963
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
2930
2964
|
mode: z.ZodEnum<{
|
|
2931
2965
|
supervised: "supervised";
|
|
2932
2966
|
auto: "auto";
|
|
@@ -2957,6 +2991,9 @@ export declare const IpcRequestSchema: z.ZodObject<{
|
|
|
2957
2991
|
}, z.core.$strict>, z.ZodObject<{
|
|
2958
2992
|
kind: z.ZodLiteral<"managed-thread">;
|
|
2959
2993
|
threadId: z.ZodUUID;
|
|
2994
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
2995
|
+
kind: z.ZodLiteral<"thread-plan">;
|
|
2996
|
+
threadId: z.ZodUUID;
|
|
2960
2997
|
}, z.core.$strict>, z.ZodObject<{
|
|
2961
2998
|
kind: z.ZodLiteral<"managed-thread-name">;
|
|
2962
2999
|
name: z.ZodString;
|
|
@@ -2979,6 +3016,7 @@ export declare const IpcRequestSchema: z.ZodObject<{
|
|
|
2979
3016
|
}, z.core.$strict>, z.ZodObject<{
|
|
2980
3017
|
kind: z.ZodLiteral<"live-items">;
|
|
2981
3018
|
threadId: z.ZodUUID;
|
|
3019
|
+
afterRevision: z.ZodOptional<z.ZodNumber>;
|
|
2982
3020
|
}, z.core.$strict>], "kind">;
|
|
2983
3021
|
}, z.core.$strict>;
|
|
2984
3022
|
export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -2986,6 +3024,32 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
2986
3024
|
id: z.ZodUUID;
|
|
2987
3025
|
success: z.ZodLiteral<true>;
|
|
2988
3026
|
response: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3027
|
+
kind: z.ZodLiteral<"thread-plan">;
|
|
3028
|
+
result: z.ZodNullable<z.ZodObject<{
|
|
3029
|
+
directory: z.ZodString;
|
|
3030
|
+
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3031
|
+
kind: z.ZodLiteral<"execution">;
|
|
3032
|
+
authorizationId: z.ZodUUID;
|
|
3033
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
3034
|
+
mode: z.ZodEnum<{
|
|
3035
|
+
supervised: "supervised";
|
|
3036
|
+
auto: "auto";
|
|
3037
|
+
}>;
|
|
3038
|
+
revision: z.ZodObject<{
|
|
3039
|
+
planDigest: z.ZodString;
|
|
3040
|
+
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
3041
|
+
}, z.core.$strict>;
|
|
3042
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3043
|
+
kind: z.ZodLiteral<"planning">;
|
|
3044
|
+
revisionId: z.ZodUUID;
|
|
3045
|
+
invocationId: z.ZodUUID;
|
|
3046
|
+
}, z.core.$strict>], "kind">>;
|
|
3047
|
+
observedRevision: z.ZodObject<{
|
|
3048
|
+
planDigest: z.ZodString;
|
|
3049
|
+
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
3050
|
+
}, z.core.$strict>;
|
|
3051
|
+
}, z.core.$strict>>;
|
|
3052
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
2989
3053
|
kind: z.ZodLiteral<"status">;
|
|
2990
3054
|
result: z.ZodObject<{
|
|
2991
3055
|
runtimeEpoch: z.ZodUUID;
|
|
@@ -3096,7 +3160,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3096
3160
|
planDigest: z.ZodString;
|
|
3097
3161
|
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
3098
3162
|
}, z.core.$strict>;
|
|
3099
|
-
fileHash: z.ZodString
|
|
3163
|
+
fileHash: z.ZodNullable<z.ZodString>;
|
|
3100
3164
|
createdAt: z.ZodNumber;
|
|
3101
3165
|
}, z.core.$strict>>;
|
|
3102
3166
|
planApproval: z.ZodNullable<z.ZodObject<{
|
|
@@ -3316,7 +3380,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3316
3380
|
planDigest: z.ZodString;
|
|
3317
3381
|
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
3318
3382
|
}, z.core.$strict>;
|
|
3319
|
-
fileHash: z.ZodString
|
|
3383
|
+
fileHash: z.ZodNullable<z.ZodString>;
|
|
3320
3384
|
createdAt: z.ZodNumber;
|
|
3321
3385
|
}, z.core.$strict>>;
|
|
3322
3386
|
planApproval: z.ZodNullable<z.ZodObject<{
|
|
@@ -3504,7 +3568,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3504
3568
|
reference: z.ZodString;
|
|
3505
3569
|
}, z.core.$strict>;
|
|
3506
3570
|
}, z.core.$strict>;
|
|
3507
|
-
milestoneId: z.ZodUUID
|
|
3571
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
3508
3572
|
revision: z.ZodObject<{
|
|
3509
3573
|
planDigest: z.ZodString;
|
|
3510
3574
|
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
@@ -3512,7 +3576,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3512
3576
|
contractDigest: z.ZodString;
|
|
3513
3577
|
title: z.ZodString;
|
|
3514
3578
|
contract: z.ZodString;
|
|
3515
|
-
sharedDigest: z.ZodString
|
|
3579
|
+
sharedDigest: z.ZodNullable<z.ZodString>;
|
|
3516
3580
|
checkouts: z.ZodArray<z.ZodObject<{
|
|
3517
3581
|
repository: z.ZodString;
|
|
3518
3582
|
directory: z.ZodString;
|
|
@@ -3660,7 +3724,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3660
3724
|
planDigest: z.ZodString;
|
|
3661
3725
|
breakdownDigest: z.ZodNullable<z.ZodString>;
|
|
3662
3726
|
}, z.core.$strict>;
|
|
3663
|
-
fileHash: z.ZodString
|
|
3727
|
+
fileHash: z.ZodNullable<z.ZodString>;
|
|
3664
3728
|
createdAt: z.ZodNumber;
|
|
3665
3729
|
}, z.core.$strict>>;
|
|
3666
3730
|
planApproval: z.ZodNullable<z.ZodObject<{
|
|
@@ -3799,7 +3863,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3799
3863
|
}, z.core.$strict>>;
|
|
3800
3864
|
}, z.core.$strict>;
|
|
3801
3865
|
}, z.core.$strip>;
|
|
3802
|
-
content: z.ZodString
|
|
3866
|
+
content: z.ZodNullable<z.ZodString>;
|
|
3803
3867
|
}, z.core.$strip>, z.ZodObject<{
|
|
3804
3868
|
kind: z.ZodLiteral<"milestones">;
|
|
3805
3869
|
result: z.ZodObject<{
|
|
@@ -3880,7 +3944,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
3880
3944
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3881
3945
|
kind: z.ZodLiteral<"execution">;
|
|
3882
3946
|
authorizationId: z.ZodUUID;
|
|
3883
|
-
milestoneId: z.ZodUUID
|
|
3947
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
3884
3948
|
mode: z.ZodEnum<{
|
|
3885
3949
|
supervised: "supervised";
|
|
3886
3950
|
auto: "auto";
|
|
@@ -4013,7 +4077,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4013
4077
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4014
4078
|
kind: z.ZodLiteral<"execution">;
|
|
4015
4079
|
authorizationId: z.ZodUUID;
|
|
4016
|
-
milestoneId: z.ZodUUID
|
|
4080
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
4017
4081
|
mode: z.ZodEnum<{
|
|
4018
4082
|
supervised: "supervised";
|
|
4019
4083
|
auto: "auto";
|
|
@@ -4350,7 +4414,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4350
4414
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4351
4415
|
kind: z.ZodLiteral<"execution">;
|
|
4352
4416
|
authorizationId: z.ZodUUID;
|
|
4353
|
-
milestoneId: z.ZodUUID
|
|
4417
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
4354
4418
|
mode: z.ZodEnum<{
|
|
4355
4419
|
supervised: "supervised";
|
|
4356
4420
|
auto: "auto";
|
|
@@ -4426,7 +4490,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4426
4490
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4427
4491
|
kind: z.ZodLiteral<"execution">;
|
|
4428
4492
|
authorizationId: z.ZodUUID;
|
|
4429
|
-
milestoneId: z.ZodUUID
|
|
4493
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
4430
4494
|
mode: z.ZodEnum<{
|
|
4431
4495
|
supervised: "supervised";
|
|
4432
4496
|
auto: "auto";
|
|
@@ -4614,7 +4678,7 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4614
4678
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4615
4679
|
kind: z.ZodLiteral<"execution">;
|
|
4616
4680
|
authorizationId: z.ZodUUID;
|
|
4617
|
-
milestoneId: z.ZodUUID
|
|
4681
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
4618
4682
|
mode: z.ZodEnum<{
|
|
4619
4683
|
supervised: "supervised";
|
|
4620
4684
|
auto: "auto";
|
|
@@ -4705,6 +4769,8 @@ export declare const IpcResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4705
4769
|
}, z.core.$strip>, z.ZodObject<{
|
|
4706
4770
|
kind: z.ZodLiteral<"live-items">;
|
|
4707
4771
|
result: z.ZodObject<{
|
|
4772
|
+
revision: z.ZodNumber;
|
|
4773
|
+
unchanged: z.ZodBoolean;
|
|
4708
4774
|
data: z.ZodArray<z.ZodObject<{
|
|
4709
4775
|
nativeId: z.ZodString;
|
|
4710
4776
|
turnId: z.ZodString;
|
package/dist/contracts/types.js
CHANGED
|
@@ -4,7 +4,7 @@ import { SkillIdSchema, SkillPageSchema, SkillPreviewSchema } from './skills/ind
|
|
|
4
4
|
import { HandoffCommandSchema, HandoffResultSchema } from './handoffs/index.js';
|
|
5
5
|
import { NativeIdSchema } from './identities/index.js';
|
|
6
6
|
import { PlanCommandSchema, PlanResultSchema } from './plans/index.js';
|
|
7
|
-
import { ActionEnvelopeSchema, ActionReceiptSchema, ActionSummarySchema, ManagedThreadSchema, NativeApprovalSchema, LifecycleEventSchema, } from './actions/index.js';
|
|
7
|
+
import { ActionPlanContextSchema, ActionEnvelopeSchema, ActionReceiptSchema, ActionSummarySchema, ManagedThreadSchema, NativeApprovalSchema, LifecycleEventSchema, } from './actions/index.js';
|
|
8
8
|
// opaque native identifiers, bounded independently of provider-specific formats
|
|
9
9
|
const CursorSchema = z.string().min(1).max(16_384);
|
|
10
10
|
const PageFields = {
|
|
@@ -58,6 +58,7 @@ export const HqRequestSchema = z.discriminatedUnion('kind', [
|
|
|
58
58
|
...PageFields,
|
|
59
59
|
}),
|
|
60
60
|
z.strictObject({ kind: z.literal('managed-thread'), threadId: z.uuid() }),
|
|
61
|
+
z.strictObject({ kind: z.literal('thread-plan'), threadId: z.uuid() }),
|
|
61
62
|
z.strictObject({
|
|
62
63
|
kind: z.literal('managed-thread-name'),
|
|
63
64
|
name: z.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/i),
|
|
@@ -71,7 +72,11 @@ export const HqRequestSchema = z.discriminatedUnion('kind', [
|
|
|
71
72
|
limit: PageFields.limit,
|
|
72
73
|
}),
|
|
73
74
|
z.strictObject({ kind: z.literal('approvals'), threadId: z.uuid() }),
|
|
74
|
-
z.strictObject({
|
|
75
|
+
z.strictObject({
|
|
76
|
+
kind: z.literal('live-items'),
|
|
77
|
+
threadId: z.uuid(),
|
|
78
|
+
afterRevision: z.number().int().nonnegative().optional(),
|
|
79
|
+
}),
|
|
75
80
|
]);
|
|
76
81
|
// native discovery is external/read-only until explicitly adopted for control
|
|
77
82
|
export const ThreadSummarySchema = z.object({
|
|
@@ -102,6 +107,8 @@ export const HistoryItemSchema = z.object({
|
|
|
102
107
|
isTruncated: z.boolean(),
|
|
103
108
|
});
|
|
104
109
|
export const LiveItemsSchema = z.object({
|
|
110
|
+
revision: z.number().int().nonnegative(),
|
|
111
|
+
unchanged: z.boolean(),
|
|
105
112
|
data: z.array(HistoryItemSchema.extend({ state: z.enum(['active', 'awaiting-flush']) })).max(128),
|
|
106
113
|
hasGap: z.boolean(),
|
|
107
114
|
});
|
|
@@ -141,6 +148,7 @@ export const RuntimeStatusSchema = z.object({
|
|
|
141
148
|
});
|
|
142
149
|
const PageResultFields = { nextCursor: CursorSchema.nullable(), source: z.literal('native') };
|
|
143
150
|
export const HqResponseSchema = z.discriminatedUnion('kind', [
|
|
151
|
+
z.object({ kind: z.literal('thread-plan'), result: ActionPlanContextSchema.nullable() }),
|
|
144
152
|
z.object({ kind: z.literal('status'), result: RuntimeStatusSchema }),
|
|
145
153
|
z.object({ kind: z.literal('plan'), result: PlanResultSchema }),
|
|
146
154
|
z.object({ kind: z.literal('handoff'), result: HandoffResultSchema }),
|
package/dist/handoffs/types.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare const HandoffRecordSchema: z.ZodObject<{
|
|
|
19
19
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
20
20
|
kind: z.ZodLiteral<"execution">;
|
|
21
21
|
authorizationId: z.ZodUUID;
|
|
22
|
-
milestoneId: z.ZodUUID
|
|
22
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
23
23
|
mode: z.ZodEnum<{
|
|
24
24
|
supervised: "supervised";
|
|
25
25
|
auto: "auto";
|
|
@@ -155,7 +155,7 @@ export declare const HandoffRecordSchema: z.ZodObject<{
|
|
|
155
155
|
plan: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
156
156
|
kind: z.ZodLiteral<"execution">;
|
|
157
157
|
authorizationId: z.ZodUUID;
|
|
158
|
-
milestoneId: z.ZodUUID
|
|
158
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
159
159
|
mode: z.ZodEnum<{
|
|
160
160
|
supervised: "supervised";
|
|
161
161
|
auto: "auto";
|
|
@@ -174,7 +174,7 @@ export declare const HandoffRecordSchema: z.ZodObject<{
|
|
|
174
174
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
175
175
|
kind: z.ZodLiteral<"execution">;
|
|
176
176
|
authorizationId: z.ZodUUID;
|
|
177
|
-
milestoneId: z.ZodUUID
|
|
177
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
178
178
|
mode: z.ZodEnum<{
|
|
179
179
|
supervised: "supervised";
|
|
180
180
|
auto: "auto";
|
|
@@ -333,7 +333,7 @@ export declare const HandoffDispatchSchema: z.ZodObject<{
|
|
|
333
333
|
plan: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
334
334
|
kind: z.ZodLiteral<"execution">;
|
|
335
335
|
authorizationId: z.ZodUUID;
|
|
336
|
-
milestoneId: z.ZodUUID
|
|
336
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
337
337
|
mode: z.ZodEnum<{
|
|
338
338
|
supervised: "supervised";
|
|
339
339
|
auto: "auto";
|
|
@@ -352,7 +352,7 @@ export declare const HandoffDispatchSchema: z.ZodObject<{
|
|
|
352
352
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
353
353
|
kind: z.ZodLiteral<"execution">;
|
|
354
354
|
authorizationId: z.ZodUUID;
|
|
355
|
-
milestoneId: z.ZodUUID
|
|
355
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
356
356
|
mode: z.ZodEnum<{
|
|
357
357
|
supervised: "supervised";
|
|
358
358
|
auto: "auto";
|
|
@@ -404,7 +404,7 @@ export declare const HandoffPageSchema: z.ZodObject<{
|
|
|
404
404
|
scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
405
405
|
kind: z.ZodLiteral<"execution">;
|
|
406
406
|
authorizationId: z.ZodUUID;
|
|
407
|
-
milestoneId: z.ZodUUID
|
|
407
|
+
milestoneId: z.ZodNullable<z.ZodUUID>;
|
|
408
408
|
mode: z.ZodEnum<{
|
|
409
409
|
supervised: "supervised";
|
|
410
410
|
auto: "auto";
|
|
@@ -48,7 +48,7 @@ export declare const createPlanAdmission: (coordinationRoot: string, store: ISto
|
|
|
48
48
|
scope: {
|
|
49
49
|
kind: "execution";
|
|
50
50
|
authorizationId: string;
|
|
51
|
-
milestoneId: string;
|
|
51
|
+
milestoneId: string | null;
|
|
52
52
|
mode: "supervised" | "auto";
|
|
53
53
|
revision: {
|
|
54
54
|
planDigest: string;
|
|
@@ -129,7 +129,7 @@ export declare const createPlanAdmission: (coordinationRoot: string, store: ISto
|
|
|
129
129
|
scope: {
|
|
130
130
|
kind: "execution";
|
|
131
131
|
authorizationId: string;
|
|
132
|
-
milestoneId: string;
|
|
132
|
+
milestoneId: string | null;
|
|
133
133
|
mode: "supervised" | "auto";
|
|
134
134
|
revision: {
|
|
135
135
|
planDigest: string;
|
package/dist/plans/admission.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Exception } from 'error-message-utils';
|
|
2
2
|
import { getErrorKind } from '../errors/index.js';
|
|
3
3
|
import { withHqLock } from '../locks/index.js';
|
|
4
|
-
import { describePlan } from './authority.js';
|
|
4
|
+
import { canExecutePlanUnit, describePlan } from './authority.js';
|
|
5
5
|
import { isSamePlanRevision } from './utilities.js';
|
|
6
6
|
const conflict = () => {
|
|
7
7
|
throw new Exception('The HQ action conflicts with its recorded state', undefined, {
|
|
@@ -29,10 +29,9 @@ export const createPlanAdmission = (coordinationRoot, store, runtimeEpoch, readP
|
|
|
29
29
|
execution.revokedBy ||
|
|
30
30
|
execution.action.id !== scope.authorizationId ||
|
|
31
31
|
execution.mode !== scope.mode ||
|
|
32
|
-
!
|
|
32
|
+
!canExecutePlanUnit(artifacts, scope.milestoneId) ||
|
|
33
33
|
!isSamePlanRevision(execution.revision, scope.revision) ||
|
|
34
34
|
!isSamePlanRevision(scope.revision, artifacts.revision) ||
|
|
35
|
-
!status.isSequenceApproved ||
|
|
36
35
|
status.state === 'blocked' ||
|
|
37
36
|
(artifacts.coordination.revision && artifacts.coordination.revision.phase !== 'finished') ||
|
|
38
37
|
artifacts.coordination.observedConflict)
|
|
@@ -112,6 +111,13 @@ export const createPlanAdmission = (coordinationRoot, store, runtimeEpoch, readP
|
|
|
112
111
|
conflict();
|
|
113
112
|
}
|
|
114
113
|
}
|
|
114
|
+
// explicit assessment keeps its revision guard without inheriting implementation authority
|
|
115
|
+
const isFeedbackAssessment = !!action.expectedPlan &&
|
|
116
|
+
(command.kind === 'message' || command.kind === 'queue') &&
|
|
117
|
+
command.input.kind === 'skill' &&
|
|
118
|
+
prepared.skill?.name === 'jg-feedback';
|
|
119
|
+
// current-turn permission replies and labels do not start another implementation unit
|
|
120
|
+
const isSeparateNativeControl = command.kind === 'native-reply' || command.kind === 'thread-rename';
|
|
115
121
|
if (action.plan) {
|
|
116
122
|
if (!['message', 'queue', 'steer', 'thread-resume', 'thread-recover'].includes(command.kind) ||
|
|
117
123
|
!threadId)
|
|
@@ -149,8 +155,22 @@ export const createPlanAdmission = (coordinationRoot, store, runtimeEpoch, readP
|
|
|
149
155
|
}
|
|
150
156
|
prepared.planContext = selected.context;
|
|
151
157
|
}
|
|
158
|
+
else if (command.kind === 'queue-send' && queued?.planContext) {
|
|
159
|
+
const context = queued.planContext;
|
|
160
|
+
if (context.scope) {
|
|
161
|
+
const current = await scopeContext(context.scope);
|
|
162
|
+
if (!isSamePlanRevision(context.observedRevision, current.artifacts.revision) &&
|
|
163
|
+
context.scope.kind === 'execution')
|
|
164
|
+
conflict();
|
|
165
|
+
}
|
|
166
|
+
else
|
|
167
|
+
await boundArtifacts(context);
|
|
168
|
+
prepared.planContext = context;
|
|
169
|
+
}
|
|
152
170
|
else if (binding && !safe) {
|
|
153
|
-
if (
|
|
171
|
+
if (binding.scope &&
|
|
172
|
+
!isFeedbackAssessment &&
|
|
173
|
+
!(binding.scope.kind === 'execution' && isSeparateNativeControl)) {
|
|
154
174
|
prepared.planContext = (await scopeContext(binding.scope)).context;
|
|
155
175
|
}
|
|
156
176
|
else {
|
|
@@ -162,18 +182,6 @@ export const createPlanAdmission = (coordinationRoot, store, runtimeEpoch, readP
|
|
|
162
182
|
};
|
|
163
183
|
}
|
|
164
184
|
}
|
|
165
|
-
if (command.kind === 'queue-send' && queued?.planContext) {
|
|
166
|
-
const context = queued.planContext;
|
|
167
|
-
if (context.scope) {
|
|
168
|
-
const current = await scopeContext(context.scope);
|
|
169
|
-
if (!isSamePlanRevision(context.observedRevision, current.artifacts.revision) &&
|
|
170
|
-
context.scope.kind === 'execution')
|
|
171
|
-
conflict();
|
|
172
|
-
}
|
|
173
|
-
else
|
|
174
|
-
await boundArtifacts(context);
|
|
175
|
-
prepared.planContext = context;
|
|
176
|
-
}
|
|
177
185
|
return store.admit({ action, prepared });
|
|
178
186
|
});
|
|
179
187
|
},
|
|
@@ -2,6 +2,12 @@ import type { IPlanCommand, IPlanStatus, IPlanCoordination } from '../contracts/
|
|
|
2
2
|
import type { IPlanArtifacts } from './types.js';
|
|
3
3
|
/** Derives approval independently from native sessions and native permission requests. */
|
|
4
4
|
export declare const describePlan: (artifacts: IPlanArtifacts, pendingActionId?: string | null) => IPlanStatus;
|
|
5
|
+
/**
|
|
6
|
+
* Checks the current approved unfinished unit, with null identifying an undivided plan.
|
|
7
|
+
* Runtime epoch, action identity and mode remain the caller's separate admission checks.
|
|
8
|
+
* @returns Whether the exact unit is selected by current execution authority.
|
|
9
|
+
*/
|
|
10
|
+
export declare const canExecutePlanUnit: (artifacts: IPlanArtifacts, milestoneId: string | null) => boolean;
|
|
5
11
|
/**
|
|
6
12
|
* Applies one explicit operator decision without native dispatch or filesystem mutation.
|
|
7
13
|
* @returns Updated current authority records.
|