@techspokes/typescript-wsdl-client 1.1.5 → 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 (480) hide show
  1. package/README.md +64 -66
  2. package/dist/app/generateApp.d.ts +0 -1
  3. package/dist/app/generateApp.js +1 -1
  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 +75 -1
  12. package/dist/client/checkedDirectRuntime.d.ts +40 -3
  13. package/dist/client/checkedDirectRuntime.js +28 -8
  14. package/dist/client/directClientRuntime.d.ts +27 -2
  15. package/dist/client/directClientRuntime.js +142 -89
  16. package/dist/client/directClientVersion.d.ts +3 -1
  17. package/dist/client/directClientVersion.js +3 -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 +21 -3
  21. package/dist/client/generateDirectClient.js +138 -6
  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 +0 -1
  29. package/dist/compiler/canonicalGraph.d.ts +0 -1
  30. package/dist/compiler/catalogErrors.d.ts +0 -1
  31. package/dist/compiler/catalogProvenance.d.ts +0 -1
  32. package/dist/compiler/checkedAssessment.d.ts +0 -1
  33. package/dist/compiler/checkedAssessment.js +1 -1
  34. package/dist/compiler/checkedComponentSource.d.ts +16 -0
  35. package/dist/compiler/checkedComponentSource.js +31 -0
  36. package/dist/compiler/checkedSourcePreparation.d.ts +38 -1
  37. package/dist/compiler/checkedSourcePreparation.js +71 -0
  38. package/dist/compiler/complexTypeContent.d.ts +5 -6
  39. package/dist/compiler/complexTypeContent.js +2 -2
  40. package/dist/compiler/componentCorrespondence.d.ts +32 -0
  41. package/dist/compiler/componentCorrespondence.js +140 -0
  42. package/dist/compiler/componentRecordProjection.d.ts +109 -0
  43. package/dist/compiler/componentRecordProjection.js +319 -0
  44. package/dist/compiler/componentSoapPreparation.d.ts +20 -0
  45. package/dist/compiler/componentSoapPreparation.js +36 -0
  46. package/dist/compiler/composeCanonicalGraph.d.ts +0 -1
  47. package/dist/compiler/dataOwnership.d.ts +0 -1
  48. package/dist/compiler/dataOwnership.js +14 -4
  49. package/dist/compiler/datatypeValues.d.ts +0 -1
  50. package/dist/compiler/directCodec.d.ts +59 -2
  51. package/dist/compiler/directCodec.js +275 -90
  52. package/dist/compiler/directExecutionPolicy.d.ts +0 -1
  53. package/dist/compiler/directOperation.d.ts +46 -4
  54. package/dist/compiler/directOperation.js +105 -14
  55. package/dist/compiler/directSoap.d.ts +29 -5
  56. package/dist/compiler/directSoap.js +130 -37
  57. package/dist/compiler/directSoapSource.d.ts +24 -1
  58. package/dist/compiler/directSoapSource.js +166 -19
  59. package/dist/compiler/directSourceCapsule.d.ts +74 -2
  60. package/dist/compiler/directSourceCapsule.js +428 -6
  61. package/dist/compiler/directStructure.d.ts +83 -6
  62. package/dist/compiler/directStructure.js +349 -58
  63. package/dist/compiler/directStructurePlan.d.ts +135 -2
  64. package/dist/compiler/directStructurePlan.js +594 -29
  65. package/dist/compiler/directValues.d.ts +63 -4
  66. package/dist/compiler/directValues.js +950 -116
  67. package/dist/compiler/finiteRe01Construction.d.ts +69 -0
  68. package/dist/compiler/finiteRe01Construction.js +422 -0
  69. package/dist/compiler/finiteRe01Verification.d.ts +81 -3
  70. package/dist/compiler/finiteRe01Verification.js +391 -4
  71. package/dist/compiler/generateCatalog.d.ts +0 -1
  72. package/dist/compiler/graphTraversal.d.ts +0 -1
  73. package/dist/compiler/hypotheticalScopedIdentity.d.ts +0 -1
  74. package/dist/compiler/occurrenceAnalysis.d.ts +2 -1
  75. package/dist/compiler/occurrenceAnalysis.js +23 -7
  76. package/dist/compiler/originalSourceMembership.d.ts +0 -1
  77. package/dist/compiler/particleAttribution.d.ts +0 -1
  78. package/dist/compiler/particleAttribution.js +20 -0
  79. package/dist/compiler/particleDeclarationConsistency.d.ts +0 -1
  80. package/dist/compiler/particleDeclarationConsistency.js +9 -0
  81. package/dist/compiler/particleExtension.d.ts +0 -1
  82. package/dist/compiler/particleExtension.js +5 -1
  83. package/dist/compiler/particleLocalAssessment.d.ts +0 -1
  84. package/dist/compiler/particleRestriction.d.ts +0 -1
  85. package/dist/compiler/particleRestriction.js +6 -1
  86. package/dist/compiler/particleSemanticView.d.ts +2 -1
  87. package/dist/compiler/particleSemanticView.js +16 -3
  88. package/dist/compiler/particleWildcardRelation.d.ts +0 -1
  89. package/dist/compiler/projectionScalar.d.ts +32 -0
  90. package/dist/compiler/projectionScalar.js +184 -0
  91. package/dist/compiler/re01CandidateAssignments.d.ts +95 -0
  92. package/dist/compiler/re01CandidateAssignments.js +341 -0
  93. package/dist/compiler/re01CandidateCorrespondence.d.ts +22 -1
  94. package/dist/compiler/re01CandidateCorrespondence.js +167 -38
  95. package/dist/compiler/re01TypeProperties.d.ts +0 -1
  96. package/dist/compiler/re01TypePropertyValidation.d.ts +0 -1
  97. package/dist/compiler/resolveCanonicalGraph.d.ts +5 -2
  98. package/dist/compiler/resolveCanonicalGraph.js +77 -7
  99. package/dist/compiler/scalarSchemaAssessment.d.ts +0 -1
  100. package/dist/compiler/schemaAttributeGroupProperties.d.ts +0 -1
  101. package/dist/compiler/schemaAttributeProperties.d.ts +0 -1
  102. package/dist/compiler/schemaAttributeUses.d.ts +22 -2
  103. package/dist/compiler/schemaAttributeUses.js +86 -13
  104. package/dist/compiler/schemaBinaryWordReconstruction.d.ts +0 -1
  105. package/dist/compiler/schemaBuiltinFacets.d.ts +0 -1
  106. package/dist/compiler/schemaCalendarImages.d.ts +0 -1
  107. package/dist/compiler/schemaCalendarLanguage.d.ts +0 -1
  108. package/dist/compiler/schemaCompiler.d.ts +0 -1
  109. package/dist/compiler/schemaComponentEquality.d.ts +0 -1
  110. package/dist/compiler/schemaConstructionAssessment.d.ts +34 -1
  111. package/dist/compiler/schemaConstructionAssessment.js +88 -6
  112. package/dist/compiler/schemaDatatypeValues.d.ts +0 -1
  113. package/dist/compiler/schemaDecimalLanguage.d.ts +0 -1
  114. package/dist/compiler/schemaDeclarationPrimitives.d.ts +7 -2
  115. package/dist/compiler/schemaDeclarationPrimitives.js +18 -1
  116. package/dist/compiler/schemaDocumentSyntax.d.ts +0 -1
  117. package/dist/compiler/schemaDurationLanguage.d.ts +0 -1
  118. package/dist/compiler/schemaElementInstance.d.ts +30 -0
  119. package/dist/compiler/schemaElementInstance.js +45 -0
  120. package/dist/compiler/schemaElementProperties.d.ts +0 -1
  121. package/dist/compiler/schemaEndpointWordCapacity.d.ts +0 -1
  122. package/dist/compiler/schemaExactCalendar.d.ts +0 -1
  123. package/dist/compiler/schemaFacetAnnotation.d.ts +0 -1
  124. package/dist/compiler/schemaGeneratedScalarShape.d.ts +0 -1
  125. package/dist/compiler/schemaGeneratedScalarShape.js +2 -0
  126. package/dist/compiler/schemaIdentityConstraints.d.ts +0 -1
  127. package/dist/compiler/schemaIeeeLanguage.d.ts +0 -1
  128. package/dist/compiler/schemaIntegerImages.d.ts +0 -1
  129. package/dist/compiler/schemaLexicalPredicates.d.ts +0 -1
  130. package/dist/compiler/schemaNotationProperties.d.ts +0 -1
  131. package/dist/compiler/schemaNumericImageConditions.d.ts +0 -1
  132. package/dist/compiler/schemaParticleWildcardProperties.d.ts +0 -1
  133. package/dist/compiler/schemaPattern.d.ts +0 -1
  134. package/dist/compiler/schemaRegularLanguage.d.ts +0 -1
  135. package/dist/compiler/schemaScalarContext.d.ts +5 -1
  136. package/dist/compiler/schemaScalarKernel.d.ts +0 -1
  137. package/dist/compiler/schemaScalarWitnesses.d.ts +0 -1
  138. package/dist/compiler/schemaSimpleTypeProperties.d.ts +0 -1
  139. package/dist/compiler/schemaSourceGrammar.d.ts +0 -1
  140. package/dist/compiler/schemaSourceLexical.d.ts +0 -1
  141. package/dist/compiler/schemaSourceValues.d.ts +0 -1
  142. package/dist/compiler/schemaSourceWildcards.d.ts +1 -2
  143. package/dist/compiler/schemaSourceWildcards.js +3 -1
  144. package/dist/compiler/schemaSymbolicSequences.d.ts +0 -1
  145. package/dist/compiler/schemaSymbolicValueSets.d.ts +0 -1
  146. package/dist/compiler/schemaSyntaxAssessment.d.ts +0 -1
  147. package/dist/compiler/schemaTemporalAliases.d.ts +0 -1
  148. package/dist/compiler/schemaTokenImages.d.ts +0 -1
  149. package/dist/compiler/schemaTypeIdentity.d.ts +0 -1
  150. package/dist/compiler/schemaTypeIdentity.js +2 -0
  151. package/dist/compiler/schemaTypeRelations.d.ts +0 -1
  152. package/dist/compiler/schemaUri.d.ts +0 -1
  153. package/dist/compiler/schemaValueContext.d.ts +0 -1
  154. package/dist/compiler/schemaValueImages.d.ts +0 -1
  155. package/dist/compiler/schemaValueSequences.d.ts +0 -1
  156. package/dist/compiler/semanticBudget.d.ts +18 -1
  157. package/dist/compiler/semanticBudget.js +17 -2
  158. package/dist/compiler/semanticCatalog.d.ts +1 -2
  159. package/dist/compiler/semanticContext.d.ts +12 -1
  160. package/dist/compiler/semanticContext.js +39 -0
  161. package/dist/compiler/semanticTypeDependencies.d.ts +0 -1
  162. package/dist/compiler/semanticTypeReference.d.ts +0 -1
  163. package/dist/compiler/shapeResolver.d.ts +0 -1
  164. package/dist/compiler/soapHeaders.d.ts +16 -0
  165. package/dist/compiler/soapHeaders.js +42 -0
  166. package/dist/compiler/sourceSchemaBinding.d.ts +0 -1
  167. package/dist/compiler/standardSchemaComponents.d.ts +71 -0
  168. package/dist/compiler/standardSchemaComponents.js +74 -0
  169. package/dist/compiler/standardSchemaConstruction.d.ts +20 -0
  170. package/dist/compiler/standardSchemaConstruction.js +34 -0
  171. package/dist/compiler/structuralCompanions.d.ts +0 -1
  172. package/dist/compiler/validateSemanticGraph.d.ts +0 -1
  173. package/dist/compiler/wildcardAlgebra.d.ts +0 -1
  174. package/dist/compiler/wsdlPolicyRequirements.d.ts +43 -0
  175. package/dist/compiler/wsdlPolicyRequirements.js +239 -0
  176. package/dist/config.d.ts +0 -1
  177. package/dist/gateway/generateCheckedGateway.d.ts +32 -0
  178. package/dist/gateway/generateCheckedGateway.js +293 -0
  179. package/dist/gateway/generateGateway.d.ts +0 -1
  180. package/dist/gateway/generators.d.ts +0 -1
  181. package/dist/gateway/helpers.d.ts +0 -1
  182. package/dist/generation/componentShape.d.ts +14 -0
  183. package/dist/generation/componentShape.js +269 -0
  184. package/dist/generation/preamble.d.ts +0 -1
  185. package/dist/generation/sourceLayout.d.ts +13 -0
  186. package/dist/generation/sourceLayout.js +40 -0
  187. package/dist/generation/writeGeneratedSource.d.ts +0 -1
  188. package/dist/index.d.ts +7 -2
  189. package/dist/index.js +2 -1
  190. package/dist/loader/fetch.d.ts +0 -1
  191. package/dist/loader/orderedSyntax.d.ts +8 -1
  192. package/dist/loader/orderedSyntax.js +26 -6
  193. package/dist/loader/resolutionDepth.d.ts +0 -1
  194. package/dist/loader/schemaInput.d.ts +28 -1
  195. package/dist/loader/schemaInput.js +41 -4
  196. package/dist/loader/schemaResources.d.ts +2 -1
  197. package/dist/loader/schemaResources.js +45 -4
  198. package/dist/loader/wsdlLoader.d.ts +0 -1
  199. package/dist/openapi/casing.d.ts +0 -1
  200. package/dist/openapi/generateOpenAPI.d.ts +0 -1
  201. package/dist/openapi/generatePaths.d.ts +0 -1
  202. package/dist/openapi/generateSchemas.d.ts +0 -1
  203. package/dist/openapi/security.d.ts +0 -1
  204. package/dist/pipeline.d.ts +6 -2
  205. package/dist/pipeline.js +13 -0
  206. package/dist/test/generateCheckedTests.d.ts +17 -0
  207. package/dist/test/generateCheckedTests.js +60 -0
  208. package/dist/test/generateTests.d.ts +0 -1
  209. package/dist/test/generators.d.ts +0 -1
  210. package/dist/test/mockData.d.ts +0 -1
  211. package/dist/test/mockData.js +20 -14
  212. package/dist/util/attributeWildcards.d.ts +0 -1
  213. package/dist/util/builder.d.ts +0 -1
  214. package/dist/util/catalogMeta.d.ts +0 -1
  215. package/dist/util/checkedCliDiagnostics.d.ts +11 -0
  216. package/dist/util/checkedCliDiagnostics.js +22 -0
  217. package/dist/util/cli.d.ts +0 -1
  218. package/dist/util/errors.d.ts +0 -1
  219. package/dist/util/imports.d.ts +0 -1
  220. package/dist/util/runtimeSource.d.ts +0 -1
  221. package/dist/util/runtimeSource.js +3 -5
  222. package/dist/util/securityConfig.d.ts +0 -1
  223. package/dist/util/streamConfig.d.ts +0 -1
  224. package/dist/util/tools.d.ts +0 -1
  225. package/dist/util/xmlWhitespace.d.ts +0 -1
  226. package/dist/xsd/primitives.d.ts +0 -1
  227. package/docs/agent-skill.md +2 -0
  228. package/docs/api-reference.md +1 -1
  229. package/docs/checked-gateway.md +210 -0
  230. package/docs/checked-generation.md +161 -0
  231. package/docs/cli-reference.md +23 -1
  232. package/docs/concepts.md +136 -1
  233. package/docs/configuration.md +5 -1
  234. package/docs/corpus.md +33 -0
  235. package/docs/direct-values.md +13 -13
  236. package/docs/examples/checked-forecast.wsdl +19 -0
  237. package/docs/gateway-guide.md +1 -1
  238. package/docs/generated-code.md +10 -5
  239. package/docs/mapping-contract.md +114 -0
  240. package/docs/migration-playbook.md +1 -1
  241. package/docs/output-anatomy.md +1 -1
  242. package/docs/start-here.md +8 -2
  243. package/docs/supported-patterns.md +7 -3
  244. package/docs/testing.md +117 -31
  245. package/llms.txt +7 -7
  246. package/package.json +63 -22
  247. package/src/runtime/checkedGatewayHost.tpl.txt +157 -0
  248. package/src/runtime/streamXml.ts +1 -1
  249. package/dist/app/generateApp.d.ts.map +0 -1
  250. package/dist/cli.d.ts.map +0 -1
  251. package/dist/client/checkedDirectRuntime.d.ts.map +0 -1
  252. package/dist/client/directClientRuntime.d.ts.map +0 -1
  253. package/dist/client/directClientVersion.d.ts.map +0 -1
  254. package/dist/client/generateClient.d.ts.map +0 -1
  255. package/dist/client/generateDirectClient.d.ts.map +0 -1
  256. package/dist/client/generateOperations.d.ts.map +0 -1
  257. package/dist/client/generateTypes.d.ts.map +0 -1
  258. package/dist/client/generateUtils.d.ts.map +0 -1
  259. package/dist/compiler/buildCanonicalGraph.d.ts.map +0 -1
  260. package/dist/compiler/canonicalGraph.d.ts.map +0 -1
  261. package/dist/compiler/catalogErrors.d.ts.map +0 -1
  262. package/dist/compiler/catalogProvenance.d.ts.map +0 -1
  263. package/dist/compiler/checkedAssessment.d.ts.map +0 -1
  264. package/dist/compiler/checkedSourcePreparation.d.ts.map +0 -1
  265. package/dist/compiler/complexTypeContent.d.ts.map +0 -1
  266. package/dist/compiler/composeCanonicalGraph.d.ts.map +0 -1
  267. package/dist/compiler/dataOwnership.d.ts.map +0 -1
  268. package/dist/compiler/datatypeValues.d.ts.map +0 -1
  269. package/dist/compiler/directCodec.d.ts.map +0 -1
  270. package/dist/compiler/directExecutionPolicy.d.ts.map +0 -1
  271. package/dist/compiler/directOperation.d.ts.map +0 -1
  272. package/dist/compiler/directSoap.d.ts.map +0 -1
  273. package/dist/compiler/directSoapSource.d.ts.map +0 -1
  274. package/dist/compiler/directSourceCapsule.d.ts.map +0 -1
  275. package/dist/compiler/directStructure.d.ts.map +0 -1
  276. package/dist/compiler/directStructurePlan.d.ts.map +0 -1
  277. package/dist/compiler/directValues.d.ts.map +0 -1
  278. package/dist/compiler/finiteRe01Verification.d.ts.map +0 -1
  279. package/dist/compiler/generateCatalog.d.ts.map +0 -1
  280. package/dist/compiler/graphTraversal.d.ts.map +0 -1
  281. package/dist/compiler/hypotheticalScopedIdentity.d.ts.map +0 -1
  282. package/dist/compiler/occurrenceAnalysis.d.ts.map +0 -1
  283. package/dist/compiler/originalSourceMembership.d.ts.map +0 -1
  284. package/dist/compiler/particleAttribution.d.ts.map +0 -1
  285. package/dist/compiler/particleDeclarationConsistency.d.ts.map +0 -1
  286. package/dist/compiler/particleExtension.d.ts.map +0 -1
  287. package/dist/compiler/particleLocalAssessment.d.ts.map +0 -1
  288. package/dist/compiler/particleRestriction.d.ts.map +0 -1
  289. package/dist/compiler/particleSemanticView.d.ts.map +0 -1
  290. package/dist/compiler/particleWildcardRelation.d.ts.map +0 -1
  291. package/dist/compiler/re01CandidateCorrespondence.d.ts.map +0 -1
  292. package/dist/compiler/re01TypeProperties.d.ts.map +0 -1
  293. package/dist/compiler/re01TypePropertyValidation.d.ts.map +0 -1
  294. package/dist/compiler/resolveCanonicalGraph.d.ts.map +0 -1
  295. package/dist/compiler/scalarSchemaAssessment.d.ts.map +0 -1
  296. package/dist/compiler/schemaAttributeGroupProperties.d.ts.map +0 -1
  297. package/dist/compiler/schemaAttributeProperties.d.ts.map +0 -1
  298. package/dist/compiler/schemaAttributeUses.d.ts.map +0 -1
  299. package/dist/compiler/schemaBinaryWordReconstruction.d.ts.map +0 -1
  300. package/dist/compiler/schemaBuiltinFacets.d.ts.map +0 -1
  301. package/dist/compiler/schemaCalendarImages.d.ts.map +0 -1
  302. package/dist/compiler/schemaCalendarLanguage.d.ts.map +0 -1
  303. package/dist/compiler/schemaCompiler.d.ts.map +0 -1
  304. package/dist/compiler/schemaComponentEquality.d.ts.map +0 -1
  305. package/dist/compiler/schemaConstructionAssessment.d.ts.map +0 -1
  306. package/dist/compiler/schemaDatatypeValues.d.ts.map +0 -1
  307. package/dist/compiler/schemaDecimalLanguage.d.ts.map +0 -1
  308. package/dist/compiler/schemaDeclarationPrimitives.d.ts.map +0 -1
  309. package/dist/compiler/schemaDocumentSyntax.d.ts.map +0 -1
  310. package/dist/compiler/schemaDurationLanguage.d.ts.map +0 -1
  311. package/dist/compiler/schemaElementProperties.d.ts.map +0 -1
  312. package/dist/compiler/schemaEndpointWordCapacity.d.ts.map +0 -1
  313. package/dist/compiler/schemaExactCalendar.d.ts.map +0 -1
  314. package/dist/compiler/schemaFacetAnnotation.d.ts.map +0 -1
  315. package/dist/compiler/schemaGeneratedScalarShape.d.ts.map +0 -1
  316. package/dist/compiler/schemaIdentityConstraints.d.ts.map +0 -1
  317. package/dist/compiler/schemaIeeeLanguage.d.ts.map +0 -1
  318. package/dist/compiler/schemaIntegerImages.d.ts.map +0 -1
  319. package/dist/compiler/schemaLexicalPredicates.d.ts.map +0 -1
  320. package/dist/compiler/schemaNotationProperties.d.ts.map +0 -1
  321. package/dist/compiler/schemaNumericImageConditions.d.ts.map +0 -1
  322. package/dist/compiler/schemaParticleWildcardProperties.d.ts.map +0 -1
  323. package/dist/compiler/schemaPattern.d.ts.map +0 -1
  324. package/dist/compiler/schemaRegularLanguage.d.ts.map +0 -1
  325. package/dist/compiler/schemaScalarContext.d.ts.map +0 -1
  326. package/dist/compiler/schemaScalarKernel.d.ts.map +0 -1
  327. package/dist/compiler/schemaScalarWitnesses.d.ts.map +0 -1
  328. package/dist/compiler/schemaSimpleTypeProperties.d.ts.map +0 -1
  329. package/dist/compiler/schemaSourceGrammar.d.ts.map +0 -1
  330. package/dist/compiler/schemaSourceLexical.d.ts.map +0 -1
  331. package/dist/compiler/schemaSourceValues.d.ts.map +0 -1
  332. package/dist/compiler/schemaSourceWildcards.d.ts.map +0 -1
  333. package/dist/compiler/schemaSymbolicSequences.d.ts.map +0 -1
  334. package/dist/compiler/schemaSymbolicValueSets.d.ts.map +0 -1
  335. package/dist/compiler/schemaSyntaxAssessment.d.ts.map +0 -1
  336. package/dist/compiler/schemaTemporalAliases.d.ts.map +0 -1
  337. package/dist/compiler/schemaTokenImages.d.ts.map +0 -1
  338. package/dist/compiler/schemaTypeIdentity.d.ts.map +0 -1
  339. package/dist/compiler/schemaTypeRelations.d.ts.map +0 -1
  340. package/dist/compiler/schemaUri.d.ts.map +0 -1
  341. package/dist/compiler/schemaValueContext.d.ts.map +0 -1
  342. package/dist/compiler/schemaValueImages.d.ts.map +0 -1
  343. package/dist/compiler/schemaValueSequences.d.ts.map +0 -1
  344. package/dist/compiler/semanticBudget.d.ts.map +0 -1
  345. package/dist/compiler/semanticCatalog.d.ts.map +0 -1
  346. package/dist/compiler/semanticContext.d.ts.map +0 -1
  347. package/dist/compiler/semanticTypeDependencies.d.ts.map +0 -1
  348. package/dist/compiler/semanticTypeReference.d.ts.map +0 -1
  349. package/dist/compiler/shapeResolver.d.ts.map +0 -1
  350. package/dist/compiler/sourceSchemaBinding.d.ts.map +0 -1
  351. package/dist/compiler/structuralCompanions.d.ts.map +0 -1
  352. package/dist/compiler/validateSemanticGraph.d.ts.map +0 -1
  353. package/dist/compiler/wildcardAlgebra.d.ts.map +0 -1
  354. package/dist/config.d.ts.map +0 -1
  355. package/dist/gateway/generateGateway.d.ts.map +0 -1
  356. package/dist/gateway/generators.d.ts.map +0 -1
  357. package/dist/gateway/helpers.d.ts.map +0 -1
  358. package/dist/generation/preamble.d.ts.map +0 -1
  359. package/dist/generation/writeGeneratedSource.d.ts.map +0 -1
  360. package/dist/index.d.ts.map +0 -1
  361. package/dist/loader/fetch.d.ts.map +0 -1
  362. package/dist/loader/orderedSyntax.d.ts.map +0 -1
  363. package/dist/loader/resolutionDepth.d.ts.map +0 -1
  364. package/dist/loader/schemaInput.d.ts.map +0 -1
  365. package/dist/loader/schemaResources.d.ts.map +0 -1
  366. package/dist/loader/wsdlLoader.d.ts.map +0 -1
  367. package/dist/openapi/casing.d.ts.map +0 -1
  368. package/dist/openapi/generateOpenAPI.d.ts.map +0 -1
  369. package/dist/openapi/generatePaths.d.ts.map +0 -1
  370. package/dist/openapi/generateSchemas.d.ts.map +0 -1
  371. package/dist/openapi/security.d.ts.map +0 -1
  372. package/dist/pipeline.d.ts.map +0 -1
  373. package/dist/runtime/jsonArray.d.ts +0 -24
  374. package/dist/runtime/jsonArray.d.ts.map +0 -1
  375. package/dist/runtime/jsonArray.js +0 -52
  376. package/dist/runtime/ndjson.d.ts +0 -24
  377. package/dist/runtime/ndjson.d.ts.map +0 -1
  378. package/dist/runtime/ndjson.js +0 -30
  379. package/dist/runtime/streamXml.d.ts +0 -45
  380. package/dist/runtime/streamXml.d.ts.map +0 -1
  381. package/dist/runtime/streamXml.js +0 -212
  382. package/dist/test/generateTests.d.ts.map +0 -1
  383. package/dist/test/generators.d.ts.map +0 -1
  384. package/dist/test/mockData.d.ts.map +0 -1
  385. package/dist/util/attributeWildcards.d.ts.map +0 -1
  386. package/dist/util/builder.d.ts.map +0 -1
  387. package/dist/util/catalogMeta.d.ts.map +0 -1
  388. package/dist/util/cli.d.ts.map +0 -1
  389. package/dist/util/errors.d.ts.map +0 -1
  390. package/dist/util/imports.d.ts.map +0 -1
  391. package/dist/util/runtimeSource.d.ts.map +0 -1
  392. package/dist/util/securityConfig.d.ts.map +0 -1
  393. package/dist/util/streamConfig.d.ts.map +0 -1
  394. package/dist/util/tools.d.ts.map +0 -1
  395. package/dist/util/xmlWhitespace.d.ts.map +0 -1
  396. package/dist/xsd/primitives.d.ts.map +0 -1
  397. package/docs/AGENTS.md +0 -47
  398. package/docs/README.md +0 -69
  399. package/docs/architecture.md +0 -158
  400. package/docs/content-model-analysis.md +0 -92
  401. package/docs/content-model-baseline.md +0 -121
  402. package/docs/content-model-catalog.md +0 -116
  403. package/docs/content-model-companions.md +0 -90
  404. package/docs/content-model-composition.md +0 -103
  405. package/docs/content-model-decisions.md +0 -79
  406. package/docs/content-model-gateway-feasibility.md +0 -169
  407. package/docs/content-model-graph.md +0 -121
  408. package/docs/content-model-loading.md +0 -163
  409. package/docs/content-model-matching.md +0 -85
  410. package/docs/content-model-readiness.md +0 -144
  411. package/docs/content-model-resolution.md +0 -81
  412. package/docs/content-model-s02-handoff.md +0 -98
  413. package/docs/content-model-s06-au-01.md +0 -425
  414. package/docs/content-model-s06-dt-01.md +0 -386
  415. package/docs/content-model-s06-pw-01.md +0 -350
  416. package/docs/content-model-s06-re-01-resolver-implementation.md +0 -869
  417. package/docs/content-model-s06-re-01-resolver.md +0 -513
  418. package/docs/content-model-s06-re-01-scalar-witnesses.md +0 -1423
  419. package/docs/content-model-s06-re-01-support-reconstruction.md +0 -6337
  420. package/docs/content-model-s06-re-01.md +0 -7477
  421. package/docs/content-model-s06-research-handoff.md +0 -909
  422. package/docs/content-model-shipped-fix.md +0 -83
  423. package/docs/content-model-soap-feasibility.md +0 -165
  424. package/docs/decisions/001-test-generation.md +0 -36
  425. package/docs/decisions/002-streamable-responses.md +0 -332
  426. package/docs/decisions/003-content-model-contracts.md +0 -280
  427. package/docs/file-naming-and-path-organization.md +0 -213
  428. package/docs/reference-validation.md +0 -243
  429. package/docs/releases/README.md +0 -94
  430. package/docs/releases/v0.20.0.md +0 -22
  431. package/docs/releases/v0.21.0.md +0 -30
  432. package/docs/releases/v0.22.0.md +0 -30
  433. package/docs/releases/v0.23.0.md +0 -31
  434. package/docs/releases/v0.24.0.md +0 -38
  435. package/docs/releases/v0.25.0.md +0 -31
  436. package/docs/releases/v0.25.2.md +0 -32
  437. package/docs/releases/v0.26.0.md +0 -32
  438. package/docs/releases/v0.27.0.md +0 -31
  439. package/docs/releases/v0.28.0.md +0 -32
  440. package/docs/releases/v0.29.0.md +0 -32
  441. package/docs/releases/v0.30.0.md +0 -30
  442. package/docs/releases/v0.30.1.md +0 -31
  443. package/docs/releases/v0.30.2.md +0 -30
  444. package/docs/releases/v0.30.3.md +0 -33
  445. package/docs/releases/v0.31.0.md +0 -33
  446. package/docs/releases/v0.32.0.md +0 -33
  447. package/docs/releases/v0.33.0.md +0 -34
  448. package/docs/releases/v0.34.0.md +0 -30
  449. package/docs/releases/v0.35.0.md +0 -33
  450. package/docs/releases/v0.36.0.md +0 -32
  451. package/docs/releases/v0.37.0.md +0 -33
  452. package/docs/releases/v0.38.0.md +0 -35
  453. package/docs/releases/v0.39.0.md +0 -35
  454. package/docs/releases/v0.40.0.md +0 -45
  455. package/docs/releases/v0.40.1.md +0 -34
  456. package/docs/releases/v1.0.0.md +0 -42
  457. package/docs/releases/v1.0.1.md +0 -38
  458. package/docs/releases/v1.0.2.md +0 -51
  459. package/docs/releases/v1.0.3.md +0 -37
  460. package/docs/releases/v1.0.4.md +0 -45
  461. package/docs/releases/v1.0.5.md +0 -41
  462. package/docs/releases/v1.0.6.md +0 -35
  463. package/docs/releases/v1.0.7.md +0 -36
  464. package/docs/releases/v1.1.0.md +0 -42
  465. package/docs/releases/v1.1.1.md +0 -44
  466. package/docs/releases/v1.1.2.md +0 -42
  467. package/docs/releases/v1.1.3.md +0 -36
  468. package/docs/releases/v1.1.4.md +0 -36
  469. package/docs/releases/v1.1.5.md +0 -38
  470. package/docs/roadmap/README.md +0 -107
  471. package/docs/roadmap/v1.0-capability-conformance-framework.md +0 -582
  472. package/docs/roadmap/v1.0-choice-union-mode.md +0 -90
  473. package/docs/roadmap/v1.0-contract-audit.md +0 -75
  474. package/docs/roadmap/v1.0-json-array-streaming.md +0 -101
  475. package/docs/roadmap/v1.0-openapi-fastify-compatibility.md +0 -99
  476. package/docs/roadmap/v1.0-release-candidate-gates.md +0 -92
  477. package/docs/roadmap/v1.0-wsdl-coverage-matrix.md +0 -200
  478. package/docs/roadmap/v1.0-xs-anyattribute-wildcard-bag.md +0 -932
  479. package/src/runtime/jsonArray.ts +0 -55
  480. package/src/runtime/ndjson.ts +0 -32
