@voxgig/sdkgen 3.4.7 → 3.5.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 (194) hide show
  1. package/bin/voxgig-sdkgen +78 -10
  2. package/dist/action/action.d.ts +5 -2
  3. package/dist/action/action.js +113 -6
  4. package/dist/action/action.js.map +1 -1
  5. package/dist/action/check.d.ts +15 -0
  6. package/dist/action/check.js +347 -0
  7. package/dist/action/check.js.map +1 -0
  8. package/dist/action/dispatch.d.ts +8 -0
  9. package/dist/action/dispatch.js +74 -0
  10. package/dist/action/dispatch.js.map +1 -0
  11. package/dist/action/docs.d.ts +4 -0
  12. package/dist/action/docs.js +236 -0
  13. package/dist/action/docs.js.map +1 -0
  14. package/dist/action/doctor.d.ts +5 -2
  15. package/dist/action/doctor.js +526 -74
  16. package/dist/action/doctor.js.map +1 -1
  17. package/dist/action/feature.js +96 -17
  18. package/dist/action/feature.js.map +1 -1
  19. package/dist/action/kind.d.ts +30 -0
  20. package/dist/action/kind.js +258 -0
  21. package/dist/action/kind.js.map +1 -0
  22. package/dist/action/package.d.ts +25 -0
  23. package/dist/action/package.js +852 -0
  24. package/dist/action/package.js.map +1 -0
  25. package/dist/action/resolve.d.ts +18 -0
  26. package/dist/action/resolve.js +280 -0
  27. package/dist/action/resolve.js.map +1 -0
  28. package/dist/action/target.d.ts +7 -1
  29. package/dist/action/target.js +240 -97
  30. package/dist/action/target.js.map +1 -1
  31. package/dist/cmp/Docs.d.ts +4 -0
  32. package/dist/cmp/Docs.js +98 -0
  33. package/dist/cmp/Docs.js.map +1 -0
  34. package/dist/cmp/ExternalDocs.d.ts +2 -0
  35. package/dist/cmp/ExternalDocs.js +43 -0
  36. package/dist/cmp/ExternalDocs.js.map +1 -0
  37. package/dist/helpers/definition.d.ts +5 -0
  38. package/dist/helpers/definition.js +72 -0
  39. package/dist/helpers/definition.js.map +1 -0
  40. package/dist/helpers/featureSource.d.ts +8 -2
  41. package/dist/helpers/featureSource.js +61 -12
  42. package/dist/helpers/featureSource.js.map +1 -1
  43. package/dist/helpers/junk.d.ts +11 -0
  44. package/dist/helpers/junk.js +149 -0
  45. package/dist/helpers/junk.js.map +1 -0
  46. package/dist/helpers/manifest.d.ts +50 -0
  47. package/dist/helpers/manifest.js +328 -0
  48. package/dist/helpers/manifest.js.map +1 -0
  49. package/dist/helpers/modelcheck.d.ts +22 -0
  50. package/dist/helpers/modelcheck.js +203 -0
  51. package/dist/helpers/modelcheck.js.map +1 -0
  52. package/dist/helpers/semver.d.ts +4 -0
  53. package/dist/helpers/semver.js +174 -0
  54. package/dist/helpers/semver.js.map +1 -0
  55. package/dist/helpers/shipped.d.ts +4 -0
  56. package/dist/helpers/shipped.js +36 -0
  57. package/dist/helpers/shipped.js.map +1 -0
  58. package/dist/helpers/stdrep.d.ts +9 -1
  59. package/dist/helpers/stdrep.js +22 -0
  60. package/dist/helpers/stdrep.js.map +1 -1
  61. package/dist/sdkgen.d.ts +15 -3
  62. package/dist/sdkgen.js +233 -67
  63. package/dist/sdkgen.js.map +1 -1
  64. package/dist/tsconfig.tsbuildinfo +1 -1
  65. package/dist/types.d.ts +10 -2
  66. package/dist/utility.js +17 -0
  67. package/dist/utility.js.map +1 -1
  68. package/model/sdkgen.aontu +69 -0
  69. package/package.json +3 -2
  70. package/project/.sdk/model/feature/audit.aontu +1 -0
  71. package/project/.sdk/model/feature/cache.aontu +1 -0
  72. package/project/.sdk/model/feature/clienttrack.aontu +1 -0
  73. package/project/.sdk/model/feature/debug.aontu +1 -0
  74. package/project/.sdk/model/feature/idempotency.aontu +1 -0
  75. package/project/.sdk/model/feature/log.aontu +1 -0
  76. package/project/.sdk/model/feature/metrics.aontu +1 -0
  77. package/project/.sdk/model/feature/netsim.aontu +1 -0
  78. package/project/.sdk/model/feature/paging.aontu +1 -0
  79. package/project/.sdk/model/feature/proxy.aontu +1 -0
  80. package/project/.sdk/model/feature/ratelimit.aontu +1 -0
  81. package/project/.sdk/model/feature/rbac.aontu +1 -0
  82. package/project/.sdk/model/feature/retry.aontu +1 -0
  83. package/project/.sdk/model/feature/streaming.aontu +1 -0
  84. package/project/.sdk/model/feature/telemetry.aontu +1 -0
  85. package/project/.sdk/model/feature/test.aontu +1 -0
  86. package/project/.sdk/model/feature/timeout.aontu +1 -0
  87. package/project/.sdk/model/target/c.aontu +1 -0
  88. package/project/.sdk/model/target/clojure.aontu +1 -0
  89. package/project/.sdk/model/target/cpp.aontu +1 -0
  90. package/project/.sdk/model/target/dart.aontu +1 -0
  91. package/project/.sdk/model/target/elixir.aontu +1 -0
  92. package/project/.sdk/model/target/go-cli.aontu +1 -0
  93. package/project/.sdk/model/target/go-mcp.aontu +1 -0
  94. package/project/.sdk/model/target/go.aontu +1 -0
  95. package/project/.sdk/model/target/haskell.aontu +1 -0
  96. package/project/.sdk/model/target/java.aontu +1 -0
  97. package/project/.sdk/model/target/js.aontu +1 -0
  98. package/project/.sdk/model/target/kotlin.aontu +1 -0
  99. package/project/.sdk/model/target/lean.aontu +1 -0
  100. package/project/.sdk/model/target/lua.aontu +1 -0
  101. package/project/.sdk/model/target/ocaml.aontu +1 -0
  102. package/project/.sdk/model/target/perl.aontu +1 -0
  103. package/project/.sdk/model/target/php.aontu +1 -0
  104. package/project/.sdk/model/target/py-data.aontu +1 -0
  105. package/project/.sdk/model/target/py.aontu +1 -0
  106. package/project/.sdk/model/target/rb.aontu +1 -0
  107. package/project/.sdk/model/target/rust.aontu +1 -0
  108. package/project/.sdk/model/target/scala.aontu +1 -0
  109. package/project/.sdk/model/target/seneca-provider.aontu +1 -0
  110. package/project/.sdk/model/target/zig.aontu +1 -0
  111. package/project/.sdk/src/cmp/c/Config_c.ts +44 -0
  112. package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +3 -1
  113. package/project/.sdk/src/cmp/clojure/Config_clojure.ts +37 -42
  114. package/project/.sdk/src/cmp/clojure/utility_clojure.ts +42 -0
  115. package/project/.sdk/src/cmp/cpp/Config_cpp.ts +18 -0
  116. package/project/.sdk/src/cmp/csharp/Config_csharp.ts +125 -52
  117. package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +3 -1
  118. package/project/.sdk/src/cmp/csharp/utility_csharp.ts +94 -6
  119. package/project/.sdk/src/cmp/dart/Config_dart.ts +43 -5
  120. package/project/.sdk/src/cmp/dart/fragment/Config.data.fragment.dart +74 -0
  121. package/project/.sdk/src/cmp/dart/fragment/Config.fragment.dart +6 -9
  122. package/project/.sdk/src/cmp/dart/fragment/Main.fragment.dart +16 -5
  123. package/project/.sdk/src/cmp/dart/utility_dart.ts +18 -0
  124. package/project/.sdk/src/cmp/elixir/Config_elixir.ts +128 -13
  125. package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +3 -1
  126. package/project/.sdk/src/cmp/elixir/utility_elixir.ts +6 -0
  127. package/project/.sdk/src/cmp/haskell/Config_haskell.ts +35 -52
  128. package/project/.sdk/src/cmp/haskell/Package_haskell.ts +1 -0
  129. package/project/.sdk/src/cmp/haskell/Test_haskell.ts +1 -1
  130. package/project/.sdk/src/cmp/haskell/utility_haskell.ts +15 -5
  131. package/project/.sdk/src/cmp/java/Config_java.ts +21 -0
  132. package/project/.sdk/src/cmp/kotlin/Config_kotlin.ts +15 -0
  133. package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +42 -39
  134. package/project/.sdk/src/cmp/perl/Config_perl.ts +15 -0
  135. package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +3 -1
  136. package/project/.sdk/src/cmp/rust/Config_rust.ts +44 -0
  137. package/project/.sdk/src/cmp/rust/fragment/Main.fragment.rs +4 -2
  138. package/project/.sdk/src/cmp/scala/Config_scala.ts +15 -0
  139. package/project/.sdk/src/cmp/swift/Config_swift.ts +17 -0
  140. package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +3 -1
  141. package/project/.sdk/src/cmp/zig/Config_zig.ts +44 -0
  142. package/project/.sdk/src/cmp/zig/TestEntity_zig.ts +9 -2
  143. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +3 -1
  144. package/project/.sdk/tm/c/core/sdk.h +1 -0
  145. package/project/.sdk/tm/c/utility/make_options.c +5 -1
  146. package/project/.sdk/tm/clojure/src/sdk/core.clj +51 -3
  147. package/project/.sdk/tm/cpp/core/types.hpp +4 -1
  148. package/project/.sdk/tm/cpp/utility/pipeline.hpp +5 -1
  149. package/project/.sdk/tm/csharp/test/PipelineTest.cs +15 -0
  150. package/project/.sdk/tm/csharp/utility/MakeOptions.cs +67 -1
  151. package/project/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +43 -0
  152. package/project/.sdk/tm/elixir/lib/projectname/utility.ex +58 -2
  153. package/project/.sdk/tm/haskell/{test/TestJson.hs → src/SdkJson.hs} +8 -4
  154. package/project/.sdk/tm/haskell/src/SdkRuntime.hs +55 -2
  155. package/project/.sdk/tm/haskell/test/Runner.hs +1 -1
  156. package/project/.sdk/tm/haskell/test/StructCorpus.hs +1 -1
  157. package/project/.sdk/tm/java/core/SdkClient.java +3 -1
  158. package/project/.sdk/tm/java/utility/MakeOptions.java +5 -1
  159. package/project/.sdk/tm/kotlin/core/SdkClient.kt +3 -1
  160. package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +5 -1
  161. package/project/.sdk/tm/ocaml/Makefile +3 -2
  162. package/project/.sdk/tm/ocaml/sdk_json.ml +106 -0
  163. package/project/.sdk/tm/ocaml/sdk_runtime.ml +56 -0
  164. package/project/.sdk/tm/ocaml/test/struct_corpus.ml +4 -86
  165. package/project/.sdk/tm/perl/utility/make_options.pm +5 -1
  166. package/project/.sdk/tm/rust/utility/make_options.rs +79 -1
  167. package/project/.sdk/tm/scala/core/SdkClient.scala +3 -1
  168. package/project/.sdk/tm/scala/utility/Make.scala +5 -1
  169. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +5 -1
  170. package/project/.sdk/tm/zig/core/utility.zig +85 -1
  171. package/project/sdkgen-package.json +57 -0
  172. package/src/action/action.ts +136 -6
  173. package/src/action/check.ts +495 -0
  174. package/src/action/dispatch.ts +105 -0
  175. package/src/action/docs.ts +310 -0
  176. package/src/action/doctor.ts +692 -81
  177. package/src/action/feature.ts +109 -17
  178. package/src/action/kind.ts +375 -0
  179. package/src/action/package.ts +1173 -0
  180. package/src/action/resolve.ts +362 -0
  181. package/src/action/target.ts +290 -108
  182. package/src/cmp/Docs.ts +125 -0
  183. package/src/cmp/ExternalDocs.ts +54 -0
  184. package/src/helpers/definition.ts +82 -0
  185. package/src/helpers/featureSource.ts +83 -13
  186. package/src/helpers/junk.ts +168 -0
  187. package/src/helpers/manifest.ts +474 -0
  188. package/src/helpers/modelcheck.ts +262 -0
  189. package/src/helpers/semver.ts +211 -0
  190. package/src/helpers/shipped.ts +41 -0
  191. package/src/helpers/stdrep.ts +70 -0
  192. package/src/sdkgen.ts +294 -66
  193. package/src/types.ts +33 -3
  194. package/src/utility.ts +17 -0
