@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
@@ -7,13 +7,16 @@ const types_1 = require("../types");
7
7
  const utility_1 = require("../utility");
8
8
  const optional_1 = require("../helpers/optional");
9
9
  const FeatureDocs_1 = require("./FeatureDocs");
10
+ const FeatureHook_1 = require("./FeatureHook");
10
11
  const opShape_1 = require("../helpers/opShape");
11
12
  const opExample_1 = require("../helpers/opExample");
12
13
  const mcpTools_1 = require("../helpers/mcpTools");
13
14
  const canonType_1 = require("../helpers/canonType");
14
15
  const naming_1 = require("../helpers/naming");
15
16
  const text_1 = require("../helpers/text");
16
- const alongside_1 = require("../helpers/alongside");
17
+ const facts_1 = require("../helpers/facts");
18
+ const surface_1 = require("../helpers/surface");
19
+ const copymerge_1 = require("../helpers/copymerge");
17
20
  const packageMeta_1 = require("../helpers/packageMeta");
18
21
  const SDKGEN_REPO = 'https://github.com/voxgig/sdkgen';
19
22
  const VOXGIG_SDK = 'https://voxgig.com/sdk/';
@@ -66,221 +69,173 @@ function entityExample(lang, Name, call) {
66
69
  default: return '';
67
70
  }
68
71
  }