@@ -1,6 +1,16 @@
1
1
  /** Internal direct case of the content-model matcher; never runtime admission. */
2
2
  import { inspectDirectOperation } from './directOperation.js';
3
- import { planDirectRoot } from './directStructurePlan.js';
3
+ import { planDirectProjection, flatDirectProjection, matchOrderedProjection, selectProjectionAttribute, isXmlCharacters, isXmlNamespaceBinding } from './directStructurePlan.js';
4
+ import { assertSemanticContext } from './semanticContext.js';
5
+ import { isXmlNCName } from '../loader/orderedSyntax.js';
6
+ const projectionIssued = new WeakMap();
7
+ /** Native context identity authenticates structure only, never source validity or operation admission. */
8
+ export function inspectProjectionStructuralMatch(match, context) {
9
+ assertSemanticContext(context);
10
+ if (!match || typeof match !== 'object' || projectionIssued.get(match) !== context)
11
+ throw new TypeError('Unauthenticated or foreign projection structural match');
12
+ return match;
13
+ }
4
14
  const issued = new WeakMap();
5
15
  /** Identity is checked before any receipt fields; no retrospective authentication. */
6
16
  export function inspectDirectStructuralMatch(match, expectedContract) {
@@ -23,12 +33,14 @@ class Stop extends Error {
23
33
  }
24
34
  }
