ddd-ts-kit 0.17.0 → 0.19.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 (234) hide show
  1. package/CHANGELOG.md +1273 -0
  2. package/README.fr.md +11 -12
  3. package/README.md +10 -10
  4. package/dist/affected/reach-of.js +1 -1
  5. package/dist/affected/reach-of.js.map +1 -1
  6. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  7. package/dist/check/catalogue/architecture-rules.js +4 -0
  8. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  9. package/dist/check/declarations/declared-event-handlers.d.ts +4 -9
  10. package/dist/check/declarations/declared-event-handlers.d.ts.map +1 -1
  11. package/dist/check/declarations/declared-event-handlers.js +5 -5
  12. package/dist/check/declarations/declared-event-handlers.js.map +1 -1
  13. package/dist/check/declarations/option-of.d.ts +0 -2
  14. package/dist/check/declarations/option-of.d.ts.map +1 -1
  15. package/dist/check/declarations/option-of.js +1 -7
  16. package/dist/check/declarations/option-of.js.map +1 -1
  17. package/dist/check/explain/authz-docs.d.ts.map +1 -1
  18. package/dist/check/explain/authz-docs.js +14 -1
  19. package/dist/check/explain/authz-docs.js.map +1 -1
  20. package/dist/check/explain/events-docs.d.ts.map +1 -1
  21. package/dist/check/explain/events-docs.js +44 -13
  22. package/dist/check/explain/events-docs.js.map +1 -1
  23. package/dist/check/explain/ports-docs.d.ts.map +1 -1
  24. package/dist/check/explain/ports-docs.js +11 -9
  25. package/dist/check/explain/ports-docs.js.map +1 -1
  26. package/dist/check/explain/scheduling-docs.d.ts.map +1 -1
  27. package/dist/check/explain/scheduling-docs.js +10 -5
  28. package/dist/check/explain/scheduling-docs.js.map +1 -1
  29. package/dist/check/explain/wiring-docs.js +4 -4
  30. package/dist/check/explain/wiring-docs.js.map +1 -1
  31. package/dist/check/fixtures/authz-policy-fixtures.d.ts +3 -0
  32. package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -0
  33. package/dist/check/fixtures/authz-policy-fixtures.js +97 -0
  34. package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -0
  35. package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
  36. package/dist/check/fixtures/declarations-fixtures.js +2 -42
  37. package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
  38. package/dist/check/fixtures/declared.d.ts.map +1 -1
  39. package/dist/check/fixtures/declared.js +3 -3
  40. package/dist/check/fixtures/declared.js.map +1 -1
  41. package/dist/check/fixtures/domain-events-fixtures.js +1 -1
  42. package/dist/check/fixtures/domain-events-fixtures.js.map +1 -1
  43. package/dist/check/fixtures/event-sourcing-fixtures.js +3 -3
  44. package/dist/check/fixtures/event-sourcing-fixtures.js.map +1 -1
  45. package/dist/check/fixtures/events-fixtures.d.ts.map +1 -1
  46. package/dist/check/fixtures/events-fixtures.js +30 -1
  47. package/dist/check/fixtures/events-fixtures.js.map +1 -1
  48. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  49. package/dist/check/fixtures/fixtures.js +2 -0
  50. package/dist/check/fixtures/fixtures.js.map +1 -1
  51. package/dist/check/fixtures/language-fixtures.d.ts.map +1 -1
  52. package/dist/check/fixtures/language-fixtures.js +1 -1
  53. package/dist/check/fixtures/language-fixtures.js.map +1 -1
  54. package/dist/check/rules/authz-policy-asked.d.ts +3 -0
  55. package/dist/check/rules/authz-policy-asked.d.ts.map +1 -0
  56. package/dist/check/rules/authz-policy-asked.js +184 -0
  57. package/dist/check/rules/authz-policy-asked.js.map +1 -0
  58. package/dist/check/rules/declarations-role-declared.d.ts.map +1 -1
  59. package/dist/check/rules/declarations-role-declared.js +4 -35
  60. package/dist/check/rules/declarations-role-declared.js.map +1 -1
  61. package/dist/check/rules/events-consumer-idempotent.js +3 -3
  62. package/dist/check/rules/events-consumer-idempotent.js.map +1 -1
  63. package/dist/check/rules/events-name-declared-once.d.ts +3 -0
  64. package/dist/check/rules/events-name-declared-once.d.ts.map +1 -0
  65. package/dist/check/rules/events-name-declared-once.js +51 -0
  66. package/dist/check/rules/events-name-declared-once.js.map +1 -0
  67. package/dist/generate/emit.d.ts.map +1 -1
  68. package/dist/generate/emit.js +2 -14
  69. package/dist/generate/emit.js.map +1 -1
  70. package/dist/generate/kinds/ask-policy-in-generated-use-case.d.ts +9 -0
  71. package/dist/generate/kinds/ask-policy-in-generated-use-case.d.ts.map +1 -0
  72. package/dist/generate/kinds/ask-policy-in-generated-use-case.js +102 -0
  73. package/dist/generate/kinds/ask-policy-in-generated-use-case.js.map +1 -0
  74. package/dist/generate/kinds/assert-declares-its-name.d.ts +9 -0
  75. package/dist/generate/kinds/assert-declares-its-name.d.ts.map +1 -0
  76. package/dist/generate/kinds/assert-declares-its-name.js +16 -0
  77. package/dist/generate/kinds/assert-declares-its-name.js.map +1 -0
  78. package/dist/generate/kinds/command-context.d.ts +12 -0
  79. package/dist/generate/kinds/command-context.d.ts.map +1 -0
  80. package/dist/generate/kinds/command-context.js +18 -0
  81. package/dist/generate/kinds/command-context.js.map +1 -0
  82. package/dist/generate/kinds/command-kind.d.ts.map +1 -1
  83. package/dist/generate/kinds/command-kind.js +7 -24
  84. package/dist/generate/kinds/command-kind.js.map +1 -1
  85. package/dist/generate/kinds/command-outputs.d.ts +6 -0
  86. package/dist/generate/kinds/command-outputs.d.ts.map +1 -0
  87. package/dist/generate/kinds/command-outputs.js +13 -0
  88. package/dist/generate/kinds/command-outputs.js.map +1 -0
  89. package/dist/generate/kinds/declares-its-name.d.ts +5 -0
  90. package/dist/generate/kinds/declares-its-name.d.ts.map +1 -0
  91. package/dist/generate/kinds/declares-its-name.js +7 -0
  92. package/dist/generate/kinds/declares-its-name.js.map +1 -0
  93. package/dist/generate/kinds/event-file-of.d.ts +5 -0
  94. package/dist/generate/kinds/event-file-of.d.ts.map +1 -0
  95. package/dist/generate/kinds/event-file-of.js +5 -0
  96. package/dist/generate/kinds/event-file-of.js.map +1 -0
  97. package/dist/generate/kinds/event-handler-kind.d.ts.map +1 -1
  98. package/dist/generate/kinds/event-handler-kind.js +2 -0
  99. package/dist/generate/kinds/event-handler-kind.js.map +1 -1
  100. package/dist/generate/kinds/event-name-reference.d.ts +4 -3
  101. package/dist/generate/kinds/event-name-reference.d.ts.map +1 -1
  102. package/dist/generate/kinds/event-name-reference.js +6 -6
  103. package/dist/generate/kinds/event-name-reference.js.map +1 -1
  104. package/dist/generate/kinds/integration-event-kind.d.ts.map +1 -1
  105. package/dist/generate/kinds/integration-event-kind.js +2 -0
  106. package/dist/generate/kinds/integration-event-kind.js.map +1 -1
  107. package/dist/generate/kinds/policy-kind.d.ts.map +1 -1
  108. package/dist/generate/kinds/policy-kind.js +2 -0
  109. package/dist/generate/kinds/policy-kind.js.map +1 -1
  110. package/dist/generate/kinds/query-context.d.ts +9 -0
  111. package/dist/generate/kinds/query-context.d.ts.map +1 -0
  112. package/dist/generate/kinds/query-context.js +27 -0
  113. package/dist/generate/kinds/query-context.js.map +1 -0
  114. package/dist/generate/kinds/query-kind.d.ts.map +1 -1
  115. package/dist/generate/kinds/query-kind.js +16 -52
  116. package/dist/generate/kinds/query-kind.js.map +1 -1
  117. package/dist/generate/kinds/query-outputs.d.ts +8 -0
  118. package/dist/generate/kinds/query-outputs.d.ts.map +1 -0
  119. package/dist/generate/kinds/query-outputs.js +20 -0
  120. package/dist/generate/kinds/query-outputs.js.map +1 -0
  121. package/dist/generate/kinds/reader-file.d.ts +8 -0
  122. package/dist/generate/kinds/reader-file.d.ts.map +1 -0
  123. package/dist/generate/kinds/reader-file.js +9 -0
  124. package/dist/generate/kinds/reader-file.js.map +1 -0
  125. package/dist/generate/mark-policy-questions.d.ts +10 -0
  126. package/dist/generate/mark-policy-questions.d.ts.map +1 -0
  127. package/dist/generate/mark-policy-questions.js +76 -0
  128. package/dist/generate/mark-policy-questions.js.map +1 -0
  129. package/dist/generate/permission-pattern.d.ts +4 -0
  130. package/dist/generate/permission-pattern.d.ts.map +1 -0
  131. package/dist/generate/permission-pattern.js +7 -0
  132. package/dist/generate/permission-pattern.js.map +1 -0
  133. package/dist/generate/refined-by-policy.d.ts +4 -0
  134. package/dist/generate/refined-by-policy.d.ts.map +1 -0
  135. package/dist/generate/refined-by-policy.js +9 -0
  136. package/dist/generate/refined-by-policy.js.map +1 -0
  137. package/dist/generate/rendered.d.ts +5 -0
  138. package/dist/generate/rendered.d.ts.map +1 -0
  139. package/dist/generate/rendered.js +18 -0
  140. package/dist/generate/rendered.js.map +1 -0
  141. package/dist/generate/wire.d.ts.map +1 -1
  142. package/dist/generate/wire.js +3 -25
  143. package/dist/generate/wire.js.map +1 -1
  144. package/dist/generate/wirings.d.ts +8 -0
  145. package/dist/generate/wirings.d.ts.map +1 -0
  146. package/dist/generate/wirings.js +28 -0
  147. package/dist/generate/wirings.js.map +1 -0
  148. package/dist/init/copilot-instruction.d.ts +6 -0
  149. package/dist/init/copilot-instruction.d.ts.map +1 -0
  150. package/dist/init/copilot-instruction.js +15 -0
  151. package/dist/init/copilot-instruction.js.map +1 -0
  152. package/dist/init/files/guidance-files.d.ts +1 -0
  153. package/dist/init/files/guidance-files.d.ts.map +1 -1
  154. package/dist/init/files/guidance-files.js +4 -3
  155. package/dist/init/files/guidance-files.js.map +1 -1
  156. package/dist/init/files/layer-rules.d.ts +3 -0
  157. package/dist/init/files/layer-rules.d.ts.map +1 -0
  158. package/dist/init/files/layer-rules.js +11 -0
  159. package/dist/init/files/layer-rules.js.map +1 -0
  160. package/dist/init/files/pipeline-files.d.ts.map +1 -1
  161. package/dist/init/files/pipeline-files.js +2 -0
  162. package/dist/init/files/pipeline-files.js.map +1 -1
  163. package/dist/init/json-object.d.ts +3 -0
  164. package/dist/init/json-object.d.ts.map +1 -0
  165. package/dist/init/json-object.js +12 -0
  166. package/dist/init/json-object.js.map +1 -0
  167. package/dist/init/manifest/versions.js +24 -24
  168. package/dist/init/run-init.d.ts.map +1 -1
  169. package/dist/init/run-init.js +4 -0
  170. package/dist/init/run-init.js.map +1 -1
  171. package/dist/init/write-agent-settings.d.ts.map +1 -1
  172. package/dist/init/write-agent-settings.js +3 -10
  173. package/dist/init/write-agent-settings.js.map +1 -1
  174. package/dist/init/write-copilot-instructions.d.ts +7 -0
  175. package/dist/init/write-copilot-instructions.d.ts.map +1 -0
  176. package/dist/init/write-copilot-instructions.js +16 -0
  177. package/dist/init/write-copilot-instructions.js.map +1 -0
  178. package/dist/init/write-copilot-settings.d.ts +8 -0
  179. package/dist/init/write-copilot-settings.d.ts.map +1 -0
  180. package/dist/init/write-copilot-settings.js +36 -0
  181. package/dist/init/write-copilot-settings.js.map +1 -0
  182. package/dist/markers/index.d.ts +1 -0
  183. package/dist/markers/index.d.ts.map +1 -1
  184. package/dist/markers/index.js +1 -0
  185. package/dist/markers/index.js.map +1 -1
  186. package/dist/markers/replace-in-region.d.ts +10 -0
  187. package/dist/markers/replace-in-region.d.ts.map +1 -0
  188. package/dist/markers/replace-in-region.js +30 -0
  189. package/dist/markers/replace-in-region.js.map +1 -0
  190. package/dist/progress/format-progress.js +4 -0
  191. package/dist/progress/format-progress.js.map +1 -1
  192. package/dist/progress/progress.d.ts +2 -0
  193. package/dist/progress/progress.d.ts.map +1 -1
  194. package/dist/progress/read-progress.js +1 -0
  195. package/dist/progress/read-progress.js.map +1 -1
  196. package/dist/progress/read-slices.d.ts +5 -1
  197. package/dist/progress/read-slices.d.ts.map +1 -1
  198. package/dist/progress/read-slices.js +17 -7
  199. package/dist/progress/read-slices.js.map +1 -1
  200. package/dist/sdk/agent-instruction.d.ts +1 -1
  201. package/dist/sdk/agent-instruction.js +1 -1
  202. package/dist/sdk/instruct-agents.d.ts +1 -1
  203. package/dist/sdk/instruct-agents.d.ts.map +1 -1
  204. package/dist/sdk/instruct-agents.js +12 -8
  205. package/dist/sdk/instruct-agents.js.map +1 -1
  206. package/dist/version.d.ts +1 -1
  207. package/dist/version.js +1 -1
  208. package/package.json +27 -4
  209. package/templates/command/handler.declared.ts.tpl +29 -0
  210. package/templates/command/handler.spec.buses.ts.tpl +24 -1
  211. package/templates/command/handler.ts.tpl +29 -0
  212. package/templates/command/wiring.manual.tpl +2 -2
  213. package/templates/command/wiring.tsyringe.tpl +5 -2
  214. package/templates/event-handler/event-handler.declared.ts.tpl +1 -1
  215. package/templates/init/AGENTS.md.tpl +46 -0
  216. package/templates/init/CLAUDE.md.tpl +2 -45
  217. package/templates/init/README.md.tpl +1 -1
  218. package/templates/init/rules/application.md.tpl +1 -1
  219. package/templates/init/rules/domain.md.tpl +1 -1
  220. package/templates/integration-event/publisher.declared.ts.tpl +1 -1
  221. package/templates/pipeline/github/workflows/copilot-setup-steps.yml +26 -0
  222. package/templates/pipeline/package-scripts.json +1 -1
  223. package/templates/presets/identity/context/application/integration/publishers/account-deactivated.publisher.ts.tpl +1 -1
  224. package/templates/presets/identity/context/application/integration/publishers/delegation-granted.publisher.ts.tpl +1 -1
  225. package/templates/presets/identity/context/application/integration/publishers/delegation-revoked.publisher.ts.tpl +1 -1
  226. package/templates/presets/identity/context/application/integration/publishers/member-joined.publisher.ts.tpl +1 -1
  227. package/templates/presets/identity/context/application/integration/publishers/member-removed.publisher.ts.tpl +1 -1
  228. package/templates/presets/identity/context/application/integration/publishers/member-role-changed.publisher.ts.tpl +1 -1
  229. package/templates/presets/identity/context/application/integration/publishers/organisation-opened.publisher.ts.tpl +1 -1
  230. package/templates/query/handler.declared.ts.tpl +19 -0
  231. package/templates/query/handler.spec.buses.ts.tpl +21 -0
  232. package/templates/query/handler.ts.tpl +19 -0
  233. package/templates/query/wiring.manual.tpl +1 -1
  234. package/templates/query/wiring.tsyringe.tpl +4 -1
