@techspokes/typescript-wsdl-client 1.1.4 → 1.1.8

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 (422) hide show
  1. package/README.md +81 -35
  2. package/dist/app/generateApp.d.ts +0 -1
  3. package/dist/app/generateApp.js +8 -6
  4. package/dist/app/generateCheckedApp.d.ts +38 -0
  5. package/dist/app/generateCheckedApp.js +108 -0
  6. package/dist/checkedPipeline.d.ts +155 -0
  7. package/dist/checkedPipeline.js +448 -0
  8. package/dist/checkedPlanning.d.ts +123 -0
  9. package/dist/checkedPlanning.js +245 -0
  10. package/dist/cli.d.ts +0 -1
  11. package/dist/cli.js +123 -5
  12. package/dist/client/checkedDirectRuntime.d.ts +96 -0
  13. package/dist/client/checkedDirectRuntime.js +43 -0
  14. package/dist/client/directClientRuntime.d.ts +74 -0
  15. package/dist/client/directClientRuntime.js +165 -0
  16. package/dist/client/directClientVersion.d.ts +6 -0
  17. package/dist/client/directClientVersion.js +6 -0
  18. package/dist/client/generateClient.d.ts +0 -1
  19. package/dist/client/generateClient.js +26 -12
  20. package/dist/client/generateDirectClient.d.ts +32 -0
  21. package/dist/client/generateDirectClient.js +268 -0
  22. package/dist/client/generateOperations.d.ts +0 -1
  23. package/dist/client/generateTypes.d.ts +0 -1
  24. package/dist/client/generateUtils.d.ts +0 -1
  25. package/dist/client/generateUtils.js +3 -1
  26. package/dist/compiler/applicationGroups.d.ts +53 -0
  27. package/dist/compiler/applicationGroups.js +403 -0
  28. package/dist/compiler/buildCanonicalGraph.d.ts +6 -0
  29. package/dist/compiler/buildCanonicalGraph.js +381 -0
  30. package/dist/compiler/canonicalGraph.d.ts +197 -0
  31. package/dist/compiler/canonicalGraph.js +37 -0
  32. package/dist/compiler/catalogErrors.d.ts +17 -0
  33. package/dist/compiler/catalogErrors.js +86 -0
  34. package/dist/compiler/catalogProvenance.d.ts +14 -0
  35. package/dist/compiler/catalogProvenance.js +229 -0
  36. package/dist/compiler/checkedAssessment.d.ts +90 -0
  37. package/dist/compiler/checkedAssessment.js +300 -0
  38. package/dist/compiler/checkedComponentSource.d.ts +16 -0
  39. package/dist/compiler/checkedComponentSource.js +31 -0
  40. package/dist/compiler/checkedSourcePreparation.d.ts +72 -0
  41. package/dist/compiler/checkedSourcePreparation.js +202 -0
  42. package/dist/compiler/complexTypeContent.d.ts +58 -0
  43. package/dist/compiler/complexTypeContent.js +558 -0
  44. package/dist/compiler/componentCorrespondence.d.ts +32 -0
  45. package/dist/compiler/componentCorrespondence.js +140 -0
  46. package/dist/compiler/componentRecordProjection.d.ts +109 -0
  47. package/dist/compiler/componentRecordProjection.js +319 -0
  48. package/dist/compiler/componentSoapPreparation.d.ts +20 -0
  49. package/dist/compiler/componentSoapPreparation.js +36 -0
  50. package/dist/compiler/composeCanonicalGraph.d.ts +68 -0
  51. package/dist/compiler/composeCanonicalGraph.js +252 -0
  52. package/dist/compiler/dataOwnership.d.ts +21 -0
  53. package/dist/compiler/dataOwnership.js +167 -0
  54. package/dist/compiler/datatypeValues.d.ts +46 -0
  55. package/dist/compiler/datatypeValues.js +275 -0
  56. package/dist/compiler/directCodec.d.ts +116 -0
  57. package/dist/compiler/directCodec.js +377 -0
  58. package/dist/compiler/directExecutionPolicy.d.ts +9 -0
  59. package/dist/compiler/directExecutionPolicy.js +17 -0
  60. package/dist/compiler/directOperation.d.ts +114 -0
  61. package/dist/compiler/directOperation.js +373 -0
  62. package/dist/compiler/directSoap.d.ts +66 -0
  63. package/dist/compiler/directSoap.js +391 -0
  64. package/dist/compiler/directSoapSource.d.ts +38 -0
  65. package/dist/compiler/directSoapSource.js +233 -0
  66. package/dist/compiler/directSourceCapsule.d.ts +169 -0
  67. package/dist/compiler/directSourceCapsule.js +727 -0
  68. package/dist/compiler/directStructure.d.ts +128 -0
  69. package/dist/compiler/directStructure.js +543 -0
  70. package/dist/compiler/directStructurePlan.d.ts +149 -0
  71. package/dist/compiler/directStructurePlan.js +623 -0
  72. package/dist/compiler/directValues.d.ts +128 -0
  73. package/dist/compiler/directValues.js +1116 -0
  74. package/dist/compiler/finiteRe01Construction.d.ts +69 -0
  75. package/dist/compiler/finiteRe01Construction.js +422 -0
  76. package/dist/compiler/finiteRe01Verification.d.ts +218 -0
  77. package/dist/compiler/finiteRe01Verification.js +1217 -0
  78. package/dist/compiler/generateCatalog.d.ts +0 -1
  79. package/dist/compiler/graphTraversal.d.ts +10 -0
  80. package/dist/compiler/graphTraversal.js +37 -0
  81. package/dist/compiler/hypotheticalScopedIdentity.d.ts +22 -0
  82. package/dist/compiler/hypotheticalScopedIdentity.js +81 -0
  83. package/dist/compiler/occurrenceAnalysis.d.ts +66 -0
  84. package/dist/compiler/occurrenceAnalysis.js +316 -0
  85. package/dist/compiler/originalSourceMembership.d.ts +5 -0
  86. package/dist/compiler/originalSourceMembership.js +31 -0
  87. package/dist/compiler/particleAttribution.d.ts +16 -0
  88. package/dist/compiler/particleAttribution.js +494 -0
  89. package/dist/compiler/particleDeclarationConsistency.d.ts +23 -0
  90. package/dist/compiler/particleDeclarationConsistency.js +206 -0
  91. package/dist/compiler/particleExtension.d.ts +21 -0
  92. package/dist/compiler/particleExtension.js +123 -0
  93. package/dist/compiler/particleLocalAssessment.d.ts +19 -0
  94. package/dist/compiler/particleLocalAssessment.js +92 -0
  95. package/dist/compiler/particleRestriction.d.ts +23 -0
  96. package/dist/compiler/particleRestriction.js +494 -0
  97. package/dist/compiler/particleSemanticView.d.ts +51 -0
  98. package/dist/compiler/particleSemanticView.js +310 -0
  99. package/dist/compiler/particleWildcardRelation.d.ts +87 -0
  100. package/dist/compiler/particleWildcardRelation.js +143 -0
  101. package/dist/compiler/projectionScalar.d.ts +32 -0
  102. package/dist/compiler/projectionScalar.js +184 -0
  103. package/dist/compiler/re01CandidateAssignments.d.ts +95 -0
  104. package/dist/compiler/re01CandidateAssignments.js +341 -0
  105. package/dist/compiler/re01CandidateCorrespondence.d.ts +85 -0
  106. package/dist/compiler/re01CandidateCorrespondence.js +701 -0
  107. package/dist/compiler/re01TypeProperties.d.ts +70 -0
  108. package/dist/compiler/re01TypeProperties.js +120 -0
  109. package/dist/compiler/re01TypePropertyValidation.d.ts +22 -0
  110. package/dist/compiler/re01TypePropertyValidation.js +161 -0
  111. package/dist/compiler/resolveCanonicalGraph.d.ts +41 -0
  112. package/dist/compiler/resolveCanonicalGraph.js +240 -0
  113. package/dist/compiler/scalarSchemaAssessment.d.ts +424 -0
  114. package/dist/compiler/scalarSchemaAssessment.js +5198 -0
  115. package/dist/compiler/schemaAttributeGroupProperties.d.ts +16 -0
  116. package/dist/compiler/schemaAttributeGroupProperties.js +53 -0
  117. package/dist/compiler/schemaAttributeProperties.d.ts +9 -0
  118. package/dist/compiler/schemaAttributeProperties.js +11 -0
  119. package/dist/compiler/schemaAttributeUses.d.ts +110 -0
  120. package/dist/compiler/schemaAttributeUses.js +798 -0
  121. package/dist/compiler/schemaBinaryWordReconstruction.d.ts +9 -0
  122. package/dist/compiler/schemaBinaryWordReconstruction.js +33 -0
  123. package/dist/compiler/schemaBuiltinFacets.d.ts +13 -0
  124. package/dist/compiler/schemaBuiltinFacets.js +51 -0
  125. package/dist/compiler/schemaCalendarImages.d.ts +7 -0
  126. package/dist/compiler/schemaCalendarImages.js +204 -0
  127. package/dist/compiler/schemaCalendarLanguage.d.ts +10 -0
  128. package/dist/compiler/schemaCalendarLanguage.js +227 -0
  129. package/dist/compiler/schemaCompiler.d.ts +0 -1
  130. package/dist/compiler/schemaComponentEquality.d.ts +27 -0
  131. package/dist/compiler/schemaComponentEquality.js +446 -0
  132. package/dist/compiler/schemaConstructionAssessment.d.ts +79 -0
  133. package/dist/compiler/schemaConstructionAssessment.js +745 -0
  134. package/dist/compiler/schemaDatatypeValues.d.ts +3 -0
  135. package/dist/compiler/schemaDatatypeValues.js +2 -0
  136. package/dist/compiler/schemaDecimalLanguage.d.ts +6 -0
  137. package/dist/compiler/schemaDecimalLanguage.js +102 -0
  138. package/dist/compiler/schemaDeclarationPrimitives.d.ts +39 -0
  139. package/dist/compiler/schemaDeclarationPrimitives.js +211 -0
  140. package/dist/compiler/schemaDocumentSyntax.d.ts +54 -0
  141. package/dist/compiler/schemaDocumentSyntax.js +294 -0
  142. package/dist/compiler/schemaDurationLanguage.d.ts +10 -0
  143. package/dist/compiler/schemaDurationLanguage.js +170 -0
  144. package/dist/compiler/schemaElementInstance.d.ts +30 -0
  145. package/dist/compiler/schemaElementInstance.js +45 -0
  146. package/dist/compiler/schemaElementProperties.d.ts +15 -0
  147. package/dist/compiler/schemaElementProperties.js +23 -0
  148. package/dist/compiler/schemaEndpointWordCapacity.d.ts +35 -0
  149. package/dist/compiler/schemaEndpointWordCapacity.js +39 -0
  150. package/dist/compiler/schemaExactCalendar.d.ts +72 -0
  151. package/dist/compiler/schemaExactCalendar.js +264 -0
  152. package/dist/compiler/schemaFacetAnnotation.d.ts +31 -0
  153. package/dist/compiler/schemaFacetAnnotation.js +199 -0
  154. package/dist/compiler/schemaGeneratedScalarShape.d.ts +34 -0
  155. package/dist/compiler/schemaGeneratedScalarShape.js +178 -0
  156. package/dist/compiler/schemaIdentityConstraints.d.ts +72 -0
  157. package/dist/compiler/schemaIdentityConstraints.js +362 -0
  158. package/dist/compiler/schemaIeeeLanguage.d.ts +42 -0
  159. package/dist/compiler/schemaIeeeLanguage.js +759 -0
  160. package/dist/compiler/schemaIntegerImages.d.ts +10 -0
  161. package/dist/compiler/schemaIntegerImages.js +113 -0
  162. package/dist/compiler/schemaLexicalPredicates.d.ts +28 -0
  163. package/dist/compiler/schemaLexicalPredicates.js +63 -0
  164. package/dist/compiler/schemaNotationProperties.d.ts +31 -0
  165. package/dist/compiler/schemaNotationProperties.js +84 -0
  166. package/dist/compiler/schemaNumericImageConditions.d.ts +23 -0
  167. package/dist/compiler/schemaNumericImageConditions.js +66 -0
  168. package/dist/compiler/schemaParticleWildcardProperties.d.ts +19 -0
  169. package/dist/compiler/schemaParticleWildcardProperties.js +43 -0
  170. package/dist/compiler/schemaPattern.d.ts +1061 -0
  171. package/dist/compiler/schemaPattern.js +581 -0
  172. package/dist/compiler/schemaRegularLanguage.d.ts +66 -0
  173. package/dist/compiler/schemaRegularLanguage.js +1166 -0
  174. package/dist/compiler/schemaScalarContext.d.ts +85 -0
  175. package/dist/compiler/schemaScalarContext.js +78 -0
  176. package/dist/compiler/schemaScalarKernel.d.ts +181 -0
  177. package/dist/compiler/schemaScalarKernel.js +391 -0
  178. package/dist/compiler/schemaScalarWitnesses.d.ts +5 -0
  179. package/dist/compiler/schemaScalarWitnesses.js +118 -0
  180. package/dist/compiler/schemaSimpleTypeProperties.d.ts +94 -0
  181. package/dist/compiler/schemaSimpleTypeProperties.js +103 -0
  182. package/dist/compiler/schemaSourceGrammar.d.ts +26 -0
  183. package/dist/compiler/schemaSourceGrammar.js +290 -0
  184. package/dist/compiler/schemaSourceLexical.d.ts +3 -0
  185. package/dist/compiler/schemaSourceLexical.js +12 -0
  186. package/dist/compiler/schemaSourceValues.d.ts +50 -0
  187. package/dist/compiler/schemaSourceValues.js +225 -0
  188. package/dist/compiler/schemaSourceWildcards.d.ts +27 -0
  189. package/dist/compiler/schemaSourceWildcards.js +249 -0
  190. package/dist/compiler/schemaSymbolicSequences.d.ts +15 -0
  191. package/dist/compiler/schemaSymbolicSequences.js +99 -0
  192. package/dist/compiler/schemaSymbolicValueSets.d.ts +31 -0
  193. package/dist/compiler/schemaSymbolicValueSets.js +149 -0
  194. package/dist/compiler/schemaSyntaxAssessment.d.ts +24 -0
  195. package/dist/compiler/schemaSyntaxAssessment.js +361 -0
  196. package/dist/compiler/schemaTemporalAliases.d.ts +5 -0
  197. package/dist/compiler/schemaTemporalAliases.js +195 -0
  198. package/dist/compiler/schemaTokenImages.d.ts +8 -0
  199. package/dist/compiler/schemaTokenImages.js +142 -0
  200. package/dist/compiler/schemaTypeIdentity.d.ts +38 -0
  201. package/dist/compiler/schemaTypeIdentity.js +80 -0
  202. package/dist/compiler/schemaTypeRelations.d.ts +37 -0
  203. package/dist/compiler/schemaTypeRelations.js +576 -0
  204. package/dist/compiler/schemaUri.d.ts +12 -0
  205. package/dist/compiler/schemaUri.js +103 -0
  206. package/dist/compiler/schemaValueContext.d.ts +25 -0
  207. package/dist/compiler/schemaValueContext.js +1 -0
  208. package/dist/compiler/schemaValueImages.d.ts +9 -0
  209. package/dist/compiler/schemaValueImages.js +142 -0
  210. package/dist/compiler/schemaValueSequences.d.ts +14 -0
  211. package/dist/compiler/schemaValueSequences.js +19 -0
  212. package/dist/compiler/semanticBudget.d.ts +67 -0
  213. package/dist/compiler/semanticBudget.js +193 -0
  214. package/dist/compiler/semanticCatalog.d.ts +121 -0
  215. package/dist/compiler/semanticCatalog.js +160 -0
  216. package/dist/compiler/semanticContext.d.ts +183 -0
  217. package/dist/compiler/semanticContext.js +1207 -0
  218. package/dist/compiler/semanticTypeDependencies.d.ts +7 -0
  219. package/dist/compiler/semanticTypeDependencies.js +64 -0
  220. package/dist/compiler/semanticTypeReference.d.ts +23 -0
  221. package/dist/compiler/semanticTypeReference.js +36 -0
  222. package/dist/compiler/shapeResolver.d.ts +1 -1
  223. package/dist/compiler/shapeResolver.js +7 -9
  224. package/dist/compiler/soapHeaders.d.ts +16 -0
  225. package/dist/compiler/soapHeaders.js +42 -0
  226. package/dist/compiler/sourceSchemaBinding.d.ts +25 -0
  227. package/dist/compiler/sourceSchemaBinding.js +39 -0
  228. package/dist/compiler/standardSchemaComponents.d.ts +71 -0
  229. package/dist/compiler/standardSchemaComponents.js +74 -0
  230. package/dist/compiler/standardSchemaConstruction.d.ts +20 -0
  231. package/dist/compiler/standardSchemaConstruction.js +34 -0
  232. package/dist/compiler/structuralCompanions.d.ts +15 -0
  233. package/dist/compiler/structuralCompanions.js +232 -0
  234. package/dist/compiler/validateSemanticGraph.d.ts +4 -0
  235. package/dist/compiler/validateSemanticGraph.js +376 -0
  236. package/dist/compiler/wildcardAlgebra.d.ts +25 -0
  237. package/dist/compiler/wildcardAlgebra.js +155 -0
  238. package/dist/compiler/wsdlPolicyRequirements.d.ts +43 -0
  239. package/dist/compiler/wsdlPolicyRequirements.js +239 -0
  240. package/dist/config.d.ts +0 -1
  241. package/dist/gateway/generateCheckedGateway.d.ts +32 -0
  242. package/dist/gateway/generateCheckedGateway.js +293 -0
  243. package/dist/gateway/generateGateway.d.ts +0 -1
  244. package/dist/gateway/generateGateway.js +2 -2
  245. package/dist/gateway/generators.d.ts +0 -1
  246. package/dist/gateway/helpers.d.ts +0 -1
  247. package/dist/generation/componentShape.d.ts +14 -0
  248. package/dist/generation/componentShape.js +269 -0
  249. package/dist/generation/preamble.d.ts +0 -1
  250. package/dist/generation/sourceLayout.d.ts +13 -0
  251. package/dist/generation/sourceLayout.js +40 -0
  252. package/dist/generation/writeGeneratedSource.d.ts +0 -1
  253. package/dist/index.d.ts +9 -1
  254. package/dist/index.js +3 -0
  255. package/dist/loader/fetch.d.ts +0 -1
  256. package/dist/loader/orderedSyntax.d.ts +84 -0
  257. package/dist/loader/orderedSyntax.js +222 -0
  258. package/dist/loader/resolutionDepth.d.ts +6 -0
  259. package/dist/loader/resolutionDepth.js +65 -0
  260. package/dist/loader/schemaInput.d.ts +80 -0
  261. package/dist/loader/schemaInput.js +249 -0
  262. package/dist/loader/schemaResources.d.ts +60 -0
  263. package/dist/loader/schemaResources.js +333 -0
  264. package/dist/loader/wsdlLoader.d.ts +0 -1
  265. package/dist/openapi/casing.d.ts +0 -1
  266. package/dist/openapi/generateOpenAPI.d.ts +0 -1
  267. package/dist/openapi/generateOpenAPI.js +2 -2
  268. package/dist/openapi/generatePaths.d.ts +0 -1
  269. package/dist/openapi/generateSchemas.d.ts +0 -1
  270. package/dist/openapi/security.d.ts +0 -1
  271. package/dist/pipeline.d.ts +6 -2
  272. package/dist/pipeline.js +13 -0
  273. package/dist/test/generateCheckedTests.d.ts +17 -0
  274. package/dist/test/generateCheckedTests.js +60 -0
  275. package/dist/test/generateTests.d.ts +0 -1
  276. package/dist/test/generateTests.js +2 -2
  277. package/dist/test/generators.d.ts +0 -1
  278. package/dist/test/mockData.d.ts +0 -1
  279. package/dist/test/mockData.js +20 -14
  280. package/dist/util/attributeWildcards.d.ts +0 -1
  281. package/dist/util/builder.d.ts +0 -1
  282. package/dist/util/catalogMeta.d.ts +0 -1
  283. package/dist/util/checkedCliDiagnostics.d.ts +11 -0
  284. package/dist/util/checkedCliDiagnostics.js +22 -0
  285. package/dist/util/cli.d.ts +0 -1
  286. package/dist/util/errors.d.ts +0 -1
  287. package/dist/util/imports.d.ts +0 -1
  288. package/dist/util/runtimeSource.d.ts +0 -1
  289. package/dist/util/runtimeSource.js +3 -5
  290. package/dist/util/securityConfig.d.ts +0 -1
  291. package/dist/util/streamConfig.d.ts +0 -1
  292. package/dist/util/tools.d.ts +0 -1
  293. package/dist/util/xmlWhitespace.d.ts +2 -0
  294. package/dist/util/xmlWhitespace.js +4 -0
  295. package/dist/xsd/primitives.d.ts +0 -1
  296. package/docs/agent-skill.md +2 -0
  297. package/docs/api-reference.md +1 -1
  298. package/docs/checked-gateway.md +210 -0
  299. package/docs/checked-generation.md +161 -0
  300. package/docs/cli-reference.md +43 -1
  301. package/docs/concepts.md +136 -1
  302. package/docs/configuration.md +5 -1
  303. package/docs/corpus.md +33 -0
  304. package/docs/direct-values.md +311 -0
  305. package/docs/examples/checked-forecast.wsdl +19 -0
  306. package/docs/gateway-guide.md +1 -1
  307. package/docs/generated-code.md +10 -5
  308. package/docs/mapping-contract.md +114 -0
  309. package/docs/migration-playbook.md +1 -1
  310. package/docs/output-anatomy.md +1 -1
  311. package/docs/start-here.md +8 -2
  312. package/docs/supported-patterns.md +17 -5
  313. package/docs/testing.md +117 -31
  314. package/llms.txt +7 -7
  315. package/package.json +79 -25
  316. package/src/generation/preambles/direct-client/typescript.preamble +3 -0
  317. package/src/runtime/checkedGatewayHost.tpl.txt +157 -0
  318. package/src/runtime/streamXml.ts +1 -1
  319. package/dist/app/generateApp.d.ts.map +0 -1
  320. package/dist/cli.d.ts.map +0 -1
  321. package/dist/client/generateClient.d.ts.map +0 -1
  322. package/dist/client/generateOperations.d.ts.map +0 -1
  323. package/dist/client/generateTypes.d.ts.map +0 -1
  324. package/dist/client/generateUtils.d.ts.map +0 -1
  325. package/dist/compiler/generateCatalog.d.ts.map +0 -1
  326. package/dist/compiler/schemaCompiler.d.ts.map +0 -1
  327. package/dist/compiler/shapeResolver.d.ts.map +0 -1
  328. package/dist/config.d.ts.map +0 -1
  329. package/dist/gateway/generateGateway.d.ts.map +0 -1
  330. package/dist/gateway/generators.d.ts.map +0 -1
  331. package/dist/gateway/helpers.d.ts.map +0 -1
  332. package/dist/generation/preamble.d.ts.map +0 -1
  333. package/dist/generation/writeGeneratedSource.d.ts.map +0 -1
  334. package/dist/index.d.ts.map +0 -1
  335. package/dist/loader/fetch.d.ts.map +0 -1
  336. package/dist/loader/wsdlLoader.d.ts.map +0 -1
  337. package/dist/openapi/casing.d.ts.map +0 -1
  338. package/dist/openapi/generateOpenAPI.d.ts.map +0 -1
  339. package/dist/openapi/generatePaths.d.ts.map +0 -1
  340. package/dist/openapi/generateSchemas.d.ts.map +0 -1
  341. package/dist/openapi/security.d.ts.map +0 -1
  342. package/dist/pipeline.d.ts.map +0 -1
  343. package/dist/runtime/jsonArray.d.ts +0 -24
  344. package/dist/runtime/jsonArray.d.ts.map +0 -1
  345. package/dist/runtime/jsonArray.js +0 -52
  346. package/dist/runtime/ndjson.d.ts +0 -24
  347. package/dist/runtime/ndjson.d.ts.map +0 -1
  348. package/dist/runtime/ndjson.js +0 -30
  349. package/dist/runtime/streamXml.d.ts +0 -45
  350. package/dist/runtime/streamXml.d.ts.map +0 -1
  351. package/dist/runtime/streamXml.js +0 -212
  352. package/dist/test/generateTests.d.ts.map +0 -1
  353. package/dist/test/generators.d.ts.map +0 -1
  354. package/dist/test/mockData.d.ts.map +0 -1
  355. package/dist/util/attributeWildcards.d.ts.map +0 -1
  356. package/dist/util/builder.d.ts.map +0 -1
  357. package/dist/util/catalogMeta.d.ts.map +0 -1
  358. package/dist/util/cli.d.ts.map +0 -1
  359. package/dist/util/errors.d.ts.map +0 -1
  360. package/dist/util/imports.d.ts.map +0 -1
  361. package/dist/util/runtimeSource.d.ts.map +0 -1
  362. package/dist/util/securityConfig.d.ts.map +0 -1
  363. package/dist/util/streamConfig.d.ts.map +0 -1
  364. package/dist/util/tools.d.ts.map +0 -1
  365. package/dist/xsd/primitives.d.ts.map +0 -1
  366. package/docs/AGENTS.md +0 -47
  367. package/docs/README.md +0 -56
  368. package/docs/architecture.md +0 -149
  369. package/docs/decisions/001-test-generation.md +0 -36
  370. package/docs/decisions/002-streamable-responses.md +0 -330
  371. package/docs/file-naming-and-path-organization.md +0 -213
  372. package/docs/releases/README.md +0 -94
  373. package/docs/releases/v0.20.0.md +0 -22
  374. package/docs/releases/v0.21.0.md +0 -30
  375. package/docs/releases/v0.22.0.md +0 -30
  376. package/docs/releases/v0.23.0.md +0 -31
  377. package/docs/releases/v0.24.0.md +0 -38
  378. package/docs/releases/v0.25.0.md +0 -31
  379. package/docs/releases/v0.25.2.md +0 -32
  380. package/docs/releases/v0.26.0.md +0 -32
  381. package/docs/releases/v0.27.0.md +0 -31
  382. package/docs/releases/v0.28.0.md +0 -32
  383. package/docs/releases/v0.29.0.md +0 -32
  384. package/docs/releases/v0.30.0.md +0 -30
  385. package/docs/releases/v0.30.1.md +0 -31
  386. package/docs/releases/v0.30.2.md +0 -30
  387. package/docs/releases/v0.30.3.md +0 -33
  388. package/docs/releases/v0.31.0.md +0 -33
  389. package/docs/releases/v0.32.0.md +0 -33
  390. package/docs/releases/v0.33.0.md +0 -34
  391. package/docs/releases/v0.34.0.md +0 -30
  392. package/docs/releases/v0.35.0.md +0 -33
  393. package/docs/releases/v0.36.0.md +0 -32
  394. package/docs/releases/v0.37.0.md +0 -33
  395. package/docs/releases/v0.38.0.md +0 -35
  396. package/docs/releases/v0.39.0.md +0 -35
  397. package/docs/releases/v0.40.0.md +0 -45
  398. package/docs/releases/v0.40.1.md +0 -34
  399. package/docs/releases/v1.0.0.md +0 -42
  400. package/docs/releases/v1.0.1.md +0 -38
  401. package/docs/releases/v1.0.2.md +0 -51
  402. package/docs/releases/v1.0.3.md +0 -37
  403. package/docs/releases/v1.0.4.md +0 -45
  404. package/docs/releases/v1.0.5.md +0 -41
  405. package/docs/releases/v1.0.6.md +0 -35
  406. package/docs/releases/v1.0.7.md +0 -36
  407. package/docs/releases/v1.1.0.md +0 -42
  408. package/docs/releases/v1.1.1.md +0 -44
  409. package/docs/releases/v1.1.2.md +0 -42
  410. package/docs/releases/v1.1.3.md +0 -36
  411. package/docs/releases/v1.1.4.md +0 -36
  412. package/docs/roadmap/README.md +0 -107
  413. package/docs/roadmap/v1.0-capability-conformance-framework.md +0 -582
  414. package/docs/roadmap/v1.0-choice-union-mode.md +0 -90
  415. package/docs/roadmap/v1.0-contract-audit.md +0 -75
  416. package/docs/roadmap/v1.0-json-array-streaming.md +0 -101
  417. package/docs/roadmap/v1.0-openapi-fastify-compatibility.md +0 -99
  418. package/docs/roadmap/v1.0-release-candidate-gates.md +0 -92
  419. package/docs/roadmap/v1.0-wsdl-coverage-matrix.md +0 -200
  420. package/docs/roadmap/v1.0-xs-anyattribute-wildcard-bag.md +0 -932
  421. package/src/runtime/jsonArray.ts +0 -55
  422. package/src/runtime/ndjson.ts +0 -32
