@hyperfixi/core 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +218 -0
  3. package/dist/__test-utils__/context-builders.d.ts +42 -0
  4. package/dist/__test-utils__/error-testing.d.ts +18 -0
  5. package/dist/__test-utils__/index.d.ts +6 -0
  6. package/dist/__test-utils__/mock-types.d.ts +57 -0
  7. package/dist/__test-utils__/parser-context-mock.d.ts +7 -0
  8. package/dist/__test-utils__/parser-helpers.d.ts +38 -0
  9. package/dist/api/dom-processor.d.ts +17 -0
  10. package/dist/api/hyperscript-api.d.ts +68 -0
  11. package/dist/api/lokascript-api.d.ts +9 -0
  12. package/dist/ast-utils/analyzer.d.ts +19 -0
  13. package/dist/ast-utils/documentation.d.ts +8 -0
  14. package/dist/ast-utils/generator.d.ts +9 -0
  15. package/dist/ast-utils/index.d.ts +12 -0
  16. package/dist/ast-utils/index.js +3366 -0
  17. package/dist/ast-utils/index.mjs +3320 -0
  18. package/dist/ast-utils/interchange/from-core.d.ts +8 -0
  19. package/dist/ast-utils/interchange/index.d.ts +6 -0
  20. package/dist/ast-utils/interchange/lsp.d.ts +108 -0
  21. package/dist/ast-utils/interchange/to-core.d.ts +8 -0
  22. package/dist/ast-utils/interchange/types.d.ts +113 -0
  23. package/dist/ast-utils/query.d.ts +25 -0
  24. package/dist/ast-utils/transformer.d.ts +14 -0
  25. package/dist/ast-utils/types.d.ts +162 -0
  26. package/dist/ast-utils/visitor.d.ts +40 -0
  27. package/dist/behaviors/boosted.d.ts +29 -0
  28. package/dist/behaviors/history-swap.d.ts +24 -0
  29. package/dist/behaviors/index.d.ts +4 -0
  30. package/dist/behaviors/index.js +1149 -0
  31. package/dist/behaviors/index.mjs +1139 -0
  32. package/dist/bundle-generator/generator.d.ts +4 -0
  33. package/dist/bundle-generator/index.d.ts +6 -0
  34. package/dist/bundle-generator/index.js +2294 -0
  35. package/dist/bundle-generator/index.mjs +2271 -0
  36. package/dist/bundle-generator/parser-templates.d.ts +6 -0
  37. package/dist/bundle-generator/template-capabilities.d.ts +10 -0
  38. package/dist/bundle-generator/templates.d.ts +11 -0
  39. package/dist/bundle-generator/types.d.ts +34 -0
  40. package/dist/bundles/test-minimal.d.ts +3 -0
  41. package/dist/bundles/test-standard.d.ts +3 -0
  42. package/dist/chunks/bridge-I6ceoWxV.js +2 -0
  43. package/dist/chunks/browser-modular-Dv6PAV3c.js +2 -0
  44. package/dist/chunks/feature-eventsource-DWb514fy.js +2 -0
  45. package/dist/chunks/feature-sockets-3PFuvCVY.js +2 -0
  46. package/dist/chunks/feature-webworker-DTm_eh-E.js +2 -0
  47. package/dist/commands/advanced/async.d.ts +28 -0
  48. package/dist/commands/advanced/js.d.ts +28 -0
  49. package/dist/commands/animation/measure.d.ts +31 -0
  50. package/dist/commands/animation/settle.d.ts +26 -0
  51. package/dist/commands/animation/take.d.ts +28 -0
  52. package/dist/commands/animation/transition.d.ts +31 -0
  53. package/dist/commands/async/fetch.d.ts +44 -0
  54. package/dist/commands/async/wait.d.ts +41 -0
  55. package/dist/commands/behaviors/install.d.ts +41 -0
  56. package/dist/commands/content/append.d.ts +27 -0
  57. package/dist/commands/control-flow/break.d.ts +15 -0
  58. package/dist/commands/control-flow/continue.d.ts +15 -0
  59. package/dist/commands/control-flow/exit.d.ts +15 -0
  60. package/dist/commands/control-flow/halt.d.ts +25 -0
  61. package/dist/commands/control-flow/if.d.ts +45 -0
  62. package/dist/commands/control-flow/repeat.d.ts +35 -0
  63. package/dist/commands/control-flow/return.d.ts +23 -0
  64. package/dist/commands/control-flow/signal-base.d.ts +25 -0
  65. package/dist/commands/control-flow/throw.d.ts +22 -0
  66. package/dist/commands/control-flow/unless.d.ts +3 -0
  67. package/dist/commands/data/decrement.d.ts +3 -0
  68. package/dist/commands/data/default.d.ts +31 -0
  69. package/dist/commands/data/get.d.ts +23 -0
  70. package/dist/commands/data/increment.d.ts +25 -0
  71. package/dist/commands/data/set.d.ts +56 -0
  72. package/dist/commands/decorators/index.d.ts +30 -0
  73. package/dist/commands/dom/__tests__/add-standalone-helpers.d.ts +11 -0
  74. package/dist/commands/dom/add.d.ts +31 -0
  75. package/dist/commands/dom/dom-modification-base.d.ts +48 -0
  76. package/dist/commands/dom/hide.d.ts +12 -0
  77. package/dist/commands/dom/make.d.ts +21 -0
  78. package/dist/commands/dom/process-partials.d.ts +39 -0
  79. package/dist/commands/dom/put.d.ts +31 -0
  80. package/dist/commands/dom/remove.d.ts +33 -0
  81. package/dist/commands/dom/show.d.ts +13 -0
  82. package/dist/commands/dom/swap.d.ts +38 -0
  83. package/dist/commands/dom/toggle.d.ts +55 -0
  84. package/dist/commands/dom/visibility-base.d.ts +20 -0
  85. package/dist/commands/events/send.d.ts +3 -0
  86. package/dist/commands/events/trigger.d.ts +36 -0
  87. package/dist/commands/execution/call.d.ts +24 -0
  88. package/dist/commands/execution/pseudo-command.d.ts +42 -0
  89. package/dist/commands/helpers/attribute-manipulation.d.ts +11 -0
  90. package/dist/commands/helpers/batch-dom-operations.d.ts +12 -0
  91. package/dist/commands/helpers/class-manipulation.d.ts +11 -0
  92. package/dist/commands/helpers/condition-helpers.d.ts +4 -0
  93. package/dist/commands/helpers/dom-mutation.d.ts +15 -0
  94. package/dist/commands/helpers/duration-parsing.d.ts +8 -0
  95. package/dist/commands/helpers/element-property-access.d.ts +7 -0
  96. package/dist/commands/helpers/element-resolution.d.ts +17 -0
  97. package/dist/commands/helpers/error-helpers.d.ts +17 -0
  98. package/dist/commands/helpers/event-helpers.d.ts +13 -0
  99. package/dist/commands/helpers/event-waiting.d.ts +37 -0
  100. package/dist/commands/helpers/index.d.ts +32 -0
  101. package/dist/commands/helpers/input-validator.d.ts +23 -0
  102. package/dist/commands/helpers/loop-executor.d.ts +53 -0
  103. package/dist/commands/helpers/numeric-target-parser.d.ts +14 -0
  104. package/dist/commands/helpers/property-target.d.ts +30 -0
  105. package/dist/commands/helpers/selector-type-detection.d.ts +24 -0
  106. package/dist/commands/helpers/smart-element.d.ts +16 -0
  107. package/dist/commands/helpers/style-manipulation.d.ts +16 -0
  108. package/dist/commands/helpers/temporal-modifiers.d.ts +15 -0
  109. package/dist/commands/helpers/url-argument-parser.d.ts +10 -0
  110. package/dist/commands/helpers/url-validation.d.ts +7 -0
  111. package/dist/commands/helpers/variable-access.d.ts +10 -0
  112. package/dist/commands/helpers/visibility-target-parser.d.ts +11 -0
  113. package/dist/commands/index.d.ts +139 -0
  114. package/dist/commands/index.js +9186 -0
  115. package/dist/commands/index.mjs +9032 -0
  116. package/dist/commands/navigation/go.d.ts +35 -0
  117. package/dist/commands/navigation/push-url.d.ts +35 -0
  118. package/dist/commands/navigation/replace-url.d.ts +3 -0
  119. package/dist/commands/templates/render.d.ts +48 -0
  120. package/dist/commands/utility/beep.d.ts +32 -0
  121. package/dist/commands/utility/copy.d.ts +29 -0
  122. package/dist/commands/utility/log.d.ts +24 -0
  123. package/dist/commands/utility/pick.d.ts +26 -0
  124. package/dist/commands/utility/tell.d.ts +26 -0
  125. package/dist/compatibility/browser-bundle-animation-generated.d.ts +16 -0
  126. package/dist/compatibility/browser-bundle-classic-i18n.d.ts +63 -0
  127. package/dist/compatibility/browser-bundle-classic.d.ts +17 -0
  128. package/dist/compatibility/browser-bundle-forms-generated.d.ts +16 -0
  129. package/dist/compatibility/browser-bundle-hybrid-complete.d.ts +28 -0
  130. package/dist/compatibility/browser-bundle-hybrid-hx.d.ts +43 -0
  131. package/dist/compatibility/browser-bundle-lite-plus.d.ts +25 -0
  132. package/dist/compatibility/browser-bundle-lite.d.ts +23 -0
  133. package/dist/compatibility/browser-bundle-minimal-generated.d.ts +16 -0
  134. package/dist/compatibility/browser-bundle-minimal-v2.d.ts +17 -0
  135. package/dist/compatibility/browser-bundle-minimal.d.ts +8 -0
  136. package/dist/compatibility/browser-bundle-modular.d.ts +18 -0
  137. package/dist/compatibility/browser-bundle-multilingual.d.ts +19 -0
  138. package/dist/compatibility/browser-bundle-semantic-complete.d.ts +24 -0
  139. package/dist/compatibility/browser-bundle-standard-v2.d.ts +17 -0
  140. package/dist/compatibility/browser-bundle-standard.d.ts +8 -0
  141. package/dist/compatibility/browser-bundle-textshelf-minimal.d.ts +16 -0
  142. package/dist/compatibility/browser-bundle-textshelf-profile.d.ts +18 -0
  143. package/dist/compatibility/browser-bundle.d.ts +140 -0
  144. package/dist/compatibility/browser-modular.d.ts +53 -0
  145. package/dist/compatibility/browser-tests/test-utils.d.ts +21 -0
  146. package/dist/compatibility/eval-hyperscript.d.ts +15 -0
  147. package/dist/compatibility/feature-loader.d.ts +8 -0
  148. package/dist/compatibility/hyperscript-adapter.d.ts +38 -0
  149. package/dist/compatibility/hyperscript-tests/test-adapter.d.ts +13 -0
  150. package/dist/core/ast-property-utils.d.ts +2 -0
  151. package/dist/core/base-expression-evaluator.d.ts +70 -0
  152. package/dist/core/binary-expression-evaluator.d.ts +7 -0
  153. package/dist/core/call-expression-evaluator.d.ts +7 -0
  154. package/dist/core/configurable-expression-evaluator.d.ts +5 -0
  155. package/dist/core/context.d.ts +15 -0
  156. package/dist/core/dom.d.ts +15 -0
  157. package/dist/core/evaluator-types.d.ts +5 -0
  158. package/dist/core/events.d.ts +48 -0
  159. package/dist/core/executor.d.ts +34 -0
  160. package/dist/core/expression-evaluator.d.ts +6 -0
  161. package/dist/core/lazy-expression-evaluator.d.ts +22 -0
  162. package/dist/core/parser.d.ts +21 -0
  163. package/dist/core/selector-evaluator.d.ts +15 -0
  164. package/dist/core/template-literal-evaluator.d.ts +5 -0
  165. package/dist/dom/attribute-processor.d.ts +40 -0
  166. package/dist/dom/minimal-attribute-processor.d.ts +20 -0
  167. package/dist/experimental/binary-tree/accessor.d.ts +10 -0
  168. package/dist/experimental/binary-tree/ast-serializer.d.ts +26 -0
  169. package/dist/experimental/binary-tree/benchmark.d.ts +24 -0
  170. package/dist/experimental/binary-tree/buffer-context.d.ts +27 -0
  171. package/dist/experimental/binary-tree/deserializer.d.ts +17 -0
  172. package/dist/experimental/binary-tree/index.d.ts +22 -0
  173. package/dist/experimental/binary-tree/serializer.d.ts +4 -0
  174. package/dist/experimental/binary-tree/types.d.ts +54 -0
  175. package/dist/expressions/base-expression.d.ts +27 -0
  176. package/dist/expressions/bundles/common-expressions.d.ts +9 -0
  177. package/dist/expressions/bundles/core-expressions.d.ts +7 -0
  178. package/dist/expressions/bundles/full-expressions.d.ts +10 -0
  179. package/dist/expressions/bundles/index.d.ts +7 -0
  180. package/dist/expressions/comparison/index.d.ts +80 -0
  181. package/dist/expressions/comparison/utils.d.ts +2 -0
  182. package/dist/expressions/conversion/impl/bridge.d.ts +117 -0
  183. package/dist/expressions/conversion/impl/index.d.ts +59 -0
  184. package/dist/expressions/conversion/index.d.ts +23 -0
  185. package/dist/expressions/expression-tiers.d.ts +13 -0
  186. package/dist/expressions/index.d.ts +11 -0
  187. package/dist/expressions/index.js +6930 -0
  188. package/dist/expressions/index.mjs +6912 -0
  189. package/dist/expressions/logical/impl/index.d.ts +54 -0
  190. package/dist/expressions/logical/impl/pattern-matching.d.ts +58 -0
  191. package/dist/expressions/logical/index.d.ts +59 -0
  192. package/dist/expressions/mathematical/index.d.ts +69 -0
  193. package/dist/expressions/positional/impl/bridge.d.ts +95 -0
  194. package/dist/expressions/positional/impl/index.d.ts +73 -0
  195. package/dist/expressions/positional/index.d.ts +26 -0
  196. package/dist/expressions/properties/impl/index.d.ts +105 -0
  197. package/dist/expressions/properties/index.d.ts +26 -0
  198. package/dist/expressions/property/index.d.ts +55 -0
  199. package/dist/expressions/property-access-utils.d.ts +23 -0
  200. package/dist/expressions/references/impl/bridge.d.ts +54 -0
  201. package/dist/expressions/references/impl/index.d.ts +65 -0
  202. package/dist/expressions/references/index.d.ts +40 -0
  203. package/dist/expressions/shared/comparison-utils.d.ts +10 -0
  204. package/dist/expressions/shared/index.d.ts +9 -0
  205. package/dist/expressions/shared/number-utils.d.ts +7 -0
  206. package/dist/expressions/shared/validation-utils.d.ts +13 -0
  207. package/dist/expressions/special/index.d.ts +104 -0
  208. package/dist/expressions/type-helpers.d.ts +11 -0
  209. package/dist/expressions/type-registry.d.ts +57 -0
  210. package/dist/expressions/validation-helpers.d.ts +15 -0
  211. package/dist/extensions/index.d.ts +3 -0
  212. package/dist/extensions/tailwind.d.ts +22 -0
  213. package/dist/features/behaviors.d.ts +153 -0
  214. package/dist/features/def.d.ts +135 -0
  215. package/dist/features/eventsource.d.ts +140 -0
  216. package/dist/features/init.d.ts +135 -0
  217. package/dist/features/on.d.ts +131 -0
  218. package/dist/features/predefined-behaviors/dropdown-behavior.d.ts +20 -0
  219. package/dist/features/predefined-behaviors/index.d.ts +12 -0
  220. package/dist/features/predefined-behaviors/modal-behavior.d.ts +18 -0
  221. package/dist/features/predefined-behaviors/toggle-group-behavior.d.ts +23 -0
  222. package/dist/features/predefined-behaviors/types.d.ts +14 -0
  223. package/dist/features/sockets.d.ts +162 -0
  224. package/dist/features/webworker.d.ts +135 -0
  225. package/dist/htmx/htmx-attribute-processor.d.ts +84 -0
  226. package/dist/htmx/htmx-translator.d.ts +19 -0
  227. package/dist/htmx/index.d.ts +3 -0
  228. package/dist/hyperfixi-classic-i18n.js +2 -0
  229. package/dist/hyperfixi-hx.js +1 -0
  230. package/dist/hyperfixi-hybrid-complete.js +1 -0
  231. package/dist/hyperfixi-lite-plus.js +1 -0
  232. package/dist/hyperfixi-lite.js +1 -0
  233. package/dist/hyperfixi-minimal.js +1 -0
  234. package/dist/hyperfixi-multilingual.js +2 -0
  235. package/dist/hyperfixi-standard.js +2 -0
  236. package/dist/hyperfixi.js +2 -0
  237. package/dist/hyperfixi.mjs +2 -0
  238. package/dist/index.d.ts +25 -0
  239. package/dist/index.js +65387 -0
  240. package/dist/index.min.js +2 -0
  241. package/dist/index.mjs +65343 -0
  242. package/dist/lib/index.d.ts +4 -0
  243. package/dist/lib/morph-adapter.d.ts +22 -0
  244. package/dist/lib/swap-executor.d.ts +22 -0
  245. package/dist/lib/view-transitions.d.ts +33 -0
  246. package/dist/lokascript-browser-classic-i18n.js +2 -0
  247. package/dist/lokascript-browser-minimal.js +1 -0
  248. package/dist/lokascript-browser-standard.js +2 -0
  249. package/dist/lokascript-browser.js +2 -0
  250. package/dist/lokascript-hybrid-complete.js +1 -0
  251. package/dist/lokascript-hybrid-hx.js +1 -0
  252. package/dist/lokascript-lite-plus.js +1 -0
  253. package/dist/lokascript-lite.js +1 -0
  254. package/dist/lokascript-multilingual.js +2 -0
  255. package/dist/lsp-metadata.d.ts +25 -0
  256. package/dist/lsp-metadata.js +680 -0
  257. package/dist/lsp-metadata.mjs +670 -0
  258. package/dist/metadata.d.ts +213 -0
  259. package/dist/metadata.js +378 -0
  260. package/dist/metadata.mjs +368 -0
  261. package/dist/mod.d.ts +63 -0
  262. package/dist/multilingual/bridge.d.ts +36 -0
  263. package/dist/multilingual/index.d.ts +32 -0
  264. package/dist/multilingual/index.js +285 -0
  265. package/dist/multilingual/index.mjs +278 -0
  266. package/dist/parser/__types__/test-helpers.d.ts +25 -0
  267. package/dist/parser/command-node-builder.d.ts +45 -0
  268. package/dist/parser/command-parsers/animation-commands.d.ts +5 -0
  269. package/dist/parser/command-parsers/async-commands.d.ts +5 -0
  270. package/dist/parser/command-parsers/control-flow-commands.d.ts +7 -0
  271. package/dist/parser/command-parsers/dom-commands.d.ts +8 -0
  272. package/dist/parser/command-parsers/event-commands.d.ts +4 -0
  273. package/dist/parser/command-parsers/utility-commands.d.ts +9 -0
  274. package/dist/parser/command-parsers/variable-commands.d.ts +12 -0
  275. package/dist/parser/error-handler.d.ts +34 -0
  276. package/dist/parser/expression-parser.d.ts +6 -0
  277. package/dist/parser/full-parser.d.ts +4 -0
  278. package/dist/parser/full-parser.js +6532 -0
  279. package/dist/parser/full-parser.mjs +6529 -0
  280. package/dist/parser/helpers/ast-helpers.d.ts +22 -0
  281. package/dist/parser/helpers/parsing-helpers.d.ts +19 -0
  282. package/dist/parser/helpers/token-helpers.d.ts +28 -0
  283. package/dist/parser/hybrid/aliases.d.ts +7 -0
  284. package/dist/parser/hybrid/aliases.js +44 -0
  285. package/dist/parser/hybrid/aliases.mjs +37 -0
  286. package/dist/parser/hybrid/ast-types.d.ts +97 -0
  287. package/dist/parser/hybrid/ast-types.js +3 -0
  288. package/dist/parser/hybrid/ast-types.mjs +2 -0
  289. package/dist/parser/hybrid/index.d.ts +6 -0
  290. package/dist/parser/hybrid/index.js +1015 -0
  291. package/dist/parser/hybrid/index.mjs +1005 -0
  292. package/dist/parser/hybrid/parser-core.d.ts +57 -0
  293. package/dist/parser/hybrid/parser-core.js +1001 -0
  294. package/dist/parser/hybrid/parser-core.mjs +999 -0
  295. package/dist/parser/hybrid/tokenizer.d.ts +9 -0
  296. package/dist/parser/hybrid/tokenizer.js +242 -0
  297. package/dist/parser/hybrid/tokenizer.mjs +239 -0
  298. package/dist/parser/hybrid-parser.d.ts +10 -0
  299. package/dist/parser/hybrid-parser.js +1078 -0
  300. package/dist/parser/hybrid-parser.mjs +1071 -0
  301. package/dist/parser/parser-constants.d.ts +102 -0
  302. package/dist/parser/parser-interface.d.ts +11 -0
  303. package/dist/parser/parser-types.d.ts +175 -0
  304. package/dist/parser/parser.d.ts +146 -0
  305. package/dist/parser/regex-parser.d.ts +4 -0
  306. package/dist/parser/regex-parser.js +412 -0
  307. package/dist/parser/regex-parser.mjs +409 -0
  308. package/dist/parser/runtime.d.ts +3 -0
  309. package/dist/parser/semantic-integration.d.ts +61 -0
  310. package/dist/parser/token-consumer.d.ts +35 -0
  311. package/dist/parser/token-predicates.d.ts +77 -0
  312. package/dist/parser/tokenizer.d.ts +57 -0
  313. package/dist/parser/types.d.ts +118 -0
  314. package/dist/performance/expression-cache.d.ts +78 -0
  315. package/dist/performance/integration.d.ts +40 -0
  316. package/dist/performance/production-monitor.d.ts +67 -0
  317. package/dist/reference/index.d.ts +41 -0
  318. package/dist/reference/index.js +586 -0
  319. package/dist/reference/index.mjs +577 -0
  320. package/dist/registry/browser-types.d.ts +20 -0
  321. package/dist/registry/browser-types.js +81 -0
  322. package/dist/registry/browser-types.mjs +76 -0
  323. package/dist/registry/context-provider-registry.d.ts +38 -0
  324. package/dist/registry/environment.d.ts +19 -0
  325. package/dist/registry/environment.js +36 -0
  326. package/dist/registry/environment.mjs +30 -0
  327. package/dist/registry/event-source-registry.d.ts +54 -0
  328. package/dist/registry/examples/server-commands.d.ts +6 -0
  329. package/dist/registry/examples/server-event-source.d.ts +32 -0
  330. package/dist/registry/index.d.ts +54 -0
  331. package/dist/registry/index.js +7636 -0
  332. package/dist/registry/index.mjs +7612 -0
  333. package/dist/registry/multilingual/examples.d.ts +16 -0
  334. package/dist/registry/multilingual/index.d.ts +68 -0
  335. package/dist/registry/runtime-integration.d.ts +30 -0
  336. package/dist/registry/universal-types.d.ts +34 -0
  337. package/dist/registry/universal-types.js +91 -0
  338. package/dist/registry/universal-types.mjs +86 -0
  339. package/dist/runtime/cleanup-registry.d.ts +47 -0
  340. package/dist/runtime/command-adapter.d.ts +63 -0
  341. package/dist/runtime/environment.d.ts +75 -0
  342. package/dist/runtime/runtime-base.d.ts +78 -0
  343. package/dist/runtime/runtime-experimental.d.ts +18 -0
  344. package/dist/runtime/runtime-factory.d.ts +30 -0
  345. package/dist/runtime/runtime.d.ts +19 -0
  346. package/dist/runtime/temporal-modifiers.d.ts +37 -0
  347. package/dist/scripts/code-generator.d.ts +64 -0
  348. package/dist/scripts/generate-missing-commands.d.ts +4 -0
  349. package/dist/test-setup.d.ts +45 -0
  350. package/dist/test-utilities.d.ts +52 -0
  351. package/dist/tokenizer.d.ts +49 -0
  352. package/dist/types/base-types.d.ts +336 -0
  353. package/dist/types/code-fix.d.ts +39 -0
  354. package/dist/types/command-metadata.d.ts +57 -0
  355. package/dist/types/command-types.d.ts +272 -0
  356. package/dist/types/context-types.d.ts +106 -0
  357. package/dist/types/core-context.d.ts +21 -0
  358. package/dist/types/core.d.ts +203 -0
  359. package/dist/types/error-codes.d.ts +207 -0
  360. package/dist/types/expression-types.d.ts +155 -0
  361. package/dist/types/feature-types.d.ts +81 -0
  362. package/dist/types/hooks.d.ts +45 -0
  363. package/dist/types/index.d.ts +32 -0
  364. package/dist/types/result.d.ts +72 -0
  365. package/dist/types/template-types.d.ts +162 -0
  366. package/dist/types/type-guards.d.ts +24 -0
  367. package/dist/types/unified-types.d.ts +99 -0
  368. package/dist/utils/debug-events.d.ts +41 -0
  369. package/dist/utils/debug.d.ts +35 -0
  370. package/dist/utils/dom-utils.d.ts +16 -0
  371. package/dist/utils/element-check.d.ts +7 -0
  372. package/dist/utils/keyboard-shortcuts.d.ts +18 -0
  373. package/dist/utils/performance.d.ts +40 -0
  374. package/dist/validation/command-pattern-validator.d.ts +53 -0
  375. package/dist/validation/common-validators.d.ts +24 -0
  376. package/dist/validation/lightweight-validators.d.ts +113 -0
  377. package/dist/validation/partial-validation-types.d.ts +50 -0
  378. package/dist/validation/partial-validator.d.ts +6 -0
  379. package/dist/validation/partial-warning-formatter.d.ts +6 -0
  380. package/dist/validation/validate-cli.d.ts +41 -0
  381. package/package.json +292 -0
