ws-spec-kit 0.1.0-beta.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 (353) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +79 -0
  3. package/dist/adapters/cli/output.d.ts +15 -0
  4. package/dist/adapters/cli/output.js +21 -0
  5. package/dist/adapters/cli/output.js.map +1 -0
  6. package/dist/adapters/cli/workflow.d.ts +25 -0
  7. package/dist/adapters/cli/workflow.js +131 -0
  8. package/dist/adapters/cli/workflow.js.map +1 -0
  9. package/dist/adapters/connectors/git-native.d.ts +23 -0
  10. package/dist/adapters/connectors/git-native.js +521 -0
  11. package/dist/adapters/connectors/git-native.js.map +1 -0
  12. package/dist/adapters/connectors/github-cli.d.ts +23 -0
  13. package/dist/adapters/connectors/github-cli.js +213 -0
  14. package/dist/adapters/connectors/github-cli.js.map +1 -0
  15. package/dist/adapters/connectors/gitlab-cli.d.ts +23 -0
  16. package/dist/adapters/connectors/gitlab-cli.js +199 -0
  17. package/dist/adapters/connectors/gitlab-cli.js.map +1 -0
  18. package/dist/adapters/connectors/lark-cli.d.ts +24 -0
  19. package/dist/adapters/connectors/lark-cli.js +296 -0
  20. package/dist/adapters/connectors/lark-cli.js.map +1 -0
  21. package/dist/adapters/process/redaction.d.ts +2 -0
  22. package/dist/adapters/process/redaction.js +51 -0
  23. package/dist/adapters/process/redaction.js.map +1 -0
  24. package/dist/adapters/process/spawn-json.d.ts +37 -0
  25. package/dist/adapters/process/spawn-json.js +312 -0
  26. package/dist/adapters/process/spawn-json.js.map +1 -0
  27. package/dist/adapters/skills/claude.d.ts +1 -0
  28. package/dist/adapters/skills/claude.js +3 -0
  29. package/dist/adapters/skills/claude.js.map +1 -0
  30. package/dist/adapters/skills/codex.d.ts +1 -0
  31. package/dist/adapters/skills/codex.js +3 -0
  32. package/dist/adapters/skills/codex.js.map +1 -0
  33. package/dist/adapters/skills/cursor.d.ts +1 -0
  34. package/dist/adapters/skills/cursor.js +3 -0
  35. package/dist/adapters/skills/cursor.js.map +1 -0
  36. package/dist/adapters/skills/generic.d.ts +1 -0
  37. package/dist/adapters/skills/generic.js +2 -0
  38. package/dist/adapters/skills/generic.js.map +1 -0
  39. package/dist/adapters/skills/install.d.ts +28 -0
  40. package/dist/adapters/skills/install.js +571 -0
  41. package/dist/adapters/skills/install.js.map +1 -0
  42. package/dist/application/acquire.d.ts +60 -0
  43. package/dist/application/acquire.js +964 -0
  44. package/dist/application/acquire.js.map +1 -0
  45. package/dist/application/application.d.ts +21 -0
  46. package/dist/application/application.js +31 -0
  47. package/dist/application/application.js.map +1 -0
  48. package/dist/application/artifact-reader.d.ts +1 -0
  49. package/dist/application/artifact-reader.js +150 -0
  50. package/dist/application/artifact-reader.js.map +1 -0
  51. package/dist/application/artifact-writer.d.ts +1 -0
  52. package/dist/application/artifact-writer.js +268 -0
  53. package/dist/application/artifact-writer.js.map +1 -0
  54. package/dist/application/artifact.d.ts +28 -0
  55. package/dist/application/artifact.js +523 -0
  56. package/dist/application/artifact.js.map +1 -0
  57. package/dist/application/decide.d.ts +12 -0
  58. package/dist/application/decide.js +168 -0
  59. package/dist/application/decide.js.map +1 -0
  60. package/dist/application/doctor-connectors.d.ts +34 -0
  61. package/dist/application/doctor-connectors.js +99 -0
  62. package/dist/application/doctor-connectors.js.map +1 -0
  63. package/dist/application/external-action.d.ts +164 -0
  64. package/dist/application/external-action.js +670 -0
  65. package/dist/application/external-action.js.map +1 -0
  66. package/dist/application/initial-stages.d.ts +3 -0
  67. package/dist/application/initial-stages.js +7 -0
  68. package/dist/application/initial-stages.js.map +1 -0
  69. package/dist/application/inspect.d.ts +2 -0
  70. package/dist/application/inspect.js +31 -0
  71. package/dist/application/inspect.js.map +1 -0
  72. package/dist/application/profile.d.ts +32 -0
  73. package/dist/application/profile.js +70 -0
  74. package/dist/application/profile.js.map +1 -0
  75. package/dist/application/snapshot.d.ts +75 -0
  76. package/dist/application/snapshot.js +338 -0
  77. package/dist/application/snapshot.js.map +1 -0
  78. package/dist/application/start.d.ts +43 -0
  79. package/dist/application/start.js +360 -0
  80. package/dist/application/start.js.map +1 -0
  81. package/dist/application/state.d.ts +17 -0
  82. package/dist/application/state.js +94 -0
  83. package/dist/application/state.js.map +1 -0
  84. package/dist/application/submit.d.ts +18 -0
  85. package/dist/application/submit.js +1090 -0
  86. package/dist/application/submit.js.map +1 -0
  87. package/dist/cli/commands/core.d.ts +2 -0
  88. package/dist/cli/commands/core.js +205 -0
  89. package/dist/cli/commands/core.js.map +1 -0
  90. package/dist/cli/commands/public-contract.d.ts +12 -0
  91. package/dist/cli/commands/public-contract.js +47 -0
  92. package/dist/cli/commands/public-contract.js.map +1 -0
  93. package/dist/cli/main.d.ts +2 -0
  94. package/dist/cli/main.js +23 -0
  95. package/dist/cli/main.js.map +1 -0
  96. package/dist/domain/artifacts.d.ts +52 -0
  97. package/dist/domain/artifacts.js +241 -0
  98. package/dist/domain/artifacts.js.map +1 -0
  99. package/dist/domain/digests.d.ts +11 -0
  100. package/dist/domain/digests.js +106 -0
  101. package/dist/domain/digests.js.map +1 -0
  102. package/dist/domain/external-receipt.d.ts +48 -0
  103. package/dist/domain/external-receipt.js +138 -0
  104. package/dist/domain/external-receipt.js.map +1 -0
  105. package/dist/domain/ids.d.ts +7 -0
  106. package/dist/domain/ids.js +5 -0
  107. package/dist/domain/ids.js.map +1 -0
  108. package/dist/domain/repository-path.d.ts +3 -0
  109. package/dist/domain/repository-path.js +87 -0
  110. package/dist/domain/repository-path.js.map +1 -0
  111. package/dist/domain/states.d.ts +38 -0
  112. package/dist/domain/states.js +69 -0
  113. package/dist/domain/states.js.map +1 -0
  114. package/dist/domain/work-package-identity.d.ts +2 -0
  115. package/dist/domain/work-package-identity.js +10 -0
  116. package/dist/domain/work-package-identity.js.map +1 -0
  117. package/dist/domain/workflow.d.ts +58 -0
  118. package/dist/domain/workflow.js +2 -0
  119. package/dist/domain/workflow.js.map +1 -0
  120. package/dist/engine/actor-roles.d.ts +15 -0
  121. package/dist/engine/actor-roles.js +53 -0
  122. package/dist/engine/actor-roles.js.map +1 -0
  123. package/dist/engine/approvals.d.ts +44 -0
  124. package/dist/engine/approvals.js +239 -0
  125. package/dist/engine/approvals.js.map +1 -0
  126. package/dist/engine/archive.d.ts +24 -0
  127. package/dist/engine/archive.js +442 -0
  128. package/dist/engine/archive.js.map +1 -0
  129. package/dist/engine/compiler.d.ts +25 -0
  130. package/dist/engine/compiler.js +828 -0
  131. package/dist/engine/compiler.js.map +1 -0
  132. package/dist/engine/control/condition.d.ts +10 -0
  133. package/dist/engine/control/condition.js +49 -0
  134. package/dist/engine/control/condition.js.map +1 -0
  135. package/dist/engine/control/loop.d.ts +23 -0
  136. package/dist/engine/control/loop.js +96 -0
  137. package/dist/engine/control/loop.js.map +1 -0
  138. package/dist/engine/control/retry.d.ts +15 -0
  139. package/dist/engine/control/retry.js +54 -0
  140. package/dist/engine/control/retry.js.map +1 -0
  141. package/dist/engine/docs-integrity.d.ts +13 -0
  142. package/dist/engine/docs-integrity.js +34 -0
  143. package/dist/engine/docs-integrity.js.map +1 -0
  144. package/dist/engine/expressions/ast.d.ts +18 -0
  145. package/dist/engine/expressions/ast.js +9 -0
  146. package/dist/engine/expressions/ast.js.map +1 -0
  147. package/dist/engine/expressions/evaluate.d.ts +7 -0
  148. package/dist/engine/expressions/evaluate.js +47 -0
  149. package/dist/engine/expressions/evaluate.js.map +1 -0
  150. package/dist/engine/expressions/parser.d.ts +2 -0
  151. package/dist/engine/expressions/parser.js +173 -0
  152. package/dist/engine/expressions/parser.js.map +1 -0
  153. package/dist/engine/external-effects/authorization.d.ts +146 -0
  154. package/dist/engine/external-effects/authorization.js +222 -0
  155. package/dist/engine/external-effects/authorization.js.map +1 -0
  156. package/dist/engine/external-effects/idempotency.d.ts +14 -0
  157. package/dist/engine/external-effects/idempotency.js +26 -0
  158. package/dist/engine/external-effects/idempotency.js.map +1 -0
  159. package/dist/engine/external-effects/reconciliation.d.ts +11 -0
  160. package/dist/engine/external-effects/reconciliation.js +18 -0
  161. package/dist/engine/external-effects/reconciliation.js.map +1 -0
  162. package/dist/engine/results.d.ts +14 -0
  163. package/dist/engine/results.js +88 -0
  164. package/dist/engine/results.js.map +1 -0
  165. package/dist/engine/scheduler.d.ts +60 -0
  166. package/dist/engine/scheduler.js +225 -0
  167. package/dist/engine/scheduler.js.map +1 -0
  168. package/dist/engine/tdd/green-gate.d.ts +6 -0
  169. package/dist/engine/tdd/green-gate.js +72 -0
  170. package/dist/engine/tdd/green-gate.js.map +1 -0
  171. package/dist/engine/tdd/red-gate.d.ts +30 -0
  172. package/dist/engine/tdd/red-gate.js +531 -0
  173. package/dist/engine/tdd/red-gate.js.map +1 -0
  174. package/dist/engine/tdd/types.d.ts +89 -0
  175. package/dist/engine/tdd/types.js +38 -0
  176. package/dist/engine/tdd/types.js.map +1 -0
  177. package/dist/engine/verification.d.ts +56 -0
  178. package/dist/engine/verification.js +196 -0
  179. package/dist/engine/verification.js.map +1 -0
  180. package/dist/policy/profile.d.ts +24 -0
  181. package/dist/policy/profile.js +23 -0
  182. package/dist/policy/profile.js.map +1 -0
  183. package/dist/policy/risk.d.ts +33 -0
  184. package/dist/policy/risk.js +138 -0
  185. package/dist/policy/risk.js.map +1 -0
  186. package/dist/protocol/application.d.ts +196 -0
  187. package/dist/protocol/application.js +2 -0
  188. package/dist/protocol/application.js.map +1 -0
  189. package/dist/protocol/public-contract.d.ts +81 -0
  190. package/dist/protocol/public-contract.js +231 -0
  191. package/dist/protocol/public-contract.js.map +1 -0
  192. package/dist/protocol/work-package.d.ts +55 -0
  193. package/dist/protocol/work-package.js +2 -0
  194. package/dist/protocol/work-package.js.map +1 -0
  195. package/dist/registry/connectors/external-executor.d.ts +4 -0
  196. package/dist/registry/connectors/external-executor.js +249 -0
  197. package/dist/registry/connectors/external-executor.js.map +1 -0
  198. package/dist/registry/connectors/feishu-document.d.ts +21 -0
  199. package/dist/registry/connectors/feishu-document.js +197 -0
  200. package/dist/registry/connectors/feishu-document.js.map +1 -0
  201. package/dist/registry/connectors/git-commit.d.ts +32 -0
  202. package/dist/registry/connectors/git-commit.js +122 -0
  203. package/dist/registry/connectors/git-commit.js.map +1 -0
  204. package/dist/registry/connectors/issue.d.ts +68 -0
  205. package/dist/registry/connectors/issue.js +301 -0
  206. package/dist/registry/connectors/issue.js.map +1 -0
  207. package/dist/registry/connectors/knowledge-publish.d.ts +30 -0
  208. package/dist/registry/connectors/knowledge-publish.js +157 -0
  209. package/dist/registry/connectors/knowledge-publish.js.map +1 -0
  210. package/dist/registry/connectors/local-requirement.d.ts +19 -0
  211. package/dist/registry/connectors/local-requirement.js +177 -0
  212. package/dist/registry/connectors/local-requirement.js.map +1 -0
  213. package/dist/registry/connectors/manifest.d.ts +6 -0
  214. package/dist/registry/connectors/manifest.js +164 -0
  215. package/dist/registry/connectors/manifest.js.map +1 -0
  216. package/dist/registry/connectors/registry.d.ts +11 -0
  217. package/dist/registry/connectors/registry.js +34 -0
  218. package/dist/registry/connectors/registry.js.map +1 -0
  219. package/dist/registry/connectors/requirement-source.d.ts +46 -0
  220. package/dist/registry/connectors/requirement-source.js +513 -0
  221. package/dist/registry/connectors/requirement-source.js.map +1 -0
  222. package/dist/registry/connectors/runtime.d.ts +38 -0
  223. package/dist/registry/connectors/runtime.js +127 -0
  224. package/dist/registry/connectors/runtime.js.map +1 -0
  225. package/dist/registry/connectors/secret-detector.d.ts +19 -0
  226. package/dist/registry/connectors/secret-detector.js +85 -0
  227. package/dist/registry/connectors/secret-detector.js.map +1 -0
  228. package/dist/registry/connectors/semver.d.ts +8 -0
  229. package/dist/registry/connectors/semver.js +57 -0
  230. package/dist/registry/connectors/semver.js.map +1 -0
  231. package/dist/registry/connectors/types.d.ts +45 -0
  232. package/dist/registry/connectors/types.js +2 -0
  233. package/dist/registry/connectors/types.js.map +1 -0
  234. package/dist/registry/executors/registry.d.ts +15 -0
  235. package/dist/registry/executors/registry.js +68 -0
  236. package/dist/registry/executors/registry.js.map +1 -0
  237. package/dist/registry/executors/types.d.ts +19 -0
  238. package/dist/registry/executors/types.js +2 -0
  239. package/dist/registry/executors/types.js.map +1 -0
  240. package/dist/registry/skills/lock.d.ts +3 -0
  241. package/dist/registry/skills/lock.js +278 -0
  242. package/dist/registry/skills/lock.js.map +1 -0
  243. package/dist/registry/skills/resolver.d.ts +16 -0
  244. package/dist/registry/skills/resolver.js +353 -0
  245. package/dist/registry/skills/resolver.js.map +1 -0
  246. package/dist/registry/skills/types.d.ts +75 -0
  247. package/dist/registry/skills/types.js +9 -0
  248. package/dist/registry/skills/types.js.map +1 -0
  249. package/dist/resources/catalog.d.ts +20 -0
  250. package/dist/resources/catalog.js +111 -0
  251. package/dist/resources/catalog.js.map +1 -0
  252. package/dist/schemas/definitions.d.ts +5 -0
  253. package/dist/schemas/definitions.js +958 -0
  254. package/dist/schemas/definitions.js.map +1 -0
  255. package/dist/schemas/generate.d.ts +1 -0
  256. package/dist/schemas/generate.js +26 -0
  257. package/dist/schemas/generate.js.map +1 -0
  258. package/dist/schemas/index.d.ts +11 -0
  259. package/dist/schemas/index.js +54 -0
  260. package/dist/schemas/index.js.map +1 -0
  261. package/dist/storage/control-plane.d.ts +136 -0
  262. package/dist/storage/control-plane.js +688 -0
  263. package/dist/storage/control-plane.js.map +1 -0
  264. package/dist/storage/events.d.ts +36 -0
  265. package/dist/storage/events.js +185 -0
  266. package/dist/storage/events.js.map +1 -0
  267. package/dist/storage/external-action-payload.d.ts +33 -0
  268. package/dist/storage/external-action-payload.js +190 -0
  269. package/dist/storage/external-action-payload.js.map +1 -0
  270. package/dist/storage/files.d.ts +13 -0
  271. package/dist/storage/files.js +45 -0
  272. package/dist/storage/files.js.map +1 -0
  273. package/dist/storage/git.d.ts +4 -0
  274. package/dist/storage/git.js +21 -0
  275. package/dist/storage/git.js.map +1 -0
  276. package/dist/storage/project-config.d.ts +11 -0
  277. package/dist/storage/project-config.js +60 -0
  278. package/dist/storage/project-config.js.map +1 -0
  279. package/dist/storage/repository.d.ts +14 -0
  280. package/dist/storage/repository.js +151 -0
  281. package/dist/storage/repository.js.map +1 -0
  282. package/dist/storage/work-items.d.ts +77 -0
  283. package/dist/storage/work-items.js +373 -0
  284. package/dist/storage/work-items.js.map +1 -0
  285. package/dist/storage/workflow-trust.d.ts +38 -0
  286. package/dist/storage/workflow-trust.js +310 -0
  287. package/dist/storage/workflow-trust.js.map +1 -0
  288. package/dist/workflow-package/loader.d.ts +12 -0
  289. package/dist/workflow-package/loader.js +249 -0
  290. package/dist/workflow-package/loader.js.map +1 -0
  291. package/dist/workflow-package/lock.d.ts +6 -0
  292. package/dist/workflow-package/lock.js +12 -0
  293. package/dist/workflow-package/lock.js.map +1 -0
  294. package/dist/workflow-package/path-boundary.d.ts +5 -0
  295. package/dist/workflow-package/path-boundary.js +38 -0
  296. package/dist/workflow-package/path-boundary.js.map +1 -0
  297. package/dist/workflow-package/trust.d.ts +27 -0
  298. package/dist/workflow-package/trust.js +61 -0
  299. package/dist/workflow-package/trust.js.map +1 -0
  300. package/dist/workflow-package/types.d.ts +176 -0
  301. package/dist/workflow-package/types.js +9 -0
  302. package/dist/workflow-package/types.js.map +1 -0
  303. package/dist/workflow-package/workflow-v1.d.ts +3 -0
  304. package/dist/workflow-package/workflow-v1.js +274 -0
  305. package/dist/workflow-package/workflow-v1.js.map +1 -0
  306. package/package.json +40 -0
  307. package/resources/catalog.yaml +37 -0
  308. package/resources/connectors/github-cli.yaml +24 -0
  309. package/resources/connectors/gitlab-cli.yaml +24 -0
  310. package/resources/connectors/lark-cli.yaml +28 -0
  311. package/resources/skills/bug-fixing/SKILL.md +16 -0
  312. package/resources/skills/code-review/SKILL.md +16 -0
  313. package/resources/skills/documentation-editing/SKILL.md +16 -0
  314. package/resources/skills/documentation-exploration/SKILL.md +16 -0
  315. package/resources/skills/documentation-review/SKILL.md +16 -0
  316. package/resources/skills/requirement-exploration/SKILL.md +16 -0
  317. package/resources/skills/solution-design/SKILL.md +16 -0
  318. package/resources/skills/task-planning/SKILL.md +16 -0
  319. package/resources/skills/tdd-implementation/SKILL.md +16 -0
  320. package/resources/workflows/documentation-delivery/manifest.yaml +8 -0
  321. package/resources/workflows/documentation-delivery/profiles/governed.yaml +23 -0
  322. package/resources/workflows/documentation-delivery/profiles/quick.yaml +23 -0
  323. package/resources/workflows/documentation-delivery/profiles/standard.yaml +21 -0
  324. package/resources/workflows/documentation-delivery/workflow.yaml +109 -0
  325. package/resources/workflows/feature-delivery/manifest.yaml +8 -0
  326. package/resources/workflows/feature-delivery/profiles/governed.yaml +27 -0
  327. package/resources/workflows/feature-delivery/profiles/quick.yaml +25 -0
  328. package/resources/workflows/feature-delivery/profiles/standard.yaml +26 -0
  329. package/resources/workflows/feature-delivery/workflow.yaml +150 -0
  330. package/schemas/builtin-agent-action-v1.schema.json +509 -0
  331. package/schemas/builtin-application-acquire-input-v1.schema.json +25 -0
  332. package/schemas/builtin-application-artifact-create-input-v1.schema.json +49 -0
  333. package/schemas/builtin-application-decision-input-v1.schema.json +284 -0
  334. package/schemas/builtin-application-inspect-input-v1.schema.json +20 -0
  335. package/schemas/builtin-application-project-config-snapshot-v1.schema.json +289 -0
  336. package/schemas/builtin-application-project-config-v1.schema.json +293 -0
  337. package/schemas/builtin-application-start-input-v1.schema.json +92 -0
  338. package/schemas/builtin-application-submit-input-v1.schema.json +145 -0
  339. package/schemas/builtin-artifact-v1.schema.json +48 -0
  340. package/schemas/builtin-evidence-v1.schema.json +65 -0
  341. package/schemas/builtin-external-action-grant-v1.schema.json +298 -0
  342. package/schemas/builtin-external-action-request-v1.schema.json +288 -0
  343. package/schemas/builtin-external-binding-v1.schema.json +59 -0
  344. package/schemas/builtin-external-receipt-v1.schema.json +109 -0
  345. package/schemas/builtin-external-write-receipt-v1.schema.json +253 -0
  346. package/schemas/builtin-source-artifact-v1.schema.json +293 -0
  347. package/schemas/builtin-submit-result-v1.schema.json +111 -0
  348. package/schemas/builtin-tdd-cycle-evidence-v1.schema.json +119 -0
  349. package/schemas/builtin-tdd-node-test-report-v1.schema.json +103 -0
  350. package/schemas/builtin-tdd-trusted-evidence-v1.schema.json +184 -0
  351. package/schemas/builtin-work-item-v1.schema.json +201 -0
  352. package/schemas/builtin-work-package-v1.schema.json +254 -0
  353. package/schemas/builtin-workflow-selection-v1.schema.json +40 -0
