jg-agent-hq 2.0.0 → 4.0.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.
Files changed (155) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +14 -14
  3. package/api/README.md +97 -65
  4. package/dist/actions/actions.js +15 -0
  5. package/dist/cli/cli.js +28 -5
  6. package/dist/cli/utilities.d.ts +3 -0
  7. package/dist/cli/utilities.js +13 -0
  8. package/dist/collaboration/dispatch/types.d.ts +2 -2
  9. package/dist/contracts/actions/types.d.ts +4 -4
  10. package/dist/contracts/browser/index.d.ts +1 -3
  11. package/dist/contracts/browser/index.js +1 -3
  12. package/dist/contracts/browser/types.d.ts +15 -1447
  13. package/dist/contracts/browser/types.js +3 -112
  14. package/dist/contracts/index.d.ts +9 -11
  15. package/dist/contracts/index.js +6 -8
  16. package/dist/contracts/plans/index.d.ts +4 -6
  17. package/dist/contracts/plans/index.js +2 -4
  18. package/dist/contracts/plans/types.d.ts +38 -905
  19. package/dist/contracts/plans/types.js +13 -139
  20. package/dist/contracts/sessions/index.d.ts +2 -0
  21. package/dist/contracts/sessions/index.js +2 -0
  22. package/dist/contracts/sessions/types.d.ts +101 -0
  23. package/dist/contracts/sessions/types.js +43 -0
  24. package/dist/contracts/types.d.ts +551 -1035
  25. package/dist/contracts/types.js +32 -0
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.js +1 -1
  28. package/dist/plans/admission.d.ts +6 -6
  29. package/dist/plans/admission.js +1 -1
  30. package/dist/plans/authority.d.ts +2 -0
  31. package/dist/plans/authority.js +23 -13
  32. package/dist/plans/documents.d.ts +20 -17
  33. package/dist/plans/documents.js +29 -63
  34. package/dist/plans/files.d.ts +2 -2
  35. package/dist/plans/files.js +5 -5
  36. package/dist/plans/finalization.d.ts +6 -8
  37. package/dist/plans/finalization.js +25 -26
  38. package/dist/plans/index.d.ts +2 -3
  39. package/dist/plans/index.js +1 -2
  40. package/dist/plans/plans.d.ts +8 -8
  41. package/dist/plans/plans.js +36 -83
  42. package/dist/plans/projections.d.ts +2 -2
  43. package/dist/plans/projections.js +44 -82
  44. package/dist/plans/revisions.d.ts +4 -5
  45. package/dist/plans/revisions.js +5 -44
  46. package/dist/plans/types.d.ts +5 -281
  47. package/dist/plans/types.js +2 -30
  48. package/dist/plans/utilities.js +2 -11
  49. package/dist/providers/claude/agents/agents.d.ts +16 -0
  50. package/dist/providers/claude/agents/agents.js +80 -0
  51. package/dist/providers/claude/agents/constants.d.ts +3 -0
  52. package/dist/providers/claude/agents/constants.js +4 -0
  53. package/dist/providers/claude/agents/index.d.ts +1 -0
  54. package/dist/providers/claude/agents/index.js +2 -0
  55. package/dist/providers/claude/agents/types.d.ts +14 -0
  56. package/dist/providers/claude/agents/types.js +9 -0
  57. package/dist/providers/claude/claude.js +2 -0
  58. package/dist/providers/claude/history/history.model.js +2 -0
  59. package/dist/providers/claude/history/types.d.ts +115 -368
  60. package/dist/providers/claude/index.d.ts +1 -0
  61. package/dist/providers/claude/index.js +2 -0
  62. package/dist/providers/claude/transformers.js +14 -1
  63. package/dist/providers/codex/adapter.d.ts +1 -1
  64. package/dist/providers/codex/adapter.js +26 -3
  65. package/dist/providers/codex/codex.js +51 -18
  66. package/dist/providers/codex/events.d.ts +2 -1
  67. package/dist/providers/codex/events.js +8 -3
  68. package/dist/providers/codex/index.d.ts +1 -1
  69. package/dist/providers/codex/index.js +1 -1
  70. package/dist/providers/codex/rpc.d.ts +9 -4
  71. package/dist/providers/codex/rpc.js +109 -47
  72. package/dist/providers/codex/skill-roots/constants.d.ts +4 -0
  73. package/dist/providers/codex/skill-roots/constants.js +7 -0
  74. package/dist/providers/codex/skill-roots/index.d.ts +2 -0
  75. package/dist/providers/codex/skill-roots/index.js +4 -0
  76. package/dist/providers/codex/skill-roots/skill-roots.d.ts +35 -0
  77. package/dist/providers/codex/skill-roots/skill-roots.js +93 -0
  78. package/dist/providers/codex/transformers.d.ts +3 -1
  79. package/dist/providers/codex/transformers.js +41 -3
  80. package/dist/providers/codex/types.d.ts +38 -1
  81. package/dist/providers/codex/types.js +15 -3
  82. package/dist/providers/codex/websocket/constants.d.ts +11 -0
  83. package/dist/providers/codex/websocket/constants.js +18 -0
  84. package/dist/providers/codex/websocket/index.d.ts +1 -0
  85. package/dist/providers/codex/websocket/index.js +2 -0
  86. package/dist/providers/codex/websocket/websocket.d.ts +7 -0
  87. package/dist/providers/codex/websocket/websocket.js +219 -0
  88. package/dist/providers/index.d.ts +2 -2
  89. package/dist/providers/index.js +1 -1
  90. package/dist/providers/process.d.ts +2 -2
  91. package/dist/providers/process.js +37 -4
  92. package/dist/providers/registry/registry.js +2 -1
  93. package/dist/providers/types.d.ts +25 -2
  94. package/dist/runtime/runtime.js +11 -3
  95. package/dist/runtime/state/index.d.ts +1 -1
  96. package/dist/runtime/state/index.js +1 -1
  97. package/dist/runtime/state/state.d.ts +15 -0
  98. package/dist/runtime/state/state.js +92 -1
  99. package/dist/runtime/types.d.ts +0 -2
  100. package/dist/runtime/types.js +0 -3
  101. package/dist/sessions/sessions.js +2 -0
  102. package/dist/snapshots/archive/archive.d.ts +29 -0
  103. package/dist/snapshots/archive/archive.js +342 -0
  104. package/dist/snapshots/archive/constants.d.ts +5 -0
  105. package/dist/snapshots/archive/constants.js +8 -0
  106. package/dist/snapshots/archive/index.d.ts +1 -0
  107. package/dist/snapshots/archive/index.js +2 -0
  108. package/dist/snapshots/artifacts.d.ts +10 -1
  109. package/dist/snapshots/artifacts.js +38 -13
  110. package/dist/snapshots/capture.d.ts +15 -0
  111. package/dist/snapshots/capture.js +158 -0
  112. package/dist/snapshots/database.d.ts +2 -0
  113. package/dist/snapshots/database.js +35 -55
  114. package/dist/snapshots/fences.d.ts +10 -0
  115. package/dist/snapshots/fences.js +51 -0
  116. package/dist/snapshots/index.d.ts +1 -0
  117. package/dist/snapshots/index.js +2 -0
  118. package/dist/snapshots/snapshots.d.ts +7 -3
  119. package/dist/snapshots/snapshots.js +31 -117
  120. package/dist/snapshots/snapshots.worker.js +5 -1
  121. package/dist/snapshots/types.d.ts +35 -3
  122. package/dist/snapshots/types.js +19 -4
  123. package/dist/storage/index.d.ts +2 -1
  124. package/dist/storage/index.js +2 -1
  125. package/dist/storage/schema/constants.d.ts +2 -0
  126. package/dist/storage/schema/constants.js +9 -0
  127. package/dist/storage/schema/index.d.ts +3 -0
  128. package/dist/storage/schema/index.js +6 -0
  129. package/dist/storage/schema/schema.d.ts +18 -0
  130. package/dist/storage/schema/schema.js +59 -0
  131. package/dist/storage/schema/types.d.ts +7 -0
  132. package/dist/storage/schema/types.js +8 -0
  133. package/dist/storage/storage.d.ts +1 -1
  134. package/dist/storage/storage.js +2 -2
  135. package/dist/storage/types.d.ts +0 -5
  136. package/dist/storage/types.js +0 -6
  137. package/dist/store/collaboration/collaboration.model.d.ts +2 -2
  138. package/dist/store/control/types.d.ts +16 -16
  139. package/dist/store/plans/plans.model.d.ts +3 -105
  140. package/dist/store/plans/plans.model.js +6 -46
  141. package/dist/store/schema.js +7 -35
  142. package/dist/store/schema.sql +91 -16
  143. package/dist/store/sessions/index.d.ts +1 -0
  144. package/dist/store/sessions/index.js +2 -0
  145. package/dist/store/sessions/sessions.model.d.ts +28 -0
  146. package/dist/store/sessions/sessions.model.js +105 -0
  147. package/dist/store/store.js +13 -7
  148. package/dist/store/store.worker.js +16 -11
  149. package/dist/store/types.d.ts +134 -513
  150. package/dist/store/types.js +21 -7
  151. package/docs/recovery.md +8 -4
  152. package/errors/README.md +3 -3
  153. package/package.json +2 -2
  154. package/dist/plans/reconciliation.d.ts +0 -34
  155. package/dist/plans/reconciliation.js +0 -246