@@ -1,4 +1,5 @@
1
1
  import { isRecord } from './is-record.js';
2
+ import { jsonObject } from './json-object.js';
2
3
  import { formatJson } from '../json/format-json.js';
3
4
  const AGENT_SETTINGS = '.claude/settings.json';
4
5
  /**
@@ -50,6 +51,7 @@ const PERMISSIONS = {
50
51
  'Edit(./.gitlab-ci.yml)',
51
52
  'Edit(./.github/workflows/**)',
52
53
  'Edit(./.claude/settings.json)',
54
+ 'Edit(./.github/copilot/settings.json)',
53
55
  ],
54
56
  };
55
57
  /** Creates the settings, or adds the missing permissions to the ones the project already has, and says which. */
@@ -59,7 +61,7 @@ export function writeAgentSettings(ws) {
59
61
  ws.create(AGENT_SETTINGS, serialize({ permissions: PERMISSIONS }));
60
62
  return;
61
63
  }
62
- const settings = parse(existing);
64
+ const settings = jsonObject(existing);
63
65
  if (settings === undefined) {
64
66
  ws.note(`${AGENT_SETTINGS} is not a JSON object: it was left as it is.`);
65
67
  return;
@@ -71,15 +73,6 @@ export function writeAgentSettings(ws) {
71
73
  }
72
74
  }
