@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,350 @@
1
+ import type { TaskRecord, Identity, Message, Handoff } from './types.js';
2
+ export declare const HANDOFF_KINDS: readonly string[];
3
+ export declare const HANDOFF_STATES: readonly string[];
4
+ export declare function findHandoff(record: TaskRecord, handoffId: string): Handoff | null;
5
+ export declare function beginHandoff(record: TaskRecord, { handoffId, kind, subtaskId, attempt, from, to, resources, ownerEpoch, clock, reason, }: {
6
+ handoffId: string;
7
+ kind: string;
8
+ subtaskId?: string | null;
9
+ attempt?: number | null;
10
+ from: Identity;
11
+ to: Identity;
12
+ resources?: string[];
13
+ ownerEpoch: number;
14
+ clock?: number;
15
+ reason?: string | null;
16
+ }): {
17
+ ok: false;
18
+ reason: string;
19
+ shared_resources?: never;
20
+ other_handoff?: never;
21
+ other_state?: never;
22
+ expected?: never;
23
+ actual?: never;
24
+ handoff_id?: never;
25
+ state?: never;
26
+ } | {
27
+ ok: false;
28
+ reason: string;
29
+ other_handoff: string;
30
+ other_state: string;
31
+ shared_resources: string[];
32
+ expected?: never;
33
+ actual?: never;
34
+ handoff_id?: never;
35
+ state?: never;
36
+ } | {
37
+ shared_resources?: never;
38
+ ok: false;
39
+ reason: string;
40
+ other_handoff: string;
41
+ other_state: string;
42
+ expected?: never;
43
+ actual?: never;
44
+ handoff_id?: never;
45
+ state?: never;
46
+ } | {
47
+ shared_resources?: never;
48
+ other_handoff?: never;
49
+ other_state?: never;
50
+ ok: false;
51
+ reason: string;
52
+ expected: number | null;
53
+ actual: number;
54
+ handoff_id?: never;
55
+ state?: never;
56
+ } | {
57
+ shared_resources?: never;
58
+ other_handoff?: never;
59
+ other_state?: never;
60
+ reason?: never;
61
+ expected?: never;
62
+ actual?: never;
63
+ ok: true;
64
+ handoff_id: string;
65
+ state: string;
66
+ };
67
+ /**
68
+ * Record that the previous writer stopped. An `unknown` observation is refused: without
69
+ * confirmed stopping, overlapping resources stay where they are.
70
+ */
71
+ export declare function markOldWriterStopped(record: TaskRecord, { handoffId, observation, evidenceRef, detail, actor, clock, }: {
72
+ handoffId: string;
73
+ observation: string;
74
+ evidenceRef?: string | null;
75
+ detail?: string | null;
76
+ actor?: string;
77
+ clock?: number;
78
+ }): {
79
+ state?: never;
80
+ ok: false;
81
+ reason: string;
82
+ from: string;
83
+ to: string;
84
+ expected: string | null | undefined;
85
+ at?: never;
86
+ } | {
87
+ reason?: never;
88
+ expected?: never;
89
+ from?: never;
90
+ to?: never;
91
+ ok: true;
92
+ state: string;
93
+ at: string;
94
+ } | {
95
+ ok: false;
96
+ reason: string;
97
+ };
98
+ /**
99
+ * Bind the receiver's real identity once its native session is observed. A handoff may be
100
+ * requested before the receiver session exists; the identity is then a placeholder and the
101
+ * confirmation would not correlate. Rebinding requires native evidence and is recorded.
102
+ */
103
+ export declare function rebindReceiver(record: TaskRecord, { handoffId, to, evidenceRef, actor, clock, }: {
104
+ handoffId: string;
105
+ to: Identity;
106
+ evidenceRef: string;
107
+ actor?: string;
108
+ clock?: number;
109
+ }): {
110
+ state?: never;
111
+ to?: never;
112
+ ok: false;
113
+ reason: string;
114
+ detail?: never;
115
+ confirmed_receiver?: never;
116
+ previous?: never;
117
+ } | {
118
+ to?: never;
119
+ ok: false;
120
+ reason: string;
121
+ state: string;
122
+ detail?: never;
123
+ confirmed_receiver?: never;
124
+ previous?: never;
125
+ } | {
126
+ state?: never;
127
+ to?: never;
128
+ ok: false;
129
+ reason: string;
130
+ detail: string;
131
+ confirmed_receiver: Identity;
132
+ previous?: never;
133
+ } | {
134
+ reason?: never;
135
+ state?: never;
136
+ detail?: never;
137
+ confirmed_receiver?: never;
138
+ ok: true;
139
+ to: Identity;
140
+ previous: Identity;
141
+ };
142
+ export declare function markTransferring(record: TaskRecord, { handoffId, partialOutputs, inflight, pendingApprovals, actor, clock, }: {
143
+ handoffId: string;
144
+ partialOutputs?: unknown[];
145
+ inflight?: unknown[];
146
+ pendingApprovals?: unknown[];
147
+ actor?: string;
148
+ clock?: number;
149
+ }): {
150
+ state?: never;
151
+ ok: false;
152
+ reason: string;
153
+ from: string;
154
+ to: string;
155
+ expected: string | null | undefined;
156
+ at?: never;
157
+ } | {
158
+ reason?: never;
159
+ expected?: never;
160
+ from?: never;
161
+ to?: never;
162
+ ok: true;
163
+ state: string;
164
+ at: string;
165
+ } | {
166
+ ok: false;
167
+ reason: string;
168
+ };
169
+ /** The receiver's acknowledgement must be a stored message that replies to this handoff. */
170
+ export declare function confirmReceiver(record: TaskRecord, { handoffId, message, clock, }: {
171
+ handoffId: string;
172
+ message: Message | null;
173
+ clock?: number;
174
+ }): {
175
+ state?: never;
176
+ ok: false;
177
+ reason: string;
178
+ from: string;
179
+ to: string;
180
+ expected: string | null | undefined;
181
+ at?: never;
182
+ } | {
183
+ reason?: never;
184
+ expected?: never;
185
+ from?: never;
186
+ to?: never;
187
+ ok: true;
188
+ state: string;
189
+ at: string;
190
+ } | {
191
+ ok: false;
192
+ reason: string;
193
+ type?: never;
194
+ } | {
195
+ ok: false;
196
+ reason: string;
197
+ type: string;
198
+ };
199
+ /**
200
+ * Complete the handoff: move ownership and raise the epoch. Old-epoch commands are
201
+ * rejected by the epoch check, so the previous owner cannot keep dispatching.
202
+ */
203
+ export declare function completeHandoff(record: TaskRecord, { handoffId, actor, clock, }: {
204
+ handoffId: string;
205
+ actor?: string;
206
+ clock?: number;
207
+ }): {
208
+ state?: never;
209
+ ok: false;
210
+ reason: string;
211
+ from: string;
212
+ to: string;
213
+ expected: string | null | undefined;
214
+ at?: never;
215
+ } | {
216
+ reason?: never;
217
+ expected?: never;
218
+ from?: never;
219
+ to?: never;
220
+ ok: true;
221
+ state: string;
222
+ at: string;
223
+ } | {
224
+ expected?: never;
225
+ actual?: never;
226
+ ok: false;
227
+ reason: string;
228
+ drift?: never;
229
+ } | {
230
+ expected?: never;
231
+ actual?: never;
232
+ ok: false;
233
+ reason: string;
234
+ drift: ({
235
+ expected?: never;
236
+ actual?: never;
237
+ from?: never;
238
+ claim_id: string;
239
+ reason: string;
240
+ } | {
241
+ from?: never;
242
+ claim_id: string;
243
+ reason: string;
244
+ expected: number | null | undefined;
245
+ actual: number;
246
+ } | {
247
+ from?: never;
248
+ claim_id: string;
249
+ reason: string;
250
+ expected: Identity | null | undefined;
251
+ actual: Identity;
252
+ } | {
253
+ expected?: never;
254
+ claim_id: string;
255
+ reason: string;
256
+ from: Identity;
257
+ actual: Identity;
258
+ })[];
259
+ } | {
260
+ drift?: never;
261
+ ok: false;
262
+ reason: string;
263
+ expected: number;
264
+ actual: number | null;
265
+ };
266
+ export declare function abortHandoff(record: TaskRecord, { handoffId, actor, reason, clock, }: {
267
+ handoffId: string;
268
+ actor?: string;
269
+ reason?: string;
270
+ clock?: number;
271
+ }): {
272
+ state?: never;
273
+ ok: false;
274
+ reason: string;
275
+ } | {
276
+ reason?: never;
277
+ ok: true;
278
+ state: string;
279
+ };
280
+ export declare function releaseDispatchFreeze(record: TaskRecord, { actor, ownerEpoch, clock, }: {
281
+ actor?: string;
282
+ ownerEpoch: number;
283
+ clock?: number;
284
+ }): {
285
+ ok: false;
286
+ reason: string;
287
+ expected: number | null;
288
+ actual: number;
289
+ dispatch_frozen?: never;
290
+ } | {
291
+ reason?: never;
292
+ expected?: never;
293
+ actual?: never;
294
+ ok: true;
295
+ dispatch_frozen: boolean;
296
+ };
297
+ /** Snapshot of what a handing-over owner must account for. */
298
+ export declare function handoffInventory(record: TaskRecord, { subtaskId, attempt, }: {
299
+ subtaskId?: string | null;
300
+ attempt?: number | null;
301
+ }): {
302
+ inflight: {
303
+ subtask_id: string;
304
+ attempt: number;
305
+ state: string;
306
+ native: import("./types.js").NativeBinding;
307
+ }[];
308
+ closed: {
309
+ subtask_id: string;
310
+ attempt: number;
311
+ state: string;
312
+ }[];
313
+ pending_approvals: {
314
+ subtask_id: string;
315
+ attempt: number;
316
+ }[];
317
+ uncertainty: {
318
+ uncertainty_id: string;
319
+ kind: string;
320
+ subtask_id: string | null;
321
+ attempt: number | null;
322
+ }[];
323
+ resources: {
324
+ claim_id: string;
325
+ key: string;
326
+ holder: Identity;
327
+ resource_epoch: number;
328
+ }[];
329
+ results: {
330
+ subtask_id: string;
331
+ attempt: number;
332
+ status: string;
333
+ classification: string;
334
+ message_id: string;
335
+ outputs: unknown[];
336
+ }[];
337
+ handoffs: {
338
+ handoff_id: string;
339
+ kind: string;
340
+ state: string;
341
+ }[];
342
+ coordinator: import("./types.js").Coordinator | null;
343
+ epoch_semantics: {
344
+ owner_epoch: string;
345
+ state_revision: number;
346
+ resource_epoch: string;
347
+ note: string;
348
+ };
349
+ };
350
+ export declare function newHandoffId(prefix?: string): string;