@@ -2,12 +2,12 @@ import { z } from 'zod';
2
2
  import { type IDispatchScan, type IDispatchPage, type IDispatchJob } from '../collaboration/dispatch/index.js';
3
3
  import { type IAgentIdentityQuery, type IAgentIdentity, type INativeToolBinding, type IAgentSpawnRead, type IAgentSpawnRecord } from '../collaboration/identity/index.js';
4
4
  import { type IDispatchBlocked, type IDispatchCollection, type ICollaborationRequest, type ICollaborationResponse } from '../contracts/collaboration/index.js';
5
- import { type IBrowserAction, type IBrowserReceipt, type IThreadSummary, type IPlanMilestone, type IPlanReconciliationEntry, type IActionReceipt, type IManagedThread, type IActionSummary, type INativeApprovalSummary, type ILifecycleEvent, type IActionPlanContext, type IHistoryProvenance } from '../contracts/index.js';
5
+ import { type IBrowserAction, type IBrowserReceipt, type IThreadSummary, type IPlanMilestone, type IActionReceipt, type IManagedThread, type IActionSummary, type INativeApprovalSummary, type ILifecycleEvent, type IActionPlanContext, type IHistoryProvenance, type ISessionState, type ISessionTransition } from '../contracts/index.js';
6
6
  import type { IHistoryRequest } from '../sessions/index.js';
7
7
  import { type IEvidenceOriginsRequest } from '../sessions/evidence/index.js';
8
8
  import type { IClaudeHistoryRead } from '../providers/claude/history/index.js';
9
9
  import { type IStorageDescriptor } from '../storage/index.js';
10
- import { type IPlanRevisionProjection, type IPlanWriteIntent, type IPlanProjection } from '../plans/index.js';
10
+ import { type IPlanWriteIntent, type IPlanProjection } from '../plans/index.js';
11
11
  import { type IAdmission, type INativeOutcome, type INativeObservation, type IControlPage, type IApprovalPageRequest, type IEventPage, type IApprovalRecord, type IAdmissionResult, type IDispatch, type IObservationResult } from './control/index.js';
12
12
  export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
13
  kind: z.ZodLiteral<"agent-identity">;
@@ -633,10 +633,6 @@ export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
633
633
  }, z.core.$strict>;
634
634
  }, z.core.$strict>, z.ZodObject<{
635
635
  kind: z.ZodLiteral<"storage-maintenance">;
636
- isSnapshot: z.ZodBoolean;
637
- }, z.core.$strict>, z.ZodObject<{
638
- kind: z.ZodLiteral<"snapshot-plans">;
639
- after: z.ZodString;
640
636
  }, z.core.$strict>, z.ZodObject<{
641
637
  kind: z.ZodLiteral<"snapshot-backup">;
642
638
  destination: z.ZodString;
@@ -948,23 +944,11 @@ export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
948
944
  limit: z.ZodDefault<z.ZodNumber>;
949
945
  cursor: z.ZodOptional<z.ZodString>;
950
946
  }, z.core.$strict>, z.ZodObject<{
951
- confirmation: z.ZodOptional<z.ZodObject<{
952
- proposalId: z.ZodUUID;
953
- decisions: z.ZodArray<z.ZodObject<{
954
- sourceIds: z.ZodArray<z.ZodUUID>;
955
- targetIds: z.ZodArray<z.ZodUUID>;
956
- relation: z.ZodEnum<{
957
- equivalent: "equivalent";
958
- "requirements-changed": "requirements-changed";
959
- omitted: "omitted";
960
- reopened: "reopened";
961
- }>;
962
- retainedPairs: z.ZodArray<z.ZodObject<{
963
- sourceId: z.ZodUUID;
964
- targetId: z.ZodUUID;
965
- }, z.core.$strict>>;
966
- }, z.core.$strict>>;
967
- }, z.core.$strict>>;
947
+ kind: z.ZodLiteral<"register">;
948
+ target: z.ZodObject<{
949
+ directory: z.ZodString;
950
+ }, z.core.$strict>;
951
+ }, z.core.$strict>, z.ZodObject<{
968
952
  target: z.ZodObject<{
969
953
  directory: z.ZodString;
970
954
  }, z.core.$strict>;
@@ -1072,19 +1056,6 @@ export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1072
1056
  breakdownDigest: z.ZodNullable<z.ZodString>;
1073
1057
  }, z.core.$strict>;
