@boxxy/pepys 0.0.1 → 0.1.3

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 (51) hide show
  1. package/README.md +42 -5
  2. package/dist/boxxy-source.d.ts +636 -0
  3. package/dist/boxxy-work-plugin.d.ts +1 -0
  4. package/dist/build-boxxy-plugin.d.ts +181 -0
  5. package/dist/consumers/apply-scope.d.ts +5 -0
  6. package/dist/create-pepys-fact-sink.d.ts +9 -0
  7. package/dist/create-pepys-reader.d.ts +9 -0
  8. package/dist/generated/boxxy-work-boundary.d.ts +566 -0
  9. package/dist/index.d.ts +5 -0
  10. package/dist/queries/build-cost-to-land-query.d.ts +156 -0
  11. package/dist/queries/build-cost-to-land.d.ts +12 -0
  12. package/dist/queries/build-stage-time-query.d.ts +29 -0
  13. package/dist/queries/build-stage-time.d.ts +10 -0
  14. package/dist/queries/constants.d.ts +6 -0
  15. package/dist/queries/find-item-entity-id.d.ts +2 -0
  16. package/dist/queries/types.d.ts +109 -0
  17. package/dist/sink/is-outgoing-fact.d.ts +3 -0
  18. package/dist/sink/pick-sink-answer.d.ts +7 -0
  19. package/dist/sink/to-wire-fact.d.ts +5 -0
  20. package/dist/types.d.ts +6 -0
  21. package/dist/wire-fact-schemas.d.ts +319 -0
  22. package/dist/work/boxxy-work-consumer.d.ts +125 -0
  23. package/dist/work/constants.d.ts +3 -0
  24. package/dist/work/fold-work-facts.d.ts +2 -0
  25. package/dist/work/types.d.ts +147 -0
  26. package/package.json +45 -4
  27. package/src/boxxy-source.ts +25 -0
  28. package/src/boxxy-work-plugin.ts +11 -0
  29. package/src/build-boxxy-plugin.ts +18 -0
  30. package/src/consumers/apply-scope.ts +125 -0
  31. package/src/create-pepys-fact-sink.ts +64 -0
  32. package/src/create-pepys-reader.ts +79 -0
  33. package/src/generated/boxxy-work-boundary.ts +2923 -0
  34. package/src/generated/boxxy-work.sql +71 -0
  35. package/src/index.ts +17 -0
  36. package/src/queries/build-cost-to-land-query.ts +127 -0
  37. package/src/queries/build-cost-to-land.ts +226 -0
  38. package/src/queries/build-stage-time-query.ts +59 -0
  39. package/src/queries/build-stage-time.ts +188 -0
  40. package/src/queries/constants.ts +10 -0
  41. package/src/queries/find-item-entity-id.ts +16 -0
  42. package/src/queries/types.ts +168 -0
  43. package/src/sink/is-outgoing-fact.ts +19 -0
  44. package/src/sink/pick-sink-answer.ts +29 -0
  45. package/src/sink/to-wire-fact.ts +31 -0
  46. package/src/types.ts +14 -0
  47. package/src/wire-fact-schemas.ts +41 -0
  48. package/src/work/boxxy-work-consumer.ts +95 -0
  49. package/src/work/constants.ts +25 -0
  50. package/src/work/fold-work-facts.ts +490 -0
  51. package/src/work/types.ts +177 -0
