@plures/praxis 1.0.2 → 1.1.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 (518) hide show
  1. package/FRAMEWORK.md +55 -5
  2. package/LICENSE +21 -21
  3. package/README.md +162 -375
  4. package/core/codegen/docs-generator.ts +5 -2
  5. package/core/codegen/index.ts +1 -1
  6. package/core/codegen/ts-generator.ts +15 -15
  7. package/core/db-adapter/index.ts +2 -2
  8. package/core/db-adapter/sync-engine.ts +17 -6
  9. package/core/logic-engine/engine.ts +1 -1
  10. package/core/logic-engine/index.ts +2 -2
  11. package/core/logic-engine/protocol.ts +1 -1
  12. package/core/logic-engine/psf-adapter.ts +8 -4
  13. package/core/logic-engine/rules.ts +1 -1
  14. package/core/schema-engine/compiler.ts +53 -11
  15. package/core/schema-engine/generator.ts +17 -7
  16. package/core/schema-engine/index.ts +2 -2
  17. package/core/schema-engine/psf.ts +12 -3
  18. package/core/schema-engine/types.ts +3 -11
  19. package/core/schema-engine/validator.ts +112 -22
  20. package/dist/browser/engine-BjdqxeXG.d.ts +333 -0
  21. package/dist/browser/index.d.ts +3004 -0
  22. package/dist/browser/index.js +2892 -0
  23. package/dist/{src → browser}/integrations/svelte.d.ts +19 -17
  24. package/dist/browser/integrations/svelte.js +298 -0
  25. package/dist/node/auth-STARLY7I.js +207 -0
  26. package/dist/node/build-Y7OT5VBF.js +144 -0
  27. package/dist/node/canvas-UERZHJYW.js +362 -0
  28. package/dist/node/chunk-DSDC2JWZ.js +256 -0
  29. package/dist/node/chunk-FXQZXAWF.js +175 -0
  30. package/dist/node/chunk-N5Y37EUV.js +202 -0
  31. package/dist/node/chunk-QGM4M3NI.js +37 -0
  32. package/dist/node/chunk-RJMWCNHR.js +175 -0
  33. package/dist/node/chunk-SRM3OPPM.js +404 -0
  34. package/dist/node/chunk-UATVJBNV.js +175 -0
  35. package/dist/node/chunk-UY7YEBE2.js +159 -0
  36. package/dist/node/chunk-XCY2VIFX.js +143 -0
  37. package/dist/node/chunk-YXH4Y7ZZ.js +349 -0
  38. package/dist/node/cli/index.cjs +217418 -0
  39. package/dist/node/cli/index.d.cts +1 -0
  40. package/dist/node/cli/index.d.ts +1 -0
  41. package/dist/node/cli/index.js +690 -0
  42. package/dist/node/cloud/index.cjs +1043 -0
  43. package/dist/node/cloud/index.d.cts +864 -0
  44. package/dist/node/cloud/index.d.ts +864 -0
  45. package/dist/node/cloud/index.js +456 -0
  46. package/dist/node/cloud-AXOK4PSN.js +212 -0
  47. package/dist/node/component.cjs +374 -0
  48. package/dist/node/component.d.cts +125 -0
  49. package/dist/{src/core/component/generator.d.ts → node/component.d.ts} +11 -8
  50. package/dist/node/component.js +9 -0
  51. package/dist/node/components/index.cjs +216 -0
  52. package/dist/node/components/index.d.cts +43 -0
  53. package/dist/{src → node}/components/index.d.ts +8 -8
  54. package/dist/node/components/index.js +7 -0
  55. package/dist/node/create-TRLSVCNQ.js +584 -0
  56. package/dist/node/dev-PMJZUYGE.js +65 -0
  57. package/dist/node/engine-1iqLe6_P.d.ts +214 -0
  58. package/dist/node/engine-CVJobhHm.d.cts +214 -0
  59. package/dist/node/index.cjs +3247 -0
  60. package/dist/node/index.d.cts +2579 -0
  61. package/dist/node/index.d.ts +2579 -0
  62. package/dist/node/index.js +2098 -0
  63. package/dist/node/integrations/svelte.cjs +330 -0
  64. package/dist/node/integrations/svelte.d.cts +309 -0
  65. package/dist/node/integrations/svelte.d.ts +309 -0
  66. package/dist/node/integrations/svelte.js +300 -0
  67. package/dist/node/orchestrate-737TCL5H.js +127 -0
  68. package/dist/{src/core/protocol.d.ts → node/protocol-Qek7ebBl.d.cts} +11 -10
  69. package/dist/node/protocol-Qek7ebBl.d.ts +122 -0
  70. package/dist/node/schema.cjs +200 -0
  71. package/dist/{src/core/schema/types.d.ts → node/schema.d.cts} +30 -29
  72. package/dist/node/schema.d.ts +371 -0
  73. package/dist/node/schema.js +9 -0
  74. package/dist/{src/runtime/terminal-adapter.d.ts → node/terminal-adapter-07HGftGQ.d.ts} +86 -11
  75. package/dist/node/terminal-adapter-XLtCjjb_.d.cts +231 -0
  76. package/dist/node/verify-YBZ7W24H.js +213239 -0
  77. package/docs/MONETIZATION.md +21 -16
  78. package/docs/REACTIVE_REDESIGN.md +132 -0
  79. package/docs/README.md +47 -36
  80. package/docs/SVELTE_INTEGRATION_STRATEGY.md +68 -0
  81. package/docs/TERMINAL_NODE.md +27 -24
  82. package/docs/core/building-extensions.md +58 -61
  83. package/docs/core/cli-usage.md +59 -59
  84. package/docs/core/code-canvas-sync.md +28 -16
  85. package/docs/core/logic-engine.md +77 -82
  86. package/docs/core/pluresdb-integration.md +29 -39
  87. package/docs/core/schema-model.md +66 -52
  88. package/docs/core/ui-generation.md +57 -49
  89. package/docs/core/what-is-praxis.md +32 -15
  90. package/docs/guides/canvas.md +21 -5
  91. package/docs/guides/getting-started.md +13 -7
  92. package/docs/guides/history-state-pattern.md +65 -51
  93. package/docs/guides/orchestration.md +46 -32
  94. package/docs/guides/parallel-state-pattern.md +56 -72
  95. package/docs/guides/svelte-integration.md +45 -53
  96. package/docs/tutorials/README.md +16 -0
  97. package/docs/tutorials/ecommerce-cart.md +177 -95
  98. package/docs/tutorials/first-app.md +26 -41
  99. package/docs/tutorials/form-builder.md +191 -138
  100. package/docs/tutorials/todo-pluresdb.md +71 -69
  101. package/package.json +132 -96
  102. package/src/__tests__/actors.test.ts +68 -68
  103. package/src/__tests__/billing.test.ts +32 -32
  104. package/src/__tests__/canvas-components.test.ts +94 -73
  105. package/src/__tests__/cli-create.test.ts +28 -28
  106. package/src/__tests__/cloud.test.ts +36 -36
  107. package/src/__tests__/code-canvas-integration.test.ts +132 -141
  108. package/src/__tests__/docs-generator.test.ts +3 -9
  109. package/src/__tests__/dsl.test.ts +58 -64
  110. package/src/__tests__/edge-cases.test.ts +106 -108
  111. package/src/__tests__/engine.test.ts +51 -25
  112. package/src/__tests__/generators.test.ts +42 -44
  113. package/src/__tests__/introspection.test.ts +104 -114
  114. package/src/__tests__/pluresdb.test.ts +189 -187
  115. package/src/__tests__/protocol.test.ts +15 -15
  116. package/src/__tests__/provisioning.test.ts +61 -61
  117. package/src/__tests__/schema.test.ts +7 -11
  118. package/src/__tests__/state-docs-integration.test.ts +162 -145
  119. package/src/__tests__/svelte-integration.test.ts +16 -19
  120. package/src/__tests__/tauri-integration.test.ts +149 -147
  121. package/src/__tests__/terminal-node.test.ts +12 -7
  122. package/src/__tests__/unum-integration.test.ts +68 -68
  123. package/src/adapters/cli.ts +21 -15
  124. package/src/cli/commands/auth.ts +82 -78
  125. package/src/cli/commands/build.ts +29 -27
  126. package/src/cli/commands/canvas.ts +338 -127
  127. package/src/cli/commands/cloud.ts +47 -47
  128. package/src/cli/commands/create.ts +59 -47
  129. package/src/cli/commands/dev.ts +12 -12
  130. package/src/cli/commands/generate.ts +29 -40
  131. package/src/cli/commands/orchestrate.ts +24 -24
  132. package/src/cli/commands/verify.ts +49 -0
  133. package/src/cli/index.ts +21 -2
  134. package/src/cloud/README.md +28 -15
  135. package/src/cloud/auth.ts +55 -70
  136. package/src/cloud/billing.ts +59 -58
  137. package/src/cloud/client.ts +29 -35
  138. package/src/cloud/index.ts +19 -40
  139. package/src/cloud/marketplace.ts +69 -78
  140. package/src/cloud/provisioning.ts +42 -51
  141. package/src/cloud/relay/endpoints.ts +30 -34
  142. package/src/cloud/relay/health/index.ts +1 -1
  143. package/src/cloud/relay/stats/index.ts +1 -1
  144. package/src/cloud/relay/sync/index.ts +1 -1
  145. package/src/cloud/relay/usage/index.ts +1 -1
  146. package/src/cloud/sponsors.ts +31 -34
  147. package/src/cloud/types.ts +4 -4
  148. package/src/components/README.md +1 -0
  149. package/src/components/TerminalNode.svelte +457 -457
  150. package/src/components/index.ts +3 -4
  151. package/src/core/actors.ts +7 -7
  152. package/src/core/component/generator.ts +10 -28
  153. package/src/core/engine.ts +51 -24
  154. package/src/core/introspection.ts +37 -35
  155. package/src/core/logic/generator.ts +62 -62
  156. package/src/core/pluresdb/adapter.ts +8 -8
  157. package/src/core/pluresdb/generator.ts +39 -35
  158. package/src/core/pluresdb/index.ts +9 -12
  159. package/src/core/pluresdb/schema-registry.ts +22 -25
  160. package/src/core/pluresdb/store.ts +57 -57
  161. package/src/core/protocol.ts +14 -14
  162. package/src/core/reactive-engine.svelte.ts +65 -0
  163. package/src/core/reactive-engine.ts +67 -0
  164. package/src/core/rules.ts +4 -4
  165. package/src/core/schema/loader.common.ts +150 -0
  166. package/src/core/schema/loader.ts +19 -149
  167. package/src/core/schema/normalize.ts +34 -51
  168. package/src/core/schema/types.ts +47 -11
  169. package/src/dsl/index.ts +8 -8
  170. package/src/dsl.ts +11 -17
  171. package/src/examples/advanced-todo/App.svelte +506 -506
  172. package/src/examples/advanced-todo/README.md +58 -40
  173. package/src/examples/advanced-todo/index.ts +3 -3
  174. package/src/examples/auth-basic/index.ts +30 -30
  175. package/src/examples/cart/index.ts +50 -50
  176. package/src/examples/hero-ecommerce/index.ts +130 -157
  177. package/src/examples/svelte-counter/index.ts +22 -26
  178. package/src/flows.ts +6 -17
  179. package/src/index.browser.ts +204 -0
  180. package/src/index.ts +37 -42
  181. package/src/integrations/code-canvas.ts +237 -193
  182. package/src/integrations/pluresdb.ts +55 -35
  183. package/src/integrations/state-docs.ts +104 -104
  184. package/src/integrations/svelte.ts +35 -35
  185. package/src/integrations/tauri.ts +75 -73
  186. package/src/integrations/unum.ts +68 -61
  187. package/src/registry.ts +7 -14
  188. package/src/runtime/terminal-adapter.ts +31 -26
  189. package/src/step.ts +10 -16
  190. package/src/types.ts +1 -1
  191. package/templates/basic-app/README.md +6 -9
  192. package/templates/fullstack-app/README.md +10 -0
  193. package/dist/core/codegen/docs-generator.d.ts +0 -123
  194. package/dist/core/codegen/docs-generator.d.ts.map +0 -1
  195. package/dist/core/codegen/docs-generator.js +0 -674
  196. package/dist/core/codegen/docs-generator.js.map +0 -1
  197. package/dist/core/codegen/index.d.ts +0 -11
  198. package/dist/core/codegen/index.d.ts.map +0 -1
  199. package/dist/core/codegen/index.js +0 -13
  200. package/dist/core/codegen/index.js.map +0 -1
  201. package/dist/core/codegen/ts-generator.d.ts +0 -8
  202. package/dist/core/codegen/ts-generator.d.ts.map +0 -1
  203. package/dist/core/codegen/ts-generator.js +0 -8
  204. package/dist/core/codegen/ts-generator.js.map +0 -1
  205. package/dist/core/db-adapter/index.d.ts +0 -18
  206. package/dist/core/db-adapter/index.d.ts.map +0 -1
  207. package/dist/core/db-adapter/index.js +0 -23
  208. package/dist/core/db-adapter/index.js.map +0 -1
  209. package/dist/core/db-adapter/sync-engine.d.ts +0 -180
  210. package/dist/core/db-adapter/sync-engine.d.ts.map +0 -1
  211. package/dist/core/db-adapter/sync-engine.js +0 -342
  212. package/dist/core/db-adapter/sync-engine.js.map +0 -1
  213. package/dist/core/logic-engine/engine.d.ts +0 -8
  214. package/dist/core/logic-engine/engine.d.ts.map +0 -1
  215. package/dist/core/logic-engine/engine.js +0 -8
  216. package/dist/core/logic-engine/engine.js.map +0 -1
  217. package/dist/core/logic-engine/index.d.ts +0 -16
  218. package/dist/core/logic-engine/index.d.ts.map +0 -1
  219. package/dist/core/logic-engine/index.js +0 -16
  220. package/dist/core/logic-engine/index.js.map +0 -1
  221. package/dist/core/logic-engine/protocol.d.ts +0 -7
  222. package/dist/core/logic-engine/protocol.d.ts.map +0 -1
  223. package/dist/core/logic-engine/protocol.js +0 -7
  224. package/dist/core/logic-engine/protocol.js.map +0 -1
  225. package/dist/core/logic-engine/psf-adapter.d.ts +0 -88
  226. package/dist/core/logic-engine/psf-adapter.d.ts.map +0 -1
  227. package/dist/core/logic-engine/psf-adapter.js +0 -207
  228. package/dist/core/logic-engine/psf-adapter.js.map +0 -1
  229. package/dist/core/logic-engine/rules.d.ts +0 -7
  230. package/dist/core/logic-engine/rules.d.ts.map +0 -1
  231. package/dist/core/logic-engine/rules.js +0 -7
  232. package/dist/core/logic-engine/rules.js.map +0 -1
  233. package/dist/core/schema-engine/compiler.d.ts +0 -198
  234. package/dist/core/schema-engine/compiler.d.ts.map +0 -1
  235. package/dist/core/schema-engine/compiler.js +0 -262
  236. package/dist/core/schema-engine/compiler.js.map +0 -1
  237. package/dist/core/schema-engine/generator.d.ts +0 -115
  238. package/dist/core/schema-engine/generator.d.ts.map +0 -1
  239. package/dist/core/schema-engine/generator.js +0 -506
  240. package/dist/core/schema-engine/generator.js.map +0 -1
  241. package/dist/core/schema-engine/index.d.ts +0 -18
  242. package/dist/core/schema-engine/index.d.ts.map +0 -1
  243. package/dist/core/schema-engine/index.js +0 -18
  244. package/dist/core/schema-engine/index.js.map +0 -1
  245. package/dist/core/schema-engine/psf.d.ts +0 -612
  246. package/dist/core/schema-engine/psf.d.ts.map +0 -1
  247. package/dist/core/schema-engine/psf.js +0 -45
  248. package/dist/core/schema-engine/psf.js.map +0 -1
  249. package/dist/core/schema-engine/types.d.ts +0 -10
  250. package/dist/core/schema-engine/types.d.ts.map +0 -1
  251. package/dist/core/schema-engine/types.js +0 -7
  252. package/dist/core/schema-engine/types.js.map +0 -1
  253. package/dist/core/schema-engine/validator.d.ts +0 -140
  254. package/dist/core/schema-engine/validator.d.ts.map +0 -1
  255. package/dist/core/schema-engine/validator.js +0 -407
  256. package/dist/core/schema-engine/validator.js.map +0 -1
  257. package/dist/src/adapters/cli.d.ts +0 -43
  258. package/dist/src/adapters/cli.d.ts.map +0 -1
  259. package/dist/src/adapters/cli.js +0 -126
  260. package/dist/src/adapters/cli.js.map +0 -1
  261. package/dist/src/cli/commands/auth.d.ts +0 -26
  262. package/dist/src/cli/commands/auth.d.ts.map +0 -1
  263. package/dist/src/cli/commands/auth.js +0 -233
  264. package/dist/src/cli/commands/auth.js.map +0 -1
  265. package/dist/src/cli/commands/build.d.ts +0 -23
  266. package/dist/src/cli/commands/build.d.ts.map +0 -1
  267. package/dist/src/cli/commands/build.js +0 -162
  268. package/dist/src/cli/commands/build.js.map +0 -1
  269. package/dist/src/cli/commands/canvas.d.ts +0 -23
  270. package/dist/src/cli/commands/canvas.d.ts.map +0 -1
  271. package/dist/src/cli/commands/canvas.js +0 -215
  272. package/dist/src/cli/commands/canvas.js.map +0 -1
  273. package/dist/src/cli/commands/cloud.d.ts +0 -27
  274. package/dist/src/cli/commands/cloud.d.ts.map +0 -1
  275. package/dist/src/cli/commands/cloud.js +0 -232
  276. package/dist/src/cli/commands/cloud.js.map +0 -1
  277. package/dist/src/cli/commands/create.d.ts +0 -21
  278. package/dist/src/cli/commands/create.d.ts.map +0 -1
  279. package/dist/src/cli/commands/create.js +0 -621
  280. package/dist/src/cli/commands/create.js.map +0 -1
  281. package/dist/src/cli/commands/dev.d.ts +0 -21
  282. package/dist/src/cli/commands/dev.d.ts.map +0 -1
  283. package/dist/src/cli/commands/dev.js +0 -71
  284. package/dist/src/cli/commands/dev.js.map +0 -1
  285. package/dist/src/cli/commands/generate.d.ts +0 -25
  286. package/dist/src/cli/commands/generate.d.ts.map +0 -1
  287. package/dist/src/cli/commands/generate.js +0 -168
  288. package/dist/src/cli/commands/generate.js.map +0 -1
  289. package/dist/src/cli/commands/orchestrate.d.ts +0 -44
  290. package/dist/src/cli/commands/orchestrate.d.ts.map +0 -1
  291. package/dist/src/cli/commands/orchestrate.js +0 -150
  292. package/dist/src/cli/commands/orchestrate.js.map +0 -1
  293. package/dist/src/cli/index.d.ts +0 -8
  294. package/dist/src/cli/index.d.ts.map +0 -1
  295. package/dist/src/cli/index.js +0 -211
  296. package/dist/src/cli/index.js.map +0 -1
  297. package/dist/src/cloud/auth.d.ts +0 -51
  298. package/dist/src/cloud/auth.d.ts.map +0 -1
  299. package/dist/src/cloud/auth.js +0 -194
  300. package/dist/src/cloud/auth.js.map +0 -1
  301. package/dist/src/cloud/billing.d.ts +0 -184
  302. package/dist/src/cloud/billing.d.ts.map +0 -1
  303. package/dist/src/cloud/billing.js +0 -179
  304. package/dist/src/cloud/billing.js.map +0 -1
  305. package/dist/src/cloud/client.d.ts +0 -39
  306. package/dist/src/cloud/client.d.ts.map +0 -1
  307. package/dist/src/cloud/client.js +0 -176
  308. package/dist/src/cloud/client.js.map +0 -1
  309. package/dist/src/cloud/index.d.ts +0 -44
  310. package/dist/src/cloud/index.d.ts.map +0 -1
  311. package/dist/src/cloud/index.js +0 -44
  312. package/dist/src/cloud/index.js.map +0 -1
  313. package/dist/src/cloud/marketplace.d.ts +0 -166
  314. package/dist/src/cloud/marketplace.d.ts.map +0 -1
  315. package/dist/src/cloud/marketplace.js +0 -159
  316. package/dist/src/cloud/marketplace.js.map +0 -1
  317. package/dist/src/cloud/provisioning.d.ts +0 -110
  318. package/dist/src/cloud/provisioning.d.ts.map +0 -1
  319. package/dist/src/cloud/provisioning.js +0 -148
  320. package/dist/src/cloud/provisioning.js.map +0 -1
  321. package/dist/src/cloud/relay/endpoints.d.ts +0 -62
  322. package/dist/src/cloud/relay/endpoints.d.ts.map +0 -1
  323. package/dist/src/cloud/relay/endpoints.js +0 -217
  324. package/dist/src/cloud/relay/endpoints.js.map +0 -1
  325. package/dist/src/cloud/relay/health/index.d.ts +0 -5
  326. package/dist/src/cloud/relay/health/index.d.ts.map +0 -1
  327. package/dist/src/cloud/relay/health/index.js +0 -9
  328. package/dist/src/cloud/relay/health/index.js.map +0 -1
  329. package/dist/src/cloud/relay/stats/index.d.ts +0 -5
  330. package/dist/src/cloud/relay/stats/index.d.ts.map +0 -1
  331. package/dist/src/cloud/relay/stats/index.js +0 -9
  332. package/dist/src/cloud/relay/stats/index.js.map +0 -1
  333. package/dist/src/cloud/relay/sync/index.d.ts +0 -5
  334. package/dist/src/cloud/relay/sync/index.d.ts.map +0 -1
  335. package/dist/src/cloud/relay/sync/index.js +0 -9
  336. package/dist/src/cloud/relay/sync/index.js.map +0 -1
  337. package/dist/src/cloud/relay/usage/index.d.ts +0 -5
  338. package/dist/src/cloud/relay/usage/index.d.ts.map +0 -1
  339. package/dist/src/cloud/relay/usage/index.js +0 -9
  340. package/dist/src/cloud/relay/usage/index.js.map +0 -1
  341. package/dist/src/cloud/sponsors.d.ts +0 -81
  342. package/dist/src/cloud/sponsors.d.ts.map +0 -1
  343. package/dist/src/cloud/sponsors.js +0 -130
  344. package/dist/src/cloud/sponsors.js.map +0 -1
  345. package/dist/src/cloud/types.d.ts +0 -169
  346. package/dist/src/cloud/types.d.ts.map +0 -1
  347. package/dist/src/cloud/types.js +0 -7
  348. package/dist/src/cloud/types.js.map +0 -1
  349. package/dist/src/components/index.d.ts.map +0 -1
  350. package/dist/src/components/index.js +0 -17
  351. package/dist/src/components/index.js.map +0 -1
  352. package/dist/src/core/actors.d.ts +0 -95
  353. package/dist/src/core/actors.d.ts.map +0 -1
  354. package/dist/src/core/actors.js +0 -158
  355. package/dist/src/core/actors.js.map +0 -1
  356. package/dist/src/core/component/generator.d.ts.map +0 -1
  357. package/dist/src/core/component/generator.js +0 -349
  358. package/dist/src/core/component/generator.js.map +0 -1
  359. package/dist/src/core/engine.d.ts +0 -92
  360. package/dist/src/core/engine.d.ts.map +0 -1
  361. package/dist/src/core/engine.js +0 -199
  362. package/dist/src/core/engine.js.map +0 -1
  363. package/dist/src/core/introspection.d.ts +0 -141
  364. package/dist/src/core/introspection.d.ts.map +0 -1
  365. package/dist/src/core/introspection.js +0 -208
  366. package/dist/src/core/introspection.js.map +0 -1
  367. package/dist/src/core/logic/generator.d.ts +0 -76
  368. package/dist/src/core/logic/generator.d.ts.map +0 -1
  369. package/dist/src/core/logic/generator.js +0 -370
  370. package/dist/src/core/logic/generator.js.map +0 -1
  371. package/dist/src/core/pluresdb/adapter.d.ts +0 -72
  372. package/dist/src/core/pluresdb/adapter.d.ts.map +0 -1
  373. package/dist/src/core/pluresdb/adapter.js +0 -73
  374. package/dist/src/core/pluresdb/adapter.js.map +0 -1
  375. package/dist/src/core/pluresdb/generator.d.ts +0 -58
  376. package/dist/src/core/pluresdb/generator.d.ts.map +0 -1
  377. package/dist/src/core/pluresdb/generator.js +0 -191
  378. package/dist/src/core/pluresdb/generator.js.map +0 -1
  379. package/dist/src/core/pluresdb/index.d.ts +0 -15
  380. package/dist/src/core/pluresdb/index.d.ts.map +0 -1
  381. package/dist/src/core/pluresdb/index.js +0 -11
  382. package/dist/src/core/pluresdb/index.js.map +0 -1
  383. package/dist/src/core/pluresdb/schema-registry.d.ts +0 -104
  384. package/dist/src/core/pluresdb/schema-registry.d.ts.map +0 -1
  385. package/dist/src/core/pluresdb/schema-registry.js +0 -130
  386. package/dist/src/core/pluresdb/schema-registry.js.map +0 -1
  387. package/dist/src/core/pluresdb/store.d.ts +0 -199
  388. package/dist/src/core/pluresdb/store.d.ts.map +0 -1
  389. package/dist/src/core/pluresdb/store.js +0 -344
  390. package/dist/src/core/pluresdb/store.js.map +0 -1
  391. package/dist/src/core/protocol.d.ts.map +0 -1
  392. package/dist/src/core/protocol.js +0 -46
  393. package/dist/src/core/protocol.js.map +0 -1
  394. package/dist/src/core/rules.d.ts +0 -120
  395. package/dist/src/core/rules.d.ts.map +0 -1
  396. package/dist/src/core/rules.js +0 -81
  397. package/dist/src/core/rules.js.map +0 -1
  398. package/dist/src/core/schema/loader.d.ts +0 -47
  399. package/dist/src/core/schema/loader.d.ts.map +0 -1
  400. package/dist/src/core/schema/loader.js +0 -189
  401. package/dist/src/core/schema/loader.js.map +0 -1
  402. package/dist/src/core/schema/normalize.d.ts +0 -72
  403. package/dist/src/core/schema/normalize.d.ts.map +0 -1
  404. package/dist/src/core/schema/normalize.js +0 -190
  405. package/dist/src/core/schema/normalize.js.map +0 -1
  406. package/dist/src/core/schema/types.d.ts.map +0 -1
  407. package/dist/src/core/schema/types.js +0 -161
  408. package/dist/src/core/schema/types.js.map +0 -1
  409. package/dist/src/dsl/index.d.ts +0 -152
  410. package/dist/src/dsl/index.d.ts.map +0 -1
  411. package/dist/src/dsl/index.js +0 -132
  412. package/dist/src/dsl/index.js.map +0 -1
  413. package/dist/src/dsl.d.ts +0 -124
  414. package/dist/src/dsl.d.ts.map +0 -1
  415. package/dist/src/dsl.js +0 -130
  416. package/dist/src/dsl.js.map +0 -1
  417. package/dist/src/examples/advanced-todo/index.d.ts +0 -55
  418. package/dist/src/examples/advanced-todo/index.d.ts.map +0 -1
  419. package/dist/src/examples/advanced-todo/index.js +0 -222
  420. package/dist/src/examples/advanced-todo/index.js.map +0 -1
  421. package/dist/src/examples/auth-basic/index.d.ts +0 -17
  422. package/dist/src/examples/auth-basic/index.d.ts.map +0 -1
  423. package/dist/src/examples/auth-basic/index.js +0 -122
  424. package/dist/src/examples/auth-basic/index.js.map +0 -1
  425. package/dist/src/examples/cart/index.d.ts +0 -19
  426. package/dist/src/examples/cart/index.d.ts.map +0 -1
  427. package/dist/src/examples/cart/index.js +0 -202
  428. package/dist/src/examples/cart/index.js.map +0 -1
  429. package/dist/src/examples/hero-ecommerce/index.d.ts +0 -39
  430. package/dist/src/examples/hero-ecommerce/index.d.ts.map +0 -1
  431. package/dist/src/examples/hero-ecommerce/index.js +0 -506
  432. package/dist/src/examples/hero-ecommerce/index.js.map +0 -1
  433. package/dist/src/examples/svelte-counter/index.d.ts +0 -31
  434. package/dist/src/examples/svelte-counter/index.d.ts.map +0 -1
  435. package/dist/src/examples/svelte-counter/index.js +0 -123
  436. package/dist/src/examples/svelte-counter/index.js.map +0 -1
  437. package/dist/src/flows.d.ts +0 -125
  438. package/dist/src/flows.d.ts.map +0 -1
  439. package/dist/src/flows.js +0 -160
  440. package/dist/src/flows.js.map +0 -1
  441. package/dist/src/index.d.ts +0 -77
  442. package/dist/src/index.d.ts.map +0 -1
  443. package/dist/src/index.js +0 -64
  444. package/dist/src/index.js.map +0 -1
  445. package/dist/src/integrations/code-canvas.d.ts +0 -265
  446. package/dist/src/integrations/code-canvas.d.ts.map +0 -1
  447. package/dist/src/integrations/code-canvas.js +0 -451
  448. package/dist/src/integrations/code-canvas.js.map +0 -1
  449. package/dist/src/integrations/pluresdb.d.ts +0 -117
  450. package/dist/src/integrations/pluresdb.d.ts.map +0 -1
  451. package/dist/src/integrations/pluresdb.js +0 -117
  452. package/dist/src/integrations/pluresdb.js.map +0 -1
  453. package/dist/src/integrations/state-docs.d.ts +0 -191
  454. package/dist/src/integrations/state-docs.d.ts.map +0 -1
  455. package/dist/src/integrations/state-docs.js +0 -515
  456. package/dist/src/integrations/state-docs.js.map +0 -1
  457. package/dist/src/integrations/svelte.d.ts.map +0 -1
  458. package/dist/src/integrations/svelte.js +0 -447
  459. package/dist/src/integrations/svelte.js.map +0 -1
  460. package/dist/src/integrations/tauri.d.ts +0 -360
  461. package/dist/src/integrations/tauri.d.ts.map +0 -1
  462. package/dist/src/integrations/tauri.js +0 -278
  463. package/dist/src/integrations/tauri.js.map +0 -1
  464. package/dist/src/integrations/unum.d.ts +0 -159
  465. package/dist/src/integrations/unum.d.ts.map +0 -1
  466. package/dist/src/integrations/unum.js +0 -240
  467. package/dist/src/integrations/unum.js.map +0 -1
  468. package/dist/src/registry.d.ts +0 -94
  469. package/dist/src/registry.d.ts.map +0 -1
  470. package/dist/src/registry.js +0 -181
  471. package/dist/src/registry.js.map +0 -1
  472. package/dist/src/runtime/terminal-adapter.d.ts.map +0 -1
  473. package/dist/src/runtime/terminal-adapter.js +0 -239
  474. package/dist/src/runtime/terminal-adapter.js.map +0 -1
  475. package/dist/src/step.d.ts +0 -34
  476. package/dist/src/step.d.ts.map +0 -1
  477. package/dist/src/step.js +0 -111
  478. package/dist/src/step.js.map +0 -1
  479. package/dist/src/types.d.ts +0 -63
  480. package/dist/src/types.d.ts.map +0 -1
  481. package/dist/src/types.js +0 -6
  482. package/dist/src/types.js.map +0 -1
  483. package/dist/tools/cli/commands/index.d.ts +0 -7
  484. package/dist/tools/cli/commands/index.d.ts.map +0 -1
  485. package/dist/tools/cli/commands/index.js +0 -7
  486. package/dist/tools/cli/commands/index.js.map +0 -1
  487. package/dist/tools/cli/index.d.ts +0 -8
  488. package/dist/tools/cli/index.d.ts.map +0 -1
  489. package/dist/tools/cli/index.js +0 -9
  490. package/dist/tools/cli/index.js.map +0 -1
  491. package/dist/tools/watcher/index.d.ts +0 -105
  492. package/dist/tools/watcher/index.d.ts.map +0 -1
  493. package/dist/tools/watcher/index.js +0 -213
  494. package/dist/tools/watcher/index.js.map +0 -1
  495. package/dist/ui/canvas/canvas-projection.d.ts +0 -78
  496. package/dist/ui/canvas/canvas-projection.d.ts.map +0 -1
  497. package/dist/ui/canvas/canvas-projection.js +0 -416
  498. package/dist/ui/canvas/canvas-projection.js.map +0 -1
  499. package/dist/ui/canvas/canvas-state.d.ts +0 -200
  500. package/dist/ui/canvas/canvas-state.d.ts.map +0 -1
  501. package/dist/ui/canvas/canvas-state.js +0 -464
  502. package/dist/ui/canvas/canvas-state.js.map +0 -1
  503. package/dist/ui/canvas/components/index.d.ts +0 -95
  504. package/dist/ui/canvas/components/index.d.ts.map +0 -1
  505. package/dist/ui/canvas/components/index.js +0 -19
  506. package/dist/ui/canvas/components/index.js.map +0 -1
  507. package/dist/ui/canvas/index.d.ts +0 -32
  508. package/dist/ui/canvas/index.d.ts.map +0 -1
  509. package/dist/ui/canvas/index.js +0 -32
  510. package/dist/ui/canvas/index.js.map +0 -1
  511. package/dist/ui/svelte-generator/index.d.ts +0 -9
  512. package/dist/ui/svelte-generator/index.d.ts.map +0 -1
  513. package/dist/ui/svelte-generator/index.js +0 -11
  514. package/dist/ui/svelte-generator/index.js.map +0 -1
  515. package/dist/ui/svelte-generator/psf-generator.d.ts +0 -128
  516. package/dist/ui/svelte-generator/psf-generator.d.ts.map +0 -1
  517. package/dist/ui/svelte-generator/psf-generator.js +0 -506
  518. package/dist/ui/svelte-generator/psf-generator.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Svelte v5 Integration
