@open-agreements/open-agreements 0.2.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 (358) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +359 -0
  3. package/bin/open-agreements.js +4 -0
  4. package/content/external/LICENSE +27 -0
  5. package/content/external/README.md +38 -0
  6. package/content/external/yc-safe-discount/README.md +16 -0
  7. package/content/external/yc-safe-discount/clean.json +4 -0
  8. package/content/external/yc-safe-discount/metadata.yaml +67 -0
  9. package/content/external/yc-safe-discount/replacements.json +13 -0
  10. package/content/external/yc-safe-discount/template.docx +0 -0
  11. package/content/external/yc-safe-mfn/README.md +16 -0
  12. package/content/external/yc-safe-mfn/clean.json +4 -0
  13. package/content/external/yc-safe-mfn/metadata.yaml +64 -0
  14. package/content/external/yc-safe-mfn/replacements.json +12 -0
  15. package/content/external/yc-safe-mfn/template.docx +0 -0
  16. package/content/external/yc-safe-pro-rata-side-letter/README.md +16 -0
  17. package/content/external/yc-safe-pro-rata-side-letter/clean.json +4 -0
  18. package/content/external/yc-safe-pro-rata-side-letter/metadata.yaml +49 -0
  19. package/content/external/yc-safe-pro-rata-side-letter/replacements.json +9 -0
  20. package/content/external/yc-safe-pro-rata-side-letter/template.docx +0 -0
  21. package/content/external/yc-safe-valuation-cap/README.md +16 -0
  22. package/content/external/yc-safe-valuation-cap/clean.json +4 -0
  23. package/content/external/yc-safe-valuation-cap/metadata.yaml +64 -0
  24. package/content/external/yc-safe-valuation-cap/replacements.json +12 -0
  25. package/content/external/yc-safe-valuation-cap/template.docx +0 -0
  26. package/content/recipes/nvca-certificate-of-incorporation/clean.json +8 -0
  27. package/content/recipes/nvca-certificate-of-incorporation/metadata.yaml +43 -0
  28. package/content/recipes/nvca-certificate-of-incorporation/replacements.json +9 -0
  29. package/content/recipes/nvca-indemnification-agreement/clean.json +17 -0
  30. package/content/recipes/nvca-indemnification-agreement/metadata.yaml +79 -0
  31. package/content/recipes/nvca-indemnification-agreement/replacements.json +17 -0
  32. package/content/recipes/nvca-investors-rights-agreement/clean.json +12 -0
  33. package/content/recipes/nvca-investors-rights-agreement/metadata.yaml +71 -0
  34. package/content/recipes/nvca-investors-rights-agreement/replacements.json +18 -0
  35. package/content/recipes/nvca-management-rights-letter/clean.json +7 -0
  36. package/content/recipes/nvca-management-rights-letter/metadata.yaml +47 -0
  37. package/content/recipes/nvca-management-rights-letter/replacements.json +11 -0
  38. package/content/recipes/nvca-rofr-co-sale-agreement/clean.json +7 -0
  39. package/content/recipes/nvca-rofr-co-sale-agreement/metadata.yaml +76 -0
  40. package/content/recipes/nvca-rofr-co-sale-agreement/replacements.json +17 -0
  41. package/content/recipes/nvca-stock-purchase-agreement/clean.json +13 -0
  42. package/content/recipes/nvca-stock-purchase-agreement/computed.json +103 -0
  43. package/content/recipes/nvca-stock-purchase-agreement/metadata.yaml +138 -0
  44. package/content/recipes/nvca-stock-purchase-agreement/normalize.json +83 -0
  45. package/content/recipes/nvca-stock-purchase-agreement/replacements.json +41 -0
  46. package/content/recipes/nvca-voting-agreement/README.md +53 -0
  47. package/content/recipes/nvca-voting-agreement/clean.json +7 -0
  48. package/content/recipes/nvca-voting-agreement/metadata.yaml +66 -0
  49. package/content/recipes/nvca-voting-agreement/replacements.json +18 -0
  50. package/content/templates/bonterms-mutual-nda/README.md +27 -0
  51. package/content/templates/bonterms-mutual-nda/metadata.yaml +58 -0
  52. package/content/templates/bonterms-mutual-nda/source.json +18 -0
  53. package/content/templates/bonterms-mutual-nda/template.docx +0 -0
  54. package/content/templates/bonterms-professional-services-agreement/README.md +24 -0
  55. package/content/templates/bonterms-professional-services-agreement/metadata.yaml +45 -0
  56. package/content/templates/bonterms-professional-services-agreement/selections.json +12 -0
  57. package/content/templates/bonterms-professional-services-agreement/source.json +18 -0
  58. package/content/templates/bonterms-professional-services-agreement/template.docx +0 -0
  59. package/content/templates/closing-checklist/metadata.yaml +39 -0
  60. package/content/templates/closing-checklist/template.docx +0 -0
  61. package/content/templates/common-paper-ai-addendum/README.md +23 -0
  62. package/content/templates/common-paper-ai-addendum/metadata.yaml +31 -0
  63. package/content/templates/common-paper-ai-addendum/template.docx +0 -0
  64. package/content/templates/common-paper-ai-addendum-in-app/README.md +21 -0
  65. package/content/templates/common-paper-ai-addendum-in-app/metadata.yaml +21 -0
  66. package/content/templates/common-paper-ai-addendum-in-app/template.docx +0 -0
  67. package/content/templates/common-paper-amendment/README.md +27 -0
  68. package/content/templates/common-paper-amendment/metadata.yaml +53 -0
  69. package/content/templates/common-paper-amendment/template.docx +0 -0
  70. package/content/templates/common-paper-business-associate-agreement/README.md +29 -0
  71. package/content/templates/common-paper-business-associate-agreement/metadata.yaml +56 -0
  72. package/content/templates/common-paper-business-associate-agreement/replacements.json +3 -0
  73. package/content/templates/common-paper-business-associate-agreement/template.docx +0 -0
  74. package/content/templates/common-paper-cloud-service-agreement/README.md +32 -0
  75. package/content/templates/common-paper-cloud-service-agreement/metadata.yaml +354 -0
  76. package/content/templates/common-paper-cloud-service-agreement/template.docx +0 -0
  77. package/content/templates/common-paper-csa-click-through/README.md +33 -0
  78. package/content/templates/common-paper-csa-click-through/metadata.yaml +73 -0
  79. package/content/templates/common-paper-csa-click-through/template.docx +0 -0
  80. package/content/templates/common-paper-csa-with-ai/README.md +49 -0
  81. package/content/templates/common-paper-csa-with-ai/metadata.yaml +143 -0
  82. package/content/templates/common-paper-csa-with-ai/replacements.json +7 -0
  83. package/content/templates/common-paper-csa-with-ai/template.docx +0 -0
  84. package/content/templates/common-paper-csa-with-sla/README.md +53 -0
  85. package/content/templates/common-paper-csa-with-sla/metadata.yaml +159 -0
  86. package/content/templates/common-paper-csa-with-sla/replacements.json +7 -0
  87. package/content/templates/common-paper-csa-with-sla/template.docx +0 -0
  88. package/content/templates/common-paper-csa-without-sla/README.md +47 -0
  89. package/content/templates/common-paper-csa-without-sla/metadata.yaml +135 -0
  90. package/content/templates/common-paper-csa-without-sla/replacements.json +7 -0
  91. package/content/templates/common-paper-csa-without-sla/template.docx +0 -0
  92. package/content/templates/common-paper-data-processing-agreement/README.md +46 -0
  93. package/content/templates/common-paper-data-processing-agreement/metadata.yaml +130 -0
  94. package/content/templates/common-paper-data-processing-agreement/replacements.json +3 -0
  95. package/content/templates/common-paper-data-processing-agreement/template.docx +0 -0
  96. package/content/templates/common-paper-design-partner-agreement/README.md +29 -0
  97. package/content/templates/common-paper-design-partner-agreement/metadata.yaml +59 -0
  98. package/content/templates/common-paper-design-partner-agreement/replacements.json +4 -0
  99. package/content/templates/common-paper-design-partner-agreement/template.docx +0 -0
  100. package/content/templates/common-paper-independent-contractor-agreement/README.md +27 -0
  101. package/content/templates/common-paper-independent-contractor-agreement/metadata.yaml +55 -0
  102. package/content/templates/common-paper-independent-contractor-agreement/template.docx +0 -0
  103. package/content/templates/common-paper-letter-of-intent/README.md +25 -0
  104. package/content/templates/common-paper-letter-of-intent/metadata.yaml +42 -0
  105. package/content/templates/common-paper-letter-of-intent/template.docx +0 -0
  106. package/content/templates/common-paper-mutual-nda/README.md +29 -0
  107. package/content/templates/common-paper-mutual-nda/metadata.yaml +59 -0
  108. package/content/templates/common-paper-mutual-nda/selections.json +38 -0
  109. package/content/templates/common-paper-mutual-nda/template.docx +0 -0
  110. package/content/templates/common-paper-one-way-nda/README.md +27 -0
  111. package/content/templates/common-paper-one-way-nda/metadata.yaml +59 -0
  112. package/content/templates/common-paper-one-way-nda/template.docx +0 -0
  113. package/content/templates/common-paper-order-form/README.md +36 -0
  114. package/content/templates/common-paper-order-form/metadata.yaml +87 -0
  115. package/content/templates/common-paper-order-form/replacements.json +5 -0
  116. package/content/templates/common-paper-order-form/template.docx +0 -0
  117. package/content/templates/common-paper-order-form-with-sla/README.md +42 -0
  118. package/content/templates/common-paper-order-form-with-sla/metadata.yaml +111 -0
  119. package/content/templates/common-paper-order-form-with-sla/replacements.json +5 -0
  120. package/content/templates/common-paper-order-form-with-sla/template.docx +0 -0
  121. package/content/templates/common-paper-partnership-agreement/README.md +34 -0
  122. package/content/templates/common-paper-partnership-agreement/metadata.yaml +78 -0
  123. package/content/templates/common-paper-partnership-agreement/replacements.json +7 -0
  124. package/content/templates/common-paper-partnership-agreement/template.docx +0 -0
  125. package/content/templates/common-paper-pilot-agreement/README.md +34 -0
  126. package/content/templates/common-paper-pilot-agreement/metadata.yaml +100 -0
  127. package/content/templates/common-paper-pilot-agreement/replacements.json +4 -0
  128. package/content/templates/common-paper-pilot-agreement/selections.json +37 -0
  129. package/content/templates/common-paper-pilot-agreement/template.docx +0 -0
  130. package/content/templates/common-paper-professional-services-agreement/README.md +44 -0
  131. package/content/templates/common-paper-professional-services-agreement/metadata.yaml +124 -0
  132. package/content/templates/common-paper-professional-services-agreement/replacements.json +8 -0
  133. package/content/templates/common-paper-professional-services-agreement/template.docx +0 -0
  134. package/content/templates/common-paper-software-license-agreement/README.md +18 -0
  135. package/content/templates/common-paper-software-license-agreement/metadata.yaml +13 -0
  136. package/content/templates/common-paper-software-license-agreement/template.docx +0 -0
  137. package/content/templates/common-paper-statement-of-work/README.md +32 -0
  138. package/content/templates/common-paper-statement-of-work/metadata.yaml +71 -0
  139. package/content/templates/common-paper-statement-of-work/replacements.json +3 -0
  140. package/content/templates/common-paper-statement-of-work/template.docx +0 -0
  141. package/content/templates/common-paper-term-sheet/README.md +22 -0
  142. package/content/templates/common-paper-term-sheet/metadata.yaml +28 -0
  143. package/content/templates/common-paper-term-sheet/template.docx +0 -0
  144. package/content/templates/openagreements-employee-ip-inventions-assignment/README.md +31 -0
  145. package/content/templates/openagreements-employee-ip-inventions-assignment/metadata.yaml +71 -0
  146. package/content/templates/openagreements-employee-ip-inventions-assignment/template.docx +0 -0
  147. package/content/templates/openagreements-employee-ip-inventions-assignment/template.md +80 -0
  148. package/content/templates/openagreements-employment-confidentiality-acknowledgement/README.md +30 -0
  149. package/content/templates/openagreements-employment-confidentiality-acknowledgement/metadata.yaml +60 -0
  150. package/content/templates/openagreements-employment-confidentiality-acknowledgement/template.docx +0 -0
  151. package/content/templates/openagreements-employment-confidentiality-acknowledgement/template.md +51 -0
  152. package/content/templates/openagreements-employment-offer-letter/README.md +33 -0
  153. package/content/templates/openagreements-employment-offer-letter/metadata.yaml +75 -0
  154. package/content/templates/openagreements-employment-offer-letter/template.docx +0 -0
  155. package/content/templates/openagreements-employment-offer-letter/template.md +90 -0
  156. package/content/templates/working-group-list/metadata.yaml +22 -0
  157. package/content/templates/working-group-list/template.docx +0 -0
  158. package/dist/cli/index.d.ts +4 -0
  159. package/dist/cli/index.d.ts.map +1 -0
  160. package/dist/cli/index.js +199 -0
  161. package/dist/cli/index.js.map +1 -0
  162. package/dist/commands/checklist.d.ts +22 -0
  163. package/dist/commands/checklist.d.ts.map +1 -0
  164. package/dist/commands/checklist.js +222 -0
  165. package/dist/commands/checklist.js.map +1 -0
  166. package/dist/commands/fill.d.ts +18 -0
  167. package/dist/commands/fill.d.ts.map +1 -0
  168. package/dist/commands/fill.js +119 -0
  169. package/dist/commands/fill.js.map +1 -0
  170. package/dist/commands/list.d.ts +7 -0
  171. package/dist/commands/list.d.ts.map +1 -0
  172. package/dist/commands/list.js +247 -0
  173. package/dist/commands/list.js.map +1 -0
  174. package/dist/commands/recipe.d.ts +24 -0
  175. package/dist/commands/recipe.d.ts.map +1 -0
  176. package/dist/commands/recipe.js +96 -0
  177. package/dist/commands/recipe.js.map +1 -0
  178. package/dist/commands/scan.d.ts +28 -0
  179. package/dist/commands/scan.d.ts.map +1 -0
  180. package/dist/commands/scan.js +138 -0
  181. package/dist/commands/scan.js.map +1 -0
  182. package/dist/commands/validate.d.ts +6 -0
  183. package/dist/commands/validate.d.ts.map +1 -0
  184. package/dist/commands/validate.js +158 -0
  185. package/dist/commands/validate.js.map +1 -0
  186. package/dist/core/checklist/index.d.ts +38 -0
  187. package/dist/core/checklist/index.d.ts.map +1 -0
  188. package/dist/core/checklist/index.js +229 -0
  189. package/dist/core/checklist/index.js.map +1 -0
  190. package/dist/core/checklist/patch-apply.d.ts +65 -0
  191. package/dist/core/checklist/patch-apply.d.ts.map +1 -0
  192. package/dist/core/checklist/patch-apply.js +274 -0
  193. package/dist/core/checklist/patch-apply.js.map +1 -0
  194. package/dist/core/checklist/patch-schemas.d.ts +86 -0
  195. package/dist/core/checklist/patch-schemas.d.ts.map +1 -0
  196. package/dist/core/checklist/patch-schemas.js +89 -0
  197. package/dist/core/checklist/patch-schemas.js.map +1 -0
  198. package/dist/core/checklist/patch-validator.d.ts +76 -0
  199. package/dist/core/checklist/patch-validator.d.ts.map +1 -0
  200. package/dist/core/checklist/patch-validator.js +404 -0
  201. package/dist/core/checklist/patch-validator.js.map +1 -0
  202. package/dist/core/checklist/schemas.d.ts +270 -0
  203. package/dist/core/checklist/schemas.d.ts.map +1 -0
  204. package/dist/core/checklist/schemas.js +229 -0
  205. package/dist/core/checklist/schemas.js.map +1 -0
  206. package/dist/core/checklist/test-utils.d.ts +7 -0
  207. package/dist/core/checklist/test-utils.d.ts.map +1 -0
  208. package/dist/core/checklist/test-utils.js +13 -0
  209. package/dist/core/checklist/test-utils.js.map +1 -0
  210. package/dist/core/command-generation/adapters/claude.d.ts +11 -0
  211. package/dist/core/command-generation/adapters/claude.d.ts.map +1 -0
  212. package/dist/core/command-generation/adapters/claude.js +91 -0
  213. package/dist/core/command-generation/adapters/claude.js.map +1 -0
  214. package/dist/core/command-generation/types.d.ts +14 -0
  215. package/dist/core/command-generation/types.d.ts.map +1 -0
  216. package/dist/core/command-generation/types.js +2 -0
  217. package/dist/core/command-generation/types.js.map +1 -0
  218. package/dist/core/employment/jurisdiction-rules.d.ts +20 -0
  219. package/dist/core/employment/jurisdiction-rules.d.ts.map +1 -0
  220. package/dist/core/employment/jurisdiction-rules.js +57 -0
  221. package/dist/core/employment/jurisdiction-rules.js.map +1 -0
  222. package/dist/core/employment/memo.d.ts +57 -0
  223. package/dist/core/employment/memo.d.ts.map +1 -0
  224. package/dist/core/employment/memo.js +589 -0
  225. package/dist/core/employment/memo.js.map +1 -0
  226. package/dist/core/engine.d.ts +13 -0
  227. package/dist/core/engine.d.ts.map +1 -0
  228. package/dist/core/engine.js +182 -0
  229. package/dist/core/engine.js.map +1 -0
  230. package/dist/core/external/index.d.ts +8 -0
  231. package/dist/core/external/index.d.ts.map +1 -0
  232. package/dist/core/external/index.js +50 -0
  233. package/dist/core/external/index.js.map +1 -0
  234. package/dist/core/external/types.d.ts +18 -0
  235. package/dist/core/external/types.d.ts.map +1 -0
  236. package/dist/core/external/types.js +2 -0
  237. package/dist/core/external/types.js.map +1 -0
  238. package/dist/core/fill-pipeline.d.ts +64 -0
  239. package/dist/core/fill-pipeline.d.ts.map +1 -0
  240. package/dist/core/fill-pipeline.js +350 -0
  241. package/dist/core/fill-pipeline.js.map +1 -0
  242. package/dist/core/fill-utils.d.ts +39 -0
  243. package/dist/core/fill-utils.d.ts.map +1 -0
  244. package/dist/core/fill-utils.js +127 -0
  245. package/dist/core/fill-utils.js.map +1 -0
  246. package/dist/core/metadata.d.ts +194 -0
  247. package/dist/core/metadata.d.ts.map +1 -0
  248. package/dist/core/metadata.js +197 -0
  249. package/dist/core/metadata.js.map +1 -0
  250. package/dist/core/recipe/bracket-normalizer.d.ts +46 -0
  251. package/dist/core/recipe/bracket-normalizer.d.ts.map +1 -0
  252. package/dist/core/recipe/bracket-normalizer.js +354 -0
  253. package/dist/core/recipe/bracket-normalizer.js.map +1 -0
  254. package/dist/core/recipe/cleaner.d.ts +27 -0
  255. package/dist/core/recipe/cleaner.d.ts.map +1 -0
  256. package/dist/core/recipe/cleaner.js +345 -0
  257. package/dist/core/recipe/cleaner.js.map +1 -0
  258. package/dist/core/recipe/computed.d.ts +136 -0
  259. package/dist/core/recipe/computed.d.ts.map +1 -0
  260. package/dist/core/recipe/computed.js +225 -0
  261. package/dist/core/recipe/computed.js.map +1 -0
  262. package/dist/core/recipe/downloader.d.ts +8 -0
  263. package/dist/core/recipe/downloader.d.ts.map +1 -0
  264. package/dist/core/recipe/downloader.js +58 -0
  265. package/dist/core/recipe/downloader.js.map +1 -0
  266. package/dist/core/recipe/index.d.ts +17 -0
  267. package/dist/core/recipe/index.d.ts.map +1 -0
  268. package/dist/core/recipe/index.js +90 -0
  269. package/dist/core/recipe/index.js.map +1 -0
  270. package/dist/core/recipe/ooxml-parts.d.ts +21 -0
  271. package/dist/core/recipe/ooxml-parts.d.ts.map +1 -0
  272. package/dist/core/recipe/ooxml-parts.js +33 -0
  273. package/dist/core/recipe/ooxml-parts.js.map +1 -0
  274. package/dist/core/recipe/patcher.d.ts +34 -0
  275. package/dist/core/recipe/patcher.d.ts.map +1 -0
  276. package/dist/core/recipe/patcher.js +423 -0
  277. package/dist/core/recipe/patcher.js.map +1 -0
  278. package/dist/core/recipe/replacement-keys.d.ts +33 -0
  279. package/dist/core/recipe/replacement-keys.d.ts.map +1 -0
  280. package/dist/core/recipe/replacement-keys.js +53 -0
  281. package/dist/core/recipe/replacement-keys.js.map +1 -0
  282. package/dist/core/recipe/source-drift.d.ts +33 -0
  283. package/dist/core/recipe/source-drift.d.ts.map +1 -0
  284. package/dist/core/recipe/source-drift.js +113 -0
  285. package/dist/core/recipe/source-drift.js.map +1 -0
  286. package/dist/core/recipe/types.d.ts +33 -0
  287. package/dist/core/recipe/types.d.ts.map +1 -0
  288. package/dist/core/recipe/types.js +2 -0
  289. package/dist/core/recipe/types.js.map +1 -0
  290. package/dist/core/recipe/verifier.d.ts +24 -0
  291. package/dist/core/recipe/verifier.d.ts.map +1 -0
  292. package/dist/core/recipe/verifier.js +158 -0
  293. package/dist/core/recipe/verifier.js.map +1 -0
  294. package/dist/core/selector.d.ts +41 -0
  295. package/dist/core/selector.d.ts.map +1 -0
  296. package/dist/core/selector.js +323 -0
  297. package/dist/core/selector.js.map +1 -0
  298. package/dist/core/unified-pipeline.d.ts +53 -0
  299. package/dist/core/unified-pipeline.d.ts.map +1 -0
  300. package/dist/core/unified-pipeline.js +107 -0
  301. package/dist/core/unified-pipeline.js.map +1 -0
  302. package/dist/core/validation/external.d.ts +16 -0
  303. package/dist/core/validation/external.d.ts.map +1 -0
  304. package/dist/core/validation/external.js +114 -0
  305. package/dist/core/validation/external.js.map +1 -0
  306. package/dist/core/validation/license.d.ts +15 -0
  307. package/dist/core/validation/license.d.ts.map +1 -0
  308. package/dist/core/validation/license.js +30 -0
  309. package/dist/core/validation/license.js.map +1 -0
  310. package/dist/core/validation/output.d.ts +12 -0
  311. package/dist/core/validation/output.d.ts.map +1 -0
  312. package/dist/core/validation/output.js +47 -0
  313. package/dist/core/validation/output.js.map +1 -0
  314. package/dist/core/validation/recipe.d.ts +19 -0
  315. package/dist/core/validation/recipe.d.ts.map +1 -0
  316. package/dist/core/validation/recipe.js +159 -0
  317. package/dist/core/validation/recipe.js.map +1 -0
  318. package/dist/core/validation/scan-metadata.d.ts +21 -0
  319. package/dist/core/validation/scan-metadata.d.ts.map +1 -0
  320. package/dist/core/validation/scan-metadata.js +70 -0
  321. package/dist/core/validation/scan-metadata.js.map +1 -0
  322. package/dist/core/validation/template.d.ts +11 -0
  323. package/dist/core/validation/template.d.ts.map +1 -0
  324. package/dist/core/validation/template.js +248 -0
  325. package/dist/core/validation/template.js.map +1 -0
  326. package/dist/index.d.ts +16 -0
  327. package/dist/index.d.ts.map +1 -0
  328. package/dist/index.js +23 -0
  329. package/dist/index.js.map +1 -0
  330. package/dist/utils/paths.d.ts +43 -0
  331. package/dist/utils/paths.d.ts.map +1 -0
  332. package/dist/utils/paths.js +149 -0
  333. package/dist/utils/paths.js.map +1 -0
  334. package/package.json +148 -0
  335. package/skills/cloud-service-agreement/CONNECTORS.md +19 -0
  336. package/skills/cloud-service-agreement/SKILL.md +172 -0
  337. package/skills/data-privacy-agreement/CONNECTORS.md +19 -0
  338. package/skills/data-privacy-agreement/SKILL.md +158 -0
  339. package/skills/delaware-franchise-tax/CONNECTORS.md +16 -0
  340. package/skills/delaware-franchise-tax/SKILL.md +206 -0
  341. package/skills/delaware-franchise-tax/reference/ecorp-portal-playwright-notes.md +136 -0
  342. package/skills/delaware-franchise-tax/reference/faq.md +101 -0
  343. package/skills/delaware-franchise-tax/reference/filing-instructions.md +111 -0
  344. package/skills/delaware-franchise-tax/reference/tax-calculation.md +167 -0
  345. package/skills/employment-contract/CONNECTORS.md +19 -0
  346. package/skills/employment-contract/SKILL.md +157 -0
  347. package/skills/nda/CONNECTORS.md +19 -0
  348. package/skills/nda/SKILL.md +153 -0
  349. package/skills/open-agreements/CONNECTORS.md +19 -0
  350. package/skills/open-agreements/SKILL.md +182 -0
  351. package/skills/safe/CONNECTORS.md +19 -0
  352. package/skills/safe/SKILL.md +161 -0
  353. package/skills/services-agreement/CONNECTORS.md +19 -0
  354. package/skills/services-agreement/SKILL.md +156 -0
  355. package/skills/unit-test-philosophy/SKILL.md +113 -0
  356. package/skills/unit-test-philosophy/references/allure-test-spec-writing-guide.md +164 -0
  357. package/skills/venture-financing/CONNECTORS.md +19 -0
  358. package/skills/venture-financing/SKILL.md +169 -0