@@ -0,0 +1,319 @@
1
+ import { z } from 'zod';
2
+ export declare const wireFactSchemas: {
3
+ 'boxxy.item.filed': z.ZodObject<{
4
+ id: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
5
+ kind: z.core.$ZodBranded<z.ZodString, "ItemKindName", "out">;
6
+ repo: z.core.$ZodBranded<z.ZodString, "RepoName", "out">;
7
+ title: z.ZodString;
8
+ outcome: z.ZodString;
9
+ acceptance: z.ZodArray<z.ZodType<import("@boxxy/model").Criterion, unknown, z.core.$ZodTypeInternals<import("@boxxy/model").Criterion, unknown>>>;
10
+ fields: z.ZodObject<{
11
+ designMode: z.ZodExactOptional<z.ZodEnum<{
12
+ agent: "agent";
13
+ attended: "attended";
14
+ }>>;
15
+ }, z.core.$strip>;
16
+ labels: z.ZodArray<z.ZodString>;
17
+ foundInAttempt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "AttemptId", "out">>;
18
+ filedBy: z.ZodUnion<readonly [z.ZodLiteral<"boxxy:owner:local">, z.ZodTemplateLiteral<`boxxy:runner:${string}`>, z.ZodTemplateLiteral<`boxxy:attempt:${string}`>, z.ZodTemplateLiteral<`boxxy:hook:${string}`>]>;
19
+ filedAt: z.core.$ZodBranded<z.ZodNumber, "Instant", "out">;
20
+ closedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodNumber, "Instant", "out">>;
21
+ closeReason: z.ZodNullable<z.ZodString>;
22
+ storeVersion: z.ZodNumber;
23
+ }, z.core.$strip>;
24
+ 'boxxy.item.noted': z.ZodObject<{
25
+ seq: z.ZodNumber;
26
+ text: z.ZodString;
27
+ storeVersion: z.ZodNumber;
28
+ }, z.core.$strip>;
29
+ 'boxxy.item.edited': z.ZodObject<{
30
+ title: z.ZodExactOptional<z.ZodString>;
31
+ outcome: z.ZodExactOptional<z.ZodString>;
32
+ acceptance: z.ZodExactOptional<z.ZodArray<z.ZodType<import("@boxxy/model").Criterion, unknown, z.core.$ZodTypeInternals<import("@boxxy/model").Criterion, unknown>>>>;
33
+ kind: z.ZodExactOptional<z.core.$ZodBranded<z.ZodString, "ItemKindName", "out">>;
34
+ fields: z.ZodExactOptional<z.ZodObject<{
35
+ designMode: z.ZodExactOptional<z.ZodEnum<{
36
+ agent: "agent";
37
+ attended: "attended";
38
+ }>>;
39
+ }, z.core.$strip>>;
40
+ labels: z.ZodExactOptional<z.ZodArray<z.ZodString>>;
41
+ byAttempt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "AttemptId", "out">>;
42
+ storeVersion: z.ZodNumber;
43
+ }, z.core.$strip>;
44
+ 'boxxy.item.closed': z.ZodObject<{
45
+ reason: z.ZodString;
46
+ byAttempt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "AttemptId", "out">>;
47
+ ended: z.ZodArray<z.ZodObject<{
48
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
49
+ how: z.ZodEnum<{
50
+ closing: "closing";
51
+ settled: "settled";
52
+ }>;
53
+ }, z.core.$strip>>;
54
+ storeVersion: z.ZodNumber;
55
+ }, z.core.$strip>;
56
+ 'boxxy.relation.added': z.ZodObject<{
57
+ source: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
58
+ target: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
59
+ type: z.core.$ZodBranded<z.ZodString, "RelationTypeName", "out">;
60
+ storeVersion: z.ZodNumber;
61
+ }, z.core.$strip>;
62
+ 'boxxy.relation.removed': z.ZodObject<{
63
+ source: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
64
+ target: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
65
+ type: z.core.$ZodBranded<z.ZodString, "RelationTypeName", "out">;
66
+ storeVersion: z.ZodNumber;
67
+ }, z.core.$strip>;
68
+ 'boxxy.lever.recorded': z.ZodObject<{
69
+ seq: z.ZodNumber;
70
+ kind: z.ZodTemplateLiteral<`${string}.${string}`>;
71
+ item: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
72
+ until: z.ZodNullable<z.core.$ZodBranded<z.ZodNumber, "Instant", "out">>;
73
+ expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodNumber, "Instant", "out">>;
74
+ reason: z.ZodNullable<z.ZodString>;
75
+ phase: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "PhaseName", "out">>;
76
+ actor: z.ZodUnion<readonly [z.ZodLiteral<"boxxy:owner:local">, z.ZodTemplateLiteral<`boxxy:runner:${string}`>, z.ZodTemplateLiteral<`boxxy:attempt:${string}`>, z.ZodTemplateLiteral<`boxxy:hook:${string}`>]>;
77
+ at: z.core.$ZodBranded<z.ZodNumber, "Instant", "out">;
78
+ storeVersion: z.ZodNumber;
79
+ }, z.core.$strip>;
80
+ 'boxxy.attempt.claimed': z.ZodObject<{
81
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
82
+ phase: z.core.$ZodBranded<z.ZodString, "PhaseName", "out">;
83
+ number: z.ZodNumber;
84
+ round: z.ZodNumber;
85
+ mode: z.ZodEnum<{
86
+ agent: "agent";
87
+ attended: "attended";
88
+ }>;
89
+ pool: z.core.$ZodBranded<z.ZodString, "PoolName", "out">;
90
+ fields: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
91
+ seats: z.ZodArray<z.ZodObject<{
92
+ limit: z.core.$ZodBranded<z.ZodString, "LimitName", "out">;
93
+ }, z.core.$strip>>;
94
+ recipeHash: z.core.$ZodBranded<z.core.$ZodBranded<z.ZodString, "ContentHash", "out">, "RecipeHash", "out">;
95
+ skillsRef: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "CommitSha", "out">>;
96
+ rulesVersion: z.core.$ZodBranded<z.core.$ZodBranded<z.ZodString, "ContentHash", "out">, "RulesVersion", "out">;
97
+ storeVersion: z.ZodNumber;
98
+ }, z.core.$strip>;
99
+ 'boxxy.decision.recorded': z.ZodObject<{
100
+ id: z.core.$ZodBranded<z.ZodString, "DecisionId", "out">;
101
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
102
+ item: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
103
+ kind: z.ZodEnum<{
104
+ start: "start";
105
+ wake: "wake";
106
+ }>;
107
+ pool: z.core.$ZodBranded<z.ZodString, "PoolName", "out">;
108
+ rulesVersion: z.core.$ZodBranded<z.core.$ZodBranded<z.ZodString, "ContentHash", "out">, "RulesVersion", "out">;
109
+ snapshotHash: z.core.$ZodBranded<z.core.$ZodBranded<z.ZodString, "ContentHash", "out">, "SnapshotHash", "out">;
110
+ pepysOffsets: z.ZodRecord<z.core.$ZodBranded<z.ZodString, "StreamName", "out">, z.ZodNumber>;
111
+ faults: z.ZodArray<z.ZodObject<{
112
+ plugin: z.ZodString;
113
+ kind: z.ZodEnum<{
114
+ admission: "admission";
115
+ "filter-field": "filter-field";
116
+ gate: "gate";
117
+ propagation: "propagation";
118
+ signal: "signal";
119
+ waiver: "waiver";
120
+ }>;
121
+ item: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "ItemId", "out">>;
122
+ error: z.ZodString;
123
+ }, z.core.$strip>>;
124
+ limits: z.ZodArray<z.ZodObject<{
125
+ limit: z.core.$ZodBranded<z.ZodString, "LimitName", "out">;
126
+ held: z.ZodNumber;
127
+ max: z.ZodNumber;
128
+ }, z.core.$strip>>;
129
+ at: z.core.$ZodBranded<z.ZodNumber, "Instant", "out">;
130
+ storeVersion: z.ZodNumber;
131
+ }, z.core.$strip>;
132
+ 'boxxy.attempt.started': z.ZodObject<{
133
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
134
+ atcSession: z.core.$ZodBranded<z.ZodString, "AtcSessionId", "out">;
135
+ resumeFallback: z.ZodBoolean;
136
+ caller: z.ZodNullable<z.ZodType<import("@boxxy/model").CallerIdentity, unknown, z.core.$ZodTypeInternals<import("@boxxy/model").CallerIdentity, unknown>>>;
137
+ storeVersion: z.ZodNumber;
138
+ }, z.core.$strip>;
139
+ 'boxxy.attempt.spawn_unanswered': z.ZodObject<{
140
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
141
+ reason: z.ZodString;
142
+ storeVersion: z.ZodNumber;
143
+ }, z.core.$strip>;
144
+ 'boxxy.attempt.reconciled': z.ZodObject<{
145
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
146
+ atcSession: z.core.$ZodBranded<z.ZodString, "AtcSessionId", "out">;
147
+ caller: z.ZodNullable<z.ZodType<import("@boxxy/model").CallerIdentity, unknown, z.core.$ZodTypeInternals<import("@boxxy/model").CallerIdentity, unknown>>>;
148
+ storeVersion: z.ZodNumber;
149
+ }, z.core.$strip>;
150
+ 'boxxy.attempt.session_bound': z.ZodObject<{
151
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
152
+ atcSession: z.core.$ZodBranded<z.ZodString, "AtcSessionId", "out">;
153
+ agentSession: z.core.$ZodBranded<z.ZodString, "AgentSessionId", "out">;
154
+ product: z.ZodEnum<{
155
+ claude_code: "claude_code";
156
+ codex: "codex";
157
+ }>;
158
+ source: z.ZodEnum<{
159
+ hook: "hook";
160
+ worker: "worker";
161
+ }>;
162
+ seenAt: z.core.$ZodBranded<z.ZodNumber, "Instant", "out">;
163
+ storeVersion: z.ZodNumber;
164
+ }, z.core.$strip>;
165
+ 'boxxy.attempt.slept': z.ZodObject<{
166
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
167
+ idleSince: z.core.$ZodBranded<z.ZodNumber, "Instant", "out">;
168
+ asked: z.ZodBoolean;
169
+ storeVersion: z.ZodNumber;
170
+ }, z.core.$strip>;
171
+ 'boxxy.attempt.wake_requested': z.ZodObject<{
172
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
173
+ by: z.ZodEnum<{
174
+ command: "command";
175
+ "host-slept-unasked": "host-slept-unasked";
176
+ "session-ran": "session-ran";
177
+ }>;
178
+ storeVersion: z.ZodNumber;
179
+ }, z.core.$strip>;
180
+ 'boxxy.attempt.woken': z.ZodObject<{
181
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
182
+ holdGen: z.ZodNumber;
183
+ seats: z.ZodArray<z.ZodObject<{
184
+ limit: z.core.$ZodBranded<z.ZodString, "LimitName", "out">;
185
+ }, z.core.$strip>>;
186
+ overCap: z.ZodBoolean;
187
+ storeVersion: z.ZodNumber;
188
+ }, z.core.$strip>;
189
+ 'boxxy.attempt.resumed': z.ZodObject<{
190
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
191
+ atcSession: z.core.$ZodBranded<z.ZodString, "AtcSessionId", "out">;
192
+ caller: z.ZodNullable<z.ZodType<import("@boxxy/model").CallerIdentity, unknown, z.core.$ZodTypeInternals<import("@boxxy/model").CallerIdentity, unknown>>>;
193
+ storeVersion: z.ZodNumber;
194
+ }, z.core.$strip>;
195
+ 'boxxy.attempt.closed_out': z.ZodObject<{
196
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
197
+ phase: z.core.$ZodBranded<z.ZodString, "PhaseName", "out">;
198
+ closeOut: z.ZodType<import("@boxxy/model").CloseOut, unknown, z.core.$ZodTypeInternals<import("@boxxy/model").CloseOut, unknown>>;
199
+ hash: z.core.$ZodBranded<z.ZodString, "ContentHash", "out">;
200
+ storeVersion: z.ZodNumber;
201
+ }, z.core.$strip>;
202
+ 'boxxy.attempt.timed_out': z.ZodObject<{
203
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
204
+ phase: z.core.$ZodBranded<z.ZodString, "PhaseName", "out">;
205
+ afterMinutes: z.ZodNumber;
206
+ storeVersion: z.ZodNumber;
207
+ }, z.core.$strip>;
208
+ 'boxxy.attempt.turn_ended': z.ZodObject<{
209
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
210
+ phase: z.core.$ZodBranded<z.ZodString, "PhaseName", "out">;
211
+ storeVersion: z.ZodNumber;
212
+ }, z.core.$strip>;
213
+ 'boxxy.attempt.settled': z.ZodObject<{
214
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
215
+ phase: z.core.$ZodBranded<z.ZodString, "PhaseName", "out">;
216
+ round: z.ZodNumber;
217
+ state: z.ZodEnum<{
218
+ failed: "failed";
219
+ succeeded: "succeeded";
220
+ }>;
221
+ failure: z.ZodNullable<z.ZodString>;
222
+ outcome: z.ZodString;
223
+ returnedOutcome: z.ZodNullable<z.ZodString>;
224
+ closing: z.ZodNullable<z.ZodEnum<{
225
+ "closed-out": "closed-out";
226
+ "item-closed": "item-closed";
227
+ "skill-missing": "skill-missing";
228
+ stalled: "stalled";
229
+ "timed-out": "timed-out";
230
+ "turn-ended": "turn-ended";
231
+ "usage-limit": "usage-limit";
232
+ }>>;
233
+ asleep: z.ZodBoolean;
234
+ sessionStopped: z.ZodBoolean;
235
+ endedAt: z.core.$ZodBranded<z.ZodNumber, "Instant", "out">;
236
+ criteria: z.ZodArray<z.ZodObject<{
237
+ criterion: z.core.$ZodBranded<z.ZodString, "CriterionId", "out">;
238
+ evidence: z.ZodArray<z.core.$ZodBranded<z.ZodString, "FactId", "out">>;
239
+ }, z.core.$strip>>;
240
+ matched: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ItemId", "out">>;
241
+ frictionDropped: z.ZodNumber;
242
+ skippedEffects: z.ZodArray<z.ZodObject<{
243
+ effect: z.ZodEnum<{
244
+ "add-relation": "add-relation";
245
+ "close-item": "close-item";
246
+ "file-item": "file-item";
247
+ "record-proposal": "record-proposal";
248
+ "set-acceptance": "set-acceptance";
249
+ "set-field": "set-field";
250
+ "set-kind": "set-kind";
251
+ }>;
252
+ reason: z.ZodString;
253
+ }, z.core.$strip>>;
254
+ storeVersion: z.ZodNumber;
255
+ }, z.core.$strip>;
256
+ 'boxxy.proposal.recorded': z.ZodObject<{
257
+ target: z.ZodObject<{
258
+ kind: z.ZodEnum<{
259
+ "agents-md": "agents-md";
260
+ lint: "lint";
261
+ rule: "rule";
262
+ skill: "skill";
263
+ tool: "tool";
264
+ }>;
265
+ name: z.ZodString;
266
+ }, z.core.$strip>;
267
+ change: z.ZodString;
268
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
269
+ storeVersion: z.ZodNumber;
270
+ }, z.core.$strip>;
271
+ 'boxxy.evidence.recorded': z.ZodObject<{
272
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
273
+ kind: z.ZodEnum<{
274
+ "ci-run": "ci-run";
275
+ commit: "commit";
276
+ "live-check": "live-check";
277
+ pull_request: "pull_request";
278
+ test: "test";
279
+ }>;
280
+ ref: z.ZodString;
281
+ observed: z.ZodNullable<z.ZodString>;
282
+ storeVersion: z.ZodNumber;
283
+ }, z.core.$strip>;
284
+ 'boxxy.pull_request.linked': z.ZodObject<{
285
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
286
+ repo: z.core.$ZodBranded<z.ZodString, "RepoName", "out">;
287
+ number: z.ZodNumber;
288
+ url: z.ZodURL;
289
+ pullRequestId: z.ZodString;
290
+ source: z.ZodEnum<{
291
+ hook: "hook";
292
+ watch: "watch";
293
+ }>;
294
+ storeVersion: z.ZodNumber;
295
+ }, z.core.$strip>;
296
+ 'boxxy.commit.linked': z.ZodObject<{
297
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
298
+ repo: z.core.$ZodBranded<z.ZodString, "RepoName", "out">;
299
+ sha: z.core.$ZodBranded<z.ZodString, "CommitSha", "out">;
300
+ pullRequestNumber: z.ZodNumber;
301
+ storeVersion: z.ZodNumber;
302
+ }, z.core.$strip>;
303
+ 'boxxy.pull_request.merged': z.ZodObject<{
304
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
305
+ repo: z.core.$ZodBranded<z.ZodString, "RepoName", "out">;
306
+ number: z.ZodNumber;
307
+ pullRequestId: z.ZodString;
308
+ mergedAt: z.core.$ZodBranded<z.ZodNumber, "Instant", "out">;
309
+ mergeCommit: z.core.$ZodBranded<z.ZodString, "CommitSha", "out">;
310
+ storeVersion: z.ZodNumber;
311
+ }, z.core.$strip>;
312
+ 'boxxy.pull_request.closed': z.ZodObject<{
313
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
314
+ repo: z.core.$ZodBranded<z.ZodString, "RepoName", "out">;
315
+ number: z.ZodNumber;
316
+ pullRequestId: z.ZodString;
317
+ storeVersion: z.ZodNumber;
318
+ }, z.core.$strip>;
319
+ };
@@ -0,0 +1,125 @@
1
+ export declare const boxxyWorkConsumer: import("@pepys/kit").ConsumerDeclaration<"boxxy_work", {
2
+ readonly boxxy_item: import("@pepys/kit").TableDeclaration<{
3
+ readonly id: {
4
+ readonly kind: "entityID";
5
+ };
6
+ readonly kind: {
7
+ readonly kind: "text";
8
+ };
9
+ readonly repo: {
10
+ readonly kind: "text";
11
+ };
12
+ readonly title: {
13
+ readonly kind: "text";
14
+ };
15
+ readonly design_mode: {
16
+ readonly kind: "text";
17
+ readonly nullable: true;
18
+ };
19
+ readonly filed_at: {
20
+ readonly kind: "timestamp";
21
+ };
22
+ readonly closed_at: {
23
+ readonly kind: "timestamp";
24
+ readonly nullable: true;
25
+ };
26
+ readonly close_reason: {
27
+ readonly kind: "text";
28
+ readonly nullable: true;
29
+ };
30
+ readonly updated_at: {
31
+ readonly kind: "timestamp";
32
+ };
33
+ }>;
34
+ readonly boxxy_attempt: import("@pepys/kit").TableDeclaration<{
35
+ readonly id: {
36
+ readonly kind: "entityID";
37
+ };
38
+ readonly item_id: {
39
+ readonly kind: "entityID";
40
+ };
41
+ readonly phase: {
42
+ readonly kind: "text";
43
+ };
44
+ readonly number: {
45
+ readonly kind: "integer";
46
+ };
47
+ readonly round: {
48
+ readonly kind: "integer";
49
+ };
50
+ readonly mode: {
51
+ readonly kind: "text";
52
+ };
53
+ readonly pool: {
54
+ readonly kind: "text";
55
+ };
56
+ readonly recipe_hash: {
57
+ readonly kind: "text";
58
+ };
59
+ readonly rules_version: {
60
+ readonly kind: "text";
61
+ };
62
+ readonly atc_session: {
63
+ readonly kind: "text";
64
+ readonly nullable: true;
65
+ };
66
+ readonly state: {
67
+ readonly kind: "text";
68
+ };
69
+ readonly outcome: {
70
+ readonly kind: "text";
71
+ readonly nullable: true;
72
+ };
73
+ readonly failure: {
74
+ readonly kind: "text";
75
+ readonly nullable: true;
76
+ };
77
+ readonly claimed_at: {
78
+ readonly kind: "timestamp";
79
+ };
80
+ readonly started_at: {
81
+ readonly kind: "timestamp";
82
+ readonly nullable: true;
83
+ };
84
+ readonly closed_out_at: {
85
+ readonly kind: "timestamp";
86
+ readonly nullable: true;
87
+ };
88
+ readonly ended_at: {
89
+ readonly kind: "timestamp";
90
+ readonly nullable: true;
91
+ };
92
+ readonly sleeps: {
93
+ readonly kind: "json";
94
+ };
95
+ readonly updated_at: {
96
+ readonly kind: "timestamp";
97
+ };
98
+ }>;
99
+ readonly boxxy_attempt_session: import("@pepys/kit").TableDeclaration<{
100
+ readonly attempt_id: {
101
+ readonly kind: "entityID";
102
+ };
103
+ readonly session_id: {
104
+ readonly kind: "entityID";
105
+ };
106
+ readonly key: {
107
+ readonly kind: "text";
108
+ };
109
+ readonly product: {
110
+ readonly kind: "text";
111
+ readonly nullable: true;
112
+ };
113
+ readonly caller_issuer: {
114
+ readonly kind: "text";
115
+ readonly nullable: true;
116
+ };
117
+ readonly caller_subject: {
118
+ readonly kind: "text";
119
+ readonly nullable: true;
120
+ };
121
+ readonly bound_at: {
122
+ readonly kind: "timestamp";
123
+ };
124
+ }>;
125
+ }, import("@pepys/kit").LinkTypeDeclaration<"attempt_of", "boxxy:attempt", "boxxy:item"> | import("@pepys/kit").LinkTypeDeclaration<"produced", "boxxy:attempt", "github:pull_request"> | import("@pepys/kit").LinkTypeDeclaration<"ran_in", "boxxy:attempt", "telemetry:session">>;
@@ -0,0 +1,3 @@
1
+ export declare const ranIn: import("@pepys/kit").LinkTypeDeclaration<"ran_in", "boxxy:attempt", "telemetry:session">;
2
+ export declare const produced: import("@pepys/kit").LinkTypeDeclaration<"produced", "boxxy:attempt", "github:pull_request">;
3
+ export declare const attemptOf: import("@pepys/kit").LinkTypeDeclaration<"attempt_of", "boxxy:attempt", "boxxy:item">;
@@ -0,0 +1,2 @@
1
+ import type { WorkFact, WorkFold } from './types.ts';
2
+ export declare function foldWorkFacts(facts: readonly WorkFact[]): WorkFold;
@@ -0,0 +1,147 @@
1
+ interface CallerFields {
2
+ issuer: string;
3
+ subject: string;
4
+ }
5
+ interface FactBase {
6
+ id: string;
7
+ entity: string;
8
+ at: string;
9
+ }
10
+ export interface ItemFiledFact extends FactBase {
11
+ type: 'boxxy.item.filed';
12
+ payload: {
13
+ kind: string;
14
+ repo: string;
15
+ title: string;
16
+ fields: {
17
+ designMode?: unknown;
18
+ };
19
+ };
20
+ }
21
+ export interface ItemEditedFact extends FactBase {
22
+ type: 'boxxy.item.edited';
23
+ payload: {
24
+ title?: unknown;
25
+ kind?: unknown;
26
+ fields?: unknown;
27
+ };
28
+ }
29
+ export interface ItemClosedFact extends FactBase {
30
+ type: 'boxxy.item.closed';
31
+ payload: {
32
+ reason: string;
33
+ };
34
+ }
35
+ export interface AttemptClaimedFact extends FactBase {
36
+ type: 'boxxy.attempt.claimed';
37
+ payload: {
38
+ attempt: string;
39
+ phase: string;
40
+ number: number;
41
+ round: number;
42
+ mode: string;
43
+ pool: string;
44
+ recipeHash: string;
45
+ rulesVersion: string;
46
+ };
47
+ }
48
+ export interface AttemptSessionFact extends FactBase {
49
+ type: 'boxxy.attempt.started' | 'boxxy.attempt.reconciled' | 'boxxy.attempt.resumed';
50
+ payload: {
51
+ attempt: string;
52
+ atcSession: string;
53
+ caller: CallerFields | null;
54
+ };
55
+ }
56
+ interface SessionBoundFact extends FactBase {
57
+ type: 'boxxy.attempt.session_bound';
58
+ payload: {
59
+ attempt: string;
60
+ atcSession: string;
61
+ agentSession: string;
62
+ product: string;
63
+ };
64
+ }
65
+ export interface AttemptMarkFact extends FactBase {
66
+ type: 'boxxy.attempt.slept' | 'boxxy.attempt.woken' | 'boxxy.attempt.closed_out';
67
+ payload: {
68
+ attempt: string;
69
+ };
70
+ }
71
+ export interface AttemptSettledFact extends FactBase {
72
+ type: 'boxxy.attempt.settled';
73
+ payload: {
74
+ attempt: string;
75
+ state: string;
76
+ outcome: string;
77
+ failure: string | null;
78
+ asleep: boolean;
79
+ };
80
+ }
81
+ interface PullRequestLinkedFact extends FactBase {
82
+ type: 'boxxy.pull_request.linked';
83
+ payload: {
84
+ attempt: string;
85
+ pullRequestId: string;
86
+ };
87
+ }
88
+ interface PassedOverFact extends FactBase {
89
+ type: 'boxxy.item.noted' | 'boxxy.relation.added' | 'boxxy.relation.removed' | 'boxxy.lever.recorded' | 'boxxy.decision.recorded' | 'boxxy.attempt.spawn_unanswered' | 'boxxy.attempt.wake_requested' | 'boxxy.attempt.timed_out' | 'boxxy.attempt.turn_ended' | 'boxxy.proposal.recorded' | 'boxxy.evidence.recorded' | 'boxxy.commit.linked' | 'boxxy.pull_request.merged' | 'boxxy.pull_request.closed';
90
+ payload?: unknown;
91
+ }
92
+ export type WorkFact = ItemFiledFact | ItemEditedFact | ItemClosedFact | AttemptClaimedFact | AttemptSessionFact | SessionBoundFact | AttemptMarkFact | AttemptSettledFact | PullRequestLinkedFact | PassedOverFact;
93
+ export interface ItemFold {
94
+ kind: string;
95
+ repo: string;
96
+ title: string;
97
+ design_mode: string | null;
98
+ filed_at: string;
99
+ closed_at: string | null;
100
+ close_reason: string | null;
101
+ updated_at: string;
102
+ }
103
+ export interface SleepStretch {
104
+ from: string;
105
+ to: string | null;
106
+ }
107
+ export interface AttemptFold {
108
+ id: string;
109
+ phase: string;
110
+ number: number;
111
+ round: number;
112
+ mode: string;
113
+ pool: string;
114
+ recipe_hash: string;
115
+ rules_version: string;
116
+ atc_session: string | null;
117
+ state: string;
118
+ outcome: string | null;
119
+ failure: string | null;
120
+ claimed_at: string;
121
+ started_at: string | null;
122
+ closed_out_at: string | null;
123
+ ended_at: string | null;
124
+ sleeps: SleepStretch[];
125
+ updated_at: string;
126
+ claimedFact: string;
127
+ sessions: SessionFold[];
128
+ pullRequests: PullRequestFold[];
129
+ }
130
+ export interface SessionFold {
131
+ session: string;
132
+ key: 'atc' | 'agent';
133
+ product: string | null;
134
+ caller_issuer: string | null;
135
+ caller_subject: string | null;
136
+ bound_at: string;
137
+ evidence: string;
138
+ }
139
+ export interface PullRequestFold {
140
+ id: string;
141
+ evidence: string;
142
+ }
143
+ export interface WorkFold {
144
+ item: ItemFold | null;
145
+ attempts: AttemptFold[];
146
+ }
147
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@boxxy/pepys",
3
- "version": "0.0.1",
4
- "description": "Placeholder that reserves the name; the first real version comes from the boxxy release",
3
+ "version": "0.1.3",
4
+ "description": "The pepys plug-in of boxxy, its fact sink and its report reader",
5
5
  "homepage": "https://github.com/zgeoff/boxxy/tree/main/packages/pepys#readme",