73
75
  const serialize = (settings) => formatJson(settings);
74
- function parse(text) {
75
- try {
76
- const parsed = JSON.parse(text);
77
- return isRecord(parsed) ? parsed : undefined;
78
- }
79
- catch {
80
- return undefined;
81
- }
82
- }
83
76
  /** A rule is compared as the project says it: its settings name the package manager it runs, not npm. */
84
77
  function mergePermissions(settings, spoken) {
85
78
  const current = isRecord(settings['permissions']) ? settings['permissions'] : {};
@@ -1 +1 @@
1
- {"version":3,"file":"write-agent-settings.js","sourceRoot":"","sources":["../../src/init/write-agent-settings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAI/C;;;GAGG;AACH,MAAM,WAAW,GAAgB;IAC/B,KAAK,EAAE;QACL,8BAA8B;QAC9B,6BAA6B;QAC7B,iCAAiC;QACjC,6BAA6B;QAC7B,gCAAgC;QAChC,4BAA4B;QAC5B,sBAAsB;QACtB,yBAAyB;QACzB,sBAAsB;QACtB,kBAAkB;QAClB,0BAA0B;QAC1B,6BAA6B;QAC7B,0BAA0B;QAC1B,gCAAgC;QAChC,6BAA6B;QAC7B,+BAA+B;QAC/B,4BAA4B;KAC7B;IACD,wFAAwF;IACxF,kFAAkF;IAClF,6EAA6E;IAC7E,IAAI,EAAE;QACJ,cA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,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC;AAC3D,CAAC"}
1
+ {"version":3,"file":"write-agent-settings.js","sourceRoot":"","sources":["../../src/init/write-agent-settings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAI/C;;;GAGG;AACH,MAAM,WAAW,GAAgB;IAC/B,KAAK,EAAE;QACL,8BAA8B;QAC9B,6BAA6B;QAC7B,iCAAiC;QACjC,6BAA6B;QAC7B,gCAAgC;QAChC,4BAA4B;QAC5B,sBAAsB;QACtB,yBAAyB;QACzB,sBAAsB;QACtB,kBAAkB;QAClB,0BAA0B;QAC1B,6BAA6B;QAC7B,0BAA0B;QAC1B,gCAAgC;QAChC,6BAA6B;QAC7B,+BAA+B;QAC/B,4BAA4B;KAC7B;IACD,wFAAwF;IACxF,kFAAkF;IAClF,6EAA6E;IAC7E,IAAI,EAAE;QACJ,cAAc;QACd,gBAAgB;QAChB,uBAAuB;QACvB,oBAAoB;QACpB,qCAAqC;QACrC,2CAA2C;KAC5C;IACD,yFAAyF;IACzF,4EAA4E;IAC5E,GAAG,EAAE;QACH,kBAAkB;QAClB,qBAAqB;QACrB,gCAAgC;QAChC,2BAA2B;QAC3B,oBAAoB;QACpB,iCAAiC;QACjC,mBAAmB;QACnB,sBAAsB;QACtB,wBAAwB;QACxB,8BAA8B;QAC9B,+BAA+B;QAC/B,uCAAuC;KACxC;CACF,CAAC;AAEF,iHAAiH;AACjH,MAAM,UA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EAAE,CAAC;IAC3B,MAAM,WAAW,GAA4B,EAAE,GAAG,OAAO,EAAE,CAAC;IAE5D,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACzD,MAAM,OAAO,GAAc,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7E,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAE7E,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Workspace } from '../workspace/index.js';
2
+ /**
3
+ * The rules by layer for GitHub Copilot, from those of Claude Code as this run left them: its
4
+ * cloud agent, its code review and VS Code read `.github/instructions/`, never `.claude/rules/`.
5
+ */
6
+ export declare function writeCopilotInstructions(ws: Workspace): void;
7
+ //# sourceMappingURL=write-copilot-instructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-copilot-instructions.d.ts","sourceRoot":"","sources":["../../src/init/write-copilot-instructions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,CAS5D"}
@@ -0,0 +1,16 @@
1
+ import { copilotInstruction } from './copilot-instruction.js';
2
+ import { LAYER_RULES } from './files/layer-rules.js';
3
+ /**
4
+ * The rules by layer for GitHub Copilot, from those of Claude Code as this run left them: its
5
+ * cloud agent, its code review and VS Code read `.github/instructions/`, never `.claude/rules/`.
6
+ */
7
+ export function writeCopilotInstructions(ws) {
8
+ for (const layer of LAYER_RULES) {
9
+ const rule = ws.read(`.claude/rules/${layer}.md`);
10
+ const instruction = rule === undefined ? undefined : copilotInstruction(rule);
11
+ if (instruction !== undefined) {
12
+ ws.create(`.github/instructions/${layer}.instructions.md`, instruction);
13
+ }
14
+ }
15
+ }
16
+ //# sourceMappingURL=write-copilot-instructions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-copilot-instructions.js","sourceRoot":"","sources":["../../src/init/write-copilot-instructions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,EAAa;IACpD,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,KAAK,KAAK,CAAC,CAAC;QAClD,MAAM,WAAW,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAE9E,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,EAAE,CAAC,MAAM,CAAC,wBAAwB,KAAK,kBAAkB,EAAE,WAAW,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Workspace } from '../workspace/index.js';
2
+ /**
3
+ * The plugin of the kit, declared for GitHub Copilot: its cloud agent installs it from this file,
4
+ * the Copilot CLI and VS Code recommend it. A project that has the file keeps what it holds and
5
+ * gains the two entries it lacks.
6
+ */
7
+ export declare function writeCopilotSettings(ws: Workspace): void;
8
+ //# sourceMappingURL=write-copilot-settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-copilot-settings.d.ts","sourceRoot":"","sources":["../../src/init/write-copilot-settings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQvD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,CA2BxD"}
@@ -0,0 +1,36 @@
1
+ import { formatJson } from '../json/format-json.js';
2
+ import { isRecord } from './is-record.js';
3
+ import { jsonObject } from './json-object.js';
4
+ const COPILOT_SETTINGS = '.github/copilot/settings.json';
5
+ const MARKETPLACE = 'ddd-ts-kit';
6
+ const PLUGIN = `ddd-ts-kit@${MARKETPLACE}`;
7
+ /**
8
+ * The plugin of the kit, declared for GitHub Copilot: its cloud agent installs it from this file,
9
+ * the Copilot CLI and VS Code recommend it. A project that has the file keeps what it holds and
10
+ * gains the two entries it lacks.
11
+ */
12
+ export function writeCopilotSettings(ws) {
13
+ const existing = ws.read(COPILOT_SETTINGS);
14
+ const settings = existing === undefined ? {} : jsonObject(existing);
15
+ if (settings === undefined) {
16
+ ws.note(`${COPILOT_SETTINGS} is not a JSON object: it was left as it is.`);
17
+ return;
18
+ }
19
+ const marketplaces = isRecord(settings['extraKnownMarketplaces']) ? settings['extraKnownMarketplaces'] : {};
20
+ const plugins = isRecord(settings['enabledPlugins']) ? settings['enabledPlugins'] : {};
21
+ const declared = {
22
+ ...settings,
23
+ extraKnownMarketplaces: {
24
+ ...marketplaces,
25
+ [MARKETPLACE]: marketplaces[MARKETPLACE] ?? { source: { source: 'github', repo: 'gbourgeat/ddd-ts-kit' } },
26
+ },
27
+ enabledPlugins: { ...plugins, [PLUGIN]: plugins[PLUGIN] ?? true },
28
+ };
29
+ if (existing === undefined) {
30
+ ws.create(COPILOT_SETTINGS, formatJson(declared));
31
+ }
32
+ else {
33
+ ws.update(COPILOT_SETTINGS, formatJson(declared));
34
+ }
35
+ }
36
+ //# sourceMappingURL=write-copilot-settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-copilot-settings.js","sourceRoot":"","sources":["../../src/init/write-copilot-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,gBAAgB,GAAG,+BAA+B,CAAC;AACzD,MAAM,WAAW,GAAG,YAAY,CAAC;AACjC,MAAM,MAAM,GAAG,cAAc,WAAW,EAAE,CAAC;AAE3C;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAAa;IAChD,MAAM,QAAQ,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEpE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,EAAE,CAAC,IAAI,CAAC,GAAG,gBAAgB,8CAA8C,CAAC,CAAC;QAE3E,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5G,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEvF,MAAM,QAAQ,GAAG;QACf,GAAG,QAAQ;QACX,sBAAsB,EAAE;YACtB,GAAG,YAAY;YACf,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,sBAAsB,EAAE,EAAE;SAC3G;QACD,cAAc,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;KAClE,CAAC;IAEF,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export { insertInRegion } from './insert-in-region.js';
2
2
  export { parseWiring } from './parse-wiring.js';
3
+ export { replaceInRegion } from './replace-in-region.js';
3
4
  export { replaceRegion } from './replace-region.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/markers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/markers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export { insertInRegion } from './insert-in-region.js';
2
2
  export { parseWiring } from './parse-wiring.js';
3
+ export { replaceInRegion } from './replace-in-region.js';
3
4
  export { replaceRegion } from './replace-region.js';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/markers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/markers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Replaces, inside a region, the lines a block was added as by the lines another block is added
3
+ * as, both laid out for the indentation of the region. Undefined when the file has no such region
4
+ * or the region no longer holds the first block as it was written.
5
+ */
6
+ export declare function replaceInRegion(content: string, region: string, { replaced, by }: {
7
+ readonly replaced: string;
8
+ readonly by: string;
9
+ }): string | undefined;
10
+ //# sourceMappingURL=replace-in-region.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-in-region.d.ts","sourceRoot":"","sources":["../../src/markers/replace-in-region.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACnE,MAAM,GAAG,SAAS,CAoBpB"}
@@ -0,0 +1,30 @@
1
+ import { fitBlock } from '../layout/index.js';
2
+ import { marker } from './marker.js';
3
+ /**
4
+ * Replaces, inside a region, the lines a block was added as by the lines another block is added
5
+ * as, both laid out for the indentation of the region. Undefined when the file has no such region
6
+ * or the region no longer holds the first block as it was written.
7
+ */
8
+ export function replaceInRegion(content, region, { replaced, by }) {
9
+ const lines = content.split('\n');
10
+ const open = lines.findIndex((line) => marker(region, false).test(line));
11
+ const close = lines.findIndex((line, index) => index > open && marker(region, true).test(line));
12
+ if (open === -1 || close === -1) {
13
+ return undefined;
14
+ }
15
+ const indent = /^\s*/.exec(lines[close] ?? '')?.[0] ?? '';
16
+ const inside = lines.slice(open + 1, close).join('\n');
17
+ const before = laidOut(replaced, indent);
18
+ if (before === '' || !inside.includes(before)) {
19
+ return undefined;
20
+ }
21
+ lines.splice(open + 1, close - open - 1, ...inside.replace(before, laidOut(by, indent)).split('\n'));
22
+ return lines.join('\n');
23
+ }
24
+ function laidOut(block, indent) {
25
+ const written = block.split('\n').filter((line) => line.trim() !== '');
26
+ return fitBlock(written, indent)
27
+ .map((line) => (line.trim() === '' ? '' : `${indent}${line}`))
28
+ .join('\n');
29
+ }
30
+ //# sourceMappingURL=replace-in-region.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-in-region.js","sourceRoot":"","sources":["../../src/markers/replace-in-region.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,MAAc,EACd,EAAE,QAAQ,EAAE,EAAE,EAAsD;IAEpE,MAAM,KAAK,GAAG,OAA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AC;AAED,SAAS,OAAO,CAAC,KAAa,EAAE,MAAc;IAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAEvE,OAAO,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;SAC7B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC;SAC7D,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
@@ -23,8 +23,12 @@ function sliceLines(slices) {
23
23
  .filter((status) => status !== 'done')
24
24
  .flatMap((status) => [` ${status}`, ...slices.rows.filter((row) => row.status === status).map(rowLine)]);
25
25
  const owners = Object.entries(slices.byOwner).map(([owner, byStatus]) => ` ${owner}: ${counts(byStatus, statuses)}`);
26
+ const duplicated = slices.duplicates.length === 0
27
+ ? []
28
+ : [` row numbers used more than once: ${slices.duplicates.join(', ')} (give each row its own number)`];
26
29
  return [
27
30
  `Slices (${slices.file}): ${slices.rows.length}, ${counts(slices.byStatus, statuses)}`,
31
+ ...duplicated,
28
32
  ...open,
29
33
  ' by owner',
30
34
  ...owners,
@@ -1 +1 @@
1
- {"version":3,"file":"format-progress.js","sourceRoot":"","sources":["../../src/progress/format-progress.ts"],"names":[],"mappings":"AAGA,MAAM,YAAY,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAErD,8EAA8E;AAC9E,MAAM,OAAO,GACX,wOAAwO,CAAC;AAE3O,8HAA8H;AAC9H,MAAM,UAAU,cAAc,CAAC,QAAkB;IAC/C,OAAO;QACL,SAAS,QAAQ,CAAC,IAAI,IAAI,OAAO,EAAE;QACnC,EAAE;QACF,G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C,KAAK,YAAY,GAAG,CAAC,KAAK,GAAG,KAAK,GAAG,CAAC;AACjG,CAAC;AAED,SAAS,aAAa,CAAC,KAAqB;IAC1C,OAAO,KAAK,KAAK,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,MAAM,kBAAkB,KAAK,CAAC,QAAQ,oBAAoB,KAAK,CAAC,IAAI,UAAU,CAAC;AACrK,CAAC"}
@@ -15,6 +15,8 @@ export interface SlicesProgress {
15
15
  readonly byStatus: Readonly<Record<string, readonly string[]>>;
16
16
  /** The ids of the rows, by owner then by status. */
17
17
  readonly byOwner: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>>;
18
+ /** The ids that more than one row carries, across the tables of the file: each such row is counted. */
19
+ readonly duplicates: readonly string[];
18
20
  }
19
21
  export interface RemainingCount {
20
22
  readonly context: string;
@@ -1 +1 @@
1
- {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/progress/progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,0GAA0G;AAC1G,MAAM,WAAW,QAAQ;IACvB,4HAA4H;IAC5H,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,mGAAmG;IACnG,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IACvC,sHAAsH;IACtH,QAAQ,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,KAAK,EAAE,CAAC;IAChC,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;IAC/D,oDA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ACvG,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,8BAA8B;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,yBAAyB;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB"}
@@ -17,6 +17,7 @@ function slicesProgress(rows) {
17
17
  rows,
18
18
  byStatus: idsByStatus(rows),
19
19
  byOwner: Object.fromEntries(owners.map((owner) => [owner, idsByStatus(rows.filter((row) => row.owner === owner))])),
20
+ duplicates: [...new Set(rows.map((row) => row.id).filter((id, index, ids) => ids.indexOf(id) !== index))],
20
21
  };
21
22
  }
22
23
  function idsByStatus(rows) {
@@ -1 +1 @@
1
- {"version":3,"file":"read-progress.js","sourceRoot":"","sources":["../../src/progress/read-progress.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI3D,MAAM,SAAS,GAAG,2BAA2B,CAAC;AAE9C,4HAA4H;AAC5H,MAAM,UAAU,YAAY,CAAC,EAAa,EAAE,MAAc;IACxD,MAAM,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;IAE9B,OAAO;QACL,IAAI,EAAE,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI;QAC5E,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC;QAC5D,SAAS,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,EAAE,MAAM,CA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AC,CAAC;QACpD,OAAO;QACP,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC;QAChC,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC;QACpC,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;KAC7B,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;IAE9B,OAAO,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACrH,CAAC"}
@@ -1,6 +1,10 @@
1
1
  import type { Workspace } from '../workspace/index.js';
2
2
  import type { Slice } from './slice.js';
3
3
  export declare const SLICES_FILE = "docs/architecture/slices.md";
4
- /** The rows of the slices table; undefined when the project has no slices file or the file has no such table. */
4
+ /**
5
+ * The rows of every slices table, in the order of the file: a plan may keep one table per
6
+ * milestone or story, each under the same header. Undefined when the project has no slices file
7
+ * or the file has no such table.
8
+ */
5
9
  export declare function readSlices(ws: Workspace): Slice[] | undefined;
6
10
  //# sourceMappingURL=read-slices.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"read-slices.d.ts","sourceRoot":"","sources":["../../src/progress/read-slices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,eAAO,MAAM,WAAW,gCAAgC,CAAC;AAIzD,iHAAiH;AACjH,wBAAgB,UAAU,CAAC,EAAE,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,SAAS,CAqB7D"}
1
+ {"version":3,"file":"read-slices.d.ts","sourceRoot":"","sources":["../../src/progress/read-slices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,eAAO,MAAM,WAAW,gCAAgC,CAAC;AAIzD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,SAAS,CAS7D"}
@@ -1,20 +1,30 @@
1
1
  export const SLICES_FILE = 'docs/architecture/slices.md';
2
2
  const COLUMNS = ['#', 'context', 'kind', 'slice', 'start with', 'depends on', 'owner', 'status'];
3
- /** The rows of the slices table; undefined when the project has no slices file or the file has no such table. */
3
+ /**
4
+ * The rows of every slices table, in the order of the file: a plan may keep one table per
5
+ * milestone or story, each under the same header. Undefined when the project has no slices file
6
+ * or the file has no such table.
7
+ */
4
8
  export function readSlices(ws) {
5
9
  const lines = (ws.read(SLICES_FILE) ?? '').split('\n');
6
- const header = lines.findIndex((line) => cellsOf(line)
7
- .map((cell) => cell.toLowerCase())
8
- .join('|') === COLUMNS.join('|'));
9
- if (header === -1) {
10
+ const headers = lines.flatMap((line, index) => (isHeader(line) ? [index] : []));
11
+ if (headers.length === 0) {
10
12
  return undefined;
11
13
  }
14
+ return headers.flatMap((header) => tableRows(lines, header)).map(sliceOf);
15
+ }
16
+ function isHeader(line) {
17
+ return (cellsOf(line)
18
+ .map((cell) => cell.toLowerCase())
19
+ .join('|') === COLUMNS.join('|'));
20
+ }
21
+ /** The rows under a header and its separator, up to the first line that is not a row. */
22
+ function tableRows(lines, header) {
12
23
  const end = lines.findIndex((line, index) => index > header + 1 && !line.trim().startsWith('|'));
13
24
  return lines
14
25
  .slice(header + 2, end === -1 ? undefined : end)
15
26
  .map(cellsOf)
16
- .filter((cells) => cells.length === COLUMNS.length)
17
- .map(sliceOf);
27
+ .filter((cells) => cells.length === COLUMNS.length);
18
28
  }
19
29
  /** The cells of a table row; a `\|` inside a cell is a bar of its text. */
20
30
  function cellsOf(line) {
@@ -1 +1 @@
1
- {"version":3,"file":"read-slices.js","sourceRoot":"","sources":["../../src/progress/read-slices.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAEzD,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAEjG,iHAAiH;AACjH,MAAM,UAAU,UAAU,CAAC,EAAa;IACtC,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEvD,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAC5B,CAAC,IAAI,EAAE,EAAE,CACP,OAAO,CAAC,IAAI,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;SACjC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CACrC,CAAC;IAEF,IAAI,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;QAClB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjG,OAAO,KAAK;SACT,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;SAC/C,GAAG,CAAC,OAAO,CAAC;SACZ,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,C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ACjB,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;aACxB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC;QAC9B,KAAK;QACL,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE;KAC7B,CAAC;AACJ,CAAC"}
@@ -1,3 +1,3 @@
1
- /** What the CLAUDE.md of a project with clients tells its agents, at `init --sdk` and when `ddd-ts-kit sdk` asks for them later. */
1
+ /** What the AGENTS.md of a project with clients tells its agents, at `init --sdk` and when `ddd-ts-kit sdk` asks for them later. */
2
2
  export declare const AGENT_INSTRUCTION = "Never edit the clients under `clients/`, except the version and your own keys in their `package.json`: `npm run docs:generate` (`npx ddd-ts-kit sdk`) rewrites them from the contract, `docs:check` fails while they differ from it. A spec or a script calls the API through a client by its package name, which the command resolves to its sources under `paths` in `tsconfig.json`.";
3
3
  //# sourceMappingURL=agent-instruction.d.ts.map
@@ -1,3 +1,3 @@
1
- /** What the CLAUDE.md of a project with clients tells its agents, at `init --sdk` and when `ddd-ts-kit sdk` asks for them later. */
1
+ /** What the AGENTS.md of a project with clients tells its agents, at `init --sdk` and when `ddd-ts-kit sdk` asks for them later. */
2
2
  export const AGENT_INSTRUCTION = 'Never edit the clients under `clients/`, except the version and your own keys in their `package.json`: `npm run docs:generate` (`npx ddd-ts-kit sdk`) rewrites them from the contract, `docs:check` fails while they differ from it. A spec or a script calls the API through a client by its package name, which the command resolves to its sources under `paths` in `tsconfig.json`.';
3
3
  //# sourceMappingURL=agent-instruction.js.map
@@ -1,7 +1,7 @@
1
1
  import type { Workspace } from '../workspace/index.js';
2
2
  /**
3
3
  * What `init --sdk` writes for the agents of a project, in one that asks for clients later: the
4
- * instruction of CLAUDE.md, appended once, and a note for the paths of the presentation rule,
4
+ * instruction of its guide, appended once, and a note for the paths of the presentation rules,
5
5
  * which the team may have rewritten.
6
6
  */
7
7
  export declare function instructAgents(ws: Workspace): void;
@@ -1 +1 @@
1
- {"version":3,"file":"instruct-agents.d.ts","sourceRoot":"","sources":["../../src/sdk/instruct-agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMvD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,CAWlD"}
1
+ {"version":3,"file":"instruct-agents.d.ts","sourceRoot":"","sources":["../../src/sdk/instruct-agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAOvD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,CAclD"}
@@ -1,19 +1,23 @@
1
1
  import { AGENT_INSTRUCTION } from './agent-instruction.js';
2
- const INSTRUCTIONS = 'CLAUDE.md';
3
- const PRESENTATION_RULE = '.claude/rules/presentation.md';
2
+ /** The guide of every agent; a project written before it kept its instructions in CLAUDE.md. */
3
+ const GUIDES = ['AGENTS.md', 'CLAUDE.md'];
4
+ const PRESENTATION_RULES = ['.claude/rules/presentation.md', '.github/instructions/presentation.instructions.md'];
4
5
  /**
5
6
  * What `init --sdk` writes for the agents of a project, in one that asks for clients later: the
6
- * instruction of CLAUDE.md, appended once, and a note for the paths of the presentation rule,
7
+ * instruction of its guide, appended once, and a note for the paths of the presentation rules,
7
8
  * which the team may have rewritten.
8
9
  */
9
10
  export function instructAgents(ws) {
10
- const instructions = ws.read(INSTRUCTIONS);
11
+ const guide = GUIDES.find((file) => ws.exists(file));
12
+ const instructions = guide === undefined ? undefined : ws.read(guide);
11
13
  const instruction = ws.spoken(AGENT_INSTRUCTION);
12
- if (instructions !== undefined && !instructions.includes(instruction)) {
13
- ws.update(INSTRUCTIONS, `${instructions}${instructions.endsWith('\n') ? '' : '\n'}\n${instruction}\n`);
14
+ if (guide !== undefined && instructions !== undefined && !instructions.includes(instruction)) {
15
+ ws.update(guide, `${instructions}${instructions.endsWith('\n') ? '' : '\n'}\n${instruction}\n`);
14
16
  }
15
- if (!(ws.read(PRESENTATION_RULE) ?? '"clients/**"').includes('"clients/**"')) {
16
- ws.note(`${PRESENTATION_RULE}: add "clients/**" to its paths, so that an agent editing a client reads it.`);
17
+ for (const rule of PRESENTATION_RULES) {
18
+ if (!(ws.read(rule) ?? 'clients/**').includes('clients/**')) {
19
+ ws.note(`${rule}: add "clients/**" to its paths, so that an agent editing a client reads it.`);
20
+ }
17
21
  }
18
22
  }
19
23
  //# sourceMappingURL=instruct-agents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instruct-agents.js","sourceRoot":"","sources":["../../src/sdk/instruct-agents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,YAAY,GAAG,WAAW,CAAC;AACjC,MAAM,iBAAiB,GAAG,+BAA+B,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,EAAa;IAC1C,MAAM,YAAY,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAEjD,IAAI,YAAY,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACtE,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC;IACzG,CAAC;IAED,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,cAAc,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;QAC7E,EAAE,CAAC,IAAI,CAAC,GA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8E,CAAC,CAAC;QACjG,CAAC;IACH,CAAC;AACH,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.17.0";
1
+ export declare const VERSION = "0.19.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.17.0';
1
+ export const VERSION = '0.19.0';
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,7 +1,28 @@
1
1
  {
2
2
  "name": "ddd-ts-kit",
3
- "version": "0.17.0",
4
- "description": "Bootstrap, scaffold and verify DDD and Clean Architecture TypeScript projects.",
3
+ "version": "0.19.0",
4
+ "description": "Bootstrap, scaffold and verify Domain-Driven Design (DDD), Clean Architecture and hexagonal TypeScript backends on Node.js: project and code generators, architecture checks, OpenAPI and AsyncAPI documents, for developers and AI coding agents (Claude Code, Codex, GitHub Copilot).",
5
+ "keywords": [
6
+ "ddd",
7
+ "domain-driven-design",
8
+ "clean-architecture",
9
+ "hexagonal-architecture",
10
+ "typescript",
11
+ "cli",
12
+ "scaffolding",
13
+ "code-generator",
14
+ "project-generator",
15
+ "architecture-testing",
16
+ "cqrs",
17
+ "event-sourcing",
18
+ "modular-monolith",
19
+ "microservices",
20
+ "nodejs",
21
+ "claude-code",
22
+ "codex",
23
+ "github-copilot",
24
+ "ai-agents"
25
+ ],
5
26
  "license": "MIT",
6
27
  "repository": {
7
28
  "type": "git",
@@ -21,14 +42,16 @@
21
42
  },
22
43
  "files": [
23
44
  "dist",
24
- "templates"
45
+ "templates",
46
+ "CHANGELOG.md"
25
47
  ],
26
48
  "scripts": {
27
49
  "build": "tsc -b",
50
+ "prepack": "node -e \"require('node:fs').copyFileSync('../../CHANGELOG.md', 'CHANGELOG.md')\"",
28
51
  "clean:self": "node dist/bin.js check --clean-only src test",
29
52
  "clean:packages": "node dist/bin.js check --clean-only ../kernel/src ../validation/src ../http/src ../tracing/src ../di/src ../events/src ../testing/src ../s3/src ../drizzle/src ../knex/src ../prisma/src ../typeorm/src ../aspects/src ../rabbitmq/src ../auth/src ../audit/src ../redis/src ../scheduling/src ../pino/src ../winston/src ../sentry/src ../kafka/src ../nats/src ../eslint-plugin/src"
30
53
  },
31
54
  "devDependencies": {
32
- "@ddd-ts-kit/kernel": "^0.17.0"
55
+ "@ddd-ts-kit/kernel": "^0.19.0"
33
56
  }
34
57
  }
@@ -1,8 +1,14 @@
1
1
  {{#if command.hasAggregate}}
2
+ {{#if access.policy}}
3
+ import type { Access } from '@ddd-ts-kit/auth';
4
+ {{/if}}
2
5
  import type { Clock, IdGenerator } from '@ddd-ts-kit/kernel';
3
6
  import { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
4
7
  import { {{aggregate.pascal}} } from '{{alias.context}}/domain/aggregates/{{aggregate.kebab}}.aggregate{{alias.ext}}';
5
8
  import type { {{aggregate.pascal}}Repository } from '{{alias.context}}/domain/repositories/{{aggregate.kebab}}.repository{{alias.ext}}';
9
+ {{#if access.policy}}
10
+ {{access.useCasePermissionsImport}}
11
+ {{/if}}
6
12
  import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
7
13
 
8
14
  @CommandHandler({{name.pascal}}Command)
@@ -11,9 +17,17 @@ export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Com
11
17
  private readonly {{aggregate.camel}}Repository: {{aggregate.pascal}}Repository,
12
18
  private readonly ids: IdGenerator,
13
19
  private readonly clock: Clock,
20
+ {{#if access.policy}}
21
+ private readonly access: Access,
22
+ {{/if}}
14
23
  ) {}
15
24
 
16
25
  async execute(command: {{name.pascal}}Command): Promise<string> {
26
+ {{#if access.policy}}
27
+ // TODO(domain): a policy refines {{access.reference}}: ask it about the element "{{name.words}}" acts on once it is loaded, in place of `command`.
28
+ await this.access.authorize(command.actor, {{access.reference}}, command);
29
+
30
+ {{/if}}
17
31
  {{#if refusals.factories}}
18
32
  // TODO(domain): decide what "{{name.words}}" does to a {{aggregate.pascal}}: either it gives birth to one (keep `create`, pass the facts of `command` as value objects), or it changes an existing one (load it with `findById`, throw its not-found refusal, `{{aggregate.pascal}}Error.notFound(id)` (`ddd-ts-kit generate error {{context.kebab}} {{aggregate.pascal}} notFound`), call ONE intention method). The events it records leave with the save: nothing else to do here.
19
33
  {{/if}}
@@ -29,12 +43,27 @@ export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Com
29
43
  }
30
44
  {{/if}}
31
45
  {{#unless command.hasAggregate}}
46
+ {{#if access.policy}}
47
+ import type { Access } from '@ddd-ts-kit/auth';
48
+ {{/if}}
32
49
  import { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
50
+ {{#if access.policy}}
51
+ {{access.useCasePermissionsImport}}
52
+ {{/if}}
33
53
  import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
34
54
 
35
55
  @CommandHandler({{name.pascal}}Command)
36
56
  export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Command> {
57
+ {{#if access.policy}}
58
+ constructor(private readonly access: Access) {}
59
+
60
+ {{/if}}
37
61
  async execute(command: {{name.pascal}}Command): Promise<void> {
62
+ {{#if access.policy}}
63
+ // TODO(domain): a policy refines {{access.reference}}: ask it about the element "{{name.words}}" acts on once it is loaded, in place of `command`.
64
+ await this.access.authorize(command.actor, {{access.reference}}, command);
65
+
66
+ {{/if}}
38
67
  // TODO(domain): receive the repository of the aggregate "{{name.words}}" acts on in the constructor, typed by its port (rerun with --aggregate <Name> --force to get it declared), load or create the aggregate from `command`, call its intention method and save it (its events leave with the save); the unit of work is opened by the command bus.
39
68
  }
40
69
  }