@phyzess/pappra 0.0.0-stage → 0.1.0-beta.2

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 (221) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -2
  3. package/THIRD_PARTY_NOTICES.md +16 -0
  4. package/assets/integrations/skills/pappra/SKILL.md +68 -0
  5. package/assets/integrations/skills/pappra/references/hosts.md +30 -0
  6. package/assets/integrations/skills/pappra/references/lifecycle.md +37 -0
  7. package/assets/integrations/skills/pappra/references/operations.md +14 -0
  8. package/assets/manifest.json +4 -0
  9. package/dist/app/collaboration.d.ts +170 -0
  10. package/dist/app/collaboration.js +1650 -0
  11. package/dist/app/doctor.d.ts +9 -0
  12. package/dist/app/doctor.js +1030 -0
  13. package/dist/app/init.d.ts +143 -0
  14. package/dist/app/init.js +1111 -0
  15. package/dist/cli/commands/code.d.ts +16 -0
  16. package/dist/cli/commands/code.js +127 -0
  17. package/dist/cli/commands/collaboration.d.ts +13 -0
  18. package/dist/cli/commands/collaboration.js +186 -0
  19. package/dist/cli/commands/continuity.d.ts +29 -0
  20. package/dist/cli/commands/continuity.js +133 -0
  21. package/dist/cli/commands/docs.d.ts +11 -0
  22. package/dist/cli/commands/docs.js +133 -0
  23. package/dist/cli/commands/doctor.d.ts +14 -0
  24. package/dist/cli/commands/doctor.js +57 -0
  25. package/dist/cli/commands/host.d.ts +13 -0
  26. package/dist/cli/commands/host.js +125 -0
  27. package/dist/cli/commands/init.d.ts +51 -0
  28. package/dist/cli/commands/init.js +668 -0
  29. package/dist/cli/main.d.ts +2 -0
  30. package/dist/cli/main.js +10 -0
  31. package/dist/cli/output.d.ts +4 -0
  32. package/dist/cli/output.js +1 -0
  33. package/dist/cli/run.d.ts +2 -0
  34. package/dist/cli/run.js +597 -0
  35. package/dist/code/budget.d.ts +14 -0
  36. package/dist/code/budget.js +39 -0
  37. package/dist/code/exec.d.ts +23 -0
  38. package/dist/code/exec.js +133 -0
  39. package/dist/code/identity.d.ts +13 -0
  40. package/dist/code/identity.js +214 -0
  41. package/dist/code/index.d.ts +6 -0
  42. package/dist/code/index.js +3 -0
  43. package/dist/code/providers/codegraph.d.ts +59 -0
  44. package/dist/code/providers/codegraph.js +567 -0
  45. package/dist/code/registration.d.ts +9 -0
  46. package/dist/code/registration.js +293 -0
  47. package/dist/code/service.d.ts +53 -0
  48. package/dist/code/service.js +633 -0
  49. package/dist/code/text.d.ts +3 -0
  50. package/dist/code/text.js +202 -0
  51. package/dist/collab/admission.d.ts +450 -0
  52. package/dist/collab/admission.js +797 -0
  53. package/dist/collab/canonical.d.ts +26 -0
  54. package/dist/collab/canonical.js +136 -0
  55. package/dist/collab/contracts.d.ts +73 -0
  56. package/dist/collab/contracts.js +76 -0
  57. package/dist/collab/envelope.d.ts +52 -0
  58. package/dist/collab/envelope.js +241 -0
  59. package/dist/collab/fingerprint.d.ts +7 -0
  60. package/dist/collab/fingerprint.js +58 -0
  61. package/dist/collab/handoff.d.ts +350 -0
  62. package/dist/collab/handoff.js +513 -0
  63. package/dist/collab/index.d.ts +9 -0
  64. package/dist/collab/index.js +8 -0
  65. package/dist/collab/lifecycle.d.ts +449 -0
  66. package/dist/collab/lifecycle.js +534 -0
  67. package/dist/collab/messages.d.ts +148 -0
  68. package/dist/collab/messages.js +583 -0
  69. package/dist/collab/notify.d.ts +47 -0
  70. package/dist/collab/notify.js +140 -0
  71. package/dist/collab/preflight.d.ts +31 -0
  72. package/dist/collab/preflight.js +271 -0
  73. package/dist/collab/resources.d.ts +119 -0
  74. package/dist/collab/resources.js +451 -0
  75. package/dist/collab/store.d.ts +143 -0
  76. package/dist/collab/store.js +606 -0
  77. package/dist/collab/types.d.ts +354 -0
  78. package/dist/collab/types.js +1 -0
  79. package/dist/collab/validation.d.ts +10 -0
  80. package/dist/collab/validation.js +303 -0
  81. package/dist/continuity/context.d.ts +24 -0
  82. package/dist/continuity/context.js +179 -0
  83. package/dist/continuity/index.d.ts +3 -0
  84. package/dist/continuity/index.js +1 -0
  85. package/dist/continuity/paths.d.ts +37 -0
  86. package/dist/continuity/paths.js +258 -0
  87. package/dist/continuity/service.d.ts +59 -0
  88. package/dist/continuity/service.js +1258 -0
  89. package/dist/hosts/claude/native.d.ts +79 -0
  90. package/dist/hosts/claude/native.js +853 -0
  91. package/dist/hosts/codex/native.d.ts +345 -0
  92. package/dist/hosts/codex/native.js +1528 -0
  93. package/dist/hosts/codex/protocol.d.ts +51 -0
  94. package/dist/hosts/codex/protocol.js +42 -0
  95. package/dist/hosts/detect.d.ts +28 -0
  96. package/dist/hosts/detect.js +73 -0
  97. package/dist/hosts/index.d.ts +10 -0
  98. package/dist/hosts/index.js +10 -0
  99. package/dist/hosts/integration/bundle.d.ts +16 -0
  100. package/dist/hosts/integration/bundle.js +81 -0
  101. package/dist/hosts/integration/hook-entry.d.ts +1 -0
  102. package/dist/hosts/integration/hook-entry.js +68 -0
  103. package/dist/hosts/integration/hook.d.ts +32 -0
  104. package/dist/hosts/integration/hook.js +781 -0
  105. package/dist/hosts/integration/pi-extension-runtime.d.ts +18 -0
  106. package/dist/hosts/integration/pi-extension-runtime.js +89 -0
  107. package/dist/hosts/integration/pi-template.d.ts +3 -0
  108. package/dist/hosts/integration/pi-template.js +5 -0
  109. package/dist/hosts/integration/service.d.ts +41 -0
  110. package/dist/hosts/integration/service.js +1381 -0
  111. package/dist/hosts/integration/support.d.ts +36 -0
  112. package/dist/hosts/integration/support.js +41 -0
  113. package/dist/hosts/integration/templates.d.ts +22 -0
  114. package/dist/hosts/integration/templates.js +70 -0
  115. package/dist/hosts/pi/protocol.d.ts +22 -0
  116. package/dist/hosts/pi/protocol.js +28 -0
  117. package/dist/hosts/pi/query-result.d.ts +22 -0
  118. package/dist/hosts/pi/query-result.js +710 -0
  119. package/dist/hosts/pi/rpc.d.ts +937 -0
  120. package/dist/hosts/pi/rpc.js +1621 -0
  121. package/dist/hosts/pilot.d.ts +485 -0
  122. package/dist/hosts/pilot.js +593 -0
  123. package/dist/index.d.ts +5 -0
  124. package/dist/index.js +4 -0
  125. package/dist/infra/fs.d.ts +27 -0
  126. package/dist/infra/fs.js +130 -0
  127. package/dist/infra/git.d.ts +60 -0
  128. package/dist/infra/git.js +358 -0
  129. package/dist/infra/owned-process-group.d.ts +173 -0
  130. package/dist/infra/owned-process-group.js +571 -0
  131. package/dist/install/apply.d.ts +65 -0
  132. package/dist/install/apply.js +663 -0
  133. package/dist/install/index.d.ts +5 -0
  134. package/dist/install/index.js +5 -0
  135. package/dist/install/ownership.d.ts +85 -0
  136. package/dist/install/ownership.js +430 -0
  137. package/dist/install/plan.d.ts +39 -0
  138. package/dist/install/plan.js +97 -0
  139. package/dist/install/rollback.d.ts +18 -0
  140. package/dist/install/rollback.js +544 -0
  141. package/dist/install/runtime.d.ts +76 -0
  142. package/dist/install/runtime.js +1145 -0
  143. package/dist/knowledge/catalog.d.ts +47 -0
  144. package/dist/knowledge/catalog.js +308 -0
  145. package/dist/knowledge/context.d.ts +28 -0
  146. package/dist/knowledge/context.js +61 -0
  147. package/dist/knowledge/index.d.ts +3 -0
  148. package/dist/knowledge/index.js +1 -0
  149. package/dist/knowledge/journal.d.ts +16 -0
  150. package/dist/knowledge/journal.js +109 -0
  151. package/dist/knowledge/lifecycle.d.ts +8 -0
  152. package/dist/knowledge/lifecycle.js +1001 -0
  153. package/dist/knowledge/paths.d.ts +37 -0
  154. package/dist/knowledge/paths.js +236 -0
  155. package/dist/knowledge/refs.d.ts +36 -0
  156. package/dist/knowledge/refs.js +267 -0
  157. package/dist/knowledge/service.d.ts +21 -0
  158. package/dist/knowledge/service.js +393 -0
  159. package/dist/knowledge/types.d.ts +171 -0
  160. package/dist/knowledge/types.js +1 -0
  161. package/dist/knowledge/write.d.ts +8 -0
  162. package/dist/knowledge/write.js +1223 -0
  163. package/dist/package-info.d.ts +6 -0
  164. package/dist/package-info.js +19 -0
  165. package/dist/schemas/code.d.ts +377 -0
  166. package/dist/schemas/code.js +145 -0
  167. package/dist/schemas/collaboration.d.ts +115 -0
  168. package/dist/schemas/collaboration.js +106 -0
  169. package/dist/schemas/continuity.d.ts +315 -0
  170. package/dist/schemas/continuity.js +199 -0
  171. package/dist/schemas/diagnostics.d.ts +28 -0
  172. package/dist/schemas/diagnostics.js +27 -0
  173. package/dist/schemas/doctor.d.ts +157 -0
  174. package/dist/schemas/doctor.js +75 -0
  175. package/dist/schemas/document.d.ts +644 -0
  176. package/dist/schemas/document.js +296 -0
  177. package/dist/schemas/errors.d.ts +177 -0
  178. package/dist/schemas/errors.js +176 -0
  179. package/dist/schemas/evidence.d.ts +24 -0
  180. package/dist/schemas/evidence.js +16 -0
  181. package/dist/schemas/host.d.ts +436 -0
  182. package/dist/schemas/host.js +201 -0
  183. package/dist/schemas/index.d.ts +15 -0
  184. package/dist/schemas/index.js +15 -0
  185. package/dist/schemas/init.d.ts +121 -0
  186. package/dist/schemas/init.js +94 -0
  187. package/dist/schemas/install.d.ts +213 -0
  188. package/dist/schemas/install.js +139 -0
  189. package/dist/schemas/machine.d.ts +43 -0
  190. package/dist/schemas/machine.js +96 -0
  191. package/dist/schemas/outcome.d.ts +23 -0
  192. package/dist/schemas/outcome.js +17 -0
  193. package/dist/schemas/paths.d.ts +19 -0
  194. package/dist/schemas/paths.js +63 -0
  195. package/dist/schemas/workspace.d.ts +120 -0
  196. package/dist/schemas/workspace.js +201 -0
  197. package/dist/workspace/config-file.d.ts +36 -0
  198. package/dist/workspace/config-file.js +237 -0
  199. package/dist/workspace/config.d.ts +28 -0
  200. package/dist/workspace/config.js +79 -0
  201. package/dist/workspace/discover.d.ts +34 -0
  202. package/dist/workspace/discover.js +195 -0
  203. package/dist/workspace/documents.d.ts +21 -0
  204. package/dist/workspace/documents.js +395 -0
  205. package/dist/workspace/ignore.d.ts +10 -0
  206. package/dist/workspace/ignore.js +48 -0
  207. package/dist/workspace/index.d.ts +7 -0
  208. package/dist/workspace/index.js +3 -0
  209. package/dist/workspace/repositories.d.ts +24 -0
  210. package/dist/workspace/repositories.js +411 -0
  211. package/dist/workspace/resolve.d.ts +24 -0
  212. package/dist/workspace/resolve.js +268 -0
  213. package/dist/workspace/types.d.ts +71 -0
  214. package/dist/workspace/types.js +1 -0
  215. package/dist/workspace/validation.d.ts +18 -0
  216. package/dist/workspace/validation.js +197 -0
  217. package/package.json +105 -4
  218. package/skills/pappra/SKILL.md +68 -0
  219. package/skills/pappra/references/hosts.md +30 -0
  220. package/skills/pappra/references/lifecycle.md +37 -0
  221. package/skills/pappra/references/operations.md +14 -0
