@cat-factory/contracts 0.6.0

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 (166) hide show
  1. package/LICENSE +21 -0
  2. package/dist/accounts.d.ts +103 -0
  3. package/dist/accounts.d.ts.map +1 -0
  4. package/dist/accounts.js +102 -0
  5. package/dist/accounts.js.map +1 -0
  6. package/dist/agent-config.d.ts +77 -0
  7. package/dist/agent-config.d.ts.map +1 -0
  8. package/dist/agent-config.js +78 -0
  9. package/dist/agent-config.js.map +1 -0
  10. package/dist/api-keys.d.ts +44 -0
  11. package/dist/api-keys.d.ts.map +1 -0
  12. package/dist/api-keys.js +49 -0
  13. package/dist/api-keys.js.map +1 -0
  14. package/dist/auth.d.ts +24 -0
  15. package/dist/auth.d.ts.map +1 -0
  16. package/dist/auth.js +15 -0
  17. package/dist/auth.js.map +1 -0
  18. package/dist/board-scan.d.ts +89 -0
  19. package/dist/board-scan.d.ts.map +1 -0
  20. package/dist/board-scan.js +122 -0
  21. package/dist/board-scan.js.map +1 -0
  22. package/dist/bootstrap.d.ts +168 -0
  23. package/dist/bootstrap.d.ts.map +1 -0
  24. package/dist/bootstrap.js +148 -0
  25. package/dist/bootstrap.js.map +1 -0
  26. package/dist/clarity.d.ts +75 -0
  27. package/dist/clarity.d.ts.map +1 -0
  28. package/dist/clarity.js +66 -0
  29. package/dist/clarity.js.map +1 -0
  30. package/dist/companion.d.ts +32 -0
  31. package/dist/companion.d.ts.map +1 -0
  32. package/dist/companion.js +43 -0
  33. package/dist/companion.js.map +1 -0
  34. package/dist/consensus.d.ts +195 -0
  35. package/dist/consensus.d.ts.map +1 -0
  36. package/dist/consensus.js +164 -0
  37. package/dist/consensus.js.map +1 -0
  38. package/dist/documents.d.ts +197 -0
  39. package/dist/documents.d.ts.map +1 -0
  40. package/dist/documents.js +161 -0
  41. package/dist/documents.js.map +1 -0
  42. package/dist/entities.d.ts +1691 -0
  43. package/dist/entities.d.ts.map +1 -0
  44. package/dist/entities.js +853 -0
  45. package/dist/entities.js.map +1 -0
  46. package/dist/environments.d.ts +426 -0
  47. package/dist/environments.d.ts.map +1 -0
  48. package/dist/environments.js +190 -0
  49. package/dist/environments.js.map +1 -0
  50. package/dist/events.d.ts +98 -0
  51. package/dist/events.d.ts.map +1 -0
  52. package/dist/events.js +2 -0
  53. package/dist/events.js.map +1 -0
  54. package/dist/fragment-library.d.ts +123 -0
  55. package/dist/fragment-library.d.ts.map +1 -0
  56. package/dist/fragment-library.js +88 -0
  57. package/dist/fragment-library.js.map +1 -0
  58. package/dist/github.d.ts +215 -0
  59. package/dist/github.d.ts.map +1 -0
  60. package/dist/github.js +204 -0
  61. package/dist/github.js.map +1 -0
  62. package/dist/index.d.ts +41 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +41 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/iteration-cap.d.ts +17 -0
  67. package/dist/iteration-cap.d.ts.map +1 -0
  68. package/dist/iteration-cap.js +25 -0
  69. package/dist/iteration-cap.js.map +1 -0
  70. package/dist/localModels.d.ts +54 -0
  71. package/dist/localModels.d.ts.map +1 -0
  72. package/dist/localModels.js +79 -0
  73. package/dist/localModels.js.map +1 -0
  74. package/dist/merge.d.ts +106 -0
  75. package/dist/merge.d.ts.map +1 -0
  76. package/dist/merge.js +129 -0
  77. package/dist/merge.js.map +1 -0
  78. package/dist/model-defaults.d.ts +23 -0
  79. package/dist/model-defaults.d.ts.map +1 -0
  80. package/dist/model-defaults.js +34 -0
  81. package/dist/model-defaults.js.map +1 -0
  82. package/dist/notifications.d.ts +136 -0
  83. package/dist/notifications.d.ts.map +1 -0
  84. package/dist/notifications.js +125 -0
  85. package/dist/notifications.js.map +1 -0
  86. package/dist/observability.d.ts +271 -0
  87. package/dist/observability.d.ts.map +1 -0
  88. package/dist/observability.js +152 -0
  89. package/dist/observability.js.map +1 -0
  90. package/dist/personal-subscriptions.d.ts +66 -0
  91. package/dist/personal-subscriptions.d.ts.map +1 -0
  92. package/dist/personal-subscriptions.js +70 -0
  93. package/dist/personal-subscriptions.js.map +1 -0
  94. package/dist/primitives.d.ts +57 -0
  95. package/dist/primitives.d.ts.map +1 -0
  96. package/dist/primitives.js +66 -0
  97. package/dist/primitives.js.map +1 -0
  98. package/dist/provisioning.d.ts +46 -0
  99. package/dist/provisioning.d.ts.map +1 -0
  100. package/dist/provisioning.js +107 -0
  101. package/dist/provisioning.js.map +1 -0
  102. package/dist/recurring.d.ts +117 -0
  103. package/dist/recurring.d.ts.map +1 -0
  104. package/dist/recurring.js +99 -0
  105. package/dist/recurring.js.map +1 -0
  106. package/dist/release.d.ts +60 -0
  107. package/dist/release.d.ts.map +1 -0
  108. package/dist/release.js +75 -0
  109. package/dist/release.js.map +1 -0
  110. package/dist/requests.d.ts +451 -0
  111. package/dist/requests.d.ts.map +1 -0
  112. package/dist/requests.js +231 -0
  113. package/dist/requests.js.map +1 -0
  114. package/dist/requirements.d.ts +127 -0
  115. package/dist/requirements.d.ts.map +1 -0
  116. package/dist/requirements.js +137 -0
  117. package/dist/requirements.js.map +1 -0
  118. package/dist/runners.d.ts +387 -0
  119. package/dist/runners.d.ts.map +1 -0
  120. package/dist/runners.js +117 -0
  121. package/dist/runners.js.map +1 -0
  122. package/dist/sandbox.d.ts +300 -0
  123. package/dist/sandbox.d.ts.map +1 -0
  124. package/dist/sandbox.js +243 -0
  125. package/dist/sandbox.js.map +1 -0
  126. package/dist/service-fragment-defaults.d.ts +16 -0
  127. package/dist/service-fragment-defaults.d.ts.map +1 -0
  128. package/dist/service-fragment-defaults.js +23 -0
  129. package/dist/service-fragment-defaults.js.map +1 -0
  130. package/dist/services.d.ts +81 -0
  131. package/dist/services.d.ts.map +1 -0
  132. package/dist/services.js +77 -0
  133. package/dist/services.js.map +1 -0
  134. package/dist/slack.d.ts +104 -0
  135. package/dist/slack.d.ts.map +1 -0
  136. package/dist/slack.js +98 -0
  137. package/dist/slack.js.map +1 -0
  138. package/dist/snapshot.d.ts +522 -0
  139. package/dist/snapshot.d.ts.map +1 -0
  140. package/dist/snapshot.js +104 -0
  141. package/dist/snapshot.js.map +1 -0
  142. package/dist/spec.d.ts +174 -0
  143. package/dist/spec.d.ts.map +1 -0
  144. package/dist/spec.js +173 -0
  145. package/dist/spec.js.map +1 -0
  146. package/dist/tasks.d.ts +150 -0
  147. package/dist/tasks.d.ts.map +1 -0
  148. package/dist/tasks.js +146 -0
  149. package/dist/tasks.js.map +1 -0
  150. package/dist/testing.d.ts +67 -0
  151. package/dist/testing.d.ts.map +1 -0
  152. package/dist/testing.js +64 -0
  153. package/dist/testing.js.map +1 -0
  154. package/dist/tracker.d.ts +18 -0
  155. package/dist/tracker.d.ts.map +1 -0
  156. package/dist/tracker.js +24 -0
  157. package/dist/tracker.js.map +1 -0
  158. package/dist/vendor-credentials.d.ts +37 -0
  159. package/dist/vendor-credentials.d.ts.map +1 -0
  160. package/dist/vendor-credentials.js +40 -0
  161. package/dist/vendor-credentials.js.map +1 -0
  162. package/dist/workspace-settings.d.ts +36 -0
  163. package/dist/workspace-settings.d.ts.map +1 -0
  164. package/dist/workspace-settings.js +41 -0
  165. package/dist/workspace-settings.js.map +1 -0
  166. package/package.json +31 -0