3
- *
3
+ *
4
4
  * Provides reactive bindings for Praxis logic engines in Svelte v5 applications.
5
5
  * Supports both traditional stores and modern Svelte 5 runes ($state, $derived, $effect).
6
- *
6
+ *
7
7
  * Features:
8
8
  * - Store-based API for backward compatibility
9
9
  * - Runes-based composables for Svelte 5
@@ -12,8 +12,8 @@
12
12
  * - Automatic cleanup and subscription management
13
13
  */
14
14
 
15
- import type { LogicEngine } from "../core/engine.js";
16
- import type { PraxisEvent, PraxisState } from "../core/protocol.js";
15
+ import type { LogicEngine } from '../core/engine.js';
16
+ import type { PraxisEvent, PraxisState } from '../core/protocol.js';
17
17
 
18
18
  /**
19
19
  * Writable store interface (Svelte-compatible)
@@ -33,16 +33,16 @@ export interface Readable<T> {
33
33
 
34
34
  /**
35
35
  * Create a reactive Svelte store from a Praxis engine.
36
- *
36
+ *
37
37
  * The store tracks the engine's state and provides methods to dispatch events.
38
- *
38
+ *
39
39
  * @example
40
40
  * const engine = createPraxisEngine({ ... });
41
41
  * const store = createPraxisStore(engine);
42
- *
42
+ *
43
43
  * // In Svelte component:
44
44
  * $: state = $store;
45
- *
45
+ *
46
46
  * // Dispatch events:
47
47
  * store.dispatch([Login.create({ username: "alice", password: "secret" })]);
48
48
  */