@@ -0,0 +1,449 @@
1
+ import type { TaskRecord, Message, ResultEntry } from './types.js';
2
+ export declare const ATTEMPT_STATES: readonly string[];
3
+ export declare const ACTIVE_STATES: readonly string[];
4
+ export declare const TERMINAL_STATES: readonly string[];
5
+ /** Outcomes that genuinely end an execution. `needs_input` is a recoverable block, so it is
6
+ * terminal for transitions but NOT closed for the purpose of starting a new attempt. */
7
+ export declare const CLOSED_STATES: readonly string[];
8
+ export declare const UNCERTAINTY_KINDS: readonly string[];
9
+ export declare function attemptKey(subtaskId: string, attempt: number): string;
10
+ export declare function findAttempt(record: TaskRecord, subtaskId: string | null, attempt: number | null): import("./types.js").Attempt | null;
11
+ export declare function attemptsFor(record: TaskRecord, subtaskId: string): import("./types.js").Attempt[];
12
+ export declare function latestAttemptNumber(record: TaskRecord, subtaskId: string): number;
13
+ export declare function checkOwnerEpoch(record: TaskRecord, epoch: number): {
14
+ ok: false;
15
+ reason: string;
16
+ expected?: never;
17
+ actual?: never;
18
+ owner_epoch?: never;
19
+ } | {
20
+ ok: false;
21
+ reason: string;
22
+ expected: number;
23
+ actual: number;
24
+ owner_epoch?: never;
25
+ } | {
26
+ reason?: never;
27
+ expected?: never;
28
+ actual?: never;
29
+ ok: true;
30
+ owner_epoch: number;
31
+ };
32
+ /** Every state change is appended as a transition record; history is never rewritten. */
33
+ export declare function transitionAttempt(record: TaskRecord, { subtaskId, attempt, to, actor, reason, evidence, clock, force, }: {
34
+ subtaskId: string | null;
35
+ attempt: number | null;
36
+ to: string;
37
+ actor?: string;
38
+ reason?: string;
39
+ evidence?: unknown;
40
+ clock?: number;
41
+ force?: boolean;
42
+ }): {
43
+ ok: false;
44
+ reason: string;
45
+ subtask_id: string | null;
46
+ attempt: number | null;
47
+ from?: never;
48
+ to?: never;
49
+ detail?: never;
50
+ state?: never;
51
+ at?: never;
52
+ } | {
53
+ subtask_id?: never;
54
+ attempt?: never;
55
+ ok: false;
56
+ reason: string;
57
+ state: string;
58
+ from?: never;
59
+ to?: never;
60
+ detail?: never;
61
+ at?: never;
62
+ } | {
63
+ subtask_id?: never;
64
+ attempt?: never;
65
+ ok: false;
66
+ reason: string;
67
+ from: string;
68
+ to: string;
69
+ detail?: never;
70
+ state?: never;
71
+ at?: never;
72
+ } | {
73
+ subtask_id?: never;
74
+ attempt?: never;
75
+ from?: never;
76
+ to?: never;
77
+ ok: false;
78
+ reason: string;
79
+ detail: string;
80
+ state?: never;
81
+ at?: never;
82
+ } | {
83
+ reason?: never;
84
+ subtask_id?: never;
85
+ attempt?: never;
86
+ from?: never;
87
+ to?: never;
88
+ detail?: never;
89
+ ok: true;
90
+ state: string;
91
+ at: string;
92
+ };
93
+ export declare function upsertAssignment(record: TaskRecord, { message, assignmentRef, assignmentDigest, inputRevision, clock, }: {
94
+ message: Message;
95
+ assignmentRef?: string | null;
96
+ assignmentDigest?: string | null;
97
+ inputRevision?: string | null;
98
+ clock?: number;
99
+ }): {
100
+ subtask_id?: never;
101
+ attempt?: never;
102
+ detail?: never;
103
+ state?: never;
104
+ ok: false;
105
+ reason: string;
106
+ latest?: never;
107
+ requested?: never;
108
+ still_active?: never;
109
+ } | {
110
+ detail?: never;
111
+ state?: never;
112
+ ok: false;
113
+ reason: string;
114
+ subtask_id: string;
115
+ attempt: number;
116
+ latest?: never;
117
+ requested?: never;
118
+ still_active?: never;
119
+ } | {
120
+ detail?: never;
121
+ ok: false;
122
+ reason: string;
123
+ state: string;
124
+ subtask_id: string;
125
+ attempt: number;
126
+ latest?: never;
127
+ requested?: never;
128
+ still_active?: never;
129
+ } | {
130
+ subtask_id?: never;
131
+ attempt?: never;
132
+ detail?: never;
133
+ state?: never;
134
+ ok: false;
135
+ reason: string;
136
+ latest: number;
137
+ requested: number;
138
+ still_active?: never;
139
+ } | {
140
+ subtask_id?: never;
141
+ attempt?: never;
142
+ state?: never;
143
+ latest?: never;
144
+ requested?: never;
145
+ ok: false;
146
+ reason: string;
147
+ detail: string;
148
+ still_active?: never;
149
+ } | {
150
+ subtask_id?: never;
151
+ attempt?: never;
152
+ state?: never;
153
+ latest?: never;
154
+ requested?: never;
155
+ ok: false;
156
+ reason: string;
157
+ detail: string;
158
+ still_active: string[];
159
+ } | {
160
+ reason?: never;
161
+ detail?: never;
162
+ latest?: never;
163
+ requested?: never;
164
+ still_active?: never;
165
+ ok: true;
166
+ subtask_id: string;
167
+ attempt: number;
168
+ state: string;
169
+ };
170
+ /**
171
+ * Record native evidence for an attempt. `observation: confirmed` requires an evidence
172
+ * reference; `unknown` is a first-class observation and never means failure.
173
+ */
174
+ export declare function bindNative(record: TaskRecord, { subtaskId, attempt, runner, sessionId, runId, missionId, observation, evidenceRef, observedAt, clock, }: {
175
+ subtaskId: string;
176
+ attempt: number;
177
+ runner?: string | null;
178
+ sessionId?: string | null;
179
+ runId?: string | null;
180
+ missionId?: string | null;
181
+ observation: string;
182
+ evidenceRef?: string | null;
183
+ observedAt?: string | null;
184
+ clock?: number;
185
+ }): {
186
+ ok: false;
187
+ reason: string;
188
+ native?: never;
189
+ reconciled_uncertainty?: never;
190
+ } | {
191
+ reason?: never;
192
+ ok: true;
193
+ native: import("./types.js").NativeBinding;
194
+ reconciled_uncertainty: string | null;
195
+ };
196
+ /**
197
+ * Admit a reported result. Classification:
198
+ * applied the attempt is active and its input revision still matches
199
+ * late the attempt already has a different admitted result: evidence only
200
+ * superseded a newer attempt or a different input revision is authoritative
201
+ * duplicate the same message was already admitted
202
+ */
203
+ export declare function recordResult(record: TaskRecord, { subtaskId, attempt, status, messageId, inputRevision, outputs, nativeRef, clock, evidenceRef, }: {
204
+ subtaskId: string;
205
+ attempt: number;
206
+ status: string;
207
+ messageId: string;
208
+ inputRevision?: string | null;
209
+ outputs?: unknown[];
210
+ nativeRef?: unknown;
211
+ clock?: number;
212
+ evidenceRef?: string | null;
213
+ }): {
214
+ ok: false;
215
+ reason: string;
216
+ note?: never;
217
+ classification?: never;
218
+ entry?: never;
219
+ transition?: never;
220
+ transitions?: never;
221
+ } | {
222
+ reason?: never;
223
+ ok: true;
224
+ classification: string;
225
+ entry: ResultEntry;
226
+ note?: never;
227
+ transition?: never;
228
+ transitions?: never;
229
+ } | {
230
+ reason?: never;
231
+ ok: true;
232
+ classification: string;
233
+ entry: ResultEntry;
234
+ note: string;
235
+ transitions: ({
236
+ ok: false;
237
+ reason: string;
238
+ subtask_id: string | null;
239
+ attempt: number | null;
240
+ from?: never;
241
+ to?: never;
242
+ detail?: never;
243
+ state?: never;
244
+ at?: never;
245
+ } | {
246
+ subtask_id?: never;
247
+ attempt?: never;
248
+ ok: false;
249
+ reason: string;
250
+ state: string;
251
+ from?: never;
252
+ to?: never;
253
+ detail?: never;
254
+ at?: never;
255
+ } | {
256
+ subtask_id?: never;
257
+ attempt?: never;
258
+ ok: false;
259
+ reason: string;
260
+ from: string;
261
+ to: string;
262
+ detail?: never;
263
+ state?: never;
264
+ at?: never;
265
+ } | {
266
+ subtask_id?: never;
267
+ attempt?: never;
268
+ from?: never;
269
+ to?: never;
270
+ ok: false;
271
+ reason: string;
272
+ detail: string;
273
+ state?: never;
274
+ at?: never;
275
+ } | {
276
+ reason?: never;
277
+ subtask_id?: never;
278
+ attempt?: never;
279
+ from?: never;
280
+ to?: never;
281
+ detail?: never;
282
+ ok: true;
283
+ state: string;
284
+ at: string;
285
+ })[];
286
+ transition?: never;
287
+ } | {
288
+ reason?: never;
289
+ note?: never;
290
+ ok: true;
291
+ classification: string;
292
+ entry: ResultEntry;
293
+ transition: {
294
+ ok: false;
295
+ reason: string;
296
+ subtask_id: string | null;
297
+ attempt: number | null;
298
+ from?: never;
299
+ to?: never;
300
+ detail?: never;
301
+ state?: never;
302
+ at?: never;
303
+ } | {
304
+ subtask_id?: never;
305
+ attempt?: never;
306
+ ok: false;
307
+ reason: string;
308
+ state: string;
309
+ from?: never;
310
+ to?: never;
311
+ detail?: never;
312
+ at?: never;
313
+ } | {
314
+ subtask_id?: never;
315
+ attempt?: never;
316
+ ok: false;
317
+ reason: string;
318
+ from: string;
319
+ to: string;
320
+ detail?: never;
321
+ state?: never;
322
+ at?: never;
323
+ } | {
324
+ subtask_id?: never;
325
+ attempt?: never;
326
+ from?: never;
327
+ to?: never;
328
+ ok: false;
329
+ reason: string;
330
+ detail: string;
331
+ state?: never;
332
+ at?: never;
333
+ } | {
334
+ reason?: never;
335
+ subtask_id?: never;
336
+ attempt?: never;
337
+ from?: never;
338
+ to?: never;
339
+ detail?: never;
340
+ ok: true;
341
+ state: string;
342
+ at: string;
343
+ } | undefined;
344
+ transitions: ({
345
+ ok: false;
346
+ reason: string;
347
+ subtask_id: string | null;
348
+ attempt: number | null;
349
+ from?: never;
350
+ to?: never;
351
+ detail?: never;
352
+ state?: never;
353
+ at?: never;
354
+ } | {
355
+ subtask_id?: never;
356
+ attempt?: never;
357
+ ok: false;
358
+ reason: string;
359
+ state: string;
360
+ from?: never;
361
+ to?: never;
362
+ detail?: never;
363
+ at?: never;
364
+ } | {
365
+ subtask_id?: never;
366
+ attempt?: never;
367
+ ok: false;
368
+ reason: string;
369
+ from: string;
370
+ to: string;
371
+ detail?: never;
372
+ state?: never;
373
+ at?: never;
374
+ } | {
375
+ subtask_id?: never;
376
+ attempt?: never;
377
+ from?: never;
378
+ to?: never;
379
+ ok: false;
380
+ reason: string;
381
+ detail: string;
382
+ state?: never;
383
+ at?: never;
384
+ } | {
385
+ reason?: never;
386
+ subtask_id?: never;
387
+ attempt?: never;
388
+ from?: never;
389
+ to?: never;
390
+ detail?: never;
391
+ ok: true;
392
+ state: string;
393
+ at: string;
394
+ })[];
395
+ };
396
+ export declare function writeResultEvidence(taskRoot: string, entry: ResultEntry): string;
397
+ export declare function openUncertainty(record: TaskRecord, { kind, subtaskId, attempt, detail, evidenceRef, resolutionHint, clock, }: {
398
+ kind: string;
399
+ subtaskId?: string | null;
400
+ attempt?: number | null;
401
+ detail?: string | null;
402
+ evidenceRef?: string | null;
403
+ resolutionHint?: string | null;
404
+ clock?: number;
405
+ }): {
406
+ ok: false;
407
+ reason: string;
408
+ kind: string;
409
+ duplicate?: never;
410
+ uncertainty_id?: never;
411
+ } | {
412
+ reason?: never;
413
+ kind?: never;
414
+ ok: true;
415
+ uncertainty_id: string;
416
+ duplicate: boolean;
417
+ } | {
418
+ reason?: never;
419
+ kind?: never;
420
+ duplicate?: never;
421
+ ok: true;
422
+ uncertainty_id: string;
423
+ };
424
+ export declare function resolveUncertainty(record: TaskRecord, { uncertaintyId, resolution, resolutionEvidence, actor, clock, }: {
425
+ uncertaintyId: string;
426
+ resolution: string;
427
+ resolutionEvidence?: unknown;
428
+ actor?: string;
429
+ clock?: number;
430
+ }): {
431
+ uncertainty_id?: never;
432
+ ok: false;
433
+ reason: string;
434
+ resolved_at?: never;
435
+ resolution?: never;
436
+ } | {
437
+ uncertainty_id?: never;
438
+ ok: false;
439
+ reason: string;
440
+ resolved_at: string;
441
+ resolution?: never;
442
+ } | {
443
+ reason?: never;
444
+ resolved_at?: never;
445
+ ok: true;
446
+ uncertainty_id: string;
447
+ resolution: string;
448
+ };
449
+ export declare function recordDigest(record: TaskRecord): string;