6
6
  "bugs": "https://github.com/zgeoff/boxxy/issues",
7
7
  "license": "MIT",
@@ -11,10 +11,51 @@
11
11
  "directory": "packages/pepys"
12
12
  },
13
13
  "files": [
14
- "README.md",
15
- "LICENSE"
14
+ "src",
15
+ "!src/**/*.test.ts",
16
+ "!src/test-utils",
17
+ "dist"
16
18
  ],
19
+ "type": "module",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./src/index.ts"
24
+ },
25
+ "./sink": {
26
+ "types": "./dist/create-pepys-fact-sink.d.ts",
27
+ "default": "./src/create-pepys-fact-sink.ts"
28
+ },
29
+ "./reader": {
30
+ "types": "./dist/create-pepys-reader.d.ts",
31
+ "default": "./src/create-pepys-reader.ts"
32
+ }
33
+ },
17
34
  "publishConfig": {
18
35
  "access": "public"
36
+ },
37
+ "scripts": {
38
+ "build": "rm -rf dist && tsrs -p tsconfig.build.json",
39
+ "glue": "pepys build src/boxxy-work-plugin.ts",
40
+ "typecheck": "tsrs --noEmit"
41
+ },
42
+ "dependencies": {
43
+ "@boxxy/model": "0.1.3"
44
+ },
45
+ "devDependencies": {
46
+ "@pepys/cli": "https://github.com/zgeoff/pepys/releases/download/preview-kit-0.0.1/pepys-cli-0.0.1.tgz",
47
+ "@pepys/kit": "https://github.com/zgeoff/pepys/releases/download/preview-kit-0.0.1/pepys-kit-0.0.1.tgz",
48
+ "@pepys/kysely-turso": "https://github.com/zgeoff/pepys/releases/download/preview-kit-0.0.1/pepys-kysely-turso-0.0.1.tgz",
49
+ "@pepys/schema": "https://github.com/zgeoff/pepys/releases/download/preview-kit-0.0.1/pepys-schema-0.0.1.tgz",
50
+ "@pepys/testing": "https://github.com/zgeoff/pepys/releases/download/preview-kit-0.0.1/pepys-testing-0.0.1.tgz",
51
+ "zod": "4.6.7"
52
+ },
53
+ "peerDependencies": {
54
+ "@pepys/kit": "0.0.1",
55
+ "zod": "4.6.7"
56
+ },
57
+ "engines": {
58
+ "bun": ">=1.3",
59
+ "node": ">=24"
19
60
  }
20
61
  }