@voxgig/sdkgen 1.3.7 → 1.3.9

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 (1758) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/AgentGuide.d.ts +2 -0
  3. package/dist/cmp/AgentGuide.js +124 -0
  4. package/dist/cmp/AgentGuide.js.map +1 -0
  5. package/dist/cmp/AgentGuideContent.d.ts +25 -0
  6. package/dist/cmp/AgentGuideContent.js +248 -0
  7. package/dist/cmp/AgentGuideContent.js.map +1 -0
  8. package/dist/cmp/AgentGuideFeature.d.ts +2 -0
  9. package/dist/cmp/AgentGuideFeature.js +92 -0
  10. package/dist/cmp/AgentGuideFeature.js.map +1 -0
  11. package/dist/cmp/AgentGuideTop.d.ts +2 -0
  12. package/dist/cmp/AgentGuideTop.js +97 -0
  13. package/dist/cmp/AgentGuideTop.js.map +1 -0
  14. package/dist/cmp/ReadmeTop.js +16 -3
  15. package/dist/cmp/ReadmeTop.js.map +1 -1
  16. package/dist/sdkgen.d.ts +4 -1
  17. package/dist/sdkgen.js +8 -2
  18. package/dist/sdkgen.js.map +1 -1
  19. package/dist/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +1 -1
  21. package/project/.sdk/model/feature/audit.aontu +22 -0
  22. package/project/.sdk/model/feature/cache.aontu +23 -0
  23. package/project/.sdk/model/feature/clienttrack.aontu +20 -0
  24. package/project/.sdk/model/feature/debug.aontu +25 -0
  25. package/project/.sdk/model/feature/feature-index.aontu +20 -1
  26. package/project/.sdk/model/feature/idempotency.aontu +21 -0
  27. package/project/.sdk/model/feature/metrics.aontu +20 -0
  28. package/project/.sdk/model/feature/netsim.aontu +36 -0
  29. package/project/.sdk/model/feature/paging.aontu +23 -0
  30. package/project/.sdk/model/feature/proxy.aontu +23 -0
  31. package/project/.sdk/model/feature/ratelimit.aontu +21 -0
  32. package/project/.sdk/model/feature/rbac.aontu +24 -0
  33. package/project/.sdk/model/feature/retry.aontu +23 -0
  34. package/project/.sdk/model/feature/streaming.aontu +22 -0
  35. package/project/.sdk/model/feature/telemetry.aontu +21 -0
  36. package/project/.sdk/model/feature/timeout.aontu +18 -0
  37. package/project/.sdk/model/target/c.aontu +37 -0
  38. package/project/.sdk/model/target/clojure.aontu +36 -0
  39. package/project/.sdk/model/target/cpp.aontu +35 -0
  40. package/project/.sdk/model/target/csharp.aontu +35 -0
  41. package/project/.sdk/model/target/dart.aontu +34 -0
  42. package/project/.sdk/model/target/elixir.aontu +33 -0
  43. package/project/.sdk/model/target/go-cli.aontu +5 -4
  44. package/project/.sdk/model/target/go-mcp.aontu +5 -4
  45. package/project/.sdk/model/target/haskell.aontu +47 -0
  46. package/project/.sdk/model/target/java.aontu +37 -0
  47. package/project/.sdk/model/target/kotlin.aontu +37 -0
  48. package/project/.sdk/model/target/ocaml.aontu +36 -0
  49. package/project/.sdk/model/target/perl.aontu +37 -0
  50. package/project/.sdk/model/target/rust.aontu +37 -0
  51. package/project/.sdk/model/target/scala.aontu +37 -0
  52. package/project/.sdk/model/target/swift.aontu +35 -0
  53. package/project/.sdk/model/target/zig.aontu +27 -0
  54. package/project/.sdk/src/cmp/c/Config_c.ts +109 -0
  55. package/project/.sdk/src/cmp/c/EntityBase_c.ts +61 -0
  56. package/project/.sdk/src/cmp/c/EntityOperation_c.ts +41 -0
  57. package/project/.sdk/src/cmp/c/Entity_c.ts +85 -0
  58. package/project/.sdk/src/cmp/c/Gitignore_c.ts +29 -0
  59. package/project/.sdk/src/cmp/c/MainEntity_c.ts +31 -0
  60. package/project/.sdk/src/cmp/c/Main_c.ts +83 -0
  61. package/project/.sdk/src/cmp/c/Package_c.ts +17 -0
  62. package/project/.sdk/src/cmp/c/TestDirect_c.ts +227 -0
  63. package/project/.sdk/src/cmp/c/TestEntity_c.ts +82 -0
  64. package/project/.sdk/src/cmp/c/Test_c.ts +51 -0
  65. package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +265 -0
  66. package/project/.sdk/src/cmp/c/fragment/EntityCreateOp.fragment.c +27 -0
  67. package/project/.sdk/src/cmp/c/fragment/EntityListOp.fragment.c +24 -0
  68. package/project/.sdk/src/cmp/c/fragment/EntityLoadOp.fragment.c +29 -0
  69. package/project/.sdk/src/cmp/c/fragment/EntityRemoveOp.fragment.c +29 -0
  70. package/project/.sdk/src/cmp/c/fragment/EntityUpdateOp.fragment.c +29 -0
  71. package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +220 -0
  72. package/project/.sdk/src/cmp/c/tsconfig.json +15 -0
  73. package/project/.sdk/src/cmp/c/utility_c.ts +102 -0
  74. package/project/.sdk/src/cmp/clojure/Config_clojure.ts +94 -0
  75. package/project/.sdk/src/cmp/clojure/EntityOperation_clojure.ts +35 -0
  76. package/project/.sdk/src/cmp/clojure/Entity_clojure.ts +77 -0
  77. package/project/.sdk/src/cmp/clojure/Gitignore_clojure.ts +28 -0
  78. package/project/.sdk/src/cmp/clojure/MainEntity_clojure.ts +21 -0
  79. package/project/.sdk/src/cmp/clojure/Main_clojure.ts +88 -0
  80. package/project/.sdk/src/cmp/clojure/Package_clojure.ts +41 -0
  81. package/project/.sdk/src/cmp/clojure/Test_clojure.ts +120 -0
  82. package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +158 -0
  83. package/project/.sdk/src/cmp/clojure/fragment/EntityCreateOp.fragment.clj +14 -0
  84. package/project/.sdk/src/cmp/clojure/fragment/EntityListOp.fragment.clj +17 -0
  85. package/project/.sdk/src/cmp/clojure/fragment/EntityLoadOp.fragment.clj +15 -0
  86. package/project/.sdk/src/cmp/clojure/fragment/EntityRemoveOp.fragment.clj +15 -0
  87. package/project/.sdk/src/cmp/clojure/fragment/EntityUpdateOp.fragment.clj +15 -0
  88. package/project/.sdk/src/cmp/clojure/tsconfig.json +15 -0
  89. package/project/.sdk/src/cmp/clojure/utility_clojure.ts +82 -0
  90. package/project/.sdk/src/cmp/cpp/Config_cpp.ts +136 -0
  91. package/project/.sdk/src/cmp/cpp/EntityBase_cpp.ts +51 -0
  92. package/project/.sdk/src/cmp/cpp/EntityOperation_cpp.ts +37 -0
  93. package/project/.sdk/src/cmp/cpp/Entity_cpp.ts +78 -0
  94. package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +27 -0
  95. package/project/.sdk/src/cmp/cpp/MainEntity_cpp.ts +35 -0
  96. package/project/.sdk/src/cmp/cpp/Main_cpp.ts +84 -0
  97. package/project/.sdk/src/cmp/cpp/Package_cpp.ts +17 -0
  98. package/project/.sdk/src/cmp/cpp/TestDirect_cpp.ts +258 -0
  99. package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +454 -0
  100. package/project/.sdk/src/cmp/cpp/Test_cpp.ts +36 -0
  101. package/project/.sdk/src/cmp/cpp/fragment/Entity.fragment.cpp +40 -0
  102. package/project/.sdk/src/cmp/cpp/fragment/EntityCreateOp.fragment.cpp +22 -0
  103. package/project/.sdk/src/cmp/cpp/fragment/EntityListOp.fragment.cpp +21 -0
  104. package/project/.sdk/src/cmp/cpp/fragment/EntityLoadOp.fragment.cpp +25 -0
  105. package/project/.sdk/src/cmp/cpp/fragment/EntityRemoveOp.fragment.cpp +21 -0
  106. package/project/.sdk/src/cmp/cpp/fragment/EntityUpdateOp.fragment.cpp +22 -0
  107. package/project/.sdk/src/cmp/cpp/fragment/Main.fragment.cpp +43 -0
  108. package/project/.sdk/src/cmp/cpp/tsconfig.json +15 -0
  109. package/project/.sdk/src/cmp/cpp/utility_cpp.ts +83 -0
  110. package/project/.sdk/src/cmp/csharp/Config_csharp.ts +134 -0
  111. package/project/.sdk/src/cmp/csharp/EntityBase_csharp.ts +39 -0
  112. package/project/.sdk/src/cmp/csharp/EntityOperation_csharp.ts +41 -0
  113. package/project/.sdk/src/cmp/csharp/Entity_csharp.ts +85 -0
  114. package/project/.sdk/src/cmp/csharp/Gitignore_csharp.ts +38 -0
  115. package/project/.sdk/src/cmp/csharp/MainEntity_csharp.ts +36 -0
  116. package/project/.sdk/src/cmp/csharp/Main_csharp.ts +91 -0
  117. package/project/.sdk/src/cmp/csharp/Package_csharp.ts +101 -0
  118. package/project/.sdk/src/cmp/csharp/SdkError_csharp.ts +42 -0
  119. package/project/.sdk/src/cmp/csharp/TestDirect_csharp.ts +560 -0
  120. package/project/.sdk/src/cmp/csharp/TestEntity_csharp.ts +618 -0
  121. package/project/.sdk/src/cmp/csharp/Test_csharp.ts +38 -0
  122. package/project/.sdk/src/cmp/csharp/fragment/Entity.fragment.cs +28 -0
  123. package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +268 -0
  124. package/project/.sdk/src/cmp/csharp/fragment/EntityCreateOp.fragment.cs +37 -0
  125. package/project/.sdk/src/cmp/csharp/fragment/EntityListOp.fragment.cs +35 -0
  126. package/project/.sdk/src/cmp/csharp/fragment/EntityLoadOp.fragment.cs +41 -0
  127. package/project/.sdk/src/cmp/csharp/fragment/EntityRemoveOp.fragment.cs +41 -0
  128. package/project/.sdk/src/cmp/csharp/fragment/EntityUpdateOp.fragment.cs +41 -0
  129. package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +278 -0
  130. package/project/.sdk/src/cmp/csharp/fragment/SdkError.fragment.cs +21 -0
  131. package/project/.sdk/src/cmp/csharp/tsconfig.json +15 -0
  132. package/project/.sdk/src/cmp/csharp/utility_csharp.ts +143 -0
  133. package/project/.sdk/src/cmp/dart/Config_dart.ts +99 -0
  134. package/project/.sdk/src/cmp/dart/EntityBase_dart.ts +34 -0
  135. package/project/.sdk/src/cmp/dart/EntityOperation_dart.ts +43 -0
  136. package/project/.sdk/src/cmp/dart/EntityTypes_dart.ts +190 -0
  137. package/project/.sdk/src/cmp/dart/Entity_dart.ts +79 -0
  138. package/project/.sdk/src/cmp/dart/Gitignore_dart.ts +34 -0
  139. package/project/.sdk/src/cmp/dart/MainEntity_dart.ts +33 -0
  140. package/project/.sdk/src/cmp/dart/Main_dart.ts +105 -0
  141. package/project/.sdk/src/cmp/dart/Package_dart.ts +81 -0
  142. package/project/.sdk/src/cmp/dart/SdkError_dart.ts +42 -0
  143. package/project/.sdk/src/cmp/dart/TestDirect_dart.ts +498 -0
  144. package/project/.sdk/src/cmp/dart/TestEntity_dart.ts +552 -0
  145. package/project/.sdk/src/cmp/dart/Test_dart.ts +105 -0
  146. package/project/.sdk/src/cmp/dart/fragment/Config.fragment.dart +48 -0
  147. package/project/.sdk/src/cmp/dart/fragment/Direct.test.fragment.dart +25 -0
  148. package/project/.sdk/src/cmp/dart/fragment/Entity.fragment.dart +31 -0
  149. package/project/.sdk/src/cmp/dart/fragment/Entity.test.fragment.dart +67 -0
  150. package/project/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +285 -0
  151. package/project/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +90 -0
  152. package/project/.sdk/src/cmp/dart/fragment/EntityListOp.fragment.dart +90 -0
  153. package/project/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +94 -0
  154. package/project/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +94 -0
  155. package/project/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +94 -0
  156. package/project/.sdk/src/cmp/dart/fragment/Main.fragment.dart +240 -0
  157. package/project/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +18 -0
  158. package/project/.sdk/src/cmp/dart/tsconfig.json +15 -0
  159. package/project/.sdk/src/cmp/dart/utility_dart.ts +86 -0
  160. package/project/.sdk/src/cmp/elixir/Config_elixir.ts +101 -0
  161. package/project/.sdk/src/cmp/elixir/EntityOperation_elixir.ts +27 -0
  162. package/project/.sdk/src/cmp/elixir/Entity_elixir.ts +54 -0
  163. package/project/.sdk/src/cmp/elixir/Gitignore_elixir.ts +28 -0
  164. package/project/.sdk/src/cmp/elixir/MainEntity_elixir.ts +26 -0
  165. package/project/.sdk/src/cmp/elixir/Main_elixir.ts +124 -0
  166. package/project/.sdk/src/cmp/elixir/Package_elixir.ts +64 -0
  167. package/project/.sdk/src/cmp/elixir/TestDirect_elixir.ts +95 -0
  168. package/project/.sdk/src/cmp/elixir/TestEntity_elixir.ts +115 -0
  169. package/project/.sdk/src/cmp/elixir/Test_elixir.ts +47 -0
  170. package/project/.sdk/src/cmp/elixir/fragment/Entity.fragment.ex +37 -0
  171. package/project/.sdk/src/cmp/elixir/fragment/EntityCreateOp.fragment.ex +28 -0
  172. package/project/.sdk/src/cmp/elixir/fragment/EntityListOp.fragment.ex +30 -0
  173. package/project/.sdk/src/cmp/elixir/fragment/EntityLoadOp.fragment.ex +32 -0
  174. package/project/.sdk/src/cmp/elixir/fragment/EntityRemoveOp.fragment.ex +32 -0
  175. package/project/.sdk/src/cmp/elixir/fragment/EntityUpdateOp.fragment.ex +30 -0
  176. package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +218 -0
  177. package/project/.sdk/src/cmp/elixir/fragment/Pipeline.fragment.ex +62 -0
  178. package/project/.sdk/src/cmp/elixir/tsconfig.json +15 -0
  179. package/project/.sdk/src/cmp/elixir/utility_elixir.ts +85 -0
  180. package/project/.sdk/src/cmp/go/TestEntity_go.ts +54 -0
  181. package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +133 -0
  182. package/project/.sdk/src/cmp/go/fragment/Main.fragment.go +14 -8
  183. package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +20 -2
  184. package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +42 -2
  185. package/project/.sdk/src/cmp/haskell/Config_haskell.ts +115 -0
  186. package/project/.sdk/src/cmp/haskell/Entity_haskell.ts +13 -0
  187. package/project/.sdk/src/cmp/haskell/Gitignore_haskell.ts +27 -0
  188. package/project/.sdk/src/cmp/haskell/Main_haskell.ts +123 -0
  189. package/project/.sdk/src/cmp/haskell/Package_haskell.ts +58 -0
  190. package/project/.sdk/src/cmp/haskell/Test_haskell.ts +263 -0
  191. package/project/.sdk/src/cmp/haskell/tsconfig.json +15 -0
  192. package/project/.sdk/src/cmp/haskell/utility_haskell.ts +105 -0
  193. package/project/.sdk/src/cmp/java/Config_java.ts +138 -0
  194. package/project/.sdk/src/cmp/java/EntityBase_java.ts +50 -0
  195. package/project/.sdk/src/cmp/java/EntityOperation_java.ts +48 -0
  196. package/project/.sdk/src/cmp/java/Entity_java.ts +95 -0
  197. package/project/.sdk/src/cmp/java/Gitignore_java.ts +37 -0
  198. package/project/.sdk/src/cmp/java/MainEntity_java.ts +41 -0
  199. package/project/.sdk/src/cmp/java/Main_java.ts +100 -0
  200. package/project/.sdk/src/cmp/java/Package_java.ts +126 -0
  201. package/project/.sdk/src/cmp/java/SdkError_java.ts +49 -0
  202. package/project/.sdk/src/cmp/java/TestDirect_java.ts +509 -0
  203. package/project/.sdk/src/cmp/java/TestEntity_java.ts +599 -0
  204. package/project/.sdk/src/cmp/java/Test_java.ts +42 -0
  205. package/project/.sdk/src/cmp/java/fragment/Entity.fragment.java +35 -0
  206. package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +235 -0
  207. package/project/.sdk/src/cmp/java/fragment/EntityCreateOp.fragment.java +42 -0
  208. package/project/.sdk/src/cmp/java/fragment/EntityListOp.fragment.java +39 -0
  209. package/project/.sdk/src/cmp/java/fragment/EntityLoadOp.fragment.java +45 -0
  210. package/project/.sdk/src/cmp/java/fragment/EntityRemoveOp.fragment.java +45 -0
  211. package/project/.sdk/src/cmp/java/fragment/EntityUpdateOp.fragment.java +45 -0
  212. package/project/.sdk/src/cmp/java/fragment/Main.fragment.java +34 -0
  213. package/project/.sdk/src/cmp/java/fragment/SdkError.fragment.java +27 -0
  214. package/project/.sdk/src/cmp/java/tsconfig.json +15 -0
  215. package/project/.sdk/src/cmp/java/utility_java.ts +102 -0
  216. package/project/.sdk/src/cmp/js/Config_js.ts +4 -2
  217. package/project/.sdk/src/cmp/js/TestEntity_js.ts +1 -0
  218. package/project/.sdk/src/cmp/js/fragment/Entity.test.fragment.js +32 -1
  219. package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +81 -0
  220. package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +10 -5
  221. package/project/.sdk/src/cmp/kotlin/Config_kotlin.ts +128 -0
  222. package/project/.sdk/src/cmp/kotlin/EntityBase_kotlin.ts +50 -0
  223. package/project/.sdk/src/cmp/kotlin/EntityOperation_kotlin.ts +48 -0
  224. package/project/.sdk/src/cmp/kotlin/Entity_kotlin.ts +93 -0
  225. package/project/.sdk/src/cmp/kotlin/Gitignore_kotlin.ts +41 -0
  226. package/project/.sdk/src/cmp/kotlin/MainEntity_kotlin.ts +40 -0
  227. package/project/.sdk/src/cmp/kotlin/Main_kotlin.ts +94 -0
  228. package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +110 -0
  229. package/project/.sdk/src/cmp/kotlin/SdkError_kotlin.ts +48 -0
  230. package/project/.sdk/src/cmp/kotlin/TestDirect_kotlin.ts +479 -0
  231. package/project/.sdk/src/cmp/kotlin/TestEntity_kotlin.ts +567 -0
  232. package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +42 -0
  233. package/project/.sdk/src/cmp/kotlin/fragment/Entity.fragment.kt +28 -0
  234. package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +195 -0
  235. package/project/.sdk/src/cmp/kotlin/fragment/EntityCreateOp.fragment.kt +37 -0
  236. package/project/.sdk/src/cmp/kotlin/fragment/EntityListOp.fragment.kt +34 -0
  237. package/project/.sdk/src/cmp/kotlin/fragment/EntityLoadOp.fragment.kt +40 -0
  238. package/project/.sdk/src/cmp/kotlin/fragment/EntityRemoveOp.fragment.kt +40 -0
  239. package/project/.sdk/src/cmp/kotlin/fragment/EntityUpdateOp.fragment.kt +40 -0
  240. package/project/.sdk/src/cmp/kotlin/fragment/Main.fragment.kt +28 -0
  241. package/project/.sdk/src/cmp/kotlin/fragment/SdkError.fragment.kt +24 -0
  242. package/project/.sdk/src/cmp/kotlin/tsconfig.json +15 -0
  243. package/project/.sdk/src/cmp/kotlin/utility_kotlin.ts +101 -0
  244. package/project/.sdk/src/cmp/lua/Entity_lua.ts +7 -2
  245. package/project/.sdk/src/cmp/lua/TestEntity_lua.ts +47 -0
  246. package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +137 -0
  247. package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +9 -6
  248. package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +114 -0
  249. package/project/.sdk/src/cmp/ocaml/EntityOperation_ocaml.ts +63 -0
  250. package/project/.sdk/src/cmp/ocaml/Entity_ocaml.ts +152 -0
  251. package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +37 -0
  252. package/project/.sdk/src/cmp/ocaml/MainEntity_ocaml.ts +28 -0
  253. package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +111 -0
  254. package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +47 -0
  255. package/project/.sdk/src/cmp/ocaml/SdkError_ocaml.ts +42 -0
  256. package/project/.sdk/src/cmp/ocaml/TestDirect_ocaml.ts +47 -0
  257. package/project/.sdk/src/cmp/ocaml/TestEntity_ocaml.ts +130 -0
  258. package/project/.sdk/src/cmp/ocaml/Test_ocaml.ts +35 -0
  259. package/project/.sdk/src/cmp/ocaml/fragment/RunOp.fragment.ml +32 -0
  260. package/project/.sdk/src/cmp/ocaml/tsconfig.json +15 -0
  261. package/project/.sdk/src/cmp/ocaml/utility_ocaml.ts +129 -0
  262. package/project/.sdk/src/cmp/perl/Config_perl.ts +127 -0
  263. package/project/.sdk/src/cmp/perl/EntityOperation_perl.ts +42 -0
  264. package/project/.sdk/src/cmp/perl/Entity_perl.ts +84 -0
  265. package/project/.sdk/src/cmp/perl/Gitignore_perl.ts +32 -0
  266. package/project/.sdk/src/cmp/perl/MainEntity_perl.ts +34 -0
  267. package/project/.sdk/src/cmp/perl/Main_perl.ts +140 -0
  268. package/project/.sdk/src/cmp/perl/Package_perl.ts +63 -0
  269. package/project/.sdk/src/cmp/perl/TestDirect_perl.ts +433 -0
  270. package/project/.sdk/src/cmp/perl/TestEntity_perl.ts +515 -0
  271. package/project/.sdk/src/cmp/perl/Test_perl.ts +54 -0
  272. package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +235 -0
  273. package/project/.sdk/src/cmp/perl/fragment/EntityCreateOp.fragment.pm +31 -0
  274. package/project/.sdk/src/cmp/perl/fragment/EntityListOp.fragment.pm +43 -0
  275. package/project/.sdk/src/cmp/perl/fragment/EntityLoadOp.fragment.pm +34 -0
  276. package/project/.sdk/src/cmp/perl/fragment/EntityRemoveOp.fragment.pm +32 -0
  277. package/project/.sdk/src/cmp/perl/fragment/EntityUpdateOp.fragment.pm +32 -0
  278. package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +263 -0
  279. package/project/.sdk/src/cmp/perl/fragment/SdkError.fragment.pm +27 -0
  280. package/project/.sdk/src/cmp/perl/tsconfig.json +15 -0
  281. package/project/.sdk/src/cmp/perl/utility_perl.ts +30 -0
  282. package/project/.sdk/src/cmp/php/TestEntity_php.ts +45 -0
  283. package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +124 -0
  284. package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +13 -6
  285. package/project/.sdk/src/cmp/py/Entity_py.ts +8 -2
  286. package/project/.sdk/src/cmp/py/TestEntity_py.ts +40 -0
  287. package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +135 -28
  288. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +9 -6
  289. package/project/.sdk/src/cmp/rb/Entity_rb.ts +8 -2
  290. package/project/.sdk/src/cmp/rb/ReadmeExamplesTest_rb.ts +4 -1
  291. package/project/.sdk/src/cmp/rb/TestEntity_rb.ts +42 -0
  292. package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +122 -23
  293. package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +9 -6
  294. package/project/.sdk/src/cmp/rust/Config_rust.ts +118 -0
  295. package/project/.sdk/src/cmp/rust/EntityBase_rust.ts +59 -0
  296. package/project/.sdk/src/cmp/rust/EntityOperation_rust.ts +44 -0
  297. package/project/.sdk/src/cmp/rust/Entity_rust.ts +94 -0
  298. package/project/.sdk/src/cmp/rust/Gitignore_rust.ts +29 -0
  299. package/project/.sdk/src/cmp/rust/MainEntity_rust.ts +37 -0
  300. package/project/.sdk/src/cmp/rust/Main_rust.ts +146 -0
  301. package/project/.sdk/src/cmp/rust/Package_rust.ts +80 -0
  302. package/project/.sdk/src/cmp/rust/SdkError_rust.ts +42 -0
  303. package/project/.sdk/src/cmp/rust/TestDirect_rust.ts +448 -0
  304. package/project/.sdk/src/cmp/rust/TestEntity_rust.ts +635 -0
  305. package/project/.sdk/src/cmp/rust/Test_rust.ts +51 -0
  306. package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +288 -0
  307. package/project/.sdk/src/cmp/rust/fragment/EntityCreateOp.fragment.rs +29 -0
  308. package/project/.sdk/src/cmp/rust/fragment/EntityListOp.fragment.rs +26 -0
  309. package/project/.sdk/src/cmp/rust/fragment/EntityLoadOp.fragment.rs +35 -0
  310. package/project/.sdk/src/cmp/rust/fragment/EntityRemoveOp.fragment.rs +35 -0
  311. package/project/.sdk/src/cmp/rust/fragment/EntityUpdateOp.fragment.rs +35 -0
  312. package/project/.sdk/src/cmp/rust/fragment/Main.fragment.rs +296 -0
  313. package/project/.sdk/src/cmp/rust/fragment/SdkError.fragment.rs +34 -0
  314. package/project/.sdk/src/cmp/rust/tsconfig.json +15 -0
  315. package/project/.sdk/src/cmp/rust/utility_rust.ts +104 -0
  316. package/project/.sdk/src/cmp/scala/Config_scala.ts +126 -0
  317. package/project/.sdk/src/cmp/scala/EntityBase_scala.ts +50 -0
  318. package/project/.sdk/src/cmp/scala/EntityOperation_scala.ts +46 -0
  319. package/project/.sdk/src/cmp/scala/Entity_scala.ts +87 -0
  320. package/project/.sdk/src/cmp/scala/Gitignore_scala.ts +31 -0
  321. package/project/.sdk/src/cmp/scala/MainEntity_scala.ts +40 -0
  322. package/project/.sdk/src/cmp/scala/Main_scala.ts +93 -0
  323. package/project/.sdk/src/cmp/scala/Package_scala.ts +22 -0
  324. package/project/.sdk/src/cmp/scala/TestDirect_scala.ts +233 -0
  325. package/project/.sdk/src/cmp/scala/TestEntity_scala.ts +397 -0
  326. package/project/.sdk/src/cmp/scala/Test_scala.ts +93 -0
  327. package/project/.sdk/src/cmp/scala/fragment/Entity.fragment.scala +24 -0
  328. package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +169 -0
  329. package/project/.sdk/src/cmp/scala/fragment/EntityCreateOp.fragment.scala +32 -0
  330. package/project/.sdk/src/cmp/scala/fragment/EntityListOp.fragment.scala +28 -0
  331. package/project/.sdk/src/cmp/scala/fragment/EntityLoadOp.fragment.scala +33 -0
  332. package/project/.sdk/src/cmp/scala/fragment/EntityRemoveOp.fragment.scala +33 -0
  333. package/project/.sdk/src/cmp/scala/fragment/EntityUpdateOp.fragment.scala +33 -0
  334. package/project/.sdk/src/cmp/scala/fragment/Main.fragment.scala +27 -0
  335. package/project/.sdk/src/cmp/scala/tsconfig.json +15 -0
  336. package/project/.sdk/src/cmp/scala/utility_scala.ts +99 -0
  337. package/project/.sdk/src/cmp/swift/Config_swift.ts +127 -0
  338. package/project/.sdk/src/cmp/swift/EntityBase_swift.ts +38 -0
  339. package/project/.sdk/src/cmp/swift/EntityOperation_swift.ts +39 -0
  340. package/project/.sdk/src/cmp/swift/Entity_swift.ts +86 -0
  341. package/project/.sdk/src/cmp/swift/Gitignore_swift.ts +32 -0
  342. package/project/.sdk/src/cmp/swift/MainEntity_swift.ts +35 -0
  343. package/project/.sdk/src/cmp/swift/Main_swift.ts +94 -0
  344. package/project/.sdk/src/cmp/swift/Package_swift.ts +66 -0
  345. package/project/.sdk/src/cmp/swift/SdkError_swift.ts +41 -0
  346. package/project/.sdk/src/cmp/swift/TestDirect_swift.ts +84 -0
  347. package/project/.sdk/src/cmp/swift/TestEntity_swift.ts +84 -0
  348. package/project/.sdk/src/cmp/swift/Test_swift.ts +39 -0
  349. package/project/.sdk/src/cmp/swift/fragment/Entity.fragment.swift +23 -0
  350. package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +202 -0
  351. package/project/.sdk/src/cmp/swift/fragment/EntityCreateOp.fragment.swift +23 -0
  352. package/project/.sdk/src/cmp/swift/fragment/EntityListOp.fragment.swift +21 -0
  353. package/project/.sdk/src/cmp/swift/fragment/EntityLoadOp.fragment.swift +24 -0
  354. package/project/.sdk/src/cmp/swift/fragment/EntityRemoveOp.fragment.swift +24 -0
  355. package/project/.sdk/src/cmp/swift/fragment/EntityUpdateOp.fragment.swift +24 -0
  356. package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +211 -0
  357. package/project/.sdk/src/cmp/swift/fragment/SdkError.fragment.swift +22 -0
  358. package/project/.sdk/src/cmp/swift/tsconfig.json +15 -0
  359. package/project/.sdk/src/cmp/swift/utility_swift.ts +76 -0
  360. package/project/.sdk/src/cmp/ts/Config_ts.ts +4 -2
  361. package/project/.sdk/src/cmp/ts/Package_ts.ts +17 -2
  362. package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +81 -0
  363. package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +10 -5
  364. package/project/.sdk/src/cmp/zig/Config_zig.ts +113 -0
  365. package/project/.sdk/src/cmp/zig/EntityOperation_zig.ts +39 -0
  366. package/project/.sdk/src/cmp/zig/Entity_zig.ts +89 -0
  367. package/project/.sdk/src/cmp/zig/Gitignore_zig.ts +27 -0
  368. package/project/.sdk/src/cmp/zig/MainEntity_zig.ts +38 -0
  369. package/project/.sdk/src/cmp/zig/Main_zig.ts +78 -0
  370. package/project/.sdk/src/cmp/zig/Test_zig.ts +114 -0
  371. package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +278 -0
  372. package/project/.sdk/src/cmp/zig/fragment/EntityCreateOp.fragment.zig +24 -0
  373. package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +21 -0
  374. package/project/.sdk/src/cmp/zig/fragment/EntityLoadOp.fragment.zig +26 -0
  375. package/project/.sdk/src/cmp/zig/fragment/EntityRemoveOp.fragment.zig +26 -0
  376. package/project/.sdk/src/cmp/zig/fragment/EntityUpdateOp.fragment.zig +26 -0
  377. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +258 -0
  378. package/project/.sdk/src/cmp/zig/tsconfig.json +15 -0
  379. package/project/.sdk/src/cmp/zig/utility_zig.ts +95 -0
  380. package/project/.sdk/tm/c/LICENSE +22 -0
  381. package/project/.sdk/tm/c/Makefile +50 -0
  382. package/project/.sdk/tm/c/VERSION +1 -0
  383. package/project/.sdk/tm/c/core/context.c +145 -0
  384. package/project/.sdk/tm/c/core/control.c +19 -0
  385. package/project/.sdk/tm/c/core/error.c +24 -0
  386. package/project/.sdk/tm/c/core/helpers.c +228 -0
  387. package/project/.sdk/tm/c/core/operation.c +34 -0
  388. package/project/.sdk/tm/c/core/point.c +49 -0
  389. package/project/.sdk/tm/c/core/response.c +29 -0
  390. package/project/.sdk/tm/c/core/result.c +60 -0
  391. package/project/.sdk/tm/c/core/sdk.h +514 -0
  392. package/project/.sdk/tm/c/core/spec.c +94 -0
  393. package/project/.sdk/tm/c/core/utility.c +74 -0
  394. package/project/.sdk/tm/c/feature/audit.c +134 -0
  395. package/project/.sdk/tm/c/feature/base.c +40 -0
  396. package/project/.sdk/tm/c/feature/cache.c +262 -0
  397. package/project/.sdk/tm/c/feature/clienttrack.c +144 -0
  398. package/project/.sdk/tm/c/feature/debug.c +230 -0
  399. package/project/.sdk/tm/c/feature/idempotency.c +164 -0
  400. package/project/.sdk/tm/c/feature/log.c +79 -0
  401. package/project/.sdk/tm/c/feature/metrics.c +177 -0
  402. package/project/.sdk/tm/c/feature/netsim.c +211 -0
  403. package/project/.sdk/tm/c/feature/paging.c +223 -0
  404. package/project/.sdk/tm/c/feature/proxy.c +249 -0
  405. package/project/.sdk/tm/c/feature/ratelimit.c +124 -0
  406. package/project/.sdk/tm/c/feature/rbac.c +167 -0
  407. package/project/.sdk/tm/c/feature/retry.c +164 -0
  408. package/project/.sdk/tm/c/feature/streaming.c +147 -0
  409. package/project/.sdk/tm/c/feature/support.c +115 -0
  410. package/project/.sdk/tm/c/feature/telemetry.c +205 -0
  411. package/project/.sdk/tm/c/feature/test.c +385 -0
  412. package/project/.sdk/tm/c/feature/timeout.c +106 -0
  413. package/project/.sdk/tm/c/src/feature/README.md +1 -0
  414. package/project/.sdk/tm/c/src/feature/audit/.gitkeep +0 -0
  415. package/project/.sdk/tm/c/src/feature/base/.gitkeep +0 -0
  416. package/project/.sdk/tm/c/src/feature/cache/.gitkeep +0 -0
  417. package/project/.sdk/tm/c/src/feature/clienttrack/.gitkeep +0 -0
  418. package/project/.sdk/tm/c/src/feature/debug/.gitkeep +0 -0
  419. package/project/.sdk/tm/c/src/feature/idempotency/.gitkeep +0 -0
  420. package/project/.sdk/tm/c/src/feature/log/.gitkeep +0 -0
  421. package/project/.sdk/tm/c/src/feature/metrics/.gitkeep +0 -0
  422. package/project/.sdk/tm/c/src/feature/netsim/.gitkeep +0 -0
  423. package/project/.sdk/tm/c/src/feature/paging/.gitkeep +0 -0
  424. package/project/.sdk/tm/c/src/feature/proxy/.gitkeep +0 -0
  425. package/project/.sdk/tm/c/src/feature/ratelimit/.gitkeep +0 -0
  426. package/project/.sdk/tm/c/src/feature/rbac/.gitkeep +0 -0
  427. package/project/.sdk/tm/c/src/feature/retry/.gitkeep +0 -0
  428. package/project/.sdk/tm/c/src/feature/streaming/.gitkeep +0 -0
  429. package/project/.sdk/tm/c/src/feature/telemetry/.gitkeep +0 -0
  430. package/project/.sdk/tm/c/src/feature/test/.gitkeep +0 -0
  431. package/project/.sdk/tm/c/src/feature/timeout/.gitkeep +0 -0
  432. package/project/.sdk/tm/c/tests/ctest.h +58 -0
  433. package/project/.sdk/tm/c/tests/feature_harness.h +441 -0
  434. package/project/.sdk/tm/c/tests/feature_test.c +1210 -0
  435. package/project/.sdk/tm/c/tests/pipeline_test.c +561 -0
  436. package/project/.sdk/tm/c/tests/primary_utility_test.c +573 -0
  437. package/project/.sdk/tm/c/tests/runner.h +274 -0
  438. package/project/.sdk/tm/c/tests/sdk_pipeline_test.c +89 -0
  439. package/project/.sdk/tm/c/tests/struct_corpus_test.c +939 -0
  440. package/project/.sdk/tm/c/utility/clean.c +20 -0
  441. package/project/.sdk/tm/c/utility/done.c +26 -0
  442. package/project/.sdk/tm/c/utility/feature_add.c +42 -0
  443. package/project/.sdk/tm/c/utility/feature_hook.c +22 -0
  444. package/project/.sdk/tm/c/utility/feature_init.c +22 -0
  445. package/project/.sdk/tm/c/utility/fetcher.c +78 -0
  446. package/project/.sdk/tm/c/utility/jsonparse.c +11 -0
  447. package/project/.sdk/tm/c/utility/make_context.c +7 -0
  448. package/project/.sdk/tm/c/utility/make_error.c +66 -0
  449. package/project/.sdk/tm/c/utility/make_fetch_def.c +43 -0
  450. package/project/.sdk/tm/c/utility/make_options.c +179 -0
  451. package/project/.sdk/tm/c/utility/make_point.c +109 -0
  452. package/project/.sdk/tm/c/utility/make_request.c +62 -0
  453. package/project/.sdk/tm/c/utility/make_response.c +45 -0
  454. package/project/.sdk/tm/c/utility/make_result.c +61 -0
  455. package/project/.sdk/tm/c/utility/make_spec.c +60 -0
  456. package/project/.sdk/tm/c/utility/make_url.c +88 -0
  457. package/project/.sdk/tm/c/utility/param.c +58 -0
  458. package/project/.sdk/tm/c/utility/prepare_auth.c +65 -0
  459. package/project/.sdk/tm/c/utility/prepare_body.c +12 -0
  460. package/project/.sdk/tm/c/utility/prepare_headers.c +13 -0
  461. package/project/.sdk/tm/c/utility/prepare_method.c +16 -0
  462. package/project/.sdk/tm/c/utility/prepare_params.c +30 -0
  463. package/project/.sdk/tm/c/utility/prepare_path.c +17 -0
  464. package/project/.sdk/tm/c/utility/prepare_query.c +37 -0
  465. package/project/.sdk/tm/c/utility/result_basic.c +43 -0
  466. package/project/.sdk/tm/c/utility/result_body.c +17 -0
  467. package/project/.sdk/tm/c/utility/result_headers.c +17 -0
  468. package/project/.sdk/tm/c/utility/struct/inject.c +703 -0
  469. package/project/.sdk/tm/c/utility/struct/re_util.c +221 -0
  470. package/project/.sdk/tm/c/utility/struct/regex.c +1103 -0
  471. package/project/.sdk/tm/c/utility/struct/regex.h +84 -0
  472. package/project/.sdk/tm/c/utility/struct/transform.c +2224 -0
  473. package/project/.sdk/tm/c/utility/struct/utility.c +1971 -0
  474. package/project/.sdk/tm/c/utility/struct/value.c +640 -0
  475. package/project/.sdk/tm/c/utility/struct/value.h +273 -0
  476. package/project/.sdk/tm/c/utility/struct/value_io.c +366 -0
  477. package/project/.sdk/tm/c/utility/struct/value_io.h +31 -0
  478. package/project/.sdk/tm/c/utility/struct/voxgig_struct.h +216 -0
  479. package/project/.sdk/tm/c/utility/transform_request.c +21 -0
  480. package/project/.sdk/tm/c/utility/transform_response.c +36 -0
  481. package/project/.sdk/tm/clojure/LICENSE +22 -0
  482. package/project/.sdk/tm/clojure/Makefile +15 -0
  483. package/project/.sdk/tm/clojure/VERSION +1 -0
  484. package/project/.sdk/tm/clojure/src/feature/README.md +1 -0
  485. package/project/.sdk/tm/clojure/src/feature/audit/.gitkeep +0 -0
  486. package/project/.sdk/tm/clojure/src/feature/base/.gitkeep +0 -0
  487. package/project/.sdk/tm/clojure/src/feature/cache/.gitkeep +0 -0
  488. package/project/.sdk/tm/clojure/src/feature/clienttrack/.gitkeep +0 -0
  489. package/project/.sdk/tm/clojure/src/feature/debug/.gitkeep +0 -0
  490. package/project/.sdk/tm/clojure/src/feature/idempotency/.gitkeep +0 -0
  491. package/project/.sdk/tm/clojure/src/feature/log/.gitkeep +0 -0
  492. package/project/.sdk/tm/clojure/src/feature/metrics/.gitkeep +0 -0
  493. package/project/.sdk/tm/clojure/src/feature/netsim/.gitkeep +0 -0
  494. package/project/.sdk/tm/clojure/src/feature/paging/.gitkeep +0 -0
  495. package/project/.sdk/tm/clojure/src/feature/proxy/.gitkeep +0 -0
  496. package/project/.sdk/tm/clojure/src/feature/ratelimit/.gitkeep +0 -0
  497. package/project/.sdk/tm/clojure/src/feature/rbac/.gitkeep +0 -0
  498. package/project/.sdk/tm/clojure/src/feature/retry/.gitkeep +0 -0
  499. package/project/.sdk/tm/clojure/src/feature/streaming/.gitkeep +0 -0
  500. package/project/.sdk/tm/clojure/src/feature/telemetry/.gitkeep +0 -0
  501. package/project/.sdk/tm/clojure/src/feature/test/.gitkeep +0 -0
  502. package/project/.sdk/tm/clojure/src/feature/timeout/.gitkeep +0 -0
  503. package/project/.sdk/tm/clojure/src/sdk/client.clj +119 -0
  504. package/project/.sdk/tm/clojure/src/sdk/core.clj +901 -0
  505. package/project/.sdk/tm/clojure/src/sdk/features.clj +1027 -0
  506. package/project/.sdk/tm/clojure/src/voxgig/struct.clj +1734 -0
  507. package/project/.sdk/tm/clojure/test/sdk/test/feature.clj +596 -0
  508. package/project/.sdk/tm/clojure/test/sdk/test/netsim.clj +42 -0
  509. package/project/.sdk/tm/clojure/test/sdk/test/pipeline.clj +314 -0
  510. package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +52 -0
  511. package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +337 -0
  512. package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +39 -0
  513. package/project/.sdk/tm/clojure/test/sdk/testutil.clj +35 -0
  514. package/project/.sdk/tm/cpp/LICENSE +22 -0
  515. package/project/.sdk/tm/cpp/Makefile +36 -0
  516. package/project/.sdk/tm/cpp/VERSION +1 -0
  517. package/project/.sdk/tm/cpp/core/sdk.hpp +16 -0
  518. package/project/.sdk/tm/cpp/core/struct.hpp +225 -0
  519. package/project/.sdk/tm/cpp/core/types.hpp +1105 -0
  520. package/project/.sdk/tm/cpp/feature/audit.hpp +107 -0
  521. package/project/.sdk/tm/cpp/feature/base.hpp +34 -0
  522. package/project/.sdk/tm/cpp/feature/cache.hpp +189 -0
  523. package/project/.sdk/tm/cpp/feature/clienttrack.hpp +105 -0
  524. package/project/.sdk/tm/cpp/feature/debug.hpp +157 -0
  525. package/project/.sdk/tm/cpp/feature/idempotency.hpp +119 -0
  526. package/project/.sdk/tm/cpp/feature/log.hpp +90 -0
  527. package/project/.sdk/tm/cpp/feature/metrics.hpp +103 -0
  528. package/project/.sdk/tm/cpp/feature/netsim.hpp +152 -0
  529. package/project/.sdk/tm/cpp/feature/options.hpp +156 -0
  530. package/project/.sdk/tm/cpp/feature/paging.hpp +156 -0
  531. package/project/.sdk/tm/cpp/feature/proxy.hpp +145 -0
  532. package/project/.sdk/tm/cpp/feature/ratelimit.hpp +87 -0
  533. package/project/.sdk/tm/cpp/feature/rbac.hpp +108 -0
  534. package/project/.sdk/tm/cpp/feature/retry.hpp +130 -0
  535. package/project/.sdk/tm/cpp/feature/streaming.hpp +98 -0
  536. package/project/.sdk/tm/cpp/feature/telemetry.hpp +139 -0
  537. package/project/.sdk/tm/cpp/feature/test.hpp +289 -0
  538. package/project/.sdk/tm/cpp/feature/timeout.hpp +88 -0
  539. package/project/.sdk/tm/cpp/src/feature/README.md +1 -0
  540. package/project/.sdk/tm/cpp/src/feature/audit/.gitkeep +0 -0
  541. package/project/.sdk/tm/cpp/src/feature/base/.gitkeep +0 -0
  542. package/project/.sdk/tm/cpp/src/feature/cache/.gitkeep +0 -0
  543. package/project/.sdk/tm/cpp/src/feature/clienttrack/.gitkeep +0 -0
  544. package/project/.sdk/tm/cpp/src/feature/debug/.gitkeep +0 -0
  545. package/project/.sdk/tm/cpp/src/feature/idempotency/.gitkeep +0 -0
  546. package/project/.sdk/tm/cpp/src/feature/log/.gitkeep +0 -0
  547. package/project/.sdk/tm/cpp/src/feature/metrics/.gitkeep +0 -0
  548. package/project/.sdk/tm/cpp/src/feature/netsim/.gitkeep +0 -0
  549. package/project/.sdk/tm/cpp/src/feature/paging/.gitkeep +0 -0
  550. package/project/.sdk/tm/cpp/src/feature/proxy/.gitkeep +0 -0
  551. package/project/.sdk/tm/cpp/src/feature/ratelimit/.gitkeep +0 -0
  552. package/project/.sdk/tm/cpp/src/feature/rbac/.gitkeep +0 -0
  553. package/project/.sdk/tm/cpp/src/feature/retry/.gitkeep +0 -0
  554. package/project/.sdk/tm/cpp/src/feature/streaming/.gitkeep +0 -0
  555. package/project/.sdk/tm/cpp/src/feature/telemetry/.gitkeep +0 -0
  556. package/project/.sdk/tm/cpp/src/feature/test/.gitkeep +0 -0
  557. package/project/.sdk/tm/cpp/src/feature/timeout/.gitkeep +0 -0
  558. package/project/.sdk/tm/cpp/test/custom_utility_test.cpp +57 -0
  559. package/project/.sdk/tm/cpp/test/exists_test.cpp +16 -0
  560. package/project/.sdk/tm/cpp/test/feature_test.cpp +911 -0
  561. package/project/.sdk/tm/cpp/test/harness.hpp +344 -0
  562. package/project/.sdk/tm/cpp/test/netsim_test.cpp +48 -0
  563. package/project/.sdk/tm/cpp/test/pipeline_test.cpp +526 -0
  564. package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +841 -0
  565. package/project/.sdk/tm/cpp/test/runner_support.hpp +437 -0
  566. package/project/.sdk/tm/cpp/test/sdk-test-control.json +19 -0
  567. package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +494 -0
  568. package/project/.sdk/tm/cpp/test/struct_runner.hpp +314 -0
  569. package/project/.sdk/tm/cpp/test/testlib.hpp +82 -0
  570. package/project/.sdk/tm/cpp/utility/pipeline.hpp +1054 -0
  571. package/project/.sdk/tm/cpp/utility/voxgigstruct/value.hpp +525 -0
  572. package/project/.sdk/tm/cpp/utility/voxgigstruct/value_io.hpp +315 -0
  573. package/project/.sdk/tm/cpp/utility/voxgigstruct/voxgig_struct.hpp +3379 -0
  574. package/project/.sdk/tm/csharp/LICENSE +22 -0
  575. package/project/.sdk/tm/csharp/Makefile +43 -0
  576. package/project/.sdk/tm/csharp/VERSION +1 -0
  577. package/project/.sdk/tm/csharp/core/Context.cs +257 -0
  578. package/project/.sdk/tm/csharp/core/Control.cs +17 -0
  579. package/project/.sdk/tm/csharp/core/Helpers.cs +61 -0
  580. package/project/.sdk/tm/csharp/core/Operation.cs +51 -0
  581. package/project/.sdk/tm/csharp/core/Point.cs +68 -0
  582. package/project/.sdk/tm/csharp/core/Response.cs +45 -0
  583. package/project/.sdk/tm/csharp/core/Result.cs +63 -0
  584. package/project/.sdk/tm/csharp/core/Spec.cs +81 -0
  585. package/project/.sdk/tm/csharp/core/Types.cs +21 -0
  586. package/project/.sdk/tm/csharp/core/Utility.cs +88 -0
  587. package/project/.sdk/tm/csharp/feature/AuditFeature.cs +116 -0
  588. package/project/.sdk/tm/csharp/feature/BaseFeature.cs +39 -0
  589. package/project/.sdk/tm/csharp/feature/CacheFeature.cs +186 -0
  590. package/project/.sdk/tm/csharp/feature/ClienttrackFeature.cs +103 -0
  591. package/project/.sdk/tm/csharp/feature/DebugFeature.cs +157 -0
  592. package/project/.sdk/tm/csharp/feature/FeatureOptions.cs +197 -0
  593. package/project/.sdk/tm/csharp/feature/IdempotencyFeature.cs +97 -0
  594. package/project/.sdk/tm/csharp/feature/LogFeature.cs +109 -0
  595. package/project/.sdk/tm/csharp/feature/MetricsFeature.cs +117 -0
  596. package/project/.sdk/tm/csharp/feature/NetsimFeature.cs +200 -0
  597. package/project/.sdk/tm/csharp/feature/PagingFeature.cs +187 -0
  598. package/project/.sdk/tm/csharp/feature/ProxyFeature.cs +138 -0
  599. package/project/.sdk/tm/csharp/feature/RatelimitFeature.cs +89 -0
  600. package/project/.sdk/tm/csharp/feature/RbacFeature.cs +124 -0
  601. package/project/.sdk/tm/csharp/feature/RetryFeature.cs +174 -0
  602. package/project/.sdk/tm/csharp/feature/StreamingFeature.cs +93 -0
  603. package/project/.sdk/tm/csharp/feature/TelemetryFeature.cs +145 -0
  604. package/project/.sdk/tm/csharp/feature/TestFeature.cs +368 -0
  605. package/project/.sdk/tm/csharp/feature/TimeoutFeature.cs +69 -0
  606. package/project/.sdk/tm/csharp/src/feature/README.md +1 -0
  607. package/project/.sdk/tm/csharp/src/feature/audit/.gitkeep +0 -0
  608. package/project/.sdk/tm/csharp/src/feature/base/.gitkeep +0 -0
  609. package/project/.sdk/tm/csharp/src/feature/cache/.gitkeep +0 -0
  610. package/project/.sdk/tm/csharp/src/feature/clienttrack/.gitkeep +0 -0
  611. package/project/.sdk/tm/csharp/src/feature/debug/.gitkeep +0 -0
  612. package/project/.sdk/tm/csharp/src/feature/idempotency/.gitkeep +0 -0
  613. package/project/.sdk/tm/csharp/src/feature/log/.gitkeep +0 -0
  614. package/project/.sdk/tm/csharp/src/feature/metrics/.gitkeep +0 -0
  615. package/project/.sdk/tm/csharp/src/feature/netsim/.gitkeep +0 -0
  616. package/project/.sdk/tm/csharp/src/feature/paging/.gitkeep +0 -0
  617. package/project/.sdk/tm/csharp/src/feature/proxy/.gitkeep +0 -0
  618. package/project/.sdk/tm/csharp/src/feature/ratelimit/.gitkeep +0 -0
  619. package/project/.sdk/tm/csharp/src/feature/rbac/.gitkeep +0 -0
  620. package/project/.sdk/tm/csharp/src/feature/retry/.gitkeep +0 -0
  621. package/project/.sdk/tm/csharp/src/feature/streaming/.gitkeep +0 -0
  622. package/project/.sdk/tm/csharp/src/feature/telemetry/.gitkeep +0 -0
  623. package/project/.sdk/tm/csharp/src/feature/test/.gitkeep +0 -0
  624. package/project/.sdk/tm/csharp/src/feature/timeout/.gitkeep +0 -0
  625. package/project/.sdk/tm/csharp/test/CustomUtilityTest.cs +51 -0
  626. package/project/.sdk/tm/csharp/test/ExistsTest.cs +17 -0
  627. package/project/.sdk/tm/csharp/test/FeatureTest.cs +1653 -0
  628. package/project/.sdk/tm/csharp/test/NetsimTest.cs +67 -0
  629. package/project/.sdk/tm/csharp/test/PipelineTest.cs +605 -0
  630. package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +957 -0
  631. package/project/.sdk/tm/csharp/test/Runner.cs +626 -0
  632. package/project/.sdk/tm/csharp/test/StructRunner.cs +276 -0
  633. package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +1273 -0
  634. package/project/.sdk/tm/csharp/test/sdk-test-control.json +19 -0
  635. package/project/.sdk/tm/csharp/utility/Clean.cs +11 -0
  636. package/project/.sdk/tm/csharp/utility/Done.cs +28 -0
  637. package/project/.sdk/tm/csharp/utility/FeatureAdd.cs +54 -0
  638. package/project/.sdk/tm/csharp/utility/FeatureHook.cs +35 -0
  639. package/project/.sdk/tm/csharp/utility/FeatureInit.cs +28 -0
  640. package/project/.sdk/tm/csharp/utility/Fetcher.cs +181 -0
  641. package/project/.sdk/tm/csharp/utility/MakeContext.cs +11 -0
  642. package/project/.sdk/tm/csharp/utility/MakeError.cs +69 -0
  643. package/project/.sdk/tm/csharp/utility/MakeFetchDef.cs +38 -0
  644. package/project/.sdk/tm/csharp/utility/MakeOptions.cs +203 -0
  645. package/project/.sdk/tm/csharp/utility/MakePoint.cs +127 -0
  646. package/project/.sdk/tm/csharp/utility/MakeRequest.cs +87 -0
  647. package/project/.sdk/tm/csharp/utility/MakeResponse.cs +55 -0
  648. package/project/.sdk/tm/csharp/utility/MakeResult.cs +64 -0
  649. package/project/.sdk/tm/csharp/utility/MakeSpec.cs +64 -0
  650. package/project/.sdk/tm/csharp/utility/MakeUrl.cs +54 -0
  651. package/project/.sdk/tm/csharp/utility/Param.cs +67 -0
  652. package/project/.sdk/tm/csharp/utility/PrepareAuth.cs +54 -0
  653. package/project/.sdk/tm/csharp/utility/PrepareBody.cs +19 -0
  654. package/project/.sdk/tm/csharp/utility/PrepareHeaders.cs +22 -0
  655. package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +22 -0
  656. package/project/.sdk/tm/csharp/utility/PrepareParams.cs +38 -0
  657. package/project/.sdk/tm/csharp/utility/PreparePath.cs +18 -0
  658. package/project/.sdk/tm/csharp/utility/PrepareQuery.cs +40 -0
  659. package/project/.sdk/tm/csharp/utility/Register.cs +41 -0
  660. package/project/.sdk/tm/csharp/utility/ResultBasic.cs +39 -0
  661. package/project/.sdk/tm/csharp/utility/ResultBody.cs +22 -0
  662. package/project/.sdk/tm/csharp/utility/ResultHeaders.cs +26 -0
  663. package/project/.sdk/tm/csharp/utility/TransformRequest.cs +39 -0
  664. package/project/.sdk/tm/csharp/utility/TransformResponse.cs +53 -0
  665. package/project/.sdk/tm/csharp/utility/struct/Struct.cs +3582 -0
  666. package/project/.sdk/tm/dart/LICENSE +22 -0
  667. package/project/.sdk/tm/dart/Makefile +50 -0
  668. package/project/.sdk/tm/dart/lib/Context.dart +150 -0
  669. package/project/.sdk/tm/dart/lib/Control.dart +15 -0
  670. package/project/.sdk/tm/dart/lib/Operation.dart +31 -0
  671. package/project/.sdk/tm/dart/lib/Point.dart +43 -0
  672. package/project/.sdk/tm/dart/lib/Response.dart +32 -0
  673. package/project/.sdk/tm/dart/lib/Result.dart +39 -0
  674. package/project/.sdk/tm/dart/lib/Spec.dart +49 -0
  675. package/project/.sdk/tm/dart/lib/feature/audit/AuditFeature.dart +103 -0
  676. package/project/.sdk/tm/dart/lib/feature/base/BaseFeature.dart +76 -0
  677. package/project/.sdk/tm/dart/lib/feature/cache/CacheFeature.dart +152 -0
  678. package/project/.sdk/tm/dart/lib/feature/clienttrack/ClienttrackFeature.dart +104 -0
  679. package/project/.sdk/tm/dart/lib/feature/debug/DebugFeature.dart +153 -0
  680. package/project/.sdk/tm/dart/lib/feature/idempotency/IdempotencyFeature.dart +92 -0
  681. package/project/.sdk/tm/dart/lib/feature/log/LogFeature.dart +85 -0
  682. package/project/.sdk/tm/dart/lib/feature/metrics/MetricsFeature.dart +103 -0
  683. package/project/.sdk/tm/dart/lib/feature/netsim/NetsimFeature.dart +186 -0
  684. package/project/.sdk/tm/dart/lib/feature/paging/PagingFeature.dart +145 -0
  685. package/project/.sdk/tm/dart/lib/feature/proxy/ProxyFeature.dart +118 -0
  686. package/project/.sdk/tm/dart/lib/feature/ratelimit/RatelimitFeature.dart +103 -0
  687. package/project/.sdk/tm/dart/lib/feature/rbac/RbacFeature.dart +121 -0
  688. package/project/.sdk/tm/dart/lib/feature/retry/RetryFeature.dart +155 -0
  689. package/project/.sdk/tm/dart/lib/feature/streaming/StreamingFeature.dart +97 -0
  690. package/project/.sdk/tm/dart/lib/feature/telemetry/TelemetryFeature.dart +136 -0
  691. package/project/.sdk/tm/dart/lib/feature/test/TestFeature.dart +270 -0
  692. package/project/.sdk/tm/dart/lib/feature/timeout/TimeoutFeature.dart +104 -0
  693. package/project/.sdk/tm/dart/lib/utility/CleanUtility.dart +12 -0
  694. package/project/.sdk/tm/dart/lib/utility/DoneUtility.dart +18 -0
  695. package/project/.sdk/tm/dart/lib/utility/ErrUtility.dart +46 -0
  696. package/project/.sdk/tm/dart/lib/utility/FeatureAddUtility.dart +35 -0
  697. package/project/.sdk/tm/dart/lib/utility/FeatureHookUtility.dart +20 -0
  698. package/project/.sdk/tm/dart/lib/utility/FeatureInitUtility.dart +9 -0
  699. package/project/.sdk/tm/dart/lib/utility/FetcherUtility.dart +95 -0
  700. package/project/.sdk/tm/dart/lib/utility/MakeContextUtility.dart +6 -0
  701. package/project/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +67 -0
  702. package/project/.sdk/tm/dart/lib/utility/MakeFetchDefUtility.dart +42 -0
  703. package/project/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +147 -0
  704. package/project/.sdk/tm/dart/lib/utility/MakePointUtility.dart +84 -0
  705. package/project/.sdk/tm/dart/lib/utility/MakeRequestUtility.dart +63 -0
  706. package/project/.sdk/tm/dart/lib/utility/MakeResponseUtility.dart +54 -0
  707. package/project/.sdk/tm/dart/lib/utility/MakeResultUtility.dart +49 -0
  708. package/project/.sdk/tm/dart/lib/utility/MakeSpecUtility.dart +61 -0
  709. package/project/.sdk/tm/dart/lib/utility/MakeUrlUtility.dart +51 -0
  710. package/project/.sdk/tm/dart/lib/utility/ParamUtility.dart +56 -0
  711. package/project/.sdk/tm/dart/lib/utility/PrepareAuthUtility.dart +46 -0
  712. package/project/.sdk/tm/dart/lib/utility/PrepareBodyUtility.dart +19 -0
  713. package/project/.sdk/tm/dart/lib/utility/PrepareHeadersUtility.dart +11 -0
  714. package/project/.sdk/tm/dart/lib/utility/PrepareMethodUtility.dart +15 -0
  715. package/project/.sdk/tm/dart/lib/utility/PrepareParamsUtility.dart +23 -0
  716. package/project/.sdk/tm/dart/lib/utility/PreparePathUtility.dart +9 -0
  717. package/project/.sdk/tm/dart/lib/utility/PrepareQueryUtility.dart +18 -0
  718. package/project/.sdk/tm/dart/lib/utility/ResultBasicUtility.dart +29 -0
  719. package/project/.sdk/tm/dart/lib/utility/ResultBodyUtility.dart +15 -0
  720. package/project/.sdk/tm/dart/lib/utility/ResultHeadersUtility.dart +18 -0
  721. package/project/.sdk/tm/dart/lib/utility/StructUtility.dart +127 -0
  722. package/project/.sdk/tm/dart/lib/utility/TransformRequestUtility.dart +28 -0
  723. package/project/.sdk/tm/dart/lib/utility/TransformResponseUtility.dart +44 -0
  724. package/project/.sdk/tm/dart/lib/utility/Utility.dart +230 -0
  725. package/project/.sdk/tm/dart/lib/utility/voxgig_struct.dart +2456 -0
  726. package/project/.sdk/tm/dart/src/feature/README.md +3 -0
  727. package/project/.sdk/tm/dart/src/feature/audit/.gitkeep +0 -0
  728. package/project/.sdk/tm/dart/src/feature/base/.gitkeep +0 -0
  729. package/project/.sdk/tm/dart/src/feature/cache/.gitkeep +0 -0
  730. package/project/.sdk/tm/dart/src/feature/clienttrack/.gitkeep +0 -0
  731. package/project/.sdk/tm/dart/src/feature/debug/.gitkeep +0 -0
  732. package/project/.sdk/tm/dart/src/feature/idempotency/.gitkeep +0 -0
  733. package/project/.sdk/tm/dart/src/feature/log/.gitkeep +0 -0
  734. package/project/.sdk/tm/dart/src/feature/metrics/.gitkeep +0 -0
  735. package/project/.sdk/tm/dart/src/feature/netsim/.gitkeep +0 -0
  736. package/project/.sdk/tm/dart/src/feature/paging/.gitkeep +0 -0
  737. package/project/.sdk/tm/dart/src/feature/proxy/.gitkeep +0 -0
  738. package/project/.sdk/tm/dart/src/feature/ratelimit/.gitkeep +0 -0
  739. package/project/.sdk/tm/dart/src/feature/rbac/.gitkeep +0 -0
  740. package/project/.sdk/tm/dart/src/feature/retry/.gitkeep +0 -0
  741. package/project/.sdk/tm/dart/src/feature/streaming/.gitkeep +0 -0
  742. package/project/.sdk/tm/dart/src/feature/telemetry/.gitkeep +0 -0
  743. package/project/.sdk/tm/dart/src/feature/test/.gitkeep +0 -0
  744. package/project/.sdk/tm/dart/src/feature/timeout/.gitkeep +0 -0
  745. package/project/.sdk/tm/dart/test/custom_test.dart +65 -0
  746. package/project/.sdk/tm/dart/test/exists_test.dart +12 -0
  747. package/project/.sdk/tm/dart/test/feature/harness.dart +329 -0
  748. package/project/.sdk/tm/dart/test/feature_test.dart +1139 -0
  749. package/project/.sdk/tm/dart/test/harness.dart +153 -0
  750. package/project/.sdk/tm/dart/test/netsim_test.dart +48 -0
  751. package/project/.sdk/tm/dart/test/pipeline_test.dart +608 -0
  752. package/project/.sdk/tm/dart/test/primary_test.dart +411 -0
  753. package/project/.sdk/tm/dart/test/runner.dart +406 -0
  754. package/project/.sdk/tm/dart/test/sdk-test-control.json +19 -0
  755. package/project/.sdk/tm/dart/test/struct_corpus.dart +531 -0
  756. package/project/.sdk/tm/dart/test/struct_test.dart +41 -0
  757. package/project/.sdk/tm/dart/test/utility.dart +159 -0
  758. package/project/.sdk/tm/elixir/LICENSE +21 -0
  759. package/project/.sdk/tm/elixir/Makefile +15 -0
  760. package/project/.sdk/tm/elixir/VERSION +1 -0
  761. package/project/.sdk/tm/elixir/lib/projectname/context.ex +138 -0
  762. package/project/.sdk/tm/elixir/lib/projectname/core.ex +125 -0
  763. package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +155 -0
  764. package/project/.sdk/tm/elixir/lib/projectname/error.ex +16 -0
  765. package/project/.sdk/tm/elixir/lib/projectname/feature/audit.ex +125 -0
  766. package/project/.sdk/tm/elixir/lib/projectname/feature/cache.ex +170 -0
  767. package/project/.sdk/tm/elixir/lib/projectname/feature/clienttrack.ex +136 -0
  768. package/project/.sdk/tm/elixir/lib/projectname/feature/debug.ex +232 -0
  769. package/project/.sdk/tm/elixir/lib/projectname/feature/idempotency.ex +107 -0
  770. package/project/.sdk/tm/elixir/lib/projectname/feature/log.ex +62 -0
  771. package/project/.sdk/tm/elixir/lib/projectname/feature/metrics.ex +130 -0
  772. package/project/.sdk/tm/elixir/lib/projectname/feature/netsim.ex +213 -0
  773. package/project/.sdk/tm/elixir/lib/projectname/feature/paging.ex +191 -0
  774. package/project/.sdk/tm/elixir/lib/projectname/feature/proxy.ex +142 -0
  775. package/project/.sdk/tm/elixir/lib/projectname/feature/ratelimit.ex +81 -0
  776. package/project/.sdk/tm/elixir/lib/projectname/feature/rbac.ex +139 -0
  777. package/project/.sdk/tm/elixir/lib/projectname/feature/retry.ex +150 -0
  778. package/project/.sdk/tm/elixir/lib/projectname/feature/streaming.ex +107 -0
  779. package/project/.sdk/tm/elixir/lib/projectname/feature/telemetry.ex +172 -0
  780. package/project/.sdk/tm/elixir/lib/projectname/feature/test.ex +285 -0
  781. package/project/.sdk/tm/elixir/lib/projectname/feature/timeout.ex +64 -0
  782. package/project/.sdk/tm/elixir/lib/projectname/feature.ex +90 -0
  783. package/project/.sdk/tm/elixir/lib/projectname/helpers.ex +66 -0
  784. package/project/.sdk/tm/elixir/lib/projectname/json.ex +115 -0
  785. package/project/.sdk/tm/elixir/lib/projectname/utility.ex +1257 -0
  786. package/project/.sdk/tm/elixir/lib/utility/struct/voxgig_struct.ex +2615 -0
  787. package/project/.sdk/tm/elixir/src/feature/README.md +3 -0
  788. package/project/.sdk/tm/elixir/src/feature/audit/.gitkeep +0 -0
  789. package/project/.sdk/tm/elixir/src/feature/base/.gitkeep +0 -0
  790. package/project/.sdk/tm/elixir/src/feature/cache/.gitkeep +0 -0
  791. package/project/.sdk/tm/elixir/src/feature/clienttrack/.gitkeep +0 -0
  792. package/project/.sdk/tm/elixir/src/feature/debug/.gitkeep +0 -0
  793. package/project/.sdk/tm/elixir/src/feature/idempotency/.gitkeep +0 -0
  794. package/project/.sdk/tm/elixir/src/feature/log/.gitkeep +0 -0
  795. package/project/.sdk/tm/elixir/src/feature/metrics/.gitkeep +0 -0
  796. package/project/.sdk/tm/elixir/src/feature/netsim/.gitkeep +0 -0
  797. package/project/.sdk/tm/elixir/src/feature/paging/.gitkeep +0 -0
  798. package/project/.sdk/tm/elixir/src/feature/proxy/.gitkeep +0 -0
  799. package/project/.sdk/tm/elixir/src/feature/ratelimit/.gitkeep +0 -0
  800. package/project/.sdk/tm/elixir/src/feature/rbac/.gitkeep +0 -0
  801. package/project/.sdk/tm/elixir/src/feature/retry/.gitkeep +0 -0
  802. package/project/.sdk/tm/elixir/src/feature/streaming/.gitkeep +0 -0
  803. package/project/.sdk/tm/elixir/src/feature/telemetry/.gitkeep +0 -0
  804. package/project/.sdk/tm/elixir/src/feature/test/.gitkeep +0 -0
  805. package/project/.sdk/tm/elixir/src/feature/timeout/.gitkeep +0 -0
  806. package/project/.sdk/tm/elixir/test/feature_test.exs +879 -0
  807. package/project/.sdk/tm/elixir/test/netsim_test.exs +58 -0
  808. package/project/.sdk/tm/elixir/test/pipeline_test.exs +558 -0
  809. package/project/.sdk/tm/elixir/test/primary_utility_test.exs +133 -0
  810. package/project/.sdk/tm/elixir/test/stream_test.exs +119 -0
  811. package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +18 -0
  812. package/project/.sdk/tm/elixir/test/support/feature_harness.ex +346 -0
  813. package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +677 -0
  814. package/project/.sdk/tm/elixir/test/test_helper.exs +1 -0
  815. package/project/.sdk/tm/go/core/context.go +10 -0
  816. package/project/.sdk/tm/go/core/control.go +2 -0
  817. package/project/.sdk/tm/go/core/result.go +6 -0
  818. package/project/.sdk/tm/go/core/types.go +1 -0
  819. package/project/.sdk/tm/go/feature/audit_feature.go +110 -0
  820. package/project/.sdk/tm/go/feature/base_feature.go +8 -0
  821. package/project/.sdk/tm/go/feature/cache_feature.go +171 -0
  822. package/project/.sdk/tm/go/feature/clienttrack_feature.go +100 -0
  823. package/project/.sdk/tm/go/feature/debug_feature.go +159 -0
  824. package/project/.sdk/tm/go/feature/feature_options.go +204 -0
  825. package/project/.sdk/tm/go/feature/idempotency_feature.go +115 -0
  826. package/project/.sdk/tm/go/feature/metrics_feature.go +112 -0
  827. package/project/.sdk/tm/go/feature/netsim_feature.go +184 -0
  828. package/project/.sdk/tm/go/feature/paging_feature.go +173 -0
  829. package/project/.sdk/tm/go/feature/proxy_feature.go +121 -0
  830. package/project/.sdk/tm/go/feature/ratelimit_feature.go +88 -0
  831. package/project/.sdk/tm/go/feature/rbac_feature.go +126 -0
  832. package/project/.sdk/tm/go/feature/retry_feature.go +165 -0
  833. package/project/.sdk/tm/go/feature/streaming_feature.go +119 -0
  834. package/project/.sdk/tm/go/feature/telemetry_feature.go +142 -0
  835. package/project/.sdk/tm/go/feature/test_feature.go +78 -3
  836. package/project/.sdk/tm/go/feature/timeout_feature.go +88 -0
  837. package/project/.sdk/tm/go/src/feature/audit/.gitkeep +0 -0
  838. package/project/.sdk/tm/go/src/feature/cache/.gitkeep +0 -0
  839. package/project/.sdk/tm/go/src/feature/clienttrack/.gitkeep +0 -0
  840. package/project/.sdk/tm/go/src/feature/debug/.gitkeep +0 -0
  841. package/project/.sdk/tm/go/src/feature/idempotency/.gitkeep +0 -0
  842. package/project/.sdk/tm/go/src/feature/metrics/.gitkeep +0 -0
  843. package/project/.sdk/tm/go/src/feature/netsim/.gitkeep +0 -0
  844. package/project/.sdk/tm/go/src/feature/paging/.gitkeep +0 -0
  845. package/project/.sdk/tm/go/src/feature/proxy/.gitkeep +0 -0
  846. package/project/.sdk/tm/go/src/feature/ratelimit/.gitkeep +0 -0
  847. package/project/.sdk/tm/go/src/feature/rbac/.gitkeep +0 -0
  848. package/project/.sdk/tm/go/src/feature/retry/.gitkeep +0 -0
  849. package/project/.sdk/tm/go/src/feature/streaming/.gitkeep +0 -0
  850. package/project/.sdk/tm/go/src/feature/telemetry/.gitkeep +0 -0
  851. package/project/.sdk/tm/go/src/feature/timeout/.gitkeep +0 -0
  852. package/project/.sdk/tm/go/test/feature_test.go +1465 -0
  853. package/project/.sdk/tm/go/test/netsim_test.go +70 -0
  854. package/project/.sdk/tm/go/test/pipeline_test.go +571 -0
  855. package/project/.sdk/tm/go/utility/feature_add.go +38 -0
  856. package/project/.sdk/tm/go/utility/fetcher.go +13 -1
  857. package/project/.sdk/tm/go/utility/make_error.go +8 -0
  858. package/project/.sdk/tm/go/utility/make_options.go +62 -0
  859. package/project/.sdk/tm/go/utility/make_point.go +6 -0
  860. package/project/.sdk/tm/go-cli/src/feature/audit/.gitkeep +0 -0
  861. package/project/.sdk/tm/go-cli/src/feature/cache/.gitkeep +0 -0
  862. package/project/.sdk/tm/go-cli/src/feature/clienttrack/.gitkeep +0 -0
  863. package/project/.sdk/tm/go-cli/src/feature/debug/.gitkeep +0 -0
  864. package/project/.sdk/tm/go-cli/src/feature/idempotency/.gitkeep +0 -0
  865. package/project/.sdk/tm/go-cli/src/feature/metrics/.gitkeep +0 -0
  866. package/project/.sdk/tm/go-cli/src/feature/netsim/.gitkeep +0 -0
  867. package/project/.sdk/tm/go-cli/src/feature/paging/.gitkeep +0 -0
  868. package/project/.sdk/tm/go-cli/src/feature/proxy/.gitkeep +0 -0
  869. package/project/.sdk/tm/go-cli/src/feature/ratelimit/.gitkeep +0 -0
  870. package/project/.sdk/tm/go-cli/src/feature/rbac/.gitkeep +0 -0
  871. package/project/.sdk/tm/go-cli/src/feature/retry/.gitkeep +0 -0
  872. package/project/.sdk/tm/go-cli/src/feature/streaming/.gitkeep +0 -0
  873. package/project/.sdk/tm/go-cli/src/feature/telemetry/.gitkeep +0 -0
  874. package/project/.sdk/tm/go-cli/src/feature/timeout/.gitkeep +0 -0
  875. package/project/.sdk/tm/go-mcp/src/feature/audit/.gitkeep +0 -0
  876. package/project/.sdk/tm/go-mcp/src/feature/cache/.gitkeep +0 -0
  877. package/project/.sdk/tm/go-mcp/src/feature/clienttrack/.gitkeep +0 -0
  878. package/project/.sdk/tm/go-mcp/src/feature/debug/.gitkeep +0 -0
  879. package/project/.sdk/tm/go-mcp/src/feature/idempotency/.gitkeep +0 -0
  880. package/project/.sdk/tm/go-mcp/src/feature/metrics/.gitkeep +0 -0
  881. package/project/.sdk/tm/go-mcp/src/feature/netsim/.gitkeep +0 -0
  882. package/project/.sdk/tm/go-mcp/src/feature/paging/.gitkeep +0 -0
  883. package/project/.sdk/tm/go-mcp/src/feature/proxy/.gitkeep +0 -0
  884. package/project/.sdk/tm/go-mcp/src/feature/ratelimit/.gitkeep +0 -0
  885. package/project/.sdk/tm/go-mcp/src/feature/rbac/.gitkeep +0 -0
  886. package/project/.sdk/tm/go-mcp/src/feature/retry/.gitkeep +0 -0
  887. package/project/.sdk/tm/go-mcp/src/feature/streaming/.gitkeep +0 -0
  888. package/project/.sdk/tm/go-mcp/src/feature/telemetry/.gitkeep +0 -0
  889. package/project/.sdk/tm/go-mcp/src/feature/timeout/.gitkeep +0 -0
  890. package/project/.sdk/tm/haskell/LICENSE +21 -0
  891. package/project/.sdk/tm/haskell/Makefile +22 -0
  892. package/project/.sdk/tm/haskell/VERSION +1 -0
  893. package/project/.sdk/tm/haskell/src/SdkFeatures.hs +1278 -0
  894. package/project/.sdk/tm/haskell/src/SdkHelpers.hs +337 -0
  895. package/project/.sdk/tm/haskell/src/SdkRuntime.hs +1007 -0
  896. package/project/.sdk/tm/haskell/src/SdkTypes.hs +186 -0
  897. package/project/.sdk/tm/haskell/src/VoxgigStruct.hs +2299 -0
  898. package/project/.sdk/tm/haskell/src/Vregex.hs +237 -0
  899. package/project/.sdk/tm/haskell/src/feature/README.md +5 -0
  900. package/project/.sdk/tm/haskell/src/feature/audit/.gitkeep +0 -0
  901. package/project/.sdk/tm/haskell/src/feature/base/.gitkeep +0 -0
  902. package/project/.sdk/tm/haskell/src/feature/cache/.gitkeep +0 -0
  903. package/project/.sdk/tm/haskell/src/feature/clienttrack/.gitkeep +0 -0
  904. package/project/.sdk/tm/haskell/src/feature/debug/.gitkeep +0 -0
  905. package/project/.sdk/tm/haskell/src/feature/idempotency/.gitkeep +0 -0
  906. package/project/.sdk/tm/haskell/src/feature/log/.gitkeep +0 -0
  907. package/project/.sdk/tm/haskell/src/feature/metrics/.gitkeep +0 -0
  908. package/project/.sdk/tm/haskell/src/feature/netsim/.gitkeep +0 -0
  909. package/project/.sdk/tm/haskell/src/feature/paging/.gitkeep +0 -0
  910. package/project/.sdk/tm/haskell/src/feature/proxy/.gitkeep +0 -0
  911. package/project/.sdk/tm/haskell/src/feature/ratelimit/.gitkeep +0 -0
  912. package/project/.sdk/tm/haskell/src/feature/rbac/.gitkeep +0 -0
  913. package/project/.sdk/tm/haskell/src/feature/retry/.gitkeep +0 -0
  914. package/project/.sdk/tm/haskell/src/feature/streaming/.gitkeep +0 -0
  915. package/project/.sdk/tm/haskell/src/feature/telemetry/.gitkeep +0 -0
  916. package/project/.sdk/tm/haskell/src/feature/test/.gitkeep +0 -0
  917. package/project/.sdk/tm/haskell/src/feature/timeout/.gitkeep +0 -0
  918. package/project/.sdk/tm/haskell/test/Harness.hs +276 -0
  919. package/project/.sdk/tm/haskell/test/Runner.hs +47 -0
  920. package/project/.sdk/tm/haskell/test/StructCorpus.hs +449 -0
  921. package/project/.sdk/tm/haskell/test/TCustomUtility.hs +38 -0
  922. package/project/.sdk/tm/haskell/test/TFeature.hs +794 -0
  923. package/project/.sdk/tm/haskell/test/TNetsim.hs +50 -0
  924. package/project/.sdk/tm/haskell/test/TPipeline.hs +334 -0
  925. package/project/.sdk/tm/haskell/test/TPrimaryUtility.hs +386 -0
  926. package/project/.sdk/tm/haskell/test/TestJson.hs +107 -0
  927. package/project/.sdk/tm/haskell/test/Testutil.hs +59 -0
  928. package/project/.sdk/tm/java/LICENSE +22 -0
  929. package/project/.sdk/tm/java/Makefile +44 -0
  930. package/project/.sdk/tm/java/VERSION +1 -0
  931. package/project/.sdk/tm/java/core/Context.java +269 -0
  932. package/project/.sdk/tm/java/core/Control.java +23 -0
  933. package/project/.sdk/tm/java/core/Entity.java +13 -0
  934. package/project/.sdk/tm/java/core/Feature.java +45 -0
  935. package/project/.sdk/tm/java/core/FeaturePlacement.java +13 -0
  936. package/project/.sdk/tm/java/core/Helpers.java +50 -0
  937. package/project/.sdk/tm/java/core/Operation.java +47 -0
  938. package/project/.sdk/tm/java/core/Point.java +90 -0
  939. package/project/.sdk/tm/java/core/Response.java +48 -0
  940. package/project/.sdk/tm/java/core/Result.java +64 -0
  941. package/project/.sdk/tm/java/core/SdkClient.java +280 -0
  942. package/project/.sdk/tm/java/core/SdkEntity.java +28 -0
  943. package/project/.sdk/tm/java/core/Spec.java +84 -0
  944. package/project/.sdk/tm/java/core/Utility.java +128 -0
  945. package/project/.sdk/tm/java/feature/AuditFeature.java +113 -0
  946. package/project/.sdk/tm/java/feature/BaseFeature.java +91 -0
  947. package/project/.sdk/tm/java/feature/CacheFeature.java +184 -0
  948. package/project/.sdk/tm/java/feature/ClienttrackFeature.java +103 -0
  949. package/project/.sdk/tm/java/feature/DebugFeature.java +163 -0
  950. package/project/.sdk/tm/java/feature/FeatureOptions.java +204 -0
  951. package/project/.sdk/tm/java/feature/IdempotencyFeature.java +115 -0
  952. package/project/.sdk/tm/java/feature/LogFeature.java +143 -0
  953. package/project/.sdk/tm/java/feature/MetricsFeature.java +115 -0
  954. package/project/.sdk/tm/java/feature/NetsimFeature.java +181 -0
  955. package/project/.sdk/tm/java/feature/PagingFeature.java +178 -0
  956. package/project/.sdk/tm/java/feature/ProxyFeature.java +122 -0
  957. package/project/.sdk/tm/java/feature/RatelimitFeature.java +83 -0
  958. package/project/.sdk/tm/java/feature/RbacFeature.java +132 -0
  959. package/project/.sdk/tm/java/feature/RetryFeature.java +156 -0
  960. package/project/.sdk/tm/java/feature/StreamingFeature.java +110 -0
  961. package/project/.sdk/tm/java/feature/TelemetryFeature.java +146 -0
  962. package/project/.sdk/tm/java/feature/TestFeature.java +333 -0
  963. package/project/.sdk/tm/java/feature/TimeoutFeature.java +89 -0
  964. package/project/.sdk/tm/java/src/feature/README.md +1 -0
  965. package/project/.sdk/tm/java/src/feature/audit/.gitkeep +0 -0
  966. package/project/.sdk/tm/java/src/feature/base/.gitkeep +0 -0
  967. package/project/.sdk/tm/java/src/feature/cache/.gitkeep +0 -0
  968. package/project/.sdk/tm/java/src/feature/clienttrack/.gitkeep +0 -0
  969. package/project/.sdk/tm/java/src/feature/debug/.gitkeep +0 -0
  970. package/project/.sdk/tm/java/src/feature/idempotency/.gitkeep +0 -0
  971. package/project/.sdk/tm/java/src/feature/log/.gitkeep +0 -0
  972. package/project/.sdk/tm/java/src/feature/metrics/.gitkeep +0 -0
  973. package/project/.sdk/tm/java/src/feature/netsim/.gitkeep +0 -0
  974. package/project/.sdk/tm/java/src/feature/paging/.gitkeep +0 -0
  975. package/project/.sdk/tm/java/src/feature/proxy/.gitkeep +0 -0
  976. package/project/.sdk/tm/java/src/feature/ratelimit/.gitkeep +0 -0
  977. package/project/.sdk/tm/java/src/feature/rbac/.gitkeep +0 -0
  978. package/project/.sdk/tm/java/src/feature/retry/.gitkeep +0 -0
  979. package/project/.sdk/tm/java/src/feature/streaming/.gitkeep +0 -0
  980. package/project/.sdk/tm/java/src/feature/telemetry/.gitkeep +0 -0
  981. package/project/.sdk/tm/java/src/feature/test/.gitkeep +0 -0
  982. package/project/.sdk/tm/java/src/feature/timeout/.gitkeep +0 -0
  983. package/project/.sdk/tm/java/test/CustomUtilityTest.java +59 -0
  984. package/project/.sdk/tm/java/test/ExistsTest.java +16 -0
  985. package/project/.sdk/tm/java/test/FeatureHarness.java +448 -0
  986. package/project/.sdk/tm/java/test/FeatureTest.java +1018 -0
  987. package/project/.sdk/tm/java/test/NetsimTest.java +59 -0
  988. package/project/.sdk/tm/java/test/PipelineTest.java +618 -0
  989. package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +864 -0
  990. package/project/.sdk/tm/java/test/RunnerSupport.java +545 -0
  991. package/project/.sdk/tm/java/test/StructCorpusTest.java +351 -0
  992. package/project/.sdk/tm/java/test/StructRunner.java +281 -0
  993. package/project/.sdk/tm/java/test/sdk-test-control.json +19 -0
  994. package/project/.sdk/tm/java/utility/Clean.java +12 -0
  995. package/project/.sdk/tm/java/utility/Done.java +29 -0
  996. package/project/.sdk/tm/java/utility/FeatureAdd.java +59 -0
  997. package/project/.sdk/tm/java/utility/FeatureHookUtil.java +72 -0
  998. package/project/.sdk/tm/java/utility/FeatureInit.java +35 -0
  999. package/project/.sdk/tm/java/utility/Fetcher.java +170 -0
  1000. package/project/.sdk/tm/java/utility/Json.java +268 -0
  1001. package/project/.sdk/tm/java/utility/MakeContext.java +14 -0
  1002. package/project/.sdk/tm/java/utility/MakeError.java +81 -0
  1003. package/project/.sdk/tm/java/utility/MakeFetchDef.java +48 -0
  1004. package/project/.sdk/tm/java/utility/MakeOptions.java +168 -0
  1005. package/project/.sdk/tm/java/utility/MakePoint.java +118 -0
  1006. package/project/.sdk/tm/java/utility/MakeRequest.java +83 -0
  1007. package/project/.sdk/tm/java/utility/MakeResponse.java +54 -0
  1008. package/project/.sdk/tm/java/utility/MakeResult.java +68 -0
  1009. package/project/.sdk/tm/java/utility/MakeSpec.java +69 -0
  1010. package/project/.sdk/tm/java/utility/MakeUrl.java +67 -0
  1011. package/project/.sdk/tm/java/utility/Param.java +74 -0
  1012. package/project/.sdk/tm/java/utility/PrepareAuth.java +66 -0
  1013. package/project/.sdk/tm/java/utility/PrepareBody.java +16 -0
  1014. package/project/.sdk/tm/java/utility/PrepareHeaders.java +28 -0
  1015. package/project/.sdk/tm/java/utility/PrepareMethod.java +28 -0
  1016. package/project/.sdk/tm/java/utility/PrepareParams.java +50 -0
  1017. package/project/.sdk/tm/java/utility/PreparePath.java +26 -0
  1018. package/project/.sdk/tm/java/utility/PrepareQuery.java +54 -0
  1019. package/project/.sdk/tm/java/utility/Register.java +41 -0
  1020. package/project/.sdk/tm/java/utility/ResultBasic.java +36 -0
  1021. package/project/.sdk/tm/java/utility/ResultBody.java +23 -0
  1022. package/project/.sdk/tm/java/utility/ResultHeaders.java +36 -0
  1023. package/project/.sdk/tm/java/utility/TransformRequest.java +35 -0
  1024. package/project/.sdk/tm/java/utility/TransformResponse.java +52 -0
  1025. package/project/.sdk/tm/java/utility/struct/Struct.java +3550 -0
  1026. package/project/.sdk/tm/js/src/feature/audit/AuditFeature.js +96 -0
  1027. package/project/.sdk/tm/js/src/feature/cache/CacheFeature.js +150 -0
  1028. package/project/.sdk/tm/js/src/feature/clienttrack/ClienttrackFeature.js +104 -0
  1029. package/project/.sdk/tm/js/src/feature/debug/DebugFeature.js +132 -0
  1030. package/project/.sdk/tm/js/src/feature/idempotency/IdempotencyFeature.js +95 -0
  1031. package/project/.sdk/tm/js/src/feature/metrics/MetricsFeature.js +102 -0
  1032. package/project/.sdk/tm/js/src/feature/netsim/NetsimFeature.js +187 -0
  1033. package/project/.sdk/tm/js/src/feature/paging/PagingFeature.js +139 -0
  1034. package/project/.sdk/tm/js/src/feature/proxy/ProxyFeature.js +110 -0
  1035. package/project/.sdk/tm/js/src/feature/ratelimit/RatelimitFeature.js +106 -0
  1036. package/project/.sdk/tm/js/src/feature/rbac/RbacFeature.js +102 -0
  1037. package/project/.sdk/tm/js/src/feature/retry/RetryFeature.js +158 -0
  1038. package/project/.sdk/tm/js/src/feature/streaming/StreamingFeature.js +96 -0
  1039. package/project/.sdk/tm/js/src/feature/telemetry/TelemetryFeature.js +128 -0
  1040. package/project/.sdk/tm/js/src/feature/test/TestFeature.js +58 -1
  1041. package/project/.sdk/tm/js/src/feature/timeout/TimeoutFeature.js +101 -0
  1042. package/project/.sdk/tm/js/src/utility/FeatureHookUtility.js +4 -1
  1043. package/project/.sdk/tm/js/src/utility/MakeErrorUtility.js +9 -0
  1044. package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +31 -1
  1045. package/project/.sdk/tm/js/test/feature/harness.js +275 -0
  1046. package/project/.sdk/tm/js/test/feature.test.js +772 -0
  1047. package/project/.sdk/tm/js/test/netsim.test.js +43 -0
  1048. package/project/.sdk/tm/js/test/pipeline.test.js +382 -0
  1049. package/project/.sdk/tm/kotlin/LICENSE +22 -0
  1050. package/project/.sdk/tm/kotlin/Makefile +43 -0
  1051. package/project/.sdk/tm/kotlin/VERSION +1 -0
  1052. package/project/.sdk/tm/kotlin/core/Context.kt +247 -0
  1053. package/project/.sdk/tm/kotlin/core/Control.kt +21 -0
  1054. package/project/.sdk/tm/kotlin/core/Helpers.kt +49 -0
  1055. package/project/.sdk/tm/kotlin/core/Interfaces.kt +88 -0
  1056. package/project/.sdk/tm/kotlin/core/Operation.kt +43 -0
  1057. package/project/.sdk/tm/kotlin/core/Point.kt +83 -0
  1058. package/project/.sdk/tm/kotlin/core/Response.kt +43 -0
  1059. package/project/.sdk/tm/kotlin/core/Result.kt +61 -0
  1060. package/project/.sdk/tm/kotlin/core/SdkClient.kt +266 -0
  1061. package/project/.sdk/tm/kotlin/core/Spec.kt +76 -0
  1062. package/project/.sdk/tm/kotlin/core/Utility.kt +93 -0
  1063. package/project/.sdk/tm/kotlin/feature/AuditFeature.kt +96 -0
  1064. package/project/.sdk/tm/kotlin/feature/BaseFeature.kt +57 -0
  1065. package/project/.sdk/tm/kotlin/feature/CacheFeature.kt +167 -0
  1066. package/project/.sdk/tm/kotlin/feature/ClienttrackFeature.kt +84 -0
  1067. package/project/.sdk/tm/kotlin/feature/DebugFeature.kt +141 -0
  1068. package/project/.sdk/tm/kotlin/feature/FeatureOptions.kt +191 -0
  1069. package/project/.sdk/tm/kotlin/feature/IdempotencyFeature.kt +98 -0
  1070. package/project/.sdk/tm/kotlin/feature/LogFeature.kt +92 -0
  1071. package/project/.sdk/tm/kotlin/feature/MetricsFeature.kt +96 -0
  1072. package/project/.sdk/tm/kotlin/feature/NetsimFeature.kt +162 -0
  1073. package/project/.sdk/tm/kotlin/feature/PagingFeature.kt +143 -0
  1074. package/project/.sdk/tm/kotlin/feature/ProxyFeature.kt +109 -0
  1075. package/project/.sdk/tm/kotlin/feature/RatelimitFeature.kt +77 -0
  1076. package/project/.sdk/tm/kotlin/feature/RbacFeature.kt +100 -0
  1077. package/project/.sdk/tm/kotlin/feature/RetryFeature.kt +140 -0
  1078. package/project/.sdk/tm/kotlin/feature/StreamingFeature.kt +90 -0
  1079. package/project/.sdk/tm/kotlin/feature/TelemetryFeature.kt +118 -0
  1080. package/project/.sdk/tm/kotlin/feature/TestFeature.kt +306 -0
  1081. package/project/.sdk/tm/kotlin/feature/TimeoutFeature.kt +74 -0
  1082. package/project/.sdk/tm/kotlin/src/feature/README.md +1 -0
  1083. package/project/.sdk/tm/kotlin/src/feature/audit/.gitkeep +0 -0
  1084. package/project/.sdk/tm/kotlin/src/feature/base/.gitkeep +0 -0
  1085. package/project/.sdk/tm/kotlin/src/feature/cache/.gitkeep +0 -0
  1086. package/project/.sdk/tm/kotlin/src/feature/clienttrack/.gitkeep +0 -0
  1087. package/project/.sdk/tm/kotlin/src/feature/debug/.gitkeep +0 -0
  1088. package/project/.sdk/tm/kotlin/src/feature/idempotency/.gitkeep +0 -0
  1089. package/project/.sdk/tm/kotlin/src/feature/log/.gitkeep +0 -0
  1090. package/project/.sdk/tm/kotlin/src/feature/metrics/.gitkeep +0 -0
  1091. package/project/.sdk/tm/kotlin/src/feature/netsim/.gitkeep +0 -0
  1092. package/project/.sdk/tm/kotlin/src/feature/paging/.gitkeep +0 -0
  1093. package/project/.sdk/tm/kotlin/src/feature/proxy/.gitkeep +0 -0
  1094. package/project/.sdk/tm/kotlin/src/feature/ratelimit/.gitkeep +0 -0
  1095. package/project/.sdk/tm/kotlin/src/feature/rbac/.gitkeep +0 -0
  1096. package/project/.sdk/tm/kotlin/src/feature/retry/.gitkeep +0 -0
  1097. package/project/.sdk/tm/kotlin/src/feature/streaming/.gitkeep +0 -0
  1098. package/project/.sdk/tm/kotlin/src/feature/telemetry/.gitkeep +0 -0
  1099. package/project/.sdk/tm/kotlin/src/feature/test/.gitkeep +0 -0
  1100. package/project/.sdk/tm/kotlin/src/feature/timeout/.gitkeep +0 -0
  1101. package/project/.sdk/tm/kotlin/test/CustomUtilityTest.kt +51 -0
  1102. package/project/.sdk/tm/kotlin/test/ExistsTest.kt +15 -0
  1103. package/project/.sdk/tm/kotlin/test/FeatureHarness.kt +380 -0
  1104. package/project/.sdk/tm/kotlin/test/FeatureTest.kt +924 -0
  1105. package/project/.sdk/tm/kotlin/test/NetsimTest.kt +50 -0
  1106. package/project/.sdk/tm/kotlin/test/PipelineTest.kt +556 -0
  1107. package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +829 -0
  1108. package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +477 -0
  1109. package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +297 -0
  1110. package/project/.sdk/tm/kotlin/test/StructRunner.kt +177 -0
  1111. package/project/.sdk/tm/kotlin/test/sdk-test-control.json +19 -0
  1112. package/project/.sdk/tm/kotlin/utility/CoreUtil.kt +96 -0
  1113. package/project/.sdk/tm/kotlin/utility/FeatureUtil.kt +121 -0
  1114. package/project/.sdk/tm/kotlin/utility/Fetcher.kt +156 -0
  1115. package/project/.sdk/tm/kotlin/utility/Json.kt +237 -0
  1116. package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +152 -0
  1117. package/project/.sdk/tm/kotlin/utility/MakePoint.kt +108 -0
  1118. package/project/.sdk/tm/kotlin/utility/MakeReqRes.kt +152 -0
  1119. package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +142 -0
  1120. package/project/.sdk/tm/kotlin/utility/Prepare.kt +236 -0
  1121. package/project/.sdk/tm/kotlin/utility/Register.kt +39 -0
  1122. package/project/.sdk/tm/kotlin/utility/ResultTransform.kt +109 -0
  1123. package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +2697 -0
  1124. package/project/.sdk/tm/lua/feature/audit_feature.lua +132 -0
  1125. package/project/.sdk/tm/lua/feature/cache_feature.lua +188 -0
  1126. package/project/.sdk/tm/lua/feature/clienttrack_feature.lua +127 -0
  1127. package/project/.sdk/tm/lua/feature/debug_feature.lua +194 -0
  1128. package/project/.sdk/tm/lua/feature/idempotency_feature.lua +127 -0
  1129. package/project/.sdk/tm/lua/feature/metrics_feature.lua +135 -0
  1130. package/project/.sdk/tm/lua/feature/netsim_feature.lua +205 -0
  1131. package/project/.sdk/tm/lua/feature/paging_feature.lua +180 -0
  1132. package/project/.sdk/tm/lua/feature/proxy_feature.lua +147 -0
  1133. package/project/.sdk/tm/lua/feature/ratelimit_feature.lua +120 -0
  1134. package/project/.sdk/tm/lua/feature/rbac_feature.lua +141 -0
  1135. package/project/.sdk/tm/lua/feature/retry_feature.lua +188 -0
  1136. package/project/.sdk/tm/lua/feature/streaming_feature.lua +143 -0
  1137. package/project/.sdk/tm/lua/feature/telemetry_feature.lua +159 -0
  1138. package/project/.sdk/tm/lua/feature/test_feature.lua +85 -1
  1139. package/project/.sdk/tm/lua/feature/timeout_feature.lua +94 -0
  1140. package/project/.sdk/tm/lua/src/feature/audit/.gitkeep +0 -0
  1141. package/project/.sdk/tm/lua/src/feature/cache/.gitkeep +0 -0
  1142. package/project/.sdk/tm/lua/src/feature/clienttrack/.gitkeep +0 -0
  1143. package/project/.sdk/tm/lua/src/feature/debug/.gitkeep +0 -0
  1144. package/project/.sdk/tm/lua/src/feature/idempotency/.gitkeep +0 -0
  1145. package/project/.sdk/tm/lua/src/feature/metrics/.gitkeep +0 -0
  1146. package/project/.sdk/tm/lua/src/feature/netsim/.gitkeep +0 -0
  1147. package/project/.sdk/tm/lua/src/feature/paging/.gitkeep +0 -0
  1148. package/project/.sdk/tm/lua/src/feature/proxy/.gitkeep +0 -0
  1149. package/project/.sdk/tm/lua/src/feature/ratelimit/.gitkeep +0 -0
  1150. package/project/.sdk/tm/lua/src/feature/rbac/.gitkeep +0 -0
  1151. package/project/.sdk/tm/lua/src/feature/retry/.gitkeep +0 -0
  1152. package/project/.sdk/tm/lua/src/feature/streaming/.gitkeep +0 -0
  1153. package/project/.sdk/tm/lua/src/feature/telemetry/.gitkeep +0 -0
  1154. package/project/.sdk/tm/lua/src/feature/timeout/.gitkeep +0 -0
  1155. package/project/.sdk/tm/lua/test/feature_test.lua +1244 -0
  1156. package/project/.sdk/tm/lua/test/netsim_test.lua +61 -0
  1157. package/project/.sdk/tm/lua/test/pipeline_test.lua +613 -0
  1158. package/project/.sdk/tm/lua/utility/feature_add.lua +28 -1
  1159. package/project/.sdk/tm/lua/utility/make_error.lua +9 -0
  1160. package/project/.sdk/tm/lua/utility/make_options.lua +58 -0
  1161. package/project/.sdk/tm/lua/utility/make_point.lua +8 -1
  1162. package/project/.sdk/tm/ocaml/LICENSE +21 -0
  1163. package/project/.sdk/tm/ocaml/Makefile +58 -0
  1164. package/project/.sdk/tm/ocaml/VERSION +1 -0
  1165. package/project/.sdk/tm/ocaml/sdk_features.ml +1127 -0
  1166. package/project/.sdk/tm/ocaml/sdk_helpers.ml +110 -0
  1167. package/project/.sdk/tm/ocaml/sdk_runtime.ml +942 -0
  1168. package/project/.sdk/tm/ocaml/sdk_types.ml +259 -0
  1169. package/project/.sdk/tm/ocaml/src/feature/README.md +1 -0
  1170. package/project/.sdk/tm/ocaml/src/feature/audit/.gitkeep +0 -0
  1171. package/project/.sdk/tm/ocaml/src/feature/base/.gitkeep +0 -0
  1172. package/project/.sdk/tm/ocaml/src/feature/cache/.gitkeep +0 -0
  1173. package/project/.sdk/tm/ocaml/src/feature/clienttrack/.gitkeep +0 -0
  1174. package/project/.sdk/tm/ocaml/src/feature/debug/.gitkeep +0 -0
  1175. package/project/.sdk/tm/ocaml/src/feature/idempotency/.gitkeep +0 -0
  1176. package/project/.sdk/tm/ocaml/src/feature/log/.gitkeep +0 -0
  1177. package/project/.sdk/tm/ocaml/src/feature/metrics/.gitkeep +0 -0
  1178. package/project/.sdk/tm/ocaml/src/feature/netsim/.gitkeep +0 -0
  1179. package/project/.sdk/tm/ocaml/src/feature/paging/.gitkeep +0 -0
  1180. package/project/.sdk/tm/ocaml/src/feature/proxy/.gitkeep +0 -0
  1181. package/project/.sdk/tm/ocaml/src/feature/ratelimit/.gitkeep +0 -0
  1182. package/project/.sdk/tm/ocaml/src/feature/rbac/.gitkeep +0 -0
  1183. package/project/.sdk/tm/ocaml/src/feature/retry/.gitkeep +0 -0
  1184. package/project/.sdk/tm/ocaml/src/feature/streaming/.gitkeep +0 -0
  1185. package/project/.sdk/tm/ocaml/src/feature/telemetry/.gitkeep +0 -0
  1186. package/project/.sdk/tm/ocaml/src/feature/test/.gitkeep +0 -0
  1187. package/project/.sdk/tm/ocaml/src/feature/timeout/.gitkeep +0 -0
  1188. package/project/.sdk/tm/ocaml/test/custom_utility.ml +30 -0
  1189. package/project/.sdk/tm/ocaml/test/harness.ml +198 -0
  1190. package/project/.sdk/tm/ocaml/test/struct_corpus.ml +487 -0
  1191. package/project/.sdk/tm/ocaml/test/t_feature.ml +533 -0
  1192. package/project/.sdk/tm/ocaml/test/t_main.ml +5 -0
  1193. package/project/.sdk/tm/ocaml/test/t_pipeline.ml +354 -0
  1194. package/project/.sdk/tm/ocaml/test/testutil.ml +57 -0
  1195. package/project/.sdk/tm/ocaml/utility/voxgig_struct.ml +1858 -0
  1196. package/project/.sdk/tm/ocaml/utility/vregex.ml +254 -0
  1197. package/project/.sdk/tm/perl/LICENSE +22 -0
  1198. package/project/.sdk/tm/perl/Makefile +57 -0
  1199. package/project/.sdk/tm/perl/core/context.pm +138 -0
  1200. package/project/.sdk/tm/perl/core/control.pm +22 -0
  1201. package/project/.sdk/tm/perl/core/error.pm +30 -0
  1202. package/project/.sdk/tm/perl/core/helpers.pm +142 -0
  1203. package/project/.sdk/tm/perl/core/operation.pm +47 -0
  1204. package/project/.sdk/tm/perl/core/response.pm +40 -0
  1205. package/project/.sdk/tm/perl/core/result.pm +45 -0
  1206. package/project/.sdk/tm/perl/core/spec.pm +33 -0
  1207. package/project/.sdk/tm/perl/core/utility_type.pm +32 -0
  1208. package/project/.sdk/tm/perl/feature/audit_feature.pm +128 -0
  1209. package/project/.sdk/tm/perl/feature/base_feature.pm +41 -0
  1210. package/project/.sdk/tm/perl/feature/cache_feature.pm +168 -0
  1211. package/project/.sdk/tm/perl/feature/clienttrack_feature.pm +126 -0
  1212. package/project/.sdk/tm/perl/feature/debug_feature.pm +168 -0
  1213. package/project/.sdk/tm/perl/feature/idempotency_feature.pm +104 -0
  1214. package/project/.sdk/tm/perl/feature/log_feature.pm +77 -0
  1215. package/project/.sdk/tm/perl/feature/metrics_feature.pm +124 -0
  1216. package/project/.sdk/tm/perl/feature/netsim_feature.pm +215 -0
  1217. package/project/.sdk/tm/perl/feature/paging_feature.pm +158 -0
  1218. package/project/.sdk/tm/perl/feature/proxy_feature.pm +128 -0
  1219. package/project/.sdk/tm/perl/feature/ratelimit_feature.pm +126 -0
  1220. package/project/.sdk/tm/perl/feature/rbac_feature.pm +124 -0
  1221. package/project/.sdk/tm/perl/feature/retry_feature.pm +153 -0
  1222. package/project/.sdk/tm/perl/feature/streaming_feature.pm +112 -0
  1223. package/project/.sdk/tm/perl/feature/telemetry_feature.pm +155 -0
  1224. package/project/.sdk/tm/perl/feature/test_feature.pm +314 -0
  1225. package/project/.sdk/tm/perl/feature/timeout_feature.pm +110 -0
  1226. package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +2897 -0
  1227. package/project/.sdk/tm/perl/src/feature/README.md +3 -0
  1228. package/project/.sdk/tm/perl/src/feature/audit/.gitkeep +0 -0
  1229. package/project/.sdk/tm/perl/src/feature/base/.gitkeep +0 -0
  1230. package/project/.sdk/tm/perl/src/feature/cache/.gitkeep +0 -0
  1231. package/project/.sdk/tm/perl/src/feature/clienttrack/.gitkeep +0 -0
  1232. package/project/.sdk/tm/perl/src/feature/debug/.gitkeep +0 -0
  1233. package/project/.sdk/tm/perl/src/feature/idempotency/.gitkeep +0 -0
  1234. package/project/.sdk/tm/perl/src/feature/log/.gitkeep +0 -0
  1235. package/project/.sdk/tm/perl/src/feature/metrics/.gitkeep +0 -0
  1236. package/project/.sdk/tm/perl/src/feature/netsim/.gitkeep +0 -0
  1237. package/project/.sdk/tm/perl/src/feature/paging/.gitkeep +0 -0
  1238. package/project/.sdk/tm/perl/src/feature/proxy/.gitkeep +0 -0
  1239. package/project/.sdk/tm/perl/src/feature/ratelimit/.gitkeep +0 -0
  1240. package/project/.sdk/tm/perl/src/feature/rbac/.gitkeep +0 -0
  1241. package/project/.sdk/tm/perl/src/feature/retry/.gitkeep +0 -0
  1242. package/project/.sdk/tm/perl/src/feature/streaming/.gitkeep +0 -0
  1243. package/project/.sdk/tm/perl/src/feature/telemetry/.gitkeep +0 -0
  1244. package/project/.sdk/tm/perl/src/feature/test/.gitkeep +0 -0
  1245. package/project/.sdk/tm/perl/src/feature/timeout/.gitkeep +0 -0
  1246. package/project/.sdk/tm/perl/t/feature.t +1054 -0
  1247. package/project/.sdk/tm/perl/t/netsim.t +55 -0
  1248. package/project/.sdk/tm/perl/t/pipeline.t +632 -0
  1249. package/project/.sdk/tm/perl/t/primary_utility.t +1023 -0
  1250. package/project/.sdk/tm/perl/t/runner.pm +140 -0
  1251. package/project/.sdk/tm/perl/t/sdk-test-control.json +19 -0
  1252. package/project/.sdk/tm/perl/t/stream.t +132 -0
  1253. package/project/.sdk/tm/perl/t/struct_runner.pm +275 -0
  1254. package/project/.sdk/tm/perl/t/struct_utility.t +438 -0
  1255. package/project/.sdk/tm/perl/utility/clean.pm +15 -0
  1256. package/project/.sdk/tm/perl/utility/done.pm +34 -0
  1257. package/project/.sdk/tm/perl/utility/feature_add.pm +47 -0
  1258. package/project/.sdk/tm/perl/utility/feature_hook.pm +25 -0
  1259. package/project/.sdk/tm/perl/utility/feature_init.pm +33 -0
  1260. package/project/.sdk/tm/perl/utility/fetcher.pm +112 -0
  1261. package/project/.sdk/tm/perl/utility/make_context.pm +22 -0
  1262. package/project/.sdk/tm/perl/utility/make_error.pm +74 -0
  1263. package/project/.sdk/tm/perl/utility/make_fetch_def.pm +46 -0
  1264. package/project/.sdk/tm/perl/utility/make_options.pm +123 -0
  1265. package/project/.sdk/tm/perl/utility/make_point.pm +104 -0
  1266. package/project/.sdk/tm/perl/utility/make_request.pm +66 -0
  1267. package/project/.sdk/tm/perl/utility/make_response.pm +38 -0
  1268. package/project/.sdk/tm/perl/utility/make_result.pm +53 -0
  1269. package/project/.sdk/tm/perl/utility/make_spec.pm +71 -0
  1270. package/project/.sdk/tm/perl/utility/make_url.pm +63 -0
  1271. package/project/.sdk/tm/perl/utility/param.pm +65 -0
  1272. package/project/.sdk/tm/perl/utility/prepare_auth.pm +56 -0
  1273. package/project/.sdk/tm/perl/utility/prepare_body.pm +17 -0
  1274. package/project/.sdk/tm/perl/utility/prepare_headers.pm +27 -0
  1275. package/project/.sdk/tm/perl/utility/prepare_method.pm +25 -0
  1276. package/project/.sdk/tm/perl/utility/prepare_params.pm +41 -0
  1277. package/project/.sdk/tm/perl/utility/prepare_path.pm +29 -0
  1278. package/project/.sdk/tm/perl/utility/prepare_query.pm +40 -0
  1279. package/project/.sdk/tm/perl/utility/register.pm +53 -0
  1280. package/project/.sdk/tm/perl/utility/result_basic.pm +38 -0
  1281. package/project/.sdk/tm/perl/utility/result_body.pm +28 -0
  1282. package/project/.sdk/tm/perl/utility/result_headers.pm +32 -0
  1283. package/project/.sdk/tm/perl/utility/transform_request.pm +30 -0
  1284. package/project/.sdk/tm/perl/utility/transform_response.pm +43 -0
  1285. package/project/.sdk/tm/php/core/Result.php +10 -0
  1286. package/project/.sdk/tm/php/feature/AuditFeature.php +125 -0
  1287. package/project/.sdk/tm/php/feature/BaseFeature.php +6 -0
  1288. package/project/.sdk/tm/php/feature/CacheFeature.php +158 -0
  1289. package/project/.sdk/tm/php/feature/ClienttrackFeature.php +126 -0
  1290. package/project/.sdk/tm/php/feature/DebugFeature.php +167 -0
  1291. package/project/.sdk/tm/php/feature/IdempotencyFeature.php +102 -0
  1292. package/project/.sdk/tm/php/feature/MetricsFeature.php +122 -0
  1293. package/project/.sdk/tm/php/feature/NetsimFeature.php +190 -0
  1294. package/project/.sdk/tm/php/feature/PagingFeature.php +153 -0
  1295. package/project/.sdk/tm/php/feature/ProxyFeature.php +136 -0
  1296. package/project/.sdk/tm/php/feature/RatelimitFeature.php +116 -0
  1297. package/project/.sdk/tm/php/feature/RbacFeature.php +133 -0
  1298. package/project/.sdk/tm/php/feature/RetryFeature.php +159 -0
  1299. package/project/.sdk/tm/php/feature/StreamingFeature.php +107 -0
  1300. package/project/.sdk/tm/php/feature/TelemetryFeature.php +156 -0
  1301. package/project/.sdk/tm/php/feature/TestFeature.php +80 -1
  1302. package/project/.sdk/tm/php/feature/TimeoutFeature.php +95 -0
  1303. package/project/.sdk/tm/php/src/feature/audit/.gitkeep +0 -0
  1304. package/project/.sdk/tm/php/src/feature/cache/.gitkeep +0 -0
  1305. package/project/.sdk/tm/php/src/feature/clienttrack/.gitkeep +0 -0
  1306. package/project/.sdk/tm/php/src/feature/debug/.gitkeep +0 -0
  1307. package/project/.sdk/tm/php/src/feature/idempotency/.gitkeep +0 -0
  1308. package/project/.sdk/tm/php/src/feature/metrics/.gitkeep +0 -0
  1309. package/project/.sdk/tm/php/src/feature/netsim/.gitkeep +0 -0
  1310. package/project/.sdk/tm/php/src/feature/paging/.gitkeep +0 -0
  1311. package/project/.sdk/tm/php/src/feature/proxy/.gitkeep +0 -0
  1312. package/project/.sdk/tm/php/src/feature/ratelimit/.gitkeep +0 -0
  1313. package/project/.sdk/tm/php/src/feature/rbac/.gitkeep +0 -0
  1314. package/project/.sdk/tm/php/src/feature/retry/.gitkeep +0 -0
  1315. package/project/.sdk/tm/php/src/feature/streaming/.gitkeep +0 -0
  1316. package/project/.sdk/tm/php/src/feature/telemetry/.gitkeep +0 -0
  1317. package/project/.sdk/tm/php/src/feature/timeout/.gitkeep +0 -0
  1318. package/project/.sdk/tm/php/test/FeatureTest.php +1259 -0
  1319. package/project/.sdk/tm/php/test/NetsimTest.php +53 -0
  1320. package/project/.sdk/tm/php/test/PipelineTest.php +674 -0
  1321. package/project/.sdk/tm/php/utility/FeatureAdd.php +32 -1
  1322. package/project/.sdk/tm/php/utility/MakeError.php +9 -0
  1323. package/project/.sdk/tm/php/utility/MakeOptions.php +46 -0
  1324. package/project/.sdk/tm/php/utility/MakePoint.php +7 -0
  1325. package/project/.sdk/tm/py/core/context.py +4 -0
  1326. package/project/.sdk/tm/py/core/control.py +3 -0
  1327. package/project/.sdk/tm/py/feature/audit_feature.py +98 -0
  1328. package/project/.sdk/tm/py/feature/cache_feature.py +138 -0
  1329. package/project/.sdk/tm/py/feature/clienttrack_feature.py +97 -0
  1330. package/project/.sdk/tm/py/feature/debug_feature.py +134 -0
  1331. package/project/.sdk/tm/py/feature/idempotency_feature.py +89 -0
  1332. package/project/.sdk/tm/py/feature/metrics_feature.py +93 -0
  1333. package/project/.sdk/tm/py/feature/netsim_feature.py +170 -0
  1334. package/project/.sdk/tm/py/feature/paging_feature.py +134 -0
  1335. package/project/.sdk/tm/py/feature/proxy_feature.py +104 -0
  1336. package/project/.sdk/tm/py/feature/ratelimit_feature.py +98 -0
  1337. package/project/.sdk/tm/py/feature/rbac_feature.py +102 -0
  1338. package/project/.sdk/tm/py/feature/retry_feature.py +142 -0
  1339. package/project/.sdk/tm/py/feature/streaming_feature.py +84 -0
  1340. package/project/.sdk/tm/py/feature/telemetry_feature.py +128 -0
  1341. package/project/.sdk/tm/py/feature/test_feature.py +70 -1
  1342. package/project/.sdk/tm/py/feature/timeout_feature.py +78 -0
  1343. package/project/.sdk/tm/py/src/feature/audit/.gitkeep +0 -0
  1344. package/project/.sdk/tm/py/src/feature/cache/.gitkeep +0 -0
  1345. package/project/.sdk/tm/py/src/feature/clienttrack/.gitkeep +0 -0
  1346. package/project/.sdk/tm/py/src/feature/debug/.gitkeep +0 -0
  1347. package/project/.sdk/tm/py/src/feature/idempotency/.gitkeep +0 -0
  1348. package/project/.sdk/tm/py/src/feature/metrics/.gitkeep +0 -0
  1349. package/project/.sdk/tm/py/src/feature/netsim/.gitkeep +0 -0
  1350. package/project/.sdk/tm/py/src/feature/paging/.gitkeep +0 -0
  1351. package/project/.sdk/tm/py/src/feature/proxy/.gitkeep +0 -0
  1352. package/project/.sdk/tm/py/src/feature/ratelimit/.gitkeep +0 -0
  1353. package/project/.sdk/tm/py/src/feature/rbac/.gitkeep +0 -0
  1354. package/project/.sdk/tm/py/src/feature/retry/.gitkeep +0 -0
  1355. package/project/.sdk/tm/py/src/feature/streaming/.gitkeep +0 -0
  1356. package/project/.sdk/tm/py/src/feature/telemetry/.gitkeep +0 -0
  1357. package/project/.sdk/tm/py/src/feature/timeout/.gitkeep +0 -0
  1358. package/project/.sdk/tm/py/test/feature_harness.py +336 -0
  1359. package/project/.sdk/tm/py/test/test_feature.py +807 -0
  1360. package/project/.sdk/tm/py/test/test_netsim.py +52 -0
  1361. package/project/.sdk/tm/py/test/test_pipeline.py +606 -0
  1362. package/project/.sdk/tm/py/utility/feature_add.py +25 -1
  1363. package/project/.sdk/tm/py/utility/make_error.py +8 -0
  1364. package/project/.sdk/tm/py/utility/make_options.py +32 -0
  1365. package/project/.sdk/tm/py/utility/make_point.py +8 -2
  1366. package/project/.sdk/tm/py/utility/make_request.py +6 -2
  1367. package/project/.sdk/tm/py/utility/make_response.py +6 -2
  1368. package/project/.sdk/tm/py/utility/make_result.py +6 -2
  1369. package/project/.sdk/tm/py/utility/make_spec.py +6 -2
  1370. package/project/.sdk/tm/rb/core/context.rb +2 -0
  1371. package/project/.sdk/tm/rb/core/control.rb +5 -1
  1372. package/project/.sdk/tm/rb/core/result.rb +2 -1
  1373. package/project/.sdk/tm/rb/feature/audit_feature.rb +103 -0
  1374. package/project/.sdk/tm/rb/feature/base_feature.rb +5 -0
  1375. package/project/.sdk/tm/rb/feature/cache_feature.rb +133 -0
  1376. package/project/.sdk/tm/rb/feature/clienttrack_feature.rb +91 -0
  1377. package/project/.sdk/tm/rb/feature/debug_feature.rb +138 -0
  1378. package/project/.sdk/tm/rb/feature/idempotency_feature.rb +78 -0
  1379. package/project/.sdk/tm/rb/feature/metrics_feature.rb +91 -0
  1380. package/project/.sdk/tm/rb/feature/netsim_feature.rb +167 -0
  1381. package/project/.sdk/tm/rb/feature/paging_feature.rb +120 -0
  1382. package/project/.sdk/tm/rb/feature/proxy_feature.rb +93 -0
  1383. package/project/.sdk/tm/rb/feature/ratelimit_feature.rb +95 -0
  1384. package/project/.sdk/tm/rb/feature/rbac_feature.rb +96 -0
  1385. package/project/.sdk/tm/rb/feature/retry_feature.rb +116 -0
  1386. package/project/.sdk/tm/rb/feature/streaming_feature.rb +85 -0
  1387. package/project/.sdk/tm/rb/feature/telemetry_feature.rb +122 -0
  1388. package/project/.sdk/tm/rb/feature/test_feature.rb +65 -1
  1389. package/project/.sdk/tm/rb/feature/timeout_feature.rb +74 -0
  1390. package/project/.sdk/tm/rb/src/feature/audit/.gitkeep +0 -0
  1391. package/project/.sdk/tm/rb/src/feature/cache/.gitkeep +0 -0
  1392. package/project/.sdk/tm/rb/src/feature/clienttrack/.gitkeep +0 -0
  1393. package/project/.sdk/tm/rb/src/feature/debug/.gitkeep +0 -0
  1394. package/project/.sdk/tm/rb/src/feature/idempotency/.gitkeep +0 -0
  1395. package/project/.sdk/tm/rb/src/feature/metrics/.gitkeep +0 -0
  1396. package/project/.sdk/tm/rb/src/feature/netsim/.gitkeep +0 -0
  1397. package/project/.sdk/tm/rb/src/feature/paging/.gitkeep +0 -0
  1398. package/project/.sdk/tm/rb/src/feature/proxy/.gitkeep +0 -0
  1399. package/project/.sdk/tm/rb/src/feature/ratelimit/.gitkeep +0 -0
  1400. package/project/.sdk/tm/rb/src/feature/rbac/.gitkeep +0 -0
  1401. package/project/.sdk/tm/rb/src/feature/retry/.gitkeep +0 -0
  1402. package/project/.sdk/tm/rb/src/feature/streaming/.gitkeep +0 -0
  1403. package/project/.sdk/tm/rb/src/feature/telemetry/.gitkeep +0 -0
  1404. package/project/.sdk/tm/rb/src/feature/timeout/.gitkeep +0 -0
  1405. package/project/.sdk/tm/rb/test/feature_test.rb +1031 -0
  1406. package/project/.sdk/tm/rb/test/netsim_test.rb +48 -0
  1407. package/project/.sdk/tm/rb/test/pipeline_test.rb +584 -0
  1408. package/project/.sdk/tm/rb/utility/feature_add.rb +28 -1
  1409. package/project/.sdk/tm/rb/utility/make_error.rb +8 -0
  1410. package/project/.sdk/tm/rb/utility/make_options.rb +35 -0
  1411. package/project/.sdk/tm/rb/utility/make_point.rb +7 -1
  1412. package/project/.sdk/tm/rust/LICENSE +22 -0
  1413. package/project/.sdk/tm/rust/Makefile +41 -0
  1414. package/project/.sdk/tm/rust/VERSION +1 -0
  1415. package/project/.sdk/tm/rust/core/context.rs +320 -0
  1416. package/project/.sdk/tm/rust/core/control.rs +37 -0
  1417. package/project/.sdk/tm/rust/core/helpers.rs +168 -0
  1418. package/project/.sdk/tm/rust/core/mod.rs +18 -0
  1419. package/project/.sdk/tm/rust/core/operation.rs +35 -0
  1420. package/project/.sdk/tm/rust/core/point.rs +68 -0
  1421. package/project/.sdk/tm/rust/core/response.rs +38 -0
  1422. package/project/.sdk/tm/rust/core/result.rs +90 -0
  1423. package/project/.sdk/tm/rust/core/spec.rs +109 -0
  1424. package/project/.sdk/tm/rust/core/types.rs +105 -0
  1425. package/project/.sdk/tm/rust/core/utility_type.rs +184 -0
  1426. package/project/.sdk/tm/rust/feature/audit.rs +138 -0
  1427. package/project/.sdk/tm/rust/feature/base.rs +49 -0
  1428. package/project/.sdk/tm/rust/feature/cache.rs +198 -0
  1429. package/project/.sdk/tm/rust/feature/clienttrack.rs +154 -0
  1430. package/project/.sdk/tm/rust/feature/debug.rs +188 -0
  1431. package/project/.sdk/tm/rust/feature/idempotency.rs +139 -0
  1432. package/project/.sdk/tm/rust/feature/log.rs +114 -0
  1433. package/project/.sdk/tm/rust/feature/metrics.rs +136 -0
  1434. package/project/.sdk/tm/rust/feature/mod.rs +24 -0
  1435. package/project/.sdk/tm/rust/feature/netsim.rs +233 -0
  1436. package/project/.sdk/tm/rust/feature/paging.rs +209 -0
  1437. package/project/.sdk/tm/rust/feature/proxy.rs +165 -0
  1438. package/project/.sdk/tm/rust/feature/ratelimit.rs +116 -0
  1439. package/project/.sdk/tm/rust/feature/rbac.rs +152 -0
  1440. package/project/.sdk/tm/rust/feature/retry.rs +190 -0
  1441. package/project/.sdk/tm/rust/feature/streaming.rs +124 -0
  1442. package/project/.sdk/tm/rust/feature/support.rs +145 -0
  1443. package/project/.sdk/tm/rust/feature/telemetry.rs +185 -0
  1444. package/project/.sdk/tm/rust/feature/test.rs +397 -0
  1445. package/project/.sdk/tm/rust/feature/timeout.rs +103 -0
  1446. package/project/.sdk/tm/rust/src/feature/README.md +1 -0
  1447. package/project/.sdk/tm/rust/src/feature/audit/.gitkeep +0 -0
  1448. package/project/.sdk/tm/rust/src/feature/base/.gitkeep +0 -0
  1449. package/project/.sdk/tm/rust/src/feature/cache/.gitkeep +0 -0
  1450. package/project/.sdk/tm/rust/src/feature/clienttrack/.gitkeep +0 -0
  1451. package/project/.sdk/tm/rust/src/feature/debug/.gitkeep +0 -0
  1452. package/project/.sdk/tm/rust/src/feature/idempotency/.gitkeep +0 -0
  1453. package/project/.sdk/tm/rust/src/feature/log/.gitkeep +0 -0
  1454. package/project/.sdk/tm/rust/src/feature/metrics/.gitkeep +0 -0
  1455. package/project/.sdk/tm/rust/src/feature/netsim/.gitkeep +0 -0
  1456. package/project/.sdk/tm/rust/src/feature/paging/.gitkeep +0 -0
  1457. package/project/.sdk/tm/rust/src/feature/proxy/.gitkeep +0 -0
  1458. package/project/.sdk/tm/rust/src/feature/ratelimit/.gitkeep +0 -0
  1459. package/project/.sdk/tm/rust/src/feature/rbac/.gitkeep +0 -0
  1460. package/project/.sdk/tm/rust/src/feature/retry/.gitkeep +0 -0
  1461. package/project/.sdk/tm/rust/src/feature/streaming/.gitkeep +0 -0
  1462. package/project/.sdk/tm/rust/src/feature/telemetry/.gitkeep +0 -0
  1463. package/project/.sdk/tm/rust/src/feature/test/.gitkeep +0 -0
  1464. package/project/.sdk/tm/rust/src/feature/timeout/.gitkeep +0 -0
  1465. package/project/.sdk/tm/rust/tests/common/mod.rs +969 -0
  1466. package/project/.sdk/tm/rust/tests/custom_utility_test.rs +69 -0
  1467. package/project/.sdk/tm/rust/tests/feature_test.rs +1864 -0
  1468. package/project/.sdk/tm/rust/tests/netsim_test.rs +78 -0
  1469. package/project/.sdk/tm/rust/tests/pipeline_test.rs +699 -0
  1470. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +999 -0
  1471. package/project/.sdk/tm/rust/tests/sdk-test-control.json +19 -0
  1472. package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +424 -0
  1473. package/project/.sdk/tm/rust/tests/struct_utility_test.rs +733 -0
  1474. package/project/.sdk/tm/rust/utility/clean.rs +13 -0
  1475. package/project/.sdk/tm/rust/utility/done.rs +31 -0
  1476. package/project/.sdk/tm/rust/utility/feature_add.rs +46 -0
  1477. package/project/.sdk/tm/rust/utility/feature_hook.rs +18 -0
  1478. package/project/.sdk/tm/rust/utility/feature_init.rs +26 -0
  1479. package/project/.sdk/tm/rust/utility/fetcher.rs +142 -0
  1480. package/project/.sdk/tm/rust/utility/jsonparse.rs +211 -0
  1481. package/project/.sdk/tm/rust/utility/make_context.rs +7 -0
  1482. package/project/.sdk/tm/rust/utility/make_error.rs +79 -0
  1483. package/project/.sdk/tm/rust/utility/make_fetch_def.rs +42 -0
  1484. package/project/.sdk/tm/rust/utility/make_options.rs +175 -0
  1485. package/project/.sdk/tm/rust/utility/make_point.rs +116 -0
  1486. package/project/.sdk/tm/rust/utility/make_request.rs +73 -0
  1487. package/project/.sdk/tm/rust/utility/make_response.rs +56 -0
  1488. package/project/.sdk/tm/rust/utility/make_result.rs +64 -0
  1489. package/project/.sdk/tm/rust/utility/make_spec.rs +70 -0
  1490. package/project/.sdk/tm/rust/utility/make_url.rs +83 -0
  1491. package/project/.sdk/tm/rust/utility/mod.rs +36 -0
  1492. package/project/.sdk/tm/rust/utility/param.rs +67 -0
  1493. package/project/.sdk/tm/rust/utility/prepare_auth.rs +65 -0
  1494. package/project/.sdk/tm/rust/utility/prepare_body.rs +14 -0
  1495. package/project/.sdk/tm/rust/utility/prepare_headers.rs +23 -0
  1496. package/project/.sdk/tm/rust/utility/prepare_method.rs +18 -0
  1497. package/project/.sdk/tm/rust/utility/prepare_params.rs +33 -0
  1498. package/project/.sdk/tm/rust/utility/prepare_path.rs +17 -0
  1499. package/project/.sdk/tm/rust/utility/prepare_query.rs +47 -0
  1500. package/project/.sdk/tm/rust/utility/result_basic.rs +35 -0
  1501. package/project/.sdk/tm/rust/utility/result_body.rs +26 -0
  1502. package/project/.sdk/tm/rust/utility/result_headers.rs +24 -0
  1503. package/project/.sdk/tm/rust/utility/transform_request.rs +31 -0
  1504. package/project/.sdk/tm/rust/utility/transform_response.rs +55 -0
  1505. package/project/.sdk/tm/rust/utility/voxgigstruct/consts.rs +122 -0
  1506. package/project/.sdk/tm/rust/utility/voxgigstruct/major.rs +2688 -0
  1507. package/project/.sdk/tm/rust/utility/voxgigstruct/mini.rs +1081 -0
  1508. package/project/.sdk/tm/rust/utility/voxgigstruct/mod.rs +70 -0
  1509. package/project/.sdk/tm/rust/utility/voxgigstruct/ordered_map.rs +159 -0
  1510. package/project/.sdk/tm/rust/utility/voxgigstruct/re.rs +1229 -0
  1511. package/project/.sdk/tm/rust/utility/voxgigstruct/value.rs +372 -0
  1512. package/project/.sdk/tm/scala/LICENSE +22 -0
  1513. package/project/.sdk/tm/scala/Makefile +24 -0
  1514. package/project/.sdk/tm/scala/VERSION +1 -0
  1515. package/project/.sdk/tm/scala/core/Context.scala +160 -0
  1516. package/project/.sdk/tm/scala/core/Contracts.scala +76 -0
  1517. package/project/.sdk/tm/scala/core/Control.scala +23 -0
  1518. package/project/.sdk/tm/scala/core/Helpers.scala +38 -0
  1519. package/project/.sdk/tm/scala/core/Operation.scala +37 -0
  1520. package/project/.sdk/tm/scala/core/Point.scala +44 -0
  1521. package/project/.sdk/tm/scala/core/Response.scala +37 -0
  1522. package/project/.sdk/tm/scala/core/Result.scala +42 -0
  1523. package/project/.sdk/tm/scala/core/SdkClient.scala +220 -0
  1524. package/project/.sdk/tm/scala/core/SdkError.scala +15 -0
  1525. package/project/.sdk/tm/scala/core/Spec.scala +39 -0
  1526. package/project/.sdk/tm/scala/core/Types.scala +31 -0
  1527. package/project/.sdk/tm/scala/core/Utility.scala +85 -0
  1528. package/project/.sdk/tm/scala/feature/AuditFeature.scala +101 -0
  1529. package/project/.sdk/tm/scala/feature/BaseFeature.scala +21 -0
  1530. package/project/.sdk/tm/scala/feature/CacheFeature.scala +181 -0
  1531. package/project/.sdk/tm/scala/feature/ClienttrackFeature.scala +93 -0
  1532. package/project/.sdk/tm/scala/feature/DebugFeature.scala +149 -0
  1533. package/project/.sdk/tm/scala/feature/FeatureOptions.scala +111 -0
  1534. package/project/.sdk/tm/scala/feature/IdempotencyFeature.scala +106 -0
  1535. package/project/.sdk/tm/scala/feature/LogFeature.scala +64 -0
  1536. package/project/.sdk/tm/scala/feature/MetricsFeature.scala +105 -0
  1537. package/project/.sdk/tm/scala/feature/NetsimFeature.scala +134 -0
  1538. package/project/.sdk/tm/scala/feature/PagingFeature.scala +170 -0
  1539. package/project/.sdk/tm/scala/feature/ProxyFeature.scala +113 -0
  1540. package/project/.sdk/tm/scala/feature/RatelimitFeature.scala +58 -0
  1541. package/project/.sdk/tm/scala/feature/RbacFeature.scala +90 -0
  1542. package/project/.sdk/tm/scala/feature/RetryFeature.scala +104 -0
  1543. package/project/.sdk/tm/scala/feature/StreamingFeature.scala +98 -0
  1544. package/project/.sdk/tm/scala/feature/TelemetryFeature.scala +129 -0
  1545. package/project/.sdk/tm/scala/feature/TestFeature.scala +253 -0
  1546. package/project/.sdk/tm/scala/feature/TimeoutFeature.scala +57 -0
  1547. package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +766 -0
  1548. package/project/.sdk/tm/scala/sdktest/SdkTestSupport.scala +93 -0
  1549. package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
  1550. package/project/.sdk/tm/scala/sdktest/sdk-test-control.json +19 -0
  1551. package/project/.sdk/tm/scala/src/feature/README.md +1 -0
  1552. package/project/.sdk/tm/scala/src/feature/audit/.gitkeep +0 -0
  1553. package/project/.sdk/tm/scala/src/feature/base/.gitkeep +0 -0
  1554. package/project/.sdk/tm/scala/src/feature/cache/.gitkeep +0 -0
  1555. package/project/.sdk/tm/scala/src/feature/clienttrack/.gitkeep +0 -0
  1556. package/project/.sdk/tm/scala/src/feature/debug/.gitkeep +0 -0
  1557. package/project/.sdk/tm/scala/src/feature/idempotency/.gitkeep +0 -0
  1558. package/project/.sdk/tm/scala/src/feature/log/.gitkeep +0 -0
  1559. package/project/.sdk/tm/scala/src/feature/metrics/.gitkeep +0 -0
  1560. package/project/.sdk/tm/scala/src/feature/netsim/.gitkeep +0 -0
  1561. package/project/.sdk/tm/scala/src/feature/paging/.gitkeep +0 -0
  1562. package/project/.sdk/tm/scala/src/feature/proxy/.gitkeep +0 -0
  1563. package/project/.sdk/tm/scala/src/feature/ratelimit/.gitkeep +0 -0
  1564. package/project/.sdk/tm/scala/src/feature/rbac/.gitkeep +0 -0
  1565. package/project/.sdk/tm/scala/src/feature/retry/.gitkeep +0 -0
  1566. package/project/.sdk/tm/scala/src/feature/streaming/.gitkeep +0 -0
  1567. package/project/.sdk/tm/scala/src/feature/telemetry/.gitkeep +0 -0
  1568. package/project/.sdk/tm/scala/src/feature/test/.gitkeep +0 -0
  1569. package/project/.sdk/tm/scala/src/feature/timeout/.gitkeep +0 -0
  1570. package/project/.sdk/tm/scala/utility/FeatureUtils.scala +68 -0
  1571. package/project/.sdk/tm/scala/utility/Fetcher.scala +129 -0
  1572. package/project/.sdk/tm/scala/utility/Json.java +268 -0
  1573. package/project/.sdk/tm/scala/utility/Make.scala +463 -0
  1574. package/project/.sdk/tm/scala/utility/MakeSpec.scala +49 -0
  1575. package/project/.sdk/tm/scala/utility/Misc.scala +68 -0
  1576. package/project/.sdk/tm/scala/utility/Prepare.scala +142 -0
  1577. package/project/.sdk/tm/scala/utility/Register.scala +38 -0
  1578. package/project/.sdk/tm/scala/utility/Results.scala +63 -0
  1579. package/project/.sdk/tm/scala/utility/StructUtility.scala +29 -0
  1580. package/project/.sdk/tm/scala/utility/Transform.scala +52 -0
  1581. package/project/.sdk/tm/scala/utility/struct/Struct.java +3550 -0
  1582. package/project/.sdk/tm/scala/utility/struct/voxgig_struct.scala +1833 -0
  1583. package/project/.sdk/tm/swift/LICENSE +22 -0
  1584. package/project/.sdk/tm/swift/Makefile +41 -0
  1585. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +113 -0
  1586. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +260 -0
  1587. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +111 -0
  1588. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/JSON.swift +327 -0
  1589. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Merge.swift +55 -0
  1590. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +601 -0
  1591. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/OrderedDictionary.swift +79 -0
  1592. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Path.swift +157 -0
  1593. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Select.swift +259 -0
  1594. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Transform.swift +462 -0
  1595. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +378 -0
  1596. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Value.swift +184 -0
  1597. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Walk.swift +44 -0
  1598. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +161 -0
  1599. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Control.swift +20 -0
  1600. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Operation.swift +27 -0
  1601. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Point.swift +37 -0
  1602. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Response.swift +29 -0
  1603. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Result.swift +41 -0
  1604. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Spec.swift +36 -0
  1605. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Support.swift +98 -0
  1606. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Types.swift +25 -0
  1607. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Utility.swift +81 -0
  1608. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/AuditFeature.swift +99 -0
  1609. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/BaseFeature.swift +60 -0
  1610. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/CacheFeature.swift +164 -0
  1611. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/ClienttrackFeature.swift +95 -0
  1612. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/DebugFeature.swift +126 -0
  1613. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/FeatureOptions.swift +96 -0
  1614. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/IdempotencyFeature.swift +80 -0
  1615. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/LogFeature.swift +69 -0
  1616. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/MetricsFeature.swift +103 -0
  1617. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/NetsimFeature.swift +177 -0
  1618. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/PagingFeature.swift +154 -0
  1619. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/ProxyFeature.swift +122 -0
  1620. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RatelimitFeature.swift +79 -0
  1621. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RbacFeature.swift +103 -0
  1622. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RetryFeature.swift +150 -0
  1623. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/StreamingFeature.swift +82 -0
  1624. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TelemetryFeature.swift +119 -0
  1625. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TestFeature.swift +257 -0
  1626. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TimeoutFeature.swift +83 -0
  1627. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Feature.swift +56 -0
  1628. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Fetcher.swift +107 -0
  1629. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Make.swift +321 -0
  1630. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeError.swift +56 -0
  1631. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +151 -0
  1632. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +157 -0
  1633. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Register.swift +40 -0
  1634. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +107 -0
  1635. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/CustomUtilityTest.swift +44 -0
  1636. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/ExistsTest.swift +12 -0
  1637. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/FeatureTest.swift +1049 -0
  1638. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/NetsimTest.swift +50 -0
  1639. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PipelineTest.swift +398 -0
  1640. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +750 -0
  1641. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +237 -0
  1642. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +523 -0
  1643. package/project/.sdk/tm/swift/VERSION +1 -0
  1644. package/project/.sdk/tm/swift/src/feature/README.md +6 -0
  1645. package/project/.sdk/tm/swift/src/feature/audit/.gitkeep +0 -0
  1646. package/project/.sdk/tm/swift/src/feature/base/.gitkeep +0 -0
  1647. package/project/.sdk/tm/swift/src/feature/cache/.gitkeep +0 -0
  1648. package/project/.sdk/tm/swift/src/feature/clienttrack/.gitkeep +0 -0
  1649. package/project/.sdk/tm/swift/src/feature/debug/.gitkeep +0 -0
  1650. package/project/.sdk/tm/swift/src/feature/idempotency/.gitkeep +0 -0
  1651. package/project/.sdk/tm/swift/src/feature/log/.gitkeep +0 -0
  1652. package/project/.sdk/tm/swift/src/feature/metrics/.gitkeep +0 -0
  1653. package/project/.sdk/tm/swift/src/feature/netsim/.gitkeep +0 -0
  1654. package/project/.sdk/tm/swift/src/feature/paging/.gitkeep +0 -0
  1655. package/project/.sdk/tm/swift/src/feature/proxy/.gitkeep +0 -0
  1656. package/project/.sdk/tm/swift/src/feature/ratelimit/.gitkeep +0 -0
  1657. package/project/.sdk/tm/swift/src/feature/rbac/.gitkeep +0 -0
  1658. package/project/.sdk/tm/swift/src/feature/retry/.gitkeep +0 -0
  1659. package/project/.sdk/tm/swift/src/feature/streaming/.gitkeep +0 -0
  1660. package/project/.sdk/tm/swift/src/feature/telemetry/.gitkeep +0 -0
  1661. package/project/.sdk/tm/swift/src/feature/test/.gitkeep +0 -0
  1662. package/project/.sdk/tm/swift/src/feature/timeout/.gitkeep +0 -0
  1663. package/project/.sdk/tm/ts/Makefile +6 -1
  1664. package/project/.sdk/tm/ts/src/feature/audit/AuditFeature.ts +98 -0
  1665. package/project/.sdk/tm/ts/src/feature/cache/CacheFeature.ts +152 -0
  1666. package/project/.sdk/tm/ts/src/feature/clienttrack/ClienttrackFeature.ts +106 -0
  1667. package/project/.sdk/tm/ts/src/feature/debug/DebugFeature.ts +134 -0
  1668. package/project/.sdk/tm/ts/src/feature/idempotency/IdempotencyFeature.ts +97 -0
  1669. package/project/.sdk/tm/ts/src/feature/metrics/MetricsFeature.ts +104 -0
  1670. package/project/.sdk/tm/ts/src/feature/netsim/NetsimFeature.ts +189 -0
  1671. package/project/.sdk/tm/ts/src/feature/paging/PagingFeature.ts +141 -0
  1672. package/project/.sdk/tm/ts/src/feature/proxy/ProxyFeature.ts +112 -0
  1673. package/project/.sdk/tm/ts/src/feature/ratelimit/RatelimitFeature.ts +108 -0
  1674. package/project/.sdk/tm/ts/src/feature/rbac/RbacFeature.ts +104 -0
  1675. package/project/.sdk/tm/ts/src/feature/retry/RetryFeature.ts +160 -0
  1676. package/project/.sdk/tm/ts/src/feature/streaming/StreamingFeature.ts +98 -0
  1677. package/project/.sdk/tm/ts/src/feature/telemetry/TelemetryFeature.ts +130 -0
  1678. package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +58 -1
  1679. package/project/.sdk/tm/ts/src/feature/timeout/TimeoutFeature.ts +103 -0
  1680. package/project/.sdk/tm/ts/src/utility/FeatureHookUtility.ts +4 -1
  1681. package/project/.sdk/tm/ts/src/utility/MakeErrorUtility.ts +9 -0
  1682. package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +31 -1
  1683. package/project/.sdk/tm/ts/test/feature/harness.ts +293 -0
  1684. package/project/.sdk/tm/ts/test/feature.test.ts +772 -0
  1685. package/project/.sdk/tm/ts/test/netsim.test.ts +43 -0
  1686. package/project/.sdk/tm/ts/test/pipeline.test.ts +382 -0
  1687. package/project/.sdk/tm/zig/LICENSE +21 -0
  1688. package/project/.sdk/tm/zig/Makefile +31 -0
  1689. package/project/.sdk/tm/zig/VERSION +1 -0
  1690. package/project/.sdk/tm/zig/build.zig +58 -0
  1691. package/project/.sdk/tm/zig/build.zig.zon +11 -0
  1692. package/project/.sdk/tm/zig/core/context.zig +258 -0
  1693. package/project/.sdk/tm/zig/core/control.zig +26 -0
  1694. package/project/.sdk/tm/zig/core/error.zig +28 -0
  1695. package/project/.sdk/tm/zig/core/helpers.zig +326 -0
  1696. package/project/.sdk/tm/zig/core/mem.zig +20 -0
  1697. package/project/.sdk/tm/zig/core/operation.zig +34 -0
  1698. package/project/.sdk/tm/zig/core/point.zig +63 -0
  1699. package/project/.sdk/tm/zig/core/response.zig +32 -0
  1700. package/project/.sdk/tm/zig/core/result.zig +73 -0
  1701. package/project/.sdk/tm/zig/core/spec.zig +68 -0
  1702. package/project/.sdk/tm/zig/core/types.zig +101 -0
  1703. package/project/.sdk/tm/zig/core/utility.zig +1115 -0
  1704. package/project/.sdk/tm/zig/feature/audit.zig +131 -0
  1705. package/project/.sdk/tm/zig/feature/base.zig +52 -0
  1706. package/project/.sdk/tm/zig/feature/cache.zig +216 -0
  1707. package/project/.sdk/tm/zig/feature/clienttrack.zig +129 -0
  1708. package/project/.sdk/tm/zig/feature/debug.zig +191 -0
  1709. package/project/.sdk/tm/zig/feature/idempotency.zig +121 -0
  1710. package/project/.sdk/tm/zig/feature/log.zig +93 -0
  1711. package/project/.sdk/tm/zig/feature/metrics.zig +145 -0
  1712. package/project/.sdk/tm/zig/feature/netsim.zig +186 -0
  1713. package/project/.sdk/tm/zig/feature/paging.zig +201 -0
  1714. package/project/.sdk/tm/zig/feature/proxy.zig +180 -0
  1715. package/project/.sdk/tm/zig/feature/ratelimit.zig +123 -0
  1716. package/project/.sdk/tm/zig/feature/rbac.zig +126 -0
  1717. package/project/.sdk/tm/zig/feature/retry.zig +167 -0
  1718. package/project/.sdk/tm/zig/feature/streaming.zig +127 -0
  1719. package/project/.sdk/tm/zig/feature/support.zig +128 -0
  1720. package/project/.sdk/tm/zig/feature/telemetry.zig +165 -0
  1721. package/project/.sdk/tm/zig/feature/test.zig +315 -0
  1722. package/project/.sdk/tm/zig/feature/timeout.zig +105 -0
  1723. package/project/.sdk/tm/zig/root.zig +74 -0
  1724. package/project/.sdk/tm/zig/src/feature/README.md +1 -0
  1725. package/project/.sdk/tm/zig/src/feature/audit/.gitkeep +0 -0
  1726. package/project/.sdk/tm/zig/src/feature/base/.gitkeep +0 -0
  1727. package/project/.sdk/tm/zig/src/feature/cache/.gitkeep +0 -0
  1728. package/project/.sdk/tm/zig/src/feature/clienttrack/.gitkeep +0 -0
  1729. package/project/.sdk/tm/zig/src/feature/debug/.gitkeep +0 -0
  1730. package/project/.sdk/tm/zig/src/feature/idempotency/.gitkeep +0 -0
  1731. package/project/.sdk/tm/zig/src/feature/log/.gitkeep +0 -0
  1732. package/project/.sdk/tm/zig/src/feature/metrics/.gitkeep +0 -0
  1733. package/project/.sdk/tm/zig/src/feature/netsim/.gitkeep +0 -0
  1734. package/project/.sdk/tm/zig/src/feature/paging/.gitkeep +0 -0
  1735. package/project/.sdk/tm/zig/src/feature/proxy/.gitkeep +0 -0
  1736. package/project/.sdk/tm/zig/src/feature/ratelimit/.gitkeep +0 -0
  1737. package/project/.sdk/tm/zig/src/feature/rbac/.gitkeep +0 -0
  1738. package/project/.sdk/tm/zig/src/feature/retry/.gitkeep +0 -0
  1739. package/project/.sdk/tm/zig/src/feature/streaming/.gitkeep +0 -0
  1740. package/project/.sdk/tm/zig/src/feature/telemetry/.gitkeep +0 -0
  1741. package/project/.sdk/tm/zig/src/feature/test/.gitkeep +0 -0
  1742. package/project/.sdk/tm/zig/src/feature/timeout/.gitkeep +0 -0
  1743. package/project/.sdk/tm/zig/test/feature_test.zig +1045 -0
  1744. package/project/.sdk/tm/zig/test/fh.zig +531 -0
  1745. package/project/.sdk/tm/zig/test/gotcha_test.zig +230 -0
  1746. package/project/.sdk/tm/zig/test/pipeline_test.zig +493 -0
  1747. package/project/.sdk/tm/zig/test/primary_utility_test.zig +346 -0
  1748. package/project/.sdk/tm/zig/test/struct_corpus.zig +1145 -0
  1749. package/project/.sdk/tm/zig/test/struct_runner.zig +226 -0
  1750. package/project/.sdk/tm/zig/utility/jsonparse.zig +13 -0
  1751. package/project/.sdk/tm/zig/utility/voxgigstruct/regex.zig +779 -0
  1752. package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +4400 -0
  1753. package/src/cmp/AgentGuide.ts +150 -0
  1754. package/src/cmp/AgentGuideContent.ts +286 -0
  1755. package/src/cmp/AgentGuideFeature.ts +107 -0
  1756. package/src/cmp/AgentGuideTop.ts +121 -0
  1757. package/src/cmp/ReadmeTop.ts +16 -3
  1758. package/src/sdkgen.ts +6 -0
