@boxxy/model 0.1.2 → 0.1.4

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 (234) hide show
  1. package/README.md +8 -6
  2. package/dist/closeouts/build-close-out-schema.d.ts +31 -0
  3. package/dist/closeouts/close-out-answer-schema.d.ts +3 -0
  4. package/dist/closeouts/close-out-schema.d.ts +3 -0
  5. package/dist/closeouts/design-close-out-schema.d.ts +30 -0
  6. package/dist/closeouts/friction-schema.d.ts +14 -0
  7. package/dist/closeouts/open-item-schema.d.ts +3 -0
  8. package/dist/closeouts/review-close-out-schema.d.ts +40 -0
  9. package/dist/closeouts/triage-close-out-schema.d.ts +40 -0
  10. package/dist/closeouts/types.d.ts +221 -0
  11. package/dist/dispatch/build-applied-change.d.ts +6 -0
  12. package/dist/dispatch/collect-seat-sync.d.ts +14 -0
  13. package/dist/dispatch/pick-seat-take.d.ts +10 -0
  14. package/dist/dispatch/types.d.ts +11 -0
  15. package/dist/{outbox-fact-schema.d.ts → facts/outbox-fact-schema.d.ts} +1 -1
  16. package/dist/facts/parse-new-fact.d.ts +2 -0
  17. package/dist/facts/types.d.ts +191 -0
  18. package/dist/facts/work-fact-schemas.d.ts +293 -0
  19. package/dist/index.d.ts +64 -23
  20. package/dist/items/build-item-views.d.ts +4 -0
  21. package/dist/items/collect-retries.d.ts +3 -0
  22. package/dist/items/collect-settled.d.ts +3 -0
  23. package/dist/items/derive-item-state.d.ts +17 -0
  24. package/dist/{live-levers.d.ts → items/live-levers.d.ts} +1 -1
  25. package/dist/items/types.d.ts +12 -0
  26. package/dist/pipeline/advance.d.ts +10 -0
  27. package/dist/pipeline/constants.d.ts +2 -0
  28. package/dist/pipeline/count-trailing.d.ts +1 -0
  29. package/dist/pipeline/find-position.d.ts +9 -0
  30. package/dist/pipeline/find-step.d.ts +3 -0
  31. package/dist/pipeline/merge-by-time.d.ts +9 -0
  32. package/dist/pipeline/position-schema.d.ts +3 -0
  33. package/dist/pipeline/types.d.ts +28 -0
  34. package/dist/planning/define-admission.d.ts +3 -0
  35. package/dist/planning/define-gate.d.ts +3 -0
  36. package/dist/planning/define-signal.d.ts +3 -0
  37. package/dist/planning/is-filter-match.d.ts +3 -0
  38. package/dist/planning/limit-fill-schema.d.ts +3 -0
  39. package/dist/{signal-key.d.ts → planning/signal-key.d.ts} +1 -1
  40. package/dist/planning/types.d.ts +155 -0
  41. package/dist/ports/types.d.ts +289 -0
  42. package/dist/reports/constants.d.ts +3 -0
  43. package/dist/reports/cost-to-land-schema.d.ts +29 -0
  44. package/dist/reports/outbox-status.d.ts +16 -0
  45. package/dist/reports/stage-time-schema.d.ts +25 -0
  46. package/dist/reports/types.d.ts +5 -0
  47. package/dist/rows/actor-ref-schema.d.ts +2 -0
  48. package/dist/rows/attempt-row-schema.d.ts +3 -0
  49. package/dist/rows/attempt-session-row-schema.d.ts +3 -0
  50. package/dist/{brand-schemas.d.ts → rows/brand-schemas.d.ts} +5 -2
  51. package/dist/rows/caller-identity-schema.d.ts +3 -0
  52. package/dist/rows/criterion-schema.d.ts +3 -0
  53. package/dist/rows/decision-row-schema.d.ts +34 -0
  54. package/dist/rows/evidence-row-schema.d.ts +3 -0
  55. package/dist/rows/item-row-schema.d.ts +28 -0
  56. package/dist/rows/item-view-schema.d.ts +3 -0
  57. package/dist/rows/lease-row-schema.d.ts +3 -0
  58. package/dist/rows/lever-row-schema.d.ts +12 -0
  59. package/dist/rows/limit-schema.d.ts +3 -0
  60. package/dist/rows/limit-seat-row-schema.d.ts +3 -0
  61. package/dist/rows/note-row-schema.d.ts +3 -0
  62. package/dist/rows/notice-row-schema.d.ts +3 -0
  63. package/dist/rows/pull-request-row-schema.d.ts +3 -0
  64. package/dist/rows/relation-row-schema.d.ts +3 -0
  65. package/dist/{row-schemas.d.ts → rows/row-schemas.d.ts} +2 -2
  66. package/dist/rows/runner-row-schema.d.ts +3 -0
  67. package/dist/rows/spawn-request-schema.d.ts +3 -0
  68. package/dist/rules/define-phase.d.ts +3 -0
  69. package/dist/rules/load-rejection-schema.d.ts +3 -0
  70. package/dist/rules/types.d.ts +244 -0
  71. package/dist/test-utils/build-mock-cost-to-land.d.ts +2 -0
  72. package/dist/test-utils/build-mock-evidence-row.d.ts +1 -1
  73. package/dist/test-utils/build-mock-fact-id.d.ts +1 -1
  74. package/dist/test-utils/build-mock-frame-item.d.ts +1 -1
  75. package/dist/test-utils/build-mock-frame.d.ts +2 -0
  76. package/dist/test-utils/build-mock-item-rules.d.ts +2 -0
  77. package/dist/test-utils/build-mock-lease-row.d.ts +1 -1
  78. package/dist/test-utils/build-mock-outbox-fact.d.ts +2 -0
  79. package/dist/test-utils/build-mock-phase-kind.d.ts +7 -0
  80. package/dist/test-utils/build-mock-pipeline.d.ts +7 -0
  81. package/dist/test-utils/build-mock-relation-row.d.ts +2 -0
  82. package/dist/test-utils/build-mock-settled.d.ts +9 -0
  83. package/dist/test-utils/build-mock-snapshot.d.ts +1 -1
  84. package/dist/test-utils/build-mock-v1-attempt-row.d.ts +2 -0
  85. package/dist/test-utils/build-mock-v1-item-row.d.ts +2 -0
  86. package/dist/test-utils/build-mock-v1-item-view.d.ts +2 -0
  87. package/dist/test-utils/build-mock-v1-lever-row.d.ts +2 -0
  88. package/dist/test-utils/build-mock-v1-pull-request-row.d.ts +2 -0
  89. package/dist/test-utils/build-mock-work-fact.d.ts +12 -0
  90. package/dist/test-utils/create-fake-notifier.d.ts +9 -0
  91. package/dist/test-utils/create-fake-pepys-reader.d.ts +13 -0
  92. package/dist/test-utils/fact-sink-contract.d.ts +14 -0
  93. package/dist/test-utils/pepys-reader-contract.d.ts +17 -0
  94. package/dist/{types/core.d.ts → types.d.ts} +93 -43
  95. package/package.json +13 -3
  96. package/src/{build-close-out-schema.ts → closeouts/build-close-out-schema.ts} +5 -10
  97. package/src/closeouts/close-out-answer-schema.ts +42 -0
  98. package/src/closeouts/close-out-schema.ts +13 -0
  99. package/src/closeouts/design-close-out-schema.ts +20 -0
  100. package/src/closeouts/friction-schema.ts +11 -0
  101. package/src/closeouts/open-item-schema.ts +8 -0
  102. package/src/closeouts/review-close-out-schema.ts +38 -0
  103. package/src/closeouts/triage-close-out-schema.ts +29 -0
  104. package/src/closeouts/types.ts +230 -0
  105. package/src/dispatch/build-applied-change.ts +57 -0
  106. package/src/dispatch/collect-seat-sync.ts +86 -0
  107. package/src/dispatch/pick-seat-take.ts +39 -0
  108. package/src/dispatch/types.ts +14 -0
  109. package/src/facts/outbox-fact-schema.ts +22 -0
  110. package/src/facts/parse-new-fact.ts +16 -0
  111. package/src/facts/types.ts +235 -0
  112. package/src/facts/work-fact-schemas.ts +201 -0
  113. package/src/index.ts +147 -55
  114. package/src/items/build-item-views.ts +146 -0
  115. package/src/items/collect-retries.ts +12 -0
  116. package/src/items/collect-settled.ts +20 -0
  117. package/src/items/derive-item-state.ts +95 -0
  118. package/src/{live-levers.ts → items/live-levers.ts} +1 -1
  119. package/src/items/types.ts +26 -0
  120. package/src/pipeline/advance.ts +78 -0
  121. package/src/pipeline/constants.ts +12 -0
  122. package/src/pipeline/count-trailing.ts +16 -0
  123. package/src/pipeline/find-position.ts +74 -0
  124. package/src/pipeline/find-step.ts +6 -0
  125. package/src/pipeline/merge-by-time.ts +33 -0
  126. package/src/pipeline/position-schema.ts +27 -0
  127. package/src/pipeline/types.ts +47 -0
  128. package/src/{define-admission.ts → planning/define-admission.ts} +2 -2
  129. package/src/{define-gate.ts → planning/define-gate.ts} +2 -2
  130. package/src/{define-signal.ts → planning/define-signal.ts} +2 -2
  131. package/src/planning/is-filter-match.ts +10 -0
  132. package/src/planning/limit-fill-schema.ts +12 -0
  133. package/src/{signal-key.ts → planning/signal-key.ts} +1 -1
  134. package/src/planning/types.ts +216 -0
  135. package/src/ports/types.ts +412 -0
  136. package/src/reports/constants.ts +6 -0
  137. package/src/reports/cost-to-land-schema.ts +47 -0
  138. package/src/reports/outbox-status.ts +22 -0
  139. package/src/reports/stage-time-schema.ts +21 -0
  140. package/src/reports/types.ts +7 -0
  141. package/src/rows/actor-ref-schema.ts +17 -0
  142. package/src/rows/attempt-row-schema.ts +69 -0
  143. package/src/rows/attempt-session-row-schema.ts +12 -0
  144. package/src/{brand-schemas.ts → rows/brand-schemas.ts} +5 -2
  145. package/src/rows/caller-identity-schema.ts +7 -0
  146. package/src/rows/criterion-schema.ts +9 -0
  147. package/src/rows/decision-row-schema.ts +34 -0
  148. package/src/rows/evidence-row-schema.ts +13 -0
  149. package/src/rows/item-row-schema.ts +32 -0
  150. package/src/rows/item-view-schema.ts +31 -0
  151. package/src/rows/lease-row-schema.ts +12 -0
  152. package/src/rows/lever-row-schema.ts +17 -0
  153. package/src/rows/limit-schema.ts +12 -0
  154. package/src/rows/limit-seat-row-schema.ts +12 -0
  155. package/src/rows/note-row-schema.ts +12 -0
  156. package/src/rows/notice-row-schema.ts +17 -0
  157. package/src/rows/pull-request-row-schema.ts +15 -0
  158. package/src/rows/relation-row-schema.ts +13 -0
  159. package/src/rows/row-schemas.ts +30 -0
  160. package/src/rows/runner-row-schema.ts +9 -0
  161. package/src/rows/spawn-request-schema.ts +15 -0
  162. package/src/rules/define-phase.ts +12 -0
  163. package/src/rules/load-rejection-schema.ts +51 -0
  164. package/src/rules/types.ts +291 -0
  165. package/src/test-utils/build-mock-cost-to-land.ts +31 -0
  166. package/src/test-utils/build-mock-evidence-row.ts +2 -2
  167. package/src/test-utils/build-mock-fact-id.ts +3 -3
  168. package/src/test-utils/build-mock-frame-item.ts +10 -5
  169. package/src/test-utils/build-mock-frame.ts +13 -0
  170. package/src/test-utils/build-mock-item-rules.ts +17 -0
  171. package/src/test-utils/build-mock-lease-row.ts +2 -2
  172. package/src/test-utils/build-mock-outbox-fact.ts +22 -0
  173. package/src/test-utils/build-mock-phase-kind.ts +29 -0
  174. package/src/test-utils/build-mock-pipeline.ts +52 -0
  175. package/src/test-utils/{build-mock-link-row.ts → build-mock-relation-row.ts} +4 -4
  176. package/src/test-utils/build-mock-settled.ts +18 -0
  177. package/src/test-utils/build-mock-snapshot.ts +10 -2
  178. package/src/test-utils/{build-mock-attempt-row.ts → build-mock-v1-attempt-row.ts} +28 -9
  179. package/src/test-utils/{build-mock-item-row.ts → build-mock-v1-item-row.ts} +7 -3
  180. package/src/test-utils/build-mock-v1-item-view.ts +29 -0
  181. package/src/test-utils/{build-mock-lever-row.ts → build-mock-v1-lever-row.ts} +5 -3
  182. package/src/test-utils/build-mock-v1-pull-request-row.ts +26 -0
  183. package/src/test-utils/build-mock-work-fact.ts +179 -0
  184. package/src/test-utils/create-fake-notifier.ts +54 -0
  185. package/src/test-utils/create-fake-pepys-reader.ts +73 -0
  186. package/src/test-utils/fact-sink-contract.ts +103 -0
  187. package/src/test-utils/pepys-reader-contract.ts +117 -0
  188. package/src/{types/core.ts → types.ts} +183 -59
  189. package/dist/actor-ref-schema.d.ts +0 -2
  190. package/dist/build-applied-change.d.ts +0 -13
  191. package/dist/build-close-out-schema.d.ts +0 -3
  192. package/dist/build-item-views.d.ts +0 -2
  193. package/dist/define-admission.d.ts +0 -3
  194. package/dist/define-gate.d.ts +0 -3
  195. package/dist/define-signal.d.ts +0 -3
  196. package/dist/derive-item-state.d.ts +0 -2
  197. package/dist/fact-schemas.d.ts +0 -5
  198. package/dist/find-slot-take.d.ts +0 -5
  199. package/dist/friction-schema.d.ts +0 -3
  200. package/dist/test-utils/build-mock-attempt-row.d.ts +0 -2
  201. package/dist/test-utils/build-mock-item-row.d.ts +0 -2
  202. package/dist/test-utils/build-mock-item-rows.d.ts +0 -2
  203. package/dist/test-utils/build-mock-item-view.d.ts +0 -2
  204. package/dist/test-utils/build-mock-lever-row.d.ts +0 -2
  205. package/dist/test-utils/build-mock-link-row.d.ts +0 -2
  206. package/dist/test-utils/build-mock-pull-request-row.d.ts +0 -2
  207. package/dist/types/dispatch.d.ts +0 -82
  208. package/dist/types/facts.d.ts +0 -154
  209. package/dist/types/planning.d.ts +0 -94
  210. package/dist/types/ports.d.ts +0 -218
  211. package/dist/types/registries.d.ts +0 -150
  212. package/src/actor-ref-schema.ts +0 -9
  213. package/src/build-applied-change.ts +0 -71
  214. package/src/build-item-views.ts +0 -128
  215. package/src/derive-item-state.ts +0 -76
  216. package/src/fact-schemas.ts +0 -132
  217. package/src/find-slot-take.ts +0 -12
  218. package/src/friction-schema.ts +0 -10
  219. package/src/outbox-fact-schema.ts +0 -25
  220. package/src/row-schemas.ts +0 -89
  221. package/src/test-utils/build-mock-item-rows.ts +0 -14
  222. package/src/test-utils/build-mock-item-view.ts +0 -8
  223. package/src/test-utils/build-mock-pull-request-row.ts +0 -16
  224. package/src/types/dispatch.ts +0 -95
  225. package/src/types/facts.ts +0 -166
  226. package/src/types/planning.ts +0 -136
  227. package/src/types/ports.ts +0 -262
  228. package/src/types/registries.ts +0 -185
  229. /package/dist/test-utils/{seed-faker.d.ts → pin-faker-seed.d.ts} +0 -0
  230. /package/dist/{format-key-path.d.ts → utils/format-key-path.d.ts} +0 -0
  231. /package/dist/{to-json-value.d.ts → utils/to-json-value.d.ts} +0 -0
  232. /package/src/test-utils/{seed-faker.ts → pin-faker-seed.ts} +0 -0
  233. /package/src/{format-key-path.ts → utils/format-key-path.ts} +0 -0
  234. /package/src/{to-json-value.ts → utils/to-json-value.ts} +0 -0
