@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,6 @@
1
+ export interface PackageInfo {
2
+ readonly name: string;
3
+ readonly version: string;
4
+ readonly description: string;
5
+ }
6
+ export declare function getPackageInfo(): PackageInfo;
@@ -0,0 +1,19 @@
1
+ import { readFileSync } from 'node:fs';
2
+ export function getPackageInfo() {
3
+ const value = JSON.parse(readFileSync(new URL(import.meta.resolve('@phyzess/pappra/package.json')), 'utf8'));
4
+ if (typeof value !== 'object' ||
5
+ value === null ||
6
+ !('name' in value) ||
7
+ typeof value.name !== 'string' ||
8
+ !('version' in value) ||
9
+ typeof value.version !== 'string' ||
10
+ !('description' in value) ||
11
+ typeof value.description !== 'string') {
12
+ throw new Error('The installed Pappra package metadata is invalid.');
13
+ }
14
+ return {
15
+ name: value.name,
16
+ version: value.version,
17
+ description: value.description,
18
+ };
19
+ }
@@ -0,0 +1,377 @@
1
+ import { z } from 'zod';
2
+ export declare const codeWorkingTreeSchema: z.ZodObject<{
3
+ digest: z.ZodString;
4
+ completeness: z.ZodEnum<{
5
+ complete: "complete";
6
+ partial: "partial";
7
+ unknown: "unknown";
8
+ }>;
9
+ fileCount: z.ZodNumber;
10
+ byteCount: z.ZodNumber;
11
+ reasons: z.ZodArray<z.ZodString>;
12
+ }, z.core.$strict>;
13
+ export declare const codeEngineSchema: z.ZodObject<{
14
+ id: z.ZodLiteral<"codegraph">;
15
+ version: z.ZodString;
16
+ configDigest: z.ZodString;
17
+ configStatus: z.ZodOptional<z.ZodEnum<{
18
+ default: "default";
19
+ observed: "observed";
20
+ unknown: "unknown";
21
+ }>>;
22
+ }, z.core.$strict>;
23
+ export declare const codeIdentitySchema: z.ZodObject<{
24
+ schema: z.ZodLiteral<"pappra/code-identity/1">;
25
+ repositoryId: z.ZodString;
26
+ checkoutId: z.ZodString;
27
+ root: z.ZodString;
28
+ gitDir: z.ZodNullable<z.ZodString>;
29
+ gitCommonDir: z.ZodNullable<z.ZodString>;
30
+ head: z.ZodNullable<z.ZodString>;
31
+ branch: z.ZodNullable<z.ZodString>;
32
+ workingTree: z.ZodObject<{
33
+ digest: z.ZodString;
34
+ completeness: z.ZodEnum<{
35
+ complete: "complete";
36
+ partial: "partial";
37
+ unknown: "unknown";
38
+ }>;
39
+ fileCount: z.ZodNumber;
40
+ byteCount: z.ZodNumber;
41
+ reasons: z.ZodArray<z.ZodString>;
42
+ }, z.core.$strict>;
43
+ engine: z.ZodObject<{
44
+ id: z.ZodLiteral<"codegraph">;
45
+ version: z.ZodString;
46
+ configDigest: z.ZodString;
47
+ configStatus: z.ZodOptional<z.ZodEnum<{
48
+ default: "default";
49
+ observed: "observed";
50
+ unknown: "unknown";
51
+ }>>;
52
+ }, z.core.$strict>;
53
+ }, z.core.$strict>;
54
+ export declare const codeIndexCoverageSchema: z.ZodObject<{
55
+ scope: z.ZodLiteral<"selected-repository">;
56
+ languages: z.ZodArray<z.ZodString>;
57
+ semantic: z.ZodBoolean;
58
+ callGraph: z.ZodBoolean;
59
+ note: z.ZodString;
60
+ }, z.core.$strict>;
61
+ export declare const codeIndexHealthSchema: z.ZodObject<{
62
+ schema: z.ZodLiteral<"pappra/code-index-health/1">;
63
+ state: z.ZodEnum<{
64
+ building: "building";
65
+ failed: "failed";
66
+ missing: "missing";
67
+ partial: "partial";
68
+ ready: "ready";
69
+ stale: "stale";
70
+ unsupported: "unsupported";
71
+ }>;
72
+ reasons: z.ZodArray<z.ZodString>;
73
+ evidence: z.ZodArray<z.ZodObject<{
74
+ kind: z.ZodEnum<{
75
+ file: "file";
76
+ git: "git";
77
+ "native-event": "native-event";
78
+ "runtime-probe": "runtime-probe";
79
+ }>;
80
+ ref: z.ZodString;
81
+ digest: z.ZodNullable<z.ZodString>;
82
+ observedAt: z.ZodISODateTime;
83
+ scope: z.ZodEnum<{
84
+ declared: "declared";
85
+ "live-owned": "live-owned";
86
+ persisted: "persisted";
87
+ }>;
88
+ }, z.core.$strict>>;
89
+ coverage: z.ZodObject<{
90
+ scope: z.ZodLiteral<"selected-repository">;
91
+ languages: z.ZodArray<z.ZodString>;
92
+ semantic: z.ZodBoolean;
93
+ callGraph: z.ZodBoolean;
94
+ note: z.ZodString;
95
+ }, z.core.$strict>;
96
+ engineVersion: z.ZodString;
97
+ observedAt: z.ZodISODateTime;
98
+ }, z.core.$strict>;
99
+ export declare const codeQueryKindSchema: z.ZodEnum<{
100
+ explore: "explore";
101
+ impact: "impact";
102
+ references: "references";
103
+ symbol: "symbol";
104
+ text: "text";
105
+ }>;
106
+ export declare const codeQueryLimitsSchema: z.ZodObject<{
107
+ maxResults: z.ZodNumber;
108
+ maxBytes: z.ZodNumber;
109
+ maxFiles: z.ZodNumber;
110
+ }, z.core.$strict>;
111
+ export declare const codeQueryRequestSchema: z.ZodObject<{
112
+ schema: z.ZodLiteral<"pappra/code-query/1">;
113
+ kind: z.ZodEnum<{
114
+ explore: "explore";
115
+ impact: "impact";
116
+ references: "references";
117
+ symbol: "symbol";
118
+ text: "text";
119
+ }>;
120
+ query: z.ZodString;
121
+ identity: z.ZodObject<{
122
+ schema: z.ZodLiteral<"pappra/code-identity/1">;
123
+ repositoryId: z.ZodString;
124
+ checkoutId: z.ZodString;
125
+ root: z.ZodString;
126
+ gitDir: z.ZodNullable<z.ZodString>;
127
+ gitCommonDir: z.ZodNullable<z.ZodString>;
128
+ head: z.ZodNullable<z.ZodString>;
129
+ branch: z.ZodNullable<z.ZodString>;
130
+ workingTree: z.ZodObject<{
131
+ digest: z.ZodString;
132
+ completeness: z.ZodEnum<{
133
+ complete: "complete";
134
+ partial: "partial";
135
+ unknown: "unknown";
136
+ }>;
137
+ fileCount: z.ZodNumber;
138
+ byteCount: z.ZodNumber;
139
+ reasons: z.ZodArray<z.ZodString>;
140
+ }, z.core.$strict>;
141
+ engine: z.ZodObject<{
142
+ id: z.ZodLiteral<"codegraph">;
143
+ version: z.ZodString;
144
+ configDigest: z.ZodString;
145
+ configStatus: z.ZodOptional<z.ZodEnum<{
146
+ default: "default";
147
+ observed: "observed";
148
+ unknown: "unknown";
149
+ }>>;
150
+ }, z.core.$strict>;
151
+ }, z.core.$strict>;
152
+ limits: z.ZodObject<{
153
+ maxResults: z.ZodNumber;
154
+ maxBytes: z.ZodNumber;
155
+ maxFiles: z.ZodNumber;
156
+ }, z.core.$strict>;
157
+ excludedRoots: z.ZodOptional<z.ZodArray<z.ZodString>>;
158
+ }, z.core.$strict>;
159
+ export declare const codeQueryItemSchema: z.ZodObject<{
160
+ path: z.ZodString;
161
+ line: z.ZodNullable<z.ZodNumber>;
162
+ column: z.ZodNullable<z.ZodNumber>;
163
+ kind: z.ZodString;
164
+ name: z.ZodNullable<z.ZodString>;
165
+ snippet: z.ZodString;
166
+ source: z.ZodEnum<{
167
+ codegraph: "codegraph";
168
+ structure: "structure";
169
+ text: "text";
170
+ }>;
171
+ }, z.core.$strict>;
172
+ export declare const codeQueryResultSchema: z.ZodObject<{
173
+ schema: z.ZodLiteral<"pappra/code-query-result/1">;
174
+ provider: z.ZodEnum<{
175
+ codegraph: "codegraph";
176
+ structure: "structure";
177
+ text: "text";
178
+ }>;
179
+ kind: z.ZodEnum<{
180
+ explore: "explore";
181
+ impact: "impact";
182
+ references: "references";
183
+ symbol: "symbol";
184
+ text: "text";
185
+ }>;
186
+ query: z.ZodString;
187
+ identityDigest: z.ZodString;
188
+ observedIdentity: z.ZodObject<{
189
+ schema: z.ZodLiteral<"pappra/code-identity/1">;
190
+ repositoryId: z.ZodString;
191
+ checkoutId: z.ZodString;
192
+ root: z.ZodString;
193
+ gitDir: z.ZodNullable<z.ZodString>;
194
+ gitCommonDir: z.ZodNullable<z.ZodString>;
195
+ head: z.ZodNullable<z.ZodString>;
196
+ branch: z.ZodNullable<z.ZodString>;
197
+ workingTree: z.ZodObject<{
198
+ digest: z.ZodString;
199
+ completeness: z.ZodEnum<{
200
+ complete: "complete";
201
+ partial: "partial";
202
+ unknown: "unknown";
203
+ }>;
204
+ fileCount: z.ZodNumber;
205
+ byteCount: z.ZodNumber;
206
+ reasons: z.ZodArray<z.ZodString>;
207
+ }, z.core.$strict>;
208
+ engine: z.ZodObject<{
209
+ id: z.ZodLiteral<"codegraph">;
210
+ version: z.ZodString;
211
+ configDigest: z.ZodString;
212
+ configStatus: z.ZodOptional<z.ZodEnum<{
213
+ default: "default";
214
+ observed: "observed";
215
+ unknown: "unknown";
216
+ }>>;
217
+ }, z.core.$strict>;
218
+ }, z.core.$strict>;
219
+ coverage: z.ZodEnum<{
220
+ complete: "complete";
221
+ fallback: "fallback";
222
+ partial: "partial";
223
+ unsupported: "unsupported";
224
+ }>;
225
+ items: z.ZodArray<z.ZodObject<{
226
+ path: z.ZodString;
227
+ line: z.ZodNullable<z.ZodNumber>;
228
+ column: z.ZodNullable<z.ZodNumber>;
229
+ kind: z.ZodString;
230
+ name: z.ZodNullable<z.ZodString>;
231
+ snippet: z.ZodString;
232
+ source: z.ZodEnum<{
233
+ codegraph: "codegraph";
234
+ structure: "structure";
235
+ text: "text";
236
+ }>;
237
+ }, z.core.$strict>>;
238
+ bytes: z.ZodNumber;
239
+ truncated: z.ZodBoolean;
240
+ reasons: z.ZodArray<z.ZodString>;
241
+ evidence: z.ZodArray<z.ZodObject<{
242
+ kind: z.ZodEnum<{
243
+ file: "file";
244
+ git: "git";
245
+ "native-event": "native-event";
246
+ "runtime-probe": "runtime-probe";
247
+ }>;
248
+ ref: z.ZodString;
249
+ digest: z.ZodNullable<z.ZodString>;
250
+ observedAt: z.ZodISODateTime;
251
+ scope: z.ZodEnum<{
252
+ declared: "declared";
253
+ "live-owned": "live-owned";
254
+ persisted: "persisted";
255
+ }>;
256
+ }, z.core.$strict>>;
257
+ unsupportedReason: z.ZodNullable<z.ZodString>;
258
+ }, z.core.$strict>;
259
+ export declare const codePrepareActionSchema: z.ZodEnum<{
260
+ init: "init";
261
+ none: "none";
262
+ rebuild: "rebuild";
263
+ sync: "sync";
264
+ }>;
265
+ export declare const codePreparePlanSchema: z.ZodObject<{
266
+ schema: z.ZodLiteral<"pappra/code-prepare-plan/1">;
267
+ repositoryId: z.ZodString;
268
+ identityDigest: z.ZodString;
269
+ action: z.ZodEnum<{
270
+ init: "init";
271
+ none: "none";
272
+ rebuild: "rebuild";
273
+ sync: "sync";
274
+ }>;
275
+ indexPath: z.ZodString;
276
+ command: z.ZodArray<z.ZodString>;
277
+ mutates: z.ZodBoolean;
278
+ reasons: z.ZodArray<z.ZodString>;
279
+ }, z.core.$strict>;
280
+ export declare const codePrepareResultSchema: z.ZodObject<{
281
+ schema: z.ZodLiteral<"pappra/code-prepare-result/1">;
282
+ ok: z.ZodBoolean;
283
+ status: z.ZodEnum<{
284
+ conflict: "conflict";
285
+ failed: "failed";
286
+ partial: "partial";
287
+ planned: "planned";
288
+ ready: "ready";
289
+ unsupported: "unsupported";
290
+ }>;
291
+ plan: z.ZodObject<{
292
+ schema: z.ZodLiteral<"pappra/code-prepare-plan/1">;
293
+ repositoryId: z.ZodString;
294
+ identityDigest: z.ZodString;
295
+ action: z.ZodEnum<{
296
+ init: "init";
297
+ none: "none";
298
+ rebuild: "rebuild";
299
+ sync: "sync";
300
+ }>;
301
+ indexPath: z.ZodString;
302
+ command: z.ZodArray<z.ZodString>;
303
+ mutates: z.ZodBoolean;
304
+ reasons: z.ZodArray<z.ZodString>;
305
+ }, z.core.$strict>;
306
+ health: z.ZodObject<{
307
+ schema: z.ZodLiteral<"pappra/code-index-health/1">;
308
+ state: z.ZodEnum<{
309
+ building: "building";
310
+ failed: "failed";
311
+ missing: "missing";
312
+ partial: "partial";
313
+ ready: "ready";
314
+ stale: "stale";
315
+ unsupported: "unsupported";
316
+ }>;
317
+ reasons: z.ZodArray<z.ZodString>;
318
+ evidence: z.ZodArray<z.ZodObject<{
319
+ kind: z.ZodEnum<{
320
+ file: "file";
321
+ git: "git";
322
+ "native-event": "native-event";
323
+ "runtime-probe": "runtime-probe";
324
+ }>;
325
+ ref: z.ZodString;
326
+ digest: z.ZodNullable<z.ZodString>;
327
+ observedAt: z.ZodISODateTime;
328
+ scope: z.ZodEnum<{
329
+ declared: "declared";
330
+ "live-owned": "live-owned";
331
+ persisted: "persisted";
332
+ }>;
333
+ }, z.core.$strict>>;
334
+ coverage: z.ZodObject<{
335
+ scope: z.ZodLiteral<"selected-repository">;
336
+ languages: z.ZodArray<z.ZodString>;
337
+ semantic: z.ZodBoolean;
338
+ callGraph: z.ZodBoolean;
339
+ note: z.ZodString;
340
+ }, z.core.$strict>;
341
+ engineVersion: z.ZodString;
342
+ observedAt: z.ZodISODateTime;
343
+ }, z.core.$strict>;
344
+ registrationPath: z.ZodNullable<z.ZodString>;
345
+ diagnostics: z.ZodArray<z.ZodUnknown>;
346
+ }, z.core.$strict>;
347
+ export declare const codeIndexRegistrationSchema: z.ZodObject<{
348
+ schema: z.ZodLiteral<"pappra/code-index-registration/1">;
349
+ repositoryId: z.ZodString;
350
+ identityDigest: z.ZodString;
351
+ checkoutId: z.ZodString;
352
+ root: z.ZodString;
353
+ engineVersion: z.ZodString;
354
+ configDigest: z.ZodString;
355
+ preparedAt: z.ZodISODateTime;
356
+ coverage: z.ZodObject<{
357
+ scope: z.ZodLiteral<"selected-repository">;
358
+ languages: z.ZodArray<z.ZodString>;
359
+ semantic: z.ZodBoolean;
360
+ callGraph: z.ZodBoolean;
361
+ note: z.ZodString;
362
+ }, z.core.$strict>;
363
+ }, z.core.$strict>;
364
+ export type CodeWorkingTree = z.infer<typeof codeWorkingTreeSchema>;
365
+ export type CodeEngine = z.infer<typeof codeEngineSchema>;
366
+ export type CodeIdentity = z.infer<typeof codeIdentitySchema>;
367
+ export type CodeIndexCoverage = z.infer<typeof codeIndexCoverageSchema>;
368
+ export type CodeIndexHealth = z.infer<typeof codeIndexHealthSchema>;
369
+ export type CodeQueryKind = z.infer<typeof codeQueryKindSchema>;
370
+ export type CodeQueryLimits = z.infer<typeof codeQueryLimitsSchema>;
371
+ export type CodeQueryRequest = z.infer<typeof codeQueryRequestSchema>;
372
+ export type CodeQueryItem = z.infer<typeof codeQueryItemSchema>;
373
+ export type CodeQueryResult = z.infer<typeof codeQueryResultSchema>;
374
+ export type CodePrepareAction = z.infer<typeof codePrepareActionSchema>;
375
+ export type CodePreparePlan = z.infer<typeof codePreparePlanSchema>;
376
+ export type CodePrepareResult = z.infer<typeof codePrepareResultSchema>;
377
+ export type CodeIndexRegistration = z.infer<typeof codeIndexRegistrationSchema>;
@@ -0,0 +1,145 @@
1
+ import { z } from 'zod';
2
+ import { evidenceRefSchema } from './evidence.js';
3
+ const digestSchema = z.string().regex(/^sha256:[0-9a-f]{64}$/);
4
+ const reasonSchema = z.string().min(1).max(512);
5
+ const relativePathSchema = z.string().min(1).max(2048);
6
+ export const codeWorkingTreeSchema = z.strictObject({
7
+ digest: digestSchema,
8
+ completeness: z.enum(['complete', 'partial', 'unknown']),
9
+ fileCount: z.number().int().nonnegative(),
10
+ byteCount: z.number().int().nonnegative(),
11
+ reasons: z.array(reasonSchema).max(16),
12
+ });
13
+ export const codeEngineSchema = z.strictObject({
14
+ id: z.literal('codegraph'),
15
+ version: z.string().min(1).max(64),
16
+ configDigest: digestSchema,
17
+ configStatus: z.enum(['default', 'observed', 'unknown']).optional(),
18
+ });
19
+ export const codeIdentitySchema = z.strictObject({
20
+ schema: z.literal('pappra/code-identity/1'),
21
+ repositoryId: z.string().min(1).max(64),
22
+ checkoutId: z.string().min(1).max(128),
23
+ root: z.string().min(1).max(4096),
24
+ gitDir: z.string().min(1).max(4096).nullable(),
25
+ gitCommonDir: z.string().min(1).max(4096).nullable(),
26
+ head: z.string().max(256).nullable(),
27
+ branch: z.string().max(512).nullable(),
28
+ workingTree: codeWorkingTreeSchema,
29
+ engine: codeEngineSchema,
30
+ });
31
+ export const codeIndexCoverageSchema = z.strictObject({
32
+ scope: z.literal('selected-repository'),
33
+ languages: z.array(z.string().min(1).max(64)).max(64),
34
+ semantic: z.boolean(),
35
+ callGraph: z.boolean(),
36
+ note: z.string().min(1).max(1024),
37
+ });
38
+ export const codeIndexHealthSchema = z.strictObject({
39
+ schema: z.literal('pappra/code-index-health/1'),
40
+ state: z.enum([
41
+ 'missing',
42
+ 'building',
43
+ 'ready',
44
+ 'stale',
45
+ 'partial',
46
+ 'failed',
47
+ 'unsupported',
48
+ ]),
49
+ reasons: z.array(reasonSchema).max(32),
50
+ evidence: z.array(evidenceRefSchema).max(32),
51
+ coverage: codeIndexCoverageSchema,
52
+ engineVersion: z.string().min(1).max(64),
53
+ observedAt: z.iso.datetime({ offset: true }),
54
+ });
55
+ export const codeQueryKindSchema = z.enum([
56
+ 'explore',
57
+ 'symbol',
58
+ 'references',
59
+ 'impact',
60
+ 'text',
61
+ ]);
62
+ export const codeQueryLimitsSchema = z.strictObject({
63
+ maxResults: z.number().int().min(1).max(100),
64
+ maxBytes: z
65
+ .number()
66
+ .int()
67
+ .min(1)
68
+ .max(16 * 1024 * 1024),
69
+ maxFiles: z.number().int().min(1).max(5000),
70
+ });
71
+ export const codeQueryRequestSchema = z.strictObject({
72
+ schema: z.literal('pappra/code-query/1'),
73
+ kind: codeQueryKindSchema,
74
+ query: z.string().min(1).max(1024),
75
+ identity: codeIdentitySchema,
76
+ limits: codeQueryLimitsSchema,
77
+ excludedRoots: z.array(z.string().min(1).max(4096)).max(64).optional(),
78
+ });
79
+ export const codeQueryItemSchema = z.strictObject({
80
+ path: relativePathSchema,
81
+ line: z.number().int().positive().nullable(),
82
+ column: z.number().int().nonnegative().nullable(),
83
+ kind: z.string().min(1).max(64),
84
+ name: z.string().max(512).nullable(),
85
+ snippet: z.string().max(4096),
86
+ source: z.enum(['codegraph', 'text', 'structure']),
87
+ });
88
+ export const codeQueryResultSchema = z.strictObject({
89
+ schema: z.literal('pappra/code-query-result/1'),
90
+ provider: z.enum(['codegraph', 'text', 'structure']),
91
+ kind: codeQueryKindSchema,
92
+ query: z.string().min(1).max(1024),
93
+ identityDigest: digestSchema,
94
+ observedIdentity: codeIdentitySchema,
95
+ coverage: z.enum(['complete', 'partial', 'fallback', 'unsupported']),
96
+ items: z.array(codeQueryItemSchema).max(100),
97
+ bytes: z.number().int().nonnegative(),
98
+ truncated: z.boolean(),
99
+ reasons: z.array(reasonSchema).max(16),
100
+ evidence: z.array(evidenceRefSchema).max(32),
101
+ unsupportedReason: z.string().max(1024).nullable(),
102
+ });
103
+ export const codePrepareActionSchema = z.enum([
104
+ 'none',
105
+ 'init',
106
+ 'sync',
107
+ 'rebuild',
108
+ ]);
109
+ export const codePreparePlanSchema = z.strictObject({
110
+ schema: z.literal('pappra/code-prepare-plan/1'),
111
+ repositoryId: z.string().min(1).max(64),
112
+ identityDigest: digestSchema,
113
+ action: codePrepareActionSchema,
114
+ indexPath: z.string().min(1).max(4096),
115
+ command: z.array(z.string().max(4096)).max(16),
116
+ mutates: z.boolean(),
117
+ reasons: z.array(reasonSchema).max(16),
118
+ });
119
+ export const codePrepareResultSchema = z.strictObject({
120
+ schema: z.literal('pappra/code-prepare-result/1'),
121
+ ok: z.boolean(),
122
+ status: z.enum([
123
+ 'planned',
124
+ 'ready',
125
+ 'partial',
126
+ 'failed',
127
+ 'conflict',
128
+ 'unsupported',
129
+ ]),
130
+ plan: codePreparePlanSchema,
131
+ health: codeIndexHealthSchema,
132
+ registrationPath: z.string().max(4096).nullable(),
133
+ diagnostics: z.array(z.unknown()).max(32),
134
+ });
135
+ export const codeIndexRegistrationSchema = z.strictObject({
136
+ schema: z.literal('pappra/code-index-registration/1'),
137
+ repositoryId: z.string().min(1).max(64),
138
+ identityDigest: digestSchema,
139
+ checkoutId: z.string().min(1).max(128),
140
+ root: z.string().min(1).max(4096),
141
+ engineVersion: z.string().min(1).max(64),
142
+ configDigest: digestSchema,
143
+ preparedAt: z.iso.datetime({ offset: true }),
144
+ coverage: codeIndexCoverageSchema,
145
+ });
@@ -0,0 +1,115 @@
1
+ import { z } from 'zod';
2
+ export declare const collaborationGoalSchema: z.ZodObject<{
3
+ schema: z.ZodLiteral<"pappra/collaboration-goal/1">;
4
+ task_id: z.ZodString;
5
+ subtask_id: z.ZodString;
6
+ attempt: z.ZodNumber;
7
+ phase: z.ZodEnum<{
8
+ discovery: "discovery";
9
+ fix: "fix";
10
+ handoff: "handoff";
11
+ implementation: "implementation";
12
+ review: "review";
13
+ }>;
14
+ objective: z.ZodString;
15
+ acceptance: z.ZodArray<z.ZodString>;
16
+ prompt: z.ZodString;
17
+ coordinator: z.ZodObject<{
18
+ agent_id: z.ZodString;
19
+ session_id: z.ZodString;
20
+ harness: z.ZodString;
21
+ owner_epoch: z.ZodNumber;
22
+ }, z.core.$strict>;
23
+ assignee: z.ZodObject<{
24
+ agent_id: z.ZodString;
25
+ session_id: z.ZodString;
26
+ harness: z.ZodString;
27
+ cwd: z.ZodString;
28
+ surface: z.ZodString;
29
+ configuration_id: z.ZodString;
30
+ }, z.core.$strict>;
31
+ resources: z.ZodArray<z.ZodObject<{
32
+ path: z.ZodString;
33
+ access: z.ZodEnum<{
34
+ read: "read";
35
+ write: "write";
36
+ }>;
37
+ }, z.core.$strict>>;
38
+ required: z.ZodObject<{
39
+ skills: z.ZodArray<z.ZodObject<{
40
+ id: z.ZodString;
41
+ bundle_digest: z.ZodString;
42
+ }, z.core.$strict>>;
43
+ tools: z.ZodArray<z.ZodString>;
44
+ }, z.core.$strict>;
45
+ preferred: z.ZodDefault<z.ZodObject<{
46
+ skills: z.ZodArray<z.ZodObject<{
47
+ id: z.ZodString;
48
+ bundle_digest: z.ZodString;
49
+ }, z.core.$strict>>;
50
+ tools: z.ZodArray<z.ZodString>;
51
+ }, z.core.$strict>>;
52
+ }, z.core.$strict>;
53
+ export type CollaborationGoal = z.infer<typeof collaborationGoalSchema>;
54
+ export declare const collaborationPreparedSchema: z.ZodObject<{
55
+ schema: z.ZodLiteral<"pappra/collaboration-prepared/1">;
56
+ task_id: z.ZodString;
57
+ subtask_id: z.ZodString;
58
+ attempt: z.ZodNumber;
59
+ phase: z.ZodString;
60
+ task_root: z.ZodString;
61
+ domain_root: z.ZodString;
62
+ prepared_dir: z.ZodString;
63
+ assignment_path: z.ZodString;
64
+ prompt_path: z.ZodString;
65
+ goal_path: z.ZodString;
66
+ assignment_digest: z.ZodString;
67
+ prompt_digest: z.ZodString;
68
+ resource_epochs: z.ZodRecord<z.ZodString, z.ZodNumber>;
69
+ claim_ids: z.ZodArray<z.ZodString>;
70
+ state_revision: z.ZodNumber;
71
+ created_at: z.ZodString;
72
+ }, z.core.$strict>;
73
+ export type CollaborationPrepared = z.infer<typeof collaborationPreparedSchema>;
74
+ export declare const collaborationCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
75
+ schema: z.ZodLiteral<"pappra/collaboration-command/1">;
76
+ action: z.ZodLiteral<"query">;
77
+ request_id: z.ZodString;
78
+ }, z.core.$strict>, z.ZodObject<{
79
+ schema: z.ZodLiteral<"pappra/collaboration-command/1">;
80
+ action: z.ZodLiteral<"cancel">;
81
+ request_id: z.ZodString;
82
+ }, z.core.$strict>, z.ZodObject<{
83
+ schema: z.ZodLiteral<"pappra/collaboration-command/1">;
84
+ action: z.ZodLiteral<"finish">;
85
+ request_id: z.ZodString;
86
+ status: z.ZodEnum<{
87
+ cancelled: "cancelled";
88
+ completed: "completed";
89
+ failed: "failed";
90
+ needs_input: "needs_input";
91
+ unknown: "unknown";
92
+ }>;
93
+ outputs: z.ZodDefault<z.ZodArray<z.ZodUnknown>>;
94
+ native_ref: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
95
+ evidence_ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
96
+ }, z.core.$strict>], "action">;
97
+ export type CollaborationCommand = z.infer<typeof collaborationCommandSchema>;
98
+ export declare const collaborationEventSchema: z.ZodObject<{
99
+ schema: z.ZodLiteral<"pappra/collaboration-event/1">;
100
+ sequence: z.ZodNumber;
101
+ request_id: z.ZodNullable<z.ZodString>;
102
+ kind: z.ZodEnum<{
103
+ cancel: "cancel";
104
+ finished: "finished";
105
+ query: "query";
106
+ refused: "refused";
107
+ report: "report";
108
+ started: "started";
109
+ }>;
110
+ at: z.ZodString;
111
+ status: z.ZodString;
112
+ detail: z.ZodNullable<z.ZodString>;
113
+ data: z.ZodNullable<z.ZodUnknown>;
114
+ }, z.core.$strict>;
115
+ export type CollaborationEvent = z.infer<typeof collaborationEventSchema>;