1074
1058
  kind: z.ZodLiteral<"revision-invoke">;
1075
- }, z.core.$strict>, z.ZodObject<{
1076
- kind: z.ZodLiteral<"reconciliation">;
1077
- target: z.ZodObject<{
1078
- directory: z.ZodString;
1079
- }, z.core.$strict>;
1080
- collection: z.ZodEnum<{
1081
- drafts: "drafts";
1082
- sources: "sources";
1083
- evidence: "evidence";
1084
- correspondences: "correspondences";
1085
- }>;
1086
- limit: z.ZodDefault<z.ZodNumber>;
1087
- cursor: z.ZodOptional<z.ZodString>;
1088
1059
  }, z.core.$strict>, z.ZodObject<{
1089
1060
  scope: z.ZodEnum<{
1090
1061
  plan: "plan";
@@ -1177,44 +1148,6 @@ export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1177
1148
  auto: "auto";
1178
1149
  }>;
1179
1150
  }, z.core.$strict>], "kind">;
1180
- }, z.core.$strict>, z.ZodObject<{
1181
- kind: z.ZodLiteral<"priority">;
1182
- target: z.ZodObject<{
1183
- directory: z.ZodString;
1184
- }, z.core.$strict>;
1185
- expectedRevision: z.ZodObject<{
1186
- planDigest: z.ZodString;
1187
- breakdownDigest: z.ZodNullable<z.ZodString>;
1188
- }, z.core.$strict>;
1189
- priority: z.ZodEnum<{
1190
- P0: "P0";
1191
- P1: "P1";
1192
- P2: "P2";
1193
- P3: "P3";
1194
- }>;
1195
- reason: z.ZodString;
1196
- }, z.core.$strict>, z.ZodObject<{
1197
- kind: z.ZodLiteral<"error-reservation">;
1198
- target: z.ZodObject<{
1199
- directory: z.ZodString;
1200
- }, z.core.$strict>;
1201
- expectedRevision: z.ZodObject<{
1202
- planDigest: z.ZodString;
1203
- breakdownDigest: z.ZodNullable<z.ZodString>;
1204
- }, z.core.$strict>;
1205
- reservation: z.ZodObject<{
1206
- repository: z.ZodString;
1207
- namespace: z.ZodString;
1208
- start: z.ZodNumber;
1209
- end: z.ZodNumber;
1210
- registryPath: z.ZodString;
1211
- purpose: z.ZodString;
1212
- }, z.core.$strict>;
1213
- release: z.ZodBoolean;
1214
- }, z.core.$strict>, z.ZodObject<{
1215
- kind: z.ZodLiteral<"publication-retry">;
1216
- publicationId: z.ZodUUID;
1217
- expectedCommit: z.ZodNullable<z.ZodString>;
1218
1151
  }, z.core.$strict>], "kind">;
1219
1152
  }, z.core.$strict>;
1220
1153
  operatorId: z.ZodString;
@@ -1223,8 +1156,8 @@ export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1223
1156
  id: z.ZodUUID;
1224
1157
  operatorId: z.ZodString;
1225
1158
  state: z.ZodEnum<{
1226
- acknowledged: "acknowledged";
1227
1159
  uncertain: "uncertain";
1160
+ acknowledged: "acknowledged";
1228
1161
  }>;
1229
1162
  }, z.core.$strict>, z.ZodObject<{
1230
1163
  kind: z.ZodLiteral<"claude-history">;
@@ -2178,23 +2111,11 @@ export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2178
2111
  limit: z.ZodDefault<z.ZodNumber>;
2179
2112
  cursor: z.ZodOptional<z.ZodString>;
2180
2113
  }, z.core.$strict>, z.ZodObject<{
2181
- confirmation: z.ZodOptional<z.ZodObject<{
2182
- proposalId: z.ZodUUID;
2183
- decisions: z.ZodArray<z.ZodObject<{
2184
- sourceIds: z.ZodArray<z.ZodUUID>;
2185
- targetIds: z.ZodArray<z.ZodUUID>;
2186
- relation: z.ZodEnum<{
2187
- equivalent: "equivalent";
2188
- "requirements-changed": "requirements-changed";
2189
- omitted: "omitted";
2190
- reopened: "reopened";
2191
- }>;
2192
- retainedPairs: z.ZodArray<z.ZodObject<{
2193
- sourceId: z.ZodUUID;
2194
- targetId: z.ZodUUID;
2195
- }, z.core.$strict>>;
2196
- }, z.core.$strict>>;
2197
- }, z.core.$strict>>;
2114
+ kind: z.ZodLiteral<"register">;
2115
+ target: z.ZodObject<{
2116
+ directory: z.ZodString;
2117
+ }, z.core.$strict>;
2118
+ }, z.core.$strict>, z.ZodObject<{
2198
2119
  target: z.ZodObject<{
2199
2120
  directory: z.ZodString;
2200
2121
  }, z.core.$strict>;
@@ -2302,19 +2223,6 @@ export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2302
2223
  breakdownDigest: z.ZodNullable<z.ZodString>;
2303
2224
  }, z.core.$strict>;
2304
2225
  kind: z.ZodLiteral<"revision-invoke">;