25
35
  /**
26
- * Data-only SyntaxElement input (plain records/arrays, no proxies/accessors). Malformed
27
- * input throws TypeError; XML structure differences return mismatch. No caller is frozen.
28
- * Cancellation is synchronous/cooperative, checked at visits and before publication.
36
+ * Match a data-only ordered XML tree against an actual native projection.
37
+ * @remarks The issued receipt establishes structure only, not source validity, scalar validity or operation admission.
38
+ * @constraints Plain records/arrays only; proxies and accessors are unsupported. No caller payload is frozen.
39
+ * @throws TypeError For malformed data-only trees or unauthenticated contexts.
40
+ * @returns A context-owned structural match or a mismatch, unsupported, cancellation or resource failure.
29
41
  */
30
- export function matchDirectOperation(contract, direction, payload, options = {}) {
31
- const { context } = inspectDirectOperation(contract);
42
+ export function matchDirectProjection(context, root, payload, options = {}) {
43
+ assertSemanticContext(context);
32
44
  const { budget } = context;
33
45
  const check = () => { budget.chargeWork(); if (options.signal?.aborted)
34
46
  throw new Stop('cancelled', 'cooperative-cancellation'); };
@@ -62,28 +74,27 @@ export function matchDirectOperation(contract, direction, payload, options = {})
62
74
  // Reserve fixed closures/state, diagnostics and terminal publication before input work.
63
75
  budget.chargeWork(4096);
64
76
  check();
65
- const suppliedDirection = budget.snapshot(direction);
66
- if (!record(suppliedDirection))
67
- return malformed();
68
- if (!['input', 'output', 'fault'].includes(suppliedDirection.kind))
69
- return fail('unsupported', 'unknown-direction');
70
- const ownedDirection = suppliedDirection.kind === 'fault'
71
- ? { kind: 'fault', name: suppliedDirection.name } : { kind: suppliedDirection.kind };
72
- let root;
73
- if (ownedDirection.kind === 'fault') {
74
- budget.chargeWork(64 + contract.faults.length * 32);
75
- if (typeof ownedDirection.name !== 'string')
76
- return fail('unsupported', 'unknown-fault');
77
- const selected = contract.faults.find(f => budget.compareText(f.name, ownedDirection.name) === 0);
78
- if (!selected)
79
- return fail('unsupported', 'unknown-fault');
80
- root = selected.root;
81
- }
82
- else
83
- root = contract[ownedDirection.kind];
84
- const schemaPath = root.element.context.source.path;
77
+ const schemaPath = root.context.source.path;
85
78
  const unsupported = () => fail('unsupported', 'native-direct-shape', schemaPath);
86
- const { slots, rootBuiltin } = planDirectRoot(context, root, check, unsupported);
79
+ const plan = planDirectProjection(context, root, check, unsupported);
80
+ if (options.flatOnly)
81
+ flatDirectProjection(plan, check, unsupported);
82
+ const records = new Map(plan.records.map(record => [record.type.id, record]));
83
+ const wildcardPlans = new Map([[root, plan]]);
84
+ const wildcardValue = (element) => {
85
+ let selected = wildcardPlans.get(element);
86
+ if (!selected) {
87
+ selected = planDirectProjection(context, element, check, unsupported);
88
+ budget.chargeWork(64 + selected.records.length * 64);
89
+ for (const record of selected.records) {
90
+ check();
91
+ if (!records.has(record.type.id))
92
+ records.set(record.type.id, record);
93
+ }
94
+ wildcardPlans.set(element, selected);
95
+ }
96
+ return selected.root;
97
+ };
87
98
  // Count syntax nodes before copying. Descriptor reads reject accessors without invoking
88
99
  // them. A tree may not reuse a node, including cyclic input; proxies are out of contract.
89
100
  budget.chargeWork(128);
@@ -155,25 +166,12 @@ export function matchDirectOperation(contract, direction, payload, options = {})
155
166
  if (node.attributes.length)
156
167
  fail('unsupported', 'payload-attributes', declaration.context.source.path, path);
157
168
  };
158
- attributes(owned, root.element, '/0');
159
- if (!same(owned.name, root.element.name))
160
- return mismatch('root-name', root.element, '/0');
169
+ if (!same(owned.name, root.name))
170
+ return mismatch('root-name', root, '/0');
161
171
  budget.chargeWork(64);
162
172
  const occurrences = [];
163
- const leaf = (node, declaration, builtin, path) => {
164
- attributes(node, declaration, path);
165
- budget.chargeWork(64);
166
- const parts = [];
167
- let length = 0;
168
- for (const child of node.children) {
169
- check();
170
- if (child.kind !== 'text')
171
- return mismatch('scalar-child', declaration, path);
172
- budget.chargeWork(32 + child.value.length * 4);
173
- parts.push(child.value);
174
- length += child.value.length;
175
- }
176
- budget.chargeWork(256 + length * 4 + path.length * 4);
173
+ const operand = (node, declaration, builtin, lexical, path, fixedCanonical, retainLexical, list) => {
174
+ budget.chargeWork(256 + lexical.length * 4 + path.length * 4);
177
175
  // Project only typed retained facts. Generic snapshots deliberately preserve
178
176
  // unknown values; caller extension fields must not become receipt authority.
179
177
  const namespaces = Object.create(null);
@@ -188,22 +186,261 @@ export function matchDirectOperation(contract, direction, payload, options = {})
188
186
  const payloadSource = budget.snapshot({ uri: s.uri, digest: s.digest, path: s.path,
189
187
  start: { offset: s.start.offset, line: s.start.line, column: s.start.column },
190
188
  end: { offset: s.end.offset, line: s.end.line, column: s.end.column } });
191
- occurrences.push({ declaration, type: declaration.type, builtin, lexical: parts.join(''), namespaces,
192
- payloadSource, payloadPath: path, schemaPath: declaration.context.source.path });
189
+ occurrences.push({ declaration, type: declaration.type, builtin, lexical, namespaces,
190
+ payloadSource, payloadPath: path, schemaPath: declaration.context.source.path,
191
+ ...(fixedCanonical === undefined ? {} : { fixedCanonical }), ...(retainLexical ? { retainLexical } : {}), ...(list ? { list } : {}) });
192
+ };
193
+ const text = (node, declaration, path) => {
194
+ budget.chargeWork(64);
195
+ const parts = [];
196
+ for (const child of node.children) {
197
+ check();
198
+ if (child.kind !== 'text')
199
+ return mismatch('scalar-child', declaration, path);
200
+ budget.chargeWork(32 + child.value.length * 4);
201
+ parts.push(child.value);
202
+ }
203
+ return parts.join('');
204
+ };
205
+ const elementOperand = (node, declaration, builtin, path, shape, retainLexical, list) => {
206
+ const lexical = text(node, declaration, path);
207
+ operand(node, declaration, builtin, lexical === '' && shape.constraint ? shape.constraint.lexical : lexical, path, shape.constraint?.kind === 'fixed' ? shape.constraint.canonical : undefined, retainLexical, list);
193
208
  };
194
- if (rootBuiltin)
195
- leaf(owned, root.element, rootBuiltin, '/0');
196
- else {
209
+ const leaf = (node, declaration, builtin, path, shape, retainLexical, list) => {
210
+ attributes(node, declaration, path);
211
+ elementOperand(node, declaration, builtin, path, shape, retainLexical, list);
212
+ };
213
+ const roots = [];
214
+ const frames = [{ node: owned, declaration: root, value: plan.root, path: '/0', into: roots }];
215
+ while (frames.length) {
216
+ check();
217
+ const frame = frames.pop();
218
+ const { declaration, path: parentPath } = frame;
219
+ let node = frame.node;
220
+ budget.chargeWork(128 + parentPath.length * 4);
221
+ if (node.kind === 'text') {
222
+ if (!isXmlCharacters(node.value))
223
+ return mismatch('xml-characters', declaration, parentPath);
224
+ frame.into.push({ kind: 'mixed-text', declaration, payloadPath: parentPath, value: node.value });
225
+ continue;
226
+ }
227
+ if (frame.unassessed) {
228
+ const pending = [node];
229
+ while (pending.length) {
230
+ check();
231
+ const value = pending.pop();
232
+ budget.chargeWork(64);
233
+ if (value.kind === 'text') {
234
+ if (!isXmlCharacters(value.value))
235
+ return mismatch('xml-characters', declaration, value.source.path);
236
+ continue;
237
+ }
238
+ if (!isXmlNCName(value.name.local) || !isXmlCharacters(value.name.namespace) || value.name.namespace === 'http://www.w3.org/2000/xmlns/')
239
+ return mismatch('expanded-name-required', declaration, value.source.path);
240
+ for (const prefix in value.namespaces) {
241
+ check();
242
+ if (!isXmlNamespaceBinding(prefix, value.namespaces[prefix]))
243
+ return mismatch('namespace-binding', declaration, value.source.path);
244
+ }
245
+ const identities = new Set();
246
+ for (const attribute of value.attributes) {
247
+ check();
248
+ const key = JSON.stringify([attribute.name.namespace, attribute.name.local]);
249
+ budget.chargeWork(64 + key.length * 4 + attribute.value.length);
250
+ if (!isXmlNCName(attribute.name.local) || attribute.name.local === 'xmlns' && attribute.name.namespace === '' || attribute.name.namespace === 'http://www.w3.org/2000/xmlns/' || !isXmlCharacters(attribute.name.namespace))
251
+ return mismatch('attribute-name', declaration, value.source.path);
252
+ if (!isXmlCharacters(attribute.value))
253
+ return mismatch('xml-characters', declaration, value.source.path);
254
+ if (identities.has(key))
255
+ return mismatch('duplicate-attribute', declaration, value.source.path);
256
+ identities.add(key);
257
+ }
258
+ for (const child of value.children) {
259
+ check();
260
+ pending.push(child);
261
+ }
262
+ }
263
+ frame.into.push({ kind: 'unassessed', declaration, payloadPath: parentPath, payload: node });
264
+ continue;
265
+ }
266
+ let nil = false;
267
+ const nilAttributes = node.attributes.filter(attribute => {
268
+ check();
269
+ return attribute.name.namespace === 'http://www.w3.org/2001/XMLSchema-instance' && attribute.name.local === 'nil';
270
+ });
271
+ if (nilAttributes.length) {
272
+ if (options.flatOnly)
273
+ return fail('unsupported', 'payload-attributes', declaration.context.source.path, parentPath);
274
+ if (nilAttributes.length !== 1)
275
+ return mismatch('duplicate-nil', declaration, parentPath);
276
+ const lexical = nilAttributes[0].value.replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, '');
277
+ if (!['true', '1', 'false', '0'].includes(lexical))
278
+ return mismatch('nil-lexical', declaration, parentPath);
279
+ nil = lexical === 'true' || lexical === '1';
280
+ if (nil && !frame.value.nillable)
281
+ return mismatch('non-nillable', declaration, parentPath);
282
+ if (nil && frame.value.constraint?.kind === 'fixed')
283
+ return mismatch('nil-fixed-value', declaration, parentPath);
284
+ if (nil && node.children.length)
285
+ return mismatch('nil-content', declaration, parentPath);
286
+ node = { ...node, attributes: node.attributes.filter(attribute => { check(); return !nilAttributes.includes(attribute); }) };
287
+ }
288
+ if (frame.value.kind === 'scalar') {
289
+ if (nil) {
290
+ attributes(node, declaration, parentPath);
291
+ frame.into.push({ kind: 'record', nil: true, declaration, payloadPath: parentPath, attributes: [], slots: [] });
292
+ continue;
293
+ }
294
+ const operand = occurrences.length;
295
+ leaf(node, declaration, frame.value.builtin, parentPath, frame.value, frame.value.retainLexical, frame.value.list);
296
+ frame.into.push({ kind: 'scalar', declaration, payloadPath: parentPath, operand });
297
+ continue;
298
+ }
299
+ const record = records.get(frame.value.type);
300
+ if (!record)
301
+ return unsupported();
302
+ if (record.contextual)
303
+ for (const prefix in node.namespaces) {
304
+ check();
305
+ if (!isXmlNamespaceBinding(prefix, node.namespaces[prefix]))
306
+ return mismatch('namespace-binding', declaration, parentPath);
307
+ }
308
+ // @why XSD 1.0 cvc-complex-type.2.1 forbids even whitespace character children for empty content.
309
+ if (record.content === 'empty' && node.children.length)
310
+ return mismatch('empty-content', declaration, parentPath);
311
+ const matchedAttributes = [];
312
+ const openAttributes = [];
313
+ const attributeChannel = (expected) => ({ ...(expected.bag ? { bag: true } : {}),
314
+ ...(expected.bag && expected.declaration.name.namespace && (record.attributeWildcard
315
+ || record.attributes.some(other => other !== expected && other.declaration.name.local === expected.declaration.name.local)) ? { namespaceChoice: true } : {}) });
316
+ if (!record.attributes.length && !record.attributeWildcard)
317
+ attributes(node, declaration, parentPath);
318
+ else {
319
+ const present = new Set();
320
+ for (let index = 0; index < node.attributes.length; index++) {
321
+ check();
322
+ const attribute = node.attributes[index];
323
+ const path = `${parentPath}/attributes/${index}`;
324
+ let expected = record.attributes.find(item => { check(); return same(item.declaration.name, attribute.name); });
325
+ let dynamic = false;
326
+ if (!expected) {
327
+ const selected = selectProjectionAttribute(context, record, attribute.name, check, unsupported);
328
+ if (!selected)
329
+ return mismatch('unknown-attribute', declaration, path);
330
+ if (!selected.attribute) {
331
+ if (!isXmlNCName(attribute.name.local) || attribute.name.local === 'xmlns' && attribute.name.namespace === ''
332
+ || attribute.name.namespace === 'http://www.w3.org/2000/xmlns/' || !isXmlCharacters(attribute.name.namespace))
333
+ return mismatch('attribute-name', declaration, path);
334
+ if (!isXmlCharacters(attribute.value))
335
+ return mismatch('xml-characters', declaration, path);
336
+ const key = JSON.stringify([attribute.name.namespace, attribute.name.local]);
337
+ if (present.has(key))
338
+ return mismatch('duplicate-attribute', declaration, path);
339
+ present.add(key);
340
+ openAttributes.push(attribute);
341
+ continue;
342
+ }
343
+ expected = selected.attribute;
344
+ dynamic = true;
345
+ }
346
+ if (present.has(expected.declaration.id))
347
+ return mismatch('duplicate-attribute', declaration, path);
348
+ budget.chargeWork(128 + expected.declaration.id.length);
349
+ present.add(expected.declaration.id);
350
+ matchedAttributes.push({ declaration: expected.declaration, operand: occurrences.length, payloadPath: path, origin: 'present',
351
+ ...(dynamic ? { bag: true, ...(attribute.name.namespace ? { namespaceChoice: true } : {}) } : attributeChannel(expected)) });
352
+ operand(node, expected.declaration, expected.builtin, attribute.value, path, expected.constraint?.kind === 'fixed' ? expected.constraint.canonical : undefined, expected.retainLexical, expected.list);
353
+ }
354
+ for (const expected of record.attributes) {
355
+ check();
356
+ if (expected.required && !present.has(expected.declaration.id))
357
+ return mismatch('missing-required-attribute', declaration, parentPath);
358
+ if (!present.has(expected.declaration.id) && expected.constraint) {
359
+ budget.chargeWork(128 + expected.declaration.id.length * 4);
360
+ const path = `${parentPath}/@schema-${expected.constraint.kind}/${encodeURIComponent(expected.declaration.id)}`;
361
+ matchedAttributes.push({ declaration: expected.declaration, operand: occurrences.length, payloadPath: path,
362
+ ...attributeChannel(expected),
363
+ origin: expected.constraint.kind === 'fixed' ? 'schema-fixed' : 'schema-default' });
364
+ operand(node, expected.declaration, expected.builtin, expected.constraint.lexical, path, expected.constraint.kind === 'fixed' ? expected.constraint.canonical : undefined, expected.retainLexical, expected.list);
365
+ }
366
+ }
367
+ }
368
+ if (nil) {
369
+ frame.into.push({ kind: 'record', nil: true, declaration, payloadPath: parentPath, slots: [], attributes: matchedAttributes,
370
+ openAttributes,
371
+ ...(record.contextual ? { namespaces: node.namespaces } : {}) });
372
+ continue;
373
+ }
374
+ if (record.content === 'simple') {
375
+ if (!record.text)
376
+ throw new TypeError('Missing native simple content plan');
377
+ const path = `${parentPath}/text`, index = occurrences.length;
378
+ elementOperand(node, declaration, record.text.builtin, path, frame.value, record.text.retainLexical, record.text.list);
379
+ frame.into.push({ kind: 'record', declaration, payloadPath: parentPath, slots: [], attributes: matchedAttributes,
380
+ openAttributes, ...(record.contextual ? { namespaces: node.namespaces } : {}),
381
+ text: { kind: 'scalar', declaration, payloadPath: path, operand: index } });
382
+ continue;
383
+ }
384
+ const slots = record.slots;
385
+ if (record.ordered) {
386
+ const elements = [];
387
+ for (let index = 0; index < node.children.length; index++) {
388
+ check();
389
+ const child = node.children[index], path = `${parentPath}/children/${index}`;
390
+ budget.chargeWork(64);
391
+ if (child.kind === 'text') {
392
+ budget.chargeWork(child.value.length * 2);
393
+ if (record.content !== 'mixed' && /[^\t\r\n ]/.test(child.value))
394
+ return mismatch('complex-text', declaration, path);
395
+ }
396
+ else
397
+ elements.push({ node: child, path });
398
+ }
399
+ const selected = matchOrderedProjection(context, record, elements.map(item => { check(); return item.node.name; }), check);
400
+ if (!selected)
401
+ return mismatch('ordered-particle-language', declaration, parentPath);
402
+ const content = [];
403
+ frame.into.push({ kind: 'record', declaration, payloadPath: parentPath, slots: [], attributes: matchedAttributes, content,
404
+ openAttributes,
405
+ ...(record.contextual ? { namespaces: node.namespaces } : {}),
406
+ namespaceChoices: slots.filter(slot => !record.fixedOrder && slots.some(other => other !== slot && other.element.name.local === slot.element.name.local)).map(slot => slot.element.name.local),
407
+ dynamicDeclarations: selected.filter(slot => !('value' in slot) && slot.element).map(slot => slot.element),
408
+ ...(record.keyed ? { keyed: true } : {}) });
409
+ let selectedIndex = elements.length - 1;
410
+ for (let index = node.children.length - 1; index >= 0; index--) {
411
+ check();
412
+ const child = node.children[index];
413
+ if (child.kind === 'text') {
414
+ if (record.content === 'mixed')
415
+ frames.push({ node: child, path: `${parentPath}/children/${index}`, declaration, value: frame.value, into: content });
416
+ continue;
417
+ }
418
+ const item = elements[selectedIndex], slot = selected[selectedIndex--];
419
+ if (!slot.element) {
420
+ frames.push({ node: item.node, path: item.path, declaration, value: frame.value, unassessed: true, into: content });
421
+ continue;
422
+ }
423
+ frames.push({ node: item.node, path: item.path, declaration: slot.element,
424
+ value: 'value' in slot ? slot.value : wildcardValue(slot.element), into: content });
425
+ }
426
+ continue;
427
+ }
428
+ budget.chargeWork(64 + slots.length * 128);
429
+ const matchedSlots = slots.map(slot => { check(); return { slot, items: [] }; });
430
+ frame.into.push({ kind: 'record', declaration, payloadPath: parentPath, slots: matchedSlots, attributes: matchedAttributes,
431
+ openAttributes,
432
+ ...(record.contextual ? { namespaces: node.namespaces } : {}) });
433
+ const children = [];
197
434
  let cursor = 0, count = 0;
198
- for (let index = 0; index < owned.children.length; index++) {
435
+ for (let index = 0; index < node.children.length; index++) {
199
436
  check();
200
- const child = owned.children[index];
437
+ const child = node.children[index];
201
438
  budget.chargeWork(64);
202
- const path = `/0/children/${index}`;
439
+ const path = `${parentPath}/children/${index}`;
203
440
  if (child.kind === 'text') {
204
441
  budget.chargeWork(child.value.length * 2);
205
442
  if (/[^\t\r\n ]/.test(child.value))
206
- return mismatch('complex-text', root.element, path);
443
+ return mismatch('complex-text', declaration, path);
207
444
  continue;
208
445
  }
209
446
  while (cursor < slots.length && !same(child.name, slots[cursor].element.name)) {
@@ -216,27 +453,81 @@ export function matchDirectOperation(contract, direction, payload, options = {})
216
453
  }
217
454
  const slot = slots[cursor];
218
455
  if (!slot)
219
- return mismatch('unexpected-child', root.element, path);
456
+ return mismatch('unexpected-child', declaration, path);
220
457
  if (slot.particle.occurs.max === '1' && count === 1)
221
458
  return mismatch('duplicate-singleton', slot.element, path);
222
- leaf(child, slot.element, slot.builtin, path);
459
+ children.push({ node: child, declaration: slot.element, value: slot.value, path, into: matchedSlots[cursor].items });
223
460
  count++;
224
461
  }
225
462
  for (; cursor < slots.length; cursor++, count = 0) {
226
463
  check();
227
464
  const slot = slots[cursor];
228
465
  if (slot.particle.occurs.min === '1' && count === 0)
229
- return mismatch('missing-required', slot.element, '/0/end');
466
+ return mismatch('missing-required', slot.element, `${parentPath}/end`);
467
+ }
468
+ // @why Preserve document order and record boundaries without recursive JS calls.
469
+ for (let i = children.length - 1; i >= 0; i--) {
470
+ check();
471
+ frames.push(children[i]);
230
472
  }
231
473
  }
232
474
  check();
233
475
  budget.chargeWork(512);
234
- const result = { kind: 'structural-match', scope: 'structure-only', scalarValidity: 'unassessed', admitted: false,
235
- root, contextId: context.contextId, direction: ownedDirection, occurrences, usage: { ...budget.usage() } };
476
+ const result = { kind: 'projection-match', scope: 'structure-only', scalarValidity: 'unassessed', admitted: false,
477
+ root, contextId: context.contextId, tree: roots[0], occurrences, usage: { ...budget.usage() } };
236
478
  budget.freeze(result);
237
479
  check();
238
480
  // Capture final accounting after publication traversal; the record is already reserved.
239
481
  const published = Object.freeze({ ...result, usage: Object.freeze({ ...budget.usage() }) });
482
+ projectionIssued.set(published, context);
483
+ return published;
484
+ });
485
+ return guarded.kind === 'resource-limit' ? Object.freeze({ kind: 'resource-limit', rule: 'request-budget', usage: budget.usage() }) : guarded;
486
+ }
487
+ catch (error) {
488
+ if (budget.exhausted())
489
+ return Object.freeze({ kind: 'resource-limit', rule: 'request-budget', usage: budget.usage() });
490
+ if (error instanceof Stop)
491
+ return Object.freeze({ kind: error.kind, rule: error.rule, schemaPath: error.schemaPath, payloadPath: error.payloadPath, usage: Object.freeze({ ...budget.usage() }) });
492
+ throw error;
493
+ }
494
+ }
495
+ /** Operation-owned flat preview wrapper; structured projection matches cannot bypass this gate. */
496
+ export function matchDirectOperation(contract, direction, payload, options = {}) {
497
+ const { context } = inspectDirectOperation(contract);
498
+ const { budget } = context;
499
+ try {
500
+ const guarded = budget.guard(() => {
501
+ const supplied = budget.snapshot(direction);
502
+ if (!supplied || typeof supplied !== 'object' || Array.isArray(supplied))
503
+ throw new TypeError('Direct direction requires a data-only record');
504
+ if (!['input', 'output', 'fault'].includes(supplied.kind))
505
+ throw new Stop('unsupported', 'unknown-direction');
506
+ const ownedDirection = supplied.kind === 'fault' ? { kind: 'fault', name: supplied.name } : { kind: supplied.kind };
507
+ let root;
508
+ if (ownedDirection.kind === 'fault') {
509
+ budget.chargeWork(64 + contract.faults.length * 32);
510
+ if (typeof ownedDirection.name !== 'string')
511
+ throw new Stop('unsupported', 'unknown-fault');
512
+ const selected = contract.faults.find(fault => budget.compareText(fault.name, ownedDirection.name) === 0);
513
+ if (!selected)
514
+ throw new Stop('unsupported', 'unknown-fault');
515
+ root = selected.root;
516
+ }
517
+ else
518
+ root = contract[ownedDirection.kind];
519
+ const matched = matchDirectProjection(context, root.element, payload, { ...options, flatOnly: true });
520
+ if (matched.kind !== 'projection-match')
521
+ return matched;
522
+ inspectProjectionStructuralMatch(matched, context);
523
+ budget.chargeWork(512);
524
+ const result = { kind: 'structural-match', scope: matched.scope, scalarValidity: matched.scalarValidity, admitted: false,
525
+ root, contextId: context.contextId, direction: ownedDirection, occurrences: matched.occurrences, tree: matched.tree, usage: { ...budget.usage() } };
526
+ budget.freeze(result);
527
+ budget.chargeWork();
528
+ if (options.signal?.aborted)
529
+ throw new Stop('cancelled', 'cooperative-cancellation');
530
+ const published = Object.freeze({ ...result, usage: Object.freeze({ ...budget.usage() }) });
240
531
  issued.set(published, contract);
241
532
  return published;
242
533
  });
@@ -1,8 +1,11 @@
1
1
  /** Single native direct slot interpretation shared by matching and value mapping. */
2
2
  import type { DirectMessageRoot } from './directOperation.js';
3
3
  import type { SemanticContext } from './semanticContext.js';
4
- import type { ElementNode, ParticleNode } from './canonicalGraph.js';
4
+ import type { AttributeNode, ComplexTypeNode, ElementNode, NodeId, ParticleNode } from './canonicalGraph.js';
5
5
  import type { ExpandedName } from '../loader/orderedSyntax.js';
6
+ import type { ProjectionScalarList } from './projectionScalar.js';
7
+ import type { SemanticParticle, SemanticParticleView } from './particleSemanticView.js';
8
+ import type { AttributeWildcard } from './schemaAttributeUses.js';
6
9
  export interface DirectSlot {
7
10
  readonly element: ElementNode;
8
11
  readonly particle: ParticleNode;
@@ -12,5 +15,135 @@ export interface DirectRootPlan {
12
15
  readonly rootBuiltin?: ExpandedName;
13
16
  readonly slots: readonly DirectSlot[];
14
17
  }
18
+ export type DirectProjectionValue = Readonly<({
19
+ kind: 'scalar';
20
+ builtin: ExpandedName;
21
+ declared?: true;
22
+ retainLexical?: true;
23
+ list?: ProjectionScalarList;
24
+ } | {
25
+ kind: 'record';
26
+ type: NodeId;
27
+ }) & {
28
+ nillable?: true;
29
+ constraint?: Readonly<{
30
+ kind: 'fixed' | 'default';
31
+ lexical: string;
32
+ canonical: string;
33
+ }>;
34
+ }>;
35
+ export interface DirectProjectionSlot {
36
+ readonly element: ElementNode;
37
+ readonly particle: ParticleNode;
38
+ readonly value: DirectProjectionValue;
39
+ }
40
+ export interface DirectProjectionAttribute {
41
+ readonly bag?: true;
42
+ readonly declaration: AttributeNode;
43
+ readonly required: boolean;
44
+ readonly builtin: ExpandedName;
45
+ readonly constraint?: Readonly<{
46
+ kind: 'fixed' | 'default';
47
+ lexical: string;
48
+ canonical: string;
49
+ }>;
50
+ readonly retainLexical?: true;
51
+ readonly list?: ProjectionScalarList;
52
+ }
53
+ export interface DirectProjectionRecord {
54
+ readonly type: ComplexTypeNode;
55
+ readonly slots: readonly DirectProjectionSlot[];
56
+ readonly attributes: readonly DirectProjectionAttribute[];
57
+ readonly content: 'empty' | 'element-only' | 'simple' | 'mixed';
58
+ readonly text?: Extract<DirectProjectionValue, {
59
+ kind: 'scalar';
60
+ }>;
61
+ readonly keyed?: true;
62
+ readonly fixedOrder?: true;
63
+ readonly contextual?: true;
64
+ readonly attributeWildcard?: AttributeWildcard;
65
+ readonly ordered?: true;
66
+ }
67
+ export type DirectProjectionSelection = DirectProjectionSlot | Readonly<{
68
+ kind: 'wildcard';
69
+ element?: ElementNode;
70
+ particle: ParticleNode;
71
+ }>;
72
+ /** Inspect source particles only after authenticating their projection owner. */
73
+ export declare function inspectProjectionGrammar(context: SemanticContext, record: DirectProjectionRecord): Readonly<{
74
+ view: SemanticParticleView;
75
+ first(particle: SemanticParticle): readonly string[];
76
+ bodyNullable(particle: SemanticParticle): boolean;
77
+ slot(key: string): DirectProjectionSlot | undefined;
78
+ }> | undefined;
79
+ /** Match ordered children using authenticated native particles, without granting source or operation admission.
80
+ * @constraints Leaf alphabets must be disjoint; native strict/lax/skip policy selects declaration assessment or unassessed preservation.
81
+ * @returns Source-owned slots in document order, or undefined when the child sequence is outside the particle language.
82
+ * @throws TypeError For an unauthenticated record or foreign context.
83
+ */
84
+ export declare function matchOrderedProjection(context: SemanticContext, record: DirectProjectionRecord, names: readonly ExpandedName[], check: () => void): readonly DirectProjectionSelection[] | undefined;
85
+ /** Resolve a policy-assessed wildcard declaration, never from a caller-supplied type or companion-name guess.
86
+ * @returns The source declaration, or undefined for an excluded namespace, missing declaration or incomplete universe.
87
+ * @throws TypeError For copied/foreign projection records.
88
+ */
89
+ export declare function resolveProjectionWildcard(context: SemanticContext, record: DirectProjectionRecord, name: ExpandedName, check: () => void): ElementNode | undefined;
90
+ /** Select native application wildcard policy from the authenticated particle, without payload-driven schema acquisition.
91
+ * @param context Exact source context owning the record.
92
+ * @param record Authenticated projection record.
93
+ * @param name Actual expanded payload identity.
94
+ * @param check Budget and cancellation checkpoint.
95
+ * @returns Declaration assessment, an unassessed native policy selection, or no match.
96
+ * @throws TypeError For a foreign or copied record.
97
+ */
98
+ export declare function selectProjectionWildcard(context: SemanticContext, record: DirectProjectionRecord, name: ExpandedName, check: () => void): Readonly<{
99
+ element?: ElementNode;
100
+ }> | undefined;
101
+ export interface DirectProjectionPlan {
102
+ readonly root: DirectProjectionValue;
103
+ readonly records: readonly DirectProjectionRecord[];
104
+ }
105
+ /** Inspect wildcard presence on an exact ordered plan; this describes existing grammar, never adds admission. */
106
+ export declare function inspectOrderedProjectionWildcards(context: SemanticContext, record: DirectProjectionRecord): boolean;
107
+ /** Inspect whether every wildcard on an authenticated ordered record requires unassessed preservation. */
108
+ export declare function inspectUnassessedProjectionWildcards(context: SemanticContext, record: DirectProjectionRecord): boolean;
109
+ /** Capability diagnostic only; this record neither proves schema invalidity nor grants admission. */
110
+ export interface DirectProjectionUnavailable {
111
+ readonly rule: string;
112
+ readonly component: NodeId;
113
+ readonly schemaPath: string;
114
+ }
115
+ /** JSON representation policy only; native datatype calculations decide lexical/value validity. */
116
+ export declare function projectionScalarRepresentation(name: ExpandedName): 'string' | 'number' | 'boolean' | undefined;
117
+ /** Test projected XML 1.0 character data without interpreting lexical application strings. */
118
+ export declare const isXmlCharacters: (value: string) => boolean;
119
+ /** Check a projected Namespaces 1.0 binding; the empty key denotes the default namespace. */
120
+ export declare const isXmlNamespaceBinding: (prefix: string, namespace: string) => boolean;
121
+ /** Resolve and plan an application attribute permitted by the source wildcard.
122
+ * @param context Exact source context.
123
+ * @param record Source-derived record containing the native attribute policy.
124
+ * @param name Expanded payload attribute identity.
125
+ * @param check Budget and cancellation checkpoint.
126
+ * @param unsupported Existing diagnostic owner for unavailable native scalar duties.
127
+ * @returns A typed declaration, unassessed lexical selection, or no policy match.
128
+ * @throws TypeError For a non-actual context.
129
+ */
130
+ export declare function selectProjectionAttribute(context: SemanticContext, record: DirectProjectionRecord, name: ExpandedName, check: () => void, unsupported: () => never): Readonly<{
131
+ attribute?: DirectProjectionAttribute;
132
+ }> | undefined;
133
+ /**
134
+ * Derive record structure using native component identity, including anonymous scopes and recursion.
135
+ * @remarks This is a projection plan, not source validity, correspondence or runtime admission.
136
+ * Effective sequences and known attributes of explicitly represented builtin scalars are supported.
137
+ * Exact numeric families and temporal/binary values use strings; QName and document-wide ID/ENTITY duties are outside this plan.
138
+ * Inheritance is read from native content and attribute owners; only unit sequence groups flatten into peer properties.
139
+ * Other represented particles retain ordered children in $content; disjoint element/wildcard alphabets are required.
140
+ * Source-selected keyed content and attribute fallback preserve mixed text and local-name collisions.
141
+ * Native wildcard policies select known declaration duties or lexical preservation; retained scopes propagate through known intermediates.
142
+ * Native default/fixed values are explicit XML-assessment augmentation, never a missing required application field.
143
+ * The checked-direct preview adapter below retains its flat-only grammar.
144
+ */
145
+ export declare function planDirectProjection(context: SemanticContext, root: ElementNode, check: () => void, unsupported: (detail?: DirectProjectionUnavailable) => never): DirectProjectionPlan;
146
+ /** Adapt the native projection to the supported flat preview without widening admission. */
15
147
  export declare function planDirectRoot(context: SemanticContext, root: DirectMessageRoot, check: () => void, unsupported: () => never): DirectRootPlan;
16
- //# sourceMappingURL=directStructurePlan.d.ts.map
148
+ /** Flat-only projection adapter; its input is derived data, never native admission. */
149
+ export declare function flatDirectProjection(plan: DirectProjectionPlan, check: () => void, unsupported: () => never): DirectRootPlan;