@@ -0,0 +1,207 @@
1
+ import type { ValidationError } from './unified-types';
2
+ import type { ExecutionError, ExecutionErrorContext } from './result';
3
+ export declare const ErrorCodes: {
4
+ readonly EXECUTION: {
5
+ readonly ADD_FAILED: "ADD_EXECUTION_FAILED";
6
+ readonly GO_FAILED: "GO_EXECUTION_FAILED";
7
+ readonly HIDE_FAILED: "HIDE_EXECUTION_FAILED";
8
+ readonly PUT_FAILED: "PUT_EXECUTION_FAILED";
9
+ readonly REMOVE_FAILED: "REMOVE_EXECUTION_FAILED";
10
+ readonly SEND_FAILED: "SEND_EXECUTION_FAILED";
11
+ readonly SHOW_FAILED: "SHOW_EXECUTION_FAILED";
12
+ readonly TAKE_FAILED: "TAKE_EXECUTION_FAILED";
13
+ readonly TOGGLE_FAILED: "TOGGLE_EXECUTION_FAILED";
14
+ readonly TRIGGER_FAILED: "TRIGGER_EXECUTION_FAILED";
15
+ readonly WAIT_FAILED: "WAIT_FAILED";
16
+ readonly FETCH_FAILED: "FETCH_FAILED";
17
+ readonly IF_FAILED: "IF_EXECUTION_FAILED";
18
+ readonly ELSE_FAILED: "ELSE_EXECUTION_FAILED";
19
+ readonly REPEAT_FAILED: "REPEAT_EXECUTION_FAILED";
20
+ readonly SCROLL_FAILED: "SCROLL_EXECUTION_FAILED";
21
+ };
22
+ readonly VALIDATION: {
23
+ readonly ADD_FAILED: "ADD_VALIDATION_FAILED";
24
+ readonly GO_FAILED: "GO_VALIDATION_FAILED";
25
+ readonly PUT_FAILED: "PUT_VALIDATION_FAILED";
26
+ readonly REMOVE_FAILED: "REMOVE_VALIDATION_FAILED";
27
+ readonly SEND_FAILED: "SEND_VALIDATION_FAILED";
28
+ readonly TAKE_FAILED: "TAKE_VALIDATION_FAILED";
29
+ readonly TOGGLE_FAILED: "TOGGLE_VALIDATION_FAILED";
30
+ readonly TRIGGER_FAILED: "TRIGGER_VALIDATION_FAILED";
31
+ readonly IF_FAILED: "IF_VALIDATION_FAILED";
32
+ readonly ELSE_FAILED: "ELSE_VALIDATION_FAILED";
33
+ readonly REPEAT_FAILED: "REPEAT_VALIDATION_FAILED";
34
+ readonly GENERIC: "VALIDATION_ERROR";
35
+ readonly PARTIAL_LAYOUT_ELEMENT: "PARTIAL_LAYOUT_ELEMENT";
36
+ readonly PARTIAL_DUPLICATE_SEMANTIC: "PARTIAL_DUPLICATE_SEMANTIC";
37
+ readonly PARTIAL_METADATA_ELEMENT: "PARTIAL_METADATA_ELEMENT";
38
+ };
39
+ readonly OPERATION: {
40
+ readonly CLASS_ADD_FAILED: "CLASS_ADD_FAILED";
41
+ readonly CLASS_REMOVE_FAILED: "CLASS_REMOVE_FAILED";
42
+ readonly CLASS_TOGGLE_FAILED: "CLASS_TOGGLE_FAILED";
43
+ readonly ATTRIBUTE_ADD_FAILED: "ATTRIBUTE_ADD_FAILED";
44
+ readonly ATTRIBUTE_TOGGLE_FAILED: "ATTRIBUTE_TOGGLE_FAILED";
45
+ readonly CSS_PROPERTY_TOGGLE_FAILED: "CSS_PROPERTY_TOGGLE_FAILED";
46
+ readonly ELEMENT_HIDE_FAILED: "ELEMENT_HIDE_FAILED";
47
+ readonly ELEMENT_SHOW_FAILED: "ELEMENT_SHOW_FAILED";
48
+ readonly EVENT_DISPATCH_FAILED: "EVENT_DISPATCH_FAILED";
49
+ readonly EVENT_TRIGGER_FAILED: "EVENT_TRIGGER_FAILED";
50
+ readonly NAVIGATION_FAILED: "NAVIGATION_FAILED";
51
+ readonly HISTORY_NAVIGATION_FAILED: "HISTORY_NAVIGATION_FAILED";
52
+ readonly URL_NAVIGATION_FAILED: "URL_NAVIGATION_FAILED";
53
+ readonly SCROLL_FAILED: "SCROLL_FAILED";
54
+ readonly SCROLL_OFFSET_FAILED: "SCROLL_OFFSET_FAILED";
55
+ readonly PROPERTY_TAKE_FAILED: "PROPERTY_TAKE_FAILED";
56
+ readonly PROPERTY_PUT_FAILED: "PROPERTY_PUT_FAILED";
57
+ readonly STYLE_ADD_FAILED: "STYLE_ADD_FAILED";
58
+ readonly OPERATION_FAILED: "OPERATION_FAILED";
59
+ readonly PARSE_FAILED: "PARSE_FAILED";
60
+ readonly ARGUMENT_PARSE_FAILED: "ARGUMENT_PARSE_FAILED";
61
+ };
62
+ readonly RESOLUTION: {
63
+ readonly TARGET_RESOLUTION_FAILED: "TARGET_RESOLUTION_FAILED";
64
+ readonly SOURCE_RESOLUTION_FAILED: "SOURCE_RESOLUTION_FAILED";
65
+ readonly RESOLUTION_FAILED: "RESOLUTION_FAILED";
66
+ };
67
+ readonly INVALID: {
68
+ readonly CONTEXT_ELEMENT: "INVALID_CONTEXT_ELEMENT";
69
+ readonly CLASS_NAME: "INVALID_CLASS_NAME";
70
+ readonly ATTRIBUTE_NAME: "INVALID_ATTRIBUTE_NAME";
71
+ readonly ELEMENT_REFERENCE: "INVALID_ELEMENT_REFERENCE";
72
+ readonly POSITION: "INVALID_POSITION";
73
+ readonly PROPERTY: "INVALID_PROPERTY";
74
+ readonly PROPERTY_POSITION: "INVALID_PROPERTY_POSITION";
75
+ readonly SELECTOR: "INVALID_SELECTOR";
76
+ readonly TARGET_TYPE: "INVALID_TARGET_TYPE";
77
+ readonly URL: "INVALID_URL";
78
+ };
79
+ readonly MISSING: {
80
+ readonly URL: "MISSING_URL";
81
+ readonly ARGUMENTS: "NO_ARGUMENTS";
82
+ };
83
+ readonly NOT_FOUND: {
84
+ readonly ELEMENT: "ELEMENT_NOT_FOUND";
85
+ readonly TARGET_ELEMENT: "NO_TARGET_ELEMENT";
86
+ readonly TARGET_ELEMENTS: "NO_TARGET_ELEMENTS";
87
+ readonly TARGET: "TARGET_NOT_FOUND";
88
+ };
89
+ readonly NO_VALID: {
90
+ readonly ATTRIBUTES: "NO_VALID_ATTRIBUTES";
91
+ readonly CLASSES: "NO_VALID_CLASSES";
92
+ readonly CSS_PROPERTY: "NO_VALID_CSS_PROPERTY";
93
+ };
94
+ readonly CONTEXT: {
95
+ readonly IF_INVALID: "IF_CONTEXT_INVALID";
96
+ readonly ELSE_INVALID: "ELSE_CONTEXT_INVALID";
97
+ readonly REPEAT_INVALID: "REPEAT_CONTEXT_INVALID";
98
+ readonly REPEAT_COLLECTION_INVALID: "REPEAT_COLLECTION_INVALID";
99
+ };
100
+ readonly UNSUPPORTED: {
101
+ readonly CSS_PROPERTY: "UNSUPPORTED_CSS_PROPERTY";
102
+ readonly HISTORY_API: "HISTORY_API_UNAVAILABLE";
103
+ };
104
+ };
105
+ export declare const ErrorMessages: {
106
+ readonly ADD_EXECUTION_FAILED: "Failed to execute add command";
107
+ readonly GO_EXECUTION_FAILED: "Failed to execute go command";
108
+ readonly HIDE_EXECUTION_FAILED: "Failed to execute hide command";
109
+ readonly PUT_EXECUTION_FAILED: "Failed to execute put command";
110
+ readonly REMOVE_EXECUTION_FAILED: "Failed to execute remove command";
111
+ readonly SEND_EXECUTION_FAILED: "Failed to execute send command";
112
+ readonly SHOW_EXECUTION_FAILED: "Failed to execute show command";
113
+ readonly TAKE_EXECUTION_FAILED: "Failed to execute take command";
114
+ readonly TOGGLE_EXECUTION_FAILED: "Failed to execute toggle command";
115
+ readonly TRIGGER_EXECUTION_FAILED: "Failed to execute trigger command";
116
+ readonly WAIT_FAILED: "Wait command failed";
117
+ readonly FETCH_FAILED: "Fetch command failed";
118
+ readonly IF_EXECUTION_FAILED: "Failed to execute if directive";
119
+ readonly ELSE_EXECUTION_FAILED: "Failed to execute else directive";
120
+ readonly REPEAT_EXECUTION_FAILED: "Failed to execute repeat directive";
121
+ readonly SCROLL_EXECUTION_FAILED: "Failed to execute scroll operation";
122
+ readonly ADD_VALIDATION_FAILED: "Add command validation failed";
123
+ readonly GO_VALIDATION_FAILED: "Go command validation failed";
124
+ readonly PUT_VALIDATION_FAILED: "Put command validation failed";
125
+ readonly REMOVE_VALIDATION_FAILED: "Remove command validation failed";
126
+ readonly SEND_VALIDATION_FAILED: "Send command validation failed";
127
+ readonly TAKE_VALIDATION_FAILED: "Take command validation failed";
128
+ readonly TOGGLE_VALIDATION_FAILED: "Toggle command validation failed";
129
+ readonly TRIGGER_VALIDATION_FAILED: "Trigger command validation failed";
130
+ readonly IF_VALIDATION_FAILED: "If directive validation failed";
131
+ readonly ELSE_VALIDATION_FAILED: "Else directive validation failed";
132
+ readonly REPEAT_VALIDATION_FAILED: "Repeat directive validation failed";
133
+ readonly VALIDATION_ERROR: "Validation error";
134
+ readonly PARTIAL_LAYOUT_ELEMENT: "Partial contains layout element: {0}";
135
+ readonly PARTIAL_DUPLICATE_SEMANTIC: "Partial may create duplicate semantic landmark: {0}";
136
+ readonly PARTIAL_METADATA_ELEMENT: "Partial contains metadata element: {0}";
137
+ readonly CLASS_ADD_FAILED: "Failed to add class to element";
138
+ readonly CLASS_REMOVE_FAILED: "Failed to remove class from element";
139
+ readonly CLASS_TOGGLE_FAILED: "Failed to toggle class on element";
140
+ readonly ATTRIBUTE_ADD_FAILED: "Failed to add attribute to element";
141
+ readonly ATTRIBUTE_TOGGLE_FAILED: "Failed to toggle attribute on element";
142
+ readonly CSS_PROPERTY_TOGGLE_FAILED: "Failed to toggle CSS property";
143
+ readonly ELEMENT_HIDE_FAILED: "Failed to hide element";
144
+ readonly ELEMENT_SHOW_FAILED: "Failed to show element";
145
+ readonly EVENT_DISPATCH_FAILED: "Failed to dispatch event";
146
+ readonly EVENT_TRIGGER_FAILED: "Failed to trigger event on element";
147
+ readonly NAVIGATION_FAILED: "Navigation failed";
148
+ readonly HISTORY_NAVIGATION_FAILED: "History navigation failed";
149
+ readonly URL_NAVIGATION_FAILED: "URL navigation failed";
150
+ readonly SCROLL_FAILED: "Scroll operation failed";
151
+ readonly SCROLL_OFFSET_FAILED: "Failed to scroll with offset";
152
+ readonly PROPERTY_TAKE_FAILED: "Failed to take property from element";
153
+ readonly PROPERTY_PUT_FAILED: "Failed to put property on element";
154
+ readonly STYLE_ADD_FAILED: "Failed to add style to element";
155
+ readonly OPERATION_FAILED: "Operation failed";
156
+ readonly PARSE_FAILED: "Failed to parse input";
157
+ readonly ARGUMENT_PARSE_FAILED: "Failed to parse arguments";
158
+ readonly TARGET_RESOLUTION_FAILED: "Failed to resolve target element";
159
+ readonly SOURCE_RESOLUTION_FAILED: "Failed to resolve source element";
160
+ readonly RESOLUTION_FAILED: "Element resolution failed";
161
+ readonly INVALID_CONTEXT_ELEMENT: "Invalid context element";
162
+ readonly INVALID_CLASS_NAME: "Invalid class name: \"{0}\"";
163
+ readonly INVALID_ATTRIBUTE_NAME: "Invalid attribute name: \"{0}\"";
164
+ readonly INVALID_ELEMENT_REFERENCE: "Invalid element reference";
165
+ readonly INVALID_POSITION: "Invalid position: \"{0}\"";
166
+ readonly INVALID_PROPERTY: "Invalid property: \"{0}\"";
167
+ readonly INVALID_PROPERTY_POSITION: "Invalid property position";
168
+ readonly INVALID_SELECTOR: "Invalid selector: \"{0}\"";
169
+ readonly INVALID_TARGET_TYPE: "Invalid target type";
170
+ readonly INVALID_URL: "Invalid URL: \"{0}\"";
171
+ readonly MISSING_URL: "Missing URL";
172
+ readonly NO_ARGUMENTS: "No arguments provided";
173
+ readonly ELEMENT_NOT_FOUND: "Element not found";
174
+ readonly NO_TARGET_ELEMENT: "No target element found";
175
+ readonly NO_TARGET_ELEMENTS: "No target elements found";
176
+ readonly TARGET_NOT_FOUND: "Target not found: \"{0}\"";
177
+ readonly NO_VALID_ATTRIBUTES: "No valid attributes provided";
178
+ readonly NO_VALID_CLASSES: "No valid classes provided to {0}";
179
+ readonly NO_VALID_CSS_PROPERTY: "No valid CSS property provided";
180
+ readonly IF_CONTEXT_INVALID: "Invalid context for if directive";
181
+ readonly ELSE_CONTEXT_INVALID: "Invalid context for else directive";
182
+ readonly REPEAT_CONTEXT_INVALID: "Invalid context for repeat directive";
183
+ readonly REPEAT_COLLECTION_INVALID: "Invalid collection for repeat directive";
184
+ readonly UNSUPPORTED_CSS_PROPERTY: "Unsupported CSS property: \"{0}\"";
185
+ readonly HISTORY_API_UNAVAILABLE: "History API is not available";
186
+ };
187
+ export declare const ErrorSuggestions: {
188
+ readonly ELEMENT_NOT_FOUND: readonly ["Check if target selector is valid", "Ensure elements exist in DOM", "Verify element has correct ID or class"];
189
+ readonly INVALID_SELECTOR: readonly ["Use valid CSS selector syntax like \"#id\", \".class\", or \"element\"", "Check CSS selector syntax", "Use document.querySelector() test"];
190
+ readonly NO_TARGET: readonly ["Provide a valid target element", "Check if element exists", "Verify selector matches an element"];
191
+ readonly INVALID_CLASS: readonly ["Use valid CSS class names", "Check for special characters", "Class names must start with letter, underscore, or hyphen"];
192
+ readonly INVALID_ATTRIBUTE: readonly ["Use valid HTML attribute names", "Check for special characters", "Attribute names must not contain spaces"];
193
+ readonly NO_VALID_VALUES: readonly ["Provide valid class names or attributes", "Check input syntax", "Ensure values are not empty"];
194
+ readonly CONTEXT_INVALID: readonly ["Check if context element exists", "Verify context is properly initialized", "Ensure \"me\" reference is valid"];
195
+ readonly NAVIGATION_ERROR: readonly ["Check if URL is valid and accessible", "Verify browser supports requested navigation", "Ensure History API is available"];
196
+ readonly EXECUTION_FAILED: readonly ["Check if element exists", "Verify element is not null", "Ensure element is still in DOM"];
197
+ readonly VALIDATION_FAILED: readonly ["Check argument types and syntax", "Ensure arguments match expected types", "Verify required arguments are provided"];
198
+ readonly PARTIAL_LAYOUT: readonly ["Remove layout elements (html, body, head) from partial response", "Return only content fragments, not full page HTML", "Check server endpoint is returning partial content"];
199
+ readonly PARTIAL_SEMANTIC: readonly ["Check if page already has this semantic landmark", "Consider if landmark is needed in partial or should be static", "Review partial content for duplicate header/footer/main/nav/aside"];
200
+ };
201
+ export declare function createError(errorCode: string, customMessage?: string, placeholders?: (string | number)[], suggestions?: string[]): ValidationError;
202
+ export declare function getSuggestions(errorCode: string): readonly string[];
203
+ export declare function wrapError(code: string, message: string, cause: Error | ExecutionError, context?: ExecutionErrorContext): ExecutionError;
204
+ export declare function isExecutionError(error: unknown): error is ExecutionError;
205
+ export declare function getErrorChain(error: ExecutionError | Error, maxDepth?: number): Array<ExecutionError | Error>;
206
+ export declare function formatErrorChain(error: ExecutionError | Error): string;
207
+ //# sourceMappingURL=error-codes.d.ts.map
@@ -0,0 +1,155 @@
1
+ import type { RuntimeValidator } from '../validation/lightweight-validators';
2
+ import type { ValidationResult, EvaluationResult, LLMDocumentation, ExecutionContext, TypedExpressionContext, EvaluationType } from './base-types';
3
+ export type { ValidationResult, EvaluationResult, LLMDocumentation, ExecutionContext, TypedExecutionContext, TypedExpressionContext, EvaluationType, HyperScriptValueType, } from './base-types';
4
+ export type ExpressionCategory = 'Reference' | 'Logical' | 'Conversion' | 'Positional' | 'Property' | 'Special' | 'Template';
5
+ export interface TypedError {
6
+ name: string;
7
+ message: string;
8
+ code: string;
9
+ suggestions: string[];
10
+ }
11
+ export interface BaseTypedExpression<T> {
12
+ readonly name: string;
13
+ readonly category: string;
14
+ readonly syntax: string;
15
+ readonly outputType: string;
16
+ readonly inputSchema: RuntimeValidator<unknown>;
17
+ readonly metadata: ExpressionMetadata;
18
+ readonly documentation?: LLMDocumentation;
19
+ evaluate(context: TypedExpressionContext, input: unknown): Promise<EvaluationResult<T>>;
20
+ validate(input: unknown): ValidationResult;
21
+ }
22
+ export interface ExpressionEvaluation {
23
+ expressionName: string;
24
+ category: ExpressionCategory;
25
+ input: unknown;
26
+ output: unknown;
27
+ timestamp: number;
28
+ duration: number;
29
+ success: boolean;
30
+ error?: Error;
31
+ }
32
+ export interface ExpressionMetadata {
33
+ category: ExpressionCategory;
34
+ complexity: 'simple' | 'medium' | 'complex';
35
+ sideEffects?: string[];
36
+ dependencies?: string[];
37
+ returnTypes?: EvaluationType[];
38
+ examples?: {
39
+ input: string;
40
+ description: string;
41
+ expectedOutput: unknown;
42
+ context?: Partial<ExecutionContext>;
43
+ }[];
44
+ relatedExpressions?: string[];
45
+ performance?: {
46
+ averageTime: number;
47
+ complexity: 'O(1)' | 'O(n)' | 'O(log n)' | 'O(n²)';
48
+ };
49
+ }
50
+ export interface TypedExpressionImplementation<TInput = unknown, TOutput = unknown, TContext extends TypedExpressionContext = TypedExpressionContext> {
51
+ readonly name: string;
52
+ readonly category: ExpressionCategory;
53
+ readonly syntax: string;
54
+ readonly description: string;
55
+ readonly inputSchema: RuntimeValidator<TInput>;
56
+ readonly outputType: EvaluationType;
57
+ readonly metadata: ExpressionMetadata;
58
+ readonly documentation?: LLMDocumentation;
59
+ evaluate(context: TContext, input: TInput): Promise<EvaluationResult<TOutput>>;
60
+ validate(input: unknown): ValidationResult;
61
+ parse?(expressionString: string): Promise<EvaluationResult<TInput>>;
62
+ canHandle?(input: unknown): boolean;
63
+ }
64
+ export interface ExpressionValidationError {
65
+ type: 'type-mismatch' | 'missing-argument' | 'invalid-syntax' | 'runtime-error' | 'syntax-error' | 'security-warning';
66
+ message: string;
67
+ position?: {
68
+ line: number;
69
+ column: number;
70
+ source: string;
71
+ start?: number;
72
+ end?: number;
73
+ suggestions: [];
74
+ };
75
+ suggestions: string[];
76
+ code?: string;
77
+ severity: 'error' | 'warning' | 'info';
78
+ }
79
+ export interface ExpressionValidationResult extends ValidationResult<unknown> {
80
+ errors: ExpressionValidationError[];
81
+ warnings?: ExpressionValidationError[];
82
+ suggestions: string[];
83
+ }
84
+ export interface EnhancedExpressionRegistry {
85
+ register<TInput, TOutput, TContext extends TypedExpressionContext>(expression: TypedExpressionImplementation<TInput, TOutput, TContext>): void;
86
+ get(name: string): TypedExpressionImplementation | undefined;
87
+ has(name: string): boolean;
88
+ getExpressionNames(): string[];
89
+ getByCategory(category: ExpressionCategory): TypedExpressionImplementation[];
90
+ validateExpression(name: string, input: unknown): ExpressionValidationResult;
91
+ getMetadata(name: string): ExpressionMetadata | undefined;
92
+ findByReturnType(returnType: EvaluationType): TypedExpressionImplementation[];
93
+ }
94
+ export interface ExpressionEvaluationOptions {
95
+ validationMode?: 'strict' | 'permissive';
96
+ maxDepth?: number;
97
+ timeout?: number;
98
+ caching?: boolean;
99
+ debugging?: boolean;
100
+ }
101
+ export interface ExpressionContextBridge {
102
+ toTyped(context: ExecutionContext, options?: ExpressionEvaluationOptions): TypedExpressionContext;
103
+ fromTyped(typedContext: TypedExpressionContext, originalContext: ExecutionContext): ExecutionContext;
104
+ }
105
+ export interface ExpressionFactory {
106
+ createReferenceExpression<T = HTMLElement>(name: string, evaluator: (context: TypedExpressionContext, input: unknown) => Promise<T>): TypedExpressionImplementation;
107
+ createLogicalExpression(name: string, evaluator: (context: TypedExpressionContext, left: unknown, right: unknown) => Promise<boolean>): TypedExpressionImplementation;
108
+ createConversionExpression<TFrom, TTo>(name: string, fromType: EvaluationType, toType: EvaluationType, converter: (context: TypedExpressionContext, input: TFrom) => Promise<TTo>): TypedExpressionImplementation;
109
+ }
110
+ export interface ExpressionProfiler {
111
+ startProfiling(expressionName: string, input: unknown): string;
112
+ endProfiling(profilingId: string, result: EvaluationResult<unknown>): void;
113
+ getStats(expressionName?: string): {
114
+ totalEvaluations: number;
115
+ averageTime: number;
116
+ slowestEvaluation: number;
117
+ fastestEvaluation: number;
118
+ errorRate: number;
119
+ };
120
+ clearStats(): void;
121
+ }
122
+ export type ExpressionImplementationMap<T = TypedExpressionImplementation> = {
123
+ [key: string]: T;
124
+ };
125
+ export type ExpressionCategoryMap = {
126
+ [K in ExpressionCategory]: TypedExpressionImplementation[];
127
+ };
128
+ export interface ExpressionCache {
129
+ get(key: string): EvaluationResult<unknown> | undefined;
130
+ set(key: string, result: EvaluationResult<unknown>, ttl?: number): void;
131
+ clear(): void;
132
+ size(): number;
133
+ }
134
+ export interface ExpressionDebugger {
135
+ enable(expressionNames: string[]): void;
136
+ disable(): void;
137
+ getLastEvaluation(): ExpressionEvaluation | undefined;
138
+ getHistory(limit?: number): ExpressionEvaluation[];
139
+ setBreakpoint(expressionName: string, condition?: (context: TypedExpressionContext) => boolean): void;
140
+ }
141
+ export declare const CommonInputSchemas: {
142
+ readonly NoInput: RuntimeValidator<unknown>;
143
+ readonly StringInput: RuntimeValidator<string>;
144
+ readonly NumberInput: RuntimeValidator<number>;
145
+ readonly BooleanInput: RuntimeValidator<boolean>;
146
+ readonly ElementInput: RuntimeValidator<unknown>;
147
+ readonly SelectorInput: RuntimeValidator<string>;
148
+ readonly ComparisonInput: RuntimeValidator<{
149
+ [x: string]: unknown;
150
+ }>;
151
+ readonly LogicalInput: RuntimeValidator<{
152
+ [x: string]: unknown;
153
+ }>;
154
+ };
155
+ //# sourceMappingURL=expression-types.d.ts.map
@@ -0,0 +1,81 @@
1
+ import type { RuntimeValidator } from '../validation/lightweight-validators';
2
+ import type { ValidationResult, EvaluationResult, CommandMetadata, LLMDocumentation } from './command-types';
3
+ export interface TypedFeatureContext {
4
+ me: HTMLElement | null;
5
+ it: unknown;
6
+ you: HTMLElement | null;
7
+ result: unknown;
8
+ event?: Event;
9
+ variables: Map<string, unknown>;
10
+ locals: Map<string, unknown>;
11
+ globals: Map<string, unknown>;
12
+ feature: string;
13
+ syntax: string;
14
+ element: HTMLElement;
15
+ errors: Error[];
16
+ featureHistory: FeatureExecution[];
17
+ validationMode: 'strict' | 'permissive';
18
+ }
19
+ export interface FeatureExecution {
20
+ featureName: string;
21
+ timestamp: number;
22
+ duration?: number;
23
+ success: boolean;
24
+ input: unknown[];
25
+ output?: unknown;
26
+ error?: Error;
27
+ }
28
+ export interface FeatureMetadata extends CommandMetadata {
29
+ syntaxElements: {
30
+ keywords: string[];
31
+ modifiers: string[];
32
+ expressions: string[];
33
+ };
34
+ triggerTypes: string[];
35
+ scope: 'element' | 'document' | 'global';
36
+ lifecycle: 'immediate' | 'deferred' | 'continuous';
37
+ }
38
+ export interface TypedFeatureImplementation<TInput = unknown, TOutput = unknown, TContext extends TypedFeatureContext = TypedFeatureContext> {
39
+ readonly name: string;
40
+ readonly syntax: string;
41
+ readonly description: string;
42
+ readonly inputSchema: RuntimeValidator<TInput>;
43
+ readonly outputType: string;
44
+ readonly metadata: FeatureMetadata;
45
+ readonly documentation?: LLMDocumentation;
46
+ parse(syntaxString: string, element: HTMLElement): Promise<EvaluationResult<TInput>>;
47
+ execute(context: TContext, input: TInput): Promise<EvaluationResult<TOutput>>;
48
+ validate(input: unknown): ValidationResult;
49
+ cleanup?(context: TContext, registration: TOutput): Promise<void>;
50
+ }
51
+ export interface FeatureRegistration {
52
+ id: string;
53
+ featureName: string;
54
+ element: HTMLElement;
55
+ syntax: string;
56
+ active: boolean;
57
+ cleanup?: () => Promise<void>;
58
+ }
59
+ export interface FeatureValidationError {
60
+ type: 'syntax-error' | 'type-mismatch' | 'semantic-error' | 'runtime-error';
61
+ message: string;
62
+ position?: {
63
+ start: number;
64
+ end: number;
65
+ line?: number;
66
+ column?: number;
67
+ suggestions: [];
68
+ };
69
+ suggestion: string;
70
+ code?: string;
71
+ }
72
+ export interface FeatureValidationResult {
73
+ isValid: boolean;
74
+ errors: FeatureValidationError[];
75
+ suggestions: string[];
76
+ parsedSyntax?: {
77
+ tokens: string[];
78
+ structure: Record<string, any>;
79
+ };
80
+ }
81
+ //# sourceMappingURL=feature-types.d.ts.map
@@ -0,0 +1,45 @@
1
+ import type { ExecutionContext } from './base-types';
2
+ export interface HookContext {
3
+ commandName: string;
4
+ element: Element | null;
5
+ args: unknown[];
6
+ modifiers: Record<string, unknown>;
7
+ event?: Event;
8
+ executionContext: ExecutionContext;
9
+ }
10
+ export type BeforeExecuteHook = (ctx: HookContext) => void | Promise<void>;
11
+ export type AfterExecuteHook = (ctx: HookContext, result: unknown) => void | Promise<void>;
12
+ export type OnErrorHook = (ctx: HookContext, error: Error) => void | Error | Promise<void | Error>;
13
+ export type InterceptCommandHook = (commandName: string, ctx: HookContext) => boolean;
14
+ export interface RuntimeHooks {
15
+ beforeExecute?: BeforeExecuteHook;
16
+ afterExecute?: AfterExecuteHook;
17
+ onError?: OnErrorHook;
18
+ interceptCommand?: InterceptCommandHook;
19
+ }
20
+ export declare class HookRegistry {
21
+ private hooks;
22
+ private beforeExecuteHooks;
23
+ private afterExecuteHooks;
24
+ private onErrorHooks;
25
+ private interceptCommandHooks;
26
+ register(name: string, hooks: RuntimeHooks): void;
27
+ unregister(name: string): boolean;
28
+ has(name: string): boolean;
29
+ runBeforeExecute(ctx: HookContext): Promise<void>;
30
+ runAfterExecute(ctx: HookContext, result: unknown): Promise<void>;
31
+ runOnError(ctx: HookContext, error: Error): Promise<Error>;
32
+ shouldIntercept(commandName: string, ctx: HookContext): boolean;
33
+ getRegisteredNames(): string[];
34
+ clear(): void;
35
+ }
36
+ export declare function createHooks(config: {
37
+ name?: string;
38
+ beforeExecute?: BeforeExecuteHook;
39
+ afterExecute?: AfterExecuteHook;
40
+ onError?: OnErrorHook;
41
+ interceptCommand?: InterceptCommandHook;
42
+ }): RuntimeHooks;
43
+ export declare const loggingHooks: RuntimeHooks;
44
+ export declare function createTimingHooks(onTiming: (commandName: string, durationMs: number) => void): RuntimeHooks;
45
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1,32 @@
1
+ import type { ValidationResult, ValidationError, EvaluationResult, ExecutionContext } from './base-types';
2
+ export type { CoreExecutionContext } from './core-context';
3
+ export { createCoreContext, isCoreExecutionContext, assertHTMLElement, asHTMLElement, } from './core-context';
4
+ export type { ValidationError, ValidationResult, HyperScriptValueType, EvaluationType, HyperScriptValue, ExecutionContext, TypedExecutionContext, TypedResult, CommandCategory, SideEffect, ExpressionCategory, ExpressionMetadata, ASTNode, ParseError, LLMDocumentation, } from './unified-types';
5
+ export { Validator, isValidationResult, isExecutionContext } from './unified-types';
6
+ export { isInputElement, isFormElement, isHTMLElement, isDOMElement, isDOMNode, isOptionElement, isArrayLike, isNodeList, isHTMLCollection, isPlainObject, isObject, isFunction, isPromiseLike, getProperty, setProperty, hasProperty, toNumber, compareValues, getFormValue, getChecked, getDisabled, getSelected, getHidden, } from './type-guards';
7
+ export type { ExpressionNode, CommandNode, EvaluationResult, EventHandlerNode, BehaviorNode, DefNode, } from './base-types';
8
+ export type ValidResult<T> = ValidationResult<T>;
9
+ export type ExecContext = ExecutionContext;
10
+ export type ValidError = ValidationError;
11
+ export type AsyncResult<T> = Promise<EvaluationResult<T>>;
12
+ export type AsyncValidResult<T> = Promise<ValidationResult<T>>;
13
+ export type ValidationFunction<T> = (input: unknown) => ValidationResult<T>;
14
+ export type AsyncValidationFunction<T> = (input: unknown) => Promise<ValidationResult<T>>;
15
+ export { CoreTypes } from './unified-types';
16
+ export type { Result, Ok, Err, ExecutionSignal, HaltSignal, ExitSignal, BreakSignal, ContinueSignal, ReturnSignal, ExecutionResult, OperationResult, ExecutionError, ExecutionErrorContext, } from './result';
17
+ export { ok, err, halt, exit, breakLoop, continueLoop, returnValue, isOk, isErr, isSignal, isSignalResult, unwrap, unwrapOr, unwrapOrElse, map, mapErr, andThen, fromPromise, fromThrowable, fromAsyncThrowable, } from './result';
18
+ export { ErrorCodes, ErrorMessages, ErrorSuggestions, createError, getSuggestions, wrapError, isExecutionError, getErrorChain, formatErrorChain, } from './error-codes';
19
+ export type { HookContext, BeforeExecuteHook, AfterExecuteHook, OnErrorHook, InterceptCommandHook, RuntimeHooks, } from './hooks';
20
+ export { HookRegistry, createHooks, loggingHooks, createTimingHooks } from './hooks';
21
+ export type { CodeActionKind, TextRange, TextEdit, FixCommand, CodeFix, FixableError, DiagnosticWithFixes, DiagnosticResponseWithFixes, } from './code-fix';
22
+ export type { CommandCategory as StandardCommandCategory, CommandSideEffect, CommandMetadata, MetadataValidationResult, CommandRegistryEntry, } from './command-metadata';
23
+ export { COMMAND_CATEGORIES, COMMAND_SIDE_EFFECTS, validateCommandMetadata, normalizeCategory, createCommandMetadata, mergeCommandMetadata, getSyntaxArray, formatMetadataForDocs, CommandMetadataRegistry, commandMetadataRegistry, } from './command-metadata';
24
+ export type { SwapStrategy, SwapExecutionOptions } from '../lib/swap-executor';
25
+ export type { MorphOptions, MorphEngine } from '../lib/morph-adapter';
26
+ export type { TransitionCallback, ViewTransitionOptions, ViewTransitionsConfig, } from '../lib/view-transitions';
27
+ export type { HistorySwapConfig, HistorySwapInstance } from '../behaviors/history-swap';
28
+ export type { BoostedConfig, BoostedInstance } from '../behaviors/boosted';
29
+ export type { SwapCommandInput } from '../commands/dom/swap';
30
+ export type { HistoryCommandInput, HistoryMode, PushUrlCommandInput, } from '../commands/navigation/push-url';
31
+ export type { ReplaceUrlCommandInput } from '../commands/navigation/replace-url';
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,72 @@
1
+ export type Result<T, E = Error> = Ok<T> | Err<E>;
2
+ export interface Ok<T> {
3
+ readonly ok: true;
4
+ readonly value: T;
5
+ }
6
+ export interface Err<E> {
7
+ readonly ok: false;
8
+ readonly error: E;
9
+ }
10
+ export type ExecutionSignal = HaltSignal | ExitSignal | BreakSignal | ContinueSignal | ReturnSignal;
11
+ export interface HaltSignal {
12
+ readonly type: 'halt';
13
+ }
14
+ export interface ExitSignal {
15
+ readonly type: 'exit';
16
+ readonly returnValue?: unknown;
17
+ }
18
+ export interface BreakSignal {
19
+ readonly type: 'break';
20
+ }
21
+ export interface ContinueSignal {
22
+ readonly type: 'continue';
23
+ }
24
+ export interface ReturnSignal {
25
+ readonly type: 'return';
26
+ readonly returnValue?: unknown;
27
+ }
28
+ export type ExecutionResult<T> = Result<T, ExecutionSignal>;
29
+ export interface ControlFlowError extends Error {
30
+ isHalt?: true;
31
+ isExit?: true;
32
+ isBreak?: true;
33
+ isContinue?: true;
34
+ isReturn?: true;
35
+ returnValue?: unknown;
36
+ }
37
+ export declare function asControlFlowError(e: unknown): ControlFlowError | null;
38
+ export type OperationResult<T> = Result<T, ExecutionError>;
39
+ export interface ExecutionError {
40
+ readonly code: string;
41
+ readonly message: string;
42
+ readonly cause?: ExecutionError | Error;
43
+ readonly context?: ExecutionErrorContext;
44
+ }
45
+ export interface ExecutionErrorContext {
46
+ command?: string;
47
+ input?: unknown;
48
+ element?: string;
49
+ phase?: 'parse' | 'validate' | 'execute';
50
+ [key: string]: unknown;
51
+ }
52
+ export declare function ok<T>(value: T): Ok<T>;
53
+ export declare function err<E>(error: E): Err<E>;
54
+ export declare function halt(): Err<HaltSignal>;
55
+ export declare function exit(returnValue?: unknown): Err<ExitSignal>;
56
+ export declare function breakLoop(): Err<BreakSignal>;
57
+ export declare function continueLoop(): Err<ContinueSignal>;
58
+ export declare function returnValue(value?: unknown): Err<ReturnSignal>;
59
+ export declare function isOk<T, E>(result: Result<T, E>): result is Ok<T>;
60
+ export declare function isErr<T, E>(result: Result<T, E>): result is Err<E>;
61
+ export declare function isSignal(error: unknown): error is ExecutionSignal;
62
+ export declare function isSignalResult<T>(result: Result<T, unknown>): result is Err<ExecutionSignal>;
63
+ export declare function unwrap<T, E>(result: Result<T, E>): T;
64
+ export declare function unwrapOr<T, E>(result: Result<T, E>, defaultValue: T): T;
65
+ export declare function unwrapOrElse<T, E>(result: Result<T, E>, fn: (error: E) => T): T;
66
+ export declare function map<T, U, E>(result: Result<T, E>, fn: (value: T) => U): Result<U, E>;
67
+ export declare function mapErr<T, E, F>(result: Result<T, E>, fn: (error: E) => F): Result<T, F>;
68
+ export declare function andThen<T, U, E>(result: Result<T, E>, fn: (value: T) => Result<U, E>): Result<U, E>;
69
+ export declare function fromPromise<T>(promise: Promise<T>): Promise<Result<T, Error>>;
70
+ export declare function fromThrowable<T, A extends unknown[]>(fn: (...args: A) => T): (...args: A) => Result<T, Error>;
71
+ export declare function fromAsyncThrowable<T, A extends unknown[]>(fn: (...args: A) => Promise<T>): (...args: A) => Promise<Result<T, Error>>;
72
+ //# sourceMappingURL=result.d.ts.map