@@ -0,0 +1,958 @@
1
+ export const schemaIds = [
2
+ "builtin.workflow-selection.v1",
3
+ "builtin.application-project-config.v1",
4
+ "builtin.application-project-config-snapshot.v1",
5
+ "builtin.source-artifact.v1",
6
+ "builtin.work-item.v1",
7
+ "builtin.application-start-input.v1",
8
+ "builtin.application-acquire-input.v1",
9
+ "builtin.application-artifact-create-input.v1",
10
+ "builtin.application-submit-input.v1",
11
+ "builtin.application-decision-input.v1",
12
+ "builtin.application-inspect-input.v1",
13
+ "builtin.agent-action.v1",
14
+ "builtin.work-package.v1",
15
+ "builtin.submit-result.v1",
16
+ "builtin.evidence.v1",
17
+ "builtin.tdd-trusted-evidence.v1",
18
+ "builtin.tdd-cycle-evidence.v1",
19
+ "builtin.tdd-node-test-report.v1",
20
+ "builtin.external-binding.v1",
21
+ "builtin.external-receipt.v1",
22
+ "builtin.external-action-request.v1",
23
+ "builtin.external-action-grant.v1",
24
+ "builtin.external-write-receipt.v1",
25
+ "builtin.artifact.v1",
26
+ ];
27
+ const idPattern = "^[a-z][a-z0-9-]{0,62}$";
28
+ const gateIdPattern = "^[a-z][a-z0-9.-]{0,62}$";
29
+ const stepInstanceIdPattern = "^[a-z][a-z0-9-]{0,62}(?::[1-9][0-9]*:[a-z][a-z0-9-]{0,62})?$";
30
+ const digestPattern = "^sha256:.+$";
31
+ const repositoryIdPattern = "^repo-[0-9A-HJKMNP-TV-Z]{26}$";
32
+ const workItemIdPattern = "^WSS-[A-Za-z0-9-]+$";
33
+ const attemptIdPattern = "^attempt-.+$";
34
+ const errorCodePattern = "^WSSPEC_[A-Z0-9_]+$";
35
+ const stringArray = { type: "array", items: { type: "string" }, uniqueItems: true };
36
+ const testPathRuleSchema = { enum: ["node", "java", "ruby", "dotnet"] };
37
+ const approvalSchema = {
38
+ type: "object",
39
+ additionalProperties: false,
40
+ required: ["required"],
41
+ properties: {
42
+ required: { type: "boolean" },
43
+ provider: { enum: ["interactive"] },
44
+ },
45
+ allOf: [
46
+ {
47
+ if: { properties: { required: { const: true } }, required: ["required"] },
48
+ then: { properties: { provider: { enum: ["interactive"] } }, required: ["provider"] },
49
+ },
50
+ ],
51
+ };
52
+ const stageSchema = {
53
+ type: "object",
54
+ additionalProperties: false,
55
+ required: ["id", "kind", "owner", "uses"],
56
+ properties: {
57
+ id: { type: "string", pattern: idPattern },
58
+ kind: { enum: ["define", "design", "plan", "implement", "review", "verify", "publish", "close"] },
59
+ owner: { enum: ["agent", "engine"] },
60
+ uses: { type: "string", pattern: "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9-]*$" },
61
+ needs: stringArray,
62
+ input: stringArray,
63
+ output: stringArray,
64
+ approval: approvalSchema,
65
+ gates: stringArray,
66
+ publish: stringArray,
67
+ },
68
+ };
69
+ const gateSchema = {
70
+ type: "object",
71
+ additionalProperties: false,
72
+ required: ["command", "cwd", "timeoutSeconds", "required", "evidence"],
73
+ properties: {
74
+ command: { type: "array", minItems: 1, items: { type: "string" } },
75
+ cwd: { const: "worktree" },
76
+ timeoutSeconds: { type: "integer", minimum: 1, maximum: 86400 },
77
+ required: { type: "boolean" },
78
+ evidence: { enum: ["trusted", "attested"] },
79
+ inheritEnv: {
80
+ type: "array",
81
+ items: { type: "string", pattern: "^[A-Z_][A-Z0-9_]*$" },
82
+ uniqueItems: true,
83
+ },
84
+ env: {
85
+ type: "object",
86
+ propertyNames: { pattern: "^[A-Z_][A-Z0-9_]*$" },
87
+ additionalProperties: { type: "string" },
88
+ },
89
+ reporter: {
90
+ type: "object",
91
+ additionalProperties: false,
92
+ required: ["type", "version"],
93
+ properties: { type: { const: "node-test" }, version: { const: 1 } },
94
+ },
95
+ },
96
+ };
97
+ const artifactReferenceSchema = {
98
+ type: "object",
99
+ additionalProperties: false,
100
+ required: ["artifactType", "schemaVersion"],
101
+ properties: {
102
+ artifactType: { type: "string", pattern: idPattern },
103
+ outputId: { type: "string", pattern: idPattern },
104
+ artifactId: { type: "string", minLength: 1, maxLength: 128 },
105
+ schemaVersion: { type: "integer", minimum: 1 },
106
+ path: { type: "string" },
107
+ revision: { type: "integer", minimum: 1 },
108
+ contentHash: { type: "string", pattern: digestPattern },
109
+ mediaType: { type: "string" },
110
+ contentLevel: { type: "string", minLength: 1 },
111
+ },
112
+ };
113
+ const artifactExpectationSchema = {
114
+ type: "object",
115
+ additionalProperties: false,
116
+ required: ["artifactType", "schemaVersion"],
117
+ properties: {
118
+ artifactType: { type: "string", pattern: idPattern },
119
+ outputId: { type: "string", pattern: idPattern },
120
+ schemaVersion: { type: "integer", minimum: 1 },
121
+ contentLevel: { type: "string", minLength: 1 },
122
+ },
123
+ };
124
+ const sourceMetadataSchema = (keys) => ({
125
+ type: "object",
126
+ additionalProperties: false,
127
+ maxProperties: 16,
128
+ properties: Object.fromEntries(keys.map((key) => [key, {
129
+ oneOf: [
130
+ { type: "string", minLength: 1, maxLength: 256 },
131
+ { type: "array", maxItems: 32, items: { type: "string", minLength: 1, maxLength: 256 } },
132
+ ],
133
+ }])),
134
+ });
135
+ const sourceArtifactSchema = {
136
+ type: "object",
137
+ additionalProperties: false,
138
+ required: ["version", "artifactType", "schemaVersion", "artifactId", "type", "stableId", "title", "body", "metadata", "contentDigest"],
139
+ properties: {
140
+ version: { const: 1 },
141
+ artifactType: { const: "requirement-source" },
142
+ schemaVersion: { const: 1 },
143
+ artifactId: { type: "string", pattern: "^source-[a-f0-9]{64}$" },
144
+ type: { enum: ["user.prompt", "local.file", "github.issue", "gitlab.issue", "feishu.document"] },
145
+ stableId: { type: "string", minLength: 1, maxLength: 512 },
146
+ canonicalUrl: { type: "string", format: "uri", maxLength: 2048 },
147
+ title: { type: "string", minLength: 1, maxLength: 512 },
148
+ body: { type: "string", minLength: 1, maxLength: 524288 },
149
+ updatedAt: { type: "string", format: "date-time" },
150
+ metadata: { type: "object" },
151
+ contentDigest: { type: "string", pattern: "^sha256:[a-f0-9]{64}$" },
152
+ },
153
+ allOf: [
154
+ { if: { properties: { type: { enum: ["user.prompt", "local.file"] } }, required: ["type"] }, then: { properties: { metadata: sourceMetadataSchema([]) } } },
155
+ { if: { properties: { type: { enum: ["github.issue", "gitlab.issue"] } }, required: ["type"] }, then: { properties: { metadata: sourceMetadataSchema(["assignees", "author", "labels", "repository", "state"]) } } },
156
+ { if: { properties: { type: { const: "feishu.document" } }, required: ["type"] }, then: { properties: { metadata: sourceMetadataSchema(["owner", "revision", "space"]) } } },
157
+ ],
158
+ };
159
+ const requirementSourceSchema = {
160
+ oneOf: [
161
+ {
162
+ type: "object", additionalProperties: false, required: ["type", "text"],
163
+ properties: { type: { const: "prompt" }, text: { type: "string", minLength: 1 } },
164
+ },
165
+ {
166
+ type: "object", additionalProperties: false, required: ["type", "path"],
167
+ properties: { type: { const: "file" }, path: { type: "string", minLength: 1 } },
168
+ },
169
+ {
170
+ type: "object", additionalProperties: false, required: ["type", "provider", "id"],
171
+ properties: {
172
+ type: { const: "issue" }, provider: { type: "string", minLength: 1 },
173
+ id: { type: "string", minLength: 1 }, url: { type: "string", format: "uri" },
174
+ },
175
+ },
176
+ ],
177
+ };
178
+ const submitResultSchema = {
179
+ type: "object",
180
+ additionalProperties: false,
181
+ required: ["version", "status", "summary", "modifiedFiles", "artifacts", "commands", "evidence", "externalWrites", "remainingRisks"],
182
+ properties: {
183
+ version: { const: 1 },
184
+ status: { enum: ["completed", "failed"] },
185
+ summary: { type: "string", minLength: 1 },
186
+ modifiedFiles: stringArray,
187
+ artifacts: { type: "array", items: artifactReferenceSchema },
188
+ commands: { type: "array", items: { type: "object" } },
189
+ evidence: { type: "array", items: { type: "object" } },
190
+ externalWrites: { type: "array", items: { type: "object" } },
191
+ remainingRisks: { type: "array", items: { type: "object" } },
192
+ },
193
+ };
194
+ const strictDigestSchema = { type: "string", pattern: "^sha256:[a-f0-9]{64}$" };
195
+ const externalTargetSchema = {
196
+ type: "object",
197
+ additionalProperties: false,
198
+ required: ["kind", "stableId"],
199
+ properties: {
200
+ kind: { enum: ["repository", "issue", "knowledge"] },
201
+ stableId: { type: "string", minLength: 1, maxLength: 4096 },
202
+ },
203
+ };
204
+ const externalActionIdentityProperties = {
205
+ requestId: { type: "string", pattern: "^external-request-[a-f0-9]{64}$" },
206
+ requestDigest: strictDigestSchema,
207
+ workItemId: { type: "string", pattern: workItemIdPattern },
208
+ stepId: { type: "string", pattern: stepInstanceIdPattern },
209
+ attemptId: { type: "string", pattern: attemptIdPattern },
210
+ provider: { type: "string", pattern: "^[a-z][a-z0-9-]{0,62}$" },
211
+ action: { enum: ["git.commit", "issue.update", "knowledge.publish", "issue.close"] },
212
+ securityClass: { enum: ["local-write", "external-write"] },
213
+ target: externalTargetSchema,
214
+ externalEffectKind: { const: "issue.comment" },
215
+ payloadDigest: strictDigestSchema,
216
+ expectedContentDigest: strictDigestSchema,
217
+ payloadArtifactDigest: strictDigestSchema,
218
+ bindingDigest: strictDigestSchema,
219
+ inputDigest: strictDigestSchema,
220
+ artifactDigests: { type: "array", uniqueItems: true, items: strictDigestSchema },
221
+ idempotencyKey: { type: "string", pattern: "^external:[a-f0-9]{64}$" },
222
+ profile: { enum: ["quick", "standard", "governed"] },
223
+ profileDigest: strictDigestSchema,
224
+ workspaceDigest: strictDigestSchema,
225
+ configDigest: strictDigestSchema,
226
+ };
227
+ const governedActionConditions = [
228
+ {
229
+ if: { properties: { externalEffectKind: { const: "issue.comment" } }, required: ["externalEffectKind"] },
230
+ then: { properties: {
231
+ action: { const: "issue.update" },
232
+ securityClass: { const: "external-write" },
233
+ target: { type: "object", properties: { kind: { const: "issue" } } },
234
+ } },
235
+ },
236
+ {
237
+ if: { properties: { action: { const: "knowledge.publish" } }, required: ["action"] },
238
+ then: { properties: {
239
+ securityClass: { const: "external-write" },
240
+ target: { type: "object", properties: { kind: { const: "knowledge" } } },
241
+ } },
242
+ },
243
+ {
244
+ if: { properties: { action: { enum: ["issue.update", "issue.close"] } }, required: ["action"] },
245
+ then: { properties: {
246
+ securityClass: { const: "external-write" },
247
+ target: { type: "object", properties: { kind: { const: "issue" } } },
248
+ } },
249
+ },
250
+ {
251
+ if: { properties: { action: { const: "git.commit" } }, required: ["action"] },
252
+ then: { properties: {
253
+ provider: { const: "git-native" },
254
+ securityClass: { const: "local-write" },
255
+ target: { type: "object", properties: { kind: { const: "repository" } } },
256
+ } },
257
+ },
258
+ ];
259
+ const governedReceiptConditions = [
260
+ {
261
+ if: { properties: { externalEffectKind: { const: "issue.comment" } }, required: ["externalEffectKind"] },
262
+ then: {
263
+ properties: { externalEffectId: { type: "string", pattern: "^(?:github-comment|gitlab-note):[1-9][0-9]{0,15}$" } },
264
+ required: ["externalEffectId"],
265
+ },
266
+ else: { properties: { externalEffectId: false } },
267
+ },
268
+ {
269
+ if: { properties: { action: { const: "knowledge.publish" } }, required: ["action"] },
270
+ then: { properties: { target: { type: "object", properties: { kind: { const: "knowledge" } } } } },
271
+ },
272
+ {
273
+ if: { properties: { action: { enum: ["issue.update", "issue.close"] } }, required: ["action"] },
274
+ then: { properties: { target: { type: "object", properties: { kind: { const: "issue" } } } } },
275
+ },
276
+ {
277
+ if: { properties: { action: { const: "git.commit" } }, required: ["action"] },
278
+ then: { properties: {
279
+ provider: { const: "git-native" },
280
+ target: { type: "object", properties: { kind: { const: "repository" } } },
281
+ } },
282
+ },
283
+ ];
284
+ const workPackageSchema = {
285
+ type: "object",
286
+ additionalProperties: false,
287
+ required: ["version", "workItemId", "stepId", "attemptId", "lease", "objective", "skills", "artifacts", "constraints", "requiredOutputs", "gates", "resultSchema"],
288
+ properties: {
289
+ version: { const: 1 },
290
+ workItemId: { type: "string", pattern: workItemIdPattern },
291
+ stepId: { type: "string", pattern: stepInstanceIdPattern },
292
+ attemptId: { type: "string", pattern: attemptIdPattern },
293
+ lease: {
294
+ type: "object", additionalProperties: false, required: ["token", "expiresAt"],
295
+ properties: { token: { type: "string", minLength: 1 }, expiresAt: { type: "string", format: "date-time" } },
296
+ },
297
+ objective: { type: "string", minLength: 1 },
298
+ artifactLevel: { type: "string", minLength: 1 },
299
+ skills: {
300
+ type: "array",
301
+ items: {
302
+ type: "object", additionalProperties: false, required: ["ref", "version", "digest", "description"],
303
+ properties: {
304
+ ref: { type: "string", minLength: 1 }, version: { type: "string", minLength: 1 },
305
+ digest: { type: "string", pattern: digestPattern }, description: { type: "string", minLength: 1 },
306
+ },
307
+ },
308
+ },
309
+ artifacts: { type: "array", items: artifactReferenceSchema },
310
+ constraints: {
311
+ type: "object", additionalProperties: false, required: ["allowedPaths", "forbiddenActions"],
312
+ properties: { allowedPaths: stringArray, forbiddenActions: stringArray },
313
+ },
314
+ requiredOutputs: { type: "array", items: artifactExpectationSchema },
315
+ artifactAuthoring: {
316
+ type: "object", additionalProperties: false, required: ["version", "maxContentBytes", "draftRoots"],
317
+ properties: {
318
+ version: { const: 1 },
319
+ maxContentBytes: { type: "integer", minimum: 1, maximum: 1_048_576 },
320
+ draftRoots: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1 } },
321
+ },
322
+ },
323
+ gates: {
324
+ type: "array",
325
+ items: {
326
+ type: "object", additionalProperties: false, required: ["id", "evidence", "required"],
327
+ properties: {
328
+ id: { type: "string", pattern: gateIdPattern },
329
+ evidence: { enum: ["trusted", "attested", "reported"] }, required: { type: "boolean" },
330
+ },
331
+ },
332
+ },
333
+ resultSchema: { const: "builtin.submit-result.v1" },
334
+ },
335
+ };
336
+ const publishBinding = (properties) => ({
337
+ anyOf: [
338
+ { type: "null" },
339
+ {
340
+ type: "object",
341
+ additionalProperties: false,
342
+ required: Object.keys(properties).slice(0, 3),
343
+ properties,
344
+ },
345
+ ],
346
+ });
347
+ function applicationProjectConfigSchema(id, portable) {
348
+ return {
349
+ $schema: "https://json-schema.org/draft/2020-12/schema",
350
+ $id: id,
351
+ type: "object",
352
+ additionalProperties: false,
353
+ required: ["version"],
354
+ properties: {
355
+ version: { const: 1 },
356
+ trigger: {
357
+ type: "object",
358
+ additionalProperties: false,
359
+ required: ["mode"],
360
+ properties: { mode: { enum: ["off", "suggest", "active-only"] } },
361
+ },
362
+ git: {
363
+ type: "object",
364
+ additionalProperties: false,
365
+ required: ["worktrees"],
366
+ properties: {
367
+ worktrees: {
368
+ type: "object",
369
+ additionalProperties: false,
370
+ required: ["enabled", "root", "branchPrefix"],
371
+ properties: {
372
+ enabled: { const: true },
373
+ root: { type: "string", minLength: 1 },
374
+ branchPrefix: { type: "string", minLength: 1 },
375
+ },
376
+ },
377
+ },
378
+ },
379
+ runtime: {
380
+ type: "object",
381
+ additionalProperties: false,
382
+ required: ["claimTtlSeconds", "maxStageRetries"],
383
+ properties: {
384
+ claimTtlSeconds: { type: "integer", minimum: 60, maximum: 86400 },
385
+ maxStageRetries: { type: "integer", minimum: 0, maximum: 10 },
386
+ },
387
+ },
388
+ quality: {
389
+ type: "object",
390
+ additionalProperties: false,
391
+ required: ["gates"],
392
+ properties: {
393
+ gates: {
394
+ type: "object",
395
+ minProperties: 1,
396
+ propertyNames: { pattern: idPattern },
397
+ additionalProperties: gateSchema,
398
+ },
399
+ },
400
+ },
401
+ testing: {
402
+ type: "object",
403
+ additionalProperties: false,
404
+ required: ["pathRules", "testAssetPaths", "productPaths"],
405
+ properties: {
406
+ pathRules: { type: "array", minItems: 1, uniqueItems: true, items: testPathRuleSchema },
407
+ testAssetPaths: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 1024 } },
408
+ productPaths: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 1024 } },
409
+ },
410
+ },
411
+ publishing: {
412
+ type: "object",
413
+ additionalProperties: false,
414
+ required: ["targets"],
415
+ properties: {
416
+ targets: {
417
+ type: "object",
418
+ additionalProperties: false,
419
+ properties: {
420
+ knowledge: {
421
+ type: "object",
422
+ additionalProperties: false,
423
+ required: ["provider", "document"],
424
+ properties: {
425
+ provider: { const: "feishu" },
426
+ document: { type: "string", minLength: 1, maxLength: 2048 },
427
+ },
428
+ },
429
+ },
430
+ },
431
+ },
432
+ },
433
+ documentation: {
434
+ type: "object",
435
+ additionalProperties: false,
436
+ required: ["allowedPaths"],
437
+ properties: {
438
+ allowedPaths: {
439
+ type: "array",
440
+ minItems: 1,
441
+ uniqueItems: true,
442
+ items: { type: "string", minLength: 1 },
443
+ },
444
+ },
445
+ },
446
+ skills: {
447
+ type: "object",
448
+ additionalProperties: false,
449
+ required: ["additionalGlobalRoots"],
450
+ properties: {
451
+ additionalGlobalRoots: {
452
+ type: "array",
453
+ minItems: 1,
454
+ ...(portable ? { uniqueItems: true } : {}),
455
+ items: {
456
+ type: "object",
457
+ additionalProperties: false,
458
+ required: portable ? ["id"] : ["id", "path"],
459
+ properties: {
460
+ id: { type: "string", pattern: idPattern },
461
+ ...(portable ? {} : { path: { type: "string", minLength: 1 } }),
462
+ },
463
+ },
464
+ },
465
+ },
466
+ },
467
+ },
468
+ };
469
+ }
470
+ export const schemas = {
471
+ "builtin.workflow-selection.v1": {
472
+ $schema: "https://json-schema.org/draft/2020-12/schema",
473
+ $id: "builtin.workflow-selection.v1",
474
+ type: "object",
475
+ additionalProperties: false,
476
+ required: ["version", "activeWorkflow"],
477
+ properties: {
478
+ version: { const: 1 },
479
+ activeWorkflow: {
480
+ type: "object",
481
+ additionalProperties: false,
482
+ required: ["ref", "version"],
483
+ properties: {
484
+ ref: { type: "string", pattern: "^(builtin|project)://workflows/[a-z0-9][a-z0-9-]*$" },
485
+ version: { const: 1 },
486
+ },
487
+ },
488
+ profile: { enum: ["auto", "quick", "standard", "governed"] },
489
+ },
490
+ },
491
+ "builtin.application-project-config.v1": applicationProjectConfigSchema("builtin.application-project-config.v1", false),
492
+ "builtin.application-project-config-snapshot.v1": applicationProjectConfigSchema("builtin.application-project-config-snapshot.v1", true),
493
+ "builtin.source-artifact.v1": {
494
+ $schema: "https://json-schema.org/draft/2020-12/schema",
495
+ $id: "builtin.source-artifact.v1",
496
+ ...sourceArtifactSchema,
497
+ },
498
+ "builtin.work-item.v1": {
499
+ $schema: "https://json-schema.org/draft/2020-12/schema",
500
+ $id: "builtin.work-item.v1",
501
+ type: "object",
502
+ additionalProperties: false,
503
+ required: ["version", "workItemId", "repositoryId", "title", "createdAt", "status", "execution", "source", "bindings"],
504
+ properties: {
505
+ version: { const: 1 },
506
+ workItemId: { type: "string", pattern: workItemIdPattern },
507
+ repositoryId: { type: "string", pattern: repositoryIdPattern },
508
+ title: { type: "string", minLength: 1 },
509
+ createdAt: { type: "string", format: "date-time" },
510
+ status: { enum: ["draft", "active", "awaiting_approval", "verifying", "verified", "blocked", "pending_publish", "reconciliation_required", "paused", "closed", "cancelled"] },
511
+ execution: {
512
+ type: "object",
513
+ additionalProperties: false,
514
+ required: ["worktree", "branch", "baselineRevision", "baselineTreeDigest", "workflowDigest", "configDigest", "schemaDigest"],
515
+ properties: {
516
+ worktree: { type: "string", minLength: 1 },
517
+ branch: { type: "string", minLength: 1 },
518
+ baselineRevision: { type: "string", minLength: 1 },
519
+ baselineTreeDigest: { type: "string", pattern: digestPattern },
520
+ workflowDigest: { type: "string", pattern: digestPattern },
521
+ configDigest: { type: "string", pattern: digestPattern },
522
+ schemaDigest: { type: "string", pattern: digestPattern },
523
+ },
524
+ },
525
+ source: {
526
+ type: "object",
527
+ additionalProperties: false,
528
+ required: ["type", "artifactId", "snapshot", "contentDigest", "artifactDigest"],
529
+ properties: {
530
+ type: { enum: ["user.prompt", "local.file", "github.issue", "gitlab.issue", "feishu.document"] },
531
+ artifactId: { type: "string", pattern: "^source-[a-f0-9]{64}$" },
532
+ snapshot: { type: "string", minLength: 1 },
533
+ contentDigest: { type: "string", pattern: digestPattern },
534
+ artifactDigest: { type: "string", pattern: "^sha256:[a-f0-9]{64}$" },
535
+ },
536
+ },
537
+ bindings: {
538
+ type: "object",
539
+ additionalProperties: false,
540
+ required: ["issue", "knowledge"],
541
+ properties: {
542
+ issue: publishBinding({ provider: { type: "string" }, stableId: { type: "string" }, url: { type: "string" } }),
543
+ knowledge: publishBinding({ adapter: { type: "string" }, space: { type: "string" }, stableId: { type: "string" }, url: { type: "string" } }),
544
+ },
545
+ },
546
+ },
547
+ },
548
+ "builtin.application-start-input.v1": {
549
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.application-start-input.v1",
550
+ type: "object", additionalProperties: false, required: ["root", "source"],
551
+ properties: {
552
+ root: { type: "string", minLength: 1 }, source: requirementSourceSchema,
553
+ workflowRef: { type: "string", minLength: 1 },
554
+ profile: { enum: ["auto", "quick", "standard", "governed"] },
555
+ },
556
+ },
557
+ "builtin.application-acquire-input.v1": {
558
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.application-acquire-input.v1",
559
+ type: "object", additionalProperties: false, required: ["root", "workItemId", "actor"],
560
+ properties: {
561
+ root: { type: "string", minLength: 1 }, workItemId: { type: "string", pattern: workItemIdPattern },
562
+ actor: { type: "string", minLength: 1 },
563
+ },
564
+ },
565
+ "builtin.application-artifact-create-input.v1": {
566
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.application-artifact-create-input.v1",
567
+ type: "object", additionalProperties: false,
568
+ required: ["root", "workItemId", "stepId", "attemptId", "leaseToken", "artifactType", "contentFile"],
569
+ properties: {
570
+ root: { type: "string", minLength: 1 }, workItemId: { type: "string", pattern: workItemIdPattern },
571
+ stepId: { type: "string", pattern: stepInstanceIdPattern }, attemptId: { type: "string", pattern: attemptIdPattern },
572
+ leaseToken: { type: "string", minLength: 1 }, artifactType: { type: "string", pattern: idPattern },
573
+ outputId: { type: "string", pattern: idPattern }, contentFile: { type: "string", minLength: 1 },
574
+ },
575
+ },
576
+ "builtin.application-submit-input.v1": {
577
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.application-submit-input.v1",
578
+ type: "object", additionalProperties: false,
579
+ required: ["root", "workItemId", "stepId", "attemptId", "leaseToken", "result"],
580
+ properties: {
581
+ root: { type: "string", minLength: 1 }, workItemId: { type: "string", pattern: workItemIdPattern },
582
+ stepId: { type: "string", pattern: stepInstanceIdPattern }, attemptId: { type: "string", pattern: attemptIdPattern },
583
+ leaseToken: { type: "string", minLength: 1 }, result: submitResultSchema,
584
+ },
585
+ },
586
+ "builtin.application-decision-input.v1": {
587
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.application-decision-input.v1",
588
+ oneOf: [
589
+ {
590
+ type: "object", additionalProperties: false,
591
+ required: ["kind", "root", "workItemId", "requestId", "decision", "expectedDigest", "actor"],
592
+ properties: {
593
+ kind: { const: "approval" }, root: { type: "string", minLength: 1 },
594
+ workItemId: { type: "string", pattern: workItemIdPattern }, requestId: { type: "string", minLength: 1 },
595
+ decision: { enum: ["approved", "rejected"] }, expectedDigest: { type: "string", pattern: digestPattern },
596
+ actor: { type: "string", minLength: 1 },
597
+ },
598
+ },
599
+ {
600
+ type: "object", additionalProperties: false,
601
+ required: ["kind", "root", "requestId", "decision", "expectedPackageDigest", "expectedCapabilityDigest", "actor"],
602
+ properties: {
603
+ kind: { const: "workflow_trust" }, root: { type: "string", minLength: 1 },
604
+ requestId: { type: "string", minLength: 1 }, decision: { enum: ["trusted", "rejected"] },
605
+ expectedPackageDigest: { type: "string", pattern: digestPattern },
606
+ expectedCapabilityDigest: { type: "string", pattern: digestPattern }, actor: { type: "string", minLength: 1 },
607
+ },
608
+ },
609
+ {
610
+ type: "object", additionalProperties: false,
611
+ required: ["kind", "root", "workItemId", "requestId", "decision", "expectedDigest", "actor"],
612
+ properties: {
613
+ kind: { const: "external_action" }, root: { type: "string", minLength: 1 },
614
+ workItemId: { type: "string", pattern: workItemIdPattern }, requestId: { type: "string", minLength: 1 },
615
+ decision: { enum: ["approved", "rejected"] }, expectedDigest: { type: "string", pattern: digestPattern },
616
+ actor: { type: "string", minLength: 1 },
617
+ },
618
+ },
619
+ {
620
+ type: "object", additionalProperties: false,
621
+ required: ["kind", "root", "workItemId", "requestId", "decision", "expectedDigest", "actor"],
622
+ properties: {
623
+ kind: { const: "external_reconciliation" }, root: { type: "string", minLength: 1 },
624
+ workItemId: { type: "string", pattern: workItemIdPattern }, requestId: { type: "string", minLength: 1 },
625
+ decision: { const: "reconcile" }, expectedDigest: strictDigestSchema,
626
+ actor: { type: "string", minLength: 1 },
627
+ },
628
+ },
629
+ {
630
+ type: "object", additionalProperties: false,
631
+ required: ["kind", "root", "workItemId", "requestId", "decision", "expectedDigest", "evidence", "actor"],
632
+ properties: {
633
+ kind: { const: "external_reconciliation" }, root: { type: "string", minLength: 1 },
634
+ workItemId: { type: "string", pattern: workItemIdPattern }, requestId: { type: "string", minLength: 1 },
635
+ decision: { const: "mark_failed" }, expectedDigest: strictDigestSchema,
636
+ evidence: { type: "string", minLength: 1, maxLength: 2048 },
637
+ actor: { type: "string", minLength: 1 },
638
+ },
639
+ },
640
+ {
641
+ type: "object", additionalProperties: false,
642
+ required: ["kind", "root", "workItemId", "requestId", "decision", "expectedDigest", "externalStableId", "contentDigest", "evidence", "actor"],
643
+ properties: {
644
+ kind: { const: "external_reconciliation" }, root: { type: "string", minLength: 1 },
645
+ workItemId: { type: "string", pattern: workItemIdPattern }, requestId: { type: "string", minLength: 1 },
646
+ decision: { const: "adopt_verified" }, expectedDigest: strictDigestSchema,
647
+ externalStableId: { type: "string", minLength: 1, maxLength: 2048 },
648
+ contentDigest: strictDigestSchema,
649
+ evidence: { type: "string", minLength: 1, maxLength: 2048 },
650
+ actor: { type: "string", minLength: 1 },
651
+ },
652
+ },
653
+ ],
654
+ },
655
+ "builtin.application-inspect-input.v1": {
656
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.application-inspect-input.v1",
657
+ type: "object", additionalProperties: false, required: ["root", "workItemId"],
658
+ properties: { root: { type: "string", minLength: 1 }, workItemId: { type: "string", pattern: workItemIdPattern } },
659
+ },
660
+ "builtin.agent-action.v1": {
661
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.agent-action.v1",
662
+ oneOf: [
663
+ {
664
+ type: "object", additionalProperties: false, required: ["action", "workPackage"],
665
+ properties: { action: { const: "execute" }, workPackage: workPackageSchema },
666
+ },
667
+ {
668
+ type: "object", additionalProperties: false, required: ["action", "approval"],
669
+ properties: {
670
+ action: { const: "await_approval" },
671
+ approval: {
672
+ oneOf: [
673
+ ...["step", "workflow_trust"].map((kind) => ({
674
+ type: "object", additionalProperties: false,
675
+ required: ["kind", "requestId", "workItemId", "title", "digest"],
676
+ properties: {
677
+ kind: { const: kind }, requestId: { type: "string", minLength: 1 },
678
+ workItemId: { type: "string", pattern: workItemIdPattern }, title: { type: "string", minLength: 1 },
679
+ digest: { type: "string", pattern: digestPattern },
680
+ },
681
+ })),
682
+ {
683
+ type: "object", additionalProperties: false,
684
+ required: ["kind", "requestId", "workItemId", "title", "digest", "provider", "action", "target", "sideEffects"],
685
+ properties: {
686
+ kind: { const: "external_action" }, requestId: { type: "string", minLength: 1 },
687
+ workItemId: { type: "string", pattern: workItemIdPattern }, title: { type: "string", minLength: 1 },
688
+ digest: { type: "string", pattern: digestPattern },
689
+ provider: { type: "string", pattern: "^[a-z][a-z0-9-]{0,62}$" },
690
+ action: externalActionIdentityProperties.action,
691
+ target: externalTargetSchema,
692
+ sideEffects: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 256 } },
693
+ },
694
+ },
695
+ ],
696
+ },
697
+ },
698
+ },
699
+ {
700
+ type: "object", additionalProperties: false, required: ["action", "problems"],
701
+ properties: {
702
+ action: { const: "blocked" }, problems: {
703
+ type: "array", minItems: 1, items: {
704
+ type: "object", additionalProperties: false, required: ["code", "message", "retryable"],
705
+ properties: {
706
+ code: { type: "string", pattern: errorCodePattern }, message: { type: "string", minLength: 1 },
707
+ retryable: { type: "boolean" },
708
+ },
709
+ },
710
+ },
711
+ },
712
+ },
713
+ {
714
+ type: "object", additionalProperties: false, required: ["action", "summary"],
715
+ properties: {
716
+ action: { const: "completed" }, summary: {
717
+ type: "object", additionalProperties: false, required: ["workItemId", "status", "message"],
718
+ properties: {
719
+ workItemId: { type: "string", pattern: workItemIdPattern }, status: { enum: ["closed", "cancelled"] },
720
+ message: { type: "string", minLength: 1 },
721
+ },
722
+ },
723
+ },
724
+ },
725
+ ],
726
+ },
727
+ "builtin.work-package.v1": {
728
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.work-package.v1", ...workPackageSchema,
729
+ },
730
+ "builtin.submit-result.v1": {
731
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.submit-result.v1", ...submitResultSchema,
732
+ },
733
+ "builtin.evidence.v1": {
734
+ $schema: "https://json-schema.org/draft/2020-12/schema",
735
+ $id: "builtin.evidence.v1",
736
+ type: "object",
737
+ additionalProperties: false,
738
+ required: ["evidenceId", "level", "gateId", "codeRevision", "baselineTreeDigest", "workspaceTreeDigest", "configDigest", "attemptId", "result", "recordHash"],
739
+ properties: {
740
+ evidenceId: { type: "string", minLength: 1 },
741
+ level: { enum: ["trusted", "attested", "reported"] },
742
+ gateId: { type: "string", pattern: gateIdPattern },
743
+ codeRevision: { type: "string", minLength: 1 },
744
+ baselineTreeDigest: { type: "string", pattern: digestPattern },
745
+ workspaceTreeDigest: { type: "string", pattern: digestPattern },
746
+ configDigest: { type: "string", pattern: digestPattern },
747
+ attemptId: { type: "string", pattern: "^attempt-.+$" },
748
+ result: { enum: ["passed", "failed"] },
749
+ recordHash: { type: "string", pattern: digestPattern },
750
+ },
751
+ },
752
+ "builtin.tdd-trusted-evidence.v1": {
753
+ $schema: "https://json-schema.org/draft/2020-12/schema",
754
+ $id: "builtin.tdd-trusted-evidence.v1",
755
+ type: "object",
756
+ additionalProperties: false,
757
+ required: ["evidenceId", "level", "phase", "taskId", "stepId", "commandId", "commandDigest", "exitCode", "failedTests", "testPaths", "testFiles", "testPathsDigest", "testPathRules", "testAssets", "testAssetsDigest", "testAssetPaths", "testAssetRoots", "productPaths", "workspaceDigest", "summary"],
758
+ properties: {
759
+ evidenceId: { type: "string", pattern: "^evidence-[a-f0-9]{64}$" },
760
+ level: { const: "trusted" },
761
+ phase: { enum: ["red", "green"] },
762
+ taskId: { type: "string", pattern: workItemIdPattern },
763
+ stepId: { type: "string", pattern: stepInstanceIdPattern },
764
+ commandId: { type: "string", pattern: idPattern },
765
+ commandDigest: { type: "string", pattern: digestPattern },
766
+ exitCode: { type: "integer" },
767
+ failedTests: { type: "array", maxItems: 100, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 512 } },
768
+ testPaths: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1 } },
769
+ testFiles: {
770
+ type: "array", minItems: 1, items: {
771
+ type: "object", additionalProperties: false, required: ["path", "digest"],
772
+ properties: { path: { type: "string", minLength: 1 }, digest: { type: "string", pattern: digestPattern } },
773
+ },
774
+ },
775
+ testPathsDigest: { type: "string", pattern: digestPattern },
776
+ testPathRules: { type: "array", minItems: 1, uniqueItems: true, items: testPathRuleSchema },
777
+ testAssets: {
778
+ type: "array", minItems: 1, items: {
779
+ type: "object", additionalProperties: false, required: ["path", "digest"],
780
+ properties: { path: { type: "string", minLength: 1 }, digest: { type: "string", pattern: digestPattern } },
781
+ },
782
+ },
783
+ testAssetsDigest: { type: "string", pattern: digestPattern },
784
+ testAssetPaths: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 1024 } },
785
+ testAssetRoots: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 1024 } },
786
+ productPaths: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 1024 } },
787
+ workspaceDigest: { type: "string", pattern: digestPattern },
788
+ summary: { type: "string", maxLength: 8192 },
789
+ },
790
+ },
791
+ "builtin.tdd-cycle-evidence.v1": {
792
+ $schema: "https://json-schema.org/draft/2020-12/schema",
793
+ $id: "builtin.tdd-cycle-evidence.v1",
794
+ type: "object",
795
+ additionalProperties: false,
796
+ required: ["taskId", "testPaths", "testPathRules", "testAssets", "testAssetsDigest", "testAssetPaths", "testAssetRoots", "productPaths", "commandId", "redEvidenceId", "greenEvidenceId"],
797
+ properties: {
798
+ taskId: { type: "string", pattern: workItemIdPattern },
799
+ testPaths: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1 } },
800
+ testPathRules: { type: "array", minItems: 1, uniqueItems: true, items: testPathRuleSchema },
801
+ testAssets: {
802
+ type: "array", minItems: 1, items: {
803
+ type: "object", additionalProperties: false, required: ["path", "digest"],
804
+ properties: { path: { type: "string", minLength: 1 }, digest: { type: "string", pattern: digestPattern } },
805
+ },
806
+ },
807
+ testAssetsDigest: { type: "string", pattern: digestPattern },
808
+ testAssetPaths: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 1024 } },
809
+ testAssetRoots: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 1024 } },
810
+ productPaths: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 1024 } },
811
+ commandId: { type: "string", pattern: idPattern },
812
+ redEvidenceId: { type: "string", pattern: "^evidence-[a-f0-9]{64}$" },
813
+ greenEvidenceId: { type: "string", pattern: "^evidence-[a-f0-9]{64}$" },
814
+ refactorEvidenceId: { type: "string", pattern: "^evidence-[a-f0-9]{64}$" },
815
+ },
816
+ },
817
+ "builtin.external-receipt.v1": {
818
+ $schema: "https://json-schema.org/draft/2020-12/schema",
819
+ $id: "builtin.external-receipt.v1",
820
+ type: "object",
821
+ additionalProperties: false,
822
+ required: ["version", "kind", "target", "stableId", "externalWorkItemId", "publishStepId", "publishAttemptId", "publishInputDigest", "publishedContentDigest", "readBackContentDigest", "status", "readBackStatus"],
823
+ properties: {
824
+ version: { const: 1 },
825
+ kind: { const: "external-receipt" },
826
+ target: { enum: ["issue", "knowledge"] },
827
+ stableId: { type: "string", minLength: 1 },
828
+ externalEffectKind: { const: "issue.comment" },
829
+ externalEffectId: { type: "string", pattern: "^(?:github-comment|gitlab-note):[1-9][0-9]{0,15}$" },
830
+ externalWorkItemId: { type: "string", minLength: 1 },
831
+ publishStepId: { type: "string", pattern: stepInstanceIdPattern },
832
+ publishAttemptId: { type: "string", pattern: attemptIdPattern },
833
+ publishInputDigest: { type: "string", pattern: digestPattern },
834
+ publishedContentDigest: { type: "string", pattern: digestPattern },
835
+ readBackContentDigest: { type: "string", pattern: digestPattern },
836
+ status: { const: "confirmed" },
837
+ readBackStatus: { enum: ["confirmed", "stale", "failed"] },
838
+ },
839
+ allOf: [{
840
+ if: { properties: { externalEffectKind: { const: "issue.comment" } }, required: ["externalEffectKind"] },
841
+ then: {
842
+ properties: { externalEffectId: { type: "string", pattern: "^(?:github-comment|gitlab-note):[1-9][0-9]{0,15}$" } },
843
+ required: ["externalEffectId"],
844
+ },
845
+ else: { properties: { externalEffectId: false } },
846
+ }],
847
+ },
848
+ "builtin.external-binding.v1": {
849
+ $schema: "https://json-schema.org/draft/2020-12/schema",
850
+ $id: "builtin.external-binding.v1",
851
+ type: "object",
852
+ additionalProperties: false,
853
+ required: ["version", "kind", "target", "exists", "stableId", "externalWorkItemId", "publishStepId", "publishAttemptId", "publishInputDigest", "expectedPublishedContentDigest"],
854
+ properties: {
855
+ version: { const: 1 },
856
+ kind: { const: "external-binding" },
857
+ target: { enum: ["issue", "knowledge"] },
858
+ exists: { const: true },
859
+ stableId: { type: "string", minLength: 1 },
860
+ externalWorkItemId: { type: "string", minLength: 1 },
861
+ publishStepId: { type: "string", pattern: stepInstanceIdPattern },
862
+ publishAttemptId: { type: "string", pattern: attemptIdPattern },
863
+ publishInputDigest: { type: "string", pattern: digestPattern },
864
+ expectedPublishedContentDigest: { type: "string", pattern: digestPattern },
865
+ },
866
+ },
867
+ "builtin.external-action-request.v1": {
868
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.external-action-request.v1",
869
+ type: "object", additionalProperties: false,
870
+ required: ["version", "requestId", "workItemId", "stepId", "attemptId", "provider", "action", "securityClass", "target", "payloadDigest", "expectedContentDigest", "payloadArtifactDigest", "bindingDigest", "inputDigest", "artifactDigests", "idempotencyKey", "profile", "profileDigest", "workspaceDigest", "configDigest", "sideEffects", "createdAt", "expiresAt", "requestDigest"],
871
+ properties: {
872
+ version: { const: 1 }, ...externalActionIdentityProperties,
873
+ sideEffects: { type: "array", minItems: 1, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: 256 } },
874
+ createdAt: { type: "string", format: "date-time" }, expiresAt: { type: "string", format: "date-time" },
875
+ },
876
+ allOf: governedActionConditions,
877
+ },
878
+ "builtin.external-action-grant.v1": {
879
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.external-action-grant.v1",
880
+ type: "object", additionalProperties: false,
881
+ required: ["version", "grantId", "requestId", "requestDigest", "workItemId", "stepId", "attemptId", "provider", "action", "securityClass", "target", "payloadDigest", "expectedContentDigest", "payloadArtifactDigest", "bindingDigest", "inputDigest", "artifactDigests", "idempotencyKey", "actor", "approvalDigest", "profile", "profileDigest", "workspaceDigest", "configDigest", "decidedAt", "expiresAt", "grantDigest"],
882
+ properties: {
883
+ version: { const: 1 }, grantId: { type: "string", pattern: "^external-grant-[a-f0-9]{64}$" }, ...externalActionIdentityProperties,
884
+ actor: { type: "string", minLength: 1, maxLength: 256 }, approvalDigest: strictDigestSchema,
885
+ decidedAt: { type: "string", format: "date-time" }, expiresAt: { type: "string", format: "date-time" }, grantDigest: strictDigestSchema,
886
+ },
887
+ allOf: governedActionConditions,
888
+ },
889
+ "builtin.external-write-receipt.v1": {
890
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: "builtin.external-write-receipt.v1",
891
+ type: "object", additionalProperties: false,
892
+ required: ["version", "kind", "requestId", "requestDigest", "grantDigest", "workItemId", "stepId", "attemptId", "provider", "action", "target", "payloadDigest", "expectedContentDigest", "bindingDigest", "inputDigest", "artifactDigests", "idempotencyKey", "publishedContentDigest", "readBackContentDigest", "status", "verifiedAt"],
893
+ properties: {
894
+ version: { const: 1 }, kind: { const: "external-write-receipt" },
895
+ requestId: externalActionIdentityProperties.requestId, requestDigest: strictDigestSchema, grantDigest: strictDigestSchema,
896
+ workItemId: externalActionIdentityProperties.workItemId, stepId: externalActionIdentityProperties.stepId,
897
+ attemptId: externalActionIdentityProperties.attemptId, provider: externalActionIdentityProperties.provider,
898
+ action: externalActionIdentityProperties.action, target: externalTargetSchema, payloadDigest: strictDigestSchema,
899
+ externalEffectKind: externalActionIdentityProperties.externalEffectKind,
900
+ externalEffectId: { type: "string", pattern: "^(?:github-comment|gitlab-note):[1-9][0-9]{0,15}$" },
901
+ expectedContentDigest: strictDigestSchema,
902
+ bindingDigest: strictDigestSchema, inputDigest: strictDigestSchema, artifactDigests: externalActionIdentityProperties.artifactDigests,
903
+ idempotencyKey: externalActionIdentityProperties.idempotencyKey,
904
+ publishedContentDigest: strictDigestSchema, readBackContentDigest: strictDigestSchema,
905
+ status: { const: "verified" }, verifiedAt: { type: "string", format: "date-time" },
906
+ },
907
+ allOf: governedReceiptConditions,
908
+ },
909
+ "builtin.tdd-node-test-report.v1": {
910
+ $schema: "https://json-schema.org/draft/2020-12/schema",
911
+ $id: "builtin.tdd-node-test-report.v1",
912
+ type: "object",
913
+ additionalProperties: false,
914
+ required: ["version", "adapter", "summary", "failureTotal", "truncated", "failures"],
915
+ properties: {
916
+ version: { const: 1 },
917
+ adapter: { const: "node-test" },
918
+ summary: {
919
+ type: "object", additionalProperties: false,
920
+ required: ["success", "tests", "passed", "failed", "cancelled", "skipped", "todo"],
921
+ properties: {
922
+ success: { type: "boolean" }, tests: { type: "integer", minimum: 0 }, passed: { type: "integer", minimum: 0 },
923
+ failed: { type: "integer", minimum: 0 }, cancelled: { type: "integer", minimum: 0 }, skipped: { type: "integer", minimum: 0 },
924
+ todo: { type: "integer", minimum: 0 },
925
+ },
926
+ },
927
+ failureTotal: { type: "integer", minimum: 0 },
928
+ truncated: { type: "boolean" },
929
+ failures: {
930
+ type: "array", maxItems: 100, items: {
931
+ type: "object", additionalProperties: false, required: ["name", "file", "kind"],
932
+ properties: {
933
+ name: { type: "string", minLength: 1, maxLength: 512 }, file: { type: "string", minLength: 1 },
934
+ kind: { enum: ["assertion", "syntax", "dependency", "other"] },
935
+ },
936
+ },
937
+ },
938
+ },
939
+ },
940
+ "builtin.artifact.v1": {
941
+ $schema: "https://json-schema.org/draft/2020-12/schema",
942
+ $id: "builtin.artifact.v1",
943
+ type: "object",
944
+ additionalProperties: false,
945
+ required: ["artifactType", "schemaVersion", "workItemId", "stageId", "attemptId", "revision", "contentHash"],
946
+ properties: {
947
+ artifactType: { type: "string", pattern: idPattern },
948
+ outputId: { type: "string", pattern: idPattern },
949
+ schemaVersion: { const: 1 },
950
+ workItemId: { type: "string", pattern: workItemIdPattern },
951
+ stageId: { type: "string", pattern: stepInstanceIdPattern },
952
+ attemptId: { type: "string", pattern: "^attempt-.+$" },
953
+ revision: { type: "integer", minimum: 1 },
954
+ contentHash: { type: "string", pattern: digestPattern },
955
+ },
956
+ },
957
+ };
958
+ //# sourceMappingURL=definitions.js.map