2305
- }, z.core.$strict>, z.ZodObject<{
2306
- kind: z.ZodLiteral<"reconciliation">;
2307
- target: z.ZodObject<{
2308
- directory: z.ZodString;
2309
- }, z.core.$strict>;
2310
- collection: z.ZodEnum<{
2311
- drafts: "drafts";
2312
- sources: "sources";
2313
- evidence: "evidence";
2314
- correspondences: "correspondences";
2315
- }>;
2316
- limit: z.ZodDefault<z.ZodNumber>;
2317
- cursor: z.ZodOptional<z.ZodString>;
2318
2226
  }, z.core.$strict>, z.ZodObject<{
2319
2227
  scope: z.ZodEnum<{
2320
2228
  plan: "plan";
@@ -2786,6 +2694,10 @@ export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2786
2694
  kind: z.ZodLiteral<"live-items">;
2787
2695
  threadId: z.ZodUUID;
2788
2696
  afterRevision: z.ZodOptional<z.ZodNumber>;
2697
+ }, z.core.$strict>, z.ZodObject<{
2698
+ kind: z.ZodLiteral<"session-states">;
2699
+ afterSequence: z.ZodDefault<z.ZodNumber>;
2700
+ limit: z.ZodDefault<z.ZodNumber>;
2789
2701
  }, z.core.$strict>], "kind">;
2790
2702
  }, z.core.$strict>, z.ZodObject<{
2791
2703
  kind: z.ZodLiteral<"remember">;
@@ -2808,10 +2720,18 @@ export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2808
2720
  notLoaded: "notLoaded";
2809
2721
  systemError: "systemError";
2810
2722
  }>;
2723
+ state: z.ZodEnum<{
2724
+ unknown: "unknown";
2725
+ idle: "idle";
2726
+ failed: "failed";
2727
+ running: "running";
2728
+ waiting: "waiting";
2729
+ closed: "closed";
2730
+ }>;
2811
2731
  ownership: z.ZodEnum<{
2812
2732
  external: "external";
2813
- uncertain: "uncertain";
2814
2733
  managed: "managed";
2734
+ uncertain: "uncertain";
2815
2735
  }>;
2816
2736
  managedId: z.ZodNullable<z.ZodUUID>;
