@voxgig/sdkgen 4.45.0 → 4.47.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 (276) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/action/check.js +73 -4
  3. package/dist/action/check.js.map +1 -1
  4. package/dist/action/copies.js +1 -0
  5. package/dist/action/copies.js.map +1 -1
  6. package/dist/action/doctor.d.ts +26 -2
  7. package/dist/action/doctor.js +208 -11
  8. package/dist/action/doctor.js.map +1 -1
  9. package/dist/action/package.d.ts +1 -1
  10. package/dist/action/package.js +15 -16
  11. package/dist/action/package.js.map +1 -1
  12. package/dist/action/remove.js +16 -4
  13. package/dist/action/remove.js.map +1 -1
  14. package/dist/action/resolve.d.ts +1 -0
  15. package/dist/action/resolve.js +10 -4
  16. package/dist/action/resolve.js.map +1 -1
  17. package/dist/action/target.d.ts +2 -1
  18. package/dist/action/target.js +50 -11
  19. package/dist/action/target.js.map +1 -1
  20. package/dist/admin/status.d.ts +7 -1
  21. package/dist/admin/status.js +34 -5
  22. package/dist/admin/status.js.map +1 -1
  23. package/dist/cmp/AgentGuide.js +46 -23
  24. package/dist/cmp/AgentGuide.js.map +1 -1
  25. package/dist/cmp/AgentGuideContent.d.ts +9 -7
  26. package/dist/cmp/AgentGuideContent.js +73 -43
  27. package/dist/cmp/AgentGuideContent.js.map +1 -1
  28. package/dist/cmp/AgentGuideFeature.js +19 -9
  29. package/dist/cmp/AgentGuideFeature.js.map +1 -1
  30. package/dist/cmp/AgentGuideTop.js +95 -49
  31. package/dist/cmp/AgentGuideTop.js.map +1 -1
  32. package/dist/cmp/Changelog.js +45 -4
  33. package/dist/cmp/Changelog.js.map +1 -1
  34. package/dist/cmp/Deploy.js +73 -35
  35. package/dist/cmp/Deploy.js.map +1 -1
  36. package/dist/cmp/Entity.js +1 -1
  37. package/dist/cmp/Entity.js.map +1 -1
  38. package/dist/cmp/ExternalTarget.js +10 -5
  39. package/dist/cmp/ExternalTarget.js.map +1 -1
  40. package/dist/cmp/Feature.js +12 -5
  41. package/dist/cmp/Feature.js.map +1 -1
  42. package/dist/cmp/FeatureDocs.d.ts +6 -4
  43. package/dist/cmp/FeatureDocs.js +14 -39
  44. package/dist/cmp/FeatureDocs.js.map +1 -1
  45. package/dist/cmp/FeatureHook.d.ts +7 -1
  46. package/dist/cmp/FeatureHook.js +34 -1
  47. package/dist/cmp/FeatureHook.js.map +1 -1
  48. package/dist/cmp/Main.js +1 -1
  49. package/dist/cmp/Main.js.map +1 -1
  50. package/dist/cmp/PublishWorkflow.js +89 -55
  51. package/dist/cmp/PublishWorkflow.js.map +1 -1
  52. package/dist/cmp/ReadmeErrors.js +521 -18
  53. package/dist/cmp/ReadmeErrors.js.map +1 -1
  54. package/dist/cmp/ReadmeExplanation.js +280 -44
  55. package/dist/cmp/ReadmeExplanation.js.map +1 -1
  56. package/dist/cmp/ReadmeFeatures.js +16 -7
  57. package/dist/cmp/ReadmeFeatures.js.map +1 -1
  58. package/dist/cmp/ReadmeIntro.js +4 -3
  59. package/dist/cmp/ReadmeIntro.js.map +1 -1
  60. package/dist/cmp/ReadmeModel.js +2 -2
  61. package/dist/cmp/ReadmeModel.js.map +1 -1
  62. package/dist/cmp/ReadmeRefFeatures.js +34 -24
  63. package/dist/cmp/ReadmeRefFeatures.js.map +1 -1
  64. package/dist/cmp/ReadmeStation.js +12 -9
  65. package/dist/cmp/ReadmeStation.js.map +1 -1
  66. package/dist/cmp/ReadmeTop.js +479 -382
  67. package/dist/cmp/ReadmeTop.js.map +1 -1
  68. package/dist/cmp/ReadmeUnions.js +8 -2
  69. package/dist/cmp/ReadmeUnions.js.map +1 -1
  70. package/dist/cmp/Registered.js +1 -1
  71. package/dist/cmp/Registered.js.map +1 -1
  72. package/dist/cmp/Security.js +26 -5
  73. package/dist/cmp/Security.js.map +1 -1
  74. package/dist/cmp/Test.js +1 -1
  75. package/dist/cmp/Test.js.map +1 -1
  76. package/dist/helpers/alongside.d.ts +2 -3
  77. package/dist/helpers/alongside.js +16 -15
  78. package/dist/helpers/alongside.js.map +1 -1
  79. package/dist/helpers/applicability.d.ts +3 -1
  80. package/dist/helpers/applicability.js +40 -1
  81. package/dist/helpers/applicability.js.map +1 -1
  82. package/dist/helpers/component.js +9 -1
  83. package/dist/helpers/component.js.map +1 -1
  84. package/dist/helpers/copymerge.d.ts +3 -0
  85. package/dist/helpers/copymerge.js +43 -10
  86. package/dist/helpers/copymerge.js.map +1 -1
  87. package/dist/helpers/definitionPlan.js +0 -1
  88. package/dist/helpers/definitionPlan.js.map +1 -1
  89. package/dist/helpers/doccheck.d.ts +11 -0
  90. package/dist/helpers/doccheck.js +146 -0
  91. package/dist/helpers/doccheck.js.map +1 -0
  92. package/dist/helpers/doctext.d.ts +11 -0
  93. package/dist/helpers/doctext.js +85 -0
  94. package/dist/helpers/doctext.js.map +1 -0
  95. package/dist/helpers/exampleCall.d.ts +16 -0
  96. package/dist/helpers/exampleCall.js +334 -0
  97. package/dist/helpers/exampleCall.js.map +1 -0
  98. package/dist/helpers/exportnames.d.ts +4 -0
  99. package/dist/helpers/exportnames.js +35 -0
  100. package/dist/helpers/exportnames.js.map +1 -0
  101. package/dist/helpers/facts.d.ts +2 -1
  102. package/dist/helpers/facts.js +210 -5
  103. package/dist/helpers/facts.js.map +1 -1
  104. package/dist/helpers/flowGuard.d.ts +1 -1
  105. package/dist/helpers/flowGuard.js +20 -7
  106. package/dist/helpers/flowGuard.js.map +1 -1
  107. package/dist/helpers/generated.d.ts +1 -0
  108. package/dist/helpers/generated.js +1 -1
  109. package/dist/helpers/generated.js.map +1 -1
  110. package/dist/helpers/graphqlPoint.d.ts +2 -1
  111. package/dist/helpers/graphqlPoint.js +17 -0
  112. package/dist/helpers/graphqlPoint.js.map +1 -1
  113. package/dist/helpers/guardModel.d.ts +2 -0
  114. package/dist/helpers/guardModel.js +41 -0
  115. package/dist/helpers/guardModel.js.map +1 -0
  116. package/dist/helpers/manifest.d.ts +2 -1
  117. package/dist/helpers/manifest.js +16 -0
  118. package/dist/helpers/manifest.js.map +1 -1
  119. package/dist/helpers/mcpTools.d.ts +2 -1
  120. package/dist/helpers/mcpTools.js +8 -1
  121. package/dist/helpers/mcpTools.js.map +1 -1
  122. package/dist/helpers/modelcheck.d.ts +2 -1
  123. package/dist/helpers/modelcheck.js +13 -0
  124. package/dist/helpers/modelcheck.js.map +1 -1
  125. package/dist/helpers/opExample.d.ts +9 -2
  126. package/dist/helpers/opExample.js +22 -2
  127. package/dist/helpers/opExample.js.map +1 -1
  128. package/dist/helpers/opShape.d.ts +2 -1
  129. package/dist/helpers/opShape.js +29 -17
  130. package/dist/helpers/opShape.js.map +1 -1
  131. package/dist/helpers/packageMeta.d.ts +6 -4
  132. package/dist/helpers/packageMeta.js +88 -53
  133. package/dist/helpers/packageMeta.js.map +1 -1
  134. package/dist/helpers/placement.d.ts +15 -0
  135. package/dist/helpers/placement.js +76 -0
  136. package/dist/helpers/placement.js.map +1 -0
  137. package/dist/helpers/semver.d.ts +3 -1
  138. package/dist/helpers/semver.js +28 -0
  139. package/dist/helpers/semver.js.map +1 -1
  140. package/dist/helpers/serverVars.js +3 -2
  141. package/dist/helpers/serverVars.js.map +1 -1
  142. package/dist/helpers/shipped.d.ts +2 -1
  143. package/dist/helpers/shipped.js +12 -0
  144. package/dist/helpers/shipped.js.map +1 -1
  145. package/dist/helpers/sourcestring.d.ts +3 -0
  146. package/dist/helpers/sourcestring.js +43 -0
  147. package/dist/helpers/sourcestring.js.map +1 -0
  148. package/dist/helpers/stdrep.d.ts +1 -1
  149. package/dist/helpers/stdrep.js +5 -1
  150. package/dist/helpers/stdrep.js.map +1 -1
  151. package/dist/helpers/surface.d.ts +7 -0
  152. package/dist/helpers/surface.js +69 -0
  153. package/dist/helpers/surface.js.map +1 -0
  154. package/dist/helpers/targetguard.d.ts +13 -0
  155. package/dist/helpers/targetguard.js +65 -0
  156. package/dist/helpers/targetguard.js.map +1 -0
  157. package/dist/helpers/text.d.ts +3 -1
  158. package/dist/helpers/text.js +16 -0
  159. package/dist/helpers/text.js.map +1 -1
  160. package/dist/helpers/textguard.d.ts +31 -0
  161. package/dist/helpers/textguard.js +157 -0
  162. package/dist/helpers/textguard.js.map +1 -0
  163. package/dist/helpers/title.d.ts +4 -0
  164. package/dist/helpers/title.js +52 -0
  165. package/dist/helpers/title.js.map +1 -0
  166. package/dist/sdkgen.d.ts +4 -6
  167. package/dist/sdkgen.js +72 -63
  168. package/dist/sdkgen.js.map +1 -1
  169. package/dist/testkit.d.ts +7 -2
  170. package/dist/testkit.js +27 -20
  171. package/dist/testkit.js.map +1 -1
  172. package/dist/tsconfig.tsbuildinfo +1 -1
  173. package/dist/utility.js +2 -1
  174. package/dist/utility.js.map +1 -1
  175. package/model/fact.aontu +150 -0
  176. package/model/sdkgen.aontu +15 -3
  177. package/package.json +3 -1
  178. package/project/.sdk/src/cmp/c/ReadmeQuick_c.ts +2 -2
  179. package/project/.sdk/src/cmp/c/ReadmeTopQuick_c.ts +1 -1
  180. package/project/.sdk/src/cmp/clojure/ReadmeEntity_clojure.ts +12 -3
  181. package/project/.sdk/src/cmp/clojure/ReadmeQuick_clojure.ts +1 -1
  182. package/project/.sdk/src/cmp/cpp/ReadmeQuick_cpp.ts +1 -1
  183. package/project/.sdk/src/cmp/csharp/ReadmeQuick_csharp.ts +1 -1
  184. package/project/.sdk/src/cmp/elixir/ReadmeQuick_elixir.ts +1 -1
  185. package/project/.sdk/src/cmp/go/ReadmeQuick_go.ts +1 -1
  186. package/project/.sdk/src/cmp/java/ReadmeQuick_java.ts +1 -1
  187. package/project/.sdk/src/cmp/js/ReadmeQuick_js.ts +1 -1
  188. package/project/.sdk/src/cmp/kotlin/ReadmeQuick_kotlin.ts +1 -1
  189. package/project/.sdk/src/cmp/lua/ReadmeQuick_lua.ts +1 -1
  190. package/project/.sdk/src/cmp/ocaml/ReadmeQuick_ocaml.ts +1 -1
  191. package/project/.sdk/src/cmp/perl/ReadmeQuick_perl.ts +1 -1
  192. package/project/.sdk/src/cmp/php/ReadmeQuick_php.ts +1 -1
  193. package/project/.sdk/src/cmp/py/ReadmeQuick_py.ts +1 -1
  194. package/project/.sdk/src/cmp/rb/ReadmeQuick_rb.ts +1 -1
  195. package/project/.sdk/src/cmp/rust/ReadmeQuick_rust.ts +1 -1
  196. package/project/.sdk/src/cmp/scala/ReadmeQuick_scala.ts +1 -1
  197. package/project/.sdk/src/cmp/scala/ReadmeRef_scala.ts +4 -1
  198. package/project/.sdk/src/cmp/swift/ReadmeQuick_swift.ts +2 -1
  199. package/project/.sdk/src/cmp/swift/ReadmeRef_swift.ts +3 -0
  200. package/project/.sdk/src/cmp/swift/ReadmeTopQuick_swift.ts +2 -1
  201. package/project/.sdk/src/cmp/ts/ReadmeQuick_ts.ts +1 -1
  202. package/project/.sdk/src/cmp/ts/TestDefinition_ts.ts +3 -1
  203. package/project/.sdk/src/cmp/zig/ReadmeOptions_zig.ts +1 -1
  204. package/project/.sdk/src/cmp/zig/ReadmeQuick_zig.ts +3 -3
  205. package/project/.sdk/src/cmp/zig/ReadmeTopQuick_zig.ts +2 -2
  206. package/project/.sdk/tm/ocaml/test/feature/secrets/t_secrets.ml +3 -1
  207. package/project/.sdk/tm/php/test/feature/secrets/SecretsTest.php +2 -1
  208. package/project/.sdk/tm/zig/test/feature/secrets/secrets_test.zig +11 -2
  209. package/project/sdkgen-package.json +1 -1
  210. package/src/action/check.ts +99 -4
  211. package/src/action/copies.ts +2 -0
  212. package/src/action/doctor.ts +304 -15
  213. package/src/action/package.ts +11 -13
  214. package/src/action/remove.ts +20 -5
  215. package/src/action/resolve.ts +11 -4
  216. package/src/action/target.ts +66 -15
  217. package/src/admin/status.ts +25 -5
  218. package/src/cmp/AgentGuide.ts +52 -25
  219. package/src/cmp/AgentGuideContent.ts +75 -43
  220. package/src/cmp/AgentGuideFeature.ts +21 -10
  221. package/src/cmp/AgentGuideTop.ts +119 -49
  222. package/src/cmp/Changelog.ts +56 -5
  223. package/src/cmp/Deploy.ts +81 -40
  224. package/src/cmp/Entity.ts +1 -1
  225. package/src/cmp/ExternalTarget.ts +12 -6
  226. package/src/cmp/Feature.ts +13 -6
  227. package/src/cmp/FeatureDocs.ts +21 -40
  228. package/src/cmp/FeatureHook.ts +38 -1
  229. package/src/cmp/Main.ts +1 -1
  230. package/src/cmp/PublishWorkflow.ts +94 -60
  231. package/src/cmp/ReadmeErrors.ts +555 -25
  232. package/src/cmp/ReadmeExplanation.ts +316 -52
  233. package/src/cmp/ReadmeFeatures.ts +18 -8
  234. package/src/cmp/ReadmeIntro.ts +4 -3
  235. package/src/cmp/ReadmeModel.ts +2 -2
  236. package/src/cmp/ReadmeRefFeatures.ts +39 -27
  237. package/src/cmp/ReadmeStation.ts +13 -16
  238. package/src/cmp/ReadmeTop.ts +538 -397
  239. package/src/cmp/ReadmeUnions.ts +10 -2
  240. package/src/cmp/Registered.ts +1 -1
  241. package/src/cmp/Security.ts +35 -7
  242. package/src/cmp/Test.ts +1 -1
  243. package/src/helpers/alongside.ts +16 -19
  244. package/src/helpers/applicability.ts +44 -1
  245. package/src/helpers/component.ts +11 -1
  246. package/src/helpers/copymerge.ts +58 -10
  247. package/src/helpers/definitionPlan.ts +0 -1
  248. package/src/helpers/doccheck.ts +174 -0
  249. package/src/helpers/doctext.ts +115 -0
  250. package/src/helpers/exampleCall.ts +415 -0
  251. package/src/helpers/exportnames.ts +47 -0
  252. package/src/helpers/facts.ts +259 -5
  253. package/src/helpers/flowGuard.ts +22 -7
  254. package/src/helpers/generated.ts +3 -1
  255. package/src/helpers/graphqlPoint.ts +20 -1
  256. package/src/helpers/guardModel.ts +50 -0
  257. package/src/helpers/manifest.ts +19 -0
  258. package/src/helpers/mcpTools.ts +11 -1
  259. package/src/helpers/modelcheck.ts +16 -0
  260. package/src/helpers/opExample.ts +34 -2
  261. package/src/helpers/opShape.ts +29 -16
  262. package/src/helpers/packageMeta.ts +89 -52
  263. package/src/helpers/placement.ts +114 -0
  264. package/src/helpers/semver.ts +35 -0
  265. package/src/helpers/serverVars.ts +4 -2
  266. package/src/helpers/shipped.ts +13 -0
  267. package/src/helpers/sourcestring.ts +47 -0
  268. package/src/helpers/stdrep.ts +6 -1
  269. package/src/helpers/surface.ts +82 -0
  270. package/src/helpers/targetguard.ts +91 -0
  271. package/src/helpers/text.ts +22 -0
  272. package/src/helpers/textguard.ts +208 -0
  273. package/src/helpers/title.ts +59 -0
  274. package/src/sdkgen.ts +82 -78
  275. package/src/testkit.ts +42 -20
  276. package/src/utility.ts +2 -1