@@ -0,0 +1,623 @@
1
+ import { assertSemanticContext } from './semanticContext.js';
2
+ import { assessSourceAttributeUses } from './schemaAttributeUses.js';
3
+ import { deriveActualComplexContent, particleContentNode } from './complexTypeContent.js';
4
+ import { XSD_NAMESPACE, XML_NAMESPACE, isXmlNCName } from '../loader/orderedSyntax.js';
5
+ import { occurrenceAlgebra } from './occurrenceAnalysis.js';
6
+ import { describeProjectionScalar, assessProjectionScalarOperand } from './projectionScalar.js';
7
+ import { builtinListItem } from './datatypeValues.js';
8
+ import { prepareSemanticParticleView, assertSemanticParticleView } from './particleSemanticView.js';
9
+ import { effectiveSubstitutionMembers } from './schemaTypeRelations.js';
10
+ import { namespaceAllows, namespaceIntersection } from './wildcardAlgebra.js';
11
+ import { globalId } from './canonicalGraph.js';
12
+ const orderedGrammars = new WeakMap();
13
+ /** Inspect source particles only after authenticating their projection owner. */
14
+ export function inspectProjectionGrammar(context, record) {
15
+ if (projectionRecords.get(record) !== context)
16
+ throw new TypeError('Authenticated projection record required');
17
+ const grammar = orderedGrammars.get(record);
18
+ return grammar ? Object.freeze({ view: grammar.view,
19
+ first(particle) { const keys = grammar.first.get(particle); context.budget.chargeWork(32 + (keys?.size ?? 0)); return Object.freeze([...(keys ?? [])]); },
20
+ bodyNullable: (particle) => grammar.bodyNullable.get(particle), slot: (key) => grammar.slots.get(key) }) : undefined;
21
+ }
22
+ const projectionRecords = new WeakMap();
23
+ const nameKey = (name, charge) => {
24
+ charge(64 + (name.namespace.length + name.local.length) * 8);
25
+ return JSON.stringify([name.namespace, name.local]);
26
+ };
27
+ /** Match ordered children using authenticated native particles, without granting source or operation admission.
28
+ * @constraints Leaf alphabets must be disjoint; native strict/lax/skip policy selects declaration assessment or unassessed preservation.
29
+ * @returns Source-owned slots in document order, or undefined when the child sequence is outside the particle language.
30
+ * @throws TypeError For an unauthenticated record or foreign context.
31
+ */
32
+ export function matchOrderedProjection(context, record, names, check) {
33
+ const grammar = orderedGrammars.get(record);
34
+ if (!grammar || grammar.context !== context)
35
+ throw new TypeError('Unauthenticated ordered projection record');
36
+ assertSemanticParticleView(context, grammar.view);
37
+ const algebra = occurrenceAlgebra(check), result = [];
38
+ context.budget.chargeWork(64 + names.length * 8);
39
+ const inputKeys = names.map(name => { check(); return nameKey(name, context.budget.chargeWork); });
40
+ const starts = (p) => {
41
+ check();
42
+ const key = inputKeys[cursor];
43
+ if (key === undefined)
44
+ return false;
45
+ if (grammar.first.get(p).has(key))
46
+ return true;
47
+ return grammar.firstWildcards.get(p).some(wildcard => { check(); return namespaceAllows(wildcard.namespace, names[cursor].namespace, context.budget.chargeWork); });
48
+ };
49
+ let cursor = 0;
50
+ const tasks = [{ kind: 'repeat', particle: grammar.view.root, count: 0 }];
51
+ while (tasks.length) {
52
+ check();
53
+ context.budget.chargeWork(64);
54
+ const task = tasks.pop(), p = task.particle;
55
+ const key = inputKeys[cursor];
56
+ if (task.kind === 'repeat') {
57
+ if (algebra.compare(String(task.count), p.occurs.max) < 0 && starts(p)) {
58
+ tasks.push({ kind: 'repeat', particle: p, count: task.count + 1 }, { kind: 'body', particle: p });
59
+ }
60
+ else if (algebra.compare(String(task.count), p.occurs.min) < 0 && !grammar.bodyNullable.get(p))
61
+ return undefined;
62
+ continue;
63
+ }
64
+ if (p.kind === 'element') {
65
+ if (key === undefined || grammar.leafKeys.get(p) !== key)
66
+ return undefined;
67
+ result.push(grammar.slots.get(key));
68
+ cursor++;
69
+ continue;
70
+ }
71
+ if (p.kind === 'any') {
72
+ const leaf = grammar.wildcardLeaves.get(p);
73
+ const selected = selectProjectionWildcard(context, record, names[cursor], check);
74
+ if (!selected)
75
+ return undefined;
76
+ result.push({ kind: 'wildcard', ...(selected.element ? { element: selected.element } : {}), particle: leaf.particle });
77
+ cursor++;
78
+ continue;
79
+ }
80
+ if (p.kind === 'choice') {
81
+ const selected = p.children.find(child => starts(child));
82
+ if (selected)
83
+ tasks.push({ kind: 'repeat', particle: selected, count: 0 });
84
+ else if (!grammar.bodyNullable.get(p))
85
+ return undefined;
86
+ }
87
+ else if (p.kind === 'sequence') {
88
+ for (let i = p.children.length - 1; i >= 0; i--) {
89
+ check();
90
+ tasks.push({ kind: 'repeat', particle: p.children[i], count: 0 });
91
+ }
92
+ }
93
+ else if (p.kind === 'all') {
94
+ // @why Each all-child occurs at most once in this subset; choose by disjoint native FIRST sets without enumerating permutations.
95
+ const remaining = new Map();
96
+ for (const child of p.children) {
97
+ check();
98
+ context.budget.chargeWork(64);
99
+ if (child.kind !== 'element')
100
+ throw new TypeError('Unsupported all child escaped planning');
101
+ remaining.set(grammar.leafKeys.get(child), child);
102
+ }
103
+ while (cursor < names.length) {
104
+ check();
105
+ const next = inputKeys[cursor];
106
+ const child = remaining.get(next);
107
+ if (!child)
108
+ break;
109
+ result.push(grammar.slots.get(next));
110
+ cursor++;
111
+ remaining.delete(next);
112
+ }
113
+ for (const child of remaining.values()) {
114
+ check();
115
+ if (!child.summary.nullable)
116
+ return undefined;
117
+ }
118
+ }
119
+ else
120
+ throw new TypeError('Wildcard escaped ordered projection planning');
121
+ }
122
+ return cursor === names.length ? result : undefined;
123
+ }
124
+ /** Resolve a policy-assessed wildcard declaration, never from a caller-supplied type or companion-name guess.
125
+ * @returns The source declaration, or undefined for an excluded namespace, missing declaration or incomplete universe.
126
+ * @throws TypeError For copied/foreign projection records.
127
+ */
128
+ export function resolveProjectionWildcard(context, record, name, check) {
129
+ return selectProjectionWildcard(context, record, name, check)?.element;
130
+ }
131
+ /** Select native application wildcard policy from the authenticated particle, without payload-driven schema acquisition.
132
+ * @param context Exact source context owning the record.
133
+ * @param record Authenticated projection record.
134
+ * @param name Actual expanded payload identity.
135
+ * @param check Budget and cancellation checkpoint.
136
+ * @returns Declaration assessment, an unassessed native policy selection, or no match.
137
+ * @throws TypeError For a foreign or copied record.
138
+ */
139
+ export function selectProjectionWildcard(context, record, name, check) {
140
+ const grammar = orderedGrammars.get(record);
141
+ if (!grammar || grammar.context !== context)
142
+ throw new TypeError('Unauthenticated wildcard projection record');
143
+ assertSemanticParticleView(context, grammar.view);
144
+ if (context.membership !== 'complete-actual-plus-additions')
145
+ return undefined;
146
+ let policy;
147
+ for (const leaf of grammar.wildcardLeaves.values()) {
148
+ check();
149
+ if (namespaceAllows(leaf.wildcard.namespace, name.namespace, context.budget.chargeWork)) {
150
+ policy = leaf.wildcard.processContents;
151
+ break;
152
+ }
153
+ }
154
+ if (!policy)
155
+ return undefined;
156
+ if (policy === 'skip')
157
+ return {};
158
+ context.budget.chargeWork(128 + (name.namespace.length + name.local.length) * 8);
159
+ const declaration = context.lookup(globalId('element', name));
160
+ if (declaration.kind === 'found' && declaration.node.kind === 'element' && declaration.node.identity.kind === 'global')
161
+ return { element: declaration.node };
162
+ return policy === 'lax' ? {} : undefined;
163
+ }
164
+ /** Inspect wildcard presence on an exact ordered plan; this describes existing grammar, never adds admission. */
165
+ export function inspectOrderedProjectionWildcards(context, record) {
166
+ const grammar = orderedGrammars.get(record);
167
+ if (!grammar || grammar.context !== context)
168
+ throw new TypeError('Authentic ordered projection required');
169
+ return grammar.wildcardLeaves.size > 0;
170
+ }
171
+ /** Inspect whether every wildcard on an authenticated ordered record requires unassessed preservation. */
172
+ export function inspectUnassessedProjectionWildcards(context, record) {
173
+ const grammar = orderedGrammars.get(record);
174
+ if (!grammar || grammar.context !== context)
175
+ throw new TypeError('Authentic ordered projection required');
176
+ return grammar.wildcardLeaves.size > 0 && [...grammar.wildcardLeaves.values()].every(leaf => leaf.wildcard.processContents === 'skip');
177
+ }
178
+ const lexicalBuiltins = new Set(['string', 'normalizedString', 'token', 'language', 'Name', 'NCName', 'NMTOKEN', 'anyURI',
179
+ 'decimal', 'integer', 'nonPositiveInteger', 'negativeInteger', 'long', 'short', 'byte', 'nonNegativeInteger',
180
+ 'unsignedLong', 'unsignedInt', 'unsignedShort', 'unsignedByte', 'positiveInteger', 'float', 'double',
181
+ 'dateTime', 'date', 'time', 'duration', 'gYearMonth', 'gYear', 'gMonthDay', 'gDay', 'gMonth', 'hexBinary', 'base64Binary']);
182
+ /** JSON representation policy only; native datatype calculations decide lexical/value validity. */
183
+ export function projectionScalarRepresentation(name) {
184
+ if (name.namespace !== XSD_NAMESPACE)
185
+ return undefined;
186
+ if (name.local === 'int')
187
+ return 'number';
188
+ if (name.local === 'boolean')
189
+ return 'boolean';
190
+ return lexicalBuiltins.has(name.local) ? 'string' : undefined;
191
+ }
192
+ /** Test projected XML 1.0 character data without interpreting lexical application strings. */
193
+ export const isXmlCharacters = (value) => /^[\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]*$/u.test(value);
194
+ /** Check a projected Namespaces 1.0 binding; the empty key denotes the default namespace. */
195
+ export const isXmlNamespaceBinding = (prefix, namespace) => (prefix === '' || isXmlNCName(prefix)) && prefix !== 'xmlns' && isXmlCharacters(namespace)
196
+ && namespace !== 'http://www.w3.org/2000/xmlns/' && (prefix === 'xml' ? namespace === XML_NAMESPACE : namespace !== XML_NAMESPACE)
197
+ && (!prefix || !!namespace);
198
+ /** Resolve and plan an application attribute permitted by the source wildcard.
199
+ * @param context Exact source context.
200
+ * @param record Source-derived record containing the native attribute policy.
201
+ * @param name Expanded payload attribute identity.
202
+ * @param check Budget and cancellation checkpoint.
203
+ * @param unsupported Existing diagnostic owner for unavailable native scalar duties.
204
+ * @returns A typed declaration, unassessed lexical selection, or no policy match.
205
+ * @throws TypeError For a non-actual context.
206
+ */
207
+ export function selectProjectionAttribute(context, record, name, check, unsupported) {
208
+ assertSemanticContext(context);
209
+ if (projectionRecords.get(record) !== context)
210
+ throw new TypeError('Authenticated attribute projection required');
211
+ const policy = record.attributeWildcard;
212
+ check();
213
+ if (!policy || !namespaceAllows(policy.namespace, name.namespace, context.budget.chargeWork))
214
+ return undefined;
215
+ if (name.namespace === 'http://www.w3.org/2001/XMLSchema-instance' && ['type', 'nil'].includes(name.local))
216
+ return unsupported();
217
+ if (policy.processContents === 'skip')
218
+ return {};
219
+ const found = context.lookup(globalId('attribute', name));
220
+ if (found.kind !== 'found' || found.node.kind !== 'attribute' || found.node.identity.kind !== 'global')
221
+ return policy.processContents === 'lax' ? {} : undefined;
222
+ const declaration = found.node;
223
+ const scalar = describeProjectionScalar(context, declaration, check);
224
+ if (scalar.kind !== 'projection-scalar-type' || !projectionScalarRepresentation(scalar.builtin))
225
+ return unsupported();
226
+ const constraint = declaration.value ? assessProjectionScalarOperand(context, declaration, declaration.value.lexical, check) : undefined;
227
+ if (constraint && constraint.kind !== 'projection-scalar-operand')
228
+ return unsupported();
229
+ return { attribute: Object.freeze({ declaration, required: false, bag: true, builtin: scalar.builtin,
230
+ ...(scalar.retainLexical ? { retainLexical: true } : {}), ...(scalar.list ? { list: scalar.list } : {}),
231
+ ...(declaration.value && constraint?.kind === 'projection-scalar-operand' ? { constraint: Object.freeze({ kind: declaration.value.kind,
232
+ lexical: declaration.value.lexical.value, canonical: constraint.operand.canonical }) } : {}) }) };
233
+ }
234
+ /**
235
+ * Derive record structure using native component identity, including anonymous scopes and recursion.
236
+ * @remarks This is a projection plan, not source validity, correspondence or runtime admission.
237
+ * Effective sequences and known attributes of explicitly represented builtin scalars are supported.
238
+ * Exact numeric families and temporal/binary values use strings; QName and document-wide ID/ENTITY duties are outside this plan.
239
+ * Inheritance is read from native content and attribute owners; only unit sequence groups flatten into peer properties.
240
+ * Other represented particles retain ordered children in $content; disjoint element/wildcard alphabets are required.
241
+ * Source-selected keyed content and attribute fallback preserve mixed text and local-name collisions.
242
+ * Native wildcard policies select known declaration duties or lexical preservation; retained scopes propagate through known intermediates.
243
+ * Native default/fixed values are explicit XML-assessment augmentation, never a missing required application field.
244
+ * The checked-direct preview adapter below retains its flat-only grammar.
245
+ */
246
+ export function planDirectProjection(context, root, check, unsupported) {
247
+ assertSemanticContext(context);
248
+ if (context.kind !== 'actual')
249
+ return unsupported();
250
+ const { budget } = context;
251
+ const unavailable = (node, rule) => {
252
+ budget.chargeWork(32 + rule.length);
253
+ return unsupported(Object.freeze({ rule, component: node.id, schemaPath: node.context.source.path }));
254
+ };
255
+ const lookup = (id) => {
256
+ check();
257
+ const result = context.lookup(id);
258
+ if (result.kind !== 'found')
259
+ return unsupported();
260
+ return result.node;
261
+ };
262
+ const records = new Map();
263
+ const pending = [];
264
+ const value = (element) => {
265
+ if (lookup(element.id) !== element)
266
+ return unsupported();
267
+ check();
268
+ const type = context.resolve(element.type);
269
+ if (element.abstract || element.substitutionGroup)
270
+ return unsupported();
271
+ const facts = { ...(element.nillable ? { nillable: true } : {}), ...(() => {
272
+ if (!element.value)
273
+ return {};
274
+ const assessed = assessProjectionScalarOperand(context, element, element.value.lexical, check);
275
+ if (assessed.kind !== 'projection-scalar-operand')
276
+ return unavailable(element, 'element-value-constraint');
277
+ return { constraint: Object.freeze({ kind: element.value.kind, lexical: element.value.lexical.value, canonical: assessed.operand.canonical }) };
278
+ })() };
279
+ if (type.kind === 'builtin' && !builtinListItem(type.name.local)) {
280
+ if (!projectionScalarRepresentation(type.name))
281
+ return unavailable(element, 'builtin-scalar-context-or-representation');
282
+ return Object.freeze({ kind: 'scalar', builtin: type.name, ...facts });
283
+ }
284
+ if (type.kind === 'builtin' || type.kind === 'found' && type.node.kind === 'simpleType') {
285
+ const scalar = describeProjectionScalar(context, element, check);
286
+ check();
287
+ if (scalar.kind !== 'projection-scalar-type')
288
+ return unavailable(element, 'rule' in scalar ? scalar.rule : 'scalar-source-definition');
289
+ if (!projectionScalarRepresentation(scalar.builtin))
290
+ return unavailable(element, 'scalar-context-or-representation');
291
+ return Object.freeze({ kind: 'scalar', builtin: scalar.builtin, declared: true, ...facts,
292
+ ...(scalar.retainLexical ? { retainLexical: true } : {}), ...(scalar.list ? { list: scalar.list } : {}) });
293
+ }
294
+ if (type.kind !== 'found' || type.node.kind !== 'complexType')
295
+ return unavailable(element, 'unavailable-complex-type');
296
+ if (!records.has(type.node.id)) {
297
+ budget.chargeWork(64);
298
+ records.set(type.node.id, { type: type.node, declaration: element, slots: [], attributes: [], content: 'element-only' });
299
+ pending.push(type.node);
300
+ }
301
+ return Object.freeze({ kind: 'record', type: type.node.id, ...facts });
302
+ };
303
+ budget.chargeWork(128);
304
+ const rootValue = value(root);
305
+ while (pending.length) {
306
+ check();
307
+ const type = pending.pop();
308
+ const record = records.get(type.id);
309
+ const { slots, attributes } = record;
310
+ if (type.abstract)
311
+ return unavailable(type, 'abstract-type');
312
+ if (type.attributes.length || type.derivation) {
313
+ const assessed = assessSourceAttributeUses(context, type.id);
314
+ check();
315
+ if (assessed.kind !== 'checked')
316
+ return unavailable(type, 'native-attribute-properties');
317
+ if (assessed.value.wildcard) {
318
+ record.attributeWildcard = assessed.value.wildcard;
319
+ if (record.attributeWildcard.processContents !== 'strict')
320
+ record.contextual = true;
321
+ }
322
+ for (const presence of assessed.value.attributes) {
323
+ check();
324
+ if (presence.uses.length !== 1)
325
+ return unavailable(type, 'attribute-presence-constraints');
326
+ const use = presence.uses[0];
327
+ if (presence.absent.kind === 'conflict')
328
+ return unavailable(use.declaration, 'attribute-value-constraint-conflict');
329
+ const resolved = context.resolve(use.declaration.type);
330
+ let builtin;
331
+ let retainLexical;
332
+ let list;
333
+ if (resolved.kind === 'builtin' && !builtinListItem(resolved.name.local))
334
+ builtin = resolved.name;
335
+ else {
336
+ const scalar = describeProjectionScalar(context, use.declaration, check);
337
+ check();
338
+ if (scalar.kind !== 'projection-scalar-type')
339
+ return unavailable(use.declaration, 'rule' in scalar ? scalar.rule : 'scalar-source-definition');
340
+ builtin = scalar.builtin;
341
+ retainLexical = scalar.retainLexical;
342
+ list = scalar.list;
343
+ }
344
+ if (!projectionScalarRepresentation(builtin))
345
+ return unavailable(use.declaration, 'declared-attribute-scalar');
346
+ const key = use.declaration.name.local;
347
+ budget.chargeWork(128 + key.length * 4);
348
+ const effective = use.effective;
349
+ if (effective?.kind === 'default' && presence.required)
350
+ return unavailable(use.declaration, 'required-attribute-default');
351
+ attributes.push(Object.freeze({ declaration: use.declaration, required: presence.required, builtin,
352
+ ...(retainLexical ? { retainLexical } : {}),
353
+ ...(list ? { list } : {}),
354
+ ...(effective ? { constraint: Object.freeze({ kind: effective.kind, lexical: effective.value.lexical.value, canonical: effective.value.operand.canonical }) } : {}) }));
355
+ }
356
+ }
357
+ const content = deriveActualComplexContent(context, type.id);
358
+ check();
359
+ if (content.kind !== 'checked')
360
+ return unavailable(type, 'native-content-properties');
361
+ if (content.view.content.kind === 'simple') {
362
+ const scalar = describeProjectionScalar(context, record.declaration, check);
363
+ check();
364
+ if (scalar.kind !== 'projection-scalar-type')
365
+ return unavailable(type, 'rule' in scalar ? scalar.rule : 'scalar-source-definition');
366
+ if (!projectionScalarRepresentation(scalar.builtin))
367
+ return unavailable(type, 'scalar-context-or-representation');
368
+ record.content = 'simple';
369
+ record.text = Object.freeze({ kind: 'scalar', builtin: scalar.builtin, declared: true,
370
+ ...(scalar.retainLexical ? { retainLexical: true } : {}), ...(scalar.list ? { list: scalar.list } : {}) });
371
+ Object.freeze(slots);
372
+ continue;
373
+ }
374
+ if (!['empty', 'element-only', 'mixed'].includes(content.view.content.kind))
375
+ return unavailable(type, content.view.content.kind + '-content');
376
+ record.content = content.view.content.kind;
377
+ if (record.content === 'mixed')
378
+ record.keyed = true;
379
+ if (content.view.content.kind === 'empty') {
380
+ Object.freeze(slots);
381
+ continue;
382
+ }
383
+ if (content.view.content.kind !== 'element-only' && content.view.content.kind !== 'mixed')
384
+ return unsupported();
385
+ const prepared = prepareSemanticParticleView(context, content.view, 'declared');
386
+ check();
387
+ if (prepared.kind !== 'checked')
388
+ return unavailable(type, 'native-particle-properties');
389
+ const nodes = [], todo = [prepared.view.root];
390
+ let compact = !record.keyed;
391
+ let fixedOrder = true;
392
+ const childLocals = new Set();
393
+ while (todo.length) {
394
+ check();
395
+ const p = todo.pop();
396
+ budget.chargeWork(64);
397
+ nodes.push(p);
398
+ fixedOrder &&= (p.kind === 'sequence' || p.kind === 'element') && p.occurs.min === '1' && p.occurs.max === '1';
399
+ if (p.kind === 'sequence')
400
+ compact &&= p.occurs.min === '1' && p.occurs.max === '1';
401
+ else if (p.kind === 'element') {
402
+ compact &&= ['0', '1'].includes(p.occurs.min) && ['1', 'unbounded'].includes(p.occurs.max);
403
+ if (p.element) {
404
+ if (childLocals.has(p.element.name.local)) {
405
+ compact = false;
406
+ record.keyed = true;
407
+ }
408
+ childLocals.add(p.element.name.local);
409
+ }
410
+ }
411
+ else
412
+ compact = false;
413
+ for (const child of p.children) {
414
+ check();
415
+ todo.push(child);
416
+ }
417
+ }
418
+ if (!compact) {
419
+ const first = new Map(), bodyNullable = new Map();
420
+ const leafSlots = new Map();
421
+ const leafKeys = new Map();
422
+ const firstWildcards = new Map();
423
+ const wildcardLeaves = new Map();
424
+ for (let i = nodes.length - 1; i >= 0; i--) {
425
+ check();
426
+ const p = nodes[i];
427
+ budget.chargeWork(128);
428
+ const starts = new Set();
429
+ const wildcardStarts = [];
430
+ let nullable = false;
431
+ if (p.kind === 'any') {
432
+ if (!p.originalParticle || !p.wildcard)
433
+ return unavailable(type, 'ordered-wildcard-source');
434
+ const particle = particleContentNode(context, content.view, p.originalParticle);
435
+ if (!particle || particle.kind !== 'particle')
436
+ return unavailable(type, 'ordered-wildcard-source');
437
+ if (p.wildcard.processContents !== 'strict') {
438
+ record.keyed = true;
439
+ record.contextual = true;
440
+ }
441
+ // @why Named-group memoization shares nodes; distinct leaf incidences must not disappear before alphabet-overlap checks.
442
+ if (wildcardLeaves.has(p))
443
+ return unavailable(particle, 'ordered-wildcard-incidence-overlap');
444
+ wildcardLeaves.set(p, Object.freeze({ particle, wildcard: p.wildcard }));
445
+ wildcardStarts.push(p.wildcard);
446
+ }
447
+ else if (p.kind === 'element') {
448
+ if (!p.element || !p.originalParticle)
449
+ return unavailable(type, 'ordered-element-source');
450
+ const particle = particleContentNode(context, content.view, p.originalParticle);
451
+ if (!particle || particle.kind !== 'particle')
452
+ return unavailable(type, 'ordered-element-source');
453
+ const key = nameKey(p.element.name, budget.chargeWork);
454
+ leafKeys.set(p, key);
455
+ if (leafSlots.has(key))
456
+ return unavailable(p.element, 'ordered-element-name-overlap');
457
+ if (p.element.identity.kind === 'global') {
458
+ const members = effectiveSubstitutionMembers(context, p.element.id);
459
+ check();
460
+ if (members.kind !== 'checked' || members.value.some(id => id !== p.element.id))
461
+ return unavailable(p.element, 'ordered-element-substitution');
462
+ }
463
+ starts.add(key);
464
+ leafSlots.set(key, Object.freeze({ element: p.element, particle, value: value(p.element) }));
465
+ }
466
+ else {
467
+ nullable = p.kind === 'choice' ? p.children.some(child => { check(); return child.summary.nullable; })
468
+ : p.children.every(child => { check(); return child.summary.nullable; });
469
+ let reachable = true;
470
+ for (const child of p.children) {
471
+ check();
472
+ if (p.kind === 'all' && (child.kind !== 'element' || child.occurs.max !== '1'))
473
+ return unavailable(type, 'ordered-all-child');
474
+ if (p.kind !== 'sequence' || reachable) {
475
+ for (const key of first.get(child)) {
476
+ check();
477
+ budget.chargeWork(32 + key.length);
478
+ starts.add(key);
479
+ }
480
+ for (const wildcard of firstWildcards.get(child)) {
481
+ check();
482
+ budget.chargeWork(32);
483
+ wildcardStarts.push(wildcard);
484
+ }
485
+ }
486
+ reachable &&= child.summary.nullable;
487
+ }
488
+ }
489
+ first.set(p, starts);
490
+ firstWildcards.set(p, Object.freeze(wildcardStarts));
491
+ bodyNullable.set(p, nullable);
492
+ }
493
+ const wildcards = [...wildcardLeaves.values()];
494
+ budget.chargeWork(64 + wildcards.length * 8);
495
+ if (wildcards.length && context.membership !== 'complete-actual-plus-additions')
496
+ return unavailable(type, 'ordered-wildcard-incomplete-universe');
497
+ for (let index = 0; index < wildcards.length; index++) {
498
+ check();
499
+ const wildcard = wildcards[index].wildcard;
500
+ for (const slot of leafSlots.values()) {
501
+ check();
502
+ if (namespaceAllows(wildcard.namespace, slot.element.name.namespace, budget.chargeWork))
503
+ return unavailable(type, 'ordered-wildcard-element-overlap');
504
+ }
505
+ for (let other = 0; other < index; other++) {
506
+ check();
507
+ const intersection = namespaceIntersection(wildcard.namespace, wildcards[other].wildcard.namespace, budget.chargeWork);
508
+ if (intersection.kind !== 'set' || intersection.namespaces.length)
509
+ return unavailable(type, 'ordered-wildcard-overlap');
510
+ }
511
+ }
512
+ record.ordered = true;
513
+ if (record.keyed && fixedOrder)
514
+ record.fixedOrder = true;
515
+ // @why Slots are metadata only here; the native grammar, rather than per-property cardinality, owns their occurrence correlation.
516
+ const orderedNodes = [prepared.view.root];
517
+ while (orderedNodes.length) {
518
+ check();
519
+ const p = orderedNodes.pop();
520
+ budget.chargeWork(32);
521
+ if (p.kind === 'element')
522
+ slots.push(leafSlots.get(leafKeys.get(p)));
523
+ for (let index = p.children.length - 1; index >= 0; index--)
524
+ orderedNodes.push(p.children[index]);
525
+ }
526
+ record.grammar = { context, view: prepared.view, first, bodyNullable, slots: leafSlots, leafKeys, firstWildcards, wildcardLeaves };
527
+ Object.freeze(slots);
528
+ continue;
529
+ }
530
+ budget.chargeWork(64);
531
+ const algebra = occurrenceAlgebra(check);
532
+ const particles = [content.view.content.particle];
533
+ while (particles.length) {
534
+ check();
535
+ const particle = particleContentNode(context, content.view, particles.pop());
536
+ if (!particle || particle.kind !== 'particle')
537
+ return unsupported();
538
+ algebra.validate(particle.occurs);
539
+ if (particle.term.kind === 'sequence') {
540
+ if (particle.occurs.min !== '1' || particle.occurs.max !== '1')
541
+ return unavailable(particle, 'sequence-occurrence-correlation');
542
+ budget.chargeWork(32 + particle.term.children.length * 8);
543
+ for (let index = particle.term.children.length - 1; index >= 0; index--) {
544
+ check();
545
+ particles.push(particle.term.children[index]);
546
+ }
547
+ continue;
548
+ }
549
+ if (particle.term.kind !== 'element')
550
+ return unavailable(particle, 'particle-' + particle.term.kind);
551
+ if (!['0', '1'].includes(particle.occurs.min) || !['1', 'unbounded'].includes(particle.occurs.max))
552
+ return unavailable(particle, 'element-occurrence-bound');
553
+ const declaration = context.resolve(particle.term.declaration);
554
+ if (declaration.kind !== 'found' || declaration.node.kind !== 'element')
555
+ return unsupported();
556
+ const element = declaration.node;
557
+ budget.chargeWork(128 + element.name.local.length * 4);
558
+ slots.push(Object.freeze({ element, particle, value: value(element) }));
559
+ }
560
+ Object.freeze(slots);
561
+ }
562
+ const ordered = budget.sorted([...records.values()], (a, b) => budget.compareText(a.type.id, b.type.id));
563
+ // @why Known intermediates carry scope changes required by unassessed descendants; each source type selects this duty.
564
+ let changed = true;
565
+ while (changed) {
566
+ check();
567
+ changed = false;
568
+ for (const record of ordered) {
569
+ check();
570
+ budget.chargeWork(32 + record.slots.length);
571
+ if (!record.contextual && record.slots.some(slot => slot.value.kind === 'record' && records.get(slot.value.type)?.contextual)) {
572
+ record.contextual = true;
573
+ changed = true;
574
+ }
575
+ }
576
+ }
577
+ budget.chargeWork(32 + ordered.length * 64);
578
+ return Object.freeze({ root: rootValue, records: Object.freeze(ordered.map(({ declaration: _declaration, grammar, ...record }) => {
579
+ const attributes = Object.freeze(record.attributes.map(attribute => {
580
+ const local = attribute.declaration.name.local;
581
+ const collision = record.slots.some(slot => slot.element.name.local === local)
582
+ || record.attributes.some(other => other !== attribute && other.declaration.name.local === local);
583
+ return collision ? Object.freeze({ ...attribute, bag: true }) : attribute;
584
+ }));
585
+ const published = Object.freeze({ ...record, attributes });
586
+ projectionRecords.set(published, context);
587
+ if (grammar)
588
+ orderedGrammars.set(published, grammar);
589
+ return published;
590
+ })) });
591
+ }
592
+ /** Adapt the native projection to the supported flat preview without widening admission. */
593
+ export function planDirectRoot(context, root, check, unsupported) {
594
+ const plan = planDirectProjection(context, root.element, check, unsupported);
595
+ return flatDirectProjection(plan, check, unsupported);
596
+ }
597
+ /** Flat-only projection adapter; its input is derived data, never native admission. */
598
+ export function flatDirectProjection(plan, check, unsupported) {
599
+ if (plan.root.nillable || plan.root.constraint)
600
+ return unsupported();
601
+ const scalar = (name) => {
602
+ check();
603
+ if (name.namespace !== XSD_NAMESPACE || !['string', 'boolean', 'int'].includes(name.local))
604
+ return unsupported();
605
+ return name;
606
+ };
607
+ if (plan.root.kind === 'scalar') {
608
+ if (plan.root.declared || plan.root.list)
609
+ return unsupported();
610
+ return { rootBuiltin: scalar(plan.root.builtin), slots: [] };
611
+ }
612
+ const rootType = plan.root.type;
613
+ const record = plan.records.find(item => item.type.id === rootType);
614
+ if (!record || record.ordered || record.keyed || record.contextual || record.attributeWildcard || record.attributes.length || record.type.derivation || record.text || !record.type.content)
615
+ return unsupported();
616
+ const slots = record.slots.map(slot => {
617
+ check();
618
+ if (slot.value.kind !== 'scalar' || slot.value.declared || slot.value.list || slot.value.nillable || slot.value.constraint)
619
+ return unsupported();
620
+ return { element: slot.element, particle: slot.particle, builtin: scalar(slot.value.builtin) };
621
+ });
622
+ return { slots };
623
+ }