@cat-factory/contracts 0.343.0 → 0.345.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 (125) hide show
  1. package/dist/agent-presentation.d.ts +2 -2
  2. package/dist/bootstrap.d.ts +48 -7
  3. package/dist/bootstrap.d.ts.map +1 -1
  4. package/dist/bootstrap.js +41 -6
  5. package/dist/bootstrap.js.map +1 -1
  6. package/dist/bugFishing.d.ts +379 -0
  7. package/dist/bugFishing.d.ts.map +1 -0
  8. package/dist/bugFishing.js +412 -0
  9. package/dist/bugFishing.js.map +1 -0
  10. package/dist/deploy-fix.d.ts +53 -3
  11. package/dist/deploy-fix.d.ts.map +1 -1
  12. package/dist/deploy-fix.js +39 -2
  13. package/dist/deploy-fix.js.map +1 -1
  14. package/dist/entities.d.ts +18 -1
  15. package/dist/entities.d.ts.map +1 -1
  16. package/dist/entities.js +15 -0
  17. package/dist/entities.js.map +1 -1
  18. package/dist/environment-investigation.d.ts +55 -5
  19. package/dist/environment-investigation.d.ts.map +1 -1
  20. package/dist/environment-investigation.js +19 -2
  21. package/dist/environment-investigation.js.map +1 -1
  22. package/dist/errors.d.ts +1 -1
  23. package/dist/errors.d.ts.map +1 -1
  24. package/dist/errors.js +18 -0
  25. package/dist/errors.js.map +1 -1
  26. package/dist/execution.d.ts +104 -0
  27. package/dist/execution.d.ts.map +1 -1
  28. package/dist/execution.js +12 -0
  29. package/dist/execution.js.map +1 -1
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +1 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/initiative.d.ts +15 -5
  35. package/dist/initiative.d.ts.map +1 -1
  36. package/dist/notification-routing.d.ts +3 -3
  37. package/dist/notification-webhooks.d.ts +7 -5
  38. package/dist/notification-webhooks.d.ts.map +1 -1
  39. package/dist/notifications.d.ts +25 -3
  40. package/dist/notifications.d.ts.map +1 -1
  41. package/dist/notifications.js +17 -0
  42. package/dist/notifications.js.map +1 -1
  43. package/dist/pipeline-purpose.d.ts +4 -0
  44. package/dist/pipeline-purpose.d.ts.map +1 -1
  45. package/dist/pipeline-purpose.js +6 -0
  46. package/dist/pipeline-purpose.js.map +1 -1
  47. package/dist/pr-report.d.ts +414 -6
  48. package/dist/pr-report.d.ts.map +1 -1
  49. package/dist/pr-report.js +143 -2
  50. package/dist/pr-report.js.map +1 -1
  51. package/dist/primitives.d.ts +71 -7
  52. package/dist/primitives.d.ts.map +1 -1
  53. package/dist/primitives.js +24 -1
  54. package/dist/primitives.js.map +1 -1
  55. package/dist/public-api.d.ts +6 -4
  56. package/dist/public-api.d.ts.map +1 -1
  57. package/dist/public-provisioning.d.ts +23 -4
  58. package/dist/public-provisioning.d.ts.map +1 -1
  59. package/dist/public-provisioning.js +24 -5
  60. package/dist/public-provisioning.js.map +1 -1
  61. package/dist/public-task-types.d.ts.map +1 -1
  62. package/dist/public-task-types.js +20 -0
  63. package/dist/public-task-types.js.map +1 -1
  64. package/dist/recurring.d.ts +12 -8
  65. package/dist/recurring.d.ts.map +1 -1
  66. package/dist/recurring.js +10 -5
  67. package/dist/recurring.js.map +1 -1
  68. package/dist/requests.d.ts +47 -7
  69. package/dist/requests.d.ts.map +1 -1
  70. package/dist/result-views.d.ts +1 -1
  71. package/dist/result-views.d.ts.map +1 -1
  72. package/dist/result-views.js +1 -0
  73. package/dist/result-views.js.map +1 -1
  74. package/dist/routes/agent-runs.d.ts +86 -0
  75. package/dist/routes/agent-runs.d.ts.map +1 -1
  76. package/dist/routes/board.d.ts +99 -20
  77. package/dist/routes/board.d.ts.map +1 -1
  78. package/dist/routes/bootstrap.d.ts +6 -0
  79. package/dist/routes/bootstrap.d.ts.map +1 -1
  80. package/dist/routes/bug-hunt.d.ts +92 -2
  81. package/dist/routes/bug-hunt.d.ts.map +1 -1
  82. package/dist/routes/bugFishing.d.ts +307 -0
  83. package/dist/routes/bugFishing.d.ts.map +1 -0
  84. package/dist/routes/bugFishing.js +51 -0
  85. package/dist/routes/bugFishing.js.map +1 -0
  86. package/dist/routes/execution.d.ts +428 -2
  87. package/dist/routes/execution.d.ts.map +1 -1
  88. package/dist/routes/human-review.d.ts +42 -0
  89. package/dist/routes/human-review.d.ts.map +1 -1
  90. package/dist/routes/human-test.d.ts +210 -0
  91. package/dist/routes/human-test.d.ts.map +1 -1
  92. package/dist/routes/index.d.ts +1 -0
  93. package/dist/routes/index.d.ts.map +1 -1
  94. package/dist/routes/index.js +1 -0
  95. package/dist/routes/index.js.map +1 -1
  96. package/dist/routes/initiative.d.ts +52 -17
  97. package/dist/routes/initiative.d.ts.map +1 -1
  98. package/dist/routes/notification-webhooks.d.ts +14 -14
  99. package/dist/routes/notifications.d.ts +12 -6
  100. package/dist/routes/notifications.d.ts.map +1 -1
  101. package/dist/routes/public-api.d.ts +17 -11
  102. package/dist/routes/public-api.d.ts.map +1 -1
  103. package/dist/routes/public-board.d.ts +2 -2
  104. package/dist/routes/public-evidence.d.ts +24 -1
  105. package/dist/routes/public-evidence.d.ts.map +1 -1
  106. package/dist/routes/public-provisioning.d.ts +2 -0
  107. package/dist/routes/public-provisioning.d.ts.map +1 -1
  108. package/dist/routes/recurring.d.ts +5 -5
  109. package/dist/routes/slack.d.ts +3 -3
  110. package/dist/routes/tasks.d.ts +12 -3
  111. package/dist/routes/tasks.d.ts.map +1 -1
  112. package/dist/routes/visual-confirm.d.ts +126 -0
  113. package/dist/routes/visual-confirm.d.ts.map +1 -1
  114. package/dist/routes/workspace-settings.d.ts +6 -3
  115. package/dist/routes/workspace-settings.d.ts.map +1 -1
  116. package/dist/routes/workspaces.d.ts +122 -14
  117. package/dist/routes/workspaces.d.ts.map +1 -1
  118. package/dist/slack.d.ts +2 -2
  119. package/dist/snapshot.d.ts +61 -7
  120. package/dist/snapshot.d.ts.map +1 -1
  121. package/dist/workspace-settings.d.ts +26 -3
  122. package/dist/workspace-settings.d.ts.map +1 -1
  123. package/dist/workspace-settings.js +23 -0
  124. package/dist/workspace-settings.js.map +1 -1
  125. package/package.json +1 -1
