@cat-factory/contracts 0.34.0 → 0.35.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 (209) hide show
  1. package/dist/api-keys.d.ts +17 -0
  2. package/dist/api-keys.d.ts.map +1 -1
  3. package/dist/api-keys.js +2 -0
  4. package/dist/api-keys.js.map +1 -1
  5. package/dist/github.d.ts +14 -0
  6. package/dist/github.d.ts.map +1 -1
  7. package/dist/github.js +13 -0
  8. package/dist/github.js.map +1 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +1 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/observability.d.ts +63 -0
  14. package/dist/observability.d.ts.map +1 -1
  15. package/dist/observability.js +57 -0
  16. package/dist/observability.js.map +1 -1
  17. package/dist/requests.d.ts +7 -0
  18. package/dist/requests.d.ts.map +1 -1
  19. package/dist/requests.js +2 -0
  20. package/dist/requests.js.map +1 -1
  21. package/dist/routes/_shared.d.ts +49 -0
  22. package/dist/routes/_shared.d.ts.map +1 -0
  23. package/dist/routes/_shared.js +34 -0
  24. package/dist/routes/_shared.js.map +1 -0
  25. package/dist/routes/accounts.d.ts +775 -0
  26. package/dist/routes/accounts.d.ts.map +1 -0
  27. package/dist/routes/accounts.js +145 -0
  28. package/dist/routes/accounts.js.map +1 -0
  29. package/dist/routes/agent-runs.d.ts +659 -0
  30. package/dist/routes/agent-runs.d.ts.map +1 -0
  31. package/dist/routes/agent-runs.js +33 -0
  32. package/dist/routes/agent-runs.js.map +1 -0
  33. package/dist/routes/api-keys.d.ts +245 -0
  34. package/dist/routes/api-keys.d.ts.map +1 -0
  35. package/dist/routes/api-keys.js +49 -0
  36. package/dist/routes/api-keys.js.map +1 -0
  37. package/dist/routes/auth.d.ts +411 -0
  38. package/dist/routes/auth.d.ts.map +1 -0
  39. package/dist/routes/auth.js +129 -0
  40. package/dist/routes/auth.js.map +1 -0
  41. package/dist/routes/board.d.ts +1260 -0
  42. package/dist/routes/board.d.ts.map +1 -0
  43. package/dist/routes/board.js +85 -0
  44. package/dist/routes/board.js.map +1 -0
  45. package/dist/routes/bootstrap.d.ts +395 -0
  46. package/dist/routes/bootstrap.d.ts.map +1 -0
  47. package/dist/routes/bootstrap.js +56 -0
  48. package/dist/routes/bootstrap.js.map +1 -0
  49. package/dist/routes/brainstorm.d.ts +482 -0
  50. package/dist/routes/brainstorm.d.ts.map +1 -0
  51. package/dist/routes/brainstorm.js +69 -0
  52. package/dist/routes/brainstorm.js.map +1 -0
  53. package/dist/routes/clarity.d.ts +462 -0
  54. package/dist/routes/clarity.d.ts.map +1 -0
  55. package/dist/routes/clarity.js +67 -0
  56. package/dist/routes/clarity.js.map +1 -0
  57. package/dist/routes/consensus.d.ts +71 -0
  58. package/dist/routes/consensus.d.ts.map +1 -0
  59. package/dist/routes/consensus.js +23 -0
  60. package/dist/routes/consensus.js.map +1 -0
  61. package/dist/routes/documents.d.ts +449 -0
  62. package/dist/routes/documents.d.ts.map +1 -0
  63. package/dist/routes/documents.js +89 -0
  64. package/dist/routes/documents.js.map +1 -0
  65. package/dist/routes/environments.d.ts +715 -0
  66. package/dist/routes/environments.d.ts.map +1 -0
  67. package/dist/routes/environments.js +82 -0
  68. package/dist/routes/environments.js.map +1 -0
  69. package/dist/routes/execution.d.ts +2768 -0
  70. package/dist/routes/execution.d.ts.map +1 -0
  71. package/dist/routes/execution.js +119 -0
  72. package/dist/routes/execution.js.map +1 -0
  73. package/dist/routes/followUp.d.ts +277 -0
  74. package/dist/routes/followUp.d.ts.map +1 -0
  75. package/dist/routes/followUp.js +47 -0
  76. package/dist/routes/followUp.js.map +1 -0
  77. package/dist/routes/fragment-library.d.ts +594 -0
  78. package/dist/routes/fragment-library.d.ts.map +1 -0
  79. package/dist/routes/fragment-library.js +102 -0
  80. package/dist/routes/fragment-library.js.map +1 -0
  81. package/dist/routes/github.d.ts +807 -0
  82. package/dist/routes/github.d.ts.map +1 -0
  83. package/dist/routes/github.js +157 -0
  84. package/dist/routes/github.js.map +1 -0
  85. package/dist/routes/human-review.d.ts +290 -0
  86. package/dist/routes/human-review.d.ts.map +1 -0
  87. package/dist/routes/human-review.js +20 -0
  88. package/dist/routes/human-review.js.map +1 -0
  89. package/dist/routes/human-test.d.ts +1435 -0
  90. package/dist/routes/human-test.d.ts.map +1 -0
  91. package/dist/routes/human-test.js +48 -0
  92. package/dist/routes/human-test.js.map +1 -0
  93. package/dist/routes/incident-enrichment.d.ts +110 -0
  94. package/dist/routes/incident-enrichment.d.ts.map +1 -0
  95. package/dist/routes/incident-enrichment.js +26 -0
  96. package/dist/routes/incident-enrichment.js.map +1 -0
  97. package/dist/routes/index.d.ts +47 -0
  98. package/dist/routes/index.d.ts.map +1 -0
  99. package/dist/routes/index.js +50 -0
  100. package/dist/routes/index.js.map +1 -0
  101. package/dist/routes/kaizen.d.ts +113 -0
  102. package/dist/routes/kaizen.d.ts.map +1 -0
  103. package/dist/routes/kaizen.js +22 -0
  104. package/dist/routes/kaizen.js.map +1 -0
  105. package/dist/routes/localModels.d.ts +163 -0
  106. package/dist/routes/localModels.d.ts.map +1 -0
  107. package/dist/routes/localModels.js +41 -0
  108. package/dist/routes/localModels.js.map +1 -0
  109. package/dist/routes/localSettings.d.ts +93 -0
  110. package/dist/routes/localSettings.d.ts.map +1 -0
  111. package/dist/routes/localSettings.js +22 -0
  112. package/dist/routes/localSettings.js.map +1 -0
  113. package/dist/routes/merge.d.ts +197 -0
  114. package/dist/routes/merge.d.ts.map +1 -0
  115. package/dist/routes/merge.js +36 -0
  116. package/dist/routes/merge.js.map +1 -0
  117. package/dist/routes/model-presets.d.ts +162 -0
  118. package/dist/routes/model-presets.d.ts.map +1 -0
  119. package/dist/routes/model-presets.js +36 -0
  120. package/dist/routes/model-presets.js.map +1 -0
  121. package/dist/routes/models.d.ts +123 -0
  122. package/dist/routes/models.d.ts.map +1 -0
  123. package/dist/routes/models.js +25 -0
  124. package/dist/routes/models.js.map +1 -0
  125. package/dist/routes/notifications.d.ts +213 -0
  126. package/dist/routes/notifications.d.ts.map +1 -0
  127. package/dist/routes/notifications.js +31 -0
  128. package/dist/routes/notifications.js.map +1 -0
  129. package/dist/routes/openrouter.d.ts +145 -0
  130. package/dist/routes/openrouter.d.ts.map +1 -0
  131. package/dist/routes/openrouter.js +32 -0
  132. package/dist/routes/openrouter.js.map +1 -0
  133. package/dist/routes/personal-subscriptions.d.ts +124 -0
  134. package/dist/routes/personal-subscriptions.d.ts.map +1 -0
  135. package/dist/routes/personal-subscriptions.js +32 -0
  136. package/dist/routes/personal-subscriptions.js.map +1 -0
  137. package/dist/routes/pipelines.d.ts +457 -0
  138. package/dist/routes/pipelines.d.ts.map +1 -0
  139. package/dist/routes/pipelines.js +51 -0
  140. package/dist/routes/pipelines.js.map +1 -0
  141. package/dist/routes/prompt-fragments.d.ts +52 -0
  142. package/dist/routes/prompt-fragments.d.ts.map +1 -0
  143. package/dist/routes/prompt-fragments.js +14 -0
  144. package/dist/routes/prompt-fragments.js.map +1 -0
  145. package/dist/routes/provisioning-logs.d.ts +45 -0
  146. package/dist/routes/provisioning-logs.d.ts.map +1 -0
  147. package/dist/routes/provisioning-logs.js +14 -0
  148. package/dist/routes/provisioning-logs.js.map +1 -0
  149. package/dist/routes/recurring.d.ts +309 -0
  150. package/dist/routes/recurring.d.ts.map +1 -0
  151. package/dist/routes/recurring.js +50 -0
  152. package/dist/routes/recurring.js.map +1 -0
  153. package/dist/routes/release.d.ts +218 -0
  154. package/dist/routes/release.d.ts.map +1 -0
  155. package/dist/routes/release.js +47 -0
  156. package/dist/routes/release.js.map +1 -0
  157. package/dist/routes/requirements.d.ts +901 -0
  158. package/dist/routes/requirements.d.ts.map +1 -0
  159. package/dist/routes/requirements.js +96 -0
  160. package/dist/routes/requirements.js.map +1 -0
  161. package/dist/routes/runners.d.ts +442 -0
  162. package/dist/routes/runners.d.ts.map +1 -0
  163. package/dist/routes/runners.js +47 -0
  164. package/dist/routes/runners.js.map +1 -0
  165. package/dist/routes/sandbox.d.ts +898 -0
  166. package/dist/routes/sandbox.d.ts.map +1 -0
  167. package/dist/routes/sandbox.js +119 -0
  168. package/dist/routes/sandbox.js.map +1 -0
  169. package/dist/routes/service-fragment-defaults.d.ts +66 -0
  170. package/dist/routes/service-fragment-defaults.d.ts.map +1 -0
  171. package/dist/routes/service-fragment-defaults.js +20 -0
  172. package/dist/routes/service-fragment-defaults.js.map +1 -0
  173. package/dist/routes/services.d.ts +224 -0
  174. package/dist/routes/services.d.ts.map +1 -0
  175. package/dist/routes/services.js +44 -0
  176. package/dist/routes/services.js.map +1 -0
  177. package/dist/routes/slack.d.ts +332 -0
  178. package/dist/routes/slack.d.ts.map +1 -0
  179. package/dist/routes/slack.js +72 -0
  180. package/dist/routes/slack.js.map +1 -0
  181. package/dist/routes/spec.d.ts +76 -0
  182. package/dist/routes/spec.d.ts.map +1 -0
  183. package/dist/routes/spec.js +17 -0
  184. package/dist/routes/spec.js.map +1 -0
  185. package/dist/routes/tasks.d.ts +723 -0
  186. package/dist/routes/tasks.d.ts.map +1 -0
  187. package/dist/routes/tasks.js +108 -0
  188. package/dist/routes/tasks.js.map +1 -0
  189. package/dist/routes/tracker.d.ts +77 -0
  190. package/dist/routes/tracker.d.ts.map +1 -0
  191. package/dist/routes/tracker.js +20 -0
  192. package/dist/routes/tracker.js.map +1 -0
  193. package/dist/routes/user-secret.d.ts +231 -0
  194. package/dist/routes/user-secret.d.ts.map +1 -0
  195. package/dist/routes/user-secret.js +49 -0
  196. package/dist/routes/user-secret.js.map +1 -0
  197. package/dist/routes/vendor-credentials.d.ts +120 -0
  198. package/dist/routes/vendor-credentials.d.ts.map +1 -0
  199. package/dist/routes/vendor-credentials.js +33 -0
  200. package/dist/routes/vendor-credentials.js.map +1 -0
  201. package/dist/routes/workspace-settings.d.ts +93 -0
  202. package/dist/routes/workspace-settings.d.ts.map +1 -0
  203. package/dist/routes/workspace-settings.js +20 -0
  204. package/dist/routes/workspace-settings.js.map +1 -0
  205. package/dist/routes/workspaces.d.ts +1309 -0
  206. package/dist/routes/workspaces.d.ts.map +1 -0
  207. package/dist/routes/workspaces.js +45 -0
  208. package/dist/routes/workspaces.js.map +1 -0
  209. package/package.json +3 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/routes/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqC,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AA4D5B,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAItC,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAItC,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI1C,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKhC,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI3C,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKvC,CAAA;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMxC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMrC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAInC,CAAA;AAIF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAK/B,CAAA;AAIF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIlC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKrC,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIlC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAInC,CAAA;AAIF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKnC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMrC,CAAA;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMpC,CAAA;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMxC,CAAA;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMzC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOrC,CAAA"}
