@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,581 @@
1
+ import { XML_NAME_RANGES } from '../loader/orderedSyntax.js';
2
+ import { schemaRegularLanguages } from './schemaRegularLanguage.js';
3
+ export function schemaPatterns(c) { return createSchemaPatterns(c, false); }
4
+ /** Closed assessment-schema consumer; this does not widen the application profile. */
5
+ export function fixedS4SPatterns(c) { return createSchemaPatterns(c, true); }
6
+ /** Private original builtin facet-component consumer; caller patterns keep their profile. */
7
+ export function intrinsicBuiltinPatterns(c) { return createSchemaPatterns(c, true, true); }
8
+ function createSchemaPatterns(c, fixedSchemaNames, intrinsicNames = false) {
9
+ // Separate privately captured records: mutating an exposed plan cannot
10
+ // manufacture literal-language authority or alter these compiled facts.
11
+ const literalPrograms = new WeakMap();
12
+ const regular = schemaRegularLanguages(c), regularPrograms = new WeakMap();
13
+ const compile = (lexical, owner) => {
14
+ c.text(lexical.value, owner);
15
+ const source = lexical.value, atoms = [], literals = [];
16
+ const add = (atom, literal, explicitClass = false) => {
17
+ c.step(owner, 3 + (atom.kind === 'sequence' || atom.kind === 'choice' ? atom.children.length : 0));
18
+ atoms.push(atom);
19
+ literals.push(atom.kind === 'character' ? literal === undefined
20
+ ? explicitClass ? { kind: 'class', expression: atom.expression } : { kind: 'outside' }
21
+ : { kind: 'literal', value: literal }
22
+ : atom.kind === 'repeat' ? { ...atom } : { kind: atom.kind, children: [...atom.children] });
23
+ return atoms.length - 1;
24
+ };
25
+ const invalid = () => c.fail(owner, "pattern-valid-restriction", "Malformed XSD regular expression", lexical.context.source);
26
+ const unsupported = () => c.unsupported(owner, "pattern-subset", "XSD regex construct requires a separately evidenced equivalent implementation", lexical.context.source);
27
+ let i = 0, escapedLiteral;
28
+ const escaped = (inClass = false) => {
29
+ escapedLiteral = undefined;
30
+ i++;
31
+ const char = source[i++];
32
+ if (char === undefined)
33
+ return invalid();
34
+ if (char === "n") {
35
+ escapedLiteral = '\n';
36
+ return "\\n";
37
+ }
38
+ if (char === "r") {
39
+ escapedLiteral = '\r';
40
+ return "\\r";
41
+ }
42
+ if (char === "t") {
43
+ escapedLiteral = '\t';
44
+ return "\\t";
45
+ }
46
+ if ("\\|.-^?*+{}()[]".includes(char)) {
47
+ escapedLiteral = char;
48
+ return char === '-' && !inClass ? '-' : `\\${char}`;
49
+ }
50
+ if (char === "s")
51
+ return "[ \\t\\n\\r]";
52
+ if (char === "S")
53
+ return "[^ \\t\\n\\r]";
54
+ if (char === "d")
55
+ return "\\p{Nd}";
56
+ if (char === "D")
57
+ return "\\P{Nd}";
58
+ if (char === "p" || char === "P") {
59
+ if (source[i++] !== "{")
60
+ return invalid();
61
+ const start = i;
62
+ while (i < source.length && source[i] !== "}") {
63
+ c.step(owner);
64
+ i++;
65
+ }
66
+ if (source[i++] !== "}")
67
+ return invalid();
68
+ const category = source.slice(start, i - 1);
69
+ if (category.startsWith("Is"))
70
+ return unsupported();
71
+ if (!/^(?:L[ultmo]?|M[nce]?|N[dlo]?|P[cdseifo]?|Z[slp]?|S[mcko]?|C[cfon]?)$/.test(category))
72
+ return invalid();
73
+ return `\\${char}{${category}}`;
74
+ }
75
+ if ("iIcC".includes(char)) {
76
+ if (!fixedSchemaNames)
77
+ return unsupported();
78
+ const range = char === 'i' || char === 'I' ? XML_NAME_RANGES.start : XML_NAME_RANGES.character;
79
+ c.step(owner, range.length + 3);
80
+ return `[${char === 'I' || char === 'C' ? '^' : ''}${range}]`;
81
+ }
82
+ if ("wW".includes(char))
83
+ return unsupported();
84
+ return invalid();
85
+ };
86
+ const characterClass = () => {
87
+ if (intrinsicNames) {
88
+ c.step(owner, 20);
89
+ const start = source.startsWith("[\\i-[:]]", i), character = source.startsWith("[\\c-[:]]", i);
90
+ if (start || character) {
91
+ const range = start ? XML_NAME_RANGES.start : XML_NAME_RANGES.character;
92
+ c.step(owner, range.length + 12);
93
+ i += 8;
94
+ return `(?!:)[${range}]`;
95
+ }
96
+ }
97
+ i++;
98
+ let body = "", negative = false;
99
+ if (source[i] === "^") {
100
+ negative = true;
101
+ i++;
102
+ }
103
+ let count = 0, canEndRange = false, rangeEnd = false;
104
+ while (i < source.length && source[i] !== "]") {
105
+ c.step(owner);
106
+ const char = source[i];
107
+ if (char === "[" || char === "-" && source[i + 1] === "[")
108
+ return unsupported();
109
+ if (char === "-") {
110
+ if (count === 0 || source[i + 1] === "]") {
111
+ body += "\\-";
112
+ i++;
113
+ count++;
114
+ canEndRange = false;
115
+ continue;
116
+ }
117
+ if (!canEndRange || rangeEnd)
118
+ return invalid();
119
+ body += "-";
120
+ i++;
121
+ canEndRange = false;
122
+ rangeEnd = true;
123
+ continue;
124
+ }
125
+ if (char === "\\") {
126
+ const escape = escaped(true);
127
+ // Nested character-class escapes need set algebra. Do not copy a
128
+ // non-equivalent ECMAScript class into a verified plan.
129
+ if (escape.startsWith("["))
130
+ return unsupported();
131
+ if (rangeEnd && /\\[pP]\{/.test(escape))
132
+ return invalid();
133
+ body += escape;
134
+ canEndRange = !/\\[pP]\{/.test(escape) && !rangeEnd;
135
+ }
136
+ else {
137
+ const point = source.codePointAt(i), literal = String.fromCodePoint(point);
138
+ body += literal === "^" ? "\\^" : literal;
139
+ i += point > 0xffff ? 2 : 1;
140
+ canEndRange = !rangeEnd;
141
+ }
142
+ if (rangeEnd) {
143
+ rangeEnd = false;
144
+ canEndRange = false;
145
+ }
146
+ count++;
147
+ }
148
+ if (!count || source[i++] !== "]")
149
+ return invalid();
150
+ const result = `[${negative ? "^" : ""}${body}]`;
151
+ c.text(result, owner);
152
+ try {
153
+ new RegExp(result, "u");
154
+ }
155
+ catch {
156
+ return invalid();
157
+ }
158
+ return result;
159
+ };
160
+ const frames = [{ branches: [], pieces: [] }];
161
+ const closeBranch = (frame) => { c.step(owner, frame.pieces.length); frame.branches.push(add({ kind: "sequence", children: frame.pieces })); frame.pieces = []; };
162
+ const quantified = (atom) => {
163
+ const char = source[i];
164
+ let min = "1", max = "1";
165
+ if (char === "?" || char === "*" || char === "+") {
166
+ i++;
167
+ min = char === "+" ? "1" : "0";
168
+ max = char === "?" ? "1" : "unbounded";
169
+ }
170
+ else if (char === "{") {
171
+ i++;
172
+ const start = i;
173
+ while (/\d/.test(source[i] ?? "") && i < source.length) {
174
+ c.step(owner);
175
+ i++;
176
+ }
177
+ if (i === start)
178
+ return invalid();
179
+ min = source.slice(start, i).replace(/^0+(?=\d)/, "");
180
+ max = min;
181
+ if (source[i] === ",") {
182
+ i++;
183
+ const next = i;
184
+ while (/\d/.test(source[i] ?? "") && i < source.length) {
185
+ c.step(owner);
186
+ i++;
187
+ }
188
+ max = next === i ? "unbounded" : source.slice(next, i).replace(/^0+(?=\d)/, "");
189
+ }
190
+ if (source[i++] !== "}")
191
+ return invalid();
192
+ if (c.algebra.compare(min, max) > 0)
193
+ return invalid();
194
+ }
195
+ return min === "1" && max === "1" ? atom : add({ kind: "repeat", child: atom, min, max });
196
+ };
197
+ while (i < source.length) {
198
+ c.step(owner);
199
+ const frame = frames.at(-1), char = source[i];
200
+ if (char === "(") {
201
+ i++;
202
+ c.step(owner);
203
+ frames.push({ branches: [], pieces: [] });
204
+ continue;
205
+ }
206
+ if (char === "|") {
207
+ i++;
208
+ closeBranch(frame);
209
+ continue;
210
+ }
211
+ if (char === ")") {
212
+ if (frames.length === 1)
213
+ return invalid();
214
+ i++;
215
+ closeBranch(frame);
216
+ c.step(owner, frame.branches.length);
217
+ const atom = add({ kind: "choice", children: frame.branches });
218
+ frames.pop();
219
+ frames.at(-1).pieces.push(quantified(atom));
220
+ continue;
221
+ }
222
+ if ("?*+{}]".includes(char))
223
+ return invalid();
224
+ let expression, literal;
225
+ if (char === "[")
226
+ expression = characterClass();
227
+ else if (char === "\\") {
228
+ expression = escaped();
229
+ literal = escapedLiteral;
230
+ }
231
+ else if (char === ".") {
232
+ i++;
233
+ expression = "[^\\r\\n]";
234
+ }
235
+ else {
236
+ const point = source.codePointAt(i);
237
+ i += point > 0xffff ? 2 : 1;
238
+ literal = String.fromCodePoint(point);
239
+ expression = literal.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
240
+ }
241
+ c.text(expression, owner);
242
+ frame.pieces.push(quantified(add({ kind: "character", expression }, literal, char === '[')));
243
+ }
244
+ if (frames.length !== 1)
245
+ return invalid();
246
+ closeBranch(frames[0]);
247
+ c.step(owner, frames[0].branches.length);
248
+ const root = add({ kind: "choice", children: frames[0].branches });
249
+ c.step(owner, 3);
250
+ const pattern = { language: "xsd10-whole-string", atoms, root, unicode: "code-points", runtimeOwner: "#184" };
251
+ literalPrograms.set(pattern, { atoms: literals, root, sourceLength: source.length });
252
+ c.step(owner, atoms.length * 4 + 2);
253
+ const privateAtoms = atoms.map(atom => {
254
+ if (atom.kind === 'choice' || atom.kind === 'sequence') {
255
+ c.step(owner, atom.children.length + 3);
256
+ return { ...atom, children: [...atom.children] };
257
+ }
258
+ return { ...atom };
259
+ });
260
+ regularPrograms.set(pattern, { atoms: privateAtoms, root });
261
+ return pattern;
262
+ };
263
+ /** Exact finite literal fragment, used only to propose concretely checked operands. */
264
+ const literalLanguage = (pattern, owner) => {
265
+ c.step(owner);
266
+ const program = literalPrograms.get(pattern);
267
+ if (!program)
268
+ throw new TypeError('Literal language requires a pattern issued by this factory');
269
+ c.step(owner, program.atoms.length * 2 + 2);
270
+ const finite = [], emptyOnly = [];
271
+ for (const atom of program.atoms) {
272
+ c.step(owner, 3);
273
+ let known = false, empty = false;
274
+ if (atom.kind === 'literal')
275
+ known = true;
276
+ else if (atom.kind === 'sequence' || atom.kind === 'choice') {
277
+ c.step(owner, atom.children.length * 2);
278
+ known = atom.children.every(child => finite[child]);
279
+ empty = atom.children.every(child => emptyOnly[child]);
280
+ }
281
+ else if (atom.kind === 'repeat') {
282
+ c.text(atom.max, owner);
283
+ empty = atom.max === '0' || emptyOnly[atom.child];
284
+ known = empty || atom.max !== 'unbounded' && finite[atom.child];
285
+ }
286
+ finite.push(known);
287
+ emptyOnly.push(empty);
288
+ }
289
+ if (!finite[program.root])
290
+ return { kind: 'outside-fragment' };
291
+ function* words() {
292
+ c.step(owner, 4);
293
+ const states = [{ pending: [{ kind: 'node', node: program.root }], word: '' }];
294
+ while (states.length) {
295
+ c.step(owner);
296
+ const state = states.pop();
297
+ while (state.pending.length) {
298
+ c.step(owner);
299
+ const task = state.pending.pop();
300
+ if (task.kind === 'repeat') {
301
+ c.step(owner, task.digits * 4 + 6);
302
+ if (task.max === 0n)
303
+ continue;
304
+ const next = { ...task, min: task.min > 0n ? task.min - 1n : 0n, max: task.max - 1n };
305
+ if (task.min > 0n)
306
+ state.pending.push(next, { kind: 'node', node: task.child });
307
+ else {
308
+ c.step(owner, state.pending.length + 4);
309
+ states.push({ word: state.word, pending: [...state.pending, next, { kind: 'node', node: task.child }] });
310
+ }
311
+ continue;
312
+ }
313
+ if (emptyOnly[task.node])
314
+ continue;
315
+ const atom = program.atoms[task.node];
316
+ if (atom.kind === 'literal') {
317
+ c.step(owner, state.word.length + atom.value.length + 1);
318
+ state.word += atom.value;
319
+ }
320
+ else if (atom.kind === 'sequence') {
321
+ c.step(owner, atom.children.length * 2);
322
+ for (let index = atom.children.length - 1; index >= 0; index--)
323
+ state.pending.push({ kind: 'node', node: atom.children[index] });
324
+ }
325
+ else if (atom.kind === 'choice') {
326
+ for (let index = atom.children.length - 1; index > 0; index--) {
327
+ c.step(owner, state.pending.length + 4);
328
+ states.push({ word: state.word, pending: [...state.pending, { kind: 'node', node: atom.children[index] }] });
329
+ }
330
+ c.step(owner);
331
+ state.pending.push({ kind: 'node', node: atom.children[0] });
332
+ }
333
+ else if (atom.kind === 'repeat') {
334
+ c.text(atom.min, owner);
335
+ c.text(atom.max, owner);
336
+ c.step(owner, atom.min.length * atom.min.length + atom.max.length * atom.max.length + 3);
337
+ state.pending.push({ kind: 'repeat', child: atom.child, min: BigInt(atom.min), max: BigInt(atom.max), digits: atom.max.length });
338
+ }
339
+ else
340
+ throw new TypeError('Private finite literal program contains an outside-fragment atom');
341
+ }
342
+ c.text(state.word, owner);
343
+ yield state.word;
344
+ }
345
+ }
346
+ c.step(owner);
347
+ return { kind: 'finite-literal', words: words() };
348
+ };
349
+ /** Sound proposals for the private literal/class grammar; no exhaustion claim. */
350
+ function* positiveWords(pattern, owner, hints) {
351
+ c.step(owner);
352
+ const program = literalPrograms.get(pattern);
353
+ if (!program)
354
+ throw new TypeError('Positive words require a pattern issued by this factory');
355
+ c.step(owner, 12);
356
+ let states = [{ pending: [{ kind: 'node', node: program.root }], word: '' }];
357
+ const deferred = [];
358
+ const classChoices = new Map();
359
+ const classRegexes = new Map();
360
+ const scannedClasses = new Set();
361
+ let cursor = 0, exploringClasses = false;
362
+ const enqueue = (state, tasks = [], suffix = '') => {
363
+ c.step(owner, state.pending.length + tasks.length + state.word.length + suffix.length + 8);
364
+ states.push({ pending: [...state.pending, ...tasks], word: state.word + suffix });
365
+ };
366
+ while (cursor < states.length || (!exploringClasses && deferred.length)) {
367
+ if (cursor === states.length) {
368
+ c.step(owner);
369
+ states = deferred;
370
+ cursor = 0;
371
+ exploringClasses = true;
372
+ }
373
+ c.step(owner);
374
+ const state = states[cursor];
375
+ states[cursor++] = undefined;
376
+ const task = state.pending.pop();
377
+ if (!task) {
378
+ c.text(state.word, owner);
379
+ yield state.word;
380
+ continue;
381
+ }
382
+ if (task.kind === 'repeat') {
383
+ c.step(owner, task.digits * 4 + 6);
384
+ if (task.min === 0n)
385
+ enqueue(state);
386
+ if (task.max !== 0n) {
387
+ const next = { kind: 'repeat', child: task.child,
388
+ min: task.min > 0n ? task.min - 1n : 0n, max: task.max - 1n, digits: task.digits };
389
+ enqueue(state, [next, { kind: 'node', node: task.child }]);
390
+ }
391
+ continue;
392
+ }
393
+ const atom = program.atoms[task.node];
394
+ if (atom.kind === 'literal') {
395
+ enqueue(state, [], atom.value);
396
+ continue;
397
+ }
398
+ if (atom.kind === 'class') {
399
+ let choices = classChoices.get(task.node);
400
+ if (!choices) {
401
+ c.text(atom.expression, owner);
402
+ c.step(owner, atom.expression.length + 8);
403
+ const regex = new RegExp(`^(?:${atom.expression})(?![\\s\\S])`, 'u');
404
+ classRegexes.set(task.node, regex);
405
+ c.step(owner, 4);
406
+ const found = [], seen = new Set();
407
+ for (let index = 0; index < hints.length;) {
408
+ c.step(owner, 4);
409
+ const point = hints.codePointAt(index), char = String.fromCodePoint(point);
410
+ index += char.length;
411
+ if (regex.test(char) && !seen.has(char)) {
412
+ c.step(owner, 3);
413
+ seen.add(char);
414
+ found.push(char);
415
+ }
416
+ }
417
+ // Common single-character witnesses are cheap enough to try before
418
+ // a class-free branch, even when that branch has many words.
419
+ if (!found.length)
420
+ for (let point = 0x20; point <= 0x7e; point++) {
421
+ c.step(owner, 3);
422
+ const char = String.fromCodePoint(point);
423
+ if (regex.test(char)) {
424
+ c.step(owner, 2);
425
+ found.push(char);
426
+ break;
427
+ }
428
+ }
429
+ choices = found;
430
+ c.step(owner, choices.length + 2);
431
+ classChoices.set(task.node, choices);
432
+ }
433
+ // A full Unicode scan can consume the allowance before a finite
434
+ // alternative is reached. Keep the charged state for a later pass.
435
+ if (!choices.length && !exploringClasses) {
436
+ c.step(owner, state.pending.length + state.word.length + 8);
437
+ state.pending.push(task);
438
+ deferred.push(state);
439
+ continue;
440
+ }
441
+ if (!choices.length && !scannedClasses.has(task.node)) {
442
+ const regex = classRegexes.get(task.node);
443
+ for (let point = 0x7f; point <= 0x10ffff; point++) {
444
+ c.step(owner, 3);
445
+ const char = String.fromCodePoint(point);
446
+ if (regex.test(char)) {
447
+ c.step(owner, 2);
448
+ choices = [char];
449
+ break;
450
+ }
451
+ }
452
+ scannedClasses.add(task.node);
453
+ classChoices.set(task.node, choices);
454
+ }
455
+ for (const char of choices)
456
+ enqueue(state, [], char);
457
+ continue;
458
+ }
459
+ if (atom.kind === 'sequence') {
460
+ c.step(owner, atom.children.length * 2 + 2);
461
+ const tasks = [];
462
+ for (let index = atom.children.length - 1; index >= 0; index--)
463
+ tasks.push({ kind: 'node', node: atom.children[index] });
464
+ enqueue(state, tasks);
465
+ }
466
+ else if (atom.kind === 'choice') {
467
+ c.step(owner, atom.children.length * 2 + 2);
468
+ for (const node of atom.children)
469
+ enqueue(state, [{ kind: 'node', node }]);
470
+ }
471
+ else if (atom.kind === 'repeat') {
472
+ c.text(atom.min, owner);
473
+ c.text(atom.max, owner);
474
+ c.step(owner, atom.min.length * atom.min.length + atom.max.length * atom.max.length + 3);
475
+ // This input-derived prefix is proposal scope, never a negative
476
+ // language bound. The exact assessor checks every emitted spelling.
477
+ const max = atom.max === 'unbounded'
478
+ ? BigInt(atom.min) + BigInt(program.sourceLength) + BigInt(hints.length)
479
+ : BigInt(atom.max);
480
+ enqueue(state, [{ kind: 'repeat', child: atom.child, min: BigInt(atom.min), max,
481
+ digits: Math.max(atom.min.length, atom.max.length, String(program.sourceLength).length, String(hints.length).length) + 1 }]);
482
+ }
483
+ // Other admitted characters have no producer here. Their absence is
484
+ // unresolved by the caller, never a proof that the language is empty.
485
+ }
486
+ }
487
+ // Bounded relation evaluation only for schema-declared operand literals.
488
+ // It never expands a finite repetition or runs an unbounded JS regex.
489
+ const acceptsOperand = (pattern, value, owner) => {
490
+ c.text(value, owner);
491
+ const chars = [];
492
+ for (const char of value) {
493
+ c.step(owner);
494
+ chars.push(char);
495
+ }
496
+ const relations = [];
497
+ const identity = () => {
498
+ const result = [];
499
+ for (let i = 0; i <= chars.length; i++) {
500
+ c.step(owner);
501
+ result.push(new Set([i]));
502
+ }
503
+ return result;
504
+ };
505
+ const compose = (a, b) => {
506
+ const result = [];
507
+ for (let i = 0; i < a.length; i++) {
508
+ c.step(owner);
509
+ const row = new Set();
510
+ for (const middle of a[i])
511
+ for (const end of b[middle]) {
512
+ c.step(owner);
513
+ row.add(end);
514
+ }
515
+ result.push(row);
516
+ }
517
+ return result;
518
+ };
519
+ const union = (target, source) => {
520
+ for (let i = 0; i < target.length; i++)
521
+ for (const end of source[i]) {
522
+ c.step(owner);
523
+ target[i].add(end);
524
+ }
525
+ };
526
+ for (const atom of pattern.atoms) {
527
+ c.step(owner);
528
+ let result;
529
+ if (atom.kind === "character") {
530
+ c.text(atom.expression, owner);
531
+ const character = new RegExp(`^(?:${atom.expression})(?![\\s\\S])`, "u");
532
+ result = [];
533
+ for (let i = 0; i <= chars.length; i++) {
534
+ c.step(owner);
535
+ result.push(new Set(i < chars.length && character.test(chars[i]) ? [i + 1] : []));
536
+ }
537
+ }
538
+ else if (atom.kind === "sequence") {
539
+ result = identity();
540
+ for (const child of atom.children)
541
+ result = compose(result, relations[child]);
542
+ }
543
+ else if (atom.kind === "choice") {
544
+ result = [];
545
+ for (let i = 0; i <= chars.length; i++) {
546
+ c.step(owner);
547
+ result.push(new Set());
548
+ }
549
+ for (const child of atom.children)
550
+ union(result, relations[child]);
551
+ }
552
+ else {
553
+ const child = relations[atom.child], nullable = child[0].has(0);
554
+ result = [];
555
+ for (let i = 0; i <= chars.length; i++) {
556
+ c.step(owner);
557
+ result.push(new Set());
558
+ }
559
+ let repeated = identity();
560
+ const cap = c.algebra.compare(atom.max, chars.length.toString()) < 0 ? Number(atom.max) : chars.length;
561
+ for (let count = 0; count <= cap; count++) {
562
+ c.step(owner);
563
+ if (nullable || c.algebra.compare(count.toString(), atom.min) >= 0)
564
+ union(result, repeated);
565
+ if (count !== cap)
566
+ repeated = compose(repeated, child);
567
+ }
568
+ }
569
+ relations.push(result);
570
+ }
571
+ return relations[pattern.root][0].has(chars.length);
572
+ };
573
+ const language = (pattern, owner, authority = regular) => {
574
+ c.step(owner);
575
+ const program = regularPrograms.get(pattern);
576
+ if (!program)
577
+ throw new TypeError('Regular language requires a pattern issued by this factory');
578
+ return authority.fromPattern(program.atoms, program.root, owner);
579
+ };
580
+ return { compile, acceptsOperand, literalLanguage, positiveWords, language, regular };
581
+ }
@@ -0,0 +1,66 @@
1
+ /** Finite automata over XML code points. Empty search is a complete language result. */
2
+ import type { PatternAtom } from './schemaPattern.js';
3
+ import type { SchemaPatternContext } from './schemaValueContext.js';
4
+ type Range = readonly [number, number];
5
+ export type RegularLanguage = Readonly<{
6
+ kind: 'private-regular-language';
7
+ }>;
8
+ export type RegularAutomaton = Readonly<{
9
+ states: readonly Readonly<{
10
+ accepting: boolean;
11
+ transitions: readonly Readonly<{
12
+ to: number;
13
+ lo: number;
14
+ hi: number;
15
+ }>[];
16
+ }>[];
17
+ start: number;
18
+ }>;
19
+ export declare function schemaRegularLanguages<Owner>(c: SchemaPatternContext<Owner>): {
20
+ fromPattern: (atoms: readonly PatternAtom[], root: number, owner: Owner) => RegularLanguage;
21
+ intersect: (languages: readonly RegularLanguage[], owner: Owner) => Readonly<{
22
+ kind: "private-regular-language";
23
+ }>;
24
+ union: (languages: readonly RegularLanguage[], owner: Owner) => Readonly<{
25
+ kind: "private-regular-language";
26
+ }>;
27
+ negate: (language: RegularLanguage, owner: Owner) => RegularLanguage;
28
+ witness: (language: RegularLanguage, owner: Owner) => string | undefined;
29
+ finiteWords: (language: RegularLanguage, owner: Owner) => {
30
+ kind: "infinite";
31
+ } | {
32
+ kind: "finite";
33
+ words: Generator<string>;
34
+ };
35
+ automaton: (language: RegularLanguage, owner: Owner) => RegularAutomaton;
36
+ fromAutomaton: (program: RegularAutomaton, owner: Owner) => RegularLanguage;
37
+ fromNfa: (program: Readonly<{
38
+ edges: readonly (readonly Readonly<{
39
+ to: number;
40
+ ranges?: readonly Range[];
41
+ }>[])[];
42
+ start: number;
43
+ end: number;
44
+ }>, owner: Owner) => RegularLanguage;
45
+ substitutionGraph: (count: number, start: number, end: number, labels: readonly {
46
+ from: number;
47
+ to: number;
48
+ language: RegularLanguage;
49
+ }[], owner: Owner) => RegularLanguage;
50
+ jsonStringImage: (language: RegularLanguage, owner: Owner) => RegularLanguage;
51
+ paths: (program: RegularAutomaton, starts: readonly number[], ends: ReadonlySet<number>, owner: Owner) => RegularLanguage;
52
+ quotient: (source: RegularLanguage, prefix: RegularLanguage, suffix: RegularLanguage, owner: Owner) => RegularLanguage;
53
+ reverse: (language: RegularLanguage, owner: Owner) => RegularLanguage;
54
+ concatenate: (languages: readonly RegularLanguage[], owner: Owner) => RegularLanguage;
55
+ repeat: (language: RegularLanguage, min: number, max: number | "unbounded", owner: Owner) => RegularLanguage;
56
+ whitespacePreimage: (language: RegularLanguage, mode: "preserve" | "replace" | "collapse", owner: Owner) => RegularLanguage;
57
+ whitespaceImage: (language: RegularLanguage, mode: "preserve" | "replace" | "collapse", owner: Owner) => RegularLanguage;
58
+ characterImage: (language: RegularLanguage, changes: readonly {
59
+ lo: number;
60
+ hi: number;
61
+ shift?: number;
62
+ remove?: boolean;
63
+ }[], owner: Owner) => RegularLanguage;
64
+ words: (language: RegularLanguage, owner: Owner) => Generator<string>;
65
+ };
66
+ export {};