@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,345 @@
1
+ import { type NativeReply, type NativeEvent, type NativeEntry } from './protocol.js';
2
+ export interface TransportOptions {
3
+ cwd: string;
4
+ codexBin?: string | undefined;
5
+ env?: NodeJS.ProcessEnv | undefined;
6
+ args?: never;
7
+ deadlineMs?: number;
8
+ maxBytes?: number | undefined;
9
+ controlled?: boolean;
10
+ initialize?: boolean;
11
+ onServerRequest?: (request: {
12
+ id: string | number;
13
+ method: string;
14
+ params: unknown;
15
+ }) => Record<string, unknown>;
16
+ }
17
+ interface RequestLog {
18
+ id: string;
19
+ method: string;
20
+ at: string;
21
+ ok: boolean;
22
+ code?: string | null;
23
+ }
24
+ interface StopOptions {
25
+ termMs?: number | undefined;
26
+ killMs?: number | undefined;
27
+ }
28
+ export type CodexTransport = Awaited<ReturnType<typeof openCodexTransport>>;
29
+ export interface AttemptOptions {
30
+ taskRoot: string;
31
+ subtaskId: string;
32
+ attempt: number;
33
+ ownerEpoch: number;
34
+ agentId: string;
35
+ sessionId: string;
36
+ threadId: string;
37
+ turnId: string;
38
+ cwd: string;
39
+ transport: CodexTransport;
40
+ timeoutMs?: number;
41
+ reason?: string;
42
+ evidenceDir?: string;
43
+ stopTermMs?: number;
44
+ stopKillMs?: number;
45
+ }
46
+ export interface HistoryOptions extends TransportOptions {
47
+ threadId: string;
48
+ turnId?: string;
49
+ timeoutMs?: number;
50
+ requireCompleted?: boolean;
51
+ }
52
+ export interface CodexObservation {
53
+ schema: string;
54
+ status: string;
55
+ claims_retained: boolean;
56
+ blockers?: string[];
57
+ detail?: string | null;
58
+ evidence?: Record<string, unknown>;
59
+ native?: {
60
+ turn_status?: string | null;
61
+ [key: string]: unknown;
62
+ };
63
+ [key: string]: unknown;
64
+ }
65
+ export declare class CodexNativeRefusal extends Error {
66
+ readonly status: string;
67
+ readonly code: string;
68
+ readonly detail: string | null;
69
+ constructor(status: string, code: string, detail?: string | null);
70
+ }
71
+ /**
72
+ * Own one `codex app-server --stdio` child and speak bounded JSONL with it. Opening is a local
73
+ * no-inference process start; `initialize` performs no model work.
74
+ */
75
+ export declare function openCodexTransport(options: TransportOptions): Promise<Readonly<{
76
+ schema: "harness-collab/codex-native/1";
77
+ identity: Readonly<{
78
+ kind: "codex-app-server-stdio";
79
+ argv: string[];
80
+ cwd: string;
81
+ pid: number | null;
82
+ client_info: Readonly<{
83
+ name: "harness-collab-codex-native";
84
+ version: "1";
85
+ }>;
86
+ opened_at: string;
87
+ model_inference: "none";
88
+ admitted_launcher: false;
89
+ scope: "controlled-owned-group" | "default-process";
90
+ }>;
91
+ pid: number | null;
92
+ request: (method: string, params: Record<string, unknown>, opts?: {
93
+ timeoutMs?: number;
94
+ }) => Promise<NativeReply>;
95
+ notify: (method: string, params: Record<string, unknown>) => void;
96
+ events: () => NativeEvent[];
97
+ requestLog: () => RequestLog[];
98
+ serverRequestsRefused: () => {
99
+ id: string | number;
100
+ method: string;
101
+ at: string;
102
+ }[];
103
+ fatal: () => CodexNativeRefusal | null;
104
+ requestIds: () => string[];
105
+ ownedThread: (threadId: string) => boolean;
106
+ ownedTurn: (threadId: string, turnId: string) => boolean;
107
+ owned: (threadId: string, turnId: string) => boolean;
108
+ createdThreads: () => string[];
109
+ createdTurns: () => {
110
+ threadId: string;
111
+ turnId: string;
112
+ }[];
113
+ waitForNotification: (predicate: (event: NativeEvent) => boolean, opts?: {
114
+ timeoutMs?: number;
115
+ fromIndex?: number;
116
+ }) => Promise<NativeEvent>;
117
+ initialize: () => Promise<NativeReply>;
118
+ /** Explicit low-level fixture creation. Never called by query/cancel/recover. */
119
+ startThread: (params: Record<string, unknown> & {
120
+ cwd: string;
121
+ }) => Promise<{
122
+ threadId: string;
123
+ thread: import("./protocol.js").NativeThread;
124
+ }>;
125
+ /** Explicit low-level fixture creation. Never called by query/cancel/recover. */
126
+ startTurn: (params: Record<string, unknown> & {
127
+ threadId: string;
128
+ }) => Promise<{
129
+ threadId: string;
130
+ turnId: string;
131
+ turn: NativeEntry;
132
+ }>;
133
+ /**
134
+ * Explicit native shell turn on an owned, idle thread. This performs no model request: it
135
+ * runs a local shell command through the app-server's own user-shell surface. The event
136
+ * wait is installed before the request, so a `turn/started` that precedes the empty
137
+ * acknowledgement is still correlated by thread and turn id.
138
+ */
139
+ startShellTurn: (params: {
140
+ threadId: string;
141
+ command: string;
142
+ waitMs?: number;
143
+ timeoutMs?: number;
144
+ }) => Promise<{
145
+ threadId: string;
146
+ turnId: string;
147
+ ack: NativeReply;
148
+ event: {
149
+ method: string;
150
+ seq: number;
151
+ at: string;
152
+ };
153
+ event_preceded_ack: boolean;
154
+ native_timeout_ms: number | null;
155
+ }>;
156
+ threadRead: (threadId: string, params?: {
157
+ includeTurns?: boolean;
158
+ }) => Promise<NativeReply>;
159
+ listTurns: (threadId: string, params?: {
160
+ itemsView?: string;
161
+ sortDirection?: string;
162
+ limit?: number;
163
+ }) => Promise<NativeReply>;
164
+ listItems: (threadId: string, params?: {
165
+ turnId?: string;
166
+ sortDirection?: string;
167
+ limit?: number;
168
+ }) => Promise<NativeReply>;
169
+ /**
170
+ * Frozen runtime capability. `stop` terminates ONLY the owned process group created for a
171
+ * controlled transport (bounded TERM then KILL) and positively re-observes the group. In
172
+ * default mode it refuses; it never releases resources and never signals a caller-supplied
173
+ * pid/pgid. Descendants that escaped the group via setsid are outside this guarantee.
174
+ */
175
+ runtime: Readonly<{
176
+ scope: "controlled-owned-group" | "default-process";
177
+ controlled: boolean;
178
+ stop: (stopOptions?: StopOptions) => Promise<{
179
+ scope: string;
180
+ child_pid: number | null;
181
+ group_observed: boolean;
182
+ group_live: boolean;
183
+ live_members: number[];
184
+ parent_exited: boolean;
185
+ stopped: boolean;
186
+ term_sent: boolean;
187
+ kill_sent: boolean;
188
+ remaining: {
189
+ pid: number;
190
+ state: string;
191
+ start_identity: string;
192
+ }[];
193
+ note: string;
194
+ }>;
195
+ /**
196
+ * Read-only snapshot of the owned root and its actual descendant groups (they may live in
197
+ * their own process groups, as a real native user-shell does). Frozen opaque token backed
198
+ * by private state; only `stopTree` accepts it, and the snapshot is privately bound to the
199
+ * exact owned group handle that captured it.
200
+ */
201
+ snapshotTree: () => Readonly<{
202
+ scope: "owned-descendant-tree-snapshot";
203
+ captured_at: string;
204
+ original_pgid: number;
205
+ root: {
206
+ pid: number;
207
+ pgid: number;
208
+ start_identity: string;
209
+ };
210
+ descendants: {
211
+ pid: number;
212
+ ppid: number;
213
+ pgid: number;
214
+ start_identity: string;
215
+ }[];
216
+ groups: {
217
+ pgid: number;
218
+ member_count: number;
219
+ }[];
220
+ }>;
221
+ /**
222
+ * Stops only the groups captured in this exact snapshot and only when this transport's own
223
+ * owned group captured it. Members are re-verified against their captured PID + start
224
+ * identity and captured PGID before TERM, again before any KILL escalation, and once more
225
+ * before a positive `stopped: true` proof.
226
+ */
227
+ stopTree: (snapshot: unknown, stopOptions?: StopOptions) => Promise<{
228
+ scope: string;
229
+ original_pgid: number;
230
+ root_pid: number;
231
+ groups: number[];
232
+ targeted_groups: number[];
233
+ stopped: boolean;
234
+ already_stopped: boolean;
235
+ term_sent: boolean;
236
+ kill_sent: boolean;
237
+ group_observed: boolean;
238
+ escalation_refused: string;
239
+ remaining: never[];
240
+ } | {
241
+ scope: string;
242
+ original_pgid: number;
243
+ root_pid: number;
244
+ groups: number[];
245
+ targeted_groups: number[];
246
+ stopped: boolean;
247
+ already_stopped: boolean;
248
+ term_sent: boolean;
249
+ kill_sent: boolean;
250
+ group_observed: boolean;
251
+ escalation_refused: string;
252
+ escalation_detail: string;
253
+ remaining: {
254
+ pid: number;
255
+ pgid: number;
256
+ state: string;
257
+ start_identity: string;
258
+ }[];
259
+ } | {
260
+ scope: string;
261
+ original_pgid: number;
262
+ root_pid: number;
263
+ groups: number[];
264
+ targeted_groups: number[];
265
+ stopped: boolean;
266
+ already_stopped: boolean;
267
+ term_sent: boolean;
268
+ kill_sent: boolean;
269
+ group_observed: boolean;
270
+ final_proof_refused: string;
271
+ final_proof_detail: string;
272
+ remaining: {
273
+ pid: number;
274
+ pgid: number;
275
+ state: string;
276
+ start_identity: string;
277
+ }[];
278
+ } | {
279
+ scope: string;
280
+ original_pgid: number;
281
+ root_pid: number;
282
+ groups: number[];
283
+ targeted_groups: number[];
284
+ stopped: boolean;
285
+ already_stopped: boolean;
286
+ term_sent: boolean;
287
+ kill_sent: boolean;
288
+ remaining: {
289
+ pid: number;
290
+ pgid: number;
291
+ state: string;
292
+ start_identity: string;
293
+ }[];
294
+ group_observed: boolean;
295
+ }>;
296
+ }>;
297
+ close: () => Promise<{
298
+ exit_code: number | null;
299
+ signal: NodeJS.Signals | null;
300
+ parent_exited: boolean;
301
+ stream_closed: boolean;
302
+ streams_detached: boolean;
303
+ killed_after_eof_timeout: boolean;
304
+ signaled_kill: boolean;
305
+ request_ids: string[];
306
+ server_requests_refused: number;
307
+ }>;
308
+ }>>;
309
+ /** In-flight status of one exact recorded attempt on its owned original transport and turn. */
310
+ export declare function queryCodexAttempt(options: AttemptOptions): Promise<CodexObservation>;
311
+ /**
312
+ * Requests cancellation of one exact recorded attempt. Requires a fresh active observation on
313
+ * the owned original transport, records the CANCEL intent, invokes `turn/interrupt` with the
314
+ * exact ids, and accepts only terminal `turn/completed` with `interrupted` as evidence - even
315
+ * if it precedes the interrupt response. Claims stay held and no CANCELLED is sent; any failure
316
+ * after the recorded intent still returns `reconciliation_required: true`.
317
+ */
318
+ export declare function cancelCodexAttempt(options: AttemptOptions): Promise<CodexObservation>;
319
+ /**
320
+ * Recovery of a completed turn whose notification was lost. Only the exact requested terminal
321
+ * turn is accepted, and it must carry a usable original native result: a model agent message or
322
+ * an explicit successful native shell command output. Nothing is synthesized.
323
+ */
324
+ export declare function recoverCodexCompleted(options: AttemptOptions): Promise<CodexObservation>;
325
+ /**
326
+ * Persisted-history read on a FRESH server. `notLoaded` describes only this server's load state,
327
+ * never the original execution. The canonical thread cwd is always validated against the
328
+ * requested cwd, and with `requireCompleted` only an exact completed turn with a usable native
329
+ * result is accepted.
330
+ */
331
+ export declare function queryPersistedHistory(options: HistoryOptions): Promise<CodexObservation>;
332
+ /**
333
+ * Cancellation plus controlled-runtime stop for one exact recorded attempt.
334
+ *
335
+ * The native handshake (CANCEL intent + `turn/interrupt` + observed terminal event) is reported
336
+ * separately from the group/process stop proof. The owned process group is stopped ONLY when the
337
+ * cancellation intent was actually recorded, and only for a controlled transport that created
338
+ * the original runtime. Claims are retained, no CANCELLED is sent, and the result always carries
339
+ * `reconciliation_required: true` once the intent exists. A non-terminal native handshake may
340
+ * still require the controlled shutdown; it is never reported as a native interruption.
341
+ * Task-specific evidence (known child pids/heartbeats) remains the caller's responsibility:
342
+ * an empty owned group is not proof that every OS side effect stopped.
343
+ */
344
+ export declare function cancelAndStopCodexAttempt(options: AttemptOptions): Promise<CodexObservation>;
345
+ export {};