2817
2737
  historyState: z.ZodEnum<{
@@ -2822,152 +2742,34 @@ export declare const StoreCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2822
2742
  nextCursor: z.ZodNullable<z.ZodString>;
2823
2743
  observedAt: z.ZodNumber;
2824
2744
  }, z.core.$strict>, z.ZodObject<{
2825
- kind: z.ZodLiteral<"plan-revision-project">;
2826
- projection: z.ZodObject<{
2827
- directory: z.ZodString;
2828
- sourceHash: z.ZodNullable<z.ZodString>;
2829
- records: z.ZodArray<z.ZodObject<{
2830
- collection: z.ZodEnum<{
2831
- drafts: "drafts";
2832
- sources: "sources";
2833
- evidence: "evidence";
2834
- correspondences: "correspondences";
2835
- }>;
2836
- id: z.ZodString;
2837
- entry: z.ZodDiscriminatedUnion<[z.ZodObject<{
2838
- kind: z.ZodLiteral<"source">;
2839
- entry: z.ZodObject<{
2840
- ordinal: z.ZodNumber;
2841
- title: z.ZodString;
2842
- status: z.ZodEnum<{
2843
- pending: "pending";
2844
- "in progress": "in progress";
2845
- done: "done";
2846
- }>;
2847
- id: z.ZodUUID;
2848
- contractDigest: z.ZodString;
2849
- contract: z.ZodString;
2850
- sharedDigest: z.ZodString;
2851
- }, z.core.$strip>;
2852
- }, z.core.$strip>, z.ZodObject<{
2853
- kind: z.ZodLiteral<"draft">;
2854
- entry: z.ZodObject<{
2855
- ordinal: z.ZodNumber;
2856
- title: z.ZodString;
2857
- status: z.ZodEnum<{
2858
- pending: "pending";
2859
- "in progress": "in progress";
2860
- done: "done";
2861
- }>;
2862
- id: z.ZodUUID;
2863
- contractDigest: z.ZodString;
2864
- contract: z.ZodString;
2865
- sharedDigest: z.ZodString;
2866
- matchedSourceId: z.ZodNullable<z.ZodUUID>;
2867
- }, z.core.$strip>;
2868
- }, z.core.$strip>, z.ZodObject<{
2869
- kind: z.ZodLiteral<"evidence">;
2870
- entry: z.ZodObject<{
2871
- id: z.ZodUUID;
2872
- action: z.ZodObject<{
2873
- id: z.ZodUUID;
2874
- operatorId: z.ZodString;
2875
- source: z.ZodObject<{
2876
- kind: z.ZodEnum<{
2877
- "user-action": "user-action";
2878
- "user-message": "user-message";
2879
- }>;
2880
- reference: z.ZodString;
2881
- }, z.core.$strict>;
2882
- }, z.core.$strict>;
2883
- milestoneId: z.ZodNullable<z.ZodUUID>;
2884
- revision: z.ZodObject<{
2885
- planDigest: z.ZodString;
2886
- breakdownDigest: z.ZodNullable<z.ZodString>;
2887
- }, z.core.$strict>;
2888
- contractDigest: z.ZodString;
2889
- title: z.ZodString;
2890
- contract: z.ZodString;
2891
- sharedDigest: z.ZodNullable<z.ZodString>;
2892
- checkouts: z.ZodArray<z.ZodObject<{
2893
- repository: z.ZodString;
2894
- directory: z.ZodString;
2895
- claimReference: z.ZodString;
2896
- paths: z.ZodArray<z.ZodString>;
2897
- branch: z.ZodNullable<z.ZodString>;
2898
- head: z.ZodString;
2899
- fingerprint: z.ZodString;
2900
- }, z.core.$strict>>;
2901
- checks: z.ZodArray<z.ZodObject<{
2902
- command: z.ZodString;
2903
- outcome: z.ZodLiteral<"passed">;
2904
- reference: z.ZodString;
2905
- }, z.core.$strict>>;
2906
- completedAt: z.ZodNumber;
2907
- reopenActionId: z.ZodNullable<z.ZodUUID>;
2908
- }, z.core.$strict>;
2909
- }, z.core.$strip>, z.ZodObject<{
2910
- kind: z.ZodLiteral<"correspondence">;
2911
- entry: z.ZodObject<{
2912
- id: z.ZodUUID;
2913
- action: z.ZodObject<{
2914
- id: z.ZodUUID;
2915
- operatorId: z.ZodString;
2916
- source: z.ZodObject<{
2917
- kind: z.ZodEnum<{
2918
- "user-action": "user-action";
2919
- "user-message": "user-message";
2920
- }>;
2921
- reference: z.ZodString;
2922
- }, z.core.$strict>;
2923
- }, z.core.$strict>;
2924
- revision: z.ZodObject<{
2925
- planDigest: z.ZodString;
2926
- breakdownDigest: z.ZodNullable<z.ZodString>;
2927
- }, z.core.$strict>;
2928
- relation: z.ZodEnum<{
2929
- equivalent: "equivalent";
2930
- "requirements-changed": "requirements-changed";
2931
- omitted: "omitted";
2932
- reopened: "reopened";
2933
- }>;
2934
- targets: z.ZodArray<z.ZodObject<{
2935
- id: z.ZodUUID;
2936
- contractDigest: z.ZodString;
2937
- status: z.ZodEnum<{
2938
- pending: "pending";
2939
- "in progress": "in progress";
2940
- done: "done";
2941
- }>;
2942
- }, z.core.$strict>>;
2943
- invalidatedReceiptIds: z.ZodArray<z.ZodUUID>;
2944
- recordedAt: z.ZodNumber;
2945
- sources: z.ZodArray<z.ZodObject<{
2946
- id: z.ZodUUID;
2947
- status: z.ZodEnum<{
2948
- pending: "pending";
2949
- "in progress": "in progress";
2950
- done: "done";
2951
- }>;
2952
- contractDigest: z.ZodString;
2953
- }, z.core.$strip>>;
2954
- }, z.core.$strict>;
2955
- }, z.core.$strip>], "kind">;
2956
- }, z.core.$strict>>;
2957
- }, z.core.$strict>;
2745
+ kind: z.ZodLiteral<"plan-register">;
2746
+ directory: z.ZodString;
2958
2747
  }, z.core.$strict>, z.ZodObject<{
2959
- kind: z.ZodLiteral<"plan-revision-page">;
2960
- page: z.ZodObject<{
2961
- directory: z.ZodString;
2962
- collection: z.ZodEnum<{
2963
- drafts: "drafts";
2964
- sources: "sources";
2965
- evidence: "evidence";
2966
- correspondences: "correspondences";
2748
+ kind: z.ZodLiteral<"sessions-observe">;
2749
+ provider: z.ZodString;
2750
+ sessions: z.ZodArray<z.ZodObject<{
2751
+ nativeId: z.ZodString;
2752
+ state: z.ZodEnum<{
2753
+ unknown: "unknown";
2754
+ idle: "idle";
2755
+ failed: "failed";
2756
+ running: "running";
2757
+ waiting: "waiting";
2758
+ closed: "closed";
2967
2759
  }>;
2968
- after: z.ZodString;
2969
- limit: z.ZodNumber;
2970
- }, z.core.$strict>;
2760
+ }, z.core.$strict>>;
2761
+ isComplete: z.ZodBoolean;
2762
+ }, z.core.$strict>, z.ZodObject<{
2763
+ kind: z.ZodLiteral<"sessions-unknown">;
2764
+ provider: z.ZodString;
2765
+ }, z.core.$strict>, z.ZodObject<{
2766
+ kind: z.ZodLiteral<"sessions-states">;
2767
+ provider: z.ZodString;
2768
+ nativeIds: z.ZodArray<z.ZodString>;
2769
+ }, z.core.$strict>, z.ZodObject<{
2770
+ kind: z.ZodLiteral<"session-transitions">;
2771
+ afterSequence: z.ZodNumber;
2772
+ limit: z.ZodNumber;
2971
2773
  }, z.core.$strict>, z.ZodObject<{
2972
2774
  kind: z.ZodLiteral<"thread-plan-read">;
2973
2775
  threadId: z.ZodUUID;
@@ -4304,10 +4106,6 @@ export declare const StoreRequestSchema: z.ZodObject<{
4304
4106
  }, z.core.$strict>;
4305
4107
  }, z.core.$strict>, z.ZodObject<{
4306
4108
  kind: z.ZodLiteral<"storage-maintenance">;
4307
- isSnapshot: z.ZodBoolean;
4308
- }, z.core.$strict>, z.ZodObject<{
4309
- kind: z.ZodLiteral<"snapshot-plans">;
4310
- after: z.ZodString;
4311
4109
  }, z.core.$strict>, z.ZodObject<{
4312
4110
  kind: z.ZodLiteral<"snapshot-backup">;
4313
4111
  destination: z.ZodString;
@@ -4619,23 +4417,11 @@ export declare const StoreRequestSchema: z.ZodObject<{
4619
4417
  limit: z.ZodDefault<z.ZodNumber>;
4620
4418
  cursor: z.ZodOptional<z.ZodString>;
4621
4419
  }, z.core.$strict>, z.ZodObject<{
4622
- confirmation: z.ZodOptional<z.ZodObject<{
4623
- proposalId: z.ZodUUID;
4624
- decisions: z.ZodArray<z.ZodObject<{
4625
- sourceIds: z.ZodArray<z.ZodUUID>;
4626
- targetIds: z.ZodArray<z.ZodUUID>;
4627
- relation: z.ZodEnum<{
4628
- equivalent: "equivalent";
4629
- "requirements-changed": "requirements-changed";
4630
- omitted: "omitted";
4631
- reopened: "reopened";
4632
- }>;
4633
- retainedPairs: z.ZodArray<z.ZodObject<{
4634
- sourceId: z.ZodUUID;
4635
- targetId: z.ZodUUID;
4636
- }, z.core.$strict>>;
4637
- }, z.core.$strict>>;
4638
- }, z.core.$strict>>;
4420
+ kind: z.ZodLiteral<"register">;
4421
+ target: z.ZodObject<{
4422
+ directory: z.ZodString;
4423
+ }, z.core.$strict>;
4424
+ }, z.core.$strict>, z.ZodObject<{
4639
4425
  target: z.ZodObject<{
4640
4426
  directory: z.ZodString;
4641
4427
  }, z.core.$strict>;
@@ -4743,19 +4529,6 @@ export declare const StoreRequestSchema: z.ZodObject<{
4743
4529
  breakdownDigest: z.ZodNullable<z.ZodString>;
4744
4530
  }, z.core.$strict>;
4745
4531
  kind: z.ZodLiteral<"revision-invoke">;
4746
- }, z.core.$strict>, z.ZodObject<{
4747
- kind: z.ZodLiteral<"reconciliation">;
4748
- target: z.ZodObject<{
4749
- directory: z.ZodString;
4750
- }, z.core.$strict>;
4751
- collection: z.ZodEnum<{
4752
- drafts: "drafts";
4753
- sources: "sources";
4754
- evidence: "evidence";
4755
- correspondences: "correspondences";
4756
- }>;
4757
- limit: z.ZodDefault<z.ZodNumber>;
4758
- cursor: z.ZodOptional<z.ZodString>;
4759
4532
  }, z.core.$strict>, z.ZodObject<{
4760
4533
  scope: z.ZodEnum<{
4761
4534
  plan: "plan";
@@ -4848,44 +4621,6 @@ export declare const StoreRequestSchema: z.ZodObject<{
4848
4621
  auto: "auto";
4849
4622
  }>;
4850
4623
  }, z.core.$strict>], "kind">;
4851
- }, z.core.$strict>, z.ZodObject<{
4852
- kind: z.ZodLiteral<"priority">;
4853
- target: z.ZodObject<{
4854
- directory: z.ZodString;
4855
- }, z.core.$strict>;
4856
- expectedRevision: z.ZodObject<{
4857
- planDigest: z.ZodString;
4858
- breakdownDigest: z.ZodNullable<z.ZodString>;
4859
- }, z.core.$strict>;
4860
- priority: z.ZodEnum<{
4861
- P0: "P0";
4862
- P1: "P1";
4863
- P2: "P2";
4864
- P3: "P3";
4865
- }>;
4866
- reason: z.ZodString;
4867
- }, z.core.$strict>, z.ZodObject<{
4868
- kind: z.ZodLiteral<"error-reservation">;
4869
- target: z.ZodObject<{
4870
- directory: z.ZodString;
4871
- }, z.core.$strict>;
4872
- expectedRevision: z.ZodObject<{
4873
- planDigest: z.ZodString;
4874
- breakdownDigest: z.ZodNullable<z.ZodString>;
4875
- }, z.core.$strict>;
4876
- reservation: z.ZodObject<{
4877
- repository: z.ZodString;
4878
- namespace: z.ZodString;
4879
- start: z.ZodNumber;
4880
- end: z.ZodNumber;
4881
- registryPath: z.ZodString;
4882
- purpose: z.ZodString;
4883
- }, z.core.$strict>;
4884
- release: z.ZodBoolean;
4885
- }, z.core.$strict>, z.ZodObject<{
4886
- kind: z.ZodLiteral<"publication-retry">;
4887
- publicationId: z.ZodUUID;
4888
- expectedCommit: z.ZodNullable<z.ZodString>;
4889
4624
  }, z.core.$strict>], "kind">;