69
- const ReadmeTop = (0, component_1.cmp)(function ReadmeTop(props) {
70
- const { ctx$ } = props;
71
- const { model } = ctx$;
72
- if (model.name && !model.Name)
73
- (0, jostraca_1.names)(model, model.name);
74
- const info = (0, text_1.modelText)(model);
75
- const def = (model.main && model.main.def) || {};
76
- const productName = info.title || `${model.Name} API`;
77
- const tagline = info.tagline
78
- || def.tagline
79
- || `${productName} client, generated from the OpenAPI spec.`;
80
- const aboutMd = info.about_md || '';
81
- const homepage = info.homepage || '';
82
- const docsUrl = info.docs_url || '';
83
- const entityDesc = info.entity_desc || {};
84
- const apiSummary = (info.summary || '').trim();
85
- const apiWebsite = (info.website || '').trim();
86
- const websiteLine = apiWebsite
87
- ? `Learn more about ${productName} at ` +
88
- `[${apiWebsite.replace(/^https?:\/\//, '').replace(/\/$/, '')}](${apiWebsite}).`
89
- : '';
90
- // Attribution for API metadata sourced from a third-party catalogue (e.g.
91
- // freepublicapis.com). Rendered only when the model carries an
92
- // `info.meta_source` URL, so first-party SDKs never show it. The link points
93
- // back to the catalogue that kindly supplied the metadata.
94
- const metaSource = (info.meta_source || '').trim();
95
- const metaSourceLine = metaSource
96
- ? `Metadata kindly supplied by ` +
97
- `[${metaSource.replace(/^https?:\/\//, '').replace(/\/$/, '')}](${metaSource}).`
98
- : '';
99
- const entity = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.entity`);
100
- const target = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.target`);
101
- const feature = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.feature`);
102
- (0, jostraca_1.each)(entity, (ent) => { if (!ent.Name)
103
- (0, jostraca_1.names)(ent, ent.name); });
104
- (0, jostraca_1.each)(feature, (feat) => { if (!feat.Name)
105
- (0, jostraca_1.names)(feat, feat.name); });
106
- const activeEntities = (0, jostraca_1.each)(entity).filter((e) => e.active !== false);
107
- const activeTargets = (0, jostraca_1.each)(target).filter((t) => t.active !== false);
108
- const hasCli = activeTargets.some((t) => t.name === 'go-cli');
109
- const hasMcp = activeTargets.some((t) => t.name === 'go-mcp');
110
- const docsOrder = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.config.docs_order`, { only_active: false, required: false }) || [];
111
- const orderOf = (name) => {
112
- const i = docsOrder.indexOf(name);
113
- if (i !== -1)
114
- return i;
115
- if (name === 'go-cli')
116
- return docsOrder.length + 1;
117
- if (name === 'go-mcp')
118
- return docsOrder.length + 2;
119
- return docsOrder.length;
120
- };
121
- const ordered = activeTargets
122
- .slice()
123
- .sort((a, b) => orderOf(a.name) - orderOf(b.name));
124
- const isCliOrMcp = (t) => t.name === 'go-cli' || t.name === 'go-mcp';
125
- const sdkTargets = ordered.filter((t) => !(0, alongside_1.isConsumer)(t));
126
- // The CLI and the MCP server have surfaces of their own below.
127
- const consumerTargets = ordered.filter((t) => (0, alongside_1.isConsumer)(t) && !isCliOrMcp(t));
128
- const docTargets = ordered.filter((t) => !isCliOrMcp(t));
129
- const pkgTargets = activeTargets
130
- .filter((t) => (0, packageMeta_1.hasPackageName)(model, t.name))
131
- .sort((a, b) => orderOf(a.name) - orderOf(b.name));
132
- const langList = sdkTargets.map((t) => t.title).join(', ');
133
- const leadTarget = pickLeadTarget(sdkTargets);
134
- (0, jostraca_1.File)({ name: 'README.md' }, () => {
135
- (0, jostraca_1.Content)(`# ${model.Name} SDK
72
+ const ReadmeTopTitle = (0, component_1.cmp)(function ReadmeTopTitle(props) {
73
+ const { model, tagline, apiSummary, websiteLine, metaSourceLine } = props.s;
74
+ (0, jostraca_1.Content)(`# ${model.Name} SDK
136
75
 
137
76
  ${tagline}
138
77
 
139
78
  `);
140
- if (apiSummary) {
141
- (0, jostraca_1.Content)(`${apiSummary}
79
+ if (apiSummary) {
80
+ (0, jostraca_1.Content)(`${apiSummary}
142
81
 
143
82
  `);
144
- }
145
- if (websiteLine) {
146
- (0, jostraca_1.Content)(`${websiteLine}
83
+ }
84
+ if (websiteLine) {
85
+ (0, jostraca_1.Content)(`${websiteLine}
147
86
 
148
87
  `);
149
- }
150
- (0, jostraca_1.Content)(`${(0, packageMeta_1.nonAffiliation)(model)}
88
+ }
89
+ (0, jostraca_1.Content)(`${(0, packageMeta_1.nonAffiliation)(model)}
151
90
 
152
91
  `);
153
- if ((0, packageMeta_1.isDefaultPublisher)(model)) {
154
- (0, jostraca_1.Content)(`Learn more about Voxgig SDKs at [voxgig.com/sdk](${VOXGIG_SDK}).
92
+ if ((0, packageMeta_1.isDefaultPublisher)(model)) {
93
+ (0, jostraca_1.Content)(`Learn more about Voxgig SDKs at [voxgig.com/sdk](${VOXGIG_SDK}).
155
94
 
156
95
  `);
157
- }
158
- // THE GENERATED SITE, LINKED FROM THE TOP, because the repository was the
159
- // one place it could not be found from. `docs_url` further down is the
160
- // UPSTREAM API's documentation, not this, and a reader who lands on the
161
- // repo rather than arriving from a link had no route to the site at all.
162
- // Empty unless the project actually publishes one -- see docsSiteUrl.
163
- const siteUrl = (0, packageMeta_1.docsSiteUrl)(model);
164
- if (siteUrl) {
165
- (0, jostraca_1.Content)(`Full documentation for this SDK: [${siteUrl}](${siteUrl})
96
+ }
97
+ // THE GENERATED SITE, LINKED FROM THE TOP, because the repository was the
98
+ // one place it could not be found from. `docs_url` further down is the
99
+ // UPSTREAM API's documentation, not this, and a reader who lands on the
100
+ // repo rather than arriving from a link had no route to the site at all.
101
+ // Empty unless the project actually publishes one -- see docsSiteUrl.
102
+ const siteUrl = (0, packageMeta_1.docsSiteUrl)(model);
103
+ if (siteUrl) {
104
+ (0, jostraca_1.Content)(`Full documentation for this SDK: [${siteUrl}](${siteUrl})
166
105
 
167
106
  `);
168
- }
169
- if (metaSourceLine) {
170
- (0, jostraca_1.Content)(`${metaSourceLine}
107
+ }
108
+ if (metaSourceLine) {
109
+ (0, jostraca_1.Content)(`${metaSourceLine}
171
110
 
172
111
  `);
173
- }
174
- if (sdkTargets.length > 1) {
175
- const surfaces = [];
176
- surfaces.push(`${langList} SDKs`);
177
- if (hasCli)
178
- surfaces.push('a CLI with an interactive REPL');
179
- if (hasMcp)
180
- surfaces.push('an MCP server for AI agents');
181
- consumerTargets.forEach((t) => surfaces.push(`the ${t.title} package`));
182
- const surfaceList = surfaces.length > 1
183
- ? surfaces.slice(0, -1).join(', ') + ', and ' + surfaces[surfaces.length - 1]
184
- : surfaces[0];
185
- (0, jostraca_1.Content)(`> ${surfaceList} — all generated from one OpenAPI spec by [@voxgig/sdkgen](${SDKGEN_REPO}).
112
+ }
113
+ });
114
+ const ReadmeTopSurfaceLine = (0, component_1.cmp)(function ReadmeTopSurfaceLine(props) {
115
+ const { hasCli, hasMcp, sdkTargets, consumerTargets, langList, definition } = props.s;
116
+ if (sdkTargets.length > 1) {
117
+ const surfaces = [];
118
+ surfaces.push(`${langList} SDKs`);
119
+ if (hasCli)
120
+ surfaces.push('a CLI with an interactive REPL');
121
+ if (hasMcp)
122
+ surfaces.push('an MCP server for AI agents');
123
+ consumerTargets.forEach((t) => surfaces.push(`the ${(0, facts_1.fact)(t, 'title')} package`));
124
+ const surfaceList = surfaces.length > 1
125
+ ? surfaces.slice(0, -1).join(', ') + ', and ' + surfaces[surfaces.length - 1]
126
+ : surfaces[0];
127
+ (0, jostraca_1.Content)(`> ${surfaceList} — all generated from one ${definition} by [@voxgig/sdkgen](${SDKGEN_REPO}).
186
128
 
187
129
  `);
188
- }
189
- // FEATURES BELONG BESIDE THE TARGETS. What an SDK can do is as much a
190
- // reason to choose it as which language it is in, and a reader who has to
191
- // scroll past every language section to discover that retries, caching and
192
- // tracing are built in has already decided it is a thin HTTP wrapper.
193
- // Named here, in one line, with the detail left to each target's README.
194
- const features = (0, FeatureDocs_1.featureDocs)(model);
195
- if (0 < features.length) {
196
- (0, jostraca_1.Content)(`> **Features:** ${features.map((f) => '`' + f.name + '`').join(', ')} — opt-in,
197
- > inactive until switched on, and configured per client. See the Features
130
+ }
131
+ });
132
+ const ReadmeTopFeatureLine = (0, component_1.cmp)(function ReadmeTopFeatureLine(props) {
133
+ const { model } = props.s;
134
+ // FEATURES BELONG BESIDE THE TARGETS. What an SDK can do is as much a
135
+ // reason to choose it as which language it is in, and a reader who has to
136
+ // scroll past every language section to discover that retries, caching and
137
+ // tracing are built in has already decided it is a thin HTTP wrapper.
138
+ // Named here, in one line, with the detail left to each target's README.
139
+ const features = (0, FeatureDocs_1.featureDocs)(model);
140
+ if (0 < features.length) {
141
+ const on = features.filter((f) => f.on).map((f) => f.name);
142
+ const state = 0 === on.length ? `opt-in,
143
+ > inactive until switched on, and configured per client.` : `configured per client.
144
+ > ${(0, FeatureDocs_1.codeList)(on)} ${1 === on.length ? 'runs' : 'run'} by default${on.length < features.length ?
145
+ '; the rest are opt-in, inactive until switched on' : ''}.`;
146
+ (0, jostraca_1.Content)(`> **Features:** ${features.map((f) => '`' + f.name + '`').join(', ')} — ${state} See the Features
198
147
  > section of any SDK README below for what each one does.
199
148
 
200
149
  `);
201
- }
202
- if (aboutMd) {
203
- (0, jostraca_1.Content)(`## About ${productName}
150
+ }
151
+ });
152
+ const ReadmeTopAbout = (0, component_1.cmp)(function ReadmeTopAbout(props) {
153
+ const { text, productName, aboutMd } = props.s;
154
+ if (aboutMd) {
155
+ (0, jostraca_1.Content)(`## About ${productName}
204
156
 
205
- ${aboutMd.trim()}
157
+ ${aboutMd}
206
158
 
207
159
  `);
208
- }
209
- else if (def.desc) {
210
- (0, jostraca_1.Content)(`${def.desc}
160
+ }
161
+ else if (text.desc.text) {
162
+ (0, jostraca_1.Content)(`${text.desc.text}
211
163
 
212
164
  `);
165
+ }
166
+ });
167
+ const ReadmeTopEntityModel = (0, component_1.cmp)(function ReadmeTopEntityModel(props) {
168
+ const { model, activeEntities, sdkTargets } = props.s;
169
+ if (activeEntities.length > 0) {
170
+ const entNames = activeEntities.map((e) => e.Name);
171
+ const entCount = entNames.length;
172
+ const entList = entCount > 1
173
+ ? entNames.slice(0, -1).join(', ') + ' and ' + entNames[entNames.length - 1]
174
+ : entNames[0];
175
+ const NAME_INLINE_MAX = 6;
176
+ const inlineNames = entCount <= NAME_INLINE_MAX;
177
+ const surface = inlineNames
178
+ ? `a small set of **semantic entities** — ${entList} —`
179
+ : `**${entCount} semantic entities**`;
180
+ const seeEntities = inlineNames
181
+ ? ''
182
+ : ' See the [Entities](#entities) table below for the full list.';
183
+ const exEnt = activeEntities[0];
184
+ const ex = exEnt.Name;
185
+ const exLower = (0, naming_1.exampleVarName)(ex.toLowerCase(), 'ts');
186
+ // The example call uses the entity's PRIMARY op — an op it actually
187
+ // exposes (prefer list -> the array, then load -> the record, else a
188
+ // create with its required fields). A create-only entity therefore never
189
+ // shows a phantom .list()/.load() that would not compile. If it exposes
190
+ // only remove (or nothing), the op line is omitted entirely.
191
+ const primaryOp = (0, opShape_1.entityPrimaryOp)(exEnt);
192
+ let exCall = '';
193
+ const exIdField = (0, opShape_1.entityIdField)(exEnt);
194
+ const exListArg = (0, opExample_1.listMatchArg)('ts', exEnt);
195
+ const exLoadArg = (0, opExample_1.matchArg)('ts', exEnt, 'load', exIdField, (0, opExample_1.idLiteral)(exEnt, 'load', exIdField));
196
+ if ('list' === primaryOp) {
197
+ exCall = `const items = await client.${ex}().list(${exListArg})`;
213
198
  }
214
- if (activeEntities.length > 0) {
215
- const entNames = activeEntities.map((e) => e.Name);
216
- const entCount = entNames.length;
217
- const entList = entCount > 1
218
- ? entNames.slice(0, -1).join(', ') + ' and ' + entNames[entNames.length - 1]
219
- : entNames[0];
220
- const NAME_INLINE_MAX = 6;
221
- const inlineNames = entCount <= NAME_INLINE_MAX;
222
- const surface = inlineNames
223
- ? `a small set of **semantic entities** — ${entList} —`
224
- : `**${entCount} semantic entities**`;
225
- const seeEntities = inlineNames
226
- ? ''
227
- : ' See the [Entities](#entities) table below for the full list.';
228
- const exEnt = activeEntities[0];
229
- const ex = exEnt.Name;
230
- const exLower = (0, naming_1.exampleVarName)(ex.toLowerCase(), 'ts');
231
- // The example call uses the entity's PRIMARY op — an op it actually
232
- // exposes (prefer list -> the array, then load -> the record, else a
233
- // create with its required fields). A create-only entity therefore never
234
- // shows a phantom .list()/.load() that would not compile. If it exposes
235
- // only remove (or nothing), the op line is omitted entirely.
236
- const primaryOp = (0, opShape_1.entityPrimaryOp)(exEnt);
237
- let exCall = '';
238
- const exIdField = (0, opShape_1.entityIdField)(exEnt);
239
- const exListArg = (0, opExample_1.listMatchArg)('ts', exEnt);
240
- const exLoadArg = (0, opExample_1.matchArg)('ts', exEnt, 'load', exIdField, (0, opExample_1.idLiteral)(exEnt, 'load', exIdField));
241
- if ('list' === primaryOp) {
242
- exCall = `const items = await client.${ex}().list(${exListArg})`;
243
- }
244
- else if ('load' === primaryOp) {
245
- exCall = `const ${exLower} = await client.${ex}().load(${exLoadArg})`;
246
- }
247
- else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
248
- const exIdF = (0, opShape_1.entityIdField)(exEnt);
249
- // Drop the id only when the request shape says it is OPTIONAL. It is
250
- // server-assigned on a normal create, but an op whose id comes from a
251
- // PATH PARAMETER requires it, and the typed CreateData then rejects a
252
- // body without it. Same rule as dataArg in helpers/opExample.
253
- const shapeItems = (0, opExample_1.requestExampleItems)(exEnt, primaryOp)
254
- .filter((it) => (it.name !== exIdF && it.name !== 'id') || !it.optional);
255
- const required = shapeItems.filter((it) => !it.optional);
256
- const chosen = required.length ? required : shapeItems.slice(0, 3);
257
- const bodyLines = chosen.map((it) => ` ${(0, naming_1.jsKey)(it.name)}: ${tsExampleLiteral(it.type)},`);
258
- const body = bodyLines.length ? `\n${bodyLines.join('\n')}\n` : '';
259
- exCall = `const ${exLower} = await client.${ex}().${primaryOp}({${body}})`;
260
- }
261
- const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove'];
262
- const opSet = new Set();
263
- activeEntities.forEach((e) => Object.keys(e.op || {})
264
- .forEach((o) => { if (e.op[o] && e.op[o].active !== false)
265
- opSet.add(o); }));
266
- const opNames = CANON_OPS.filter((o) => opSet.has(o)).concat([...opSet].filter((o) => !CANON_OPS.includes(o)));
267
- const opList = (opNames.length ? opNames : ['list', 'load']).map((o) => '`' + o + '`').join(', ');
268
- // In the SDK's own language: ts when it has one, else the first the
269
- // example helpers can write, else no example at all.
270
- const lang = exampleLang(model, sdkTargets);
271
- let snippet = '';
272
- if ('ts' === lang) {
273
- snippet = `const client = new ${model.Name}SDK()${exCall ? '\n' + exCall : ''}`;
274
- }
275
- else if (null != lang) {
276
- const call = ['list', 'load', 'create', 'update', 'patch'].includes(String(primaryOp))
277
- ? (0, opExample_1.primaryOpCall)(lang, ex, (0, naming_1.exampleVarName)(ex.toLowerCase(), lang), primaryOp, exIdField, exEnt)
278
- : null;
279
- snippet = entityExample(lang, model.Name, call);
280
- }
281
- const exBlock = '' === snippet ? '.' :
282
- `:\n\n\`\`\`${EXAMPLE_FENCE[lang]}\n${snippet}\n\`\`\``;
283
- (0, jostraca_1.Content)(`## Entities, not endpoints
199
+ else if ('load' === primaryOp) {
200
+ exCall = `const ${exLower} = await client.${ex}().load(${exLoadArg})`;
201
+ }
202
+ else if ('create' === primaryOp || 'update' === primaryOp || 'patch' === primaryOp) {
203
+ const exIdF = (0, opShape_1.entityIdField)(exEnt);
204
+ // Drop the id only when the request shape says it is OPTIONAL. It is
205
+ // server-assigned on a normal create, but an op whose id comes from a
206
+ // PATH PARAMETER requires it, and the typed CreateData then rejects a
207
+ // body without it. Same rule as dataArg in helpers/opExample.
208
+ const shapeItems = (0, opExample_1.requestExampleItems)(exEnt, primaryOp)
209
+ .filter((it) => (it.name !== exIdF && it.name !== 'id') || !it.optional);
210
+ const required = shapeItems.filter((it) => !it.optional);
211
+ const chosen = required.length ? required : shapeItems.slice(0, 3);
212
+ const bodyLines = chosen.map((it) => ` ${(0, naming_1.jsKey)(it.name)}: ${tsExampleLiteral(it.type)},`);
213
+ const body = bodyLines.length ? `\n${bodyLines.join('\n')}\n` : '';
214
+ exCall = `const ${exLower} = await client.${ex}().${primaryOp}({${body}})`;
215
+ }
216
+ const CANON_OPS = ['list', 'load', 'create', 'update', 'patch', 'remove'];
217
+ const opSet = new Set();
218
+ activeEntities.forEach((e) => Object.keys(e.op || {})
219
+ .forEach((o) => { if (e.op[o] && e.op[o].active !== false)
220
+ opSet.add(o); }));
221
+ const opNames = CANON_OPS.filter((o) => opSet.has(o)).concat([...opSet].filter((o) => !CANON_OPS.includes(o)));
222
+ const opList = (opNames.length ? opNames : ['list', 'load']).map((o) => '`' + o + '`').join(', ');
223
+ // In the SDK's own language: ts when it has one, else the first the
224
+ // example helpers can write, else no example at all.
225
+ const lang = exampleLang(model, sdkTargets);
226
+ let snippet = '';
227
+ if ('ts' === lang) {
228
+ snippet = `const client = new ${model.Name}SDK()${exCall ? '\n' + exCall : ''}`;
229
+ }
230
+ else if (null != lang) {
231
+ const call = ['list', 'load', 'create', 'update', 'patch'].includes(String(primaryOp))
232
+ ? (0, opExample_1.primaryOpCall)(lang, ex, (0, naming_1.exampleVarName)(ex.toLowerCase(), lang), primaryOp, exIdField, exEnt)
233
+ : null;
234
+ snippet = entityExample(lang, model.Name, call);
235
+ }
236
+ const exBlock = '' === snippet ? '.' :
237
+ `:\n\n\`\`\`${EXAMPLE_FENCE[lang]}\n${snippet}\n\`\`\``;
238
+ (0, jostraca_1.Content)(`## Entities, not endpoints
284
239
 
285
240
  This SDK exposes the API as ${surface} that you
286
241
  call directly, instead of assembling URL paths and query strings.${seeEntities} Entities are
@@ -291,122 +246,141 @@ Thinking in entities keeps the mental model small — for people and AI agents a
291
246
  rather than reasoning about raw HTTP routes and query parameters.
292
247
 
293
248
  `);
294
- }
295
- if (sdkTargets.length > 0) {
296
- (0, jostraca_1.Content)(`## Offline unit testing
249
+ }
250
+ });
251
+ const ReadmeTopTesting = (0, component_1.cmp)(function ReadmeTopTesting(props) {
252
+ const { ctx$, sdkTargets } = props.s;
253
+ if (sdkTargets.length > 0) {
254
+ (0, jostraca_1.Content)(`## Offline unit testing
297
255
 
298
256
  Every SDK ships a built-in **test mode** that swaps the HTTP transport for
299
257
  an in-memory mock, so your unit tests run fully offline — no server, no
300
258
  network, and no credentials:
301
259
 
302
260
  `);
303
- sdkTargets.forEach((tgt) => {
304
- const Test = (0, optional_1.optionalComponent)(ctx$, tgt, 'ReadmeTopTest');
305
- if (Test) {
306
- (0, jostraca_1.Content)(`### ${tgt.title}
261
+ sdkTargets.forEach((tgt) => {
262
+ const Test = (0, optional_1.optionalComponent)(ctx$, tgt, 'ReadmeTopTest');
263
+ if (Test) {
264
+ (0, jostraca_1.Content)(`### ${(0, facts_1.fact)(tgt, 'title')}
307
265
 
308
266
  `);
309
- Test['ReadmeTopTest']({ target: tgt });
310
- (0, jostraca_1.Content)(`
267
+ Test['ReadmeTopTest']({ target: tgt });
268
+ (0, jostraca_1.Content)(`
311
269
  `);
312
- }
313
- });
314
- }
315
- // 3. Packages — real published package name + install command per
316
- // ecosystem. A package that is NOT yet live on its registry (the fleet
317
- // default: 'pending') must NOT advertise a `npm install ...` that 404s —
318
- // its Install cell links to the target README's install section instead,
319
- // as do go-cli and go-mcp, which the Go proxy cannot install.
320
- if (pkgTargets.length > 0) {
321
- (0, jostraca_1.Content)(`## Packages
270
+ }
271
+ });
272
+ }
273
+ });
274
+ const ReadmeTopPackages = (0, component_1.cmp)(function ReadmeTopPackages(props) {
275
+ const { model, pkgTargets } = props.s;
276
+ // 3. Packages — real published package name + install command per
277
+ // ecosystem. A package that is NOT yet live on its registry (the fleet
278
+ // default: 'pending') must NOT advertise a `npm install ...` that 404s —
279
+ // its Install cell links to the target README's install section instead,
280
+ // as do go-cli and go-mcp, which the Go proxy cannot install.
281
+ if (pkgTargets.length > 0) {
282
+ (0, jostraca_1.Content)(`## Packages
322
283
 
323
284
  | Language | Package | Install |
324
285
  | --- | --- | --- |
325
286
  `);
326
- pkgTargets.forEach((tgt) => {
327
- const state = (0, packageMeta_1.registryState)(model, tgt.name);
328
- let cell;
329
- if ('active' === state) {
330
- const cmd = installCommand(tgt, model);
331
- if (!cmd)
332
- return;
333
- cell = '`' + cmd + '`';
334
- }
335
- else if ('tag' === state) {
336
- const cmd = (0, packageMeta_1.vendorCommand)(model, tgt.name);
337
- cell = cmd
338
- ? '`' + cmd + '`'
339
- : `build from source — [${tgt.name}/README.md](${tgt.name}/README.md)`;
340
- }
341
- else {
342
- // The target README always gives a route that works without a
343
- // tag, which a repository may not have.
344
- cell = `publish pending — [install from source](${tgt.name}/README.md#install)`;
345
- }
346
- (0, jostraca_1.Content)(`| ${tgt.title} | \`${(0, packageMeta_1.packageName)(model, tgt.name)}\` | ${cell} |
347
- `);
348
- });
349
- (0, jostraca_1.Content)(`
287
+ pkgTargets.forEach((tgt) => {
288
+ const state = (0, packageMeta_1.registryState)(model, tgt.name);
289
+ const readme = (0, facts_1.fact)(tgt, 'docs').readme;
290
+ let cell;
291
+ if ('active' === state) {
292
+ const cmd = installCommand(tgt, model);
293
+ cell = cmd
294
+ ? '`' + cmd + '`'
295
+ : readme ? `see [${tgt.name}/README.md](${tgt.name}/README.md#install)` : `see \`${tgt.name}/\``;
296
+ }
297
+ else if ('tag' === state) {
298
+ const cmd = (0, packageMeta_1.vendorCommand)(model, tgt.name);
299
+ cell = cmd
300
+ ? '`' + cmd + '`'
301
+ : 'build from source — ' + (readme ? `[${tgt.name}/README.md](${tgt.name}/README.md)` : `\`${tgt.name}/\``);
302
+ }
303
+ else {
304
+ // The target README always gives a route that works without a
305
+ // tag, which a repository may not have.
306
+ cell = readme ? `publish pending — [install from source](${tgt.name}/README.md#install)` :
307
+ `publish pending — install from source in \`${tgt.name}/\``;
308
+ }
309
+ (0, jostraca_1.Content)(`| ${(0, facts_1.fact)(tgt, 'title')} | \`${(0, packageMeta_1.packageName)(model, tgt.name)}\` | ${cell} |
310
+ `);
311
+ });
312
+ (0, jostraca_1.Content)(`
350
313
  `);
351
- }
352
- if (leadTarget) {
353
- (0, jostraca_1.Content)(`## Quickstart
314
+ }
315
+ });
316
+ const ReadmeTopQuickstart = (0, component_1.cmp)(function ReadmeTopQuickstart(props) {
317
+ const { model, ctx$, leadTarget } = props.s;
318
+ if (leadTarget) {
319
+ (0, jostraca_1.Content)(`## Quickstart
354
320
 
355
- ### ${leadTarget.title}
321
+ ### ${(0, facts_1.fact)(leadTarget, 'title')}
356
322
 
357
323
  `);
358
- const LeadQuick = (0, optional_1.optionalComponent)(ctx$, leadTarget, 'ReadmeTopQuick');
359
- if (LeadQuick) {
360
- LeadQuick['ReadmeTopQuick']({ target: leadTarget });
361
- }
362
- const placement = (0, utility_1.credentialPlacement)(model);
363
- (0, jostraca_1.Content)(`
364
- ${'' === placement ? '' : placement + '\n\n'}See the [${leadTarget.title} README](${leadTarget.name}/README.md) for the full guide.
324
+ const LeadQuick = (0, optional_1.optionalComponent)(ctx$, leadTarget, 'ReadmeTopQuick');
325
+ if (LeadQuick) {
326
+ LeadQuick['ReadmeTopQuick']({ target: leadTarget });
327
+ }
328
+ const placement = (0, utility_1.credentialPlacement)(model);
329
+ (0, jostraca_1.Content)(`
330
+ ${'' === placement ? '' : placement + '\n\n'}${(0, facts_1.fact)(leadTarget, 'docs').readme ?
331
+ `See the [${(0, facts_1.fact)(leadTarget, 'title')} README](${leadTarget.name}/README.md) for the full guide.` : ''}
365
332
 
366
333
  `);
367
- }
368
- if (sdkTargets.length > 0 || hasCli || hasMcp || consumerTargets.length > 0) {
369
- (0, jostraca_1.Content)(`## Surfaces
334
+ }
335
+ });
336
+ const ReadmeTopSurfaces = (0, component_1.cmp)(function ReadmeTopSurfaces(props) {
337
+ const { hasCli, hasMcp, cliTargets, mcpTargets, sdkTargets, consumerTargets, langList } = props.s;
338
+ const paths = (targets) => targets.map((t) => `\`${t.name}/\``).join(' ');
339
+ if (sdkTargets.length > 0 || hasCli || hasMcp || consumerTargets.length > 0) {
340
+ (0, jostraca_1.Content)(`## Surfaces
370
341
 
371
342
  | Surface | Path |
372
343
  | --- | --- |
373
344
  `);
374
- if (sdkTargets.length > 0) {
375
- const paths = sdkTargets.map((t) => `\`${t.name}/\``).join(' ');
376
- (0, jostraca_1.Content)(`| **SDK** (${langList}) | ${paths} |
345
+ if (sdkTargets.length > 0) {
346
+ (0, jostraca_1.Content)(`| **SDK** (${langList}) | ${paths(sdkTargets)} |
377
347
  `);
378
- }
379
- if (hasCli) {
380
- (0, jostraca_1.Content)(`| **CLI** | \`go-cli/\` |
348
+ }
349
+ if (hasCli) {
350
+ (0, jostraca_1.Content)(`| **CLI** | ${paths(cliTargets)} |
381
351
  `);
382
- }
383
- if (hasMcp) {
384
- (0, jostraca_1.Content)(`| **MCP server** | \`go-mcp/\` |
352
+ }
353
+ if (hasMcp) {
354
+ (0, jostraca_1.Content)(`| **MCP server** | ${paths(mcpTargets)} |
385
355
  `);
386
- }
387
- consumerTargets.forEach((t) => {
388
- (0, jostraca_1.Content)(`| **${t.title}** | \`${t.name}/\` |
356
+ }
357
+ consumerTargets.forEach((t) => {
358
+ (0, jostraca_1.Content)(`| **${(0, facts_1.fact)(t, 'title')}** | \`${t.name}/\` |
389
359
  `);
390
- });
391
- (0, jostraca_1.Content)(`
360
+ });
361
+ (0, jostraca_1.Content)(`
392
362
  `);
393
- }
394
- if (hasMcp) {
395
- const mcpOps = (0, mcpTools_1.mcpTools)(model).map((tool) => tool.op);
396
- const mcpWrite = true === model.main?.[types_1.KIT]?.target?.['go-mcp']?.tool?.write;
397
- const toggle = "`main: kit: target: 'go-mcp': tool: write: true`";
398
- const opText = mcpOps.length < 2 ? mcpOps.join('') :
399
- mcpOps.slice(0, -1).join(', ') + ' and ' + mcpOps[mcpOps.length - 1];
400
- // What the server reads and writes is what it registers, not the flag.
401
- const reads = mcpOps.some((op) => mcpTools_1.MCP_WRITE_OPS.includes(op)) ? '' : mcpWrite ?
402
- ' It only reads, as no entity has a create, update, patch or remove a plain call runs.' :
403
- ` It only reads: create, update, patch and remove become tools when the SDK's model sets
363
+ }
364
+ });
365
+ const ReadmeTopMcp = (0, component_1.cmp)(function ReadmeTopMcp(props) {
366
+ const { model, hasMcp, mcpTargets } = props.s;
367
+ if (hasMcp) {
368
+ const mcp = mcpTargets[0].name;
369
+ const mcpOps = (0, mcpTools_1.mcpTools)(model, mcp).map((tool) => tool.op);
370
+ const mcpWrite = true === mcpTargets[0].tool?.write;
371
+ const toggle = `\`main: kit: target: '${mcp}': tool: write: true\``;
372
+ const opText = mcpOps.length < 2 ? mcpOps.join('') :
373
+ mcpOps.slice(0, -1).join(', ') + ' and ' + mcpOps[mcpOps.length - 1];
374
+ // What the server reads and writes is what it registers, not the flag.
375
+ const reads = mcpOps.some((op) => mcpTools_1.MCP_WRITE_OPS.includes(op)) ? '' : mcpWrite ?
376
+ ' It only reads, as no entity has a create, update, patch or remove a plain call runs.' :
377
+ ` It only reads: create, update, patch and remove become tools when the SDK's model sets
404
378
  ${toggle}.`;
405
- (0, jostraca_1.Content)(0 === mcpOps.length ? `## Use it from an AI agent (MCP)
379
+ (0, jostraca_1.Content)(0 === mcpOps.length ? `## Use it from an AI agent (MCP)
406
380
 
407
381
  The generated MCP server has no tools for this SDK: no entity has a list or
408
382
  load a plain call runs${mcpWrite ? ', or a create, update, patch or remove' :
409
- `, and create, update, patch and remove are off until the SDK's model sets
383
+ `, and create, update, patch and remove are off until the SDK's model sets
410
384
  ${toggle}`}.
411
385
 
412
386
  ` : `## Use it from an AI agent (MCP)
@@ -416,7 +390,7 @@ The generated MCP server exposes this SDK's ${opText} operations as
416
390
  can call directly.${reads} Build and register it:
417
391
 
418
392
  \`\`\`bash
419
- cd go-mcp && go build -o ${model.name}-mcp .
393
+ cd ${mcp} && go build -o ${model.name}-mcp .
420
394
  \`\`\`
421
395
 
422
396
  Then add it to your agent's MCP config (Claude Desktop, Cursor, etc.):
@@ -432,54 +406,62 @@ Then add it to your agent's MCP config (Claude Desktop, Cursor, etc.):
432
406
  \`\`\`
433
407
 
434
408
  `);
435
- }
436
- if (activeEntities.length > 0) {
437
- (0, jostraca_1.Content)(`## Entities
409
+ }
410
+ });
411
+ const ReadmeTopEntities = (0, component_1.cmp)(function ReadmeTopEntities(props) {
412
+ const { activeEntities } = props.s;
413
+ if (activeEntities.length > 0) {
414
+ (0, jostraca_1.Content)(`## Entities
438
415
 
439
416
  The API exposes ${activeEntities.length === 1 ? 'one entity' : activeEntities.length + ' entities'}:
440
417
 
441
418
  | Entity | Description | API path |
442
419
  | --- | --- | --- |
443
420
  `);
444
- activeEntities.map((ent) => {
445
- const ops = ent.op || {};
446
- const opNames = Object.keys(ops).filter((o) => ops[o]?.active !== false);
447
- const entdesc = entityDesc[ent.name] || ent.short || ent.desc ||
448
- `The ${ent.Name} entity${opNames.length ? ' (' + opNames.join(', ') + ')' : ''}.`;
449
- const path = (0, opShape_1.entityPath)(ent);
450
- (0, jostraca_1.Content)(`| **${ent.Name}** | ${entdesc} | \`${path}\` |
451
- `);
452
- });
453
- const opUnion = new Set();
454
- activeEntities.forEach((e) => Object.keys(e.op || {})
455
- .forEach((o) => { if (e.op[o]?.active !== false)
456
- opUnion.add(o); }));
457
- const opAvail = ['load', 'list', 'create', 'update', 'patch', 'remove'].filter((o) => opUnion.has(o));
458
- const opBold = (opAvail.length ? opAvail : ['load', 'list']).map((o) => '**' + o + '**').join(', ');
459
- (0, jostraca_1.Content)(`
421
+ activeEntities.map((ent) => {
422
+ const ops = ent.op || {};
423
+ const opNames = Object.keys(ops).filter((o) => ops[o]?.active !== false);
424
+ const entdesc = (0, facts_1.fact)(ent, 'desc').cell ||
425
+ `The ${ent.Name} entity${opNames.length ? ' (' + opNames.join(', ') + ')' : ''}.`;
426
+ const path = (0, opShape_1.entityPath)(ent);
427
+ (0, jostraca_1.Content)(`| **${ent.Name}** | ${entdesc} | \`${path}\` |
428
+ `);
429
+ });
430
+ const opUnion = new Set();
431
+ activeEntities.forEach((e) => Object.keys(e.op || {})
432
+ .forEach((o) => { if (e.op[o]?.active !== false)
433
+ opUnion.add(o); }));
434
+ const opAvail = ['load', 'list', 'create', 'update', 'patch', 'remove'].filter((o) => opUnion.has(o));
435
+ const opBold = (opAvail.length ? opAvail : ['load', 'list']).map((o) => '**' + o + '**').join(', ');
436
+ (0, jostraca_1.Content)(`
460
437
  The operations available across these entities are ${opBold} — see each entity's
461
438
  own list above for exactly which it supports.
462
439
 
463
440
  `);
464
- }
465
- const otherTargets = sdkTargets.filter((t) => leadTarget && t.name !== leadTarget.name);
466
- if (otherTargets.length > 0) {
467
- (0, jostraca_1.Content)(`## Quickstart in other languages
441
+ }
442
+ });
443
+ const ReadmeTopOtherLanguages = (0, component_1.cmp)(function ReadmeTopOtherLanguages(props) {
444
+ const { ctx$, sdkTargets, leadTarget } = props.s;
445
+ const otherTargets = sdkTargets.filter((t) => leadTarget && t.name !== leadTarget.name);
446
+ if (otherTargets.length > 0) {
447
+ (0, jostraca_1.Content)(`## Quickstart in other languages
468
448
 
469
449
  `);
470
- otherTargets.forEach((tgt) => {
471
- const Quick = (0, optional_1.optionalComponent)(ctx$, tgt, 'ReadmeTopQuick');
472
- if (Quick) {
473
- (0, jostraca_1.Content)(`### ${tgt.title}
450
+ otherTargets.forEach((tgt) => {
451
+ const Quick = (0, optional_1.optionalComponent)(ctx$, tgt, 'ReadmeTopQuick');
452
+ if (Quick) {
453
+ (0, jostraca_1.Content)(`### ${(0, facts_1.fact)(tgt, 'title')}
474
454
 
475
455
  `);
476
- Quick['ReadmeTopQuick']({ target: tgt });
477
- (0, jostraca_1.Content)(`
456
+ Quick['ReadmeTopQuick']({ target: tgt });
457
+ (0, jostraca_1.Content)(`
478
458
  `);
479
- }
480
- });
481
- }
482
- (0, jostraca_1.Content)(`## Direct and prepare
459
+ }
460
+ });
461
+ }
462
+ });
463
+ const ReadmeTopDirect = (0, component_1.cmp)(function ReadmeTopDirect() {
464
+ (0, jostraca_1.Content)(`## Direct and prepare
483
465
 
484
466
  For endpoints the entity model doesn't cover, use the low-level methods:
485
467
 
@@ -490,73 +472,80 @@ Both accept a map with \`path\`, \`method\`, \`params\`, \`query\`,
490
472
  \`headers\`, and \`body\`. See the [How-to guides](#how-to-guides) below.
491
473
 
492
474
  `);
493
- (0, jostraca_1.Content)(`## How-to guides
475
+ });
476
+ const ReadmeTopHowtoGuides = (0, component_1.cmp)(function ReadmeTopHowtoGuides(props) {
477
+ const { ctx$, sdkTargets } = props.s;
478
+ (0, jostraca_1.Content)(`## How-to guides
494
479
 
495
480
  ### Make a direct API call
496
481
 
497
482
  When the entity interface does not cover an endpoint, use \`direct\`:
498
483
 
499
484
  `);
500
- sdkTargets.forEach((tgt) => {
501
- const Howto = (0, optional_1.optionalComponent)(ctx$, tgt, 'ReadmeTopHowto');
502
- if (Howto) {
503
- Howto['ReadmeTopHowto']({ target: tgt });
504
- }
505
- });
506
- (0, jostraca_1.Content)(`## Advanced
485
+ sdkTargets.forEach((tgt) => {
486
+ const Howto = (0, optional_1.optionalComponent)(ctx$, tgt, 'ReadmeTopHowto');
487
+ if (Howto) {
488
+ Howto['ReadmeTopHowto']({ target: tgt });
489
+ }
490
+ });
491
+ });
492
+ const ReadmeTopAdvanced = (0, component_1.cmp)(function ReadmeTopAdvanced(props) {
493
+ const { feature } = props.s;
494
+ (0, jostraca_1.Content)(`## Advanced
507
495
 
508
496
  > Everyday use only needs the sections above. This explains the internals
509
497
  > behind every call — relevant when writing custom features.
510
498
 
511
- Every SDK call runs the same five-stage pipeline:
499
+ Every entity operation runs the same ${(0, FeatureHook_1.pipelineLength)()}-stage pipeline:
512
500
 
513
- 1. **Point** — resolve the API endpoint from the operation definition.
514
- 2. **Spec** — build the HTTP specification (URL, method, headers, body).
515
- 3. **Request** — send the HTTP request.
516
- 4. **Response** — receive and parse the response.
517
- 5. **Result** — extract the result data for the caller.
501
+ ${FeatureHook_1.PIPELINE_STAGES.map((s, i) => (i + 1) + '. **' + s.name + '** — ' + s.purpose).join('\n')}
518
502
 
519
- A feature hook fires at each stage (e.g. \`PrePoint\`, \`PreSpec\`,
520
- \`PreRequest\`), so features can inspect or modify the pipeline without
503
+ A feature hook fires before each stage (e.g. \`${FeatureHook_1.PIPELINE_STAGES[0].hook}\`, \`${FeatureHook_1.PIPELINE_STAGES[1].hook}\`,
504
+ \`${FeatureHook_1.PIPELINE_STAGES[2].hook}\`), so features can inspect or modify the pipeline without
521
505
  forking the SDK.
522
506
 
523
- ### Features
524
-
525
507
  `);
526
- (0, jostraca_1.Content)(`| Feature | Purpose |
508
+ const active = (0, jostraca_1.each)(feature).filter((feat) => feat.active);
509
+ if (0 < active.length) {
510
+ (0, jostraca_1.Content)(`### Features
511
+
512
+ | Feature | Purpose |
527
513
  | --- | --- |
528
514
  `);
529
- (0, jostraca_1.each)(feature, (feat) => {
530
- if (!feat.active)
531
- return;
532
- const purpose = feat.title || feat.Name || feat.name;
515
+ for (const feat of active) {
516
+ const purpose = (0, facts_1.fact)(feat, 'title').cell || feat.Name || feat.name;
533
517
  (0, jostraca_1.Content)(`| **${feat.Name || feat.name}Feature** | ${purpose} |
534
518
  `);
535
- });
519
+ }
536
520
  (0, jostraca_1.Content)(`
537
- Pass custom features via the \`extend\` option at construction time.
538
-
539
- `);
540
- // 11c. Customization: model-driven declarations, in-repo templates and
541
- // components, regeneration that overwrites, customising in `.sdk`, and a
542
- // map of which paths are the project's to edit. Every SDK repo carries
543
- // its own generator, so this belongs in every README. A repository that
544
- // regenerates `.sdk` in full says so, since its copies do not merge.
545
- const mapTarget = sdkTargets[0] || docTargets[0];
546
- const targetDir = mapTarget ? `\`<target>/\`, such as \`${mapTarget.name}/\`` : `\`<target>/\``;
547
- const merging = 'overwrite' !== model.main?.kit?.copies;
548
- const mergeNote = merging ?
549
- `An add merges toolchain updates into the
521
+ `);
522
+ }
523
+ (0, jostraca_1.Content)(`Pass custom features via the \`extend\` option at construction time.
524
+
525
+ `);
526
+ });
527
+ const ReadmeTopCustomizing = (0, component_1.cmp)(function ReadmeTopCustomizing(props) {
528
+ const { model, sdkTargets, docTargets, definition } = props.s;
529
+ // 11c. Customization: model-driven declarations, in-repo templates and
530
+ // components, regeneration that overwrites, customising in `.sdk`, and a
531
+ // map of which paths are the project's to edit. Every SDK repo carries
532
+ // its own generator, so this belongs in every README. A repository that
533
+ // regenerates `.sdk` in full says so, since its copies do not merge.
534
+ const mapTarget = sdkTargets[0] || docTargets[0];
535
+ const targetDir = mapTarget ? `\`<target>/\`, such as \`${mapTarget.name}/\`` : `\`<target>/\``;
536
+ const merging = copymerge_1.MERGE === (0, copymerge_1.copyMode)(model.main?.[types_1.KIT]?.copies);
537
+ const mergeNote = merging ?
538
+ `An add merges toolchain updates into the
550
539
  edited copies, and \`voxgig-sdkgen doctor\` reports any drift from what a
551
540
  resync would write.` :
552
- `This repository regenerates \`.sdk\` in full
541
+ `This repository regenerates \`.sdk\` in full
553
542
  (\`main: kit: copies: 'overwrite'\`): set it to \`'merge'\` before
554
543
  customising, so that an add merges toolchain updates into the edited
555
544
  copies.`;
556
- const copiesRow = merging ?
557
- `Yes. They are this project's copies, and \`target add\` merges toolchain updates into your edits.` :
558
- `Only after setting \`copies\` to \`'merge'\`. This repository regenerates them in full.`;
559
- (0, jostraca_1.Content)(`## Customizing this SDK
545
+ const copiesRow = merging ?
546
+ `Yes. They are this project's copies, and \`target add\` merges toolchain updates into your edits.` :
547
+ `Only after setting \`copies\` to \`'merge'\`. This repository regenerates them in full.`;
548
+ (0, jostraca_1.Content)(`## Customizing this SDK
560
549
 
561
550
  This repository contains its own generator (\`.sdk/\`), so the SDK is
562
551
  customizable without forking any upstream tool:
@@ -590,7 +579,7 @@ customizable without forking any upstream tool:
590
579
  | \`.sdk/model/text.aontu\` | The README wording, in \`main.kit.text\`: the tagline, the summary and the entity descriptions | Yes. The scaffold writes it once and never again. |
591
580
  | \`.sdk/model/guide/guide.aontu\` | How the spec's paths map onto entities and operations | Yes. The scaffold writes it once and never again. |
592
581
  | \`.sdk/model/\`, the rest | The API model built from the spec, and the target and feature definitions | Not by hand. Generation, \`target add\` and a new scaffold run rewrite it, apart from a feature or target this project defines itself. |
593
- | \`.sdk/def/\` | The OpenAPI spec | Replace it when the API changes. Generation rebuilds the model from it. |
582
+ | \`.sdk/def/\` | The ${definition} | Replace it when the API changes. Generation rebuilds the model from it. |
594
583
  | \`.sdk/src/cmp/<target>/\`, \`.sdk/tm/<target>/\` | The components and templates that generate each target | ${copiesRow} |
595
584
  | \`.sdk/test/\` | The shared test cases the generated tests run | No. |
596
585
  | ${targetDir} | One generated SDK per target, with its own tests | No. Generation overwrites it. |
@@ -613,58 +602,166 @@ How-to: [customize and propagate templates](https://github.com/voxgig/sdkgen/blo
613
602
  The full story: [voxgig.com/sdk/custom](https://voxgig.com/sdk/custom).
614
603
 
615
604
  `);
616
- if (docTargets.length > 0) {
617
- (0, jostraca_1.Content)(`## Per-language documentation
605
+ });
606
+ const ReadmeTopPerLanguage = (0, component_1.cmp)(function ReadmeTopPerLanguage(props) {
607
+ const { docTargets } = props.s;
608
+ if (docTargets.length > 0) {
609
+ (0, jostraca_1.Content)(`## Per-language documentation
618
610
 
619
611
  `);
620
- docTargets.forEach((tgt) => {
621
- (0, jostraca_1.Content)(`- [${tgt.title}](${tgt.name}/README.md)
612
+ docTargets.filter((tgt) => (0, facts_1.fact)(tgt, 'docs').readme).forEach((tgt) => {
613
+ (0, jostraca_1.Content)(`- [${(0, facts_1.fact)(tgt, 'title')}](${tgt.name}/README.md)
622
614
  `);
623
- });
624
- (0, jostraca_1.Content)(`
615
+ });
616
+ (0, jostraca_1.Content)(`
625
617
  `);
626
- }
627
- const upstreamUrl = (info.contact && info.contact.url)
628
- || (info.servers && info.servers[0] && info.servers[0].url)
629
- || homepage;
630
- (0, jostraca_1.Content)(`## Upstream API
618
+ }
619
+ });
620
+ const ReadmeTopUpstream = (0, component_1.cmp)(function ReadmeTopUpstream(props) {
621
+ const { text, definition, definitionFull, model } = props.s;
622
+ const upstream = text.upstream;
623
+ const docs = text.docs_url;
624
+ (0, jostraca_1.Content)(`## Upstream API
631
625
 
632
- This SDK is generated from the upstream OpenAPI specification. It is an
633
- unofficial client and is not affiliated with the API provider.
626
+ This SDK is generated from the upstream ${definitionFull}.${(0, packageMeta_1.publisherInfo)(model).official ? '' : ` It is an
627
+ unofficial client and is not affiliated with the API provider.`}
634
628
 
635
- The OpenAPI spec(s) this SDK was generated from are kept in the
629
+ The ${definition}(s) this SDK was generated from are kept in the
636
630
  [\`.sdk/def/\`](.sdk/def/) folder.
637
631
 
638
632
  `);
639
- if (upstreamUrl) {
640
- // A per-tenant server URL carries an OpenAPI server variable —
641
- // `https://{instance}.dreamapply.com/api` — and is the right thing to
642
- // SHOW, because it tells the reader the host is theirs to fill in. It is
643
- // not a thing to LINK: the braces are not a resolvable address, so a
644
- // markdown link renders as clickable and dead. Show it as code instead.
645
- const templated = /[{}]/.test(upstreamUrl);
646
- (0, jostraca_1.Content)(templated
647
- ? `- Upstream API: \`${upstreamUrl}\`
633
+ if (upstream.raw) {
634
+ // A per-tenant server URL carries an OpenAPI server variable —
635
+ // `https://{instance}.dreamapply.com/api` — and is the right thing to
636
+ // SHOW, because it tells the reader the host is theirs to fill in. It is
637
+ // not a thing to LINK: the braces are not a resolvable address, so a
638
+ // markdown link renders as clickable and dead. Show it as code instead.
639
+ const templated = /[{}]/.test(upstream.raw);
640
+ (0, jostraca_1.Content)(templated
641
+ ? `- Upstream API: ${upstream.code}
648
642
  `
649
- : `- Upstream API: [${upstreamUrl}](${upstreamUrl})
643
+ : `- Upstream API: [${upstream.inline}](${upstream.link})
650
644
  `);
651
- }
652
- if (docsUrl && docsUrl !== upstreamUrl) {
653
- (0, jostraca_1.Content)(`- Documentation: [${docsUrl}](${docsUrl})
645
+ }
646
+ if (docs.raw && docs.raw !== upstream.raw) {
647
+ (0, jostraca_1.Content)(`- Documentation: [${docs.inline}](${docs.link})
654
648
  `);
655
- }
656
- (0, jostraca_1.Content)(`
649
+ }
650
+ (0, jostraca_1.Content)(`
657
651
  `);
658
- (0, jostraca_1.Content)(`## Security
652
+ });
653
+ const ReadmeTopSecurity = (0, component_1.cmp)(function ReadmeTopSecurity(props) {
654
+ const { model } = props.s;
655
+ (0, jostraca_1.Content)(`## Security
659
656
 
660
657
  Please report security issues ${(0, packageMeta_1.securityContact)(model)}. See [SECURITY.md](SECURITY.md).
661
658
  Do not open public issues for suspected vulnerabilities.
662
659
 
663
660
  `);
664
- (0, jostraca_1.Content)(`---
661
+ });
662
+ const ReadmeTopFooter = (0, component_1.cmp)(function ReadmeTopFooter(props) {
663
+ const { productName, definition } = props.s;
664
+ (0, jostraca_1.Content)(`---
665
665
 
666
- Generated from the ${productName} OpenAPI spec by [@voxgig/sdkgen](${SDKGEN_REPO}).
666
+ Generated from the ${productName} ${definition} by [@voxgig/sdkgen](${SDKGEN_REPO}).
667
667
  `);
668
+ });
669
+ const ReadmeTop = (0, component_1.cmp)(function ReadmeTop(props) {
670
+ const { ctx$ } = props;
671
+ const { model } = ctx$;
672
+ if (model.name && !model.Name)
673
+ (0, jostraca_1.names)(model, model.name);
674
+ const info = (0, text_1.modelText)(model);
675
+ const def = (model.main && model.main.def) || {};
676
+ const text = (0, facts_1.fact)(model.main[types_1.KIT], 'text');
677
+ const productName = (0, facts_1.fact)(model.main[types_1.KIT], 'apiName').inline;
678
+ const kind = (0, facts_1.fact)(model.main[types_1.KIT], 'definitionKind');
679
+ const definition = (0, text_1.definitionName)(kind);
680
+ const definitionFull = (0, text_1.definitionName)(kind, true);
681
+ const tagline = text.tagline.inline
682
+ || `${productName} client, generated from the ${definition}.`;
683
+ const aboutMd = text.about_md.text;
684
+ const apiSummary = text.summary.inline;
685
+ const websiteLine = text.website.raw
686
+ ? `Learn more about ${productName} at [${text.website.label}](${text.website.link}).`
687
+ : '';
688
+ // Attribution for API metadata sourced from a third-party catalogue (e.g.
689
+ // freepublicapis.com). Rendered only when the model carries an
690
+ // `info.meta_source` URL, so first-party SDKs never show it. The link points
691
+ // back to the catalogue that kindly supplied the metadata.
692
+ const metaSourceLine = text.meta_source.raw
693
+ ? `Metadata kindly supplied by [${text.meta_source.label}](${text.meta_source.link}).`
694
+ : '';
695
+ const entity = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.entity`);
696
+ const target = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.target`);
697
+ const feature = (0, types_1.getModelPath)(model, `main.${types_1.KIT}.feature`);
698
+ (0, jostraca_1.each)(entity, (ent) => { if (!ent.Name)
699
+ (0, jostraca_1.names)(ent, ent.name); });
700
+ (0, jostraca_1.each)(feature, (feat) => { if (!feat.Name)
701
+ (0, jostraca_1.names)(feat, feat.name); });
702
+ const activeEntities = (0, jostraca_1.each)(entity).filter((e) => e.active !== false);
703
+ const activeTargets = (0, facts_1.fact)(model.main[types_1.KIT], 'active').map((name) => target[name]);
704
+ const cliTargets = activeTargets.filter((t) => 'cli' === (0, surface_1.surfaceOf)(t));
705
+ const mcpTargets = activeTargets.filter((t) => 'mcp' === (0, surface_1.surfaceOf)(t));
706
+ const hasCli = 0 < cliTargets.length;
707
+ const hasMcp = 0 < mcpTargets.length;
708
+ const ordered = (0, surface_1.documentOrder)(model, activeTargets);
709
+ const isCliOrMcp = (t) => ['cli', 'mcp'].includes((0, surface_1.surfaceOf)(t));
710
+ const sdkTargets = ordered.filter((t) => 'sdk' === (0, surface_1.surfaceOf)(t));
711
+ // The CLI and the MCP server have surfaces of their own below.
712
+ const consumerTargets = ordered.filter((t) => 'sdk' !== (0, surface_1.surfaceOf)(t) && !isCliOrMcp(t));
713
+ const docTargets = ordered.filter((t) => !isCliOrMcp(t));
714
+ const pkgTargets = ordered.filter((t) => (0, packageMeta_1.hasPackageName)(model, t.name));
715
+ const langList = sdkTargets.map((t) => (0, facts_1.fact)(t, 'title')).join(', ');
716
+ const leadTarget = pickLeadTarget(sdkTargets);
717
+ const s = {
718
+ model,
719
+ ctx$,
720
+ info,
721
+ def,
722
+ text,
723
+ productName,
724
+ definition,
725
+ definitionFull,
726
+ tagline,
727
+ aboutMd,
728
+ apiSummary,
729
+ websiteLine,
730
+ metaSourceLine,
731
+ feature,
732
+ activeEntities,
733
+ hasCli,
734
+ hasMcp,
735
+ cliTargets,
736
+ mcpTargets,
737
+ sdkTargets,
738
+ consumerTargets,
739
+ docTargets,
740
+ pkgTargets,
741
+ langList,
742
+ leadTarget,
743
+ };
744
+ (0, jostraca_1.File)({ name: 'README.md' }, () => {
745
+ ReadmeTopTitle({ s });
746
+ ReadmeTopSurfaceLine({ s });
747
+ ReadmeTopFeatureLine({ s });
748
+ ReadmeTopAbout({ s });
749
+ ReadmeTopEntityModel({ s });
750
+ ReadmeTopTesting({ s });
751
+ ReadmeTopPackages({ s });
752
+ ReadmeTopQuickstart({ s });
753
+ ReadmeTopSurfaces({ s });
754
+ ReadmeTopMcp({ s });
755
+ ReadmeTopEntities({ s });
756
+ ReadmeTopOtherLanguages({ s });
757
+ ReadmeTopDirect({ s });
758
+ ReadmeTopHowtoGuides({ s });
759
+ ReadmeTopAdvanced({ s });
760
+ ReadmeTopCustomizing({ s });
761
+ ReadmeTopPerLanguage({ s });
762
+ ReadmeTopUpstream({ s });
763
+ ReadmeTopSecurity({ s });
764
+ ReadmeTopFooter({ s });
668
765
  });
669
766
  });
670
767
  exports.ReadmeTop = ReadmeTop;