@@ -0,0 +1,307 @@
1
+ import * as v from 'valibot';
2
+ export declare const getBugFishingContract: {
3
+ readonly method: "get";
4
+ readonly requestPathParamsSchema: v.ObjectSchema<{
5
+ executionId: v.StringSchema<undefined>;
6
+ }, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
7
+ readonly pathResolver: ({ executionId }: {
8
+ executionId: string;
9
+ }) => string;
10
+ readonly responsesByStatusCode: {
11
+ readonly '4xx': v.ObjectSchema<{
12
+ readonly error: v.ObjectSchema<{
13
+ readonly code: v.StringSchema<undefined>;
14
+ readonly message: v.StringSchema<undefined>;
15
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
16
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
17
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
18
+ readonly message: v.StringSchema<undefined>;
19
+ }, undefined>, undefined>, undefined>;
20
+ }, undefined>;
21
+ }, undefined>;
22
+ readonly '5xx': v.ObjectSchema<{
23
+ readonly error: v.ObjectSchema<{
24
+ readonly code: v.StringSchema<undefined>;
25
+ readonly message: v.StringSchema<undefined>;
26
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
27
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
28
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
29
+ readonly message: v.StringSchema<undefined>;
30
+ }, undefined>, undefined>, undefined>;
31
+ }, undefined>;
32
+ }, undefined>;
33
+ readonly 200: v.NullableSchema<v.ObjectSchema<{
34
+ readonly status: v.PicklistSchema<["fishing", "awaiting_triage", "done"], undefined>;
35
+ readonly phases: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
36
+ readonly id: v.StringSchema<undefined>;
37
+ readonly title: v.StringSchema<undefined>;
38
+ readonly goal: v.StringSchema<undefined>;
39
+ readonly status: v.PicklistSchema<["pending", "fishing", "completed", "failed"], undefined>;
40
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
41
+ readonly settledAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
42
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
43
+ }, undefined>, undefined>, readonly []>;
44
+ readonly currentPhaseIndex: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
45
+ readonly findings: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
46
+ readonly id: v.StringSchema<undefined>;
47
+ readonly phaseId: v.StringSchema<undefined>;
48
+ readonly path: v.StringSchema<undefined>;
49
+ readonly line: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
50
+ readonly severity: v.PicklistSchema<["critical", "high", "medium", "low"], undefined>;
51
+ readonly kind: v.PicklistSchema<["bug", "logic-gap", "edge-case", "footgun", "requirement-gap", "other"], undefined>;
52
+ readonly confidence: v.PicklistSchema<["high", "medium", "low"], undefined>;
53
+ readonly title: v.StringSchema<undefined>;
54
+ readonly detail: v.StringSchema<undefined>;
55
+ readonly failureScenario: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
56
+ readonly evidence: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
57
+ readonly suggestedFix: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
58
+ readonly spawn: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
59
+ readonly status: v.PicklistSchema<["pending", "spawned", "failed"], undefined>;
60
+ readonly taskId: v.StringSchema<undefined>;
61
+ readonly executionId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
62
+ readonly pipelineId: v.StringSchema<undefined>;
63
+ readonly requestedBy: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
64
+ readonly requestedAt: v.NumberSchema<undefined>;
65
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
66
+ }, undefined>, undefined>, undefined>;
67
+ readonly dismissed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
68
+ }, undefined>, undefined>, readonly []>;
69
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
70
+ readonly defaultFixPipelineId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
71
+ }, undefined>, undefined>;
72
+ };
73
+ };
74
+ /**
75
+ * Mark findings to be addressed: each spawns its own bug-fix task linked to the expedition.
76
+ *
77
+ * Deliberately accepted while the expedition is STILL FISHING later phases as well as once it
78
+ * parks: a completed phase's findings are actionable the moment they land, and making a human
79
+ * wait for the last angle is exactly the delay running the angles separately is meant to avoid.
80
+ */
81
+ export declare const addressBugFishingFindingsContract: {
82
+ readonly method: "post";
83
+ readonly requestPathParamsSchema: v.ObjectSchema<{
84
+ executionId: v.StringSchema<undefined>;
85
+ }, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
86
+ readonly pathResolver: ({ executionId }: {
87
+ executionId: string;
88
+ }) => string;
89
+ readonly requestBodySchema: v.ObjectSchema<{
90
+ readonly findingIds: v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
91
+ readonly pipelineId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
92
+ }, undefined>;
93
+ readonly responsesByStatusCode: {
94
+ readonly '4xx': v.ObjectSchema<{
95
+ readonly error: v.ObjectSchema<{
96
+ readonly code: v.StringSchema<undefined>;
97
+ readonly message: v.StringSchema<undefined>;
98
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
99
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
100
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
101
+ readonly message: v.StringSchema<undefined>;
102
+ }, undefined>, undefined>, undefined>;
103
+ }, undefined>;
104
+ }, undefined>;
105
+ readonly '5xx': v.ObjectSchema<{
106
+ readonly error: v.ObjectSchema<{
107
+ readonly code: v.StringSchema<undefined>;
108
+ readonly message: v.StringSchema<undefined>;
109
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
110
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
111
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
112
+ readonly message: v.StringSchema<undefined>;
113
+ }, undefined>, undefined>, undefined>;
114
+ }, undefined>;
115
+ }, undefined>;
116
+ readonly 200: v.ObjectSchema<{
117
+ readonly status: v.PicklistSchema<["fishing", "awaiting_triage", "done"], undefined>;
118
+ readonly phases: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
119
+ readonly id: v.StringSchema<undefined>;
120
+ readonly title: v.StringSchema<undefined>;
121
+ readonly goal: v.StringSchema<undefined>;
122
+ readonly status: v.PicklistSchema<["pending", "fishing", "completed", "failed"], undefined>;
123
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
124
+ readonly settledAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
125
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
126
+ }, undefined>, undefined>, readonly []>;
127
+ readonly currentPhaseIndex: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
128
+ readonly findings: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
129
+ readonly id: v.StringSchema<undefined>;
130
+ readonly phaseId: v.StringSchema<undefined>;
131
+ readonly path: v.StringSchema<undefined>;
132
+ readonly line: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
133
+ readonly severity: v.PicklistSchema<["critical", "high", "medium", "low"], undefined>;
134
+ readonly kind: v.PicklistSchema<["bug", "logic-gap", "edge-case", "footgun", "requirement-gap", "other"], undefined>;
135
+ readonly confidence: v.PicklistSchema<["high", "medium", "low"], undefined>;
136
+ readonly title: v.StringSchema<undefined>;
137
+ readonly detail: v.StringSchema<undefined>;
138
+ readonly failureScenario: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
139
+ readonly evidence: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
140
+ readonly suggestedFix: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
141
+ readonly spawn: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
142
+ readonly status: v.PicklistSchema<["pending", "spawned", "failed"], undefined>;
143
+ readonly taskId: v.StringSchema<undefined>;
144
+ readonly executionId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
145
+ readonly pipelineId: v.StringSchema<undefined>;
146
+ readonly requestedBy: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
147
+ readonly requestedAt: v.NumberSchema<undefined>;
148
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
149
+ }, undefined>, undefined>, undefined>;
150
+ readonly dismissed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
151
+ }, undefined>, undefined>, readonly []>;
152
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
153
+ readonly defaultFixPipelineId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
154
+ }, undefined>;
155
+ };
156
+ };
157
+ /** Dismiss a finding: it stays on the expedition's record, struck through, and is not spawnable. */
158
+ export declare const dismissBugFishingFindingContract: {
159
+ readonly method: "post";
160
+ readonly requestPathParamsSchema: v.ObjectSchema<{
161
+ readonly executionId: v.StringSchema<undefined>;
162
+ readonly findingId: v.StringSchema<undefined>;
163
+ }, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
164
+ readonly pathResolver: ({ executionId, findingId }: {
165
+ executionId: string;
166
+ findingId: string;
167
+ }) => string;
168
+ readonly requestBodySchema: v.ObjectSchema<{}, undefined>;
169
+ readonly responsesByStatusCode: {
170
+ readonly '4xx': v.ObjectSchema<{
171
+ readonly error: v.ObjectSchema<{
172
+ readonly code: v.StringSchema<undefined>;
173
+ readonly message: v.StringSchema<undefined>;
174
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
175
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
176
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
177
+ readonly message: v.StringSchema<undefined>;
178
+ }, undefined>, undefined>, undefined>;
179
+ }, undefined>;
180
+ }, undefined>;
181
+ readonly '5xx': v.ObjectSchema<{
182
+ readonly error: v.ObjectSchema<{
183
+ readonly code: v.StringSchema<undefined>;
184
+ readonly message: v.StringSchema<undefined>;
185
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
186
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
187
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
188
+ readonly message: v.StringSchema<undefined>;
189
+ }, undefined>, undefined>, undefined>;
190
+ }, undefined>;
191
+ }, undefined>;
192
+ readonly 200: v.ObjectSchema<{
193
+ readonly status: v.PicklistSchema<["fishing", "awaiting_triage", "done"], undefined>;
194
+ readonly phases: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
195
+ readonly id: v.StringSchema<undefined>;
196
+ readonly title: v.StringSchema<undefined>;
197
+ readonly goal: v.StringSchema<undefined>;
198
+ readonly status: v.PicklistSchema<["pending", "fishing", "completed", "failed"], undefined>;
199
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
200
+ readonly settledAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
201
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
202
+ }, undefined>, undefined>, readonly []>;
203
+ readonly currentPhaseIndex: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
204
+ readonly findings: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
205
+ readonly id: v.StringSchema<undefined>;
206
+ readonly phaseId: v.StringSchema<undefined>;
207
+ readonly path: v.StringSchema<undefined>;
208
+ readonly line: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
209
+ readonly severity: v.PicklistSchema<["critical", "high", "medium", "low"], undefined>;
210
+ readonly kind: v.PicklistSchema<["bug", "logic-gap", "edge-case", "footgun", "requirement-gap", "other"], undefined>;
211
+ readonly confidence: v.PicklistSchema<["high", "medium", "low"], undefined>;
212
+ readonly title: v.StringSchema<undefined>;
213
+ readonly detail: v.StringSchema<undefined>;
214
+ readonly failureScenario: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
215
+ readonly evidence: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
216
+ readonly suggestedFix: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
217
+ readonly spawn: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
218
+ readonly status: v.PicklistSchema<["pending", "spawned", "failed"], undefined>;
219
+ readonly taskId: v.StringSchema<undefined>;
220
+ readonly executionId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
221
+ readonly pipelineId: v.StringSchema<undefined>;
222
+ readonly requestedBy: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
223
+ readonly requestedAt: v.NumberSchema<undefined>;
224
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
225
+ }, undefined>, undefined>, undefined>;
226
+ readonly dismissed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
227
+ }, undefined>, undefined>, readonly []>;
228
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
229
+ readonly defaultFixPipelineId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
230
+ }, undefined>;
231
+ };
232
+ };
233
+ /** Finish a parked expedition (the human is done triaging); the run advances past the step. */
234
+ export declare const resolveBugFishingContract: {
235
+ readonly method: "post";
236
+ readonly requestPathParamsSchema: v.ObjectSchema<{
237
+ executionId: v.StringSchema<undefined>;
238
+ }, undefined> & import("@toad-contracts/core").StandardObjectKeysV1<unknown, unknown>;
239
+ readonly pathResolver: ({ executionId }: {
240
+ executionId: string;
241
+ }) => string;
242
+ readonly requestBodySchema: v.ObjectSchema<{}, undefined>;
243
+ readonly responsesByStatusCode: {
244
+ readonly '4xx': v.ObjectSchema<{
245
+ readonly error: v.ObjectSchema<{
246
+ readonly code: v.StringSchema<undefined>;
247
+ readonly message: v.StringSchema<undefined>;
248
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
249
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
250
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
251
+ readonly message: v.StringSchema<undefined>;
252
+ }, undefined>, undefined>, undefined>;
253
+ }, undefined>;
254
+ }, undefined>;
255
+ readonly '5xx': v.ObjectSchema<{
256
+ readonly error: v.ObjectSchema<{
257
+ readonly code: v.StringSchema<undefined>;
258
+ readonly message: v.StringSchema<undefined>;
259
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
260
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
261
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
262
+ readonly message: v.StringSchema<undefined>;
263
+ }, undefined>, undefined>, undefined>;
264
+ }, undefined>;
265
+ }, undefined>;
266
+ readonly 200: v.ObjectSchema<{
267
+ readonly status: v.PicklistSchema<["fishing", "awaiting_triage", "done"], undefined>;
268
+ readonly phases: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
269
+ readonly id: v.StringSchema<undefined>;
270
+ readonly title: v.StringSchema<undefined>;
271
+ readonly goal: v.StringSchema<undefined>;
272
+ readonly status: v.PicklistSchema<["pending", "fishing", "completed", "failed"], undefined>;
273
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
274
+ readonly settledAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
275
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
276
+ }, undefined>, undefined>, readonly []>;
277
+ readonly currentPhaseIndex: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
278
+ readonly findings: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
279
+ readonly id: v.StringSchema<undefined>;
280
+ readonly phaseId: v.StringSchema<undefined>;
281
+ readonly path: v.StringSchema<undefined>;
282
+ readonly line: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
283
+ readonly severity: v.PicklistSchema<["critical", "high", "medium", "low"], undefined>;
284
+ readonly kind: v.PicklistSchema<["bug", "logic-gap", "edge-case", "footgun", "requirement-gap", "other"], undefined>;
285
+ readonly confidence: v.PicklistSchema<["high", "medium", "low"], undefined>;
286
+ readonly title: v.StringSchema<undefined>;
287
+ readonly detail: v.StringSchema<undefined>;
288
+ readonly failureScenario: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
289
+ readonly evidence: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
290
+ readonly suggestedFix: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
291
+ readonly spawn: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
292
+ readonly status: v.PicklistSchema<["pending", "spawned", "failed"], undefined>;
293
+ readonly taskId: v.StringSchema<undefined>;
294
+ readonly executionId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
295
+ readonly pipelineId: v.StringSchema<undefined>;
296
+ readonly requestedBy: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
297
+ readonly requestedAt: v.NumberSchema<undefined>;
298
+ readonly failureReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
299
+ }, undefined>, undefined>, undefined>;
300
+ readonly dismissed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
301
+ }, undefined>, undefined>, readonly []>;
302
+ readonly model: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
303
+ readonly defaultFixPipelineId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
304
+ }, undefined>;
305
+ };
306
+ };
307
+ //# sourceMappingURL=bugFishing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bugFishing.d.ts","sourceRoot":"","sources":["../../src/routes/bugFishing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAoB5B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKhC,CAAA;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM5C,CAAA;AAEF,oGAAoG;AACpG,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAO3C,CAAA;AAEF,+FAA+F;AAC/F,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMpC,CAAA"}
@@ -0,0 +1,51 @@
1
+ import { defineApiContract, withObjectKeys } from '@toad-contracts/valibot';
2
+ import * as v from 'valibot';
3
+ import { addressBugFishingFindingsSchema, bugFishingStepStateSchema, resolveBugFishingSchema, } from '../bugFishing.js';
4
+ import { errorResponses, singleStringParam } from './_shared.js';
5
+ // ---------------------------------------------------------------------------
6
+ // Bug-fishing expedition route contracts. Mounted under `/workspaces/:workspaceId`,
7
+ // so the paths here are relative to that prefix. The read returns the run's active
8
+ // expedition state (or null when no `bug-fisher` step carries one); `address` marks
9
+ // findings and spawns a bug-fix task per marked finding; `dismiss` drops one from
10
+ // triage; `resolve` finishes a parked expedition. See BugFishingController in
11
+ // @cat-factory/server.
12
+ // ---------------------------------------------------------------------------
13
+ const executionIdParams = singleStringParam('executionId');
14
+ const findingParams = withObjectKeys(v.object({ executionId: v.string(), findingId: v.string() }));
15
+ export const getBugFishingContract = defineApiContract({
16
+ method: 'get',
17
+ requestPathParamsSchema: executionIdParams,
18
+ pathResolver: ({ executionId }) => `/executions/${executionId}/bug-fishing`,
19
+ responsesByStatusCode: { 200: v.nullable(bugFishingStepStateSchema), ...errorResponses },
20
+ });
21
+ /**
22
+ * Mark findings to be addressed: each spawns its own bug-fix task linked to the expedition.
23
+ *
24
+ * Deliberately accepted while the expedition is STILL FISHING later phases as well as once it
25
+ * parks: a completed phase's findings are actionable the moment they land, and making a human
26
+ * wait for the last angle is exactly the delay running the angles separately is meant to avoid.
27
+ */
28
+ export const addressBugFishingFindingsContract = defineApiContract({
29
+ method: 'post',
30
+ requestPathParamsSchema: executionIdParams,
31
+ pathResolver: ({ executionId }) => `/executions/${executionId}/bug-fishing/address`,
32
+ requestBodySchema: addressBugFishingFindingsSchema,
33
+ responsesByStatusCode: { 200: bugFishingStepStateSchema, ...errorResponses },
34
+ });
35
+ /** Dismiss a finding: it stays on the expedition's record, struck through, and is not spawnable. */
36
+ export const dismissBugFishingFindingContract = defineApiContract({
37
+ method: 'post',
38
+ requestPathParamsSchema: findingParams,
39
+ pathResolver: ({ executionId, findingId }) => `/executions/${executionId}/bug-fishing/findings/${findingId}/dismiss`,
40
+ requestBodySchema: resolveBugFishingSchema,
41
+ responsesByStatusCode: { 200: bugFishingStepStateSchema, ...errorResponses },
42
+ });
43
+ /** Finish a parked expedition (the human is done triaging); the run advances past the step. */
44
+ export const resolveBugFishingContract = defineApiContract({
45
+ method: 'post',
46
+ requestPathParamsSchema: executionIdParams,
47
+ pathResolver: ({ executionId }) => `/executions/${executionId}/bug-fishing/resolve`,
48
+ requestBodySchema: resolveBugFishingSchema,
49
+ responsesByStatusCode: { 200: bugFishingStepStateSchema, ...errorResponses },
50
+ });
51
+ //# sourceMappingURL=bugFishing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bugFishing.js","sourceRoot":"","sources":["../../src/routes/bugFishing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhE,8EAA8E;AAC9E,oFAAoF;AACpF,mFAAmF;AACnF,oFAAoF;AACpF,kFAAkF;AAClF,8EAA8E;AAC9E,uBAAuB;AACvB,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAA;AAC1D,MAAM,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAA;AAElG,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;IACrD,MAAM,EAAE,KAAK;IACb,uBAAuB,EAAE,iBAAiB;IAC1C,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,eAAe,WAAW,cAAc;IAC3E,qBAAqB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,GAAG,cAAc,EAAE;CACzF,CAAC,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,iBAAiB,CAAC;IACjE,MAAM,EAAE,MAAM;IACd,uBAAuB,EAAE,iBAAiB;IAC1C,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,eAAe,WAAW,sBAAsB;IACnF,iBAAiB,EAAE,+BAA+B;IAClD,qBAAqB,EAAE,EAAE,GAAG,EAAE,yBAAyB,EAAE,GAAG,cAAc,EAAE;CAC7E,CAAC,CAAA;AAEF,oGAAoG;AACpG,MAAM,CAAC,MAAM,gCAAgC,GAAG,iBAAiB,CAAC;IAChE,MAAM,EAAE,MAAM;IACd,uBAAuB,EAAE,aAAa;IACtC,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,EAAE,CAC3C,eAAe,WAAW,yBAAyB,SAAS,UAAU;IACxE,iBAAiB,EAAE,uBAAuB;IAC1C,qBAAqB,EAAE,EAAE,GAAG,EAAE,yBAAyB,EAAE,GAAG,cAAc,EAAE;CAC7E,CAAC,CAAA;AAEF,+FAA+F;AAC/F,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;IACzD,MAAM,EAAE,MAAM;IACd,uBAAuB,EAAE,iBAAiB;IAC1C,YAAY,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,eAAe,WAAW,sBAAsB;IACnF,iBAAiB,EAAE,uBAAuB;IAC1C,qBAAqB,EAAE,EAAE,GAAG,EAAE,yBAAyB,EAAE,GAAG,cAAc,EAAE;CAC7E,CAAC,CAAA"}