@@ -554,32 +554,23 @@ function trimFeatures(
554
554
  }
555
555
 
556
556
 
557
+ type TargetFeature = { trim: boolean, fullset: string[] }
558
+
559
+
557
560
  function readTargetFeature(
558
561
  ctx$: any,
559
562
  tfolder: string,
560
563
  torigname: string,
561
564
  tname: string,
562
- ): { trim: boolean, fullset: string[] } {
565
+ ): TargetFeature {
563
566
  const { log } = ctx$
564
567
  const fs = ctx$.fs()
565
568
 
566
569
  const path = definitionPathAny(fs, tfolder, 'target', torigname)
567
570
 
571
+ let source: TargetFeature
568
572
  try {
569
- const errs: any[] = []
570
- const src = migrateIncludes(fs.readFileSync(path, 'utf8'))
571
- const model = new Aontu().generate(src, { path, errs })
572
-
573
- if (0 < errs.length) {
574
- throw new Error(errs.map((e: any) => e.msg || String(e)).join('\n'))
575
- }
576
-
577
- const feature = model?.main?.[KIT]?.target?.[torigname]?.feature ?? {}
578
-
579
- return {
580
- trim: false !== feature.trim,
581
- fullset: Array.isArray(feature.fullset) ? feature.fullset : [],
582
- }
573
+ source = compiledTargetFeature(fs, path, torigname)
583
574
  }
584
575
  catch (err: any) {
585
576
  log.warn({
@@ -590,6 +581,66 @@ function readTargetFeature(
590
581
  })
591
582
  return { trim: false, fullset: [] }
592
583
  }
584
+
585
+ const own = projectTargetFeature(ctx$, tname)
586
+
587
+ return {
588
+ trim: own.trim ?? source.trim,
589
+ fullset: own.fullset ?? source.fullset,
590
+ }
591
+ }
592
+
593
+
594
+ function compiledTargetFeature(fs: any, path: string, name: string): TargetFeature {
595
+ const errs: any[] = []
596
+ const src = migrateIncludes(fs.readFileSync(path, 'utf8'))
597
+ const model = new Aontu().generate(src, { path, errs })
598
+
599
+ if (0 < errs.length) {
600
+ throw new Error(errs.map((e: any) => e.msg || String(e)).join('\n'))
601
+ }
602
+
603
+ const feature = model?.main?.[KIT]?.target?.[name]?.feature ?? {}
604
+
605
+ return {
606
+ trim: false !== feature.trim,
607
+ fullset: Array.isArray(feature.fullset) ? feature.fullset : [],
608
+ }
609
+ }
610
+
611
+
612
+ // What the project sets for itself: where its compiled model differs from
613
+ // the copy of the target file it holds, the setting comes from elsewhere in
614
+ // its model and survives the re-add, so the add must follow it as generate
615
+ // does. Anything else came with the copy, and the incoming copy replaces it.
616
+ function projectTargetFeature(ctx$: any, tname: string): Partial<TargetFeature> {
617
+ const compiled = ctx$.model?.main?.[KIT]?.target?.[tname]?.feature
618
+ if (null == compiled) {
619
+ return {}
620
+ }
621
+
622
+ const fs = ctx$.fs()
623
+ const path = definitionPathAny(fs, ctx$.folder ?? '.', 'target', tname)
624
+
625
+ let copied: TargetFeature = { trim: true, fullset: [] }
626
+ if (fs.existsSync(path)) {
627
+ try {
628
+ copied = compiledTargetFeature(fs, path, tname)
629
+ }
630
+ catch (_err) {
631
+ return {}
632
+ }
633
+ }
634
+
635
+ const own: Partial<TargetFeature> = {}
636
+ if ('boolean' === typeof compiled.trim && compiled.trim !== copied.trim) {
637
+ own.trim = compiled.trim
638
+ }
639
+ if (Array.isArray(compiled.fullset) &&
640
+ JSON.stringify(compiled.fullset) !== JSON.stringify(copied.fullset)) {
641
+ own.fullset = [...compiled.fullset]
642
+ }
643
+ return own
593
644
  }
594
645
 
595
646
 
@@ -2,6 +2,10 @@ import Fs from 'node:fs'
2
2
  import Path from 'node:path'
3
3
  import { spawnSync } from 'node:child_process'
4
4
 
5
+ import { applyFacts } from '../helpers/facts'
6
+ import { guardModel } from '../helpers/guardModel'
7
+ import { readOverride, runFolder, runPlace } from '../helpers/placement'
8
+
5
9
  function command(cwd: string, bin: string, args: string[]) {
6
10
  return spawnSync(bin, args, { cwd, encoding: 'utf8', timeout: 15000, windowsHide: true, env: { ...process.env, GIT_OPTIONAL_LOCKS: '0' } })
7
11
  }
@@ -21,8 +25,14 @@ function workingTree(folder: string) {
21
25
  return state === null ? 'not a git repository' : state ? 'modified' : 'clean'
22
26
  }
23
27
 
28
+ // The model a generate reads, which `sdk.json` is written before.
29
+ function prepare(model: any): string | undefined {
30
+ try { applyFacts(guardModel(model)) }
31
+ catch (err: any) { return 'Cannot prepare the compiled model: ' + err.message }
32
+ }
33
+
24
34
  // Read the compiled model and working trees. Never fetch, build, test, or publish.
25
- export function repositoryStatus(root: string) {
35
+ export function repositoryStatus(root: string, env: Record<string, string | undefined> = process.env) {
26
36
  root = Path.resolve(root)
27
37
  const sdk = Path.join(root, '.sdk')
28
38
  if (!directory(sdk)) throw new Error('Expected an SDK repository containing .sdk: ' + root)
@@ -34,7 +44,11 @@ export function repositoryStatus(root: string) {
34
44
  if (!model?.main?.kit) throw new Error('missing main.kit')
35
45
  } catch (err: any) { modelError = 'Invalid compiled model: ' + err.message }
36
46
  }
47
+ if (model && !modelError) modelError = prepare(model)
37
48
  const kit = model?.main?.kit || {}
49
+ let override: any = {}, overridden: string[] = [], overrideError: string | undefined
50
+ try { ({ override, named: overridden } = readOverride(undefined, env.SDKGEN_EXTERNAL, Object.keys(kit.target || {}))) }
51
+ catch (err: any) { overrideError = err.message }
38
52
  const upstream = git(root, ['rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{upstream}'])
39
53
  const counts = upstream && git(root, ['rev-list', '--left-right', '--count', 'HEAD...@{upstream}'])
40
54
  const [ahead, behind] = counts ? counts.split(/\s+/).map(Number) : [null, null]
@@ -51,11 +65,15 @@ export function repositoryStatus(root: string) {
51
65
  },
52
66
  model: { path: file, compiled: !!model && !modelError, error: modelError,
53
67
  generatedAt: Fs.existsSync(file) ? Fs.statSync(file).mtime.toISOString() : null },
68
+ override: { targets: overridden, error: overrideError },
54
69
  toolchain: { node: process.version, packages },
55
70
  targets: entries(kit.target).map(([name, target]) => {
56
- const folder = Path.resolve(root, target.output?.path || name)
71
+ const place = runPlace(target, override[name])
72
+ const folder = runFolder(target, name, root, override[name])
57
73
  const present = directory(folder)
58
- return { name, active: target.active !== false, path: folder, present,
74
+ const intree = Path.resolve(root, name)
75
+ const stale = 'external' === place && intree !== folder && directory(intree) ? intree : null
76
+ return { name, active: target.active !== false, place, path: folder, present, stale,
59
77
  state: workingTree(folder), readme: Fs.existsSync(Path.join(folder, 'README.md')),
60
78
  version: target.publish?.version || null,
61
79
  publication: target.publish?.registry?.state || 'not recorded',
@@ -95,7 +113,7 @@ export function main(args = process.argv.slice(2)): number {
95
113
  }
96
114
  if (!root || args.some(arg => !['--json', '--github'].includes(arg))) throw new Error('Usage: status.sh [--json] [--github]')
97
115
  const report: any = repositoryStatus(root)
98
- let failed = !!report.model.error
116
+ let failed = !!report.model.error || !!report.override.error
99
117
  if (args.includes('--github')) {
100
118
  try { report.github = githubStatus(report.root) }
101
119
  catch (err: any) { report.github = { error: err.message }; failed = true }
@@ -107,8 +125,10 @@ export function main(args = process.argv.slice(2)): number {
107
125
  console.log('Upstream: ' + (report.repository.upstream ? report.repository.upstream + ' | ahead ' + report.repository.ahead + ', behind ' + report.repository.behind + ' (local tracking refs)' : 'not configured'))
108
126
  console.log('Model: ' + (report.model.error || (report.model.compiled ? 'compiled ' + report.model.generatedAt : 'not generated; run npm run generate from .sdk')))
109
127
  console.log('Toolchain: Node ' + report.toolchain.node + '; ' + report.toolchain.packages.map((p: any) => p.name + ' ' + p.version).join('; '))
128
+ if (report.override.error) console.log('Override: ' + report.override.error)
129
+ else if (report.override.targets.length) console.log('Override: SDKGEN_EXTERNAL places ' + report.override.targets.join(', ') + ' for this run')
110
130
  console.log('\nSDKs and tools (publication state comes from the model):')
111
- for (const t of report.targets) console.log(' ' + t.name + ' | ' + (t.active ? 'active' : 'inactive') + ' | ' + t.state + ' | version ' + (t.version || 'not recorded') + ' | ' + t.publication + ' | ' + t.path)
131
+ for (const t of report.targets) console.log(' ' + t.name + ' | ' + (t.active ? 'active' : 'inactive') + ' | ' + t.state + ' | version ' + (t.version || 'not recorded') + ' | ' + t.publication + ' | ' + t.path + (t.stale ? ' | stale in-tree folder ' + t.stale : ''))
112
132
  if (!report.targets.length) console.log(' No targets in the compiled model.')
113
133
  console.log('\nDocumentation:')
114
134
  for (const e of report.editions) console.log(' ' + e.name + ' | ' + (e.active ? 'active' : 'inactive') + ' | ' + (e.present ? 'present' : 'missing') + ' | ' + (e.path || 'no output path'))
@@ -3,6 +3,8 @@ import { Content, File } from 'jostraca'
3
3
  import { cmp } from '../helpers/component'
4
4
 
5
5
  import { optionalComponent } from '../helpers/optional'
6
+ import { fact } from '../helpers/facts'
7
+ import { apiName } from '../helpers/packageMeta'
6
8
 
7
9
  import {
8
10
  activeFeatures,
@@ -12,8 +14,11 @@ import {
12
14
  claudePointer,
13
15
  featuresEnabled,
14
16
  isDirLayout,
15
- featureRuntimeFile,
17
+ featureTemplates,
18
+ writesFeatureGuides,
16
19
  featureHooks,
20
+ regenerationStatement,
21
+ copiesStatement,
17
22
  } from './AgentGuideContent'
18
23
 
19
24
  import { AgentGuideFeature } from './AgentGuideFeature'
@@ -29,34 +34,47 @@ const AgentGuide = cmp(function AgentGuide(props: any) {
29
34
 
30
35
  const Name = projectName(model)
31
36
  const lang = target.name
32
- const title = target.title || lang
33
- const surface = langCmd(lang).note
37
+ const title = fact(target, 'title')
38
+ const surface = langCmd(lang, model).note
34
39
 
35
40
  const features = activeFeatures(model, target)
36
41
  const featuresOn = featuresEnabled(target)
37
42
  const dirLayout = isDirLayout(target)
38
43
 
44
+ const place = fact(target, 'place')
45
+ const guide = fact(target, 'link').agents
46
+ const sdk = 'folder' === place ? '../.sdk' : 'root' === place ? '.sdk' :
47
+ null == ctx$.sdkrelpath ? '' : ctx$.sdkrelpath + '/.sdk'
48
+ const pathNote = 'folder' === place ?
49
+ `> Paths below (\`.sdk/…\`) are relative to the **project root** — one level up
50
+ > from this \`${lang}/\` directory.
51
+
52
+ ` : 'external' === place ? `> Paths below (\`.sdk/…\`) are relative to the SDK project that generates
53
+ > this package.
54
+
55
+ ` : ''
56
+
39
57
  File({ name: 'AGENTS.md' }, () => {
40
58
  Content(`# ${Name} ${title} — Agent Guide
41
59
 
42
60
  ${surface
43
- ? surface + '\n\nGenerated from the shared model; see the [project guide](../AGENTS.md) for the full workflow.'
44
- : `The ${title} client for the ${Name} API. This directory is **generated** — do not edit it by hand; change the model/template/component in \`.sdk/\` and regenerate. See the [project guide](../AGENTS.md) for the full workflow and the aontu model language.`}
61
+ ? surface + '\n\nGenerated from the shared model' +
62
+ ('' === guide ? '.' : `; see the [project guide](${guide}) for the full workflow.`)
63
+ : `The ${title} client for the ${apiName(model)} API. This directory is **generated** — do not edit it by hand; change the model/template/component in \`.sdk/\` and regenerate.` +
64
+ ('' === guide ? '' : ` See the [project guide](${guide}) for the full workflow and the aontu model language.`)}
45
65
 
46
- > Paths below (\`.sdk/…\`) are relative to the **project root** — one level up
47
- > from this \`${lang}/\` directory.
66
+ ${pathNote}## Regenerate this target
48
67
 
49
- ## Regenerate this target
50
-
51
- \`\`\`bash
52
- cd ../.sdk
53
- npm run build # only if you changed a component
54
- npm run generate # refreshes this ${lang}/ directory
68
+ ${'' === sdk ? 'From the SDK project\'s `.sdk/` directory:\n\n' : ''}\`\`\`bash
69
+ ${'' === sdk ? '' : 'cd ' + sdk + '\n'}npm run build # only if you changed a component
70
+ npm run generate # refreshes this ${'folder' === place ? lang + '/ directory' : 'target'}
55
71
  \`\`\`
56
72
 
73
+ ${regenerationStatement()}
74
+
57
75
  Then build and test the generated output:
58
76
 
59
- ${langCommandsBlock(lang)}
77
+ ${langCommandsBlock(lang, model)}
60
78
 
61
79
  ## What generates this target
62
80
 
@@ -69,6 +87,7 @@ ${langCommandsBlock(lang)}
69
87
  Decision rule: *same for every API → template; depends on the API →
70
88
  component.* After editing a component run \`npm run build\` before
71
89
  \`npm run generate\`; template-only edits just need \`npm run generate\`.
90
+ ${copiesStatement(model)}
72
91
 
73
92
  `)
74
93
 
@@ -88,19 +107,27 @@ Each feature's runtime and its own guide live in \`src/feature/<name>/\`.
88
107
  `)
89
108
  }
90
109
  else {
91
- Content(`Each feature is a flat file in the \`feature/\` package. Its hooks and
92
- default activation come from \`.sdk/model/feature/<name>.aontu\`; customise
93
- the runtime under \`.sdk/tm/${lang}/feature/\` and regenerate.
94
-
95
- | Feature | Runtime file | Active hooks |
96
- | --- | --- | --- |
110
+ const templates = featureTemplates(ctx$.fs(), target, features)
111
+ const shared = 0 === Object.keys(templates).length
112
+ Content(`Each feature's hooks and default activation come from
113
+ \`.sdk/model/feature/<name>.aontu\`. ${shared
114
+ ? `This target has no template per
115
+ feature: customise its features in the runtime under \`.sdk/tm/${lang}/\`
116
+ and regenerate.`
117
+ : `Its runtime is generated from the template
118
+ listed here: customise that and regenerate.`}
119
+
120
+ | Feature | ${shared ? '' : 'Template | '}Active hooks |
121
+ | --- | ${shared ? '' : '--- | '}--- |
97
122
  `)
98
123
  features.forEach((f: any) => {
99
- const file = featureRuntimeFile(target, f)
124
+ const template = templates[f.name]
100
125
  const hooks = featureHooks(f)
101
126
  const hookList = hooks.length ? hooks.map((h: string) => '\`' + h + '\`').join(', ') : '—'
102
127
  const label = f.title ? `**${f.name}** — ${f.title}` : `**${f.name}**`
103
- Content(`| ${label} | \`feature/${file}\` | ${hookList} |
128
+ const where = shared ? '' :
129
+ (null == template ? '—' : '\`.sdk/tm/' + lang + '/' + template + '\`') + ' | '
130
+ Content(`| ${label} | ${where}${hookList} |
104
131
  `)
105
132
  })
106
133
  Content(`
@@ -116,8 +143,8 @@ the runtime under \`.sdk/tm/${lang}/feature/\` and regenerate.
116
143
 
117
144
  Content(`---
118
145
 
119
- Generated by [@voxgig/sdkgen](https://github.com/voxgig/sdkgen). See the
120
- [project guide](../AGENTS.md).
146
+ Generated by [@voxgig/sdkgen](https://github.com/voxgig/sdkgen).${'' === guide ? '' : ` See the
147
+ [project guide](${guide}).`}
121
148
  `)
122
149
  })
123
150
 
@@ -129,7 +156,7 @@ Generated by [@voxgig/sdkgen](https://github.com/voxgig/sdkgen). See the
129
156
  // where each feature has its own directory to hold the guide. Flat-layout
130
157
  // targets document features inline above; phase-disabled targets
131
158
  // (go-cli/go-mcp) get no feature docs at all.
132
- if (featuresOn && dirLayout) {
159
+ if (writesFeatureGuides(model, target)) {
133
160
  features.forEach((feature: any) => {
134
161
  AgentGuideFeature({ target, feature })
135
162
  })
@@ -1,5 +1,10 @@
1
1
 
2
2
  import { featureApplies } from '../helpers/applicability'
3
+ import { fact } from '../helpers/facts'
4
+ import { findFeatureSources } from '../helpers/featureSource'
5
+ import { copyMode, MERGE } from '../helpers/copymerge'
6
+ import { originName } from '../helpers/packageMeta'
7
+ import { definitionName } from '../helpers/text'
3
8
 
4
9
  import { each } from 'jostraca'
5
10
 
@@ -33,16 +38,17 @@ const LANG_CMD: Record<string, LangCmd> = {
33
38
  }
34
39
 
35
40
 
36
- function langCmd(name: string): LangCmd {
37
- return LANG_CMD[name] || { viaMake: true }
41
+ // Keyed by origin, so an alias reads its origin's row.
42
+ function langCmd(name: string, model?: any): LangCmd {
43
+ return LANG_CMD[null == model ? name : originName(model, name)] || { viaMake: true }
38
44
  }
39
45
 
40
46
 
41
47
  // A fenced shell block of the per-target build/test commands, run **in the
42
48
  // target directory** (the per-language guide already lives there). Prefers the
43
49
  // target's Makefile recipes (`make build` / `make test`).
44
- function langCommandsBlock(name: string): string {
45
- const c = langCmd(name)
50
+ function langCommandsBlock(name: string, model?: any): string {
51
+ const c = langCmd(name, model)
46
52
  const lines: string[] = []
47
53
  if (c.install) lines.push(c.install)
48
54
  if (c.viaMake) {
@@ -56,32 +62,41 @@ function langCommandsBlock(name: string): string {
56
62
  if (0 === lines.length) {
57
63
  return `Build and test with \`${name}\`'s standard toolchain.\n`
58
64
  }
59
- return '```bash\n# in this target directory (' + name + '/):\n' + lines.join('\n') + '\n```\n'
65
+ const node = model?.main?.[KIT]?.target?.[name]
66
+ const place = null == node ? 'folder' : fact(node, 'place')
67
+ const dir = 'folder' === place ? name + '/' : 'root' === place ? 'the project root' : "this package's root"
68
+ return '```bash\n# in this target directory (' + dir + '):\n' + lines.join('\n') + '\n```\n'
60
69
  }
61
70
 
62
71
 
63
72
 
64
73
  function featuresEnabled(target: any): boolean {
65
- return target?.phase?.feature?.active !== false
74
+ return fact(target, 'phase').feature
66
75
  }
67
76
 
68
- // ts/js lay each feature out as a directory `src/feature/<name>/`; the other
69
- // SDK targets (`srcfeature: false`) use flat files in a shared `feature/`
70
- // package. Drives where feature guides live / are referenced.
77
+ // ts/js lay each feature out as a directory `src/feature/<name>/`, which also
78
+ // holds its guide; the other SDK targets (`srcfeature: false`) do not.
71
79
  function isDirLayout(target: any): boolean {
72
80
  return target?.srcfeature !== false
73
81
  }
74
82
 
75
- function featureBase(target: any): string {
76
- return isDirLayout(target) ? 'src/feature' : 'feature'
83
+ // Each feature's runtime template as discovery finds it in the target's tree,
84
+ // skipping the empty `src/feature/<name>/` a flat-layout target also keeps.
85
+ function featureTemplates(fs: any, target: any, features: any[]): Record<string, string> {
86
+ const dirLayout = isDirLayout(target)
87
+ const out: Record<string, string> = {}
88
+ const found = findFeatureSources(fs, 'tm/' + target.name,
89
+ features.map((f: any) => String(f.name).toLowerCase()))
90
+ for (const s of found) {
91
+ if (!dirLayout && s.path.startsWith('src/feature/')) continue
92
+ if (null == out[s.name]) out[s.name] = s.path + (s.folder ? '/' : '')
93
+ }
94
+ return out
77
95
  }
78
96
 
79
- function featureRuntimeFile(target: any, feature: any): string {
80
- const ext = target?.ext || target?.name || ''
81
- if ('php' === target?.name) {
82
- return (feature.Name || feature.name) + 'Feature.php'
83
- }
84
- return feature.name + '_feature.' + ext
97
+ function writesFeatureGuides(model: any, target: any): boolean {
98
+ return featuresEnabled(target) && isDirLayout(target) &&
99
+ 0 < activeFeatures(model, target).length
85
100
  }
86
101
 
87
102
  function featureHooks(feature: any): string[] {
@@ -94,8 +109,8 @@ function featureHooks(feature: any): string[] {
94
109
 
95
110
 
96
111
  function activeTargets(model: any): any[] {
97
- const target = getModelPath(model, `main.${KIT}.target`) || {}
98
- return each(target).filter((t: any) => t && t.active !== false)
112
+ const kit = model.main[KIT]
113
+ return fact(kit, 'active').map((name: string) => kit.target[name])
99
114
  }
100
115
 
101
116
  // With a target, also drops features that do not APPLY to it — a guide
@@ -119,11 +134,35 @@ function projectName(model: any): string {
119
134
 
120
135
 
121
136
 
122
- function workflowSection(): string {
137
+ // What a run does to the files it generates, stated once for every guide.
138
+ function regenerationStatement(): string {
139
+ return `Each \`npm run generate\` rewrites every file it generates, so an edit
140
+ made to generated output is lost, and deletes the files it generated before
141
+ and no longer emits. A target or a phase switched off is left as it was.`
142
+ }
143
+
144
+ function copiesStatement(model: any): string {
145
+ return MERGE === copyMode(model?.main?.[KIT]?.copies) ?
146
+ `\`target add\` and \`feature add\` copy templates and components into
147
+ \`.sdk/\`, and merge toolchain updates into the copies this project has
148
+ edited.` :
149
+ `\`target add\` and \`feature add\` overwrite the templates and components
150
+ in \`.sdk/\` (\`main: kit: copies: 'overwrite'\`): set \`copies\` to
151
+ \`'merge'\` before customising them, so that an add merges toolchain updates
152
+ into the edited copies.`
153
+ }
154
+
155
+
156
+ function workflowSection(model: any): string {
157
+ const dirs = activeTargets(model).filter((t: any) => 'folder' === fact(t, 'place'))
158
+ .map((t: any) => '\`' + t.name + '/\`')
159
+ const output = 0 === dirs.length ? 'The generated output is **build output** — never edit it by' :
160
+ 1 === dirs.length ? 'The generated\ndirectory (' + dirs[0] + ') is **build output** — never edit it by' :
161
+ 'The generated language\ndirectories (' + dirs.slice(0, 2).join(', ') + (2 < dirs.length ? ', …' : '') +
162
+ ') are **build output** — never edit them by'
123
163
  return `## Generating and updating the SDK
124
164
 
125
- All generation is driven from the \`.sdk/\` directory. The generated language
126
- directories (\`ts/\`, \`go/\`, …) are **build output** — never edit them by
165
+ All generation is driven from the \`.sdk/\` directory. ${output}
127
166
  hand; fix the model, a template, or a component and regenerate.
128
167
 
129
168
  \`\`\`bash
@@ -134,15 +173,8 @@ npm run build # compile .sdk/src/cmp -> .sdk/dist
134
173
  npm run generate # emit/refresh the SDK into ../<lang>
135
174
  \`\`\`
136
175
 
137
- \`generate\` **merges** into existing files and does **not** re-apply
138
- placeholder substitution to merged content. If you ever see a literal
139
- \`ProjectName\` or \`GOMODULE\` in generated output, delete that one file and
140
- regenerate it fresh:
141
-
142
- \`\`\`bash
143
- rm <lang>/<the-file-with-the-placeholder>
144
- npm run generate
145
- \`\`\`
176
+ ${regenerationStatement()}
177
+ ${copiesStatement(model)}
146
178
 
147
179
  Note: the \`voxgig-sdkgen\` CLI only *scaffolds* (\`target add\` /
148
180
  \`feature add\`). Generation itself runs via \`npm run generate\` (backed by
@@ -170,13 +202,11 @@ so nothing downstream complains. To inspect the model layer **without side
170
202
  effects**, use \`npm run dry-generate\` (\`-y\`, writes nothing). Never
171
203
  \`--no-config\` in anything whose output might be committed.
172
204
 
173
- **Regeneration never DELETES.** A file the generator has stopped emitting
174
- stays in the tree, and \`git status\` is silent because it is committed and
175
- unchanged. Narrowing a feature's plugin selection, or dropping a target, can
176
- leave whole modules behind that nothing references and no test covers.
177
-
178
- To find either, the target trees must be deleted and regenerated — a
179
- regeneration in place cannot see stale output at all.
205
+ **Dropping a target deletes nothing.** A run deletes only what it no longer
206
+ emits from the targets and phases that ran, so a target dropped from the
207
+ model, or a phase switched off, leaves its files in the tree, and \`git
208
+ status\` is silent because they are committed and unchanged. Delete them by
209
+ hand.
180
210
  `
181
211
  }
182
212
 
@@ -186,7 +216,7 @@ function featureSection(): string {
186
216
 
187
217
  A **feature** is a pipeline extension: an object of hooks that fire at named
188
218
  stages of every entity operation (each target's guide documents its
189
- features). Built-in features are \`log\` and \`test\`.
219
+ features).
190
220
 
191
221
  \`\`\`bash
192
222
  cd .sdk
@@ -241,12 +271,12 @@ deps live in \`.sdk/model/target/<lang>.aontu\`; features in
241
271
  }
242
272
 
243
273
 
244
- function aontuSection(): string {
274
+ function aontuSection(model: any): string {
245
275
  return `## The model language (aontu, \`.aontu\` files)
246
276
 
247
277
  The model is one structured object assembled by **aontu** (a unification
248
278
  engine) from three sources: the API model (entities/operations, from the
249
- OpenAPI spec via \`@voxgig/apidef\`), the base schema, and the target/feature
279
+ ${definitionName(fact(model.main[KIT], 'definitionKind'))} via \`@voxgig/apidef\`), the base schema, and the target/feature
250
280
  definitions in \`.sdk/model/\`. An \`.aontu\` file is a relaxed JSON (jsonic
251
281
  syntax) with unification semantics:
252
282
 
@@ -295,14 +325,16 @@ export {
295
325
  langCommandsBlock,
296
326
  featuresEnabled,
297
327
  isDirLayout,
298
- featureBase,
299
- featureRuntimeFile,
328
+ featureTemplates,
329
+ writesFeatureGuides,
300
330
  featureHooks,
301
331
  activeTargets,
302
332
  activeFeatures,
303
333
  activeEntities,
304
334
  projectName,
305
335
  workflowSection,
336
+ regenerationStatement,
337
+ copiesStatement,
306
338
  featureSection,
307
339
  customiseSection,
308
340
  aontuSection,
@@ -2,8 +2,9 @@
2
2
  import { each, Content, File, Folder } from 'jostraca'
3
3
  import { cmp } from '../helpers/component'
4
4
  import { fact } from '../helpers/facts'
5
+ import { generatedOps } from '../helpers/opShape'
5
6
 
6
- import { claudePointer } from './AgentGuideContent'
7
+ import { claudePointer, regenerationStatement } from './AgentGuideContent'
7
8
 
8
9
 
9
10
  function cap(s: string): string {
@@ -30,6 +31,15 @@ const AgentGuideFeature = cmp(function AgentGuideFeature(props: any) {
30
31
  .filter(Boolean)
31
32
 
32
33
  const defaultOn = fact(feature, 'on')
34
+ const ops = generatedOps(ctx$.model)
35
+
36
+ const place = fact(target, 'place')
37
+ const guide = fact(target, 'link').agents
38
+ const root = 'folder' === place ? '../../../../' : 'root' === place ? '../../../' :
39
+ null == ctx$.sdkrelpath ? null : '../../../' + ctx$.sdkrelpath + '/'
40
+ const where = 'folder' === place ? 'the **project root** — four levels up from here' :
41
+ 'root' === place ? 'the **project root** — three levels up from here' :
42
+ 'the SDK project that generates this package'
33
43
 
34
44
  Folder({ name: 'src/feature/' + name }, () => {
35
45
 
@@ -39,10 +49,10 @@ const AgentGuideFeature = cmp(function AgentGuideFeature(props: any) {
39
49
  ${title} (v${version}).
40
50
 
41
51
  A **feature** is a pipeline extension: an object of hooks that fire at named
42
- stages of every entity operation (load, list, create, update, patch, remove) and of
52
+ stages of every entity operation${0 < ops.length ? ' (' + ops.join(', ') + ')' : ''} and of
43
53
  the SDK/entity lifecycle. Features are how you inspect or modify the request
44
54
  pipeline without forking the SDK. This directory holds the **generated**
45
- runtime for the \`${name}\` feature in the ${target.title || lang} target — do
55
+ runtime for the \`${name}\` feature in the ${fact(target, 'title')} target — do
46
56
  not edit it by hand; change its template/model in \`.sdk/\` and regenerate.
47
57
 
48
58
  Active by default: **${defaultOn ? 'yes' : 'no'}** (\`config.options.active\`
@@ -71,7 +81,7 @@ later feature can override an earlier one.
71
81
  | Registered in | \`.sdk/model/feature/feature-index.aontu\` (\`@"${name}.aontu"\`) |
72
82
  | Runtime template | \`.sdk/tm/${lang}/src/feature/${name}/\` (copied here on \`generate\`; \`FEATURE_Name\`/\`FEATURE_VERSION\` substituted) |
73
83
 
74
- (Paths are relative to the **project root** — four levels up from here.)
84
+ (Paths are relative to ${where}.)
75
85
 
76
86
  ## Customising this feature
77
87
 
@@ -82,13 +92,14 @@ later feature can override an earlier one.
82
92
  - **Behaviour**: edit the runtime template under
83
93
  \`.sdk/tm/${lang}/src/feature/${name}/\`, then regenerate.
84
94
 
85
- After any change: \`cd ../../../../.sdk && npm run generate\` (add
86
- \`npm run build\` first if you changed a component). If a regenerated file
87
- shows a literal \`FEATURE_Name\`/\`ProjectName\`, delete it and regenerate.
95
+ After any change: \`${null == root ? '' : 'cd ' + root + '.sdk && '}npm run generate\`${null == root ?
96
+ ' in the SDK project\'s `.sdk/`' : ''} (add
97
+ \`npm run build\` first if you changed a component).
98
+ ${regenerationStatement()}
88
99
 
89
- To author a **new** feature, copy this one's model + template shape — see the
90
- [project guide](../../../../AGENTS.md) and the
91
- [${target.title || lang} guide](../../../AGENTS.md).
100
+ To author a **new** feature, copy this one's model + template shape — see ${'' === guide ? '' :
101
+ `the\n[project guide](../../../${guide}) and `}the
102
+ [${fact(target, 'title')} guide](../../../AGENTS.md).
92
103
  `)
93
104
  })
94
105