@@ -0,0 +1,270 @@
1
+ import { z } from 'zod';
2
+ export declare const ChecklistItemStatusEnum: z.ZodEnum<{
3
+ NOT_STARTED: "NOT_STARTED";
4
+ IN_PROGRESS: "IN_PROGRESS";
5
+ COMPLETED: "COMPLETED";
6
+ ON_HOLD: "ON_HOLD";
7
+ }>;
8
+ export type ChecklistItemStatus = z.infer<typeof ChecklistItemStatusEnum>;
9
+ export declare const IssueStatusEnum: z.ZodEnum<{
10
+ OPEN: "OPEN";
11
+ CLOSED: "CLOSED";
12
+ }>;
13
+ export type IssueStatus = z.infer<typeof IssueStatusEnum>;
14
+ export declare const ChecklistStageEnum: z.ZodEnum<{
15
+ PRE_SIGNING: "PRE_SIGNING";
16
+ SIGNING: "SIGNING";
17
+ CLOSING: "CLOSING";
18
+ POST_CLOSING: "POST_CLOSING";
19
+ }>;
20
+ export type ChecklistStage = z.infer<typeof ChecklistStageEnum>;
21
+ export declare const ChecklistEntryStatusEnum: z.ZodEnum<{
22
+ NOT_STARTED: "NOT_STARTED";
23
+ DRAFT: "DRAFT";
24
+ CIRCULATED: "CIRCULATED";
25
+ FORM_FINAL: "FORM_FINAL";
26
+ PARTIALLY_SIGNED: "PARTIALLY_SIGNED";
27
+ FULLY_EXECUTED: "FULLY_EXECUTED";
28
+ DELIVERED: "DELIVERED";
29
+ FILED_OR_RECORDED: "FILED_OR_RECORDED";
30
+ }>;
31
+ export type ChecklistEntryStatus = z.infer<typeof ChecklistEntryStatusEnum>;
32
+ export declare const SignatoryStatusEnum: z.ZodEnum<{
33
+ PENDING: "PENDING";
34
+ RECEIVED: "RECEIVED";
35
+ N_A: "N_A";
36
+ }>;
37
+ export type SignatoryStatus = z.infer<typeof SignatoryStatusEnum>;
38
+ export declare const ResponsibilitySchema: z.ZodObject<{
39
+ organization: z.ZodOptional<z.ZodString>;
40
+ individual_name: z.ZodOptional<z.ZodString>;
41
+ role: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ export type Responsibility = z.infer<typeof ResponsibilitySchema>;
44
+ export declare const CitationSchema: z.ZodObject<{
45
+ ref: z.ZodOptional<z.ZodString>;
46
+ text: z.ZodOptional<z.ZodString>;
47
+ link: z.ZodOptional<z.ZodString>;
48
+ filepath: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strip>;
50
+ export type Citation = z.infer<typeof CitationSchema>;
51
+ export declare const SignatureArtifactSchema: z.ZodObject<{
52
+ uri: z.ZodOptional<z.ZodString>;
53
+ path: z.ZodOptional<z.ZodString>;
54
+ received_at: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strip>;
56
+ export type SignatureArtifact = z.infer<typeof SignatureArtifactSchema>;
57
+ export declare const SignatorySchema: z.ZodObject<{
58
+ party: z.ZodString;
59
+ name: z.ZodOptional<z.ZodString>;
60
+ title: z.ZodOptional<z.ZodString>;
61
+ status: z.ZodEnum<{
62
+ PENDING: "PENDING";
63
+ RECEIVED: "RECEIVED";
64
+ N_A: "N_A";
65
+ }>;
66
+ signature_artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
67
+ uri: z.ZodOptional<z.ZodString>;
68
+ path: z.ZodOptional<z.ZodString>;
69
+ received_at: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>>>;
71
+ }, z.core.$strip>;
72
+ export type Signatory = z.infer<typeof SignatorySchema>;
73
+ export declare const ChecklistDocumentSchema: z.ZodObject<{
74
+ document_id: z.ZodString;
75
+ title: z.ZodString;
76
+ primary_link: z.ZodOptional<z.ZodString>;
77
+ labels: z.ZodDefault<z.ZodArray<z.ZodString>>;
78
+ }, z.core.$strip>;
79
+ export type ChecklistDocument = z.infer<typeof ChecklistDocumentSchema>;
80
+ export declare const ChecklistEntrySchema: z.ZodObject<{
81
+ entry_id: z.ZodString;
82
+ document_id: z.ZodOptional<z.ZodString>;
83
+ stage: z.ZodEnum<{
84
+ PRE_SIGNING: "PRE_SIGNING";
85
+ SIGNING: "SIGNING";
86
+ CLOSING: "CLOSING";
87
+ POST_CLOSING: "POST_CLOSING";
88
+ }>;
89
+ sort_key: z.ZodString;
90
+ title: z.ZodString;
91
+ status: z.ZodEnum<{
92
+ NOT_STARTED: "NOT_STARTED";
93
+ DRAFT: "DRAFT";
94
+ CIRCULATED: "CIRCULATED";
95
+ FORM_FINAL: "FORM_FINAL";
96
+ PARTIALLY_SIGNED: "PARTIALLY_SIGNED";
97
+ FULLY_EXECUTED: "FULLY_EXECUTED";
98
+ DELIVERED: "DELIVERED";
99
+ FILED_OR_RECORDED: "FILED_OR_RECORDED";
100
+ }>;
101
+ parent_entry_id: z.ZodOptional<z.ZodString>;
102
+ responsible_party: z.ZodOptional<z.ZodObject<{
103
+ organization: z.ZodOptional<z.ZodString>;
104
+ individual_name: z.ZodOptional<z.ZodString>;
105
+ role: z.ZodOptional<z.ZodString>;
106
+ }, z.core.$strip>>;
107
+ citations: z.ZodDefault<z.ZodArray<z.ZodObject<{
108
+ ref: z.ZodOptional<z.ZodString>;
109
+ text: z.ZodOptional<z.ZodString>;
110
+ link: z.ZodOptional<z.ZodString>;
111
+ filepath: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strip>>>;
113
+ signatories: z.ZodDefault<z.ZodArray<z.ZodObject<{
114
+ party: z.ZodString;
115
+ name: z.ZodOptional<z.ZodString>;
116
+ title: z.ZodOptional<z.ZodString>;
117
+ status: z.ZodEnum<{
118
+ PENDING: "PENDING";
119
+ RECEIVED: "RECEIVED";
120
+ N_A: "N_A";
121
+ }>;
122
+ signature_artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
123
+ uri: z.ZodOptional<z.ZodString>;
124
+ path: z.ZodOptional<z.ZodString>;
125
+ received_at: z.ZodOptional<z.ZodString>;
126
+ }, z.core.$strip>>>;
127
+ }, z.core.$strip>>>;
128
+ }, z.core.$strip>;
129
+ export type ChecklistEntry = z.infer<typeof ChecklistEntrySchema>;
130
+ export declare const ActionItemSchema: z.ZodObject<{
131
+ action_id: z.ZodString;
132
+ description: z.ZodString;
133
+ status: z.ZodEnum<{
134
+ NOT_STARTED: "NOT_STARTED";
135
+ IN_PROGRESS: "IN_PROGRESS";
136
+ COMPLETED: "COMPLETED";
137
+ ON_HOLD: "ON_HOLD";
138
+ }>;
139
+ assigned_to: z.ZodOptional<z.ZodObject<{
140
+ organization: z.ZodOptional<z.ZodString>;
141
+ individual_name: z.ZodOptional<z.ZodString>;
142
+ role: z.ZodOptional<z.ZodString>;
143
+ }, z.core.$strip>>;
144
+ due_date: z.ZodOptional<z.ZodString>;
145
+ related_document_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
146
+ citations: z.ZodDefault<z.ZodArray<z.ZodObject<{
147
+ ref: z.ZodOptional<z.ZodString>;
148
+ text: z.ZodOptional<z.ZodString>;
149
+ link: z.ZodOptional<z.ZodString>;
150
+ filepath: z.ZodOptional<z.ZodString>;
151
+ }, z.core.$strip>>>;
152
+ }, z.core.$strip>;
153
+ export type ActionItem = z.infer<typeof ActionItemSchema>;
154
+ export declare const IssueSchema: z.ZodObject<{
155
+ issue_id: z.ZodString;
156
+ title: z.ZodString;
157
+ summary: z.ZodOptional<z.ZodString>;
158
+ status: z.ZodEnum<{
159
+ OPEN: "OPEN";
160
+ CLOSED: "CLOSED";
161
+ }>;
162
+ related_document_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
163
+ citations: z.ZodDefault<z.ZodArray<z.ZodObject<{
164
+ ref: z.ZodOptional<z.ZodString>;
165
+ text: z.ZodOptional<z.ZodString>;
166
+ link: z.ZodOptional<z.ZodString>;
167
+ filepath: z.ZodOptional<z.ZodString>;
168
+ }, z.core.$strip>>>;
169
+ }, z.core.$strip>;
170
+ export type Issue = z.infer<typeof IssueSchema>;
171
+ export declare const ClosingChecklistSchema: z.ZodObject<{
172
+ deal_name: z.ZodString;
173
+ updated_at: z.ZodString;
174
+ documents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
175
+ document_id: z.ZodString;
176
+ title: z.ZodString;
177
+ primary_link: z.ZodOptional<z.ZodString>;
178
+ labels: z.ZodDefault<z.ZodArray<z.ZodString>>;
179
+ }, z.core.$strip>>>;
180
+ checklist_entries: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
181
+ entry_id: z.ZodString;
182
+ document_id: z.ZodOptional<z.ZodString>;
183
+ stage: z.ZodEnum<{
184
+ PRE_SIGNING: "PRE_SIGNING";
185
+ SIGNING: "SIGNING";
186
+ CLOSING: "CLOSING";
187
+ POST_CLOSING: "POST_CLOSING";
188
+ }>;
189
+ sort_key: z.ZodString;
190
+ title: z.ZodString;
191
+ status: z.ZodEnum<{
192
+ NOT_STARTED: "NOT_STARTED";
193
+ DRAFT: "DRAFT";
194
+ CIRCULATED: "CIRCULATED";
195
+ FORM_FINAL: "FORM_FINAL";
196
+ PARTIALLY_SIGNED: "PARTIALLY_SIGNED";
197
+ FULLY_EXECUTED: "FULLY_EXECUTED";
198
+ DELIVERED: "DELIVERED";
199
+ FILED_OR_RECORDED: "FILED_OR_RECORDED";
200
+ }>;
201
+ parent_entry_id: z.ZodOptional<z.ZodString>;
202
+ responsible_party: z.ZodOptional<z.ZodObject<{
203
+ organization: z.ZodOptional<z.ZodString>;
204
+ individual_name: z.ZodOptional<z.ZodString>;
205
+ role: z.ZodOptional<z.ZodString>;
206
+ }, z.core.$strip>>;
207
+ citations: z.ZodDefault<z.ZodArray<z.ZodObject<{
208
+ ref: z.ZodOptional<z.ZodString>;
209
+ text: z.ZodOptional<z.ZodString>;
210
+ link: z.ZodOptional<z.ZodString>;
211
+ filepath: z.ZodOptional<z.ZodString>;
212
+ }, z.core.$strip>>>;
213
+ signatories: z.ZodDefault<z.ZodArray<z.ZodObject<{
214
+ party: z.ZodString;
215
+ name: z.ZodOptional<z.ZodString>;
216
+ title: z.ZodOptional<z.ZodString>;
217
+ status: z.ZodEnum<{
218
+ PENDING: "PENDING";
219
+ RECEIVED: "RECEIVED";
220
+ N_A: "N_A";
221
+ }>;
222
+ signature_artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
223
+ uri: z.ZodOptional<z.ZodString>;
224
+ path: z.ZodOptional<z.ZodString>;
225
+ received_at: z.ZodOptional<z.ZodString>;
226
+ }, z.core.$strip>>>;
227
+ }, z.core.$strip>>>;
228
+ }, z.core.$strip>>>;
229
+ action_items: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
230
+ action_id: z.ZodString;
231
+ description: z.ZodString;
232
+ status: z.ZodEnum<{
233
+ NOT_STARTED: "NOT_STARTED";
234
+ IN_PROGRESS: "IN_PROGRESS";
235
+ COMPLETED: "COMPLETED";
236
+ ON_HOLD: "ON_HOLD";
237
+ }>;
238
+ assigned_to: z.ZodOptional<z.ZodObject<{
239
+ organization: z.ZodOptional<z.ZodString>;
240
+ individual_name: z.ZodOptional<z.ZodString>;
241
+ role: z.ZodOptional<z.ZodString>;
242
+ }, z.core.$strip>>;
243
+ due_date: z.ZodOptional<z.ZodString>;
244
+ related_document_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
245
+ citations: z.ZodDefault<z.ZodArray<z.ZodObject<{
246
+ ref: z.ZodOptional<z.ZodString>;
247
+ text: z.ZodOptional<z.ZodString>;
248
+ link: z.ZodOptional<z.ZodString>;
249
+ filepath: z.ZodOptional<z.ZodString>;
250
+ }, z.core.$strip>>>;
251
+ }, z.core.$strip>>>;
252
+ issues: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
253
+ issue_id: z.ZodString;
254
+ title: z.ZodString;
255
+ summary: z.ZodOptional<z.ZodString>;
256
+ status: z.ZodEnum<{
257
+ OPEN: "OPEN";
258
+ CLOSED: "CLOSED";
259
+ }>;
260
+ related_document_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
261
+ citations: z.ZodDefault<z.ZodArray<z.ZodObject<{
262
+ ref: z.ZodOptional<z.ZodString>;
263
+ text: z.ZodOptional<z.ZodString>;
264
+ link: z.ZodOptional<z.ZodString>;
265
+ filepath: z.ZodOptional<z.ZodString>;
266
+ }, z.core.$strip>>>;
267
+ }, z.core.$strip>>>;
268
+ }, z.core.$strip>;
269
+ export type ClosingChecklist = z.infer<typeof ClosingChecklistSchema>;
270
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/core/checklist/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,uBAAuB;;;;;EAAiE,CAAC;AACtG,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E,eAAO,MAAM,eAAe;;;EAA6B,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE1D,eAAO,MAAM,kBAAkB;;;;;EAAgE,CAAC;AAChG,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEhE,eAAO,MAAM,wBAAwB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OtB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAiBhD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8HjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,229 @@
1
+ import { z } from 'zod';
2
+ // ---------------------------------------------------------------------------
3
+ // Enum schemas
4
+ // ---------------------------------------------------------------------------
5
+ export const ChecklistItemStatusEnum = z.enum(['NOT_STARTED', 'IN_PROGRESS', 'COMPLETED', 'ON_HOLD']);
6
+ export const IssueStatusEnum = z.enum(['OPEN', 'CLOSED']);
7
+ export const ChecklistStageEnum = z.enum(['PRE_SIGNING', 'SIGNING', 'CLOSING', 'POST_CLOSING']);
8
+ export const ChecklistEntryStatusEnum = z.enum([
9
+ 'NOT_STARTED',
10
+ 'DRAFT',
11
+ 'CIRCULATED',
12
+ 'FORM_FINAL',
13
+ 'PARTIALLY_SIGNED',
14
+ 'FULLY_EXECUTED',
15
+ 'DELIVERED',
16
+ 'FILED_OR_RECORDED',
17
+ ]);
18
+ export const SignatoryStatusEnum = z.enum(['PENDING', 'RECEIVED', 'N_A']);
19
+ // ---------------------------------------------------------------------------
20
+ // Component schemas
21
+ // ---------------------------------------------------------------------------
22
+ export const ResponsibilitySchema = z.object({
23
+ organization: z.string().optional(),
24
+ individual_name: z.string().optional(),
25
+ role: z.string().optional(),
26
+ });
27
+ export const CitationSchema = z.object({
28
+ ref: z.string().min(1).optional(),
29
+ text: z.string().min(1).optional(),
30
+ link: z.string().min(1).optional(),
31
+ filepath: z.string().min(1).optional(),
32
+ }).superRefine((citation, ctx) => {
33
+ if (!citation.ref && !citation.text) {
34
+ ctx.addIssue({
35
+ code: z.ZodIssueCode.custom,
36
+ path: ['text'],
37
+ message: 'citation requires at least one of text or ref',
38
+ });
39
+ }
40
+ });
41
+ export const SignatureArtifactSchema = z.object({
42
+ uri: z.string().min(1).optional(),
43
+ path: z.string().min(1).optional(),
44
+ received_at: z.string().optional(),
45
+ }).superRefine((artifact, ctx) => {
46
+ if (!artifact.uri && !artifact.path) {
47
+ ctx.addIssue({
48
+ code: z.ZodIssueCode.custom,
49
+ path: ['uri'],
50
+ message: 'signature artifact requires at least one of uri or path',
51
+ });
52
+ }
53
+ });
54
+ export const SignatorySchema = z.object({
55
+ party: z.string().min(1),
56
+ name: z.string().optional(),
57
+ title: z.string().optional(),
58
+ status: SignatoryStatusEnum,
59
+ signature_artifacts: z.array(SignatureArtifactSchema).default([]),
60
+ });
61
+ export const ChecklistDocumentSchema = z.object({
62
+ document_id: z.string().min(1),
63
+ title: z.string().min(1),
64
+ primary_link: z.string().min(1).optional(),
65
+ labels: z.array(z.string().min(1)).default([]),
66
+ });
67
+ export const ChecklistEntrySchema = z.object({
68
+ entry_id: z.string().min(1),
69
+ document_id: z.string().min(1).optional(),
70
+ stage: ChecklistStageEnum,
71
+ sort_key: z.string().min(1),
72
+ title: z.string().min(1),
73
+ status: ChecklistEntryStatusEnum,
74
+ parent_entry_id: z.string().min(1).optional(),
75
+ responsible_party: ResponsibilitySchema.optional(),
76
+ citations: z.array(CitationSchema).default([]),
77
+ signatories: z.array(SignatorySchema).default([]),
78
+ });
79
+ export const ActionItemSchema = z.object({
80
+ action_id: z.string().min(1),
81
+ description: z.string().min(1),
82
+ status: ChecklistItemStatusEnum,
83
+ assigned_to: ResponsibilitySchema.optional(),
84
+ due_date: z.string().optional(),
85
+ related_document_ids: z.array(z.string().min(1)).default([]),
86
+ citations: z.array(CitationSchema).default([]),
87
+ });
88
+ export const IssueSchema = z.object({
89
+ issue_id: z.string().min(1),
90
+ title: z.string().min(1),
91
+ summary: z.string().optional(),
92
+ status: IssueStatusEnum,
93
+ related_document_ids: z.array(z.string().min(1)).default([]),
94
+ citations: z.array(CitationSchema).default([]),
95
+ });
96
+ import { DANGEROUS_KEYS } from './patch-validator.js';
97
+ const ClosingChecklistBaseSchema = z.object({
98
+ deal_name: z.string().min(1),
99
+ updated_at: z.string().min(1),
100
+ documents: z.record(z.string(), ChecklistDocumentSchema).default({}),
101
+ checklist_entries: z.record(z.string(), ChecklistEntrySchema).default({}),
102
+ action_items: z.record(z.string(), ActionItemSchema).default({}),
103
+ issues: z.record(z.string(), IssueSchema).default({}),
104
+ });
105
+ // ---------------------------------------------------------------------------
106
+ // Top-level closing checklist schema with referential integrity rules
107
+ // ---------------------------------------------------------------------------
108
+ export const ClosingChecklistSchema = ClosingChecklistBaseSchema.superRefine((checklist, ctx) => {
109
+ // Key policy: reject dangerous keys in all collections
110
+ for (const collectionName of ['documents', 'checklist_entries', 'action_items', 'issues']) {
111
+ for (const key of Object.keys(checklist[collectionName])) {
112
+ if (DANGEROUS_KEYS.has(key)) {
113
+ ctx.addIssue({
114
+ code: z.ZodIssueCode.custom,
115
+ path: [collectionName, key],
116
+ message: `record key "${key}" is a disallowed key`,
117
+ });
118
+ }
119
+ }
120
+ }
121
+ // Key-value consistency: dict key must match item ID
122
+ const knownDocumentIds = new Set();
123
+ for (const [key, document] of Object.entries(checklist.documents)) {
124
+ if (key !== document.document_id) {
125
+ ctx.addIssue({
126
+ code: z.ZodIssueCode.custom,
127
+ path: ['documents', key, 'document_id'],
128
+ message: `record key "${key}" does not match document_id "${document.document_id}"`,
129
+ });
130
+ }
131
+ knownDocumentIds.add(document.document_id);
132
+ }
133
+ const documentToEntry = new Map();
134
+ const entriesById = new Map();
135
+ for (const [key, entry] of Object.entries(checklist.checklist_entries)) {
136
+ if (key !== entry.entry_id) {
137
+ ctx.addIssue({
138
+ code: z.ZodIssueCode.custom,
139
+ path: ['checklist_entries', key, 'entry_id'],
140
+ message: `record key "${key}" does not match entry_id "${entry.entry_id}"`,
141
+ });
142
+ }
143
+ entriesById.set(entry.entry_id, entry);
144
+ if (entry.document_id) {
145
+ if (!knownDocumentIds.has(entry.document_id)) {
146
+ ctx.addIssue({
147
+ code: z.ZodIssueCode.custom,
148
+ path: ['checklist_entries', key, 'document_id'],
149
+ message: `unknown document_id "${entry.document_id}"`,
150
+ });
151
+ }
152
+ const mappedEntryId = documentToEntry.get(entry.document_id);
153
+ if (mappedEntryId && mappedEntryId !== entry.entry_id) {
154
+ ctx.addIssue({
155
+ code: z.ZodIssueCode.custom,
156
+ path: ['checklist_entries', key, 'document_id'],
157
+ message: `document_id "${entry.document_id}" is already mapped to entry_id "${mappedEntryId}"`,
158
+ });
159
+ }
160
+ else {
161
+ documentToEntry.set(entry.document_id, entry.entry_id);
162
+ }
163
+ }
164
+ }
165
+ for (const [key, entry] of Object.entries(checklist.checklist_entries)) {
166
+ if (!entry.parent_entry_id)
167
+ continue;
168
+ const parent = entriesById.get(entry.parent_entry_id);
169
+ if (!parent) {
170
+ ctx.addIssue({
171
+ code: z.ZodIssueCode.custom,
172
+ path: ['checklist_entries', key, 'parent_entry_id'],
173
+ message: `unknown parent_entry_id "${entry.parent_entry_id}"`,
174
+ });
175
+ continue;
176
+ }
177
+ if (entry.parent_entry_id === entry.entry_id) {
178
+ ctx.addIssue({
179
+ code: z.ZodIssueCode.custom,
180
+ path: ['checklist_entries', key, 'parent_entry_id'],
181
+ message: 'entry cannot be its own parent',
182
+ });
183
+ }
184
+ if (parent.stage !== entry.stage) {
185
+ ctx.addIssue({
186
+ code: z.ZodIssueCode.custom,
187
+ path: ['checklist_entries', key, 'parent_entry_id'],
188
+ message: `parent entry "${entry.parent_entry_id}" is in stage ${parent.stage}, but child is in ${entry.stage}`,
189
+ });
190
+ }
191
+ }
192
+ for (const [key, action] of Object.entries(checklist.action_items)) {
193
+ if (key !== action.action_id) {
194
+ ctx.addIssue({
195
+ code: z.ZodIssueCode.custom,
196
+ path: ['action_items', key, 'action_id'],
197
+ message: `record key "${key}" does not match action_id "${action.action_id}"`,
198
+ });
199
+ }
200
+ action.related_document_ids.forEach((documentId, docIdx) => {
201
+ if (!knownDocumentIds.has(documentId)) {
202
+ ctx.addIssue({
203
+ code: z.ZodIssueCode.custom,
204
+ path: ['action_items', key, 'related_document_ids', docIdx],
205
+ message: `unknown related document_id "${documentId}"`,
206
+ });
207
+ }
208
+ });
209
+ }
210
+ for (const [key, issue] of Object.entries(checklist.issues)) {
211
+ if (key !== issue.issue_id) {
212
+ ctx.addIssue({
213
+ code: z.ZodIssueCode.custom,
214
+ path: ['issues', key, 'issue_id'],
215
+ message: `record key "${key}" does not match issue_id "${issue.issue_id}"`,
216
+ });
217
+ }
218
+ issue.related_document_ids.forEach((documentId, docIdx) => {
219
+ if (!knownDocumentIds.has(documentId)) {
220
+ ctx.addIssue({
221
+ code: z.ZodIssueCode.custom,
222
+ path: ['issues', key, 'related_document_ids', docIdx],
223
+ message: `unknown related document_id "${documentId}"`,
224
+ });
225
+ }
226
+ });
227
+ }
228
+ });
229
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/core/checklist/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,eAAe;AACf,8EAA8E;AAE9E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;AAGtG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAG1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;AAGhG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,C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,MAAM;oBAC3B,IAAI,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE,sBAAsB,EAAE,MAAM,CAAC;oBAC3D,OAAO,EAAE,gCAAgC,UAAU,GAAG;iBACvD,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5D,IAAI,GAAG,KAAK,KAAK,CAAC,QAAQ,EAAE,CAAC;YAC3B,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;gBAC3B,IAAI,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,UAAU,CAAC;gBACjC,OAAO,EAAE,eAAe,GAAG,8BAA8B,KAAK,CAAC,QAAQ,GAAG;aAC3E,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE;YACxD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBACtC,GAAG,CAAC,QAAQ,CAAC;oBACX,IAAI,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;oBAC3B,IAAI,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,sBAAsB,EAAE,MAAM,CAAC;oBACrD,OAAO,EAAE,gCAAgC,UAAU,GAAG;iBACvD,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Convert an array of items into a Record keyed by a specified ID field.
3
+ * Used to transform test fixtures from array format to Record format
4
+ * for the array-to-record schema migration.
5
+ */
6
+ export declare function arrayToRecord<T extends Record<string, unknown>>(items: T[], idField: keyof T): Record<string, T>;
7
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/core/checklist/test-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7D,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,EAAE,MAAM,CAAC,GACf,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAMnB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Convert an array of items into a Record keyed by a specified ID field.
3
+ * Used to transform test fixtures from array format to Record format
4
+ * for the array-to-record schema migration.
5
+ */
6
+ export function arrayToRecord(items, idField) {
7
+ const result = {};
8
+ for (const item of items) {
9
+ result[item[idField]] = item;
10
+ }
11
+ return result;
12
+ }
13
+ //# sourceMappingURL=test-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../../../src/core/checklist/test-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAU,EACV,OAAgB;IAEhB,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAW,CAAC,GAAG,IAAI,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ToolCommandAdapter } from '../types.js';
2
+ import type { TemplateMetadata } from '../../metadata.js';
3
+ export declare class ClaudeCodeAdapter implements ToolCommandAdapter {
4
+ readonly name = "claude-code";
5
+ generateSkillFile(metadata: TemplateMetadata, templateId: string): string;
6
+ getOutputPath(_templateId: string): string;
7
+ private groupFieldsBySection;
8
+ private buildQuestionRounds;
9
+ private formatRound;
10
+ }
11
+ //# sourceMappingURL=claude.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../../src/core/command-generation/adapters/claude.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAS1D,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,QAAQ,CAAC,IAAI,iBAAiB;IAE9B,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;IA4CzE,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAI1C,OAAO,CAAC,oBAAoB;IAiB5B,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,WAAW;CAapB"}
@@ -0,0 +1,91 @@
1
+ export class ClaudeCodeAdapter {
2
+ name = 'claude-code';
3
+ generateSkillFile(metadata, templateId) {
4
+ const requiredFields = new Set(metadata.required_fields);
5
+ const fieldsBySection = this.groupFieldsBySection(metadata);
6
+ const questionRounds = this.buildQuestionRounds(fieldsBySection);
7
+ return `# OpenAgreements: Fill ${metadata.name}
8
+
9
+ Fill the **${metadata.name}** template with user-provided values and render a DOCX file.
10
+
11
+ Source: ${metadata.source_url}
12
+ License: ${metadata.license}
13
+ ${metadata.attribution_text}
14
+
15
+ ## Instructions
16
+
17
+ 1. Greet the user and explain you'll help them fill out a ${metadata.name}.
18
+ 2. Collect field values using AskUserQuestion in multiple rounds (up to 4 questions each).
19
+ 3. After collecting all values, run the template engine to produce the filled DOCX.
20
+
21
+ ## Field Collection Rounds
22
+
23
+ ${questionRounds}
24
+
25
+ ## Execution
26
+
27
+ After collecting all field values, run:
28
+
29
+ \`\`\`bash
30
+ open-agreements fill ${templateId} ${metadata.fields
31
+ .filter((f) => requiredFields.has(f.name))
32
+ .map((f) => `--${f.name} "\${${f.name}}"`)
33
+ .join(' ')}
34
+ \`\`\`
35
+
36
+ The filled DOCX will be saved to the current directory.
37
+
38
+ ## Important
39
+
40
+ - All fields should be confirmed with the user before rendering.
41
+ - If the user is unsure about a field (e.g., governing law), suggest common defaults.
42
+ - This template is licensed under ${metadata.license}. ${metadata.attribution_text}
43
+ `;
44
+ }
45
+ getOutputPath(_templateId) {
46
+ return '.claude/commands/open-agreements.md';
47
+ }
48
+ groupFieldsBySection(metadata) {
49
+ const requiredFields = new Set(metadata.required_fields);
50
+ const sections = new Map();
51
+ for (const field of metadata.fields) {
52
+ const fieldWithRequired = {
53
+ ...field,
54
+ required: requiredFields.has(field.name),
55
+ };
56
+ const section = field.section ?? 'General';
57
+ if (!sections.has(section))
58
+ sections.set(section, []);
59
+ sections.get(section).push(fieldWithRequired);
60
+ }
61
+ return sections;
62
+ }
63
+ buildQuestionRounds(fieldsBySection) {
64
+ let round = 1;
65
+ let output = '';
66
+ let currentBatch = [];
67
+ for (const [section, fields] of fieldsBySection) {
68
+ for (const field of fields) {
69
+ currentBatch.push(field);
70
+ if (currentBatch.length === 4) {
71
+ output += this.formatRound(round, section, currentBatch);
72
+ round++;
73
+ currentBatch = [];
74
+ }
75
+ }
76
+ if (currentBatch.length > 0) {
77
+ output += this.formatRound(round, section, currentBatch);
78
+ round++;
79
+ currentBatch = [];
80
+ }
81
+ }
82
+ return output;
83
+ }
84
+ formatRound(round, section, fields) {
85
+ const fieldList = fields
86
+ .map((f) => ` - **${f.name}** (${f.type}${f.required ? ', required' : ', optional'}): ${f.description}`)
87
+ .join('\n');
88
+ return `### Round ${round}: ${section}\n${fieldList}\n\n`;
89
+ }
90
+ }
91
+ //# sourceMappingURL=claude.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../../src/core/command-generation/adapters/claude.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,iBAAiB;IACnB,IAAI,GAAG,aAAa,CAAC;IAE9B,iBAAiB,CAAC,QAA0B,EAAE,UAAkB;QAC9D,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC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