4890
4625
  }, z.core.$strict>;
4891
4626
  operatorId: z.ZodString;
@@ -4894,8 +4629,8 @@ export declare const StoreRequestSchema: z.ZodObject<{
4894
4629
  id: z.ZodUUID;
4895
4630
  operatorId: z.ZodString;
4896
4631
  state: z.ZodEnum<{
4897
- acknowledged: "acknowledged";
4898
4632
  uncertain: "uncertain";
4633
+ acknowledged: "acknowledged";
4899
4634
  }>;
4900
4635
  }, z.core.$strict>, z.ZodObject<{
4901
4636
  kind: z.ZodLiteral<"claude-history">;
@@ -5849,23 +5584,11 @@ export declare const StoreRequestSchema: z.ZodObject<{
5849
5584
  limit: z.ZodDefault<z.ZodNumber>;
5850
5585
  cursor: z.ZodOptional<z.ZodString>;
5851
5586
  }, z.core.$strict>, z.ZodObject<{
5852
- confirmation: z.ZodOptional<z.ZodObject<{
5853
- proposalId: z.ZodUUID;
5854
- decisions: z.ZodArray<z.ZodObject<{
5855
- sourceIds: z.ZodArray<z.ZodUUID>;
5856
- targetIds: z.ZodArray<z.ZodUUID>;
5857
- relation: z.ZodEnum<{
5858
- equivalent: "equivalent";
5859
- "requirements-changed": "requirements-changed";
5860
- omitted: "omitted";
5861
- reopened: "reopened";
5862
- }>;
5863
- retainedPairs: z.ZodArray<z.ZodObject<{
5864
- sourceId: z.ZodUUID;
5865
- targetId: z.ZodUUID;
5866
- }, z.core.$strict>>;
5867
- }, z.core.$strict>>;
5868
- }, z.core.$strict>>;
5587
+ kind: z.ZodLiteral<"register">;
5588
+ target: z.ZodObject<{
5589
+ directory: z.ZodString;
5590
+ }, z.core.$strict>;
5591
+ }, z.core.$strict>, z.ZodObject<{
5869
5592
  target: z.ZodObject<{
5870
5593
  directory: z.ZodString;
5871
5594
  }, z.core.$strict>;
@@ -5973,19 +5696,6 @@ export declare const StoreRequestSchema: z.ZodObject<{
5973
5696
  breakdownDigest: z.ZodNullable<z.ZodString>;
5974
5697
  }, z.core.$strict>;
5975
5698
  kind: z.ZodLiteral<"revision-invoke">;
5976
- }, z.core.$strict>, z.ZodObject<{
5977
- kind: z.ZodLiteral<"reconciliation">;
5978
- target: z.ZodObject<{
5979
- directory: z.ZodString;
5980
- }, z.core.$strict>;
5981
- collection: z.ZodEnum<{
5982
- drafts: "drafts";
5983
- sources: "sources";
5984
- evidence: "evidence";
5985
- correspondences: "correspondences";
5986
- }>;
5987
- limit: z.ZodDefault<z.ZodNumber>;
5988
- cursor: z.ZodOptional<z.ZodString>;
5989
5699
  }, z.core.$strict>, z.ZodObject<{
5990
5700
  scope: z.ZodEnum<{
5991
5701
  plan: "plan";
@@ -6457,6 +6167,10 @@ export declare const StoreRequestSchema: z.ZodObject<{
6457
6167
  kind: z.ZodLiteral<"live-items">;
6458
6168
  threadId: z.ZodUUID;
6459
6169
  afterRevision: z.ZodOptional<z.ZodNumber>;
6170
+ }, z.core.$strict>, z.ZodObject<{
6171
+ kind: z.ZodLiteral<"session-states">;
6172
+ afterSequence: z.ZodDefault<z.ZodNumber>;
6173
+ limit: z.ZodDefault<z.ZodNumber>;
6460
6174
  }, z.core.$strict>], "kind">;
6461
6175
  }, z.core.$strict>, z.ZodObject<{
6462
6176
  kind: z.ZodLiteral<"remember">;
@@ -6479,10 +6193,18 @@ export declare const StoreRequestSchema: z.ZodObject<{
6479
6193
  notLoaded: "notLoaded";
6480
6194
  systemError: "systemError";
6481
6195
  }>;
6196
+ state: z.ZodEnum<{
6197
+ unknown: "unknown";
6198
+ idle: "idle";
6199
+ failed: "failed";
6200
+ running: "running";
6201
+ waiting: "waiting";
6202
+ closed: "closed";
6203
+ }>;
6482
6204
  ownership: z.ZodEnum<{
6483
6205
  external: "external";
6484
- uncertain: "uncertain";
6485
6206
  managed: "managed";
6207
+ uncertain: "uncertain";
6486
6208
  }>;
6487
6209
  managedId: z.ZodNullable<z.ZodUUID>;
6488
6210
  historyState: z.ZodEnum<{
@@ -6493,152 +6215,34 @@ export declare const StoreRequestSchema: z.ZodObject<{
6493
6215
  nextCursor: z.ZodNullable<z.ZodString>;
6494
6216
  observedAt: z.ZodNumber;
6495
6217
  }, z.core.$strict>, z.ZodObject<{
6496
- kind: z.ZodLiteral<"plan-revision-project">;
6497
- projection: z.ZodObject<{
6498
- directory: z.ZodString;
6499
- sourceHash: z.ZodNullable<z.ZodString>;
6500
- records: z.ZodArray<z.ZodObject<{
6501
- collection: z.ZodEnum<{
6502
- drafts: "drafts";
6503
- sources: "sources";
6504
- evidence: "evidence";
6505
- correspondences: "correspondences";
6506
- }>;
6507
- id: z.ZodString;
6508
- entry: z.ZodDiscriminatedUnion<[z.ZodObject<{
6509
- kind: z.ZodLiteral<"source">;
6510
- entry: z.ZodObject<{
6511
- ordinal: z.ZodNumber;
6512
- title: z.ZodString;
6513
- status: z.ZodEnum<{
6514
- pending: "pending";
6515
- "in progress": "in progress";
6516
- done: "done";
6517
- }>;
6518
- id: z.ZodUUID;
6519
- contractDigest: z.ZodString;
6520
- contract: z.ZodString;
6521
- sharedDigest: z.ZodString;
6522
- }, z.core.$strip>;
6523
- }, z.core.$strip>, z.ZodObject<{
6524
- kind: z.ZodLiteral<"draft">;
6525
- entry: z.ZodObject<{
6526
- ordinal: z.ZodNumber;
6527
- title: z.ZodString;
6528
- status: z.ZodEnum<{
6529
- pending: "pending";
6530
- "in progress": "in progress";
6531
- done: "done";
6532
- }>;
6533
- id: z.ZodUUID;
6534
- contractDigest: z.ZodString;
6535
- contract: z.ZodString;
6536
- sharedDigest: z.ZodString;
6537
- matchedSourceId: z.ZodNullable<z.ZodUUID>;
6538
- }, z.core.$strip>;
6539
- }, z.core.$strip>, z.ZodObject<{
6540
- kind: z.ZodLiteral<"evidence">;
6541
- entry: z.ZodObject<{
6542
- id: z.ZodUUID;
6543
- action: z.ZodObject<{
6544
- id: z.ZodUUID;
6545
- operatorId: z.ZodString;
6546
- source: z.ZodObject<{
6547
- kind: z.ZodEnum<{
6548
- "user-action": "user-action";
6549
- "user-message": "user-message";
6550
- }>;
6551
- reference: z.ZodString;
6552
- }, z.core.$strict>;
6553
- }, z.core.$strict>;
6554
- milestoneId: z.ZodNullable<z.ZodUUID>;
6555
- revision: z.ZodObject<{
6556
- planDigest: z.ZodString;
6557
- breakdownDigest: z.ZodNullable<z.ZodString>;
6558
- }, z.core.$strict>;
6559
- contractDigest: z.ZodString;
6560
- title: z.ZodString;
6561
- contract: z.ZodString;
6562
- sharedDigest: z.ZodNullable<z.ZodString>;
6563
- checkouts: z.ZodArray<z.ZodObject<{
6564
- repository: z.ZodString;
6565
- directory: z.ZodString;
6566
- claimReference: z.ZodString;
6567
- paths: z.ZodArray<z.ZodString>;
6568
- branch: z.ZodNullable<z.ZodString>;
6569
- head: z.ZodString;
6570
- fingerprint: z.ZodString;
6571
- }, z.core.$strict>>;
6572
- checks: z.ZodArray<z.ZodObject<{
6573
- command: z.ZodString;
6574
- outcome: z.ZodLiteral<"passed">;
6575
- reference: z.ZodString;
6576
- }, z.core.$strict>>;
6577
- completedAt: z.ZodNumber;
6578
- reopenActionId: z.ZodNullable<z.ZodUUID>;
6579
- }, z.core.$strict>;
6580
- }, z.core.$strip>, z.ZodObject<{
6581
- kind: z.ZodLiteral<"correspondence">;
6582
- entry: z.ZodObject<{
6583
- id: z.ZodUUID;
6584
- action: z.ZodObject<{
6585
- id: z.ZodUUID;
6586
- operatorId: z.ZodString;
6587
- source: z.ZodObject<{
6588
- kind: z.ZodEnum<{
6589
- "user-action": "user-action";
6590
- "user-message": "user-message";
6591
- }>;
6592
- reference: z.ZodString;
6593
- }, z.core.$strict>;
6594
- }, z.core.$strict>;
6595
- revision: z.ZodObject<{
6596
- planDigest: z.ZodString;
6597
- breakdownDigest: z.ZodNullable<z.ZodString>;
6598
- }, z.core.$strict>;
6599
- relation: z.ZodEnum<{
6600
- equivalent: "equivalent";
6601
- "requirements-changed": "requirements-changed";
6602
- omitted: "omitted";
6603
- reopened: "reopened";
6604
- }>;
6605
- targets: z.ZodArray<z.ZodObject<{
6606
- id: z.ZodUUID;
6607
- contractDigest: z.ZodString;
6608
- status: z.ZodEnum<{
6609
- pending: "pending";
6610
- "in progress": "in progress";
6611
- done: "done";
6612
- }>;
6613
- }, z.core.$strict>>;
6614
- invalidatedReceiptIds: z.ZodArray<z.ZodUUID>;
6615
- recordedAt: z.ZodNumber;
6616
- sources: z.ZodArray<z.ZodObject<{
6617
- id: z.ZodUUID;
6618
- status: z.ZodEnum<{
6619
- pending: "pending";
6620
- "in progress": "in progress";
6621
- done: "done";
6622
- }>;
6623
- contractDigest: z.ZodString;
6624
- }, z.core.$strip>>;
6625
- }, z.core.$strict>;
6626
- }, z.core.$strip>], "kind">;
6627
- }, z.core.$strict>>;
6628
- }, z.core.$strict>;
6218
+ kind: z.ZodLiteral<"plan-register">;
6219
+ directory: z.ZodString;
6629
6220
  }, z.core.$strict>, z.ZodObject<{
6630
- kind: z.ZodLiteral<"plan-revision-page">;
6631
- page: z.ZodObject<{
6632
- directory: z.ZodString;
6633
- collection: z.ZodEnum<{
6634
- drafts: "drafts";
6635
- sources: "sources";
6636
- evidence: "evidence";
6637
- correspondences: "correspondences";
6221
+ kind: z.ZodLiteral<"sessions-observe">;
6222
+ provider: z.ZodString;
6223
+ sessions: z.ZodArray<z.ZodObject<{
6224
+ nativeId: z.ZodString;
6225
+ state: z.ZodEnum<{
6226
+ unknown: "unknown";
6227
+ idle: "idle";
6228
+ failed: "failed";
6229
+ running: "running";
6230
+ waiting: "waiting";
6231
+ closed: "closed";
6638
6232
  }>;
6639
- after: z.ZodString;
6640
- limit: z.ZodNumber;
6641
- }, z.core.$strict>;
6233
+ }, z.core.$strict>>;
6234
+ isComplete: z.ZodBoolean;
6235
+ }, z.core.$strict>, z.ZodObject<{
6236
+ kind: z.ZodLiteral<"sessions-unknown">;
6237
+ provider: z.ZodString;
6238
+ }, z.core.$strict>, z.ZodObject<{
6239
+ kind: z.ZodLiteral<"sessions-states">;
6240
+ provider: z.ZodString;
6241
+ nativeIds: z.ZodArray<z.ZodString>;
6242
+ }, z.core.$strict>, z.ZodObject<{
6243
+ kind: z.ZodLiteral<"session-transitions">;
6244
+ afterSequence: z.ZodNumber;
6245
+ limit: z.ZodNumber;
6642
6246
  }, z.core.$strict>, z.ZodObject<{
6643
6247
  kind: z.ZodLiteral<"thread-plan-read">;
6644
6248
  threadId: z.ZodUUID;
@@ -7482,14 +7086,13 @@ export type IStore = {
7482
7086
  * @throws
7483
7087
  * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
7484
7088
  */
7485
- prepareStorageMaintenance(isSnapshot: boolean): Promise<boolean>;
7089
+ prepareStorageMaintenance(): Promise<boolean>;
7486
7090
  /**
7487
7091
  * Reads one seek page of registered plan directories while maintenance holds admission.
7488
7092
  * @returns At most 128 ordered directories.
7489
7093
  * @throws
7490
7094
  * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
7491
7095
  */
7492
- snapshotPlans(after: string): Promise<string[]>;
7493
7096
  /**
7494
7097
  * Copies the worker's database through SQLite's WAL-aware backup API.
7495
7098
  * Local backup completion has no metadata-command deadline; maintenance stays held until it settles.
@@ -7523,25 +7126,43 @@ export type IStore = {
7523
7126
  * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
7524
7127
  */
7525
7128
  settleBrowserAction(id: string, operatorId: string, state: 'acknowledged' | 'uncertain'): Promise<IBrowserReceipt | null>;
7526
- /** Refreshes one selected coordination-file projection.
7527
- * @returns A promise resolved after projection commit.
7129
+ /** Records a resolved plan directory so snapshots capture its files.
7130
+ * @returns A promise resolved after the idempotent insert commits.
7528
7131
  * @throws
7529
7132
  * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
7530
7133
  */
7531
- projectPlanRevision(projection: IPlanRevisionProjection): Promise<void>;
7532
- /** Reads a bounded revision/evidence seek page.
7533
- * @returns A page within the response byte budget.
7134
+ registerPlan(directory: string): Promise<void>;
7135
+ /** Records observed states of sessions HQ doesn't manage; complete observations close omissions.
7136
+ * @returns A promise resolved after the transaction commits.
7534
7137
  * @throws
7535
7138
  * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
7536
7139
  */
7537
- listPlanRevision(page: {
7538
- directory: string;
7539
- collection: 'sources' | 'drafts' | 'evidence' | 'correspondences';
7540
- after: string;
7541
- limit: number;
7542
- }): Promise<{
7543
- data: IPlanReconciliationEntry[];
7544
- lastId: string | null;
7140
+ observeSessions(provider: string, sessions: {
7141
+ nativeId: string;
7142
+ state: ISessionState;
7143
+ }[], isComplete: boolean): Promise<void>;
7144
+ /** Marks a provider's open observed sessions unknown after its native connection was lost.
7145
+ * @returns A promise resolved after the update commits.
7146
+ * @throws
7147
+ * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
7148
+ */
7149
+ markSessionsUnknown(provider: string): Promise<void>;
7150
+ /** Reads the live states of selected native sessions, managed or observed.
7151
+ * @returns The sessions HQ manages or has observed, without the others.
7152
+ * @throws
7153
+ * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
7154
+ */
7155
+ getSessionStates(provider: string, nativeIds: string[]): Promise<{
7156
+ nativeId: string;
7157
+ state: ISessionState;
7158
+ }[]>;
7159
+ /** Reads session transitions after a sequence, in order.
7160
+ * @returns A bounded page and whether more transitions follow.
7161
+ * @throws
7162
+ * - JG_AGENT_HQ_STORE_FAILED: The HQ store failed
7163
+ */
7164
+ listSessionTransitions(afterSequence: number, limit: number): Promise<{
7165
+ data: ISessionTransition[];
7545
7166
  hasMore: boolean;
7546
7167
  }>;
7547
7168
  /** Reads a thread's exact current plan binding.