@@ -0,0 +1,155 @@
1
+ import type { Schema } from '../rules/types.ts';
2
+ import type { AttemptId, FaultRecord, FieldValues, Instant, ItemId, ItemView, LeverRow, LimitName, PhaseName, PoolName, RelationRow, RelationTypeName } from '../types.ts';
3
+ export type SignalName = string;
4
+ export type GateName = string;
5
+ export type WaiverName = string;
6
+ export type AdmissionName = string;
7
+ export type ViewName = string;
8
+ export type SignalKey = `${SignalName}#${string}`;
9
+ export type Filter = Readonly<Record<string, readonly string[]>>;
10
+ export interface Limit {
11
+ readonly name: LimitName;
12
+ readonly max: number;
13
+ readonly counts: Filter;
14
+ }
15
+ export interface LimitFill extends Limit {
16
+ readonly held: number;
17
+ }
18
+ export interface Pool {
19
+ readonly name: PoolName;
20
+ readonly takes: Filter;
21
+ readonly order: readonly SignalKey[];
22
+ }
23
+ export interface Snapshot {
24
+ readonly storeVersion: number;
25
+ readonly items: readonly ItemView[];
26
+ readonly relations: readonly RelationRow[];
27
+ readonly levers: readonly LeverRow[];
28
+ readonly limits: readonly LimitFill[];
29
+ readonly wakes: readonly Wake[];
30
+ }
31
+ export interface Wake {
32
+ readonly attempt: AttemptId;
33
+ readonly item: ItemId;
34
+ readonly phase: PhaseName;
35
+ readonly pool: PoolName;
36
+ readonly fields: FieldValues;
37
+ readonly requestedAt: Instant;
38
+ }
39
+ export type Pick = StartPick | WakePick;
40
+ export interface StartPick {
41
+ readonly kind: 'start';
42
+ readonly item: ItemId;
43
+ readonly phase: PhaseName;
44
+ readonly round: number;
45
+ readonly pool: PoolName;
46
+ readonly fields: FieldValues;
47
+ readonly limits: readonly LimitName[];
48
+ }
49
+ export interface WakePick {
50
+ readonly kind: 'wake';
51
+ readonly attempt: AttemptId;
52
+ readonly limits: readonly LimitName[];
53
+ }
54
+ export interface Wait {
55
+ readonly subject: {
56
+ readonly kind: 'item';
57
+ readonly item: ItemId;
58
+ } | {
59
+ readonly kind: 'wake';
60
+ readonly attempt: AttemptId;
61
+ };
62
+ readonly reason: WaitReason;
63
+ }
64
+ export type WaitReason = {
65
+ readonly kind: 'limit-full';
66
+ readonly limit: LimitName;
67
+ } | {
68
+ readonly kind: 'backoff';
69
+ readonly pool: PoolName;
70
+ } | {
71
+ readonly kind: 'no-pool';
72
+ };
73
+ export interface Decision {
74
+ readonly picks: readonly Pick[];
75
+ readonly waits: readonly Wait[];
76
+ }
77
+ export interface SeatRef {
78
+ readonly limit: LimitName;
79
+ }
80
+ export interface SeatTake {
81
+ readonly limits: readonly LimitName[];
82
+ readonly attempt: AttemptId;
83
+ readonly holdGen: number;
84
+ readonly overCap: boolean;
85
+ }
86
+ export interface SeatRelease {
87
+ readonly attempt: AttemptId;
88
+ readonly holdGen: number;
89
+ }
90
+ export interface FrameItem extends ItemView {
91
+ readonly phase: PhaseName;
92
+ readonly round: number;
93
+ }
94
+ export interface Frame {
95
+ candidates: FrameItem[];
96
+ fields: Map<ItemId, Readonly<Record<string, readonly string[]>>>;
97
+ values: Map<SignalKey, Map<ItemId, number>>;
98
+ holds: Map<ItemId, Hold[]>;
99
+ lifted: Map<ItemId, Lift[]>;
100
+ faults: Fault[];
101
+ }
102
+ export type FrameValues = ReadonlyMap<SignalKey, ReadonlyMap<ItemId, number>>;
103
+ export interface Hold {
104
+ readonly gate: GateName;
105
+ readonly reason: string;
106
+ readonly until?: Instant;
107
+ }
108
+ export interface Lift {
109
+ readonly waiver: WaiverName;
110
+ readonly gate: GateName;
111
+ readonly reason: string;
112
+ }
113
+ export type Fault = FaultRecord;
114
+ export interface PlanContext {
115
+ now: Instant;
116
+ levers: readonly LeverRow[];
117
+ relations: readonly RelationRow[];
118
+ values: FrameValues;
119
+ }
120
+ export interface Signal<P> {
121
+ name: SignalName;
122
+ params: Schema<P>;
123
+ value: (item: ItemView, ctx: PlanContext, params: P) => number | null;
124
+ combine?: (left: number, right: number) => number;
125
+ }
126
+ export interface Gate<P> {
127
+ name: GateName;
128
+ liftable: boolean;
129
+ params: Schema<P>;
130
+ hold: (item: FrameItem, ctx: PlanContext, params: P) => Hold | null;
131
+ }
132
+ export interface Waiver {
133
+ name: WaiverName;
134
+ lifts: GateName;
135
+ lift: (item: FrameItem, hold: Hold, ctx: PlanContext) => Lift | null;
136
+ }
137
+ export interface Admission<P> {
138
+ name: AdmissionName;
139
+ params: Schema<P>;
140
+ admit: (item: FrameItem, ctx: PlanContext, params: P) => AdmissionGrant | null;
141
+ }
142
+ export interface AdmissionGrant {
143
+ readonly admission: AdmissionName;
144
+ readonly pools: readonly PoolName[] | 'any';
145
+ readonly reason: string;
146
+ }
147
+ export interface View<I = unknown, O = unknown> {
148
+ name: ViewName;
149
+ render: (frame: Frame, input: I) => O;
150
+ }
151
+ export interface PropagationLine {
152
+ readonly value: SignalName;
153
+ readonly over: RelationTypeName;
154
+ readonly toward: 'source' | 'target';
155
+ }
@@ -0,0 +1,289 @@
1
+ import type { JsonValue } from '@boxxy/content-hash';
2
+ import type { AnyNewFact, OutboxFact } from '../facts/types.ts';
3
+ import type { ItemWithLevers } from '../items/types.ts';
4
+ import type { HoldReason } from '../pipeline/types.ts';
5
+ import type { Limit, LimitFill, SeatRelease, SeatTake, Snapshot } from '../planning/types.ts';
6
+ import type { CostToLand, StageTime } from '../reports/types.ts';
7
+ import type { ItemRules } from '../rules/types.ts';
8
+ import type { AgentSessionId, AtcSessionId, AttemptId, AttemptRow, AttemptSessionRow, CallerIdentity, CommitSha, DecisionRow, Effort, EvidenceRow, FactId, Instant, ItemId, ItemRow, ItemState, ItemView, KeptSession, LeaseRow, LeverRow, LimitName, LimitSeatRow, NoteRow, NoticeRow, PhaseName, PoolName, PullRequestRef, PullRequestRow, RelationRow, RepoName, RunnerId, RunnerRow } from '../types.ts';
9
+ export interface ClaimStore {
10
+ exclusive: <T>(work: (tx: StoreTx) => Promise<T>) => Promise<T>;
11
+ read: <T>(work: (tx: StoreReader) => Promise<T>) => Promise<T>;
12
+ }
13
+ export interface StoreReader extends OutboxReader {
14
+ readSnapshot: (now: Instant, rules: ItemRules) => Promise<Snapshot>;
15
+ readItem: (id: ItemId, now: Instant, rules: ItemRules) => Promise<ItemView | null>;
16
+ readItemDetail: (id: ItemId, now: Instant, rules: ItemRules) => Promise<ItemDetailRows | null>;
17
+ listItems: (filter: ItemFilter, now: Instant, rules: ItemRules) => Promise<ItemWithLevers[]>;
18
+ listOpenIssues: (repo: RepoName, now: Instant, rules: ItemRules) => Promise<ItemView[]>;
19
+ readLastLeaseGen: (item: ItemId, phase: PhaseName) => Promise<number>;
20
+ readAttempt: (id: AttemptId) => Promise<AttemptRow | null>;
21
+ listEvidence: (attempt: AttemptId) => Promise<EvidenceRow[]>;
22
+ listItemAttempts: (item: ItemId) => Promise<AttemptRow[]>;
23
+ listLiveAttempts: () => Promise<AttemptRow[]>;
24
+ listStrayAttempts: (since: Instant) => Promise<AttemptRow[]>;
25
+ listSucceededAttemptsWithoutPullRequest: () => Promise<AttemptRow[]>;
26
+ findAttemptBySession: (session: AtcSessionId) => Promise<AttemptRow | null>;
27
+ findAttemptByAgentSession: (session: AgentSessionId) => Promise<AttemptId | null>;
28
+ findSessionByCaller: (caller: CallerIdentity) => Promise<AtcSessionId | 'ambiguous' | null>;
29
+ readPullRequestRow: (ref: PullRequestRef) => Promise<PullRequestRow | null>;
30
+ listWatchedPullRequests: () => Promise<PullRequestRow[]>;
31
+ listLimits: () => Promise<LimitFill[]>;
32
+ listLimitSeats: () => Promise<LimitSeatRow[]>;
33
+ listItemNotes: (item: ItemId) => Promise<NoteRow[]>;
34
+ listUnsentNotices: (limit: number) => Promise<NoticeRow[]>;
35
+ listKeptSessions: () => Promise<{
36
+ readonly item: ItemId;
37
+ readonly kept: KeptSession;
38
+ }[]>;
39
+ listSessionsToForget: (failedEndedBefore: Instant) => Promise<AttemptRow[]>;
40
+ readRunner: (id: RunnerId) => Promise<RunnerRow | null>;
41
+ }
42
+ export interface OutboxReader {
43
+ readUnsentFacts: (limit: number) => Promise<OutboxFact[]>;
44
+ readOutboxCounts: () => Promise<{
45
+ readonly unsent: number;
46
+ readonly parked: number;
47
+ readonly oldestUnsentAt: Instant | null;
48
+ }>;
49
+ readItemBehind: (item: ItemId) => Promise<{
50
+ readonly facts: number;
51
+ readonly oldestAt: Instant | null;
52
+ }>;
53
+ }
54
+ export interface ItemDetailRows {
55
+ readonly item: ItemWithLevers;
56
+ readonly attempts: readonly AttemptRow[];
57
+ readonly relations: readonly RelationRow[];
58
+ readonly evidence: readonly EvidenceRow[];
59
+ readonly pullRequests: readonly PullRequestRow[];
60
+ readonly notes: readonly NoteRow[];
61
+ }
62
+ export interface StoreTx extends StoreReader {
63
+ applyChange: (change: StoreChange) => Promise<ApplyResult>;
64
+ markFactsSent: (ids: readonly FactId[], at: Instant) => Promise<void>;
65
+ parkFacts: (ids: readonly FactId[], reason: string, at: Instant) => Promise<void>;
66
+ unparkFacts: () => Promise<number>;
67
+ writeHeartbeat: (runner: RunnerId, at: Instant) => Promise<void>;
68
+ syncLimits: (limits: readonly Limit[], at: Instant) => Promise<void>;
69
+ markPullRequestChecked: (ref: PullRequestRef, at: Instant) => Promise<void>;
70
+ markNoticeTried: (id: number, at: Instant, sent: boolean) => Promise<void>;
71
+ }
72
+ export interface StoreChange {
73
+ readonly at: Instant;
74
+ readonly under?: {
75
+ readonly item: ItemId;
76
+ readonly phase: PhaseName;
77
+ readonly gen: number;
78
+ readonly holdGen?: number;
79
+ } | null;
80
+ readonly writes: readonly RowWrite[];
81
+ readonly facts: readonly AnyNewFact[];
82
+ }
83
+ export type ApplyResult = {
84
+ readonly kind: 'applied';
85
+ } | {
86
+ readonly kind: 'stale-generation';
87
+ } | {
88
+ readonly kind: 'lease-held';
89
+ } | {
90
+ readonly kind: 'limit-full';
91
+ readonly limit: LimitName;
92
+ } | {
93
+ readonly kind: 'unknown-limit';
94
+ readonly limit: LimitName;
95
+ } | {
96
+ readonly kind: 'guard-mismatch';
97
+ readonly table: TableName;
98
+ readonly key: JsonValue;
99
+ };
100
+ export interface ItemFilter {
101
+ readonly state?: ItemState;
102
+ readonly repo?: RepoName;
103
+ }
104
+ export interface Tables {
105
+ items: ItemRow;
106
+ relations: RelationRow;
107
+ levers: LeverRow;
108
+ attempts: AttemptRow;
109
+ attempt_sessions: AttemptSessionRow;
110
+ leases: LeaseRow;
111
+ decisions: DecisionRow;
112
+ evidence: EvidenceRow;
113
+ pull_requests: PullRequestRow;
114
+ runners: RunnerRow;
115
+ notes: NoteRow;
116
+ notices: NoticeRow;
117
+ }
118
+ export type TableName = keyof Tables;
119
+ export type RowWrite = {
120
+ [T in TableName]: {
121
+ readonly op: 'insert';
122
+ readonly table: T;
123
+ readonly row: Tables[T];
124
+ };
125
+ }[TableName] | {
126
+ [T in TableName]: {
127
+ readonly op: 'update';
128
+ readonly table: T;
129
+ readonly key: Partial<Tables[T]>;
130
+ readonly expect: Partial<Tables[T]>;
131
+ readonly set: Partial<Tables[T]>;
132
+ };
133
+ }[TableName] | {
134
+ readonly op: 'take-seats';
135
+ readonly take: SeatTake;
136
+ } | {
137
+ readonly op: 'release-seats';
138
+ readonly release: SeatRelease;
139
+ };
140
+ export interface WorkerKind {
141
+ start: (request: SpawnRequest) => Promise<StartOutcome>;
142
+ reconcile: (attempt: AttemptRow) => Promise<SessionReading>;
143
+ suspend: (attempt: AttemptRow, ifIdleSince: Instant | null) => Promise<SuspendOutcome>;
144
+ resume: (attempt: AttemptRow) => Promise<StartOutcome>;
145
+ stop: (attempt: AttemptRow) => Promise<StopOutcome>;
146
+ forget: (session: AtcSessionId) => Promise<ForgetOutcome>;
147
+ resumeKept: (kept: KeptSession, request: SpawnRequest) => Promise<StartOutcome>;
148
+ }
149
+ export type StartOutcome = {
150
+ readonly kind: 'started';
151
+ readonly atcSession: AtcSessionId;
152
+ readonly agentSession: AgentSessionId | null;
153
+ readonly caller: CallerIdentity | null;
154
+ } | {
155
+ readonly kind: 'refused';
156
+ readonly cause: 'capacity' | 'other';
157
+ readonly reason: string;
158
+ } | {
159
+ readonly kind: 'unknown';
160
+ readonly reason: string;
161
+ };
162
+ export type SuspendOutcome = {
163
+ readonly kind: 'suspended';
164
+ } | {
165
+ readonly kind: 'active';
166
+ } | {
167
+ readonly kind: 'refused' | 'unknown';
168
+ readonly reason: string;
169
+ };
170
+ export type StopOutcome = {
171
+ readonly kind: 'stopped' | 'absent';
172
+ } | {
173
+ readonly kind: 'refused' | 'unknown';
174
+ readonly reason: string;
175
+ };
176
+ export type ForgetOutcome = {
177
+ readonly kind: 'forgotten' | 'absent';
178
+ } | {
179
+ readonly kind: 'refused' | 'unknown';
180
+ readonly reason: string;
181
+ };
182
+ export type SessionReading = {
183
+ readonly kind: 'running';
184
+ readonly atcSession: AtcSessionId;
185
+ readonly agentSession: AgentSessionId | null;
186
+ readonly caller: CallerIdentity | null;
187
+ readonly attention: Attention;
188
+ readonly lastActivityAt: Instant;
189
+ readonly lastOwnerAt: Instant;
190
+ readonly usageLimitResetsAt: Instant | null;
191
+ } | {
192
+ readonly kind: 'suspended';
193
+ readonly atcSession: AtcSessionId;
194
+ readonly agentSession: AgentSessionId | null;
195
+ readonly asked: boolean;
196
+ } | {
197
+ readonly kind: 'ended';
198
+ readonly atcSession: AtcSessionId;
199
+ readonly agentSession: AgentSessionId | null;
200
+ } | {
201
+ readonly kind: 'absent';
202
+ };
203
+ export type Attention = 'working' | 'needs-input' | 'turn-ended';
204
+ export interface SpawnRequest {
205
+ readonly target: string;
206
+ readonly cwd: string;
207
+ readonly prompt: string;
208
+ readonly agent: string;
209
+ readonly model: string;
210
+ readonly effort: Effort;
211
+ readonly name: `boxxy/${string}`;
212
+ readonly idempotencyKey: AttemptId;
213
+ }
214
+ export type WakeSource = 'command' | 'session-ran' | 'host-slept-unasked';
215
+ export interface Notifier {
216
+ tellHold: (notice: HoldNotice) => Promise<NoticeOutcome>;
217
+ }
218
+ export interface HoldNotice {
219
+ readonly item: ItemId;
220
+ readonly reason: HoldReason;
221
+ readonly at: Instant;
222
+ }
223
+ export type NoticeOutcome = {
224
+ readonly kind: 'sent';
225
+ } | {
226
+ readonly kind: 'failed';
227
+ readonly reason: string;
228
+ };
229
+ export interface CallerProof {
230
+ prove: (request: Request) => Promise<CallerIdentity | null>;
231
+ }
232
+ export interface CapacityBackoff {
233
+ hold: (pool: PoolName, until: Instant) => void;
234
+ listHeld: (now: Instant) => readonly PoolName[];
235
+ }
236
+ export interface SessionFault {
237
+ readonly kind: 'fault';
238
+ readonly fault: 'agent-session-owned';
239
+ readonly agentSession: AgentSessionId;
240
+ readonly attempt: AttemptId;
241
+ readonly holder: AttemptId;
242
+ }
243
+ export type SinkAnswer = {
244
+ readonly kind: 'stored';
245
+ } | {
246
+ readonly kind: 'retry';
247
+ readonly reason: string;
248
+ } | {
249
+ readonly kind: 'refused-batch';
250
+ readonly status: 400 | 413 | 422;
251
+ readonly reason: string;
252
+ } | {
253
+ readonly kind: 'refused-sink';
254
+ readonly status: number;
255
+ readonly reason: string;
256
+ };
257
+ export interface FactSink {
258
+ send: (facts: readonly OutboxFact[]) => Promise<SinkAnswer>;
259
+ }
260
+ export interface PepysReader {
261
+ readCostToLand: (item: ItemId) => Promise<PepysAnswer<CostToLand>>;
262
+ readStageTime: (item: ItemId) => Promise<PepysAnswer<StageTime>>;
263
+ }
264
+ export type PepysAnswer<Value> = {
265
+ readonly kind: 'value';
266
+ readonly value: Value;
267
+ } | {
268
+ readonly kind: 'unavailable';
269
+ readonly reason: string;
270
+ };
271
+ export interface Forge {
272
+ readPullRequest: (ref: PullRequestRef) => Promise<PullRequestReading | 'not-found'>;
273
+ listOpenPullRequests: (repo: RepoName) => Promise<PullRequestRef[]>;
274
+ }
275
+ export interface PullRequestReading {
276
+ readonly url: string;
277
+ readonly githubId: number;
278
+ readonly state: 'open' | 'closed' | 'merged';
279
+ readonly mergedAt: Instant | null;
280
+ readonly mergeCommit: CommitSha | null;
281
+ readonly commits: readonly {
282
+ readonly sha: CommitSha;
283
+ readonly message: string;
284
+ }[];
285
+ }
286
+ export interface Clock {
287
+ now: () => Instant;
288
+ }
289
+ export type NewId = () => string;
@@ -0,0 +1,3 @@
1
+ export declare const phaseSteps: readonly ['triage', 'design', 'build', 'review'];
2
+ export declare const stageSteps: readonly ["triage", "design", "build", "review", "merge", "release", "deploy"];
3
+ export declare const costBases: readonly ['reported', 'turn', 'none'];
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ export declare const costToLandSchema: z.ZodObject<{
3
+ item: z.ZodString;
4
+ landedAt: z.ZodNullable<z.ZodString>;
5
+ attempts: z.ZodNumber;
6
+ lines: z.ZodArray<z.ZodObject<{
7
+ phase: z.ZodString;
8
+ rework: z.ZodBoolean;
9
+ product: z.ZodString;
10
+ model: z.ZodNullable<z.ZodString>;
11
+ requests: z.ZodNumber;
12
+ inputTokens: z.ZodNumber;
13
+ cacheReadTokens: z.ZodNumber;
14
+ cacheCreationTokens: z.ZodNumber;
15
+ outputTokens: z.ZodNumber;
16
+ costUSD: z.ZodNullable<z.ZodNumber>;
17
+ costBasis: z.ZodEnum<{
18
+ none: "none";
19
+ reported: "reported";
20
+ turn: "turn";
21
+ }>;
22
+ }, z.core.$strip>>;
23
+ totals: z.ZodObject<{
24
+ requests: z.ZodNumber;
25
+ costUSD: z.ZodNumber;
26
+ reworkCostUSD: z.ZodNumber;
27
+ requestsWithoutCost: z.ZodNumber;
28
+ }, z.core.$strip>;
29
+ }, z.core.$strip>;
@@ -0,0 +1,16 @@
1
+ export interface OutboxStatus {
2
+ sink: 'pepys' | 'none';
3
+ state: 'idle' | 'sending' | 'backing-off' | 'blocked' | 'off';
4
+ unsent: number;
5
+ parked: number;
6
+ lag: number | null;
7
+ failingSince: number | null;
8
+ nextTryAt: number | null;
9
+ lastError: {
10
+ kind: 'retry' | 'refused-batch' | 'refused-sink';
11
+ status: number | null;
12
+ message: string;
13
+ at: number;
14
+ } | null;
15
+ lastStoredAt: number | null;
16
+ }
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ export declare const stageTimeSchema: z.ZodObject<{
3
+ item: z.ZodString;
4
+ environment: z.ZodString;
5
+ steps: z.ZodArray<z.ZodObject<{
6
+ step: z.ZodEnum<{
7
+ build: "build";
8
+ deploy: "deploy";
9
+ design: "design";
10
+ merge: "merge";
11
+ release: "release";
12
+ review: "review";
13
+ triage: "triage";
14
+ }>;
15
+ minutes: z.ZodNullable<z.ZodNumber>;
16
+ endedAt: z.ZodNullable<z.ZodString>;
17
+ }, z.core.$strip>>;
18
+ rework: z.ZodObject<{
19
+ count: z.ZodNumber;
20
+ minutes: z.ZodNumber;
21
+ }, z.core.$strip>;
22
+ reviewWaitMinutes: z.ZodNullable<z.ZodNumber>;
23
+ sleepMinutes: z.ZodNumber;
24
+ pullRequests: z.ZodArray<z.ZodString>;
25
+ }, z.core.$strip>;
@@ -0,0 +1,5 @@
1
+ import type { z } from 'zod';
2
+ import type { costToLandSchema } from './cost-to-land-schema.ts';
3
+ import type { stageTimeSchema } from './stage-time-schema.ts';
4
+ export type CostToLand = z.output<typeof costToLandSchema>;
5
+ export type StageTime = z.output<typeof stageTimeSchema>;
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const actorRefSchema: z.ZodUnion<readonly [z.ZodLiteral<"boxxy:owner:local">, z.ZodTemplateLiteral<`boxxy:runner:${string}`>, z.ZodTemplateLiteral<`boxxy:attempt:${string}`>, z.ZodTemplateLiteral<`boxxy:hook:${string}`>]>;
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ import type { AttemptRow } from '../types.ts';
3
+ export declare const attemptRowSchema: z.ZodType<AttemptRow>;
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ import type { AttemptSessionRow } from '../types.ts';
3
+ export declare const attemptSessionRowSchema: z.ZodType<AttemptSessionRow>;
@@ -4,7 +4,7 @@ export declare const brandSchemas: {
4
4
  itemId: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
5
5
  attemptId: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
6
6
  decisionId: z.core.$ZodBranded<z.ZodString, "DecisionId", "out">;
7
- factId: z.core.$ZodBranded<z.ZodTemplateLiteral<`manual:${string}`>, "FactId", "out">;
7
+ factId: z.core.$ZodBranded<z.ZodString, "FactId", "out">;
8
8
  runnerId: z.core.$ZodBranded<z.ZodString, "RunnerId", "out">;
9
9
  atcSessionId: z.core.$ZodBranded<z.ZodString, "AtcSessionId", "out">;
10
10
  agentSessionId: z.core.$ZodBranded<z.ZodString, "AgentSessionId", "out">;
@@ -12,10 +12,13 @@ export declare const brandSchemas: {
12
12
  repoName: z.core.$ZodBranded<z.ZodString, "RepoName", "out">;
13
13
  criterionId: z.core.$ZodBranded<z.ZodString, "CriterionId", "out">;
14
14
  itemKindName: z.core.$ZodBranded<z.ZodString, "ItemKindName", "out">;
15
- linkTypeName: z.core.$ZodBranded<z.ZodString, "LinkTypeName", "out">;
15
+ relationTypeName: z.core.$ZodBranded<z.ZodString, "RelationTypeName", "out">;
16
16
  phaseName: z.core.$ZodBranded<z.ZodString, "PhaseName", "out">;
17
17
  pipelineName: z.core.$ZodBranded<z.ZodString, "PipelineName", "out">;
18
18
  poolName: z.core.$ZodBranded<z.ZodString, "PoolName", "out">;
19
+ limitName: z.core.$ZodBranded<z.ZodString, "LimitName", "out">;
20
+ outcomeName: z.core.$ZodBranded<z.ZodString, "OutcomeName", "out">;
21
+ rulesHoldReason: z.core.$ZodBranded<z.ZodString, "RulesHoldReason", "out">;
19
22
  recipeName: z.core.$ZodBranded<z.ZodString, "RecipeName", "out">;
20
23
  workerKindName: z.core.$ZodBranded<z.ZodString, "WorkerKindName", "out">;
21
24
  sourceName: z.core.$ZodBranded<z.ZodString, "SourceName", "out">;
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ import type { CallerIdentity } from '../types.ts';
3
+ export declare const callerIdentitySchema: z.ZodType<CallerIdentity>;
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ import type { Criterion } from '../types.ts';
3
+ export declare const criterionSchema: z.ZodType<Criterion>;
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ export declare const decisionRowSchema: z.ZodObject<{
3
+ id: z.core.$ZodBranded<z.ZodString, "DecisionId", "out">;
4
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
5
+ item: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
6
+ kind: z.ZodEnum<{
7
+ start: "start";
8
+ wake: "wake";
9
+ }>;
10
+ pool: z.core.$ZodBranded<z.ZodString, "PoolName", "out">;
11
+ rulesVersion: z.core.$ZodBranded<z.core.$ZodBranded<z.ZodString, "ContentHash", "out">, "RulesVersion", "out">;
12
+ snapshotHash: z.core.$ZodBranded<z.core.$ZodBranded<z.ZodString, "ContentHash", "out">, "SnapshotHash", "out">;
13
+ storeVersion: z.ZodNumber;
14
+ pepysOffsets: z.ZodRecord<z.core.$ZodBranded<z.ZodString, "StreamName", "out">, z.ZodNumber>;
15
+ faults: z.ZodArray<z.ZodObject<{
16
+ plugin: z.ZodString;
17
+ kind: z.ZodEnum<{
18
+ admission: "admission";
19
+ "filter-field": "filter-field";
20
+ gate: "gate";
21
+ propagation: "propagation";
22
+ signal: "signal";
23
+ waiver: "waiver";
24
+ }>;
25
+ item: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "ItemId", "out">>;
26
+ error: z.ZodString;
27
+ }, z.core.$strip>>;
28
+ limits: z.ZodArray<z.ZodObject<{
29
+ limit: z.core.$ZodBranded<z.ZodString, "LimitName", "out">;
30
+ held: z.ZodNumber;
31
+ max: z.ZodNumber;
32
+ }, z.core.$strip>>;
33
+ at: z.core.$ZodBranded<z.ZodNumber, "Instant", "out">;
34
+ }, z.core.$strip>;
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ import type { EvidenceRow } from '../types.ts';
3
+ export declare const evidenceRowSchema: z.ZodType<EvidenceRow>;
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ export declare const itemRowSchema: z.ZodObject<{
3
+ id: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
4
+ kind: z.core.$ZodBranded<z.ZodString, "ItemKindName", "out">;
5
+ repo: z.core.$ZodBranded<z.ZodString, "RepoName", "out">;
6
+ title: z.ZodString;
7
+ outcome: z.ZodString;
8
+ acceptance: z.ZodArray<z.ZodType<import("../types.ts").Criterion, unknown, z.core.$ZodTypeInternals<import("../types.ts").Criterion, unknown>>>;
9
+ fields: z.ZodObject<{
10
+ designMode: z.ZodExactOptional<z.ZodEnum<{
11
+ agent: "agent";
12
+ attended: "attended";
13
+ }>>;
14
+ }, z.core.$strip>;
15
+ labels: z.ZodArray<z.ZodString>;
16
+ foundInAttempt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "AttemptId", "out">>;
17
+ filedBy: z.ZodUnion<readonly [z.ZodLiteral<"boxxy:owner:local">, z.ZodTemplateLiteral<`boxxy:runner:${string}`>, z.ZodTemplateLiteral<`boxxy:attempt:${string}`>, z.ZodTemplateLiteral<`boxxy:hook:${string}`>]>;
18
+ filedAt: z.core.$ZodBranded<z.ZodNumber, "Instant", "out">;
19
+ closedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodNumber, "Instant", "out">>;
20
+ closeReason: z.ZodNullable<z.ZodString>;
21
+ keptSession: z.ZodNullable<z.ZodObject<{
22
+ atcSession: z.core.$ZodBranded<z.ZodString, "AtcSessionId", "out">;
23
+ target: z.ZodString;
24
+ attempt: z.core.$ZodBranded<z.ZodString, "AttemptId", "out">;
25
+ keptAt: z.core.$ZodBranded<z.ZodNumber, "Instant", "out">;
26
+ caller: z.ZodNullable<z.ZodType<import("../types.ts").CallerIdentity, unknown, z.core.$ZodTypeInternals<import("../types.ts").CallerIdentity, unknown>>>;
27
+ }, z.core.$strip>>;
28
+ }, z.core.$strip>;
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ import type { ItemView } from '../types.ts';
3
+ export declare const itemViewSchema: z.ZodType<ItemView>;
@@ -0,0 +1,3 @@
1
+ import { z } from 'zod';
2
+ import type { LeaseRow } from '../types.ts';
3
+ export declare const leaseRowSchema: z.ZodType<LeaseRow>;
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ export declare const leverRowSchema: z.ZodObject<{
3
+ seq: z.ZodNumber;
4
+ kind: z.ZodTemplateLiteral<`${string}.${string}`>;
5
+ item: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
6
+ until: z.ZodNullable<z.core.$ZodBranded<z.ZodNumber, "Instant", "out">>;
7
+ expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodNumber, "Instant", "out">>;
8
+ reason: z.ZodNullable<z.ZodString>;
9
+ phase: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "PhaseName", "out">>;
10
+ actor: z.ZodUnion<readonly [z.ZodLiteral<"boxxy:owner:local">, z.ZodTemplateLiteral<`boxxy:runner:${string}`>, z.ZodTemplateLiteral<`boxxy:attempt:${string}`>, z.ZodTemplateLiteral<`boxxy:hook:${string}`>]>;
11
+ at: z.core.$ZodBranded<z.ZodNumber, "Instant", "out">;
12
+ }, z.core.$strip>;