@@ -76,11 +76,11 @@ export function createPraxisStore<TContext = unknown>(
76
76
 
77
77
  /**
78
78
  * Create a derived store that extracts the context from the engine state.
79
- *
79
+ *
80
80
  * @example
81
81
  * const engine = createPraxisEngine({ ... });
82
82
  * const contextStore = createContextStore(engine);
83
- *
83
+ *
84
84
  * // In Svelte component:
85
85
  * $: context = $contextStore;
86
86
  */
@@ -114,11 +114,11 @@ export function createContextStore<TContext = unknown>(
114
114
 
115
115
  /**
116
116
  * Create a derived store that extracts specific data from the context.
117
- *
117
+ *
118
118
  * @example
119
119
  * const engine = createPraxisEngine<{ count: number }>({ ... });
120
120
  * const countStore = createDerivedStore(engine, (ctx) => ctx.count);
121
- *
121
+ *
122
122
  * // In Svelte component:
123
123
  * $: count = $countStore;
124
124
  */
@@ -207,34 +207,34 @@ export interface PraxisEngineBinding<TContext = unknown> {
207
207
 
208
208
  /**
209
209
  * Create a reactive binding to a Praxis engine with Svelte 5 runes support.
210
- *
210
+ *
211
211
  * This composable provides a runes-compatible API for integrating Praxis
212
212
  * with Svelte 5 components. The returned state is reactive and will
213
213
  * automatically update the component when the engine state changes.
214
- *
214
+ *
215
215
  * Note: The history/snapshot feature tracks state snapshots but doesn't
216
216
  * restore the engine to previous states. When you navigate history (undo/redo),
217
217
  * you're viewing past snapshots, but new events are still applied to the
218
218
  * current engine state. For true undo/redo, use createHistoryEngine or
219
219
  * implement state restoration in your application logic.
220
- *
220
+ *
221
221
  * @example
222
222
  * <script>
223
223
  * import { usePraxisEngine } from '@plures/praxis/svelte';
224
224
  * import { createMyEngine } from './my-engine';
225
- *
225
+ *
226
226
  * const engine = createMyEngine();
227
227
  * const { context, dispatch, undo, canUndo } = usePraxisEngine(engine, {
228
228
  * enableHistory: true
229
229
  * });
230
230
  * </script>
231
- *
231
+ *
232
232
  * <div>
233
233
  * <p>Count: {context.count}</p>
234
234
  * <button onclick={() => dispatch([Increment.create({})])}>+</button>
235
235
  * <button onclick={() => undo()} disabled={!canUndo}>Undo</button>
236
236
  * </div>
237
- *
237
+ *
238
238
  * @param engine The Praxis logic engine
239
239
  * @param options Configuration options
240
240
  * @returns Reactive binding with state, context, and control methods
@@ -277,7 +277,7 @@ export function usePraxisEngine<TContext = unknown>(
277
277
  state: currentState,
278
278
  events,
279
279
  });
280
-
280
+
281
281
  // Limit history size
282
282
  if (snapshots.length > maxHistorySize) {
283
283
  snapshots.shift();
@@ -292,7 +292,7 @@ export function usePraxisEngine<TContext = unknown>(
292
292
  console.warn('History is not enabled for this engine');
293
293
  return;
294
294
  }
295
-
295
+
296
296
  if (index < 0 || index >= snapshots.length) {
297
297
  console.warn(`Invalid snapshot index: ${index}`);
298
298
  return;
@@ -345,20 +345,20 @@ export function usePraxisEngine<TContext = unknown>(
345
345
 
346
346
  /**
347
347
  * Create a reactive derived value from engine context with Svelte 5 runes.
348
- *
348
+ *
349
349
  * This composable extracts and tracks a specific value from the engine context.
350
350
  * The returned value is reactive and will update when the selected value changes.
351
- *
351
+ *
352
352
  * @example
353
353
  * <script>
354
354
  * import { usePraxisContext } from '@plures/praxis/svelte';
355
- *
355
+ *
356
356
  * const engine = createMyEngine();
357
357
  * const count = usePraxisContext(engine, (ctx) => ctx.count);
358
358
  * </script>
359
- *
359
+ *
360
360
  * <p>Count: {count}</p>
361
- *
361
+ *
362
362
  * @param engine The Praxis logic engine
363
363
  * @param selector Function to extract value from context
364
364
  * @returns Reactive derived value
@@ -373,21 +373,21 @@ export function usePraxisContext<TContext = unknown, TDerived = unknown>(
373
373
 
374
374
  /**
375
375
  * Subscribe to engine state changes with automatic cleanup.
376
- *
376
+ *
377
377
  * This composable sets up a subscription to engine state changes and
378
378
  * automatically cleans up when the component is destroyed.
379
- *
379
+ *
380
380
  * @example
381
381
  * <script>
382
382
  * import { usePraxisSubscription } from '@plures/praxis/svelte';
383
- *
383
+ *
384
384
  * const engine = createMyEngine();
385
- *
385
+ *
386
386
  * usePraxisSubscription(engine, (state) => {
387
387
  * console.log('State changed:', state);
388
388
  * });
389
389
  * </script>
390
- *
390
+ *
391
391
  * @param engine The Praxis logic engine
392
392
  * @param callback Function to call when state changes
393
393
  */
@@ -543,20 +543,20 @@ export class HistoryStateManager<TContext = unknown> {
543
543
 
544
544
  /**
545
545
  * Create a Praxis engine with history tracking.
546
- *
546
+ *
547
547
  * This utility wraps an engine with automatic history recording,
548
548
  * providing undo/redo functionality.
549
- *
549
+ *
550
550
  * @example
551
551
  * const engine = createPraxisEngine({ ... });
552
552
  * const { dispatch, undo, redo, canUndo, canRedo } = createHistoryEngine(engine);
553
- *
553
+ *
554
554
  * // Use normally
555
555
  * dispatch([Login.create({ username: "alice" })]);
556
- *
556
+ *
557
557
  * // Undo the login
558
558
  * undo();
559
- *
559
+ *
560
560
  * @param engine The base Praxis engine
561
561
  * @param options History configuration
562
562
  * @returns Enhanced engine with history methods
@@ -1,21 +1,21 @@
1
1
  /**
2
2
  * Tauri Integration
3
- *
3
+ *
4
4
  * Integration with plures/svelte-tauri-template for cross-platform desktop applications.
5
5
  * Provides Praxis engine integration with Tauri 2 for native desktop capabilities.
6
- *
6
+ *
7
7
  * Features:
8
8
  * - Cross-Platform: Windows, macOS, Linux, Android, iOS
9
9
  * - Native Integration: File system, system tray, notifications
10
10
  * - IPC Bridge: Type-safe communication between Rust and TypeScript
11
11
  * - Auto-Updates: Built-in update system
12
12
  * - Code Signing: Support for signed releases
13
- *
13
+ *
14
14
  * @see https://github.com/plures/svelte-tauri-template
15
15
  */
16
16
 
17
- import type { LogicEngine } from "../core/engine.js";
18
- import type { PraxisEvent } from "../core/protocol.js";
17
+ import type { LogicEngine } from '../core/engine.js';
18
+ import type { PraxisEvent } from '../core/protocol.js';
19
19
 
20
20
  /**
21
21
  * Tauri app configuration
@@ -233,7 +233,7 @@ export interface TauriNotificationOptions {
233
233
 
234
234
  /**
235
235
  * Tauri bridge for Praxis integration
236
- *
236
+ *
237
237
  * Provides type-safe access to Tauri APIs from Praxis applications.
238
238
  */
239
239
  export interface TauriBridge {
@@ -243,25 +243,25 @@ export interface TauriBridge {
243
243
  version: string;
244
244
  tauriVersion: string;
245
245
  };
246
-
246
+
247
247
  /** File system operations */
248
248
  fs: TauriFS;
249
-
249
+
250
250
  /** System tray operations */
251
251
  tray: TauriTray;
252
-
252
+
253
253
  /** Notification operations */
254
254
  notification: TauriNotification;
255
-
255
+
256
256
  /** Invoke a Tauri command */
257
257
  invoke<T = unknown>(cmd: string, payload?: unknown): Promise<T>;
258
-
258
+
259
259
  /** Listen to a Tauri event */
260
260
  listen<T = unknown>(event: string, handler: (event: TauriEvent<T>) => void): Promise<() => void>;
261
-
261
+
262
262
  /** Emit a Tauri event */
263
263
  emit(event: string, payload?: unknown): Promise<void>;
264
-
264
+
265
265
  /** Get window operations */
266
266
  window: {
267
267
  /** Minimize window */
@@ -283,10 +283,10 @@ export interface TauriBridge {
283
283
  /** Focus window */
284
284
  focus(): Promise<void>;
285
285
  };
286
-
286
+
287
287
  /** Check for updates */
288
288
  checkForUpdates(): Promise<TauriUpdateInfo | null>;
289
-
289
+
290
290
  /** Install update */
291
291
  installUpdate(): Promise<void>;
292
292
  }
@@ -311,75 +311,75 @@ export interface TauriUpdateInfo {
311
311
  export interface TauriPraxisAdapter<TContext = unknown> {
312
312
  /** Save engine state to file */
313
313
  saveState(state: TContext): Promise<void>;
314
-
314
+
315
315
  /** Load engine state from file */
316
316
  loadState(): Promise<TContext | null>;
317
-
317
+
318
318
  /** Save events to file */
319
319
  saveEvents(events: PraxisEvent[]): Promise<void>;
320
-
320
+
321
321
  /** Load events from file */
322
322
  loadEvents(): Promise<PraxisEvent[]>;
323
-
323
+
324
324
  /** Watch for file changes */
325
325
  watchStateFile(handler: (state: TContext) => void): Promise<() => void>;
326
-
326
+
327
327
  /** Get state file path */
328
328
  getStatePath(): string;
329
-
329
+
330
330
  /** Get events file path */
331
331
  getEventsPath(): string;
332
332
  }
333
333
 
334
334
  /**
335
335
  * Create a mock Tauri bridge for development/testing
336
- *
336
+ *
337
337
  * This provides a mock implementation that works without Tauri runtime.
338
338
  */
339
339
  export function createMockTauriBridge(): TauriBridge {
340
340
  const eventHandlers = new Map<string, Set<(event: TauriEvent) => void>>();
341
341
  const storage = new Map<string, unknown>();
342
-
342
+
343
343
  return {
344
344
  app: {
345
345
  name: 'Mock App',
346
346
  version: '0.0.0',
347
347
  tauriVersion: 'mock',
348
348
  },
349
-
349
+
350
350
  fs: {
351
351
  async readFile(path: string): Promise<Uint8Array> {
352
352
  const data = storage.get(path);
353
353
  if (data instanceof Uint8Array) return data;
354
354
  throw new Error(`File not found: ${path}`);
355
355
  },
356
-
356
+
357
357
  async readTextFile(path: string): Promise<string> {
358
358
  const data = storage.get(path);
359
359
  if (typeof data === 'string') return data;
360
360
  throw new Error(`File not found: ${path}`);
361
361
  },
362
-
362
+
363
363
  async writeFile(path: string, data: Uint8Array): Promise<void> {
364
364
  storage.set(path, data);
365
365
  },
366
-
366
+
367
367
  async writeTextFile(path: string, data: string): Promise<void> {
368
368
  storage.set(path, data);
369
369
  },
370
-
370
+
371
371
  async exists(path: string): Promise<boolean> {
372
372
  return storage.has(path);
373
373
  },
374
-
374
+
375
375
  async mkdir(_path: string, _options?: { recursive?: boolean }): Promise<void> {
376
376
  // No-op for mock
377
377
  },
378
-
378
+
379
379
  async remove(path: string, _options?: { recursive?: boolean }): Promise<void> {
380
380
  storage.delete(path);
381
381
  },
382
-
382
+
383
383
  async rename(oldPath: string, newPath: string): Promise<void> {
384
384
  const data = storage.get(oldPath);
385
385
  if (data !== undefined) {
@@ -387,12 +387,12 @@ export function createMockTauriBridge(): TauriBridge {
387
387
  storage.delete(oldPath);
388
388
  }
389
389
  },
390
-
390
+
391
391
  async readDir(_path: string): Promise<TauriFileEntry[]> {
392
392
  return [];
393
393
  },
394
394
  },
395
-
395
+
396
396
  tray: {
397
397
  async setIcon(_icon: string | Uint8Array): Promise<void> {},
398
398
  async setTooltip(_tooltip: string): Promise<void> {},
@@ -400,7 +400,7 @@ export function createMockTauriBridge(): TauriBridge {
400
400
  async show(): Promise<void> {},
401
401
  async hide(): Promise<void> {},
402
402
  },
403
-
403
+
404
404
  notification: {
405
405
  async send(options: TauriNotificationOptions): Promise<void> {
406
406
  console.log('Mock notification:', options.title, options.body);
@@ -412,31 +412,34 @@ export function createMockTauriBridge(): TauriBridge {
412
412
  return 'granted';
413
413
  },
414
414
  },
415
-
415
+
416
416
  async invoke<T = unknown>(cmd: string, payload?: unknown): Promise<T> {
417
417
  console.log('Mock invoke:', cmd, payload);
418
418
  return null as T;
419
419
  },
420
-
421
- async listen<T = unknown>(event: string, handler: (event: TauriEvent<T>) => void): Promise<() => void> {
420
+
421
+ async listen<T = unknown>(
422
+ event: string,
423
+ handler: (event: TauriEvent<T>) => void
424
+ ): Promise<() => void> {
422
425
  if (!eventHandlers.has(event)) {
423
426
  eventHandlers.set(event, new Set());
424
427
  }
425
428
  eventHandlers.get(event)!.add(handler as (event: TauriEvent) => void);
426
-
429
+
427
430
  return () => {
428
431
  eventHandlers.get(event)?.delete(handler as (event: TauriEvent) => void);
429
432
  };
430
433
  },
431
-
434
+
432
435
  async emit(event: string, payload?: unknown): Promise<void> {
433
436
  const handlers = eventHandlers.get(event);
434
437
  if (handlers) {
435
438
  const tauriEvent: TauriEvent = { event, payload };
436
- handlers.forEach(h => h(tauriEvent));
439
+ handlers.forEach((h) => h(tauriEvent));
437
440
  }
438
441
  },
439
-
442
+
440
443
  window: {
441
444
  async minimize(): Promise<void> {},
442
445
  async maximize(): Promise<void> {},
@@ -448,31 +451,31 @@ export function createMockTauriBridge(): TauriBridge {
448
451
  async hide(): Promise<void> {},
449
452
  async focus(): Promise<void> {},
450
453
  },
451
-
454
+
452
455
  async checkForUpdates(): Promise<TauriUpdateInfo | null> {
453
456
  return null;
454
457
  },
455
-
458
+
456
459
  async installUpdate(): Promise<void> {},
457
460
  };
458
461
  }
459
462
 
460
463
  /**
461
464
  * Create a Tauri-Praxis adapter for engine persistence
462
- *
465
+ *
463
466
  * @example
464
467
  * ```typescript
465
468
  * import { createTauriPraxisAdapter } from '@plures/praxis/integrations/tauri';
466
- *
469
+ *
467
470
  * const adapter = createTauriPraxisAdapter({
468
471
  * bridge: tauriBridge,
469
472
  * statePath: 'app-state.json',
470
473
  * eventsPath: 'app-events.json',
471
474
  * });
472
- *
475
+ *
473
476
  * // Save state
474
477
  * await adapter.saveState(engine.getContext());
475
- *
478
+ *
476
479
  * // Load state
477
480
  * const savedState = await adapter.loadState();
478
481
  * ```
@@ -483,53 +486,53 @@ export function createTauriPraxisAdapter<TContext = unknown>(options: {
483
486
  eventsPath?: string;
484
487
  }): TauriPraxisAdapter<TContext> {
485
488
  const { bridge, statePath = 'praxis-state.json', eventsPath = 'praxis-events.json' } = options;
486
-
489
+
487
490
  return {
488
491
  async saveState(state: TContext): Promise<void> {
489
492
  const json = JSON.stringify(state, null, 2);
490
493
  await bridge.fs.writeTextFile(statePath, json);
491
494
  },
492
-
495
+
493
496
  async loadState(): Promise<TContext | null> {
494
497
  try {
495
498
  const exists = await bridge.fs.exists(statePath);
496
499
  if (!exists) return null;
497
-
500
+
498
501
  const json = await bridge.fs.readTextFile(statePath);
499
502
  return JSON.parse(json) as TContext;
500
503
  } catch {
501
504
  return null;
502
505
  }
503
506
  },
504
-
507
+
505
508
  async saveEvents(events: PraxisEvent[]): Promise<void> {
506
509
  const json = JSON.stringify(events, null, 2);
507
510
  await bridge.fs.writeTextFile(eventsPath, json);
508
511
  },
509
-
512
+
510
513
  async loadEvents(): Promise<PraxisEvent[]> {
511
514
  try {
512
515
  const exists = await bridge.fs.exists(eventsPath);
513
516
  if (!exists) return [];
514
-
517
+
515
518
  const json = await bridge.fs.readTextFile(eventsPath);
516
519
  return JSON.parse(json) as PraxisEvent[];
517
520
  } catch {
518
521
  return [];
519
522
  }
520
523
  },
521
-
524
+
522
525
  async watchStateFile(_handler: (state: TContext) => void): Promise<() => void> {
523
526
  // In a real implementation, this would use Tauri's fs watch API
524
527
  // For now, we'll just return a no-op cleanup function
525
528
  console.log('File watching not implemented in mock');
526
529
  return () => {};
527
530
  },
528
-
531
+
529
532
  getStatePath(): string {
530
533
  return statePath;
531
534
  },
532
-
535
+
533
536
  getEventsPath(): string {
534
537
  return eventsPath;
535
538
  },
@@ -538,16 +541,16 @@ export function createTauriPraxisAdapter<TContext = unknown>(options: {
538
541
 
539
542
  /**
540
543
  * Attach Tauri bridge to a Praxis engine for auto-save
541
- *
544
+ *
542
545
  * @example
543
546
  * ```typescript
544
547
  * import { attachTauriToEngine } from '@plures/praxis/integrations/tauri';
545
- *
548
+ *
546
549
  * const cleanup = attachTauriToEngine(engine, adapter, {
547
550
  * autoSave: true,
548
551
  * saveInterval: 5000,
549
552
  * });
550
- *
553
+ *
551
554
  * // Later, cleanup subscriptions
552
555
  * cleanup();
553
556
  * ```
@@ -562,15 +565,15 @@ export function attachTauriToEngine<TContext>(
562
565
  ): () => void {
563
566
  const { autoSave = true, saveInterval = 5000 } = options;
564
567
  const cleanupFns: Array<() => void> = [];
565
-
568
+
566
569
  if (autoSave) {
567
570
  let saveTimer: ReturnType<typeof setTimeout> | null = null;
568
571
  let pendingSave = false;
569
-
572
+
570
573
  const debouncedSave = async () => {
571
574
  pendingSave = true;
572
575
  if (saveTimer) clearTimeout(saveTimer);
573
-
576
+
574
577
  saveTimer = setTimeout(async () => {
575
578
  if (pendingSave) {
576
579
  await adapter.saveState(engine.getContext());
@@ -578,22 +581,22 @@ export function attachTauriToEngine<TContext>(
578
581
  }
579
582
  }, saveInterval);
580
583
  };
581
-
584
+
582
585
  // Note: In a future implementation, this would hook into engine state changes
583
586
  // For now, we provide manual save on interval if state is dirty
584
587
  // The caller can trigger debouncedSave manually after engine.step() calls
585
-
588
+
586
589
  // Initial save setup - clean up timer on dispose
587
590
  cleanupFns.push(() => {
588
591
  if (saveTimer) clearTimeout(saveTimer);
589
592
  });
590
-
593
+
591
594
  // Expose a way to trigger save (for future use)
592
595
  void debouncedSave;
593
596
  }
594
-
597
+
595
598
  return () => {
596
- cleanupFns.forEach(fn => fn());
599
+ cleanupFns.forEach((fn) => fn());
597
600
  };
598
601
  }
599
602
 
@@ -602,7 +605,8 @@ export function attachTauriToEngine<TContext>(
602
605
  */
603
606
  export function generateTauriConfig(config: TauriAppConfig): Record<string, unknown> {
604
607
  return {
605
- $schema: "https://raw.githubusercontent.com/tauri-apps/tauri/tauri-v2.0.0/core/tauri-config-schema/schema.json",
608
+ $schema:
609
+ 'https://raw.githubusercontent.com/tauri-apps/tauri/tauri-v2.0.0/core/tauri-config-schema/schema.json',
606
610
  productName: config.name,
607
611
  version: config.version,
608
612
  identifier: config.identifier,
@@ -628,11 +632,9 @@ export function generateTauriConfig(config: TauriAppConfig): Record<string, unkn
628
632
  },
629
633
  },
630
634
  build: {
631
- devUrl: "http://localhost:5173",
632
- frontendDist: "../dist",
635
+ devUrl: 'http://localhost:5173',
636
+ frontendDist: '../dist',
633
637
  },
634
- plugins: Object.fromEntries(
635
- (config.plugins || []).map(p => [p.name, p.config || {}])
636
- ),
638
+ plugins: Object.fromEntries((config.plugins || []).map((p) => [p.name, p.config || {}])),
637
639
  };
638
640
  }