@@ -142,11 +142,39 @@ main: kit: contributor: &: {
142
142
  }
143
143
 
144
144
 
145
+ # PROVENANCE: where a copied target or feature came from.
146
+ #
147
+ # `target add` / `feature add` copy a shipped definition into a project and
148
+ # stamp these three keys into the copy, by rewriting the `base: 'BASE'` line
149
+ # the shipped file carries as an anchor:
150
+ #
151
+ # base the `.sdk` folder the copy came from, relative to the project
152
+ # (absolute only for an out-of-tree source). '/'-normalised, so a
153
+ # project resynced on Windows and on Linux records the same value.
154
+ # origname the name in the SOURCE, when installed under a different one
155
+ # (`target add go~go2` -> origname 'go'). Empty when they match.
156
+ # package the sdkgen package that provided it, when the source declared
157
+ # one. Empty otherwise.
158
+ #
159
+ # Read by `feature add` (to find each target's template tree) and by `doctor`
160
+ # (to re-resolve the scaffold a copy should be compared against). Without
161
+ # them both fall back to the bundled scaffold, which is right only while
162
+ # everything ships inside @voxgig/sdkgen.
163
+ #
164
+ # DEFAULTED, deliberately. A bare `string` inside a `&:` spread makes the key
165
+ # REQUIRED, which would fail the model compile of every project whose copies
166
+ # predate this — and `origname`/`package` are stamped only when they apply,
167
+ # so it would fail every ordinary install too. `*''` also keeps them FALSY
168
+ # when unset, which is what the two readers already test for.
145
169
  main: kit: target: &: {
146
170
  name: key()
147
171
  active: *true | boolean
148
172
  ext: string
149
173
  comment: line: string
174
+
175
+ base: *'' | string
176
+ origname: *'' | string
177
+ package: *'' | string
150
178
  module: {
151
179
  name: string
152
180
 
@@ -361,6 +389,11 @@ main: kit: feature: &: {
361
389
  active: *false | boolean
362
390
  title: string
363
391
 
392
+ # Provenance — see the note on `main: kit: target: &:` above.
393
+ base: *'' | string
394
+ origname: *'' | string
395
+ package: *'' | string
396
+
364
397
  # TODO: version '0.0.1' | semver # where semver is a string format type as per semver.org
365
398
  version: *'0.0.1' | string
366
399
 
@@ -401,3 +434,39 @@ main: kit: option: &: {
401
434
 
402
435
 
403
436
 
437
+ # DOCS ITEMS — the third kind. See docs/design/sdkgen-packages.md §20.
438
+ #
439
+ # A docs item is a generation target whose destination is a DOCUMENTATION
440
+ # SYSTEM rather than a language: a static site, a developer-portal catalogue,
441
+ # a hosted service's config. sdkgen ships the kind; the items live in
442
+ # packages, so this spread declares only what EVERY destination needs and
443
+ # leaves the rest to the item's own model file (an unknown key unifies fine).
444
+ #
445
+ # Deliberately NOT copied from the target spread: `ext`, `comment.line` and
446
+ # `module.name` are required there and have no honest value for a site
447
+ # emitting .md, .yml, .css and .svg at once. `title` is defaulted rather than
448
+ # required, so an author is never forced to invent one to make the model
449
+ # compile — the `module.name` trap of §10.1.
450
+ main: kit: docs: &: {
451
+ name: key()
452
+ active: *true | boolean
453
+ title: *'' | string
454
+
455
+ # Provenance — see the note on `main: kit: target: &:` above. Written by
456
+ # `docs add`, read by doctor, `package list` and `package update`.
457
+ base: *'' | string
458
+ origname: *'' | string
459
+ package: *'' | string
460
+
461
+ # Where the item generates. '' is in-tree, at `<sdk-repo>/<name>/`;
462
+ # anything else is its own generate() pass rooted there, exactly as for a
463
+ # target (see explanation/out-of-tree-targets). Out of tree is the normal
464
+ # case for a docs item: a documentation site usually has its own repo, and
465
+ # in-tree it would collide with the SDK repo's own README and workflows.
466
+ output: {
467
+ path: *'' | string
468
+ repo: *'' | string
469
+ adopt: *false | boolean
470
+ sdkrel: *'' | string
471
+ }
472
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@voxgig/sdkgen",
3
- "version": "3.4.7",
3
+ "version": "3.5.0",
4
4
  "main": "dist/sdkgen.js",
5
5
  "type": "commonjs",
6
6
  "engines": {
7
- "node": ">=22"
7
+ "node": ">=24"
8
8
  },
9
9
  "types": "dist/sdkgen.d.ts",
10
10
  "description": "Voxgig SDK Generator.",
@@ -24,6 +24,7 @@
24
24
  "scripts": {
25
25
  "test": "node --enable-source-maps --test dist-test/**/*.test.js",
26
26
  "test-some": "node --enable-source-maps --test-name-pattern=\"$npm_config_pattern\" --test dist-test/**/*.test.js",
27
+ "golden": "npm run build && SDKGEN_GOLDEN_UPDATE=1 node --test dist-test/characterize.test.js",
27
28
  "watch": "tsc --build src test -w",
28
29
  "build": "tsc --build src test && npm run check-scaffold && npm run stage-scaffold",
29
30
  "clean": "rm -rf dist dist-test node_modules yarn.lock package-lock.json",
@@ -5,6 +5,7 @@ main: kit: feature: audit: {
5
5
  title: "Structured audit trail of operations"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: cache: {
5
5
  title: "Response caching for safe read requests"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: clienttrack: {
5
5
  title: "Client identity and per-request correlation headers"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: debug: {
5
5
  title: "Request/response capture ring buffer for debugging"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: idempotency: {
5
5
  title: "Idempotency keys for safe retries of mutating operations"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: log: {
5
5
  title: "Structured request and response logging"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
 
10
11
  config: {
@@ -5,6 +5,7 @@ main: kit: feature: metrics: {
5
5
  title: "Statistics capture: per-operation counters and latency"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: netsim: {
5
5
  title: "Network behaviour simulation for offline testing (latency, failures, outages)"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  # Test-support feature: enable per test via
@@ -5,6 +5,7 @@ main: kit: feature: paging: {
5
5
  title: "Pagination signals for list operations"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: proxy: {
5
5
  title: "Outbound HTTP(S) proxy routing"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: ratelimit: {
5
5
  title: "Client-side rate limiting via a token bucket"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: rbac: {
5
5
  title: "Client-side role/permission enforcement"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: retry: {
5
5
  title: "Automatic retry of transient failures with exponential backoff"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  # Opt-in: enable per SDK via options.feature.retry.active = true
@@ -5,6 +5,7 @@ main: kit: feature: streaming: {
5
5
  title: "Incremental streaming of list results via async iteration"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: telemetry: {
5
5
  title: "Distributed tracing spans with W3C trace-context propagation"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: feature: test: {
5
5
  title: "In-memory mock transport for testing without a live server"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  # Test mode is not active by default, unlike most features
@@ -5,6 +5,7 @@ main: kit: feature: timeout: {
5
5
  title: "Per-request timeout with transport abort"
6
6
  version: '0.0.1'
7
7
  active: true
8
+ base: 'BASE'
8
9
 
9
10
  config: {
10
11
  options: {
@@ -5,6 +5,7 @@ main: kit: target: c: {
5
5
  ext: c
6
6
  comment: line: "//"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -5,6 +5,7 @@ main: kit: target: clojure: {
5
5
  ext: clj
6
6
  comment: line: ";"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -5,6 +5,7 @@ main: kit: target: cpp: {
5
5
  ext: hpp
6
6
  comment: line: "//"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -4,6 +4,7 @@ main: kit: target: dart: {
4
4
  ext: dart
5
5
  comment: line: "//"
6
6
  module: name: '$$name$$'
7
+ base: 'BASE'
7
8
  srcfeature: false
8
9
 
9
10
  deps: &: {
@@ -5,6 +5,7 @@ main: kit: target: elixir: {
5
5
  ext: ex
6
6
  comment: line: "#"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -11,6 +11,7 @@ main: kit: target: 'go-cli': {
11
11
  ext: go
12
12
  comment: line: "//"
13
13
  module: name: '$$name$$'
14
+ base: 'BASE'
14
15
 
15
16
  # Per-generation-phase activation. Mirrors the feature pattern
16
17
  # (`main.kit.feature.<name>: { active: true }`). Root.ts inspects
@@ -11,6 +11,7 @@ main: kit: target: 'go-mcp': {
11
11
  ext: go
12
12
  comment: line: "//"
13
13
  module: name: '$$name$$'
14
+ base: 'BASE'
14
15
 
15
16
  # Per-generation-phase activation. Mirrors go-cli — only Main runs.
16
17
  phase: {
@@ -5,6 +5,7 @@ main: kit: target: go: {
5
5
  ext: go
6
6
  comment: line: "//"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -5,6 +5,7 @@ main: kit: target: haskell: {
5
5
  ext: hs
6
6
  comment: line: "--"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  # Entities are generic (config-driven F.makeEntity), so no per-entity or
@@ -4,6 +4,7 @@ main: kit: target: java: {
4
4
  ext: java
5
5
  comment: line: "//"
6
6
  module: name: '$$name$$'
7
+ base: 'BASE'
7
8
  srcfeature: false
8
9
 
9
10
  deps: &: {
@@ -5,6 +5,7 @@ main: kit: target: js: {
5
5
  ext: js
6
6
  comment: line: "//"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
 
9
10
  deps: &: {
10
11
  # TODO: fix aontu disjunctions!
@@ -4,6 +4,7 @@ main: kit: target: kotlin: {
4
4
  ext: kt
5
5
  comment: line: "//"
6
6
  module: name: '$$name$$'
7
+ base: 'BASE'
7
8
  srcfeature: false
8
9
 
9
10
  deps: &: {
@@ -5,6 +5,7 @@ main: kit: target: lean: {
5
5
  ext: lean
6
6
  comment: line: "--"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  # Entities are generic (config-driven F.makeEntity), so no per-entity or
@@ -5,6 +5,7 @@ main: kit: target: lua: {
5
5
  ext: lua
6
6
  comment: line: "--"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -5,6 +5,7 @@ main: kit: target: ocaml: {
5
5
  ext: ml
6
6
  comment: line: "//"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -5,6 +5,7 @@ main: kit: target: perl: {
5
5
  ext: pl
6
6
  comment: line: "#"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -5,6 +5,7 @@ main: kit: target: php: {
5
5
  ext: php
6
6
  comment: line: "//"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -14,6 +14,7 @@ main: kit: target: 'py-data': {
14
14
  ext: py
15
15
  comment: line: "#"
16
16
  module: name: '$$name$$'
17
+ base: 'BASE'
17
18
  srcfeature: false
18
19
 
19
20
  # Per-generation-phase activation. Mirrors go-cli/go-mcp: every standard
@@ -5,6 +5,7 @@ main: kit: target: py: {
5
5
  ext: py
6
6
  comment: line: "#"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -5,6 +5,7 @@ main: kit: target: rb: {
5
5
  ext: rb
6
6
  comment: line: "#"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -5,6 +5,7 @@ main: kit: target: rust: {
5
5
  ext: rs
6
6
  comment: line: "//"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  deps: &: {
@@ -4,6 +4,7 @@ main: kit: target: scala: {
4
4
  ext: scala
5
5
  comment: line: "//"
6
6
  module: name: '$$name$$'
7
+ base: 'BASE'
7
8
  srcfeature: false
8
9
 
9
10
  deps: &: {
@@ -27,6 +27,7 @@ main: kit: target: 'seneca-provider': {
27
27
  ext: ts
28
28
  comment: line: "//"
29
29
  module: name: '$$name$$'
30
+ base: 'BASE'
30
31
  srcfeature: false
31
32
 
32
33
  # Per-generation-phase activation. Mirrors py-data: every standard phase is
@@ -5,6 +5,7 @@ main: kit: target: zig: {
5
5
  ext: zig
6
6
  comment: line: "//"
7
7
  module: name: '$$name$$'
8
+ base: 'BASE'
8
9
  srcfeature: false
9
10
 
10
11
  # The vendored voxgig struct port is in-tree (utility/voxgigstruct) — Zig
@@ -116,6 +116,28 @@ voxgig_value* make_config(void) {
116
116
  return json_parse(CONFIG_DATA);
117
117
  }
118
118
 
119
+ // SHARED CONFIG (sdkgen rung L2).
120
+ //
121
+ // The SDK reads the config on every request and never writes to it, so one
122
+ // instance is shared by every client rather than rebuilt per client. Above the
123
+ // size threshold make_config re-parses the whole embedded JSON, so this is the
124
+ // difference between parsing the model once and once per client.
125
+ //
126
+ // Deliberately never freed: it lives for the life of the process, like any
127
+ // other program-lifetime singleton.
128
+ static voxgig_value* shared_config_val = NULL;
129
+
130
+ // The process-wide config, built once on first use.
131
+ //
132
+ // The returned value is SHARED: treat it as read-only. Callers that need to
133
+ // mutate should use make_config, which always returns a fresh copy.
134
+ voxgig_value* shared_config(void) {
135
+ if (NULL == shared_config_val) {
136
+ shared_config_val = make_config();
137
+ }
138
+ return shared_config_val;
139
+ }
140
+
119
141
  Feature* make_feature(const char* name) {
120
142
  `)
121
143
  }
@@ -131,6 +153,28 @@ voxgig_value* make_config(void) {
131
153
  return ${formatCValue(config, 1)};
132
154
  }
133
155
 
156
+ // SHARED CONFIG (sdkgen rung L2).
157
+ //
158
+ // The SDK reads the config on every request and never writes to it, so one
159
+ // instance is shared by every client rather than rebuilt per client. Above the
160
+ // size threshold make_config re-parses the whole embedded JSON, so this is the
161
+ // difference between parsing the model once and once per client.
162
+ //
163
+ // Deliberately never freed: it lives for the life of the process, like any
164
+ // other program-lifetime singleton.
165
+ static voxgig_value* shared_config_val = NULL;
166
+
167
+ // The process-wide config, built once on first use.
168
+ //
169
+ // The returned value is SHARED: treat it as read-only. Callers that need to
170
+ // mutate should use make_config, which always returns a fresh copy.
171
+ voxgig_value* shared_config(void) {
172
+ if (NULL == shared_config_val) {
173
+ shared_config_val = make_config();
174
+ }
175
+ return shared_config_val;
176
+ }
177
+
134
178
  Feature* make_feature(const char* name) {
135
179
  `)
136
180
  }
@@ -16,7 +16,9 @@ ProjectNameSDK* projectname_sdk_new(voxgig_value* options) {
16
16
  sdk->features_cap = 0;
17
17
  sdk->rootctx = NULL;
18
18
 
19
- voxgig_value* config = make_config();
19
+ /* The process-wide config (sdkgen rung L2): read-only on the request path,
20
+ * so every client shares one rather than rebuilding it. */
21
+ voxgig_value* config = shared_config();
20
22
 
21
23
  CtxSpec cs;
22
24
  memset(&cs, 0, sizeof(cs));