@@ -0,0 +1,157 @@
1
+ import { ContractNoBody, defineApiContract, withObjectKeys } from '@toad-contracts/valibot';
2
+ import * as v from 'valibot';
3
+ import { commentSchema, commitFilesSchema, createBranchSchema, createRepoRequestSchema, githubAvailableRepoSchema, githubBranchSchema, githubConnectionSchema, githubInstallationOptionSchema, githubIssueSchema, githubPullRequestSchema, githubRepoSchema, linkReposSchema, mergePullRequestSchema, openPullRequestSchema, provisionedRepoSchema, repoTreeEntrySchema, resyncRequestSchema, setRepoMonorepoSchema, } from '../github.js';
4
+ import { errorResponses } from './_shared.js';
5
+ // ---------------------------------------------------------------------------
6
+ // Workspace-scoped GitHub route contracts. Mounted under `/workspaces/:workspaceId`,
7
+ // so the paths here are relative to that prefix. See GitHubController.
8
+ // ---------------------------------------------------------------------------
9
+ // Programmatic bind body — exists only inline in the controller today.
10
+ const connectSchema = v.object({ installationId: v.number() });
11
+ // Response wrappers that exist only inline in the controller today.
12
+ const installUrlSchema = v.object({ url: v.string() });
13
+ const connectionViewSchema = v.object({ connection: v.nullable(githubConnectionSchema) });
14
+ const installationsViewSchema = v.object({
15
+ installations: v.array(githubInstallationOptionSchema),
16
+ });
17
+ const availableReposViewSchema = v.array(githubAvailableRepoSchema);
18
+ const repoTreeViewSchema = v.array(repoTreeEntrySchema);
19
+ const repoListSchema = v.array(githubRepoSchema);
20
+ const branchListSchema = v.array(githubBranchSchema);
21
+ const pullRequestListSchema = v.array(githubPullRequestSchema);
22
+ const issueListSchema = v.array(githubIssueSchema);
23
+ const repoProjectionListSchema = v.array(githubRepoSchema);
24
+ const commitResultSchema = v.object({ sha: v.string() });
25
+ // The createRepo success body is a freshly-provisioned repo; `provisionedRepoSchema`
26
+ // (imported from `../github.js`) is the shared source of truth that the kernel
27
+ // `ProvisionedRepo` port type also derives from.
28
+ // The resync endpoint returns a `{ status }` envelope across both 200 and 202.
29
+ const resyncResultSchema = v.object({
30
+ status: v.picklist(['backfill_started', 'backfilled', 'queued', 'synced']),
31
+ });
32
+ const repoGithubIdParams = withObjectKeys(v.object({ repoGithubId: v.string() }));
33
+ const repoPullNumberParams = withObjectKeys(v.object({ repoGithubId: v.string(), number: v.string() }));
34
+ // ---- connection -----------------------------------------------------------
35
+ export const getGitHubInstallUrlContract = defineApiContract({
36
+ method: 'get',
37
+ pathResolver: () => '/github/install-url',
38
+ responsesByStatusCode: { 200: installUrlSchema, ...errorResponses },
39
+ });
40
+ export const getGitHubConnectionContract = defineApiContract({
41
+ method: 'get',
42
+ pathResolver: () => '/github/connection',
43
+ responsesByStatusCode: { 200: connectionViewSchema, ...errorResponses },
44
+ });
45
+ export const listGitHubInstallationsContract = defineApiContract({
46
+ method: 'get',
47
+ pathResolver: () => '/github/installations',
48
+ responsesByStatusCode: { 200: installationsViewSchema, ...errorResponses },
49
+ });
50
+ export const connectGitHubContract = defineApiContract({
51
+ method: 'post',
52
+ pathResolver: () => '/github/connect',
53
+ requestBodySchema: connectSchema,
54
+ responsesByStatusCode: { 201: githubConnectionSchema, ...errorResponses },
55
+ });
56
+ export const listGitHubAvailableReposContract = defineApiContract({
57
+ method: 'get',
58
+ pathResolver: () => '/github/available-repos',
59
+ responsesByStatusCode: { 200: availableReposViewSchema, ...errorResponses },
60
+ });
61
+ export const setGitHubLinkedReposContract = defineApiContract({
62
+ method: 'put',
63
+ pathResolver: () => '/github/repos',
64
+ requestBodySchema: linkReposSchema,
65
+ responsesByStatusCode: { 200: repoListSchema, ...errorResponses },
66
+ });
67
+ export const setGitHubRepoMonorepoContract = defineApiContract({
68
+ method: 'patch',
69
+ requestPathParamsSchema: repoGithubIdParams,
70
+ pathResolver: ({ repoGithubId }) => `/github/repos/${repoGithubId}`,
71
+ requestBodySchema: setRepoMonorepoSchema,
72
+ responsesByStatusCode: { 200: githubRepoSchema, ...errorResponses },
73
+ });
74
+ export const listGitHubRepoTreeContract = defineApiContract({
75
+ method: 'get',
76
+ requestPathParamsSchema: repoGithubIdParams,
77
+ pathResolver: ({ repoGithubId }) => `/github/repos/${repoGithubId}/tree`,
78
+ requestQuerySchema: v.object({ path: v.optional(v.string()) }),
79
+ responsesByStatusCode: { 200: repoTreeViewSchema, ...errorResponses },
80
+ });
81
+ export const disconnectGitHubContract = defineApiContract({
82
+ method: 'delete',
83
+ pathResolver: () => '/github/connection',
84
+ responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
85
+ });
86
+ // ---- resync ---------------------------------------------------------------
87
+ export const resyncGitHubContract = defineApiContract({
88
+ method: 'post',
89
+ pathResolver: () => '/github/resync',
90
+ requestBodySchema: resyncRequestSchema,
91
+ responsesByStatusCode: { 200: resyncResultSchema, 202: resyncResultSchema, ...errorResponses },
92
+ });
93
+ // ---- projection reads -----------------------------------------------------
94
+ export const listGitHubReposContract = defineApiContract({
95
+ method: 'get',
96
+ pathResolver: () => '/github/repos',
97
+ responsesByStatusCode: { 200: repoProjectionListSchema, ...errorResponses },
98
+ });
99
+ export const listGitHubBranchesContract = defineApiContract({
100
+ method: 'get',
101
+ requestPathParamsSchema: repoGithubIdParams,
102
+ pathResolver: ({ repoGithubId }) => `/github/repos/${repoGithubId}/branches`,
103
+ responsesByStatusCode: { 200: branchListSchema, ...errorResponses },
104
+ });
105
+ export const listGitHubPullsContract = defineApiContract({
106
+ method: 'get',
107
+ pathResolver: () => '/github/pulls',
108
+ responsesByStatusCode: { 200: pullRequestListSchema, ...errorResponses },
109
+ });
110
+ export const listGitHubIssuesContract = defineApiContract({
111
+ method: 'get',
112
+ pathResolver: () => '/github/issues',
113
+ responsesByStatusCode: { 200: issueListSchema, ...errorResponses },
114
+ });
115
+ // ---- writes ---------------------------------------------------------------
116
+ export const createGitHubRepoContract = defineApiContract({
117
+ method: 'post',
118
+ pathResolver: () => '/github/repos',
119
+ requestBodySchema: createRepoRequestSchema,
120
+ responsesByStatusCode: { 201: provisionedRepoSchema, ...errorResponses },
121
+ });
122
+ export const createGitHubBranchContract = defineApiContract({
123
+ method: 'post',
124
+ requestPathParamsSchema: repoGithubIdParams,
125
+ pathResolver: ({ repoGithubId }) => `/github/repos/${repoGithubId}/branches`,
126
+ requestBodySchema: createBranchSchema,
127
+ responsesByStatusCode: { 201: githubBranchSchema, ...errorResponses },
128
+ });
129
+ export const commitGitHubFilesContract = defineApiContract({
130
+ method: 'post',
131
+ requestPathParamsSchema: repoGithubIdParams,
132
+ pathResolver: ({ repoGithubId }) => `/github/repos/${repoGithubId}/commits`,
133
+ requestBodySchema: commitFilesSchema,
134
+ responsesByStatusCode: { 201: commitResultSchema, ...errorResponses },
135
+ });
136
+ export const openGitHubPullRequestContract = defineApiContract({
137
+ method: 'post',
138
+ requestPathParamsSchema: repoGithubIdParams,
139
+ pathResolver: ({ repoGithubId }) => `/github/repos/${repoGithubId}/pulls`,
140
+ requestBodySchema: openPullRequestSchema,
141
+ responsesByStatusCode: { 201: githubPullRequestSchema, ...errorResponses },
142
+ });
143
+ export const mergeGitHubPullRequestContract = defineApiContract({
144
+ method: 'put',
145
+ requestPathParamsSchema: repoPullNumberParams,
146
+ pathResolver: ({ repoGithubId, number }) => `/github/repos/${repoGithubId}/pulls/${number}/merge`,
147
+ requestBodySchema: mergePullRequestSchema,
148
+ responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
149
+ });
150
+ export const commentGitHubIssueContract = defineApiContract({
151
+ method: 'post',
152
+ requestPathParamsSchema: repoPullNumberParams,
153
+ pathResolver: ({ repoGithubId, number }) => `/github/repos/${repoGithubId}/issues/${number}/comments`,
154
+ requestBodySchema: commentSchema,
155
+ responsesByStatusCode: { 204: ContractNoBody, ...errorResponses },
156
+ });
157
+ //# sourceMappingURL=github.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.js","sourceRoot":"","sources":["../../src/routes/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3F,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,8EAA8E;AAC9E,qFAAqF;AACrF,uEAAuE;AACvE,8EAA8E;AAE9E,uEAAuE;AACvE,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,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EAAE,GAAG,cAAc,EAAE;CAC3E,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;IAC9D,MAAM,EAAE,KAAK;IACb,uBAAuB,EAAE,oBAAoB;IAC7C,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,iBAAiB,YAAY,UAAU,MAAM,QAAQ;IACjG,iBAAiB,EAAE,sBAAsB;IACzC,qBAAqB,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;CAClE,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC;IAC1D,MAAM,EAAE,MAAM;IACd,uBAAuB,EAAE,oBAAoB;IAC7C,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,CACzC,iBAAiB,YAAY,WAAW,MAAM,WAAW;IAC3D,iBAAiB,EAAE,aAAa;IAChC,qBAAqB,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;CAClE,CAAC,CAAA"}
@@ -0,0 +1,290 @@
1
+ import * as v from 'valibot';
2
+ export declare const requestHumanReviewFixContract: {
3
+ readonly method: "post";
4
+ readonly requestPathParamsSchema: v.ObjectSchema<{
5
+ readonly blockId: v.StringSchema<undefined>;
6
+ }, undefined> & import("@toad-contracts/core").ObjectKeysCarrier;
7
+ readonly pathResolver: ({ blockId }: {
8
+ blockId: string;
9
+ }) => string;
10
+ readonly requestBodySchema: v.ObjectSchema<{
11
+ readonly instructions: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
12
+ }, undefined>;
13
+ readonly responsesByStatusCode: {
14
+ readonly '4xx': v.ObjectSchema<{
15
+ readonly error: v.ObjectSchema<{
16
+ readonly code: v.StringSchema<undefined>;
17
+ readonly message: v.StringSchema<undefined>;
18
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
19
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
20
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
21
+ readonly message: v.StringSchema<undefined>;
22
+ }, undefined>, undefined>, undefined>;
23
+ }, undefined>;
24
+ }, undefined>;
25
+ readonly '5xx': v.ObjectSchema<{
26
+ readonly error: v.ObjectSchema<{
27
+ readonly code: v.StringSchema<undefined>;
28
+ readonly message: v.StringSchema<undefined>;
29
+ readonly details: v.OptionalSchema<v.UnknownSchema, undefined>;
30
+ readonly issues: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
31
+ readonly path: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
32
+ readonly message: v.StringSchema<undefined>;
33
+ }, undefined>, undefined>, undefined>;
34
+ }, undefined>;
35
+ }, undefined>;
36
+ readonly 200: v.ObjectSchema<{
37
+ readonly id: v.StringSchema<undefined>;
38
+ readonly blockId: v.StringSchema<undefined>;
39
+ readonly pipelineId: v.StringSchema<undefined>;
40
+ readonly pipelineName: v.StringSchema<undefined>;
41
+ readonly steps: v.ArraySchema<v.ObjectSchema<{
42
+ readonly runId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
43
+ readonly agentKind: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
44
+ readonly state: v.PicklistSchema<["pending", "working", "waiting_decision", "done"], undefined>;
45
+ readonly progress: v.NumberSchema<undefined>;
46
+ readonly metrics: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
47
+ readonly calls: v.NumberSchema<undefined>;
48
+ readonly promptTokens: v.NumberSchema<undefined>;
49
+ readonly completionTokens: v.NumberSchema<undefined>;
50
+ readonly peakCompletionTokens: v.NumberSchema<undefined>;
51
+ readonly maxOutputTokens: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
52
+ readonly truncatedCalls: v.NumberSchema<undefined>;
53
+ readonly upstreamMs: v.NumberSchema<undefined>;
54
+ readonly overheadMs: v.NumberSchema<undefined>;
55
+ readonly errors: v.NumberSchema<undefined>;
56
+ readonly warnings: v.NumberSchema<undefined>;
57
+ }, undefined>, undefined>, undefined>;
58
+ readonly gate: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
59
+ readonly phase: v.PicklistSchema<["checking", "working"], undefined>;
60
+ readonly attempts: v.NumberSchema<undefined>;
61
+ readonly maxAttempts: v.NumberSchema<undefined>;
62
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
63
+ readonly lastVerdict: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["pass", "pending", "fail"], undefined>, undefined>, undefined>;
64
+ readonly lastFailureSummary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
65
+ readonly failingChecks: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
66
+ readonly name: v.StringSchema<undefined>;
67
+ readonly conclusion: v.NullableSchema<v.StringSchema<undefined>, undefined>;
68
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
69
+ }, undefined>, undefined>, undefined>, undefined>;
70
+ readonly watchSince: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
71
+ readonly watchWindowMinutes: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
72
+ readonly regressedSignals: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
73
+ readonly kind: v.PicklistSchema<["monitor", "slo"], undefined>;
74
+ readonly id: v.StringSchema<undefined>;
75
+ readonly name: v.StringSchema<undefined>;
76
+ readonly state: v.PicklistSchema<["ok", "warn", "alert", "no_data"], undefined>;
77
+ readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
78
+ }, undefined>, undefined>, undefined>, undefined>;
79
+ readonly attemptLog: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.ObjectSchema<{
80
+ readonly attempt: v.NumberSchema<undefined>;
81
+ readonly at: v.NumberSchema<undefined>;
82
+ readonly outcome: v.PicklistSchema<["completed", "failed"], undefined>;
83
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
84
+ readonly summary: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
85
+ }, undefined>, undefined>, undefined>, undefined>;
86
+ readonly lastApprovals: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
87
+ readonly requiredApprovingReviewCount: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
88
+ readonly pendingThreadIds: v.OptionalSchema<v.NullableSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>;
89
+ readonly lastAddressedCommentAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
90
+ readonly humanReviewGraceMinutes: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
91
+ readonly pendingFix: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
92
+ readonly instructions: v.StringSchema<undefined>;
93
+ readonly at: v.NumberSchema<undefined>;
94
+ }, undefined>, undefined>, undefined>;
95
+ }, undefined>, undefined>, undefined>;
96
+ readonly test: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
97
+ readonly phase: v.PicklistSchema<["testing", "fixing"], undefined>;
98
+ readonly attempts: v.NumberSchema<undefined>;
99
+ readonly maxAttempts: v.NumberSchema<undefined>;
100
+ readonly lastReport: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
101
+ readonly greenlight: v.BooleanSchema<undefined>;
102
+ readonly summary: v.StringSchema<undefined>;
103
+ readonly tested: v.ArraySchema<v.StringSchema<undefined>, undefined>;
104
+ readonly outcomes: v.ArraySchema<v.ObjectSchema<{
105
+ readonly name: v.StringSchema<undefined>;
106
+ readonly status: v.PicklistSchema<["passed", "failed", "skipped"], undefined>;
107
+ readonly detail: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
108
+ }, undefined>, undefined>;
109
+ readonly concerns: v.ArraySchema<v.ObjectSchema<{
110
+ readonly title: v.StringSchema<undefined>;
111
+ readonly detail: v.StringSchema<undefined>;
112
+ readonly severity: v.PicklistSchema<["low", "medium", "high", "critical"], undefined>;
113
+ }, undefined>, undefined>;
114
+ readonly environment: v.OptionalSchema<v.PicklistSchema<["local", "ephemeral"], undefined>, undefined>;
115
+ }, undefined>, undefined>, undefined>;
116
+ }, undefined>, undefined>, undefined>;
117
+ readonly humanTest: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
118
+ readonly phase: v.PicklistSchema<["provisioning", "awaiting_human", "fixing", "resolving_conflicts", "passed"], undefined>;
119
+ readonly environment: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
120
+ readonly id: v.StringSchema<undefined>;
121
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
122
+ readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
123
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
124
+ }, undefined>, undefined>, undefined>;
125
+ readonly degradedReason: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
126
+ readonly attempts: v.NumberSchema<undefined>;
127
+ readonly maxAttempts: v.NumberSchema<undefined>;
128
+ readonly headSha: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
129
+ readonly rounds: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
130
+ readonly kind: v.PicklistSchema<["fix", "pull-main"], undefined>;
131
+ readonly findings: v.StringSchema<undefined>;
132
+ readonly helperKind: v.StringSchema<undefined>;
133
+ readonly jobId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
134
+ readonly outcome: v.OptionalSchema<v.NullableSchema<v.PicklistSchema<["completed", "failed"], undefined>, undefined>, undefined>;
135
+ readonly at: v.NumberSchema<undefined>;
136
+ }, undefined>, undefined>, undefined>;
137
+ readonly pendingAction: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
138
+ readonly type: v.PicklistSchema<["confirm", "request-fix", "pull-main", "recreate"], undefined>;
139
+ readonly findings: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
140
+ }, undefined>, undefined>, undefined>;
141
+ }, undefined>, undefined>, undefined>;
142
+ readonly environment: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
143
+ readonly id: v.StringSchema<undefined>;
144
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
145
+ readonly status: v.PicklistSchema<["provisioning", "ready", "failed", "expired", "tearing_down", "torn_down"], undefined>;
146
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
147
+ readonly lastError: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
148
+ }, undefined>, undefined>, undefined>;
149
+ readonly subtasks: v.OptionalSchema<v.ObjectSchema<{
150
+ readonly completed: v.NumberSchema<undefined>;
151
+ readonly inProgress: v.NumberSchema<undefined>;
152
+ readonly total: v.NumberSchema<undefined>;
153
+ readonly items: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
154
+ readonly label: v.StringSchema<undefined>;
155
+ readonly status: v.PicklistSchema<["pending", "in_progress", "completed"], undefined>;
156
+ }, undefined>, undefined>, undefined>;
157
+ }, undefined>, undefined>;
158
+ readonly startingContainer: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
159
+ readonly decision: v.NullableSchema<v.ObjectSchema<{
160
+ readonly id: v.StringSchema<undefined>;
161
+ readonly question: v.StringSchema<undefined>;
162
+ readonly options: v.ArraySchema<v.StringSchema<undefined>, undefined>;
163
+ readonly chosen: v.NullableSchema<v.StringSchema<undefined>, undefined>;
164
+ }, undefined>, undefined>;
165
+ readonly requiresApproval: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
166
+ readonly approval: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
167
+ readonly id: v.StringSchema<undefined>;
168
+ readonly status: v.PicklistSchema<["pending", "approved", "changes_requested", "rejected"], undefined>;
169
+ readonly proposal: v.StringSchema<undefined>;
170
+ readonly feedback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
171
+ readonly comments: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
172
+ readonly quotedSource: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
173
+ readonly srcStart: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
174
+ readonly srcEnd: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
175
+ readonly anchorId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
176
+ readonly body: v.StringSchema<undefined>;
177
+ }, undefined>, undefined>, undefined>;
178
+ }, undefined>, undefined>, undefined>;
179
+ readonly companion: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
180
+ readonly threshold: v.NumberSchema<undefined>;
181
+ readonly maxAttempts: v.NumberSchema<undefined>;
182
+ readonly attempts: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
183
+ readonly verdicts: v.ArraySchema<v.ObjectSchema<{
184
+ readonly rating: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
185
+ readonly threshold: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>;
186
+ readonly passed: v.BooleanSchema<undefined>;
187
+ readonly feedback: v.StringSchema<undefined>;
188
+ }, undefined>, undefined>;
189
+ readonly exceeded: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
190
+ }, undefined>, undefined>, undefined>;
191
+ readonly followUps: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
192
+ readonly enabled: v.BooleanSchema<undefined>;
193
+ readonly items: v.ArraySchema<v.ObjectSchema<{
194
+ readonly id: v.StringSchema<undefined>;
195
+ readonly kind: v.PicklistSchema<["follow_up", "question"], undefined>;
196
+ readonly title: v.StringSchema<undefined>;
197
+ readonly detail: v.StringSchema<undefined>;
198
+ readonly suggestedAction: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
199
+ readonly status: v.PicklistSchema<["pending", "filed", "queued", "answered", "dismissed"], undefined>;
200
+ readonly answer: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
201
+ readonly sentToCoder: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
202
+ readonly ticketExternalId: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
203
+ readonly ticketUrl: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
204
+ readonly createdAt: v.NumberSchema<undefined>;
205
+ readonly updatedAt: v.NumberSchema<undefined>;
206
+ }, undefined>, undefined>;
207
+ readonly loops: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
208
+ readonly maxLoops: v.OptionalSchema<v.NumberSchema<undefined>, 3>;
209
+ }, undefined>, undefined>, undefined>;
210
+ readonly rework: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
211
+ readonly previousProposal: v.StringSchema<undefined>;
212
+ readonly feedback: v.StringSchema<undefined>;
213
+ readonly comments: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
214
+ readonly quotedSource: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
215
+ readonly srcStart: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
216
+ readonly srcEnd: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
217
+ readonly anchorId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
218
+ readonly body: v.StringSchema<undefined>;
219
+ }, undefined>, undefined>, undefined>;
220
+ }, undefined>, undefined>, undefined>;
221
+ readonly pendingIncorporation: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
222
+ readonly feedback: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
223
+ }, undefined>, undefined>, undefined>;
224
+ readonly pendingRecommendation: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
225
+ readonly itemIds: v.ArraySchema<v.StringSchema<undefined>, undefined>;
226
+ readonly note: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
227
+ }, undefined>, undefined>, undefined>;
228
+ readonly consensus: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
229
+ readonly enabled: v.BooleanSchema<undefined>;
230
+ readonly strategy: v.PicklistSchema<["specialist-panel", "debate", "ranked-voting"], undefined>;
231
+ readonly participants: v.ArraySchema<v.ObjectSchema<{
232
+ readonly id: v.StringSchema<undefined>;
233
+ readonly role: v.StringSchema<undefined>;
234
+ readonly systemFraming: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
235
+ readonly modelId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
236
+ }, undefined>, undefined>;
237
+ readonly synthesizerModelId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
238
+ readonly rounds: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 5, undefined>]>, undefined>;
239
+ readonly gating: v.OptionalSchema<v.ObjectSchema<{
240
+ readonly enabled: v.BooleanSchema<undefined>;
241
+ readonly minComplexity: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
242
+ readonly minRisk: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
243
+ readonly minImpact: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
244
+ readonly onMissingEstimate: v.OptionalSchema<v.PicklistSchema<["consensus", "standard"], undefined>, "consensus">;
245
+ }, undefined>, undefined>;
246
+ }, undefined>, undefined>, undefined>;
247
+ readonly gating: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
248
+ readonly enabled: v.BooleanSchema<undefined>;
249
+ readonly minComplexity: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
250
+ readonly minRisk: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
251
+ readonly minImpact: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 1, undefined>]>, undefined>;
252
+ readonly onMissingEstimate: v.OptionalSchema<v.PicklistSchema<["run", "skip"], undefined>, "run">;
253
+ }, undefined>, undefined>, undefined>;
254
+ readonly skipped: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
255
+ readonly noBusinessSpecs: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
256
+ readonly technicalCorroborated: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
257
+ readonly output: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
258
+ readonly custom: v.OptionalSchema<v.UnknownSchema, undefined>;
259
+ readonly model: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
260
+ readonly selectedFragmentIds: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
261
+ readonly jobId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
262
+ readonly startedAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
263
+ readonly finishedAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
264
+ readonly pausedAt: v.OptionalSchema<v.NullableSchema<v.NumberSchema<undefined>, undefined>, undefined>;
265
+ readonly evictionRecoveries: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
266
+ readonly transientEvictionRecoveries: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
267
+ }, undefined>, undefined>;
268
+ readonly currentStep: v.NumberSchema<undefined>;
269
+ readonly status: v.PicklistSchema<["running", "blocked", "done", "paused", "failed"], undefined>;
270
+ readonly failure: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
271
+ readonly kind: v.PicklistSchema<["preflight", "dispatch", "evicted", "timeout", "agent", "job_failed", "rejected", "companion_rejected", "cancelled", "unknown"], undefined>;
272
+ readonly message: v.StringSchema<undefined>;
273
+ readonly detail: v.NullableSchema<v.StringSchema<undefined>, undefined>;
274
+ readonly hint: v.NullableSchema<v.StringSchema<undefined>, undefined>;
275
+ readonly occurredAt: v.NumberSchema<undefined>;
276
+ readonly lastSubtasks: v.NullableSchema<v.ObjectSchema<{
277
+ readonly completed: v.NumberSchema<undefined>;
278
+ readonly inProgress: v.NumberSchema<undefined>;
279
+ readonly total: v.NumberSchema<undefined>;
280
+ readonly items: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
281
+ readonly label: v.StringSchema<undefined>;
282
+ readonly status: v.PicklistSchema<["pending", "in_progress", "completed"], undefined>;
283
+ }, undefined>, undefined>, undefined>;
284
+ }, undefined>, undefined>;
285
+ }, undefined>, undefined>, undefined>;
286
+ readonly initiatedBy: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
287
+ }, undefined>;
288
+ };
289
+ };
290
+ //# sourceMappingURL=human-review.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human-review.d.ts","sourceRoot":"","sources":["../../src/routes/human-review.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAc5B,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMxC,CAAA"}
@@ -0,0 +1,20 @@
1
+ import { defineApiContract, withObjectKeys } from '@toad-contracts/valibot';
2
+ import * as v from 'valibot';
3
+ import { executionInstanceSchema } from '../entities.js';
4
+ import { requestHumanReviewFixSchema } from '../human-review.js';
5
+ import { errorResponses } from './_shared.js';
6
+ // ---------------------------------------------------------------------------
7
+ // Human-review gate route contracts. Mounted under `/workspaces/:workspaceId`,
8
+ // so the paths here are relative to that prefix. The single route drives the
9
+ // block's parked `human-review` step and returns the updated execution instance.
10
+ // See HumanReviewController in @cat-factory/server.
11
+ // ---------------------------------------------------------------------------
12
+ const blockIdParams = withObjectKeys(v.object({ blockId: v.string() }));
13
+ export const requestHumanReviewFixContract = defineApiContract({
14
+ method: 'post',
15
+ requestPathParamsSchema: blockIdParams,
16
+ pathResolver: ({ blockId }) => `/blocks/${blockId}/human-review/request-fix`,
17
+ requestBodySchema: requestHumanReviewFixSchema,
18
+ responsesByStatusCode: { 200: executionInstanceSchema, ...errorResponses },
19
+ });
20
+ //# sourceMappingURL=human-review.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human-review.js","sourceRoot":"","sources":["../../src/routes/human-review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,iFAAiF;AACjF,oDAAoD;AACpD,8EAA8E;AAE9E,MAAM,aAAa,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAA;AAEvE,MAAM,CAAC,MAAM,6BAA6B,GAAG,iBAAiB,CAAC;IAC7D,MAAM,EAAE,MAAM;IACd,uBAAuB,EAAE,aAAa;IACtC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,WAAW,OAAO,2BAA2B;IAC5E,iBAAiB,EAAE,2BAA2B;IAC9C,qBAAqB,EAAE,EAAE,GAAG,EAAE,uBAAuB,EAAE,GAAG,cAAc,EAAE;CAC3E,CAAC,CAAA"}