@@ -0,0 +1,3550 @@
1
+ // Vendored from github.com/voxgig/struct java/src/Struct.java — do not edit here;
2
+ // upstream is the voxgig struct java port. Package adjusted for the ProjectName SDK.
3
+ package SCALAPACKAGE.utility.struct;
4
+
5
+
6
+ import java.net.URLEncoder;
7
+ import java.nio.charset.StandardCharsets;
8
+ import java.util.ArrayList;
9
+ import java.util.Collections;
10
+ import java.util.Comparator;
11
+ import java.util.IdentityHashMap;
12
+ import java.util.LinkedHashMap;
13
+ import java.util.List;
14
+ import java.util.Locale;
15
+ import java.util.Map;
16
+ import java.util.Objects;
17
+ import java.util.function.Function;
18
+ import java.util.function.Supplier;
19
+ import java.util.regex.Matcher;
20
+ import java.util.regex.Pattern;
21
+
22
+ @SuppressWarnings({"unchecked", "rawtypes"})
23
+ public class Struct {
24
+ private Struct() {}
25
+
26
+ /**
27
+ * "No value" sentinel — distinct from {@code null} (which is JSON null).
28
+ * Mirrors TypeScript's {@code undefined} for the canonical port.
29
+ */
30
+ public static final Object UNDEF = new Object();
31
+
32
+ /**
33
+ * Sentinel returned from a transform/inject step to delete the current key.
34
+ * Always compared with {@code ==} identity (never {@code .equals()}). Mirrors
35
+ * the TS marker {@code {`$DELETE`: true}}; declared as {@link Map} so it can
36
+ * survive a pass through {@link #inject(Object, Object)} without losing
37
+ * structural shape, while {@link #clone(Object)} short-circuits to preserve
38
+ * identity.
39
+ */
40
+ public static final Map<String, Object> DELETE = makeSentinelMap("`$DELETE`");
41
+
42
+ private static final String S_MT = "";
43
+
44
+ public static final String S_DTOP = "$TOP";
45
+ public static final String S_DSPEC = "$SPEC";
46
+ public static final String S_DKEY = "$KEY";
47
+ public static final String S_DERRS = "$ERRS";
48
+ private static final String S_DT = ".";
49
+
50
+ // Inject mode bitfield (TS lines 60–62).
51
+ public static final int M_KEYPRE = 1;
52
+ public static final int M_KEYPOST = 2;
53
+ public static final int M_VAL = 4;
54
+
55
+ // Default max recursive depth (walk, merge, etc).
56
+ public static final int MAXDEPTH = 32;
57
+
58
+ /** Maps mode bit to its human-readable name. */
59
+ public static final Map<Integer, String> MODENAME;
60
+
61
+ /** Maps mode bit to a placement label used in error messages. */
62
+ public static final Map<Integer, String> PLACEMENT;
63
+
64
+ static {
65
+ Map<Integer, String> mn = new LinkedHashMap<>();
66
+ mn.put(M_VAL, "val");
67
+ mn.put(M_KEYPRE, "key:pre");
68
+ mn.put(M_KEYPOST, "key:post");
69
+ MODENAME = Collections.unmodifiableMap(mn);
70
+
71
+ Map<Integer, String> pl = new LinkedHashMap<>();
72
+ pl.put(M_VAL, "value");
73
+ pl.put(M_KEYPRE, "key");
74
+ pl.put(M_KEYPOST, "key");
75
+ PLACEMENT = Collections.unmodifiableMap(pl);
76
+ }
77
+
78
+ private static final Pattern R_META_PATH = Pattern.compile("^([^$]+)\\$([=~])(.+)$");
79
+ private static final Pattern R_INJECT_FULL = Pattern.compile("^`(\\$[A-Z]+|[^`]*)[0-9]*`$");
80
+ private static final Pattern R_INJECT_PART = Pattern.compile("`([^`]+)`");
81
+ private static final Pattern R_CMD_KEY = Pattern.compile("^`(\\$[A-Z]+)(\\d*)`$");
82
+ private static final Pattern R_BT_ESCAPE = Pattern.compile("\\$BT");
83
+ private static final Pattern R_DS_ESCAPE = Pattern.compile("\\$DS");
84
+ private static final Pattern R_TRANSFORM_NAME = Pattern.compile("`\\$([A-Z]+)`");
85
+ private static final Pattern R_DOUBLE_DOLLAR = Pattern.compile("\\$\\$");
86
+ private static final Pattern R_CLONE_REF = Pattern.compile("^`\\$REF:([0-9]+)`$");
87
+
88
+ /**
89
+ * Sentinel returned from a transform/inject step to omit the current key.
90
+ * Always compared with {@code ==} identity. See {@link #DELETE} for the
91
+ * marker-map rationale.
92
+ */
93
+ public static final Map<String, Object> SKIP = makeSentinelMap("`$SKIP`");
94
+
95
+ private static Map<String, Object> makeSentinelMap(String name) {
96
+ Map<String, Object> m = new LinkedHashMap<>();
97
+ m.put(name, true);
98
+ return Collections.unmodifiableMap(m);
99
+ }
100
+
101
+ /**
102
+ * Walk callback. Root key is {@code null}; otherwise key is the property
103
+ * name (or list-index string) of {@code val} inside {@code parent}.
104
+ * {@code path} is the dotted ancestor key chain ending in {@code key}.
105
+ */
106
+ @FunctionalInterface
107
+ public interface WalkApply {
108
+ Object apply(String key, Object val, Object parent, List<String> path);
109
+ }
110
+
111
+ /**
112
+ * Inject step handler. Mirrors TS {@code Injector}.
113
+ * The {@code inj} parameter will be tightened to {@code Injection} once the
114
+ * {@code Injection} class lands (step 4); callers should pass the same value
115
+ * through unchanged.
116
+ */
117
+ @FunctionalInterface
118
+ public interface Injector {
119
+ Object apply(Object inj, Object val, String ref, Object store);
120
+ }
121
+
122
+ /**
123
+ * Custom modification applied during {@link #inject} / {@link #transform} / {@link #validate}.
124
+ * Mirrors TS {@code Modify}.
125
+ */
126
+ @FunctionalInterface
127
+ public interface Modify {
128
+ void apply(Object val, Object key, Object parent, Object inj, Object store);
129
+ }
130
+
131
+ public static final int T_any = (1 << 31) - 1;
132
+ public static final int T_noval = 1 << 30;
133
+ public static final int T_boolean = 1 << 29;
134
+ public static final int T_decimal = 1 << 28;
135
+ public static final int T_integer = 1 << 27;
136
+ public static final int T_number = 1 << 26;
137
+ public static final int T_string = 1 << 25;
138
+ public static final int T_function = 1 << 24;
139
+ public static final int T_symbol = 1 << 23;
140
+ public static final int T_null = 1 << 22;
141
+ public static final int T_list = 1 << 14;
142
+ public static final int T_map = 1 << 13;
143
+ public static final int T_instance = 1 << 12;
144
+ public static final int T_scalar = 1 << 7;
145
+ public static final int T_node = 1 << 6;
146
+
147
+ private static final String[] TYPENAME = {
148
+ "any", "nil", "boolean", "decimal", "integer", "number", "string",
149
+ "function", "symbol", "null",
150
+ "", "", "", "", "", "", "",
151
+ "list", "map", "instance",
152
+ "", "", "", "",
153
+ "scalar", "node"
154
+ };
155
+
156
+ public interface ItemCheck {
157
+ boolean test(List<Object> item);
158
+ }
159
+
160
+ public static boolean isnode(Object val) {
161
+ return val instanceof Map || val instanceof List;
162
+ }
163
+
164
+ public static boolean ismap(Object val) {
165
+ return val instanceof Map;
166
+ }
167
+
168
+ public static boolean islist(Object val) {
169
+ return val instanceof List;
170
+ }
171
+
172
+ public static boolean iskey(Object key) {
173
+ if (key == null || key == UNDEF) {
174
+ return false;
175
+ }
176
+ if (key instanceof String s) {
177
+ return !s.isEmpty();
178
+ }
179
+ return key instanceof Number;
180
+ }
181
+
182
+ public static String strkey(Object key) {
183
+ if (key == null || key == UNDEF) {
184
+ return S_MT;
185
+ }
186
+ int t = typify(key);
187
+ if ((t & T_string) != 0) {
188
+ return (String) key;
189
+ }
190
+ if ((t & T_number) != 0) {
191
+ double d = ((Number) key).doubleValue();
192
+ if (Math.floor(d) == d) {
193
+ return Long.toString((long) d);
194
+ }
195
+ return Long.toString((long) Math.floor(d));
196
+ }
197
+ return S_MT;
198
+ }
199
+
200
+ public static boolean isempty(Object val) {
201
+ if (val == null || val == UNDEF) {
202
+ return true;
203
+ }
204
+ if (val instanceof String s) {
205
+ return s.isEmpty();
206
+ }
207
+ if (val instanceof List<?> l) {
208
+ return l.isEmpty();
209
+ }
210
+ if (val instanceof Map<?, ?> m) {
211
+ return m.isEmpty();
212
+ }
213
+ return false;
214
+ }
215
+
216
+ public static boolean isfunc(Object val) {
217
+ return val instanceof Function
218
+ || val instanceof Supplier
219
+ || val instanceof Injector
220
+ || val instanceof Modify;
221
+ }
222
+
223
+ public static Object getdef(Object val, Object alt) {
224
+ return (val == UNDEF) ? alt : val;
225
+ }
226
+
227
+ public static int size(Object val) {
228
+ if (val instanceof List<?> l) {
229
+ return l.size();
230
+ }
231
+ if (val instanceof Map<?, ?> m) {
232
+ return m.size();
233
+ }
234
+ if (val instanceof String s) {
235
+ return s.length();
236
+ }
237
+ if (val instanceof Number n) {
238
+ return (int) Math.floor(n.doubleValue());
239
+ }
240
+ if (val instanceof Boolean b) {
241
+ return b ? 1 : 0;
242
+ }
243
+ return 0;
244
+ }
245
+
246
+ public static int typify(Object value) {
247
+ if (value == UNDEF) {
248
+ return T_noval;
249
+ }
250
+ if (value == null) {
251
+ return T_scalar | T_null;
252
+ }
253
+ if (value instanceof Number n) {
254
+ double d = n.doubleValue();
255
+ if (Double.isNaN(d)) {
256
+ return T_noval;
257
+ }
258
+ if (Math.floor(d) == d) {
259
+ return T_scalar | T_number | T_integer;
260
+ }
261
+ return T_scalar | T_number | T_decimal;
262
+ }
263
+ if (value instanceof String) {
264
+ return T_scalar | T_string;
265
+ }
266
+ if (value instanceof Boolean) {
267
+ return T_scalar | T_boolean;
268
+ }
269
+ if (value instanceof Function
270
+ || value instanceof Supplier
271
+ || value instanceof Injector
272
+ || value instanceof Modify) {
273
+ return T_scalar | T_function;
274
+ }
275
+ if (value instanceof List) {
276
+ return T_node | T_list;
277
+ }
278
+ if (value instanceof Map) {
279
+ return T_node | T_map;
280
+ }
281
+ return T_node | T_instance;
282
+ }
283
+
284
+ public static String typename(Object tValue) {
285
+ if (!(tValue instanceof Number n)) {
286
+ return "any";
287
+ }
288
+ return typename(n.intValue());
289
+ }
290
+
291
+ /**
292
+ * TS-canonical {@code typename(t)}: human-readable name for a type bit-flag
293
+ * returned by {@link #typify(Object)}. The flag with the highest set bit
294
+ * (lowest leading-zero count) wins.
295
+ */
296
+ public static String typename(int t) {
297
+ if (t == 0) {
298
+ return "any";
299
+ }
300
+ int idx = Integer.numberOfLeadingZeros(t);
301
+ if (idx < 0 || idx >= TYPENAME.length) {
302
+ return "any";
303
+ }
304
+ String out = TYPENAME[idx];
305
+ return out.isEmpty() ? "any" : out;
306
+ }
307
+
308
+ public static List<String> keysof(Object val) {
309
+ if (!isnode(val)) {
310
+ return new ArrayList<>();
311
+ }
312
+ if (val instanceof List<?> l) {
313
+ List<String> out = new ArrayList<>(l.size());
314
+ for (int i = 0; i < l.size(); i++) {
315
+ out.add(Integer.toString(i));
316
+ }
317
+ return out;
318
+ }
319
+ Map<Object, Object> m = (Map<Object, Object>) val;
320
+ List<String> out = new ArrayList<>();
321
+ for (Object k : m.keySet()) {
322
+ out.add(Objects.toString(k));
323
+ }
324
+ out.sort(Comparator.naturalOrder());
325
+ return out;
326
+ }
327
+
328
+ public static boolean haskey(Object val, Object key) {
329
+ // Group A rule: a key whose stored value is JSON null counts as "no value".
330
+ // getprop unifies null/absent to the alt (UNDEF here), so a present-but-null
331
+ // key yields UNDEF → false. Mirrors canonical TS `null != getprop(val,key)`.
332
+ return getprop(val, key, UNDEF) != UNDEF;
333
+ }
334
+
335
+ public static List<List<Object>> items(Object val) {
336
+ List<List<Object>> out = new ArrayList<>();
337
+ if (!isnode(val)) {
338
+ return out;
339
+ }
340
+ for (String k : keysof(val)) {
341
+ List<Object> item = new ArrayList<>(2);
342
+ item.add(k);
343
+ // Group B raw read: canonical items uses val[k], preserving a stored
344
+ // JSON null (the Group A getprop would unify it to UNDEF).
345
+ item.add(lookup(val, k));
346
+ out.add(item);
347
+ }
348
+ return out;
349
+ }
350
+
351
+ public static Object getelem(Object val, Object key) {
352
+ return getelem(val, key, UNDEF);
353
+ }
354
+
355
+ public static Object getelem(Object val, Object key, Object alt) {
356
+ if (!(val instanceof List<?> list) || key == null || key == UNDEF) {
357
+ if (alt instanceof Function<?, ?> f) {
358
+ return ((Function<Object, Object>) f).apply(null);
359
+ }
360
+ return alt;
361
+ }
362
+
363
+ Integer idx = parseIntKey(key);
364
+ if (idx == null || !isIntegerKeyString(key)) {
365
+ if (alt instanceof Function<?, ?> f) {
366
+ return ((Function<Object, Object>) f).apply(null);
367
+ }
368
+ return alt;
369
+ }
370
+
371
+ if (idx < 0) {
372
+ idx = list.size() + idx;
373
+ }
374
+ if (idx < 0 || idx >= list.size()) {
375
+ if (alt instanceof Function<?, ?> f) {
376
+ return ((Function<Object, Object>) f).apply(null);
377
+ }
378
+ return alt;
379
+ }
380
+
381
+ Object out = list.get(idx);
382
+ // Group A null-unification: a JSON null (or absent) slot counts as "no
383
+ // value" — return the alt. Mirrors canonical TS getelem `if (null == out)`.
384
+ if (out == null || out == UNDEF) {
385
+ if (alt instanceof Function<?, ?> f) {
386
+ return ((Function<Object, Object>) f).apply(null);
387
+ }
388
+ return alt;
389
+ }
390
+ return out;
391
+ }
392
+
393
+ public static Object getprop(Object val, Object key) {
394
+ return getprop(val, key, UNDEF);
395
+ }
396
+
397
+ public static Object getprop(Object val, Object key, Object alt) {
398
+ if (val == null || val == UNDEF || key == null || key == UNDEF) {
399
+ return alt;
400
+ }
401
+
402
+ Object out = UNDEF;
403
+
404
+ if (val instanceof Map<?, ?> m) {
405
+ String sk = strkey(key);
406
+ if (m.containsKey(sk)) {
407
+ out = ((Map<Object, Object>) m).get(sk);
408
+ }
409
+ } else if (val instanceof List<?> l) {
410
+ Integer idx = parseIntKey(key);
411
+ if (idx != null && idx >= 0 && idx < l.size()) {
412
+ out = l.get(idx);
413
+ }
414
+ }
415
+
416
+ // Group A null-unification: a stored JSON null (or absent) at the key is
417
+ // treated as "no value" — return the alternative. Mirrors canonical TS
418
+ // getprop `if (null == out) return alt`. Group B callers needing the raw
419
+ // stored null use {@link #lookup}.
420
+ if (out == null || out == UNDEF) {
421
+ return alt;
422
+ }
423
+
424
+ return out;
425
+ }
426
+
427
+ /**
428
+ * Group B raw value lookup: read the literally-stored value at a slot,
429
+ * preserving JSON {@code null}. Returns {@link #UNDEF} when the key is absent
430
+ * or the container is not a node. Mirrors canonical TS {@code _lookup} — used
431
+ * by validate / transform / inject internals that must distinguish a stored
432
+ * null from absence (where the public getprop/getelem unify the two).
433
+ */
434
+ public static Object lookup(Object val, Object key) {
435
+ if (val == null || val == UNDEF || key == null || key == UNDEF) {
436
+ return UNDEF;
437
+ }
438
+ if (val instanceof Map<?, ?> m) {
439
+ String sk = strkey(key);
440
+ return m.containsKey(sk) ? ((Map<Object, Object>) m).get(sk) : UNDEF;
441
+ }
442
+ if (val instanceof List<?> l) {
443
+ Integer idx = parseIntKey(key);
444
+ if (idx == null) {
445
+ return UNDEF;
446
+ }
447
+ int i = idx < 0 ? l.size() + idx : idx;
448
+ if (i < 0 || i >= l.size()) {
449
+ return UNDEF;
450
+ }
451
+ return l.get(i);
452
+ }
453
+ return UNDEF;
454
+ }
455
+
456
+ public static Object setprop(Object parent, Object key, Object val) {
457
+ if (!iskey(key)) {
458
+ return parent;
459
+ }
460
+
461
+ if (parent instanceof Map<?, ?>) {
462
+ Map<Object, Object> m = (Map<Object, Object>) parent;
463
+ m.put(strkey(key), val);
464
+ return parent;
465
+ }
466
+
467
+ if (parent instanceof List<?>) {
468
+ List<Object> l = (List<Object>) parent;
469
+ Integer idx = parseIntKey(key);
470
+ if (idx == null) {
471
+ return parent;
472
+ }
473
+ idx = (int) Math.floor(idx);
474
+
475
+ if (val == null) {
476
+ if (idx >= 0 && idx < l.size()) {
477
+ l.remove((int) idx);
478
+ }
479
+ return l;
480
+ }
481
+
482
+ if (idx >= 0) {
483
+ int target = Math.min(Math.max(idx, 0), l.size());
484
+ if (target < l.size()) {
485
+ l.set(target, val);
486
+ } else {
487
+ l.add(val);
488
+ }
489
+ } else {
490
+ l.add(0, val);
491
+ }
492
+ return l;
493
+ }
494
+
495
+ return parent;
496
+ }
497
+
498
+ public static Object delprop(Object parent, Object key) {
499
+ if (!iskey(key)) {
500
+ return parent;
501
+ }
502
+
503
+ if (parent instanceof Map<?, ?> m) {
504
+ ((Map<Object, Object>) m).remove(strkey(key));
505
+ return parent;
506
+ }
507
+
508
+ if (parent instanceof List<?> l) {
509
+ Integer idx = parseIntKey(key);
510
+ if (idx != null && idx >= 0 && idx < l.size()) {
511
+ ((List<Object>) l).remove((int) idx);
512
+ }
513
+ return parent;
514
+ }
515
+
516
+ return parent;
517
+ }
518
+
519
+ public static boolean isIntegerKeyString(Object key) {
520
+ if (key instanceof Number) {
521
+ return true;
522
+ }
523
+ if (!(key instanceof String s)) {
524
+ return false;
525
+ }
526
+ return s.matches("^[-0-9]+$");
527
+ }
528
+
529
+ private static Integer parseIntKey(Object key) {
530
+ if (key instanceof Number n) {
531
+ return (int) Math.floor(n.doubleValue());
532
+ }
533
+ if (key instanceof String s) {
534
+ try {
535
+ return Integer.parseInt(s);
536
+ } catch (Exception e) {
537
+ return null;
538
+ }
539
+ }
540
+ return null;
541
+ }
542
+
543
+ public static Object clone(Object val) {
544
+ return cloneInner(val, new IdentityHashMap<>());
545
+ }
546
+
547
+ /**
548
+ * Build a {@link LinkedHashMap} (JSON object) from alternating key/value pairs.
549
+ * Mirrors TS {@code jm}. Missing trailing values become {@code null}; non-string
550
+ * keys are coerced via {@link #stringify(Object)}.
551
+ */
552
+ public static Map<String, Object> jm(Object... kv) {
553
+ Map<String, Object> out = new LinkedHashMap<>();
554
+ int n = kv == null ? 0 : kv.length;
555
+ for (int i = 0; i < n; i += 2) {
556
+ Object k = kv[i];
557
+ String sk = k instanceof String s ? s : stringify(k);
558
+ if (sk.isEmpty() && k != null) {
559
+ sk = "$KEY" + i;
560
+ } else if (k == null) {
561
+ sk = "$KEY" + i;
562
+ }
563
+ Object v = (i + 1) < n ? kv[i + 1] : null;
564
+ out.put(sk, v);
565
+ }
566
+ return out;
567
+ }
568
+
569
+ /**
570
+ * Build an {@link ArrayList} (JSON array) from positional args.
571
+ * Mirrors TS {@code jt}.
572
+ */
573
+ public static List<Object> jt(Object... v) {
574
+ int n = v == null ? 0 : v.length;
575
+ List<Object> out = new ArrayList<>(n);
576
+ for (int i = 0; i < n; i++) {
577
+ out.add(v[i]);
578
+ }
579
+ return out;
580
+ }
581
+
582
+ private static Object cloneInner(Object val, IdentityHashMap<Object, Object> seen) {
583
+ if (val == null || val == UNDEF) {
584
+ return val;
585
+ }
586
+ // Preserve sentinel identity. Without this, a cloned spec containing SKIP
587
+ // or DELETE produces a structurally-identical map that fails `==` checks
588
+ // downstream and breaks transform/inject control flow.
589
+ if (val == SKIP || val == DELETE) {
590
+ return val;
591
+ }
592
+ if (val instanceof String
593
+ || val instanceof Number
594
+ || val instanceof Boolean
595
+ || val instanceof Function
596
+ || val instanceof Supplier
597
+ || val instanceof Injector
598
+ || val instanceof Modify) {
599
+ return val;
600
+ }
601
+ if (seen.containsKey(val)) {
602
+ return seen.get(val);
603
+ }
604
+ if (val instanceof List<?> l) {
605
+ List<Object> out = new ArrayList<>(l.size());
606
+ seen.put(val, out);
607
+ for (Object n : l) {
608
+ out.add(cloneInner(n, seen));
609
+ }
610
+ return out;
611
+ }
612
+ if (val instanceof Map<?, ?> m) {
613
+ Map<String, Object> out = new LinkedHashMap<>();
614
+ seen.put(val, out);
615
+ for (Map.Entry<?, ?> e : m.entrySet()) {
616
+ out.put(Objects.toString(e.getKey()), cloneInner(e.getValue(), seen));
617
+ }
618
+ return out;
619
+ }
620
+ return val;
621
+ }
622
+
623
+ public static List<Object> flatten(Object val) {
624
+ return flatten(val, 1);
625
+ }
626
+
627
+ public static List<Object> flatten(Object val, Integer depth) {
628
+ if (!(val instanceof List<?> l)) {
629
+ return Collections.emptyList();
630
+ }
631
+ int d = depth == null ? 1 : depth;
632
+ List<Object> out = new ArrayList<>();
633
+ flattenInto(l, d, out);
634
+ return out;
635
+ }
636
+
637
+ private static void flattenInto(List<?> in, int depth, List<Object> out) {
638
+ for (Object n : in) {
639
+ if (depth > 0 && n instanceof List<?> ln) {
640
+ flattenInto(ln, depth - 1, out);
641
+ } else {
642
+ out.add(n);
643
+ }
644
+ }
645
+ }
646
+
647
+ public static List<Object> filter(Object val, ItemCheck check) {
648
+ List<Object> out = new ArrayList<>();
649
+ for (List<Object> item : items(val)) {
650
+ if (check.test(item)) {
651
+ out.add(item.get(1));
652
+ }
653
+ }
654
+ return out;
655
+ }
656
+
657
+ public static String escre(Object s) {
658
+ String in = (s == null || s == UNDEF) ? "" : Objects.toString(s);
659
+ return in.replaceAll("([\\\\.\\[\\]{}()*+?^$|])", "\\\\$1");
660
+ }
661
+
662
+ // -------------------------------------------------------------------------
663
+ // Regex utility — uniform re* API (see /REGEX_API.md). Java's
664
+ // java.util.regex.Pattern is an ECMAScript-like engine; a strict superset
665
+ // of RE2.
666
+ // -------------------------------------------------------------------------
667
+
668
+ public static java.util.regex.Pattern reCompile(String pattern) {
669
+ return java.util.regex.Pattern.compile(pattern);
670
+ }
671
+
672
+ public static boolean reTest(String pattern, String input) {
673
+ if (input == null) input = "";
674
+ return java.util.regex.Pattern.compile(pattern).matcher(input).find();
675
+ }
676
+
677
+ public static String[] reFind(String pattern, String input) {
678
+ if (input == null) input = "";
679
+ java.util.regex.Matcher m = java.util.regex.Pattern.compile(pattern).matcher(input);
680
+ if (!m.find()) return null;
681
+ String[] out = new String[m.groupCount() + 1];
682
+ for (int i = 0; i <= m.groupCount(); i++) {
683
+ out[i] = m.group(i) == null ? "" : m.group(i);
684
+ }
685
+ return out;
686
+ }
687
+
688
+ public static java.util.List<String[]> reFindAll(String pattern, String input) {
689
+ if (input == null) input = "";
690
+ java.util.List<String[]> out = new java.util.ArrayList<>();
691
+ java.util.regex.Matcher m = java.util.regex.Pattern.compile(pattern).matcher(input);
692
+ while (m.find()) {
693
+ String[] row = new String[m.groupCount() + 1];
694
+ for (int i = 0; i <= m.groupCount(); i++) row[i] = m.group(i) == null ? "" : m.group(i);
695
+ out.add(row);
696
+ }
697
+ return out;
698
+ }
699
+
700
+ public static String reReplace(String pattern, String input, String replacement) {
701
+ if (input == null) input = "";
702
+ // Translate JS-style $& / $1 to Java's $0 / $1
703
+ String javaRepl = replacement.replace("$&", "\\$0");
704
+ return java.util.regex.Pattern.compile(pattern).matcher(input).replaceAll(javaRepl);
705
+ }
706
+
707
+ public static String reReplaceFn(String pattern, String input,
708
+ java.util.function.Function<String[], String> fn) {
709
+ if (input == null) input = "";
710
+ java.util.regex.Matcher m = java.util.regex.Pattern.compile(pattern).matcher(input);
711
+ StringBuffer sb = new StringBuffer();
712
+ while (m.find()) {
713
+ String[] groups = new String[m.groupCount() + 1];
714
+ for (int i = 0; i <= m.groupCount(); i++) groups[i] = m.group(i) == null ? "" : m.group(i);
715
+ m.appendReplacement(sb, java.util.regex.Matcher.quoteReplacement(fn.apply(groups)));
716
+ }
717
+ m.appendTail(sb);
718
+ return sb.toString();
719
+ }
720
+
721
+ public static String reEscape(String s) { return escre(s); }
722
+
723
+ public static String escurl(Object s) {
724
+ if (s == null || s == UNDEF) {
725
+ return "";
726
+ }
727
+ return URLEncoder.encode(Objects.toString(s), StandardCharsets.UTF_8)
728
+ .replace("+", "%20");
729
+ }
730
+
731
+ public static String join(Object arr, Object sep, Object url) {
732
+ if (!(arr instanceof List<?> l)) {
733
+ return "";
734
+ }
735
+ String sepDef = (sep == null || sep == UNDEF) ? "," : Objects.toString(sep);
736
+ boolean urlMode = Boolean.TRUE.equals(url);
737
+
738
+ List<String> parts = new ArrayList<>();
739
+ for (Object n : l) {
740
+ if (n instanceof String s && !s.isEmpty()) {
741
+ parts.add(s);
742
+ }
743
+ }
744
+
745
+ String sepre = escre(sepDef);
746
+ List<String> clean = new ArrayList<>();
747
+ for (int i = 0; i < parts.size(); i++) {
748
+ String s = parts.get(i);
749
+ if (sepDef.length() == 1 && !sepDef.isEmpty()) {
750
+ if (urlMode && i == 0) {
751
+ s = s.replaceAll(sepre + "+$", "");
752
+ }
753
+ if (i > 0) {
754
+ s = s.replaceAll("^" + sepre + "+", "");
755
+ }
756
+ if (i < parts.size() - 1 || !urlMode) {
757
+ s = s.replaceAll(sepre + "+$", "");
758
+ }
759
+ }
760
+ clean.add(s);
761
+ }
762
+
763
+ String out = String.join(sepDef, clean);
764
+ if (!urlMode && sepDef.length() == 1 && !sepDef.isEmpty()) {
765
+ String cc = Pattern.quote(sepDef);
766
+ out = out.replaceAll("([^" + cc + "])" + cc + "+([^" + cc + "])", "$1" + sepDef + "$2");
767
+ }
768
+ return out;
769
+ }
770
+
771
+ public static Object slice(Object val, Object startObj, Object endObj) {
772
+ Integer start = (startObj instanceof Number) ? (int) Math.floor(((Number) startObj).doubleValue()) : null;
773
+ Integer end = (endObj instanceof Number) ? (int) Math.floor(((Number) endObj).doubleValue()) : null;
774
+
775
+ if (val instanceof Number n) {
776
+ int min = start == null ? Integer.MIN_VALUE : start;
777
+ int max = (end == null ? Integer.MAX_VALUE : end - 1);
778
+ double d = n.doubleValue();
779
+ return Math.min(Math.max(d, min), max);
780
+ }
781
+
782
+ int vlen = size(val);
783
+ if (end != null && start == null) {
784
+ start = 0;
785
+ }
786
+
787
+ if (start != null) {
788
+ if (start < 0) {
789
+ end = vlen + start;
790
+ if (end < 0) {
791
+ end = 0;
792
+ }
793
+ start = 0;
794
+ } else if (end != null) {
795
+ if (end < 0) {
796
+ end = vlen + end;
797
+ if (end < 0) {
798
+ end = 0;
799
+ }
800
+ } else if (vlen < end) {
801
+ end = vlen;
802
+ }
803
+ } else {
804
+ end = vlen;
805
+ }
806
+
807
+ if (vlen < start) {
808
+ start = vlen;
809
+ }
810
+
811
+ if (-1 < start && start <= end && end <= vlen) {
812
+ if (val instanceof List<?> l) {
813
+ return new ArrayList<>(l.subList(start, end));
814
+ }
815
+ if (val instanceof String s) {
816
+ return s.substring(start, end);
817
+ }
818
+ } else {
819
+ if (val instanceof List<?>) {
820
+ return new ArrayList<>();
821
+ }
822
+ if (val instanceof String) {
823
+ return "";
824
+ }
825
+ }
826
+ }
827
+
828
+ return val;
829
+ }
830
+
831
+ public static String pad(Object val, Object paddingObj, Object padcharObj) {
832
+ String s = (val instanceof String) ? (String) val : stringify(val);
833
+ int padding = (paddingObj instanceof Number) ? (int) Math.floor(((Number) paddingObj).doubleValue()) : 44;
834
+ String pc = (padcharObj == null || padcharObj == UNDEF) ? " " : (Objects.toString(padcharObj) + " ").substring(0, 1);
835
+ if (padding >= 0) {
836
+ return s + pc.repeat(Math.max(0, padding - s.length()));
837
+ }
838
+ return pc.repeat(Math.max(0, -padding - s.length())) + s;
839
+ }
840
+
841
+ public static String stringify(Object val) {
842
+ return stringify(val, null);
843
+ }
844
+
845
+ public static String stringify(Object val, Integer maxlen) {
846
+ String valstr = "";
847
+ if (val == UNDEF) {
848
+ return "";
849
+ }
850
+ if (val instanceof String s) {
851
+ valstr = s;
852
+ } else {
853
+ try {
854
+ valstr = stringifyStable(val, new IdentityHashMap<>());
855
+ } catch (Exception e) {
856
+ valstr = "__STRINGIFY_FAILED__";
857
+ }
858
+ }
859
+ if (maxlen != null && maxlen >= 0 && valstr.length() > maxlen) {
860
+ return valstr.substring(0, Math.max(0, maxlen - 3)) + "...";
861
+ }
862
+ return valstr;
863
+ }
864
+
865
+ private static String stringifyStable(Object val, IdentityHashMap<Object, Boolean> seen) {
866
+ if (val == null) return "null";
867
+ if (val instanceof String s) return s;
868
+ if (val instanceof Number n) return numstr(n);
869
+ if (val instanceof Boolean) return Objects.toString(val);
870
+ if (val instanceof Function) return Objects.toString(val);
871
+
872
+ if (seen.containsKey(val)) {
873
+ throw new IllegalStateException("cycle");
874
+ }
875
+ seen.put(val, true);
876
+ if (val instanceof List<?> l) {
877
+ List<String> parts = new ArrayList<>();
878
+ for (Object n : l) {
879
+ parts.add(stringifyStable(n, seen));
880
+ }
881
+ seen.remove(val);
882
+ return "[" + String.join(",", parts) + "]";
883
+ }
884
+ if (val instanceof Map<?, ?> m) {
885
+ List<String> keys = new ArrayList<>();
886
+ for (Object k : m.keySet()) keys.add(Objects.toString(k));
887
+ keys.sort(String::compareTo);
888
+ List<String> parts = new ArrayList<>();
889
+ for (String k : keys) {
890
+ parts.add(k + ":" + stringifyStable(((Map<Object, Object>) m).get(k), seen));
891
+ }
892
+ seen.remove(val);
893
+ return "{" + String.join(",", parts) + "}";
894
+ }
895
+ seen.remove(val);
896
+ return Objects.toString(val);
897
+ }
898
+
899
+ public static String jsonify(Object val) {
900
+ return jsonify(val, null);
901
+ }
902
+
903
+ public static String jsonify(Object val, Object flags) {
904
+ if (val == UNDEF) {
905
+ return "null";
906
+ }
907
+ int indent = 2;
908
+ int offset = 0;
909
+ if (flags instanceof Map<?, ?> fm) {
910
+ Object iv = ((Map<Object, Object>) fm).get("indent");
911
+ Object ov = ((Map<Object, Object>) fm).get("offset");
912
+ if (iv instanceof Number n) indent = n.intValue();
913
+ if (ov instanceof Number n) offset = n.intValue();
914
+ }
915
+ try {
916
+ StringBuilder sb = new StringBuilder();
917
+ _jsonifyInner(val, sb, indent, 0, new IdentityHashMap<>());
918
+ String out = sb.toString();
919
+ if (offset > 0 && out.contains("\n")) {
920
+ String[] lines = out.split("\n", -1);
921
+ StringBuilder pb = new StringBuilder(lines[0]);
922
+ String pad = " ".repeat(offset);
923
+ for (int i = 1; i < lines.length; i++) {
924
+ pb.append("\n").append(pad).append(lines[i]);
925
+ }
926
+ out = pb.toString();
927
+ }
928
+ return out;
929
+ } catch (Exception e) {
930
+ return "__JSONIFY_FAILED__";
931
+ }
932
+ }
933
+
934
+ // Pure-Java JSON emitter — mirrors c/src/utility.c::jsonify_inner. Map
935
+ // keys are emitted in INSERTION order (matching TS canonical's
936
+ // JSON.stringify behaviour). No third-party JSON library involved.
937
+ private static void _jsonifyInner(Object v, StringBuilder out, int indent, int depth,
938
+ IdentityHashMap<Object, Boolean> seen) {
939
+ if (v == null || v == UNDEF) { out.append("null"); return; }
940
+ if (v instanceof Boolean b) { out.append(b ? "true" : "false"); return; }
941
+ if (v instanceof Number n) {
942
+ double d = n.doubleValue();
943
+ if (!Double.isFinite(d)) { out.append("null"); return; }
944
+ if (Math.floor(d) == d && Math.abs(d) < 1e15) {
945
+ out.append(Long.toString((long) d));
946
+ } else {
947
+ // %g-style: shortest round-trip-ish. Locale-independent.
948
+ String s = String.format(java.util.Locale.ROOT, "%g", d);
949
+ // Trim trailing zeros in the fractional part (matches C %g).
950
+ if (s.contains(".") && !s.contains("e") && !s.contains("E")) {
951
+ s = s.replaceAll("0+$", "").replaceAll("\\.$", "");
952
+ }
953
+ out.append(s);
954
+ }
955
+ return;
956
+ }
957
+ if (v instanceof String s) {
958
+ out.append('"');
959
+ _jsonEscape(s, out);
960
+ out.append('"');
961
+ return;
962
+ }
963
+ if (v instanceof Function) { out.append("null"); return; }
964
+ if (seen.containsKey(v)) { out.append("null"); return; }
965
+ seen.put(v, true);
966
+ if (v instanceof List<?> l) {
967
+ if (l.isEmpty()) { out.append("[]"); seen.remove(v); return; }
968
+ out.append('[');
969
+ boolean first = true;
970
+ for (Object e : l) {
971
+ if (!first) out.append(',');
972
+ first = false;
973
+ if (indent > 0) {
974
+ out.append('\n').append(" ".repeat((depth + 1) * indent));
975
+ }
976
+ _jsonifyInner(e, out, indent, depth + 1, seen);
977
+ }
978
+ if (indent > 0) {
979
+ out.append('\n').append(" ".repeat(depth * indent));
980
+ }
981
+ out.append(']');
982
+ seen.remove(v);
983
+ return;
984
+ }
985
+ if (v instanceof Map<?, ?> m) {
986
+ if (m.isEmpty()) { out.append("{}"); seen.remove(v); return; }
987
+ out.append('{');
988
+ boolean first = true;
989
+ for (Map.Entry<?, ?> e : m.entrySet()) {
990
+ if (!first) out.append(',');
991
+ first = false;
992
+ if (indent > 0) {
993
+ out.append('\n').append(" ".repeat((depth + 1) * indent));
994
+ }
995
+ out.append('"');
996
+ _jsonEscape(java.util.Objects.toString(e.getKey()), out);
997
+ out.append(indent > 0 ? "\": " : "\":");
998
+ _jsonifyInner(e.getValue(), out, indent, depth + 1, seen);
999
+ }
1000
+ if (indent > 0) {
1001
+ out.append('\n').append(" ".repeat(depth * indent));
1002
+ }
1003
+ out.append('}');
1004
+ seen.remove(v);
1005
+ return;
1006
+ }
1007
+ seen.remove(v);
1008
+ out.append("null");
1009
+ }
1010
+
1011
+ private static void _jsonEscape(String s, StringBuilder out) {
1012
+ for (int i = 0; i < s.length(); i++) {
1013
+ char c = s.charAt(i);
1014
+ switch (c) {
1015
+ case '"': out.append("\\\""); break;
1016
+ case '\\': out.append("\\\\"); break;
1017
+ case '\b': out.append("\\b"); break;
1018
+ case '\f': out.append("\\f"); break;
1019
+ case '\n': out.append("\\n"); break;
1020
+ case '\r': out.append("\\r"); break;
1021
+ case '\t': out.append("\\t"); break;
1022
+ default:
1023
+ if (c < 0x20) {
1024
+ out.append(String.format("\\u%04x", (int) c));
1025
+ } else {
1026
+ out.append(c);
1027
+ }
1028
+ }
1029
+ }
1030
+ }
1031
+
1032
+
1033
+ private static String numstr(Number n) {
1034
+ double d = n.doubleValue();
1035
+ if (Double.isFinite(d) && Math.floor(d) == d) {
1036
+ return Long.toString((long) d);
1037
+ }
1038
+ return n.toString().toLowerCase(Locale.ROOT);
1039
+ }
1040
+
1041
+ private static Number jsonNumber(Number n) {
1042
+ double d = n.doubleValue();
1043
+ if (Double.isFinite(d) && Math.floor(d) == d) {
1044
+ return (long) d;
1045
+ }
1046
+ return d;
1047
+ }
1048
+
1049
+ public static String pathify(Object val) {
1050
+ return pathify(val, null, null);
1051
+ }
1052
+
1053
+ public static String pathify(Object val, Object startIn) {
1054
+ return pathify(val, startIn, null);
1055
+ }
1056
+
1057
+ public static String pathify(Object val, Object startIn, Object endIn) {
1058
+ Integer start = (startIn instanceof Number) ? Math.max(0, ((Number) startIn).intValue()) : 0;
1059
+ Integer end = (endIn instanceof Number) ? Math.max(0, ((Number) endIn).intValue()) : 0;
1060
+ List<Object> path;
1061
+ if (val instanceof List<?> l) {
1062
+ path = new ArrayList<>(l);
1063
+ } else if (val instanceof String || val instanceof Number) {
1064
+ path = new ArrayList<>();
1065
+ path.add(val);
1066
+ } else {
1067
+ path = null;
1068
+ }
1069
+
1070
+ if (path != null) {
1071
+ Object sp = slice(path, start, path.size() - end);
1072
+ List<Object> use = (sp instanceof List<?>) ? (List<Object>) sp : new ArrayList<>();
1073
+ if (use.isEmpty()) return "<root>";
1074
+ List<String> parts = new ArrayList<>();
1075
+ for (Object p : use) {
1076
+ if (iskey(p)) {
1077
+ if (p instanceof Number n) {
1078
+ parts.add(Long.toString((long) Math.floor(n.doubleValue())));
1079
+ } else {
1080
+ parts.add(Objects.toString(p).replace(".", ""));
1081
+ }
1082
+ }
1083
+ }
1084
+ return String.join(".", parts);
1085
+ }
1086
+ return "<unknown-path" + (val == UNDEF ? "" : ":" + stringify(val, 47)) + ">";
1087
+ }
1088
+
1089
+ public static Object setpath(Object store, Object path, Object val) {
1090
+ List<Object> parts;
1091
+ if (path instanceof List<?> l) {
1092
+ parts = new ArrayList<>(l);
1093
+ } else if (path instanceof String s) {
1094
+ parts = new ArrayList<>(List.of(s.split("\\.")));
1095
+ } else if (path instanceof Number) {
1096
+ parts = new ArrayList<>(List.of(path));
1097
+ } else {
1098
+ return UNDEF;
1099
+ }
1100
+ if (parts.isEmpty()) return UNDEF;
1101
+ Object parent = store;
1102
+ for (int i = 0; i < parts.size() - 1; i++) {
1103
+ Object key = parts.get(i);
1104
+ Object next = getprop(parent, key, UNDEF);
1105
+ if (!isnode(next)) {
1106
+ Object nk = parts.get(i + 1);
1107
+ next = (nk instanceof Number) ? new ArrayList<>() : new LinkedHashMap<String, Object>();
1108
+ setprop(parent, key, next);
1109
+ }
1110
+ parent = next;
1111
+ }
1112
+ Object last = parts.get(parts.size() - 1);
1113
+ if (val == DELETE) {
1114
+ delprop(parent, last);
1115
+ } else {
1116
+ setprop(parent, last, val);
1117
+ }
1118
+ return parent;
1119
+ }
1120
+
1121
+ public static Object walk(Object val, WalkApply apply) {
1122
+ return walk(val, apply, null, 32);
1123
+ }
1124
+
1125
+ public static Object walk(Object val, WalkApply before, WalkApply after) {
1126
+ return walk(val, before, after, 32);
1127
+ }
1128
+
1129
+ public static Object walk(Object val, WalkApply before, WalkApply after, int maxdepth) {
1130
+ return walkDescend(val, before, after, maxdepth, null, null, new ArrayList<>());
1131
+ }
1132
+
1133
+ private static Object walkDescend(
1134
+ Object val,
1135
+ WalkApply before,
1136
+ WalkApply after,
1137
+ int maxdepth,
1138
+ String key,
1139
+ Object parent,
1140
+ List<String> path) {
1141
+ Object out = val;
1142
+
1143
+ if (before != null) {
1144
+ out = before.apply(key, out, parent, path);
1145
+ }
1146
+
1147
+ int plen = path.size();
1148
+ if (maxdepth == 0 || (maxdepth > 0 && maxdepth <= plen)) {
1149
+ return out;
1150
+ }
1151
+
1152
+ if (isnode(out)) {
1153
+ for (List<Object> item : items(out)) {
1154
+ String ckey = (String) item.get(0);
1155
+ Object child = item.get(1);
1156
+ List<String> newPath = new ArrayList<>(path);
1157
+ newPath.add(ckey);
1158
+ Object newChild = walkDescend(child, before, after, maxdepth, ckey, out, newPath);
1159
+ out = setprop(out, ckey, newChild);
1160
+ }
1161
+ if (parent != null && key != null) {
1162
+ setprop(parent, key, out);
1163
+ }
1164
+ }
1165
+
1166
+ if (after != null) {
1167
+ out = after.apply(key, out, parent, path);
1168
+ }
1169
+
1170
+ return out;
1171
+ }
1172
+
1173
+ public static Object merge(Object val) {
1174
+ return merge(val, 32);
1175
+ }
1176
+
1177
+ public static Object merge(Object val, int maxdepthIn) {
1178
+ int md = maxdepthIn < 0 ? 0 : maxdepthIn;
1179
+
1180
+ if (!(val instanceof List<?> list)) {
1181
+ return val;
1182
+ }
1183
+ if (list.isEmpty()) {
1184
+ return null;
1185
+ }
1186
+ if (list.size() == 1) {
1187
+ return list.get(0);
1188
+ }
1189
+
1190
+ Object out = getprop(list, 0, new LinkedHashMap<String, Object>());
1191
+
1192
+ for (int oI = 1; oI < list.size(); oI++) {
1193
+ Object obj = list.get(oI);
1194
+
1195
+ if (!isnode(obj)) {
1196
+ out = obj;
1197
+ } else {
1198
+ Object[] cur = new Object[33];
1199
+ Object[] dst = new Object[33];
1200
+ cur[0] = out;
1201
+ dst[0] = out;
1202
+
1203
+ WalkApply before = (key, v, _parent, path) -> {
1204
+ int pI = path.size();
1205
+ if (md <= pI) {
1206
+ if (key != null) {
1207
+ cur[pI - 1] = setprop(cur[pI - 1], key, v);
1208
+ }
1209
+ } else if (!isnode(v)) {
1210
+ cur[pI] = v;
1211
+ } else {
1212
+ if (0 < pI && key != null) {
1213
+ dst[pI] = getprop(dst[pI - 1], key, UNDEF);
1214
+ if (dst[pI] == UNDEF) {
1215
+ dst[pI] = null;
1216
+ }
1217
+ }
1218
+ Object tval = dst[pI];
1219
+
1220
+ if (tval == null && (typify(v) & T_instance) == 0) {
1221
+ cur[pI] = islist(v) ? new ArrayList<>() : new LinkedHashMap<String, Object>();
1222
+ } else if (typify(v) == typify(tval)) {
1223
+ cur[pI] = tval;
1224
+ } else {
1225
+ cur[pI] = v;
1226
+ return null;
1227
+ }
1228
+ }
1229
+ return v;
1230
+ };
1231
+
1232
+ WalkApply after = (key, _val, _parent, path) -> {
1233
+ int cI = path.size();
1234
+ if (key == null || cI <= 0) {
1235
+ return cur[0];
1236
+ }
1237
+ Object value = cur[cI];
1238
+ cur[cI - 1] = setprop(cur[cI - 1], key, value);
1239
+ return value;
1240
+ };
1241
+
1242
+ walk(obj, before, after, md);
1243
+ out = cur[0];
1244
+ }
1245
+ }
1246
+
1247
+ if (md == 0) {
1248
+ out = getelem(list, -1);
1249
+ if (out instanceof List) {
1250
+ out = new ArrayList<>();
1251
+ } else if (out instanceof Map) {
1252
+ out = new LinkedHashMap<String, Object>();
1253
+ }
1254
+ }
1255
+
1256
+ return out;
1257
+ }
1258
+
1259
+ public static Object getpath(Object store, Object path) {
1260
+ return getpath(store, path, (Map<String, Object>) null);
1261
+ }
1262
+
1263
+ public static Object getpath(Object store, Object path, Map<String, Object> inj) {
1264
+ List<String> parts = pathParts(path);
1265
+ Object val = getpathInner(store, path, parts, inj);
1266
+ if (inj != null) {
1267
+ Object handlerObj = inj.get("handler");
1268
+ if (handlerObj instanceof Injector h) {
1269
+ String ref = pathifyForHandler(path);
1270
+ // The Injector signature requires an Injection instance; this Map-view
1271
+ // overload is only used by tests that supply Map-shaped state, so wrap
1272
+ // a synthetic Injection that exposes the same fields.
1273
+ Injection synth = new Injection(val, null);
1274
+ synth.errs = new ArrayList<>();
1275
+ if (inj.get("dparent") != null) synth.dparent = inj.get("dparent");
1276
+ if (inj.get("meta") instanceof Map<?, ?> mm) synth.meta = (Map<String, Object>) mm;
1277
+ if (inj.get("key") != null) synth.key = Objects.toString(inj.get("key"));
1278
+ val = h.apply(synth, val, ref, store);
1279
+ }
1280
+ }
1281
+ return val;
1282
+ }
1283
+
1284
+ private static String pathifyForHandler(Object path) {
1285
+ if (path == null) {
1286
+ return pathify(UNDEF);
1287
+ }
1288
+ if (path instanceof String) {
1289
+ return pathify(path);
1290
+ }
1291
+ if (path instanceof List<?>) {
1292
+ return pathify(path);
1293
+ }
1294
+ if (path instanceof Number n) {
1295
+ return pathify(n);
1296
+ }
1297
+ return pathify(path);
1298
+ }
1299
+
1300
+ private static List<String> pathParts(Object path) {
1301
+ if (path instanceof String s) {
1302
+ if (s.isEmpty()) {
1303
+ return new ArrayList<>(List.of(S_MT));
1304
+ }
1305
+ return new ArrayList<>(List.of(s.split("\\.", -1)));
1306
+ }
1307
+ if (path instanceof List<?> l) {
1308
+ List<String> out = new ArrayList<>();
1309
+ for (Object x : l) {
1310
+ if (x instanceof String) {
1311
+ out.add((String) x);
1312
+ } else if (x instanceof Number n) {
1313
+ out.add(strkey(n));
1314
+ } else {
1315
+ out.add(strkey(x));
1316
+ }
1317
+ }
1318
+ return out;
1319
+ }
1320
+ return null;
1321
+ }
1322
+
1323
+ private static Object getpathInner(Object store, Object pathOrig, List<String> parts, Map<String, Object> inj) {
1324
+ if (parts == null) {
1325
+ return null;
1326
+ }
1327
+
1328
+ Object base = inj != null ? inj.get("base") : null;
1329
+ Object src = getprop(store, base, store);
1330
+ Object dparent = inj != null ? inj.get("dparent") : null;
1331
+ @SuppressWarnings("unchecked")
1332
+ List<String> dpath = inj != null && inj.get("dpath") instanceof List
1333
+ ? (List<String>) inj.get("dpath")
1334
+ : inj != null && inj.get("dpath") instanceof String s
1335
+ ? new ArrayList<>(List.of(s.split("\\.", -1)))
1336
+ : null;
1337
+
1338
+ int numparts = parts.size();
1339
+ Object val = store;
1340
+
1341
+ if (pathOrig == null || store == null || (numparts == 1 && S_MT.equals(parts.get(0)))) {
1342
+ val = src;
1343
+ } else if (numparts > 0) {
1344
+
1345
+ if (numparts == 1) {
1346
+ val = getprop(store, parts.get(0));
1347
+ }
1348
+
1349
+ if (!isfunc(val)) {
1350
+ val = src;
1351
+
1352
+ Matcher m0 = R_META_PATH.matcher(parts.get(0));
1353
+ if (m0.matches() && inj != null && inj.get("meta") instanceof Map<?, ?> meta) {
1354
+ val = getprop(meta, m0.group(1));
1355
+ parts.set(0, m0.group(3));
1356
+ }
1357
+
1358
+ for (int pI = 0; val != null && val != UNDEF && pI < numparts; pI++) {
1359
+ String part = parts.get(pI);
1360
+
1361
+ if (inj != null && S_DKEY.equals(part)) {
1362
+ part = Objects.toString(inj.get("key"), "");
1363
+ } else if (inj != null && part.startsWith("$GET:")) {
1364
+ String subpath = part.substring(5, part.length() - 1);
1365
+ Object result = getpath(src, subpath);
1366
+ part = stringify(result);
1367
+ } else if (inj != null && part.startsWith("$REF:")) {
1368
+ String subpath = part.substring(5, part.length() - 1);
1369
+ Object specVal = getprop(store, S_DSPEC);
1370
+ if (specVal != null) {
1371
+ Object result = getpath(specVal, subpath);
1372
+ part = stringify(result);
1373
+ }
1374
+ } else if (inj != null && part.startsWith("$META:")) {
1375
+ String subpath = part.substring(6, part.length() - 1);
1376
+ Object meta = inj.get("meta");
1377
+ Object result = getpath(meta, subpath);
1378
+ part = stringify(result);
1379
+ }
1380
+
1381
+ part = part.replace("$$", "$");
1382
+
1383
+ if (S_MT.equals(part)) {
1384
+ int ascends = 0;
1385
+ while (1 + pI < numparts && S_MT.equals(parts.get(1 + pI))) {
1386
+ ascends++;
1387
+ pI++;
1388
+ }
1389
+
1390
+ if (inj != null && ascends > 0) {
1391
+ if (pI == numparts - 1) {
1392
+ ascends--;
1393
+ }
1394
+
1395
+ if (ascends == 0) {
1396
+ val = dparent;
1397
+ } else if (dpath != null) {
1398
+ int cutLen = dpath.size() - ascends;
1399
+ if (cutLen < 0) {
1400
+ cutLen = 0;
1401
+ }
1402
+ List<String> fullpath = new ArrayList<>();
1403
+ for (int i = 0; i < cutLen; i++) {
1404
+ fullpath.add(dpath.get(i));
1405
+ }
1406
+ if (pI + 1 < numparts) {
1407
+ for (int j = pI + 1; j < numparts; j++) {
1408
+ fullpath.add(parts.get(j));
1409
+ }
1410
+ }
1411
+ if (ascends <= size(dpath)) {
1412
+ val = getpath(store, fullpath);
1413
+ } else {
1414
+ val = null;
1415
+ }
1416
+ break;
1417
+ }
1418
+ } else {
1419
+ val = dparent;
1420
+ }
1421
+ } else {
1422
+ val = getprop(val, part);
1423
+ }
1424
+ }
1425
+ }
1426
+ }
1427
+
1428
+ return val;
1429
+ }
1430
+
1431
+ public static Object inject(Object val, Object store) {
1432
+ return inject(val, store, (Injection) null);
1433
+ }
1434
+
1435
+ /**
1436
+ * Map-based overload retained for back-compat with the legacy hand-rolled
1437
+ * transform/validate paths. Builds an {@link Injection} from the map's
1438
+ * {@code modify}, {@code extra}, {@code meta}, {@code handler}, {@code base},
1439
+ * {@code dparent}, {@code dpath} entries and delegates to
1440
+ * {@link #inject(Object, Object, Injection)}.
1441
+ */
1442
+ public static Object inject(Object val, Object store, Map<String, Object> injMap) {
1443
+ if (injMap == null) {
1444
+ return inject(val, store, (Injection) null);
1445
+ }
1446
+ Injection injdef = new Injection(val, null);
1447
+ injdef.prior = null; // partial — signals "build fresh state in inject()"
1448
+ if (injMap.get("base") instanceof String b) injdef.base = b;
1449
+ if (injMap.get("dparent") != null) injdef.dparent = injMap.get("dparent");
1450
+ if (injMap.get("dpath") instanceof List<?> dp) injdef.dpath = (List<String>) dp;
1451
+ if (injMap.get("meta") instanceof Map<?, ?> meta) injdef.meta = (Map<String, Object>) meta;
1452
+ if (injMap.get("modify") instanceof Modify mod) injdef.modify = mod;
1453
+ if (injMap.get("extra") != null) injdef.extra = injMap.get("extra");
1454
+ if (injMap.get("handler") instanceof Injector h) injdef.handler = h;
1455
+ return inject(val, store, injdef);
1456
+ }
1457
+
1458
+ /**
1459
+ * Inject values from a {@code store} into a JSON-shaped {@code val}. Mirrors
1460
+ * TS {@code inject} (StructUtility.ts lines 1264–1387) using the
1461
+ * {@link Injection} state machine introduced in step 4.
1462
+ *
1463
+ * <p>For each map/list child the three injection phases run in order:
1464
+ * {@link #M_KEYPRE} (key transform pre-descent), {@link #M_VAL} (recurse
1465
+ * into the value), then {@link #M_KEYPOST} (key transform post-descent).
1466
+ * Map keys are partitioned: non-{@code $} keys before {@code $}-prefixed
1467
+ * keys, so transform commands run after data fields are resolved.
1468
+ */
1469
+ public static Object inject(Object val, Object store, Injection injdef) {
1470
+ Injection inj;
1471
+ boolean isInitial = injdef == null || injdef.prior == null;
1472
+
1473
+ if (isInitial) {
1474
+ Map<String, Object> wrapper = new LinkedHashMap<>();
1475
+ wrapper.put(S_DTOP, val);
1476
+ inj = new Injection(val, wrapper);
1477
+ inj.dparent = store;
1478
+ Object errsRaw = getprop(store, S_DERRS, UNDEF);
1479
+ if (errsRaw instanceof List<?> el) {
1480
+ inj.errs = (List<Object>) el;
1481
+ }
1482
+ inj.meta.put("__d", 0);
1483
+
1484
+ if (injdef != null) {
1485
+ if (injdef.modify != null) inj.modify = injdef.modify;
1486
+ if (injdef.extra != null) inj.extra = injdef.extra;
1487
+ if (injdef.meta != null) inj.meta = injdef.meta;
1488
+ if (injdef.handler != null) inj.handler = injdef.handler;
1489
+ if (injdef.base != null) inj.base = injdef.base;
1490
+ if (injdef.dparent != UNDEF) inj.dparent = injdef.dparent;
1491
+ }
1492
+ if (inj.handler == null) {
1493
+ inj.handler = _injecthandler;
1494
+ }
1495
+ // Top-level wrapper participates in nodes stack so setval can climb.
1496
+ inj.nodes.clear();
1497
+ inj.nodes.add(wrapper);
1498
+ } else {
1499
+ inj = injdef;
1500
+ }
1501
+
1502
+ inj.descend();
1503
+
1504
+ if (isnode(val)) {
1505
+ List<String> nodekeys = keysof(val);
1506
+
1507
+ if (ismap(val)) {
1508
+ // $-suffix ordering: non-$ keys first, then $ keys.
1509
+ // Critical for transform command ordering (TS lines 1305-1310).
1510
+ List<String> nonDollar = new ArrayList<>();
1511
+ List<String> dollar = new ArrayList<>();
1512
+ for (String k : nodekeys) {
1513
+ if (k.contains("$")) {
1514
+ dollar.add(k);
1515
+ } else {
1516
+ nonDollar.add(k);
1517
+ }
1518
+ }
1519
+ nodekeys = new ArrayList<>(nonDollar.size() + dollar.size());
1520
+ nodekeys.addAll(nonDollar);
1521
+ nodekeys.addAll(dollar);
1522
+ }
1523
+
1524
+ for (int nkI = 0; nkI < nodekeys.size(); nkI++) {
1525
+ Injection childinj = inj.child(nkI, nodekeys);
1526
+ String nodekey = childinj.key;
1527
+ childinj.mode = M_KEYPRE;
1528
+
1529
+ Object prekey = _injectstr(nodekey, store, childinj);
1530
+ nkI = childinj.keyI;
1531
+ nodekeys = childinj.keys;
1532
+
1533
+ if (prekey != UNDEF) {
1534
+ childinj.val = getprop(val, prekey);
1535
+ childinj.mode = M_VAL;
1536
+ inject(childinj.val, store, childinj);
1537
+
1538
+ nkI = childinj.keyI;
1539
+ nodekeys = childinj.keys;
1540
+
1541
+ childinj.mode = M_KEYPOST;
1542
+ _injectstr(nodekey, store, childinj);
1543
+
1544
+ nkI = childinj.keyI;
1545
+ nodekeys = childinj.keys;
1546
+ }
1547
+ }
1548
+ } else if (val instanceof String s) {
1549
+ inj.mode = M_VAL;
1550
+ Object newVal = _injectstr(s, store, inj);
1551
+ if (newVal != SKIP) {
1552
+ inj.setval(newVal);
1553
+ }
1554
+ val = newVal;
1555
+ }
1556
+
1557
+ if (inj.modify != null && val != SKIP) {
1558
+ Object mkey = inj.key;
1559
+ Object mparent = inj.parent;
1560
+ Object mval = getprop(mparent, mkey);
1561
+ inj.modify.apply(mval, mkey, mparent, inj, store);
1562
+ }
1563
+
1564
+ inj.val = val;
1565
+ // Group B: the top-level result must preserve a stored JSON null (e.g.
1566
+ // injecting `$NULL`), so read the raw value. Mirrors TS _lookup(parent,$TOP).
1567
+ return lookup(inj.parent, S_DTOP);
1568
+ }
1569
+
1570
+
1571
+ private static String injectPartialText(Object found) {
1572
+ if (found == UNDEF) {
1573
+ return S_MT;
1574
+ }
1575
+ if (found == null) {
1576
+ return "null";
1577
+ }
1578
+ if (found instanceof String s) {
1579
+ return s;
1580
+ }
1581
+ if (found instanceof Map<?, ?> || found instanceof List<?>) {
1582
+ StringBuilder sb = new StringBuilder();
1583
+ _jsonifyInner(found, sb, 0, 0, new IdentityHashMap<>());
1584
+ return sb.toString();
1585
+ }
1586
+ return stringify(found);
1587
+ }
1588
+
1589
+ // ===========================================================================
1590
+ // Inject substrate helpers (step 5a — declared here, wired in step 6)
1591
+ // ===========================================================================
1592
+
1593
+ /**
1594
+ * Build a type-mismatch error message for {@link #validate}.
1595
+ * Mirrors TS {@code _invalidTypeMsg} (StructUtility.ts lines 2759–2771).
1596
+ *
1597
+ * @param path ancestor key chain
1598
+ * @param needtype expected type (human name)
1599
+ * @param vt actual type bit-flag
1600
+ * @param v actual value
1601
+ * @param whence optional error code (currently ignored; reserved for debug)
1602
+ */
1603
+ static String _invalidTypeMsg(Object path, String needtype, int vt, Object v, String whence) {
1604
+ String vs = (v == null || v == UNDEF) ? "no value" : stringify(v);
1605
+ StringBuilder sb = new StringBuilder("Expected ");
1606
+ if (path instanceof List<?> p && p.size() > 1) {
1607
+ sb.append("field ").append(pathify(path, 1)).append(" to be ");
1608
+ }
1609
+ sb.append(needtype).append(", but found ");
1610
+ if (v != null && v != UNDEF) {
1611
+ sb.append(typename(vt)).append(": ");
1612
+ }
1613
+ sb.append(vs).append(".");
1614
+ return sb.toString();
1615
+ }
1616
+
1617
+ /**
1618
+ * Adapter overload: dispatches {@link #getpath(Object, Object, Map)} given an
1619
+ * {@link Injection} value. Builds a transient {@link Map} view from the
1620
+ * injection's {@code base}, {@code dparent}, {@code dpath}, {@code meta}, and
1621
+ * {@code key} fields. The injection's {@code handler} (an {@link Injector}) is
1622
+ * applied <em>after</em> the path lookup so that step 6's three-phase machine
1623
+ * can hook command dispatch.
1624
+ */
1625
+ public static Object getpath(Object store, Object path, Injection inj) {
1626
+ if (inj == null) {
1627
+ return getpath(store, path, (Map<String, Object>) null);
1628
+ }
1629
+ Map<String, Object> view = new LinkedHashMap<>();
1630
+ if (inj.base != null) view.put("base", inj.base);
1631
+ // Always set dparent (even UNDEF) so getpathInner distinguishes "no
1632
+ // dparent given" from "dparent given but absent".
1633
+ view.put("dparent", inj.dparent);
1634
+ if (inj.dpath != null) view.put("dpath", inj.dpath);
1635
+ if (inj.meta != null) view.put("meta", inj.meta);
1636
+ if (inj.key != null) view.put("key", inj.key);
1637
+ Object val = getpath(store, path, view);
1638
+ if (inj.handler != null) {
1639
+ String ref = path == null ? "" : pathify(path);
1640
+ val = inj.handler.apply(inj, val, ref, store);
1641
+ }
1642
+ return val;
1643
+ }
1644
+
1645
+ /**
1646
+ * Inject values from a data store into a string. Internal — not part of the
1647
+ * public API. Mirrors TS {@code _injectstr} (StructUtility.ts lines 2840–2901).
1648
+ *
1649
+ * <p>If {@code val} is a "full" injection (whole string is a backtick path),
1650
+ * returns the resolved value with its original type. Otherwise replaces every
1651
+ * partial {@code `...`} reference inline, then calls {@code inj.handler} on
1652
+ * the assembled string for command dispatch.
1653
+ */
1654
+ static Object _injectstr(String val, Object store, Injection inj) {
1655
+ if (val == null || val.isEmpty()) {
1656
+ return S_MT;
1657
+ }
1658
+ Matcher full = R_INJECT_FULL.matcher(val);
1659
+ if (full.matches()) {
1660
+ if (inj != null) {
1661
+ inj.full = true;
1662
+ }
1663
+ String pathref = full.group(1);
1664
+ if (pathref != null && pathref.length() > 3) {
1665
+ pathref = R_BT_ESCAPE.matcher(pathref).replaceAll("`");
1666
+ pathref = R_DS_ESCAPE.matcher(pathref).replaceAll("\\$");
1667
+ }
1668
+ return getpath(store, pathref, inj);
1669
+ }
1670
+
1671
+ Matcher m = R_INJECT_PART.matcher(val);
1672
+ StringBuilder out = new StringBuilder();
1673
+ int cursor = 0;
1674
+ while (m.find()) {
1675
+ out.append(val, cursor, m.start());
1676
+ String ref = m.group(1);
1677
+ if (ref != null && ref.length() > 3) {
1678
+ ref = R_BT_ESCAPE.matcher(ref).replaceAll("`");
1679
+ ref = R_DS_ESCAPE.matcher(ref).replaceAll("\\$");
1680
+ }
1681
+ if (inj != null) {
1682
+ inj.full = false;
1683
+ }
1684
+ Object found = getpath(store, ref, inj);
1685
+ out.append(injectPartialText(found));
1686
+ cursor = m.end();
1687
+ }
1688
+ out.append(val.substring(cursor));
1689
+ Object outVal = out.toString();
1690
+ if (inj != null && inj.handler != null) {
1691
+ inj.full = true;
1692
+ outVal = inj.handler.apply(inj, outVal, val, store);
1693
+ }
1694
+ return outVal;
1695
+ }
1696
+
1697
+ /**
1698
+ * Validate that an injector is placed in an allowed mode and parent type.
1699
+ * Mirrors TS {@code checkPlacement} (StructUtility.ts lines 2920–2943).
1700
+ */
1701
+ public static boolean checkPlacement(int modes, String ijname, int parentTypes, Injection inj) {
1702
+ if ((modes & inj.mode) == 0) {
1703
+ List<String> allowed = new ArrayList<>();
1704
+ for (int m : new int[] {M_KEYPRE, M_KEYPOST, M_VAL}) {
1705
+ if ((modes & m) != 0) {
1706
+ allowed.add(PLACEMENT.get(m));
1707
+ }
1708
+ }
1709
+ inj.errs.add(
1710
+ "$"
1711
+ + ijname
1712
+ + ": invalid placement as "
1713
+ + PLACEMENT.get(inj.mode)
1714
+ + ", expected: "
1715
+ + String.join(",", allowed)
1716
+ + ".");
1717
+ return false;
1718
+ }
1719
+ if (parentTypes != 0) {
1720
+ int ptype = typify(inj.parent);
1721
+ if ((parentTypes & ptype) == 0) {
1722
+ inj.errs.add(
1723
+ "$"
1724
+ + ijname
1725
+ + ": invalid placement in parent "
1726
+ + typename(ptype)
1727
+ + ", expected: "
1728
+ + typename(parentTypes)
1729
+ + ".");
1730
+ return false;
1731
+ }
1732
+ }
1733
+ return true;
1734
+ }
1735
+
1736
+ /**
1737
+ * Validate and unpack injector argument types. Returns an array of size
1738
+ * {@code argTypes.length + 1}: index 0 is the error message (or {@code null}),
1739
+ * indices 1..N are the validated args. Mirrors TS {@code injectorArgs}.
1740
+ */
1741
+ public static Object[] injectorArgs(int[] argTypes, List<Object> args) {
1742
+ int n = argTypes.length;
1743
+ Object[] found = new Object[n + 1];
1744
+ found[0] = null;
1745
+ for (int i = 0; i < n; i++) {
1746
+ Object arg = i < args.size() ? args.get(i) : UNDEF;
1747
+ int argType = typify(arg);
1748
+ if ((argTypes[i] & argType) == 0) {
1749
+ found[0] =
1750
+ "invalid argument: "
1751
+ + stringify(arg, 22)
1752
+ + " ("
1753
+ + typename(argType)
1754
+ + " at position "
1755
+ + (1 + i)
1756
+ + ") is not of type: "
1757
+ + typename(argTypes[i])
1758
+ + ".";
1759
+ break;
1760
+ }
1761
+ found[i + 1] = arg;
1762
+ }
1763
+ return found;
1764
+ }
1765
+
1766
+ /**
1767
+ * Recurse {@link #inject} into a child node sharing the current injection's
1768
+ * state stack. Used by {@code $FORMAT} / {@code $APPLY} (and other injectors
1769
+ * that need to resolve a sub-spec). Mirrors TS {@code injectChild}.
1770
+ */
1771
+ public static Injection injectChild(Object child, Object store, Injection inj) {
1772
+ Injection cinj = inj;
1773
+ if (inj.prior != null) {
1774
+ if (inj.prior.prior != null) {
1775
+ cinj = inj.prior.prior.child(inj.prior.keyI, inj.prior.keys);
1776
+ cinj.val = child;
1777
+ setprop(cinj.parent, inj.prior.key, child);
1778
+ } else {
1779
+ cinj = inj.prior.child(inj.keyI, inj.keys);
1780
+ cinj.val = child;
1781
+ setprop(cinj.parent, inj.key, child);
1782
+ }
1783
+ }
1784
+ inject(child, store, cinj);
1785
+ return cinj;
1786
+ }
1787
+
1788
+ /**
1789
+ * Default {@link Injector}: when a backtick reference resolves to a function
1790
+ * value (a {@code $NAME} command), call it. Otherwise pass-through, except
1791
+ * that in {@link #M_VAL} mode with a "full" injection, set the resolved
1792
+ * value back onto {@code inj.parent[inj.key]} to keep the spec tree
1793
+ * consistent. Mirrors TS {@code _injecthandler}.
1794
+ */
1795
+ static final Injector _injecthandler =
1796
+ (injObj, val, ref, store) -> {
1797
+ if (!(injObj instanceof Injection inj)) {
1798
+ return val;
1799
+ }
1800
+ Object out = val;
1801
+ boolean iscmd = isfunc(val) && (ref == null || ref.startsWith("$"));
1802
+ if (iscmd) {
1803
+ if (val instanceof Injector ij) {
1804
+ out = ij.apply(inj, val, ref, store);
1805
+ } else if (val instanceof Function<?, ?> f) {
1806
+ out = ((Function<Object, Object>) f).apply(inj);
1807
+ } else if (val instanceof Supplier<?> s) {
1808
+ out = s.get();
1809
+ }
1810
+ } else if (inj.mode == M_VAL && inj.full) {
1811
+ inj.setval(val);
1812
+ }
1813
+ return out;
1814
+ };
1815
+
1816
+ // ===========================================================================
1817
+ // Transform injectors (step 8)
1818
+ // ===========================================================================
1819
+ // Reference implementations of the 11 TS transform commands. These are
1820
+ // ported from TS lines 1393–1896 and exposed as public static Injector
1821
+ // fields. The current public transform(data, spec, options) below remains
1822
+ // the hand-rolled implementation — these injectors are wired in via a
1823
+ // future step 9 transform() rewrite.
1824
+
1825
+ /** $DELETE: drop the current key. Mirrors TS lines 1393–1396. */
1826
+ public static final Injector transform_DELETE =
1827
+ (injObj, val, ref, store) -> {
1828
+ if (injObj instanceof Injection inj) {
1829
+ inj.setval(UNDEF);
1830
+ }
1831
+ return UNDEF;
1832
+ };
1833
+
1834
+ /** $COPY: copy the value at the current key from {@code dparent}. */
1835
+ public static final Injector transform_COPY =
1836
+ (injObj, val, ref, store) -> {
1837
+ if (!(injObj instanceof Injection inj)) return UNDEF;
1838
+ if (!checkPlacement(M_VAL, "COPY", T_any, inj)) return UNDEF;
1839
+ // Group B: $COPY copies the raw stored value, preserving JSON null.
1840
+ Object out = lookup(inj.dparent, inj.key);
1841
+ inj.setval(out);
1842
+ return out;
1843
+ };
1844
+
1845
+ /** $KEY: emit the parent key, optionally renamed via {@code `$KEY`}. */
1846
+ public static final Injector transform_KEY =
1847
+ (injObj, val, ref, store) -> {
1848
+ if (!(injObj instanceof Injection inj)) return UNDEF;
1849
+ if (inj.mode != M_VAL) return UNDEF;
1850
+ // Group B: the $KEY/$ANNO spec markers are read raw (TS _lookup).
1851
+ Object keyspec = lookup(inj.parent, "`$KEY`");
1852
+ if (keyspec != UNDEF) {
1853
+ delprop(inj.parent, "`$KEY`");
1854
+ return getprop(inj.dparent, keyspec);
1855
+ }
1856
+ Object anno = lookup(inj.parent, "`$ANNO`");
1857
+ Object annoKey = lookup(anno, "KEY");
1858
+ // TS: _lookup(_lookup(parent,$ANNO),KEY) ?? getelem(path,-2) — fall
1859
+ // back only when absent or JSON null.
1860
+ return (annoKey == UNDEF || annoKey == null) ? getelem(inj.path, -2) : annoKey;
1861
+ };
1862
+
1863
+ /** $ANNO: drop the annotation marker. */
1864
+ public static final Injector transform_ANNO =
1865
+ (injObj, val, ref, store) -> {
1866
+ if (injObj instanceof Injection inj) {
1867
+ delprop(inj.parent, "`$ANNO`");
1868
+ }
1869
+ return UNDEF;
1870
+ };
1871
+
1872
+ /** $MERGE: deep-merge a list of objects over the current parent. */
1873
+ public static final Injector transform_MERGE =
1874
+ (injObj, val, ref, store) -> {
1875
+ if (!(injObj instanceof Injection inj)) return UNDEF;
1876
+ if (inj.mode == M_KEYPRE) return inj.key;
1877
+ if (inj.mode != M_KEYPOST) return UNDEF;
1878
+
1879
+ Object args = getprop(inj.parent, inj.key);
1880
+ List<Object> argList;
1881
+ if (args instanceof List<?> al) {
1882
+ argList = (List<Object>) al;
1883
+ } else {
1884
+ argList = new ArrayList<>();
1885
+ argList.add(args);
1886
+ }
1887
+ inj.setval(UNDEF);
1888
+
1889
+ List<Object> mergelist = new ArrayList<>();
1890
+ mergelist.add(inj.parent);
1891
+ mergelist.addAll(argList);
1892
+ mergelist.add(clone(inj.parent));
1893
+ merge(mergelist);
1894
+ return inj.key;
1895
+ };
1896
+
1897
+ /** Format functions used by {@link #transform_FORMAT} ($FORMAT command). */
1898
+ public static final Map<String, WalkApply> FORMATTER;
1899
+
1900
+ /** JS-style scalar→string: integer-valued doubles render without {@code .0}. */
1901
+ private static String jsString(Object v) {
1902
+ if (v == null) return "null";
1903
+ if (v instanceof Number n) {
1904
+ double d = n.doubleValue();
1905
+ if (Double.isFinite(d) && Math.floor(d) == d) {
1906
+ return Long.toString((long) d);
1907
+ }
1908
+ return n.toString();
1909
+ }
1910
+ if (v instanceof Boolean b) return b ? "true" : "false";
1911
+ return v.toString();
1912
+ }
1913
+
1914
+ static {
1915
+ Map<String, WalkApply> f = new LinkedHashMap<>();
1916
+ f.put("identity", (k, v, p, t) -> v);
1917
+ f.put("upper", (k, v, p, t) -> isnode(v) ? v : jsString(v).toUpperCase(Locale.ROOT));
1918
+ f.put("lower", (k, v, p, t) -> isnode(v) ? v : jsString(v).toLowerCase(Locale.ROOT));
1919
+ f.put("string", (k, v, p, t) -> isnode(v) ? v : jsString(v));
1920
+ f.put(
1921
+ "number",
1922
+ (k, v, p, t) -> {
1923
+ if (isnode(v)) return v;
1924
+ try {
1925
+ double d = Double.parseDouble("" + v);
1926
+ if (Double.isNaN(d)) return 0L;
1927
+ if (Math.floor(d) == d) return (long) d;
1928
+ return d;
1929
+ } catch (Exception e) {
1930
+ return 0L;
1931
+ }
1932
+ });
1933
+ f.put(
1934
+ "integer",
1935
+ (k, v, p, t) -> {
1936
+ if (isnode(v)) return v;
1937
+ try {
1938
+ return (long) Double.parseDouble("" + v);
1939
+ } catch (Exception e) {
1940
+ return 0L;
1941
+ }
1942
+ });
1943
+ f.put(
1944
+ "concat",
1945
+ (k, v, p, t) -> {
1946
+ if (k != null || !islist(v)) return v;
1947
+ StringBuilder sb = new StringBuilder();
1948
+ for (List<Object> item : items(v)) {
1949
+ Object x = item.get(1);
1950
+ if (!isnode(x)) sb.append(jsString(x));
1951
+ }
1952
+ return sb.toString();
1953
+ });
1954
+ FORMATTER = Collections.unmodifiableMap(f);
1955
+ }
1956
+
1957
+ /** $FORMAT: walk a sub-spec applying a named formatter. */
1958
+ public static final Injector transform_FORMAT =
1959
+ (injObj, val, ref, store) -> {
1960
+ if (!(injObj instanceof Injection inj)) return UNDEF;
1961
+ if (inj.keys != null && !inj.keys.isEmpty()) {
1962
+ // Slice keys to first one to prevent further processing.
1963
+ List<String> keep = new ArrayList<>();
1964
+ if (!inj.keys.isEmpty()) keep.add(inj.keys.get(0));
1965
+ inj.keys.clear();
1966
+ inj.keys.addAll(keep);
1967
+ }
1968
+ if (inj.mode != M_VAL) return UNDEF;
1969
+
1970
+ // Group B: $FORMAT args ['`$FORMAT`','name',child] are read raw so a
1971
+ // null child reaches the formatter (TS _lookup(parent,1/2)).
1972
+ Object name = lookup(inj.parent, 1);
1973
+ Object child = lookup(inj.parent, 2);
1974
+
1975
+ Object tkey = getelem(inj.path, -2);
1976
+ Object target = getelem(inj.nodes, -2, getelem(inj.nodes, -1));
1977
+
1978
+ Injection cinj = injectChild(child, store, inj);
1979
+ Object resolved = cinj.val;
1980
+
1981
+ WalkApply formatter =
1982
+ name instanceof WalkApply wa ? wa : FORMATTER.get(Objects.toString(name, ""));
1983
+ if (formatter == null) {
1984
+ inj.errs.add("$FORMAT: unknown format: " + name + ".");
1985
+ return UNDEF;
1986
+ }
1987
+ Object out = walk(resolved, formatter);
1988
+ setprop(target, tkey, out);
1989
+ return out;
1990
+ };
1991
+
1992
+ /** $APPLY: call a custom function on a resolved sub-spec value. */
1993
+ public static final Injector transform_APPLY =
1994
+ (injObj, val, ref, store) -> {
1995
+ if (!(injObj instanceof Injection inj)) return UNDEF;
1996
+ if (!checkPlacement(M_VAL, "APPLY", T_list, inj)) return UNDEF;
1997
+
1998
+ List<Object> args = new ArrayList<>();
1999
+ if (inj.parent instanceof List<?> pl && pl.size() > 1) {
2000
+ for (int i = 1; i < pl.size(); i++) args.add(pl.get(i));
2001
+ }
2002
+ Object[] checked = injectorArgs(new int[] {T_function, T_any}, args);
2003
+ if (checked[0] != null) {
2004
+ inj.errs.add("$APPLY: " + checked[0]);
2005
+ return UNDEF;
2006
+ }
2007
+ Object apply = checked[1];
2008
+ Object child = checked[2];
2009
+
2010
+ Object tkey = getelem(inj.path, -2);
2011
+ Object target = getelem(inj.nodes, -2, getelem(inj.nodes, -1));
2012
+
2013
+ Injection cinj = injectChild(child, store, inj);
2014
+ Object resolved = cinj.val;
2015
+
2016
+ Object out;
2017
+ if (apply instanceof Function<?, ?> fn) {
2018
+ out = ((Function<Object, Object>) fn).apply(resolved);
2019
+ } else {
2020
+ out = UNDEF;
2021
+ }
2022
+ setprop(target, tkey, out);
2023
+ return out;
2024
+ };
2025
+
2026
+ /**
2027
+ * $EACH: convert a node into a list by cloning the child template per
2028
+ * source entry. Format: {@code ['`$EACH`', '<source-path>', child-template]}.
2029
+ * Mirrors TS lines 1484–1571.
2030
+ */
2031
+ public static final Injector transform_EACH =
2032
+ (injObj, val, ref, store) -> {
2033
+ if (!(injObj instanceof Injection inj)) return UNDEF;
2034
+ if (!checkPlacement(M_VAL, "EACH", T_list, inj)) return UNDEF;
2035
+
2036
+ // Mutate inj.keys to keep only first element (prevent further key processing).
2037
+ if (inj.keys.size() > 1) {
2038
+ inj.keys.subList(1, inj.keys.size()).clear();
2039
+ }
2040
+
2041
+ // Args from parent list after [0] = $EACH marker.
2042
+ List<Object> args = new ArrayList<>();
2043
+ if (inj.parent instanceof List<?> pl) {
2044
+ for (int i = 1; i < pl.size(); i++) args.add(pl.get(i));
2045
+ }
2046
+ Object[] checked = injectorArgs(new int[] {T_string, T_any}, args);
2047
+ if (checked[0] != null) {
2048
+ inj.errs.add("$EACH: " + checked[0]);
2049
+ return UNDEF;
2050
+ }
2051
+ String srcpath = (String) checked[1];
2052
+ Object child = checked[2];
2053
+
2054
+ // Source data via getpath against the injection's base store.
2055
+ Object srcstore = getprop(store, inj.base, store);
2056
+ Object src = getpath(srcstore, srcpath, inj);
2057
+ int srctype = typify(src);
2058
+
2059
+ Object tkey = getelem(inj.path, -2);
2060
+ Object target = getelem(inj.nodes, -2);
2061
+ if (target == UNDEF) target = getelem(inj.nodes, -1);
2062
+
2063
+ // Build tval as cloned child templates per source entry.
2064
+ List<Object> tval = new ArrayList<>();
2065
+ if ((T_list & srctype) != 0 && src instanceof List<?> sl) {
2066
+ for (int i = 0; i < sl.size(); i++) {
2067
+ tval.add(clone(child));
2068
+ }
2069
+ } else if ((T_map & srctype) != 0 && src instanceof Map<?, ?> sm) {
2070
+ for (Map.Entry<?, ?> e : sm.entrySet()) {
2071
+ Object cloned = clone(child);
2072
+ Map<String, Object> annoMap = new LinkedHashMap<>();
2073
+ Map<String, Object> keyMap = new LinkedHashMap<>();
2074
+ keyMap.put("KEY", Objects.toString(e.getKey()));
2075
+ annoMap.put("`$ANNO`", keyMap);
2076
+ List<Object> mergeArgs = new ArrayList<>();
2077
+ mergeArgs.add(cloned);
2078
+ mergeArgs.add(annoMap);
2079
+ tval.add(merge(mergeArgs, 1));
2080
+ }
2081
+ }
2082
+
2083
+ Object rval = new ArrayList<>();
2084
+
2085
+ if (size(tval) > 0) {
2086
+ // tcur: list of source values for relative ref binding.
2087
+ Object tcur;
2088
+ if (src instanceof List<?> sl) {
2089
+ tcur = new ArrayList<>(sl);
2090
+ } else if (src instanceof Map<?, ?> sm) {
2091
+ tcur = new ArrayList<>(sm.values());
2092
+ } else {
2093
+ tcur = UNDEF;
2094
+ }
2095
+
2096
+ Object ckey = getelem(inj.path, -2);
2097
+ String ckeyStr = strkey(ckey);
2098
+
2099
+ Object tpathRaw = slice(inj.path, -1, null);
2100
+ List<String> tpath =
2101
+ tpathRaw instanceof List<?> tpl
2102
+ ? new ArrayList<>((List<String>) tpl)
2103
+ : new ArrayList<>();
2104
+
2105
+ List<String> dpath = new ArrayList<>();
2106
+ dpath.add(S_DTOP);
2107
+ if (srcpath != null && !srcpath.isEmpty()) {
2108
+ for (String part : srcpath.split("\\.", -1)) dpath.add(part);
2109
+ }
2110
+ dpath.add("$:" + ckeyStr);
2111
+
2112
+ // Wrap tcur in the parent key structure so relative paths work.
2113
+ Map<String, Object> tcurMap = new LinkedHashMap<>();
2114
+ tcurMap.put(ckeyStr, tcur);
2115
+ Object tcurOut = tcurMap;
2116
+
2117
+ if (size(tpath) > 1) {
2118
+ Object pkey = getelem(inj.path, -3, S_DTOP);
2119
+ String pkeyStr = strkey(pkey);
2120
+ Map<String, Object> wrap = new LinkedHashMap<>();
2121
+ wrap.put(pkeyStr, tcurOut);
2122
+ tcurOut = wrap;
2123
+ dpath.add("$:" + pkeyStr);
2124
+ }
2125
+
2126
+ List<String> singleKey = new ArrayList<>();
2127
+ singleKey.add(ckeyStr);
2128
+ Injection tinj = inj.child(0, singleKey);
2129
+ tinj.path = tpath;
2130
+ Object slicedNodes = slice(inj.nodes, -1, null);
2131
+ tinj.nodes =
2132
+ slicedNodes instanceof List<?> snl
2133
+ ? new ArrayList<>((List<Object>) snl)
2134
+ : new ArrayList<>();
2135
+
2136
+ tinj.parent = getelem(tinj.nodes, -1);
2137
+ setprop(tinj.parent, ckey, tval);
2138
+
2139
+ tinj.val = tval;
2140
+ tinj.dpath = dpath;
2141
+ tinj.dparent = tcurOut;
2142
+
2143
+ inject(tval, store, tinj);
2144
+ rval = tinj.val;
2145
+ }
2146
+
2147
+ setprop(target, tkey, rval);
2148
+ return rval instanceof List<?> rl && !rl.isEmpty() ? rl.get(0) : UNDEF;
2149
+ };
2150
+
2151
+ /**
2152
+ * $PACK: convert a list/map into a keyed map. Format:
2153
+ * {@code {'`$PACK`': ['<source-path>', child-template]}}. Mirrors TS lines 1576–1707.
2154
+ */
2155
+ public static final Injector transform_PACK =
2156
+ (injObj, val, ref, store) -> {
2157
+ if (!(injObj instanceof Injection inj)) return UNDEF;
2158
+ if (!checkPlacement(M_KEYPRE, "PACK", T_map, inj)) return UNDEF;
2159
+
2160
+ Object args = getprop(inj.parent, inj.key);
2161
+ List<Object> argList = new ArrayList<>();
2162
+ if (args instanceof List<?> al) {
2163
+ argList.addAll(al);
2164
+ }
2165
+ Object[] checked = injectorArgs(new int[] {T_string, T_any}, argList);
2166
+ if (checked[0] != null) {
2167
+ inj.errs.add("$PACK: " + checked[0]);
2168
+ return UNDEF;
2169
+ }
2170
+ String srcpath = (String) checked[1];
2171
+ Object origchildspec = checked[2];
2172
+
2173
+ Object tkey = getelem(inj.path, -2);
2174
+ int pathsize = size(inj.path);
2175
+ Object target = getelem(inj.nodes, pathsize - 2);
2176
+ if (target == UNDEF) target = getelem(inj.nodes, pathsize - 1);
2177
+
2178
+ Object srcstore = getprop(store, inj.base, store);
2179
+ Object src = getpath(srcstore, srcpath, inj);
2180
+
2181
+ // Prepare source as a list of nodes.
2182
+ List<Object> srcList = null;
2183
+ if (src instanceof List<?> sl) {
2184
+ srcList = new ArrayList<>(sl);
2185
+ } else if (src instanceof Map<?, ?> sm) {
2186
+ srcList = new ArrayList<>();
2187
+ for (Map.Entry<?, ?> e : sm.entrySet()) {
2188
+ Object node = e.getValue();
2189
+ if (isnode(node)) {
2190
+ Map<String, Object> annoMap = new LinkedHashMap<>();
2191
+ annoMap.put("KEY", Objects.toString(e.getKey()));
2192
+ setprop(node, "`$ANNO`", annoMap);
2193
+ srcList.add(node);
2194
+ }
2195
+ }
2196
+ }
2197
+
2198
+ if (srcList == null) {
2199
+ return UNDEF;
2200
+ }
2201
+
2202
+ // Extract `$KEY` and `$VAL` from origchildspec (if it's a map).
2203
+ Object keypath = UNDEF;
2204
+ Object childspec = origchildspec;
2205
+ Object child = origchildspec;
2206
+ if (origchildspec instanceof Map<?, ?>) {
2207
+ keypath = getprop(origchildspec, "`$KEY`", UNDEF);
2208
+ delprop(origchildspec, "`$KEY`");
2209
+ child = getprop(origchildspec, "`$VAL`", origchildspec);
2210
+ }
2211
+ // After delprop the value may have been mutated.
2212
+ final Object keypathFinal = keypath;
2213
+ final Object childFinal = child;
2214
+
2215
+ // Build parallel target object.
2216
+ Map<String, Object> tval = new LinkedHashMap<>();
2217
+
2218
+ for (int i = 0; i < srcList.size(); i++) {
2219
+ Object item = srcList.get(i);
2220
+ // srcnode may be any value; for keypath==UNDEF, use the source index/key.
2221
+ String outKey;
2222
+ if (keypathFinal == UNDEF) {
2223
+ // For list source, use the iteration index.
2224
+ // For map source, srcList came from values() so we lost the key —
2225
+ // fall back to the item's $KEY annotation (set during list build).
2226
+ if (item instanceof Map<?, ?> imap2 && imap2.containsKey(S_DKEY)) {
2227
+ outKey = Objects.toString(imap2.get(S_DKEY), "");
2228
+ } else {
2229
+ outKey = String.valueOf(i);
2230
+ }
2231
+ } else if (keypathFinal instanceof String ks && ks.startsWith("`")) {
2232
+ // Inject the key spec against {$TOP: srcnode} merged into store.
2233
+ List<Object> mergeList = new ArrayList<>();
2234
+ mergeList.add(new LinkedHashMap<String, Object>());
2235
+ mergeList.add(store);
2236
+ Map<String, Object> topMap = new LinkedHashMap<>();
2237
+ topMap.put(S_DTOP, item);
2238
+ mergeList.add(topMap);
2239
+ Object merged = merge(mergeList, 1);
2240
+ outKey = Objects.toString(inject(keypathFinal, merged), "");
2241
+ } else {
2242
+ Object kv = getpath(item, keypathFinal, inj);
2243
+ outKey = Objects.toString(kv, "");
2244
+ }
2245
+
2246
+ Object tchild = clone(childFinal);
2247
+ setprop(tval, outKey, tchild);
2248
+
2249
+ // Preserve $ANNO if present.
2250
+ Object anno = getprop(item, "`$ANNO`", UNDEF);
2251
+ if (anno == UNDEF) {
2252
+ delprop(tchild, "`$ANNO`");
2253
+ } else {
2254
+ setprop(tchild, "`$ANNO`", anno);
2255
+ }
2256
+ }
2257
+
2258
+ Map<String, Object> rval = new LinkedHashMap<>();
2259
+
2260
+ if (!isempty(tval)) {
2261
+ // Build parallel source map keyed by outKey for relative ref binding.
2262
+ Map<String, Object> tsrc = new LinkedHashMap<>();
2263
+ for (int i = 0; i < srcList.size(); i++) {
2264
+ Object item = srcList.get(i);
2265
+ String kn;
2266
+ if (keypathFinal == UNDEF) {
2267
+ kn = String.valueOf(i);
2268
+ } else if (keypathFinal instanceof String ks && ks.startsWith("`")) {
2269
+ List<Object> mergeList = new ArrayList<>();
2270
+ mergeList.add(new LinkedHashMap<String, Object>());
2271
+ mergeList.add(store);
2272
+ Map<String, Object> topMap = new LinkedHashMap<>();
2273
+ topMap.put(S_DTOP, item);
2274
+ mergeList.add(topMap);
2275
+ Object merged = merge(mergeList, 1);
2276
+ kn = Objects.toString(inject(keypathFinal, merged), "");
2277
+ } else {
2278
+ Object kv = getpath(item, keypathFinal, inj);
2279
+ kn = Objects.toString(kv, "");
2280
+ }
2281
+ setprop(tsrc, kn, item);
2282
+ }
2283
+
2284
+ Object tpathRaw = slice(inj.path, -1, null);
2285
+ List<String> tpath =
2286
+ tpathRaw instanceof List<?> tpl
2287
+ ? new ArrayList<>((List<String>) tpl)
2288
+ : new ArrayList<>();
2289
+
2290
+ Object ckey = getelem(inj.path, -2);
2291
+ String ckeyStr = strkey(ckey);
2292
+
2293
+ List<String> dpath = new ArrayList<>();
2294
+ dpath.add(S_DTOP);
2295
+ if (srcpath != null && !srcpath.isEmpty()) {
2296
+ for (String part : srcpath.split("\\.", -1)) dpath.add(part);
2297
+ }
2298
+ dpath.add("$:" + ckeyStr);
2299
+
2300
+ Map<String, Object> tcur = new LinkedHashMap<>();
2301
+ tcur.put(ckeyStr, tsrc);
2302
+ Object tcurOut = tcur;
2303
+
2304
+ if (size(tpath) > 1) {
2305
+ Object pkey = getelem(inj.path, -3, S_DTOP);
2306
+ String pkeyStr = strkey(pkey);
2307
+ Map<String, Object> wrap = new LinkedHashMap<>();
2308
+ wrap.put(pkeyStr, tcurOut);
2309
+ tcurOut = wrap;
2310
+ dpath.add("$:" + pkeyStr);
2311
+ }
2312
+
2313
+ List<String> singleKey = new ArrayList<>();
2314
+ singleKey.add(ckeyStr);
2315
+ Injection tinj = inj.child(0, singleKey);
2316
+ tinj.path = tpath;
2317
+ Object slicedNodes = slice(inj.nodes, -1, null);
2318
+ tinj.nodes =
2319
+ slicedNodes instanceof List<?> snl
2320
+ ? new ArrayList<>((List<Object>) snl)
2321
+ : new ArrayList<>();
2322
+
2323
+ tinj.parent = getelem(tinj.nodes, -1);
2324
+ tinj.val = tval;
2325
+ tinj.dpath = dpath;
2326
+ tinj.dparent = tcurOut;
2327
+
2328
+ inject(tval, store, tinj);
2329
+ if (tinj.val instanceof Map<?, ?> rm) {
2330
+ rval = new LinkedHashMap<>();
2331
+ for (Map.Entry<?, ?> e : rm.entrySet()) {
2332
+ rval.put(Objects.toString(e.getKey()), e.getValue());
2333
+ }
2334
+ }
2335
+ }
2336
+
2337
+ setprop(target, tkey, rval);
2338
+ // Drop transform key.
2339
+ return UNDEF;
2340
+ };
2341
+
2342
+ /**
2343
+ * $REF: resolve a named reference within the original spec, enabling
2344
+ * recursive transformations. Format: {@code ['`$REF`', '<spec-path>']}.
2345
+ * Mirrors TS lines 1713–1785.
2346
+ */
2347
+ public static final Injector transform_REF =
2348
+ (injObj, val, ref, store) -> {
2349
+ if (!(injObj instanceof Injection inj)) return UNDEF;
2350
+ if (inj.mode != M_VAL) return UNDEF;
2351
+
2352
+ // Group B: $REF arg ['`$REF`','ref-path'] read raw (TS _lookup(parent,1)).
2353
+ Object refpath = lookup(inj.parent, 1);
2354
+ inj.keyI = size(inj.keys);
2355
+
2356
+ // $SPEC is stored as a Supplier<Object> that returns the original spec.
2357
+ Object specHolder = getprop(store, S_DSPEC);
2358
+ Object spec;
2359
+ if (specHolder instanceof Supplier<?> sup) {
2360
+ spec = sup.get();
2361
+ } else {
2362
+ spec = specHolder;
2363
+ }
2364
+
2365
+ Object dpathRaw = slice(inj.path, 1, null);
2366
+ List<String> dpath =
2367
+ dpathRaw instanceof List<?> dl
2368
+ ? new ArrayList<>((List<String>) dl)
2369
+ : new ArrayList<>();
2370
+ Injection refInj = new Injection(null, null);
2371
+ refInj.dpath = dpath;
2372
+ refInj.dparent = getpath(spec, dpath);
2373
+ refInj.handler = _injecthandler;
2374
+ Object refResolved = getpath(spec, refpath, refInj);
2375
+
2376
+ Object tref = clone(refResolved);
2377
+
2378
+ boolean[] hasSubRef = {false};
2379
+ if (isnode(tref)) {
2380
+ walk(
2381
+ tref,
2382
+ (k, v, p, t) -> {
2383
+ if ("`$REF`".equals(v)) hasSubRef[0] = true;
2384
+ return v;
2385
+ });
2386
+ }
2387
+
2388
+ Object cpathRaw = slice(inj.path, -3, null);
2389
+ List<String> cpath =
2390
+ cpathRaw instanceof List<?> cl
2391
+ ? new ArrayList<>((List<String>) cl)
2392
+ : new ArrayList<>();
2393
+ Object tpathRaw = slice(inj.path, -1, null);
2394
+ List<String> tpath =
2395
+ tpathRaw instanceof List<?> tpl
2396
+ ? new ArrayList<>((List<String>) tpl)
2397
+ : new ArrayList<>();
2398
+ Object tval = getpath(store, tpath);
2399
+ Object rval = UNDEF;
2400
+
2401
+ if (!hasSubRef[0] || tval != UNDEF) {
2402
+ Object lastKey = getelem(tpath, -1);
2403
+ List<String> singleKey = new ArrayList<>();
2404
+ singleKey.add(strkey(lastKey));
2405
+ Injection tinj = inj.child(0, singleKey);
2406
+ tinj.path = tpath;
2407
+ Object slicedNodes = slice(inj.nodes, -1, null);
2408
+ tinj.nodes =
2409
+ slicedNodes instanceof List<?> snl
2410
+ ? new ArrayList<>((List<Object>) snl)
2411
+ : new ArrayList<>();
2412
+ tinj.parent = getelem(inj.nodes, -2);
2413
+ tinj.val = tref;
2414
+
2415
+ List<String> flatCpath = new ArrayList<>(cpath);
2416
+ tinj.dpath = flatCpath;
2417
+ tinj.dparent = getpath(store, cpath);
2418
+
2419
+ inject(tref, store, tinj);
2420
+ rval = tinj.val;
2421
+ }
2422
+
2423
+ Object grandparent = inj.setval(rval, 2);
2424
+ if (islist(grandparent) && inj.prior != null) {
2425
+ inj.prior.keyI--;
2426
+ }
2427
+
2428
+ return val;
2429
+ };
2430
+
2431
+ public static Object transform(Object data, Object spec) {
2432
+ return transform(data, spec, (Map<String, Object>) null);
2433
+ }
2434
+
2435
+ /**
2436
+ * TS-faithful transform: clone the spec and inject it against a store
2437
+ * containing the {@code transform_*} command injectors plus {@code $TOP},
2438
+ * {@code $SPEC}, {@code $BT}, {@code $DS}, {@code $WHEN}. Mirrors TS
2439
+ * {@code transform} (StructUtility.ts lines 1902–1973).
2440
+ */
2441
+ public static Object transform(Object data, Object spec, Map<String, Object> options) {
2442
+ final Object origspec = spec;
2443
+ Object workspec = clone(origspec);
2444
+
2445
+ Object extraRaw = options == null ? null : options.get("extra");
2446
+ Object modifyRaw = options == null ? null : options.get("modify");
2447
+ Object handlerRaw = options == null ? null : options.get("handler");
2448
+ Object metaRaw = options == null ? null : options.get("meta");
2449
+ Object errsRaw = options == null ? null : options.get("errs");
2450
+
2451
+ boolean collect = errsRaw instanceof List<?>;
2452
+ List<Object> errs = collect ? (List<Object>) errsRaw : new ArrayList<>();
2453
+
2454
+ // Split extra into commands ($-keyed) and data (everything else).
2455
+ Map<String, Object> extraTransforms = new LinkedHashMap<>();
2456
+ Map<String, Object> extraData = new LinkedHashMap<>();
2457
+ if (extraRaw instanceof Map<?, ?> exm) {
2458
+ for (Map.Entry<?, ?> e : exm.entrySet()) {
2459
+ String k = Objects.toString(e.getKey(), "");
2460
+ if (k.startsWith("$")) extraTransforms.put(k, e.getValue());
2461
+ else extraData.put(k, e.getValue());
2462
+ }
2463
+ }
2464
+
2465
+ List<Object> dataMergeList = new ArrayList<>();
2466
+ if (!isempty(extraData)) dataMergeList.add(clone(extraData));
2467
+ dataMergeList.add(clone(data));
2468
+ Object dataClone = merge(dataMergeList);
2469
+
2470
+ // Build store: $TOP/data, $SPEC supplier, $BT/$DS/$WHEN escape helpers, all
2471
+ // transform_* injectors, then merge in extraTransforms, then $ERRS.
2472
+ Map<String, Object> baseStore = new LinkedHashMap<>();
2473
+ baseStore.put(S_DTOP, dataClone);
2474
+ baseStore.put(S_DSPEC, (Supplier<Object>) () -> origspec);
2475
+ baseStore.put("$BT", (Supplier<Object>) () -> "`");
2476
+ baseStore.put("$DS", (Supplier<Object>) () -> "$");
2477
+ baseStore.put(
2478
+ "$WHEN", (Supplier<Object>) () -> java.time.Instant.now().toString());
2479
+ baseStore.put("$DELETE", transform_DELETE);
2480
+ baseStore.put("$COPY", transform_COPY);
2481
+ baseStore.put("$KEY", transform_KEY);
2482
+ baseStore.put("$ANNO", transform_ANNO);
2483
+ baseStore.put("$MERGE", transform_MERGE);
2484
+ baseStore.put("$EACH", transform_EACH);
2485
+ baseStore.put("$PACK", transform_PACK);
2486
+ baseStore.put("$REF", transform_REF);
2487
+ baseStore.put("$FORMAT", transform_FORMAT);
2488
+ baseStore.put("$APPLY", transform_APPLY);
2489
+
2490
+ List<Object> storeMergeList = new ArrayList<>();
2491
+ storeMergeList.add(baseStore);
2492
+ if (!extraTransforms.isEmpty()) storeMergeList.add(extraTransforms);
2493
+ Map<String, Object> errsHolder = new LinkedHashMap<>();
2494
+ errsHolder.put(S_DERRS, errs);
2495
+ storeMergeList.add(errsHolder);
2496
+ Object store = merge(storeMergeList, 1);
2497
+
2498
+ // Build the injection definition (modify/handler/meta/errs).
2499
+ Injection injdef = new Injection(workspec, null);
2500
+ injdef.prior = null; // partial — inject() rebuilds top state
2501
+ if (modifyRaw instanceof Modify mod) injdef.modify = mod;
2502
+ if (handlerRaw instanceof Injector h) injdef.handler = h;
2503
+ if (metaRaw instanceof Map<?, ?> mm) injdef.meta = (Map<String, Object>) mm;
2504
+ injdef.errs = errs;
2505
+
2506
+ Object out = inject(workspec, store, injdef);
2507
+
2508
+ if (!errs.isEmpty() && !collect) {
2509
+ throw new IllegalArgumentException(String.join(" | ", errsAsStrings(errs)));
2510
+ }
2511
+ return out;
2512
+ }
2513
+
2514
+ private static List<String> errsAsStrings(List<Object> errs) {
2515
+ List<String> out = new ArrayList<>(errs.size());
2516
+ for (Object e : errs) out.add(Objects.toString(e, ""));
2517
+ return out;
2518
+ }
2519
+
2520
+
2521
+ // ===========================================================================
2522
+ // Validate injectors (step 10) — reference declarations
2523
+ // ===========================================================================
2524
+ // Ported from TS lines 1977–2237. Wired in via a future step 11
2525
+ // validate() rewrite; until then the hand-rolled validate(data, spec)
2526
+ // below remains the active implementation.
2527
+
2528
+ /** $STRING: require a non-empty string. */
2529
+ public static final Injector validate_STRING =
2530
+ (injObj, val, ref, store) -> {
2531
+ if (!(injObj instanceof Injection inj)) return UNDEF;
2532
+ // Group B: validate inspects the raw data value (a stored null must be
2533
+ // type-checked, not unified away). Mirrors TS _lookup(dparent,key).
2534
+ Object out = lookup(inj.dparent, inj.key);
2535
+ int t = typify(out);
2536
+ if ((T_string & t) == 0) {
2537
+ inj.errs.add(_invalidTypeMsg(inj.path, "string", t, out, "V1010"));
2538
+ return UNDEF;
2539
+ }
2540
+ if ("".equals(out)) {
2541
+ inj.errs.add("Empty string at " + pathify(inj.path, 1));
2542
+ return UNDEF;
2543
+ }
2544
+ return out;
2545
+ };
2546
+
2547
+ /** Generic $TYPE handler: looks up the bit-flag matching {@code ref}'s name. */
2548
+ public static final Injector validate_TYPE =
2549
+ (injObj, val, ref, store) -> {
2550
+ if (!(injObj instanceof Injection inj)) return UNDEF;
2551
+ String tname = ref == null || ref.length() < 2 ? "" : ref.substring(1).toLowerCase(Locale.ROOT);
2552
+ int idx = -1;
2553
+ for (int i = 0; i < TYPENAME.length; i++) {
2554
+ if (tname.equals(TYPENAME[i])) {
2555
+ idx = i;
2556
+ break;
2557
+ }
2558
+ }
2559
+ if (idx < 0) return UNDEF;
2560
+ int typev = 1 << (31 - idx);
2561
+ // Group B: type-check the raw data value (TS _lookup(dparent,key)).
2562
+ Object out = lookup(inj.dparent, inj.key);
2563
+ int t = typify(out);
2564
+ if ((t & typev) == 0) {
2565
+ inj.errs.add(_invalidTypeMsg(inj.path, tname, t, out, "V1001"));
2566
+ return UNDEF;
2567
+ }
2568
+ return out;
2569
+ };
2570
+
2571
+ /** $ANY: accept any value. */
2572
+ public static final Injector validate_ANY =
2573
+ (injObj, val, ref, store) -> {
2574
+ if (!(injObj instanceof Injection inj)) return UNDEF;
2575
+ // Group B: $ANY returns the raw data value, preserving a stored null
2576
+ // (TS _lookup(dparent,key)).
2577
+ return lookup(inj.dparent, inj.key);
2578
+ };
2579
+
2580
+ /**
2581
+ * $CHILD: validate every direct child of the current node against a template.
2582
+ * Map syntax: {@code {`$CHILD`: child-template}} (M_KEYPRE phase).
2583
+ * List syntax: {@code [`$CHILD`, child-template]} (M_VAL phase).
2584
+ * Mirrors TS lines 2028–2101.
2585
+ */
2586
+ public static final Injector validate_CHILD =
2587
+ (injObj, val, ref, store) -> {
2588
+ if (!(injObj instanceof Injection inj)) return UNDEF;
2589
+
2590
+ if (inj.mode == M_KEYPRE) {
2591
+ Object childtm = getprop(inj.parent, inj.key);
2592
+ Object pkey = getelem(inj.path, -2);
2593
+ Object tval = getprop(inj.dparent, pkey);
2594
+
2595
+ if (tval == UNDEF || tval == null) {
2596
+ tval = new LinkedHashMap<>();
2597
+ } else if (!ismap(tval)) {
2598
+ Object sp = slice(inj.path, -1, null);
2599
+ inj.errs.add(_invalidTypeMsg(sp, "object", typify(tval), tval, "V0220"));
2600
+ return UNDEF;
2601
+ }
2602
+
2603
+ List<String> ckeys = keysof(tval);
2604
+ for (String ckey : ckeys) {
2605
+ setprop(inj.parent, ckey, clone(childtm));
2606
+ inj.keys.add(ckey);
2607
+ }
2608
+ inj.setval(UNDEF);
2609
+ return UNDEF;
2610
+ }
2611
+
2612
+ if (inj.mode == M_VAL) {
2613
+ if (!islist(inj.parent)) {
2614
+ inj.errs.add("Invalid $CHILD as value");
2615
+ return UNDEF;
2616
+ }
2617
+ // Group B: the child template is read raw (TS _lookup(parent,1)).
2618
+ Object childtm = lookup(inj.parent, 1);
2619
+
2620
+ if (inj.dparent == UNDEF || inj.dparent == null) {
2621
+ ((List<Object>) inj.parent).clear();
2622
+ return UNDEF;
2623
+ }
2624
+
2625
+ if (!islist(inj.dparent)) {
2626
+ Object sp = slice(inj.path, -1, null);
2627
+ inj.errs.add(
2628
+ _invalidTypeMsg(sp, "list", typify(inj.dparent), inj.dparent, "V0230"));
2629
+ inj.keyI = size(inj.parent);
2630
+ return inj.dparent;
2631
+ }
2632
+
2633
+ List<Object> dpl = (List<Object>) inj.dparent;
2634
+ List<Object> pl = (List<Object>) inj.parent;
2635
+ for (int i = 0; i < dpl.size(); i++) {
2636
+ setprop(pl, i, clone(childtm));
2637
+ }
2638
+ while (pl.size() > dpl.size()) pl.remove(pl.size() - 1);
2639
+ inj.keyI = 0;
2640
+
2641
+ return getprop(inj.dparent, 0);
2642
+ }
2643
+
2644
+ return UNDEF;
2645
+ };
2646
+
2647
+ /**
2648
+ * $ONE: validate against any one of a list of alternative shapes.
2649
+ * Format: {@code [`$ONE`, alt0, alt1, ...]}. Mirrors TS lines 2109–2175.
2650
+ */
2651
+ public static final Injector validate_ONE =
2652
+ (injObj, val, ref, store) -> {
2653
+ if (!(injObj instanceof Injection inj)) return UNDEF;
2654
+ if (inj.mode != M_VAL) return UNDEF;
2655
+
2656
+ if (!islist(inj.parent) || inj.keyI != 0) {
2657
+ inj.errs.add(
2658
+ "The $ONE validator at field "
2659
+ + pathify(inj.path, 1, 1)
2660
+ + " must be the first element of an array.");
2661
+ return UNDEF;
2662
+ }
2663
+
2664
+ inj.keyI = size(inj.keys);
2665
+ inj.setval(inj.dparent, 2);
2666
+
2667
+ Object slicedPath = slice(inj.path, -1, null);
2668
+ inj.path =
2669
+ slicedPath instanceof List<?> spl
2670
+ ? new ArrayList<>((List<String>) spl)
2671
+ : new ArrayList<>();
2672
+ inj.key = strkey(getelem(inj.path, -1));
2673
+
2674
+ Object tvalsRaw = slice(inj.parent, 1, null);
2675
+ List<Object> tvals =
2676
+ tvalsRaw instanceof List<?> tl
2677
+ ? new ArrayList<>((List<Object>) tl)
2678
+ : new ArrayList<>();
2679
+ if (tvals.isEmpty()) {
2680
+ inj.errs.add(
2681
+ "The $ONE validator at field "
2682
+ + pathify(inj.path, 1, 1)
2683
+ + " must have at least one argument.");
2684
+ return UNDEF;
2685
+ }
2686
+
2687
+ for (Object tval : tvals) {
2688
+ List<Object> terrs = new ArrayList<>();
2689
+ Map<String, Object> vstore = new LinkedHashMap<>();
2690
+ if (store instanceof Map<?, ?> sm) {
2691
+ for (Map.Entry<?, ?> e : sm.entrySet()) {
2692
+ vstore.put(Objects.toString(e.getKey()), e.getValue());
2693
+ }
2694
+ }
2695
+ vstore.put(S_DTOP, inj.dparent);
2696
+ Map<String, Object> opts = new LinkedHashMap<>();
2697
+ opts.put("extra", vstore);
2698
+ opts.put("errs", terrs);
2699
+ opts.put("meta", inj.meta);
2700
+ Object vcurrent;
2701
+ try {
2702
+ vcurrent = validate(inj.dparent, tval, opts);
2703
+ } catch (Exception e) {
2704
+ terrs.add(e.getMessage());
2705
+ vcurrent = inj.dparent;
2706
+ }
2707
+ inj.setval(vcurrent, -2);
2708
+ if (terrs.isEmpty()) return UNDEF;
2709
+ }
2710
+
2711
+ // No match; describe alternatives.
2712
+ StringBuilder valdesc = new StringBuilder();
2713
+ for (int i = 0; i < tvals.size(); i++) {
2714
+ if (i > 0) valdesc.append(", ");
2715
+ Object tv = tvals.get(i);
2716
+ if (tv instanceof String s) {
2717
+ Matcher m = R_TRANSFORM_NAME.matcher(s);
2718
+ if (m.matches()) {
2719
+ valdesc.append(m.group(1).toLowerCase(Locale.ROOT));
2720
+ continue;
2721
+ }
2722
+ }
2723
+ valdesc.append(stringify(tv));
2724
+ }
2725
+ inj.errs.add(
2726
+ _invalidTypeMsg(
2727
+ inj.path,
2728
+ (size(tvals) > 1 ? "one of " : "") + valdesc,
2729
+ typify(inj.dparent),
2730
+ inj.dparent,
2731
+ "V0210"));
2732
+ return UNDEF;
2733
+ };
2734
+
2735
+ /**
2736
+ * $EXACT: validate against any one of a list of literal alternatives.
2737
+ * Format: {@code [`$EXACT`, lit0, lit1, ...]}. Mirrors TS lines 2178–2237.
2738
+ */
2739
+ public static final Injector validate_EXACT =
2740
+ (injObj, val, ref, store) -> {
2741
+ if (!(injObj instanceof Injection inj)) return UNDEF;
2742
+
2743
+ if (inj.mode == M_VAL) {
2744
+ if (!islist(inj.parent) || inj.keyI != 0) {
2745
+ inj.errs.add(
2746
+ "The $EXACT validator at field "
2747
+ + pathify(inj.path, 1, 1)
2748
+ + " must be the first element of an array.");
2749
+ return UNDEF;
2750
+ }
2751
+
2752
+ inj.keyI = size(inj.keys);
2753
+ inj.setval(inj.dparent, 2);
2754
+
2755
+ Object slicedPath = slice(inj.path, 0, -1);
2756
+ inj.path =
2757
+ slicedPath instanceof List<?> spl
2758
+ ? new ArrayList<>((List<String>) spl)
2759
+ : new ArrayList<>();
2760
+ inj.key = strkey(getelem(inj.path, -1));
2761
+
2762
+ Object tvalsRaw = slice(inj.parent, 1, null);
2763
+ List<Object> tvals =
2764
+ tvalsRaw instanceof List<?> tl
2765
+ ? new ArrayList<>((List<Object>) tl)
2766
+ : new ArrayList<>();
2767
+ if (tvals.isEmpty()) {
2768
+ inj.errs.add(
2769
+ "The $EXACT validator at field "
2770
+ + pathify(inj.path, 1, 1)
2771
+ + " must have at least one argument.");
2772
+ return UNDEF;
2773
+ }
2774
+
2775
+ String currentstr = null;
2776
+ for (Object tval : tvals) {
2777
+ boolean exactmatch = Objects.equals(tval, inj.dparent);
2778
+ if (!exactmatch && isnode(tval)) {
2779
+ if (currentstr == null) currentstr = stringify(inj.dparent);
2780
+ String tvalstr = stringify(tval);
2781
+ exactmatch = tvalstr.equals(currentstr);
2782
+ }
2783
+ if (exactmatch) return UNDEF;
2784
+ }
2785
+
2786
+ // No match.
2787
+ StringBuilder valdesc = new StringBuilder();
2788
+ for (int i = 0; i < tvals.size(); i++) {
2789
+ if (i > 0) valdesc.append(", ");
2790
+ Object tv = tvals.get(i);
2791
+ if (tv instanceof String s) {
2792
+ Matcher m = R_TRANSFORM_NAME.matcher(s);
2793
+ if (m.matches()) {
2794
+ valdesc.append(m.group(1).toLowerCase(Locale.ROOT));
2795
+ continue;
2796
+ }
2797
+ }
2798
+ valdesc.append(stringify(tv));
2799
+ }
2800
+ inj.errs.add(
2801
+ _invalidTypeMsg(
2802
+ inj.path,
2803
+ (size(inj.path) > 1 ? "" : "value ")
2804
+ + "exactly equal to "
2805
+ + (size(tvals) == 1 ? "" : "one of ")
2806
+ + valdesc,
2807
+ typify(inj.dparent),
2808
+ inj.dparent,
2809
+ "V0110"));
2810
+ return UNDEF;
2811
+ } else {
2812
+ delprop(inj.parent, inj.key);
2813
+ return UNDEF;
2814
+ }
2815
+ };
2816
+
2817
+ /**
2818
+ * Modify hook used by {@link #validate(Object, Object)}: runs after each
2819
+ * inject step; performs type-mismatch checks, open-vs-closed map handling
2820
+ * via {@code `$OPEN`}, exact-mode comparison, and default-value copy-over.
2821
+ * Mirrors TS {@code _validation} (lines 2242–2333).
2822
+ */
2823
+ public static final Modify _validation =
2824
+ (pval, key, parent, injObj, store) -> {
2825
+ if (!(injObj instanceof Injection inj)) return;
2826
+ if (pval == SKIP) return;
2827
+
2828
+ boolean exact = Boolean.TRUE.equals(getprop(inj.meta, "`$EXACT`", false));
2829
+ Object cval = getprop(inj.dparent, key);
2830
+ if (!exact && (cval == UNDEF || cval == null)) return;
2831
+
2832
+ int ptype = typify(pval);
2833
+ // Skip strings containing $ (special command refs).
2834
+ if ((T_string & ptype) != 0 && pval instanceof String ps && ps.contains("$")) {
2835
+ return;
2836
+ }
2837
+
2838
+ int ctype = typify(cval);
2839
+ if (ptype != ctype && pval != UNDEF) {
2840
+ inj.errs.add(_invalidTypeMsg(inj.path, typename(ptype), ctype, cval, "V0010"));
2841
+ return;
2842
+ }
2843
+
2844
+ if (ismap(cval)) {
2845
+ if (!ismap(pval)) {
2846
+ inj.errs.add(_invalidTypeMsg(inj.path, typename(ptype), ctype, cval, "V0020"));
2847
+ return;
2848
+ }
2849
+ List<String> ckeys = keysof(cval);
2850
+ List<String> pkeys = keysof(pval);
2851
+
2852
+ if (size(pkeys) > 0 && !Boolean.TRUE.equals(getprop(pval, "`$OPEN`"))) {
2853
+ List<String> badkeys = new ArrayList<>();
2854
+ for (String ck : ckeys) {
2855
+ // Group B literal presence: a key the SHAPE declares is allowed
2856
+ // even when its declared value is JSON null (TS _lookup, not the
2857
+ // Group A haskey which would miss null-valued shape slots).
2858
+ if (lookup(pval, ck) == UNDEF) badkeys.add(ck);
2859
+ }
2860
+ if (!badkeys.isEmpty()) {
2861
+ inj.errs.add(
2862
+ "Unexpected keys at field "
2863
+ + pathify(inj.path, 1)
2864
+ + ": "
2865
+ + String.join(", ", badkeys));
2866
+ }
2867
+ } else {
2868
+ List<Object> mergeArgs = new ArrayList<>();
2869
+ mergeArgs.add(pval);
2870
+ mergeArgs.add(cval);
2871
+ merge(mergeArgs);
2872
+ if (isnode(pval)) {
2873
+ delprop(pval, "`$OPEN`");
2874
+ }
2875
+ }
2876
+ } else if (islist(cval)) {
2877
+ if (!islist(pval)) {
2878
+ inj.errs.add(_invalidTypeMsg(inj.path, typename(ptype), ctype, cval, "V0030"));
2879
+ }
2880
+ } else if (exact) {
2881
+ if (!Objects.equals(cval, pval)) {
2882
+ String pathmsg =
2883
+ size(inj.path) > 1
2884
+ ? "at field " + pathify(inj.path, 1) + ": "
2885
+ : "";
2886
+ inj.errs.add(
2887
+ "Value " + pathmsg + jsString(cval) + " should equal " + jsString(pval) + ".");
2888
+ }
2889
+ } else {
2890
+ // Spec value was a default; copy data over.
2891
+ setprop(parent, key, cval);
2892
+ }
2893
+ };
2894
+
2895
+ /**
2896
+ * Custom Injector used by {@link #validate(Object, Object)}: intercepts
2897
+ * meta-path syntax ({@code `<root>$=value`}, {@code `<root>$~spec`}) before
2898
+ * delegating to the default {@link #_injecthandler}. Mirrors TS lines 2801–2828.
2899
+ */
2900
+ public static final Injector _validatehandler =
2901
+ (injObj, val, ref, store) -> {
2902
+ if (!(injObj instanceof Injection inj)) return val;
2903
+ if (ref != null) {
2904
+ Matcher m = R_META_PATH.matcher(ref);
2905
+ if (m.matches()) {
2906
+ String op = m.group(2);
2907
+ if ("=".equals(op)) {
2908
+ List<Object> wrap = new ArrayList<>();
2909
+ wrap.add("`$EXACT`");
2910
+ wrap.add(val);
2911
+ inj.setval(wrap);
2912
+ } else {
2913
+ inj.setval(val);
2914
+ }
2915
+ inj.keyI = -1;
2916
+ return SKIP;
2917
+ }
2918
+ }
2919
+ return _injecthandler.apply(inj, val, ref, store);
2920
+ };
2921
+
2922
+ // ===========================================================================
2923
+ // Select injectors (step 12) — reference declarations
2924
+ // ===========================================================================
2925
+ // Ported from TS lines 2414–2551. Wired in via a future step 12
2926
+ // select() rewrite; until then the hand-rolled select(children, query)
2927
+ // below remains the active implementation.
2928
+
2929
+ /** Build the recursive validate options used by select_*: rebind $TOP to
2930
+ * the current point and pass through meta + the existing store as extra. */
2931
+ private static Map<String, Object> selectRecOpts(
2932
+ Object store, Object point, Map<String, Object> meta, List<Object> errs) {
2933
+ Map<String, Object> vstore = new LinkedHashMap<>();
2934
+ if (store instanceof Map<?, ?> sm) {
2935
+ for (Map.Entry<?, ?> e : sm.entrySet()) {
2936
+ vstore.put(Objects.toString(e.getKey()), e.getValue());
2937
+ }
2938
+ }
2939
+ vstore.put(S_DTOP, point);
2940
+ Map<String, Object> opts = new LinkedHashMap<>();
2941
+ opts.put("errs", errs);
2942
+ opts.put("meta", meta);
2943
+ opts.put("extra", vstore);
2944
+ return opts;
2945
+ }
2946
+
2947
+ /** $AND: require every sub-term to validate against the current point. */
2948
+ public static final Injector select_AND =
2949
+ (injObj, val, ref, store) -> {
2950
+ if (!(injObj instanceof Injection inj)) return UNDEF;
2951
+ if (inj.mode != M_KEYPRE) return UNDEF;
2952
+ // Group B: select operator terms are read raw (TS _lookup(parent,key)).
2953
+ Object terms = lookup(inj.parent, inj.key);
2954
+ if (!(terms instanceof List<?> tl)) return UNDEF;
2955
+ Object ppath = slice(inj.path, -1, null);
2956
+ Object point = getpath(store, ppath);
2957
+ for (Object term : tl) {
2958
+ List<Object> terrs = new ArrayList<>();
2959
+ Map<String, Object> opts = selectRecOpts(store, point, inj.meta, terrs);
2960
+ try {
2961
+ validate(point, term, opts);
2962
+ } catch (Exception e) {
2963
+ terrs.add(e.getMessage());
2964
+ }
2965
+ if (!terrs.isEmpty()) {
2966
+ inj.errs.add(
2967
+ "AND:" + pathify(ppath) + ": " + stringify(point) + " fail:" + stringify(terms));
2968
+ }
2969
+ }
2970
+ Object gkey = getelem(inj.path, -2);
2971
+ Object gp = getelem(inj.nodes, -2);
2972
+ setprop(gp, gkey, point);
2973
+ return UNDEF;
2974
+ };
2975
+
2976
+ /** $OR: require at least one sub-term to validate. */
2977
+ public static final Injector select_OR =
2978
+ (injObj, val, ref, store) -> {
2979
+ if (!(injObj instanceof Injection inj)) return UNDEF;
2980
+ if (inj.mode != M_KEYPRE) return UNDEF;
2981
+ // Group B: select operator terms are read raw (TS _lookup(parent,key)).
2982
+ Object terms = lookup(inj.parent, inj.key);
2983
+ if (!(terms instanceof List<?> tl)) return UNDEF;
2984
+ Object ppath = slice(inj.path, -1, null);
2985
+ Object point = getpath(store, ppath);
2986
+ for (Object term : tl) {
2987
+ List<Object> terrs = new ArrayList<>();
2988
+ Map<String, Object> opts = selectRecOpts(store, point, inj.meta, terrs);
2989
+ try {
2990
+ validate(point, term, opts);
2991
+ } catch (Exception e) {
2992
+ terrs.add(e.getMessage());
2993
+ }
2994
+ if (terrs.isEmpty()) {
2995
+ Object gkey = getelem(inj.path, -2);
2996
+ Object gp = getelem(inj.nodes, -2);
2997
+ setprop(gp, gkey, point);
2998
+ return UNDEF;
2999
+ }
3000
+ }
3001
+ inj.errs.add(
3002
+ "OR:" + pathify(ppath) + ": " + stringify(point) + " fail:" + stringify(terms));
3003
+ return UNDEF;
3004
+ };
3005
+
3006
+ /** $NOT: require the sub-term to fail validation. */
3007
+ public static final Injector select_NOT =
3008
+ (injObj, val, ref, store) -> {
3009
+ if (!(injObj instanceof Injection inj)) return UNDEF;
3010
+ if (inj.mode != M_KEYPRE) return UNDEF;
3011
+ // Group B: select $NOT term is read raw (TS _lookup(parent,key)).
3012
+ Object term = lookup(inj.parent, inj.key);
3013
+ Object ppath = slice(inj.path, -1, null);
3014
+ Object point = getpath(store, ppath);
3015
+ List<Object> terrs = new ArrayList<>();
3016
+ Map<String, Object> opts = selectRecOpts(store, point, inj.meta, terrs);
3017
+ try {
3018
+ validate(point, term, opts);
3019
+ } catch (Exception e) {
3020
+ terrs.add(e.getMessage());
3021
+ }
3022
+ if (terrs.isEmpty()) {
3023
+ inj.errs.add(
3024
+ "NOT:" + pathify(ppath) + ": " + stringify(point) + " fail:" + stringify(term));
3025
+ }
3026
+ Object gkey = getelem(inj.path, -2);
3027
+ Object gp = getelem(inj.nodes, -2);
3028
+ setprop(gp, gkey, point);
3029
+ return UNDEF;
3030
+ };
3031
+
3032
+ /** $GT/$LT/$GTE/$LTE/$LIKE comparators dispatched by {@code ref}. */
3033
+ public static final Injector select_CMP =
3034
+ (injObj, val, ref, store) -> {
3035
+ if (!(injObj instanceof Injection inj)) return UNDEF;
3036
+ if (inj.mode != M_KEYPRE) return UNDEF;
3037
+ // Group B: select $CMP term is read raw (TS _lookup(parent,key)).
3038
+ Object term = lookup(inj.parent, inj.key);
3039
+ Object gkey = getelem(inj.path, -2);
3040
+ Object ppath = slice(inj.path, -1, null);
3041
+ Object point = getpath(store, ppath);
3042
+ boolean pass = false;
3043
+ if (point instanceof Number pn && term instanceof Number tn) {
3044
+ double a = pn.doubleValue();
3045
+ double b = tn.doubleValue();
3046
+ pass =
3047
+ switch (ref) {
3048
+ case "$GT" -> a > b;
3049
+ case "$LT" -> a < b;
3050
+ case "$GTE" -> a >= b;
3051
+ case "$LTE" -> a <= b;
3052
+ default -> false;
3053
+ };
3054
+ } else if ("$LIKE".equals(ref) && term instanceof String pattern) {
3055
+ try {
3056
+ pass = Pattern.compile(pattern).matcher(stringify(point)).find();
3057
+ } catch (Exception ignored) {
3058
+ pass = false;
3059
+ }
3060
+ }
3061
+ if (pass) {
3062
+ Object gp = getelem(inj.nodes, -2);
3063
+ setprop(gp, gkey, point);
3064
+ } else {
3065
+ inj.errs.add(
3066
+ "CMP: "
3067
+ + pathify(ppath)
3068
+ + ": "
3069
+ + stringify(point)
3070
+ + " fail:"
3071
+ + ref
3072
+ + " "
3073
+ + stringify(term));
3074
+ }
3075
+ return UNDEF;
3076
+ };
3077
+
3078
+ public static Object validate(Object data, Object spec) {
3079
+ return validate(data, spec, null);
3080
+ }
3081
+
3082
+ /**
3083
+ * TS-faithful validate: build a store with validate_* injectors plus nulled
3084
+ * transform commands, then dispatch via {@link #transform} with
3085
+ * {@link #_validation} as modify and {@link #_validatehandler} as handler.
3086
+ * Mirrors TS {@code validate} (StructUtility.ts lines 2347–2411).
3087
+ */
3088
+ public static Object validate(Object data, Object spec, Map<String, Object> options) {
3089
+ Object extraRaw = options == null ? null : options.get("extra");
3090
+ Object errsRaw = options == null ? null : options.get("errs");
3091
+ Object metaRaw = options == null ? null : options.get("meta");
3092
+
3093
+ boolean collect = errsRaw instanceof List<?>;
3094
+ List<Object> errs = collect ? (List<Object>) errsRaw : new ArrayList<>();
3095
+
3096
+ // Build store: nullify transform commands, add validate_* injectors.
3097
+ Map<String, Object> baseStore = new LinkedHashMap<>();
3098
+ baseStore.put("$DELETE", null);
3099
+ baseStore.put("$COPY", null);
3100
+ baseStore.put("$KEY", null);
3101
+ baseStore.put("$META", null);
3102
+ baseStore.put("$MERGE", null);
3103
+ baseStore.put("$EACH", null);
3104
+ baseStore.put("$PACK", null);
3105
+
3106
+ baseStore.put("$STRING", validate_STRING);
3107
+ baseStore.put("$NUMBER", validate_TYPE);
3108
+ baseStore.put("$INTEGER", validate_TYPE);
3109
+ baseStore.put("$DECIMAL", validate_TYPE);
3110
+ baseStore.put("$BOOLEAN", validate_TYPE);
3111
+ baseStore.put("$NULL", validate_TYPE);
3112
+ baseStore.put("$NIL", validate_TYPE);
3113
+ baseStore.put("$MAP", validate_TYPE);
3114
+ baseStore.put("$LIST", validate_TYPE);
3115
+ baseStore.put("$FUNCTION", validate_TYPE);
3116
+ baseStore.put("$INSTANCE", validate_TYPE);
3117
+ baseStore.put("$ANY", validate_ANY);
3118
+ baseStore.put("$CHILD", validate_CHILD);
3119
+ baseStore.put("$ONE", validate_ONE);
3120
+ baseStore.put("$EXACT", validate_EXACT);
3121
+
3122
+ List<Object> mergeList = new ArrayList<>();
3123
+ mergeList.add(baseStore);
3124
+ if (extraRaw instanceof Map<?, ?> em) mergeList.add(em);
3125
+ Map<String, Object> errsHolder = new LinkedHashMap<>();
3126
+ errsHolder.put(S_DERRS, errs);
3127
+ mergeList.add(errsHolder);
3128
+ Object store = merge(mergeList, 1);
3129
+
3130
+ // Build meta with `$EXACT` default.
3131
+ Map<String, Object> meta;
3132
+ if (metaRaw instanceof Map<?, ?> mm) {
3133
+ meta = new LinkedHashMap<>();
3134
+ for (Map.Entry<?, ?> e : ((Map<?, ?>) mm).entrySet()) {
3135
+ meta.put(Objects.toString(e.getKey()), e.getValue());
3136
+ }
3137
+ } else {
3138
+ meta = new LinkedHashMap<>();
3139
+ }
3140
+ if (!meta.containsKey("`$EXACT`")) {
3141
+ meta.put("`$EXACT`", false);
3142
+ }
3143
+
3144
+ Map<String, Object> opts = new LinkedHashMap<>();
3145
+ opts.put("meta", meta);
3146
+ opts.put("extra", store);
3147
+ opts.put("modify", _validation);
3148
+ opts.put("handler", _validatehandler);
3149
+ opts.put("errs", errs);
3150
+
3151
+ Object out = transform(data, spec, opts);
3152
+
3153
+ if (!errs.isEmpty() && !collect) {
3154
+ throw new IllegalArgumentException(String.join(" | ", errsAsStrings(errs)));
3155
+ }
3156
+ return out;
3157
+ }
3158
+
3159
+ /**
3160
+ * TS-faithful select: tag each child node with {@code $KEY}, walk the
3161
+ * (cloned) query annotating every map with {@code `$OPEN`}, then run
3162
+ * {@link #validate} against each child with the {@code select_*} injectors
3163
+ * available as extras and {@code meta.`$EXACT`} = true.
3164
+ * Mirrors TS lines 2558–2609.
3165
+ */
3166
+ public static List<Object> select(Object children, Object query) {
3167
+ if (!isnode(children)) {
3168
+ return new ArrayList<>();
3169
+ }
3170
+
3171
+ // Tag each node child with $KEY = original key/index; non-node children
3172
+ // (strings/numbers/etc.) are passed through as-is — TS setprop on a
3173
+ // non-node returns the value unchanged, so these are still selectable.
3174
+ List<Object> childList = new ArrayList<>();
3175
+ if (ismap(children)) {
3176
+ for (Map.Entry<?, ?> e : ((Map<?, ?>) children).entrySet()) {
3177
+ Object node = e.getValue();
3178
+ if (isnode(node)) {
3179
+ setprop(node, S_DKEY, Objects.toString(e.getKey()));
3180
+ }
3181
+ childList.add(node);
3182
+ }
3183
+ } else {
3184
+ List<?> cl = (List<?>) children;
3185
+ for (int i = 0; i < cl.size(); i++) {
3186
+ Object node = cl.get(i);
3187
+ if (isnode(node)) {
3188
+ setprop(node, S_DKEY, (long) i);
3189
+ }
3190
+ childList.add(node);
3191
+ }
3192
+ }
3193
+
3194
+ // Build injdef: meta with $EXACT=true; extras for select_* operators.
3195
+ Map<String, Object> meta = new LinkedHashMap<>();
3196
+ meta.put("`$EXACT`", true);
3197
+
3198
+ Map<String, Object> extra = new LinkedHashMap<>();
3199
+ extra.put("$AND", select_AND);
3200
+ extra.put("$OR", select_OR);
3201
+ extra.put("$NOT", select_NOT);
3202
+ extra.put("$GT", select_CMP);
3203
+ extra.put("$LT", select_CMP);
3204
+ extra.put("$GTE", select_CMP);
3205
+ extra.put("$LTE", select_CMP);
3206
+ extra.put("$LIKE", select_CMP);
3207
+
3208
+ // Clone query and annotate every map with `$OPEN`=true.
3209
+ Object q = clone(query);
3210
+ walk(
3211
+ q,
3212
+ (k, v, p, t) -> {
3213
+ if (ismap(v)) {
3214
+ setprop(v, "`$OPEN`", getprop(v, "`$OPEN`", true));
3215
+ }
3216
+ return v;
3217
+ });
3218
+
3219
+ List<Object> results = new ArrayList<>();
3220
+ for (Object child : childList) {
3221
+ List<Object> errs = new ArrayList<>();
3222
+ Map<String, Object> opts = new LinkedHashMap<>();
3223
+ opts.put("errs", errs);
3224
+ opts.put("meta", meta);
3225
+ opts.put("extra", extra);
3226
+ try {
3227
+ validate(child, clone(q), opts);
3228
+ } catch (Exception e) {
3229
+ errs.add(e.getMessage());
3230
+ }
3231
+ if (errs.isEmpty()) {
3232
+ results.add(child);
3233
+ }
3234
+ }
3235
+ return results;
3236
+ }
3237
+
3238
+
3239
+ // ===========================================================================
3240
+ // Injection
3241
+ // ===========================================================================
3242
+
3243
+ /**
3244
+ * Recursive state passed through {@link #inject}, {@link #transform}, and
3245
+ * {@link #validate}. Mirrors TS {@code class Injection} (StructUtility.ts
3246
+ * lines 2613–2744).
3247
+ *
3248
+ * <h3>Sharing semantics (critical)</h3>
3249
+ * <ul>
3250
+ * <li>{@link #child(int, List)} shares {@link #keys}, {@link #errs},
3251
+ * and {@link #meta} <em>by reference</em> with the parent. The
3252
+ * {@code $EACH} and {@code $PACK} injectors mutate {@code keys} during
3253
+ * descent — defensively copying them silently breaks those tests.</li>
3254
+ * <li>{@link #path}, {@link #nodes}, and {@link #dpath} are flattened
3255
+ * (copied) per child.</li>
3256
+ * </ul>
3257
+ *
3258
+ * <p>This class is package-private to its own file and is intentionally not
3259
+ * Gson-serializable: a circular {@link #prior} reference would stack-overflow
3260
+ * any default serializer.
3261
+ */
3262
+ public static class Injection {
3263
+ public int mode; // M_KEYPRE | M_KEYPOST | M_VAL
3264
+ public boolean full; // injection consumed the whole key string
3265
+ public int keyI; // index of current key in keys
3266
+ public List<String> keys; // sibling keys list (shared with prior)
3267
+ public String key; // current key string
3268
+ public Object val; // current child value
3269
+ public Object parent; // current parent in spec
3270
+ public List<String> path; // ancestor key chain ending in key
3271
+ public List<Object> nodes; // ancestor node stack ending in parent
3272
+ public Injector handler; // dispatch hook for `$NAME` references
3273
+ public List<Object> errs; // shared error collector
3274
+ public Map<String, Object> meta; // shared metadata bag (do not deep-copy)
3275
+ public Object dparent = UNDEF; // current data-side parent
3276
+ public List<String> dpath; // current data-side path
3277
+ public String base; // base key in store, if any
3278
+ public Modify modify; // optional value-mutation hook
3279
+ public Injection prior; // calling injection (chain upwards)
3280
+ public Object extra; // free-form passthrough
3281
+
3282
+ /** Top-level constructor: mirrors {@code new Injection(val, parent)} in TS. */
3283
+ public Injection(Object val, Object parent) {
3284
+ this.val = val;
3285
+ this.parent = parent;
3286
+ this.errs = new ArrayList<>();
3287
+ this.dparent = UNDEF;
3288
+ this.dpath = new ArrayList<>(List.of(S_DTOP));
3289
+ this.mode = M_VAL;
3290
+ this.full = false;
3291
+ this.keyI = 0;
3292
+ this.keys = new ArrayList<>(List.of(S_DTOP));
3293
+ this.key = S_DTOP;
3294
+ this.path = new ArrayList<>(List.of(S_DTOP));
3295
+ this.nodes = new ArrayList<>();
3296
+ this.nodes.add(parent);
3297
+ this.handler = null; // wired in step 5a (_injecthandler)
3298
+ this.base = S_DTOP;
3299
+ this.meta = new LinkedHashMap<>();
3300
+ }
3301
+
3302
+ /**
3303
+ * Resolve current data-side parent for relative paths and bump depth.
3304
+ * Mirrors TS {@code Injection.descend()}.
3305
+ */
3306
+ public Object descend() {
3307
+ Object dRaw = meta.get("__d");
3308
+ int d = dRaw instanceof Number n ? n.intValue() : 0;
3309
+ meta.put("__d", d + 1);
3310
+
3311
+ Object parentkey = path.size() >= 2 ? path.get(path.size() - 2) : null;
3312
+
3313
+ if (dparent == UNDEF) {
3314
+ if (size(dpath) > 1 && parentkey != null) {
3315
+ List<String> nd = new ArrayList<>(dpath);
3316
+ nd.add(strkey(parentkey));
3317
+ this.dpath = nd;
3318
+ }
3319
+ } else {
3320
+ if (parentkey != null) {
3321
+ this.dparent = getprop(this.dparent, parentkey);
3322
+ String lastpart = dpath.isEmpty() ? null : dpath.get(dpath.size() - 1);
3323
+ String marker = "$:" + strkey(parentkey);
3324
+ if (marker.equals(lastpart)) {
3325
+ Object sliced = slice(this.dpath, -1, null);
3326
+ this.dpath =
3327
+ sliced instanceof List<?> l ? new ArrayList<>((List<String>) l) : new ArrayList<>();
3328
+ } else {
3329
+ List<String> nd = new ArrayList<>(dpath);
3330
+ nd.add(strkey(parentkey));
3331
+ this.dpath = nd;
3332
+ }
3333
+ }
3334
+ }
3335
+ return dparent;
3336
+ }
3337
+
3338
+ /**
3339
+ * Build a child injection at {@code keys[keyI]}. Sharing semantics: see
3340
+ * class javadoc.
3341
+ */
3342
+ public Injection child(int keyI, List<String> keys) {
3343
+ String key = strkey(keys.get(keyI));
3344
+ Object val = this.val;
3345
+
3346
+ Injection cinj = new Injection(getprop(val, key), val);
3347
+ cinj.keyI = keyI;
3348
+ cinj.keys = keys; // shared reference
3349
+ cinj.key = key;
3350
+
3351
+ List<String> np = path == null ? new ArrayList<>() : new ArrayList<>(path);
3352
+ np.add(key);
3353
+ cinj.path = np;
3354
+
3355
+ List<Object> nn = nodes == null ? new ArrayList<>() : new ArrayList<>(nodes);
3356
+ nn.add(val);
3357
+ cinj.nodes = nn;
3358
+
3359
+ cinj.mode = this.mode;
3360
+ cinj.handler = this.handler;
3361
+ cinj.modify = this.modify;
3362
+ cinj.base = this.base;
3363
+ cinj.meta = this.meta; // shared reference
3364
+ cinj.errs = this.errs; // shared reference
3365
+ cinj.prior = this;
3366
+ cinj.dpath = new ArrayList<>(this.dpath); // flattened
3367
+ cinj.dparent = this.dparent;
3368
+
3369
+ return cinj;
3370
+ }
3371
+
3372
+ /** Set the current child value on the immediate parent. */
3373
+ public Object setval(Object val) {
3374
+ return setval(val, 0);
3375
+ }
3376
+
3377
+ /**
3378
+ * Set / delete a value on an ancestor.
3379
+ * <ul>
3380
+ * <li>{@code ancestor < 2} → operate on {@link #parent} at {@link #key}.</li>
3381
+ * <li>{@code ancestor >= 2} → walk back to {@code nodes[-ancestor]} and
3382
+ * use {@code path[-ancestor]} as the key.</li>
3383
+ * </ul>
3384
+ * When {@code val == UNDEF}, the key is deleted via {@link Struct#delprop}.
3385
+ */
3386
+ public Object setval(Object val, int ancestor) {
3387
+ Object parent;
3388
+ if (ancestor < 2) {
3389
+ if (val == UNDEF) {
3390
+ parent = delprop(this.parent, this.key);
3391
+ this.parent = parent;
3392
+ } else {
3393
+ parent = setprop(this.parent, this.key, val);
3394
+ }
3395
+ } else {
3396
+ Object aval = getelem(this.nodes, 0 - ancestor);
3397
+ Object akey = getelem(this.path, 0 - ancestor);
3398
+ if (val == UNDEF) {
3399
+ parent = delprop(aval, akey);
3400
+ } else {
3401
+ parent = setprop(aval, akey, val);
3402
+ }
3403
+ }
3404
+ return parent;
3405
+ }
3406
+
3407
+ @Override
3408
+ public String toString() {
3409
+ return toString(null);
3410
+ }
3411
+
3412
+ public String toString(String prefix) {
3413
+ StringBuilder sb = new StringBuilder();
3414
+ sb.append("INJ");
3415
+ if (prefix != null) {
3416
+ sb.append("/").append(prefix);
3417
+ }
3418
+ sb.append(":").append(pathify(path, 1));
3419
+ sb.append(":").append(MODENAME.getOrDefault(mode, "?"));
3420
+ if (full) {
3421
+ sb.append("/full");
3422
+ }
3423
+ sb.append(": key=").append(keyI).append("/").append(key);
3424
+ sb.append(" keys=").append(keys);
3425
+ sb.append(" parent=").append(stringify(parent, 60));
3426
+ sb.append(" dpath=").append(dpath);
3427
+ return sb.toString();
3428
+ }
3429
+ }
3430
+
3431
+ // ===========================================================================
3432
+ // StructUtility — instance-based facade
3433
+ // ===========================================================================
3434
+
3435
+ /**
3436
+ * Instance-based wrapper around the static Struct API. Mirrors TS
3437
+ * {@code StructUtility} (StructUtility.ts lines 2991–3056) for SDK callers
3438
+ * that prefer dependency-injected utility access. All methods delegate
3439
+ * directly to the corresponding static; sentinels and constants are exposed
3440
+ * as instance fields.
3441
+ */
3442
+ public static class StructUtility {
3443
+ // Sentinels
3444
+ public final Object UNDEF = Struct.UNDEF;
3445
+ public final Map<String, Object> SKIP = Struct.SKIP;
3446
+ public final Map<String, Object> DELETE = Struct.DELETE;
3447
+
3448
+ // Type bit-flags
3449
+ public final int T_any = Struct.T_any;
3450
+ public final int T_noval = Struct.T_noval;
3451
+ public final int T_boolean = Struct.T_boolean;
3452
+ public final int T_decimal = Struct.T_decimal;
3453
+ public final int T_integer = Struct.T_integer;
3454
+ public final int T_number = Struct.T_number;
3455
+ public final int T_string = Struct.T_string;
3456
+ public final int T_function = Struct.T_function;
3457
+ public final int T_symbol = Struct.T_symbol;
3458
+ public final int T_null = Struct.T_null;
3459
+ public final int T_list = Struct.T_list;
3460
+ public final int T_map = Struct.T_map;
3461
+ public final int T_instance = Struct.T_instance;
3462
+ public final int T_scalar = Struct.T_scalar;
3463
+ public final int T_node = Struct.T_node;
3464
+
3465
+ // Mode flags
3466
+ public final int M_KEYPRE = Struct.M_KEYPRE;
3467
+ public final int M_KEYPOST = Struct.M_KEYPOST;
3468
+ public final int M_VAL = Struct.M_VAL;
3469
+ public final Map<Integer, String> MODENAME = Struct.MODENAME;
3470
+
3471
+ // Minor utilities
3472
+ public boolean isnode(Object v) { return Struct.isnode(v); }
3473
+ public boolean ismap(Object v) { return Struct.ismap(v); }
3474
+ public boolean islist(Object v) { return Struct.islist(v); }
3475
+ public boolean iskey(Object v) { return Struct.iskey(v); }
3476
+ public boolean isempty(Object v) { return Struct.isempty(v); }
3477
+ public boolean isfunc(Object v) { return Struct.isfunc(v); }
3478
+ public Object getdef(Object v, Object alt) { return Struct.getdef(v, alt); }
3479
+ public int size(Object v) { return Struct.size(v); }
3480
+ public Object slice(Object v, Object s, Object e) { return Struct.slice(v, s, e); }
3481
+ public String pad(Object v, Object p, Object c) { return Struct.pad(v, p, c); }
3482
+ public int typify(Object v) { return Struct.typify(v); }
3483
+ public String typename(int t) { return Struct.typename(t); }
3484
+ public String tn(int t) { return Struct.typename(t); }
3485
+ public Object getelem(Object v, Object k) { return Struct.getelem(v, k); }
3486
+ public Object getelem(Object v, Object k, Object alt) { return Struct.getelem(v, k, alt); }
3487
+ public Object getprop(Object v, Object k) { return Struct.getprop(v, k); }
3488
+ public Object getprop(Object v, Object k, Object alt) { return Struct.getprop(v, k, alt); }
3489
+ public String strkey(Object k) { return Struct.strkey(k); }
3490
+ public List<String> keysof(Object v) { return Struct.keysof(v); }
3491
+ public boolean haskey(Object v, Object k) { return Struct.haskey(v, k); }
3492
+ public List<List<Object>> items(Object v) { return Struct.items(v); }
3493
+ public List<Object> flatten(Object v, Integer d) { return Struct.flatten(v, d); }
3494
+ public List<Object> filter(Object v, ItemCheck c) { return Struct.filter(v, c); }
3495
+ public String escre(Object s) { return Struct.escre(s); }
3496
+ public String escurl(Object s) { return Struct.escurl(s); }
3497
+ public String join(Object a, Object s, Object u) { return Struct.join(a, s, u); }
3498
+ public String jsonify(Object v) { return Struct.jsonify(v); }
3499
+ public String jsonify(Object v, Object f) { return Struct.jsonify(v, f); }
3500
+ public String stringify(Object v) { return Struct.stringify(v); }
3501
+ public String stringify(Object v, Integer m) { return Struct.stringify(v, m); }
3502
+ public String pathify(Object v) { return Struct.pathify(v); }
3503
+ public String pathify(Object v, Object s, Object e) { return Struct.pathify(v, s, e); }
3504
+ public Object clone(Object v) { return Struct.clone(v); }
3505
+ public Map<String, Object> jm(Object... kv) { return Struct.jm(kv); }
3506
+ public List<Object> jt(Object... v) { return Struct.jt(v); }
3507
+ public Object delprop(Object p, Object k) { return Struct.delprop(p, k); }
3508
+ public Object setprop(Object p, Object k, Object v) { return Struct.setprop(p, k, v); }
3509
+
3510
+ // Major utilities
3511
+ public Object walk(Object v, WalkApply b) { return Struct.walk(v, b); }
3512
+ public Object walk(Object v, WalkApply b, WalkApply a) { return Struct.walk(v, b, a); }
3513
+ public Object walk(Object v, WalkApply b, WalkApply a, int md) {
3514
+ return Struct.walk(v, b, a, md);
3515
+ }
3516
+ public Object merge(Object v) { return Struct.merge(v); }
3517
+ public Object merge(Object v, int md) { return Struct.merge(v, md); }
3518
+ public Object getpath(Object s, Object p) { return Struct.getpath(s, p); }
3519
+ public Object getpath(Object s, Object p, Map<String, Object> i) {
3520
+ return Struct.getpath(s, p, i);
3521
+ }
3522
+ public Object setpath(Object s, Object p, Object v) { return Struct.setpath(s, p, v); }
3523
+ public Object inject(Object v, Object s) { return Struct.inject(v, s); }
3524
+ public Object inject(Object v, Object s, Map<String, Object> i) {
3525
+ return Struct.inject(v, s, i);
3526
+ }
3527
+ public Object transform(Object d, Object s) { return Struct.transform(d, s); }
3528
+ public Object transform(Object d, Object s, Map<String, Object> o) {
3529
+ return Struct.transform(d, s, o);
3530
+ }
3531
+ public Object validate(Object d, Object s) { return Struct.validate(d, s); }
3532
+ public Object validate(Object d, Object s, Map<String, Object> o) {
3533
+ return Struct.validate(d, s, o);
3534
+ }
3535
+ public List<Object> select(Object c, Object q) { return Struct.select(c, q); }
3536
+
3537
+ // Injection helpers
3538
+ public boolean checkPlacement(int m, String n, int pt, Injection i) {
3539
+ return Struct.checkPlacement(m, n, pt, i);
3540
+ }
3541
+
3542
+ public Object[] injectorArgs(int[] argTypes, List<Object> args) {
3543
+ return Struct.injectorArgs(argTypes, args);
3544
+ }
3545
+
3546
+ public Injection injectChild(Object c, Object s, Injection i) {
3547
+ return Struct.injectChild(c, s, i);
3548
+ }
3549
+ }
3550
+ }