@@ -0,0 +1,231 @@
1
+ import * as v from 'valibot';
2
+ import { agentConfigValuesSchema } from './agent-config.js';
3
+ import { consensusStepConfigSchema, stepGatingSchema } from './consensus.js';
4
+ import { cloudProviderSchema, instanceSizeSchema } from './provisioning.js';
5
+ import { agentKindSchema, blockTypeSchema, createTaskTypeSchema, positionSchema, sizeSchema, taskTypeFieldsSchema, } from './primitives.js';
6
+ // Request body schemas. The Hono facade validates inbound JSON against these via
7
+ // @hono/valibot-validator; the frontend API client can import the inferred input
8
+ // types to stay in lockstep with what the backend accepts.
9
+ export const createWorkspaceSchema = v.object({
10
+ name: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(120))),
11
+ /** Optional free-text description shown on the board switcher / onboarding list. */
12
+ description: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(500))),
13
+ /**
14
+ * Seed the board with the sample architecture *blocks* (default true; the SPA
15
+ * passes false so real boards start empty). The pipeline catalog is always
16
+ * provisioned regardless — it is product config, not sample data.
17
+ */
18
+ seed: v.optional(v.boolean()),
19
+ /**
20
+ * The account the new board belongs to. Optional: when omitted (or in the
21
+ * auth-disabled path) the board is created in the caller's personal account, or
22
+ * unscoped when there is no signed-in user.
23
+ */
24
+ accountId: v.optional(v.pipe(v.string(), v.minLength(1))),
25
+ });
26
+ /** Rename a board and/or update its description. */
27
+ export const renameWorkspaceSchema = v.object({
28
+ name: v.optional(v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(120))),
29
+ /** `null` clears the description; an absent key leaves it unchanged. */
30
+ description: v.optional(v.nullable(v.pipe(v.string(), v.trim(), v.maxLength(500)))),
31
+ });
32
+ export const addFrameSchema = v.object({
33
+ type: blockTypeSchema,
34
+ position: positionSchema,
35
+ });
36
+ /**
37
+ * Add a service frame backed by an EXISTING GitHub repo the App can access.
38
+ * Unlike bootstrap there is no container / agent run: the backend links + syncs
39
+ * the repo into the workspace (if it wasn't already tracked), creates the frame
40
+ * `ready`, and links the repo projection to it. `position` is optional — the
41
+ * backend lays the frame out when omitted (the side-panel button passes none).
42
+ */
43
+ export const addServiceFromRepoSchema = v.object({
44
+ repoGithubId: v.number(),
45
+ position: v.optional(positionSchema),
46
+ /**
47
+ * For a monorepo repo, the subdirectory (relative to the repo root) this service
48
+ * lives in, e.g. `packages/api`. Omitted/empty for a whole-repo service. The
49
+ * frame is titled after the directory's base name when given.
50
+ */
51
+ directory: v.optional(v.string()),
52
+ /**
53
+ * Whether the backing repo is a monorepo (hosts several services). Sent as part of
54
+ * the add request instead of a separate up-front PATCH; when provided the backend
55
+ * persists the repo's monorepo flag, then requires a {@link directory}. A monorepo
56
+ * repo can back several service frames, each pinned to its own subdirectory.
57
+ */
58
+ isMonorepo: v.optional(v.boolean()),
59
+ });
60
+ export const addTaskSchema = v.object({
61
+ // The user always names the task — no auto-generated placeholder titles.
62
+ title: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(200)),
63
+ description: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(2000))),
64
+ // The kind of work this task represents; omitted → 'feature'. `recurring` is NOT
65
+ // allowed here (recurring tasks are created via a recurring-pipeline schedule).
66
+ taskType: v.optional(createTaskTypeSchema),
67
+ // Small per-type fields collected on the form (e.g. a bug's severity / repro).
68
+ taskTypeFields: v.optional(taskTypeFieldsSchema),
69
+ // The merge threshold preset governing this task's auto-merge; omitted/empty →
70
+ // the workspace default preset.
71
+ mergePresetId: v.optional(v.pipe(v.string(), v.maxLength(120))),
72
+ // The pipeline the task's Run controls default to; omitted/empty → none recorded.
73
+ pipelineId: v.optional(v.pipe(v.string(), v.maxLength(120))),
74
+ // Task-level agent-contributed config values (e.g. the Tester's environment).
75
+ agentConfig: v.optional(agentConfigValuesSchema),
76
+ });
77
+ export const addModuleSchema = v.object({
78
+ name: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(120)),
79
+ position: v.optional(positionSchema),
80
+ });
81
+ export const updateBlockSchema = v.partial(v.object({
82
+ title: v.pipe(v.string(), v.trim(), v.maxLength(200)),
83
+ description: v.pipe(v.string(), v.maxLength(2000)),
84
+ position: positionSchema,
85
+ // The dragged frame size (service frames are resizable by their borders).
86
+ size: sizeSchema,
87
+ moduleName: v.pipe(v.string(), v.trim(), v.maxLength(120)),
88
+ fragmentIds: v.array(v.pipe(v.string(), v.maxLength(120))),
89
+ // Service-level (frame): the service's selected best-practice fragment ids (folded
90
+ // into code-aware agents on its tasks); an empty array clears the selection.
91
+ serviceFragmentIds: v.array(v.pipe(v.string(), v.maxLength(120))),
92
+ // The selected model's catalog id; an empty string resets to the default.
93
+ modelId: v.pipe(v.string(), v.maxLength(120)),
94
+ // The merge threshold preset id; an empty string resets to the workspace default.
95
+ mergePresetId: v.pipe(v.string(), v.maxLength(120)),
96
+ // The task's default pipeline id; an empty string clears the selection.
97
+ pipelineId: v.pipe(v.string(), v.maxLength(120)),
98
+ // Task-level agent-contributed config values (id→value map; replaces the map).
99
+ agentConfig: agentConfigValuesSchema,
100
+ // Service-level (frame): docker-compose path for the Tester's local infra; an
101
+ // empty string clears it.
102
+ testComposePath: v.pipe(v.string(), v.maxLength(400)),
103
+ // Service-level (frame): the service has no infra dependencies to stand up.
104
+ noInfraDependencies: v.boolean(),
105
+ // Service-level (frame): the cloud provider this service's jobs run on.
106
+ cloudProvider: cloudProviderSchema,
107
+ // Service-level (frame): the abstract instance size for this service's jobs.
108
+ instanceSize: instanceSizeSchema,
109
+ }));
110
+ export const moveBlockSchema = v.object({ position: positionSchema });
111
+ export const reparentSchema = v.object({
112
+ parentId: v.pipe(v.string(), v.minLength(1)),
113
+ position: positionSchema,
114
+ });
115
+ export const toggleDependencySchema = v.object({
116
+ sourceId: v.pipe(v.string(), v.minLength(1)),
117
+ });
118
+ export const createPipelineSchema = v.object({
119
+ name: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(120)),
120
+ agentKinds: v.pipe(v.array(agentKindSchema), v.minLength(1)),
121
+ /**
122
+ * Per-step human approval gates, parallel to {@link agentKinds}. Optional;
123
+ * omitted means no gates (the pipeline runs straight through).
124
+ */
125
+ gates: v.optional(v.array(v.boolean())),
126
+ /**
127
+ * Per-step companion quality thresholds (0..1), parallel to {@link agentKinds}.
128
+ * Only meaningful on companion steps; `null`/omitted means "use the companion's
129
+ * default threshold". Optional.
130
+ */
131
+ thresholds: v.optional(v.array(v.nullable(v.pipe(v.number(), v.minValue(0), v.maxValue(1))))),
132
+ /**
133
+ * Per-step enable flags, parallel to {@link agentKinds}. `false` keeps the step in
134
+ * the pipeline but skips it at run start. Optional; omitted means every step runs.
135
+ */
136
+ enabled: v.optional(v.array(v.boolean())),
137
+ /**
138
+ * Per-step consensus configs, parallel to {@link agentKinds}: a step whose kind carries
139
+ * a consensus capability trait may run through the multi-model consensus mechanism.
140
+ * `null`/omitted ⇒ the standard single-actor agent. Optional.
141
+ */
142
+ consensus: v.optional(v.array(v.nullable(consensusStepConfigSchema))),
143
+ /**
144
+ * Per-step estimate gating, parallel to {@link agentKinds}: an enabled entry makes the
145
+ * step run only when the task estimate meets the threshold. `null`/omitted ⇒ always run.
146
+ * A pipeline with any enabled gating requires a `task-estimator` step earlier in the
147
+ * chain or it is rejected. Optional.
148
+ */
149
+ gating: v.optional(v.array(v.nullable(stepGatingSchema))),
150
+ /** Free-form organizational labels for the library. Optional. */
151
+ labels: v.optional(v.array(v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(40)))),
152
+ });
153
+ /**
154
+ * Edit an existing (non-built-in) pipeline. Every field is optional — only the
155
+ * supplied fields change; `agentKinds` (when present) replaces the whole chain and
156
+ * re-aligns the parallel arrays. Built-in pipelines reject this (clone them first).
157
+ */
158
+ export const updatePipelineSchema = v.object({
159
+ name: v.optional(v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(120))),
160
+ agentKinds: v.optional(v.pipe(v.array(agentKindSchema), v.minLength(1))),
161
+ gates: v.optional(v.array(v.boolean())),
162
+ thresholds: v.optional(v.array(v.nullable(v.pipe(v.number(), v.minValue(0), v.maxValue(1))))),
163
+ enabled: v.optional(v.array(v.boolean())),
164
+ consensus: v.optional(v.array(v.nullable(consensusStepConfigSchema))),
165
+ gating: v.optional(v.array(v.nullable(stepGatingSchema))),
166
+ labels: v.optional(v.array(v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(40)))),
167
+ });
168
+ /** Clone any pipeline (built-in or custom) into a new, editable copy. */
169
+ export const clonePipelineSchema = v.object({
170
+ /** Name for the copy. Optional; defaults to "<source name> (copy)". */
171
+ name: v.optional(v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(120))),
172
+ });
173
+ /**
174
+ * Organize a pipeline in the library: set labels and/or archive state. The ONLY
175
+ * mutation allowed on a built-in pipeline (it touches view/organization metadata,
176
+ * not structure), so built-ins can be tagged/archived while staying read-only for
177
+ * their steps. Every field optional — only the supplied fields change.
178
+ */
179
+ export const organizePipelineSchema = v.object({
180
+ labels: v.optional(v.array(v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(40)))),
181
+ archived: v.optional(v.boolean()),
182
+ });
183
+ export const startExecutionSchema = v.object({
184
+ pipelineId: v.pipe(v.string(), v.minLength(1)),
185
+ });
186
+ // NOTE: the personal password that unlocks a run's individual-usage credential
187
+ // (Claude / GLM / Codex) is NOT a body field on any of the run endpoints below
188
+ // (start / retry / resolve-decision / approve / request-changes). It is an ambient
189
+ // credential carried on the `X-Personal-Password` header (see
190
+ // `PERSONAL_PASSWORD_HEADER` in personal-subscriptions.ts), so it stays out of the
191
+ // wire-contract payloads and the client can attach it uniformly on the gated calls.
192
+ export const resolveDecisionSchema = v.object({
193
+ choice: v.pipe(v.string(), v.minLength(1)),
194
+ });
195
+ /**
196
+ * Approve a step's gated proposal. An optional edited `proposal` overrides the
197
+ * agent's text, so the human's revision is what flows to downstream steps.
198
+ */
199
+ export const approveStepSchema = v.object({
200
+ proposal: v.optional(v.pipe(v.string(), v.maxLength(50000))),
201
+ });
202
+ /** One GitHub-review-style comment on a block of the proposal (request body). */
203
+ const reviewCommentInputSchema = v.object({
204
+ quotedSource: v.pipe(v.string(), v.maxLength(20000)),
205
+ srcStart: v.number(),
206
+ srcEnd: v.number(),
207
+ body: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(5000)),
208
+ });
209
+ /**
210
+ * Request changes on a gated proposal: the step re-runs with the reviewer's
211
+ * freeform `feedback` and/or per-block `comments`. At least one of the two must
212
+ * be present — an empty review changes nothing.
213
+ */
214
+ export const requestStepChangesSchema = v.pipe(v.object({
215
+ feedback: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(10000))),
216
+ comments: v.optional(v.array(reviewCommentInputSchema)),
217
+ }), v.check((input) => Boolean(input.feedback?.length) || Boolean(input.comments?.length), 'Provide freeform feedback or at least one comment'));
218
+ /** Reject a gated proposal: the run stops entirely (a terminal failure). */
219
+ export const rejectStepSchema = v.object({
220
+ reason: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(2000))),
221
+ });
222
+ /**
223
+ * Restart a run from a chosen step: re-run from `fromStepIndex` onward, keeping the
224
+ * earlier steps (and their outputs) as handoff context and resetting that step plus
225
+ * every later one's iteration counters. The service validates the index against the
226
+ * run's real step count; this only enforces a non-negative integer up front.
227
+ */
228
+ export const restartFromStepSchema = v.object({
229
+ fromStepIndex: v.pipe(v.number(), v.integer(), v.minValue(0)),
230
+ });
231
+ //# sourceMappingURL=requests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests.js","sourceRoot":"","sources":["../src/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,EACL,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,oBAAoB,GACrB,MAAM,iBAAiB,CAAA;AAExB,iFAAiF;AACjF,iFAAiF;AACjF,2DAA2D;AAE3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,oFAAoF;IACpF,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CA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AAC,KAAK,CAAC,CAAC,CAAC;IACtE,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;CACxD,CAAC,EACF,CAAC,CAAC,KAAK,CACL,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,EAC7E,mDAAmD,CACpD,CACF,CAAA;AAGD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;CACpE,CAAC,CAAA;AAGF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;CAC9D,CAAC,CAAA"}
@@ -0,0 +1,127 @@
1
+ import * as v from 'valibot';
2
+ /** What kind of concern a review item raises. */
3
+ export declare const reviewItemCategorySchema: v.PicklistSchema<["gap", "clarification", "assumption", "risk", "question"], undefined>;
4
+ export type ReviewItemCategory = v.InferOutput<typeof reviewItemCategorySchema>;
5
+ /** How important resolving the item is before implementation should proceed. */
6
+ export declare const reviewItemSeveritySchema: v.PicklistSchema<["low", "medium", "high"], undefined>;
7
+ export type ReviewItemSeverity = v.InferOutput<typeof reviewItemSeveritySchema>;
8
+ /**
9
+ * Lifecycle of a single item: `open` until a human engages, `answered` once a
10
+ * reply is recorded, `resolved` when accepted as done, `dismissed` when waved
11
+ * off as not applicable. Both `resolved` and `dismissed` count as "settled" for
12
+ * the purpose of gating incorporation.
13
+ */
14
+ export declare const reviewItemStatusSchema: v.PicklistSchema<["open", "answered", "resolved", "dismissed"], undefined>;
15
+ export type ReviewItemStatus = v.InferOutput<typeof reviewItemStatusSchema>;
16
+ /** A single question / challenge the reviewer raised about the requirements. */
17
+ export declare const requirementReviewItemSchema: v.ObjectSchema<{
18
+ readonly id: v.StringSchema<undefined>;
19
+ readonly category: v.PicklistSchema<["gap", "clarification", "assumption", "risk", "question"], undefined>;
20
+ readonly severity: v.PicklistSchema<["low", "medium", "high"], undefined>;
21
+ /** Short headline of the concern. */
22
+ readonly title: v.StringSchema<undefined>;
23
+ /** The full question / gap / challenge, in plain prose. */
24
+ readonly detail: v.StringSchema<undefined>;
25
+ readonly status: v.PicklistSchema<["open", "answered", "resolved", "dismissed"], undefined>;
26
+ /** The human's answer, or null while unanswered. */
27
+ readonly reply: v.NullableSchema<v.StringSchema<undefined>, undefined>;
28
+ readonly createdAt: v.NumberSchema<undefined>;
29
+ readonly updatedAt: v.NumberSchema<undefined>;
30
+ }, undefined>;
31
+ export type RequirementReviewItem = v.InferOutput<typeof requirementReviewItemSchema>;
32
+ /**
33
+ * Lifecycle of the review as a whole:
34
+ * - `ready`: the reviewer raised findings that are awaiting human answers/dismissals.
35
+ * - `incorporating`: transient. The human answered the findings and asked to incorporate;
36
+ * the durable driver is folding the answers into a document (the FIRST async stage). No
37
+ * human action is needed — the user is back on the board.
38
+ * - `reviewing`: transient. The document is folded and the reviewer is RE-reviewing it (the
39
+ * SECOND async stage). Distinguished from `incorporating` so the board/window can show
40
+ * which stage is running; the user is summoned again only if it yields `ready`/`exceeded`.
41
+ * - `merged`: the companion produced an incorporated document (an internal transient on the
42
+ * async path — the driver re-reviews it immediately; only the off-path inline incorporate
43
+ * leaves a review here momentarily).
44
+ * - `exceeded`: the iteration cap was reached with findings still open — awaiting the
45
+ * human's choice (one more round / proceed anyway / reset the task).
46
+ * - `incorporated`: terminal. The requirements phase is settled; downstream agents
47
+ * consume {@link incorporatedRequirements} when present (else the original description).
48
+ */
49
+ export declare const requirementReviewStatusSchema: v.PicklistSchema<["ready", "incorporating", "reviewing", "merged", "exceeded", "incorporated"], undefined>;
50
+ export type RequirementReviewStatus = v.InferOutput<typeof requirementReviewStatusSchema>;
51
+ /** A completed requirements review for one board block. */
52
+ export declare const requirementReviewSchema: v.ObjectSchema<{
53
+ readonly id: v.StringSchema<undefined>;
54
+ readonly blockId: v.StringSchema<undefined>;
55
+ readonly status: v.PicklistSchema<["ready", "incorporating", "reviewing", "merged", "exceeded", "incorporated"], undefined>;
56
+ readonly items: v.ArraySchema<v.ObjectSchema<{
57
+ readonly id: v.StringSchema<undefined>;
58
+ readonly category: v.PicklistSchema<["gap", "clarification", "assumption", "risk", "question"], undefined>;
59
+ readonly severity: v.PicklistSchema<["low", "medium", "high"], undefined>;
60
+ /** Short headline of the concern. */
61
+ readonly title: v.StringSchema<undefined>;
62
+ /** The full question / gap / challenge, in plain prose. */
63
+ readonly detail: v.StringSchema<undefined>;
64
+ readonly status: v.PicklistSchema<["open", "answered", "resolved", "dismissed"], undefined>;
65
+ /** The human's answer, or null while unanswered. */
66
+ readonly reply: v.NullableSchema<v.StringSchema<undefined>, undefined>;
67
+ readonly createdAt: v.NumberSchema<undefined>;
68
+ readonly updatedAt: v.NumberSchema<undefined>;
69
+ }, undefined>, undefined>;
70
+ /** `provider:model` that produced the review, for transparency; null in tests. */
71
+ readonly model: v.NullableSchema<v.StringSchema<undefined>, undefined>;
72
+ /**
73
+ * The revised requirements text the incorporation companion last folded the answers
74
+ * into. Set once a doc has been produced (status `merged`/`incorporated`); null while
75
+ * still awaiting answers on the first pass. Consumed by every downstream agent step +
76
+ * the spec-writer once the phase is settled.
77
+ */
78
+ readonly incorporatedRequirements: v.NullableSchema<v.StringSchema<undefined>, undefined>;
79
+ /**
80
+ * How many reviewer passes have run so far (the initial review is iteration 1; each
81
+ * re-review adds one). Compared against {@link maxIterations} to decide when the loop
82
+ * has exhausted its budget.
83
+ */
84
+ readonly iteration: v.OptionalSchema<v.NumberSchema<undefined>, 1>;
85
+ /**
86
+ * The reviewer-pass budget for this review, snapshotted from the task's merge preset
87
+ * (`maxRequirementIterations`) when the review started. An "extra round" choice bumps
88
+ * it by one.
89
+ */
90
+ readonly maxIterations: v.OptionalSchema<v.NumberSchema<undefined>, 1>;
91
+ readonly createdAt: v.NumberSchema<undefined>;
92
+ readonly updatedAt: v.NumberSchema<undefined>;
93
+ }, undefined>;
94
+ export type RequirementReview = v.InferOutput<typeof requirementReviewSchema>;
95
+ /** Record a human's answer to a single review item. */
96
+ export declare const replyReviewItemSchema: v.ObjectSchema<{
97
+ readonly reply: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 4000, undefined>]>;
98
+ }, undefined>;
99
+ export type ReplyReviewItemInput = v.InferOutput<typeof replyReviewItemSchema>;
100
+ /** Set a review item's status (resolve / dismiss / reopen). */
101
+ export declare const updateReviewItemStatusSchema: v.ObjectSchema<{
102
+ readonly status: v.PicklistSchema<["open", "answered", "resolved", "dismissed"], undefined>;
103
+ }, undefined>;
104
+ export type UpdateReviewItemStatusInput = v.InferOutput<typeof updateReviewItemStatusSchema>;
105
+ /**
106
+ * Incorporate the settled answers into a standardized requirements document. An optional
107
+ * `feedback` comment is the human's "do it differently" lever when redoing a merge they
108
+ * were unhappy with — it is folded into the rework prompt alongside the prior document.
109
+ */
110
+ export declare const incorporateRequirementsSchema: v.ObjectSchema<{
111
+ readonly feedback: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 4000, undefined>]>, undefined>;
112
+ }, undefined>;
113
+ export type IncorporateRequirementsInput = v.InferOutput<typeof incorporateRequirementsSchema>;
114
+ /**
115
+ * How a human resolves a requirements review that hit its iteration cap with findings
116
+ * still open: `extra-round` grants one more reviewer pass, `proceed` advances the
117
+ * pipeline using the last incorporated document, `stop-reset` cancels the run and
118
+ * returns the task to phase zero (editable) while keeping the last incorporated doc.
119
+ * Shares the {@link iterationCapChoiceSchema} with the companion gate — same three
120
+ * choices, one source of truth (see `./iteration-cap.ts`).
121
+ */
122
+ export declare const resolveRequirementsExceededSchema: v.ObjectSchema<{
123
+ readonly choice: v.PicklistSchema<["extra-round", "proceed", "stop-reset"], undefined>;
124
+ }, undefined>;
125
+ export type ResolveRequirementsExceededInput = v.InferOutput<typeof resolveRequirementsExceededSchema>;
126
+ export type ResolveRequirementsExceededChoice = ResolveRequirementsExceededInput['choice'];
127
+ //# sourceMappingURL=requirements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requirements.d.ts","sourceRoot":"","sources":["../src/requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAoB5B,iDAAiD;AACjD,eAAO,MAAM,wBAAwB,yFAMnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,wDAAwC,CAAA;AAC7E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,4EAA4D,CAAA;AAC/F,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E,gFAAgF;AAChF,eAAO,MAAM,2BAA2B;;;;IAItC,qCAAqC;;IAErC,2DAA2D;;;IAG3D,oDAAoD;;;;aAIpD,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAErF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,6BAA6B,4GAOxC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAEzF,2DAA2D;AAC3D,eAAO,MAAM,uBAAuB;;;;;;;;QAxClC,qCAAqC;;QAErC,2DAA2D;;;QAG3D,oDAAoD;;;;;IAwCpD,kFAAkF;;IAElF;;;;;OAKG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;;;aAIH,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAI7E,uDAAuD;AACvD,eAAO,MAAM,qBAAqB;;aAEhC,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAE9E,+DAA+D;AAC/D,eAAO,MAAM,4BAA4B;;aAEvC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAE5F;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;aAExC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAE9F;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC;;aAE5C,CAAA;AACF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,WAAW,CAC1D,OAAO,iCAAiC,CACzC,CAAA;AACD,MAAM,MAAM,iCAAiC,GAAG,gCAAgC,CAAC,QAAQ,CAAC,CAAA"}
@@ -0,0 +1,137 @@
1
+ import * as v from 'valibot';
2
+ import { iterationCapChoiceSchema } from './iteration-cap.js';
3
+ // ---------------------------------------------------------------------------
4
+ // Requirements-review wire contracts. A reviewer agent inspects a board block's
5
+ // "collected requirements" — its description plus any linked PRD / RFC /
6
+ // requirements documents and tracker issues — and raises a list of review items:
7
+ // gaps, ambiguities, unstated assumptions, risks and open questions, each with a
8
+ // severity. A human answers or dismisses each item; an incorporation companion
9
+ // folds the answers into one standardized requirements document, then the reviewer
10
+ // re-reviews that document. The cycle repeats until the reviewer is clean (or every
11
+ // remaining finding is dismissed / tolerated by the task's severity threshold), or
12
+ // the task's iteration cap is hit and a human picks how to proceed.
13
+ //
14
+ // On the pipeline path the run parks on the requirements step while the human drives
15
+ // these round-trips; the run only advances (converge / proceed) or resets exactly
16
+ // once. The review + its items are persisted and mutated in plain request/response
17
+ // round-trips. Storage-only bookkeeping (the owning workspace) is NOT on the wire.
18
+ // ---------------------------------------------------------------------------
19
+ /** What kind of concern a review item raises. */
20
+ export const reviewItemCategorySchema = v.picklist([
21
+ 'gap',
22
+ 'clarification',
23
+ 'assumption',
24
+ 'risk',
25
+ 'question',
26
+ ]);
27
+ /** How important resolving the item is before implementation should proceed. */
28
+ export const reviewItemSeveritySchema = v.picklist(['low', 'medium', 'high']);
29
+ /**
30
+ * Lifecycle of a single item: `open` until a human engages, `answered` once a
31
+ * reply is recorded, `resolved` when accepted as done, `dismissed` when waved
32
+ * off as not applicable. Both `resolved` and `dismissed` count as "settled" for
33
+ * the purpose of gating incorporation.
34
+ */
35
+ export const reviewItemStatusSchema = v.picklist(['open', 'answered', 'resolved', 'dismissed']);
36
+ /** A single question / challenge the reviewer raised about the requirements. */
37
+ export const requirementReviewItemSchema = v.object({
38
+ id: v.string(),
39
+ category: reviewItemCategorySchema,
40
+ severity: reviewItemSeveritySchema,
41
+ /** Short headline of the concern. */
42
+ title: v.string(),
43
+ /** The full question / gap / challenge, in plain prose. */
44
+ detail: v.string(),
45
+ status: reviewItemStatusSchema,
46
+ /** The human's answer, or null while unanswered. */
47
+ reply: v.nullable(v.string()),
48
+ createdAt: v.number(),
49
+ updatedAt: v.number(),
50
+ });
51
+ /**
52
+ * Lifecycle of the review as a whole:
53
+ * - `ready`: the reviewer raised findings that are awaiting human answers/dismissals.
54
+ * - `incorporating`: transient. The human answered the findings and asked to incorporate;
55
+ * the durable driver is folding the answers into a document (the FIRST async stage). No
56
+ * human action is needed — the user is back on the board.
57
+ * - `reviewing`: transient. The document is folded and the reviewer is RE-reviewing it (the
58
+ * SECOND async stage). Distinguished from `incorporating` so the board/window can show
59
+ * which stage is running; the user is summoned again only if it yields `ready`/`exceeded`.
60
+ * - `merged`: the companion produced an incorporated document (an internal transient on the
61
+ * async path — the driver re-reviews it immediately; only the off-path inline incorporate
62
+ * leaves a review here momentarily).
63
+ * - `exceeded`: the iteration cap was reached with findings still open — awaiting the
64
+ * human's choice (one more round / proceed anyway / reset the task).
65
+ * - `incorporated`: terminal. The requirements phase is settled; downstream agents
66
+ * consume {@link incorporatedRequirements} when present (else the original description).
67
+ */
68
+ export const requirementReviewStatusSchema = v.picklist([
69
+ 'ready',
70
+ 'incorporating',
71
+ 'reviewing',
72
+ 'merged',
73
+ 'exceeded',
74
+ 'incorporated',
75
+ ]);
76
+ /** A completed requirements review for one board block. */
77
+ export const requirementReviewSchema = v.object({
78
+ id: v.string(),
79
+ blockId: v.string(),
80
+ status: requirementReviewStatusSchema,
81
+ items: v.array(requirementReviewItemSchema),
82
+ /** `provider:model` that produced the review, for transparency; null in tests. */
83
+ model: v.nullable(v.string()),
84
+ /**
85
+ * The revised requirements text the incorporation companion last folded the answers
86
+ * into. Set once a doc has been produced (status `merged`/`incorporated`); null while
87
+ * still awaiting answers on the first pass. Consumed by every downstream agent step +
88
+ * the spec-writer once the phase is settled.
89
+ */
90
+ incorporatedRequirements: v.nullable(v.string()),
91
+ /**
92
+ * How many reviewer passes have run so far (the initial review is iteration 1; each
93
+ * re-review adds one). Compared against {@link maxIterations} to decide when the loop
94
+ * has exhausted its budget.
95
+ */
96
+ iteration: v.optional(v.number(), 1),
97
+ /**
98
+ * The reviewer-pass budget for this review, snapshotted from the task's merge preset
99
+ * (`maxRequirementIterations`) when the review started. An "extra round" choice bumps
100
+ * it by one.
101
+ */
102
+ maxIterations: v.optional(v.number(), 1),
103
+ createdAt: v.number(),
104
+ updatedAt: v.number(),
105
+ });
106
+ // ---- Request bodies -------------------------------------------------------
107
+ /** Record a human's answer to a single review item. */
108
+ export const replyReviewItemSchema = v.object({
109
+ reply: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(4000)),
110
+ });
111
+ /** Set a review item's status (resolve / dismiss / reopen). */
112
+ export const updateReviewItemStatusSchema = v.object({
113
+ status: reviewItemStatusSchema,
114
+ });
115
+ /**
116
+ * Incorporate the settled answers into a standardized requirements document. An optional
117
+ * `feedback` comment is the human's "do it differently" lever when redoing a merge they
118
+ * were unhappy with — it is folded into the rework prompt alongside the prior document.
119
+ */
120
+ export const incorporateRequirementsSchema = v.object({
121
+ feedback: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(4000))),
122
+ });
123
+ /**
124
+ * How a human resolves a requirements review that hit its iteration cap with findings
125
+ * still open: `extra-round` grants one more reviewer pass, `proceed` advances the
126
+ * pipeline using the last incorporated document, `stop-reset` cancels the run and
127
+ * returns the task to phase zero (editable) while keeping the last incorporated doc.
128
+ * Shares the {@link iterationCapChoiceSchema} with the companion gate — same three
129
+ * choices, one source of truth (see `./iteration-cap.ts`).
130
+ */
131
+ export const resolveRequirementsExceededSchema = v.object({
132
+ choice: iterationCapChoiceSchema,
133
+ });
134
+ // NOTE: the durable, in-repo PRESCRIPTIVE specification (the `spec.json` tree with its
135
+ // requirements, domain rules and acceptance criteria) lives in `./spec.ts`. This file
136
+ // is only the transient, per-block CONTEXT review of the linked-prose brief.
137
+ //# sourceMappingURL=requirements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requirements.js","sourceRoot":"","sources":["../src/requirements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,8EAA8E;AAC9E,gFAAgF;AAChF,yEAAyE;AACzE,iFAAiF;AACjF,iFAAiF;AACjF,+EAA+E;AAC/E,mF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