@plures/praxis 1.0.3 → 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.
- package/FRAMEWORK.md +55 -5
- package/LICENSE +21 -21
- package/README.md +162 -375
- package/core/codegen/docs-generator.ts +5 -2
- package/core/codegen/index.ts +1 -1
- package/core/codegen/ts-generator.ts +15 -15
- package/core/db-adapter/index.ts +2 -2
- package/core/db-adapter/sync-engine.ts +17 -6
- package/core/logic-engine/engine.ts +1 -1
- package/core/logic-engine/index.ts +2 -2
- package/core/logic-engine/protocol.ts +1 -1
- package/core/logic-engine/psf-adapter.ts +8 -4
- package/core/logic-engine/rules.ts +1 -1
- package/core/schema-engine/compiler.ts +53 -11
- package/core/schema-engine/generator.ts +17 -7
- package/core/schema-engine/index.ts +2 -2
- package/core/schema-engine/psf.ts +12 -3
- package/core/schema-engine/types.ts +3 -11
- package/core/schema-engine/validator.ts +112 -22
- package/dist/browser/engine-BjdqxeXG.d.ts +333 -0
- package/dist/browser/index.d.ts +3004 -0
- package/dist/browser/index.js +2892 -0
- package/dist/{src → browser}/integrations/svelte.d.ts +19 -17
- package/dist/browser/integrations/svelte.js +298 -0
- package/dist/node/auth-STARLY7I.js +207 -0
- package/dist/node/build-Y7OT5VBF.js +144 -0
- package/dist/node/canvas-UERZHJYW.js +362 -0
- package/dist/node/chunk-DSDC2JWZ.js +256 -0
- package/dist/node/chunk-FXQZXAWF.js +175 -0
- package/dist/node/chunk-N5Y37EUV.js +202 -0
- package/dist/node/chunk-QGM4M3NI.js +37 -0
- package/dist/node/chunk-RJMWCNHR.js +175 -0
- package/dist/node/chunk-SRM3OPPM.js +404 -0
- package/dist/node/chunk-UATVJBNV.js +175 -0
- package/dist/node/chunk-UY7YEBE2.js +159 -0
- package/dist/node/chunk-XCY2VIFX.js +143 -0
- package/dist/node/chunk-YXH4Y7ZZ.js +349 -0
- package/dist/node/cli/index.cjs +217418 -0
- package/dist/node/cli/index.d.cts +1 -0
- package/dist/node/cli/index.d.ts +1 -0
- package/dist/node/cli/index.js +690 -0
- package/dist/node/cloud/index.cjs +1043 -0
- package/dist/node/cloud/index.d.cts +864 -0
- package/dist/node/cloud/index.d.ts +864 -0
- package/dist/node/cloud/index.js +456 -0
- package/dist/node/cloud-AXOK4PSN.js +212 -0
- package/dist/node/component.cjs +374 -0
- package/dist/node/component.d.cts +125 -0
- package/dist/{src/core/component/generator.d.ts → node/component.d.ts} +11 -8
- package/dist/node/component.js +9 -0
- package/dist/node/components/index.cjs +216 -0
- package/dist/node/components/index.d.cts +43 -0
- package/dist/{src → node}/components/index.d.ts +8 -8
- package/dist/node/components/index.js +7 -0
- package/dist/node/create-TRLSVCNQ.js +584 -0
- package/dist/node/dev-PMJZUYGE.js +65 -0
- package/dist/node/engine-1iqLe6_P.d.ts +214 -0
- package/dist/node/engine-CVJobhHm.d.cts +214 -0
- package/dist/node/index.cjs +3247 -0
- package/dist/node/index.d.cts +2579 -0
- package/dist/node/index.d.ts +2579 -0
- package/dist/node/index.js +2098 -0
- package/dist/node/integrations/svelte.cjs +330 -0
- package/dist/node/integrations/svelte.d.cts +309 -0
- package/dist/node/integrations/svelte.d.ts +309 -0
- package/dist/node/integrations/svelte.js +300 -0
- package/dist/node/orchestrate-737TCL5H.js +127 -0
- package/dist/{src/core/protocol.d.ts → node/protocol-Qek7ebBl.d.cts} +11 -10
- package/dist/node/protocol-Qek7ebBl.d.ts +122 -0
- package/dist/node/schema.cjs +200 -0
- package/dist/{src/core/schema/types.d.ts → node/schema.d.cts} +30 -29
- package/dist/node/schema.d.ts +371 -0
- package/dist/node/schema.js +9 -0
- package/dist/{src/runtime/terminal-adapter.d.ts → node/terminal-adapter-07HGftGQ.d.ts} +86 -11
- package/dist/node/terminal-adapter-XLtCjjb_.d.cts +231 -0
- package/dist/node/verify-YBZ7W24H.js +213239 -0
- package/docs/MONETIZATION.md +21 -16
- package/docs/REACTIVE_REDESIGN.md +132 -0
- package/docs/README.md +47 -36
- package/docs/SVELTE_INTEGRATION_STRATEGY.md +68 -0
- package/docs/TERMINAL_NODE.md +27 -24
- package/docs/core/building-extensions.md +58 -61
- package/docs/core/cli-usage.md +59 -59
- package/docs/core/code-canvas-sync.md +28 -16
- package/docs/core/logic-engine.md +77 -82
- package/docs/core/pluresdb-integration.md +29 -39
- package/docs/core/schema-model.md +66 -52
- package/docs/core/ui-generation.md +57 -49
- package/docs/core/what-is-praxis.md +32 -15
- package/docs/guides/canvas.md +21 -5
- package/docs/guides/getting-started.md +13 -7
- package/docs/guides/history-state-pattern.md +65 -51
- package/docs/guides/orchestration.md +46 -32
- package/docs/guides/parallel-state-pattern.md +56 -72
- package/docs/guides/svelte-integration.md +45 -53
- package/docs/tutorials/README.md +16 -0
- package/docs/tutorials/ecommerce-cart.md +177 -95
- package/docs/tutorials/first-app.md +26 -41
- package/docs/tutorials/form-builder.md +191 -138
- package/docs/tutorials/todo-pluresdb.md +71 -69
- package/package.json +132 -97
- package/src/__tests__/actors.test.ts +68 -68
- package/src/__tests__/billing.test.ts +32 -32
- package/src/__tests__/canvas-components.test.ts +94 -73
- package/src/__tests__/cli-create.test.ts +28 -28
- package/src/__tests__/cloud.test.ts +36 -36
- package/src/__tests__/code-canvas-integration.test.ts +132 -141
- package/src/__tests__/docs-generator.test.ts +3 -9
- package/src/__tests__/dsl.test.ts +58 -64
- package/src/__tests__/edge-cases.test.ts +106 -108
- package/src/__tests__/engine.test.ts +51 -25
- package/src/__tests__/generators.test.ts +42 -44
- package/src/__tests__/introspection.test.ts +104 -114
- package/src/__tests__/pluresdb.test.ts +189 -187
- package/src/__tests__/protocol.test.ts +15 -15
- package/src/__tests__/provisioning.test.ts +61 -61
- package/src/__tests__/schema.test.ts +7 -11
- package/src/__tests__/state-docs-integration.test.ts +162 -145
- package/src/__tests__/svelte-integration.test.ts +16 -19
- package/src/__tests__/tauri-integration.test.ts +149 -147
- package/src/__tests__/terminal-node.test.ts +12 -7
- package/src/__tests__/unum-integration.test.ts +68 -68
- package/src/adapters/cli.ts +21 -15
- package/src/cli/commands/auth.ts +82 -78
- package/src/cli/commands/build.ts +29 -27
- package/src/cli/commands/canvas.ts +338 -127
- package/src/cli/commands/cloud.ts +47 -47
- package/src/cli/commands/create.ts +59 -47
- package/src/cli/commands/dev.ts +12 -12
- package/src/cli/commands/generate.ts +29 -40
- package/src/cli/commands/orchestrate.ts +24 -24
- package/src/cli/commands/verify.ts +7 -8
- package/src/cli/index.ts +14 -10
- package/src/cloud/README.md +28 -15
- package/src/cloud/auth.ts +55 -70
- package/src/cloud/billing.ts +59 -58
- package/src/cloud/client.ts +29 -35
- package/src/cloud/index.ts +19 -40
- package/src/cloud/marketplace.ts +69 -78
- package/src/cloud/provisioning.ts +42 -51
- package/src/cloud/relay/endpoints.ts +30 -34
- package/src/cloud/relay/health/index.ts +1 -1
- package/src/cloud/relay/stats/index.ts +1 -1
- package/src/cloud/relay/sync/index.ts +1 -1
- package/src/cloud/relay/usage/index.ts +1 -1
- package/src/cloud/sponsors.ts +31 -34
- package/src/cloud/types.ts +4 -4
- package/src/components/README.md +1 -0
- package/src/components/TerminalNode.svelte +457 -457
- package/src/components/index.ts +3 -4
- package/src/core/actors.ts +7 -7
- package/src/core/component/generator.ts +10 -28
- package/src/core/engine.ts +51 -24
- package/src/core/introspection.ts +37 -35
- package/src/core/logic/generator.ts +62 -62
- package/src/core/pluresdb/adapter.ts +8 -8
- package/src/core/pluresdb/generator.ts +39 -35
- package/src/core/pluresdb/index.ts +9 -12
- package/src/core/pluresdb/schema-registry.ts +22 -25
- package/src/core/pluresdb/store.ts +57 -57
- package/src/core/protocol.ts +14 -14
- package/src/core/reactive-engine.svelte.ts +65 -0
- package/src/core/reactive-engine.ts +67 -0
- package/src/core/rules.ts +4 -4
- package/src/core/schema/loader.common.ts +150 -0
- package/src/core/schema/loader.ts +19 -149
- package/src/core/schema/normalize.ts +34 -51
- package/src/core/schema/types.ts +47 -11
- package/src/dsl/index.ts +8 -8
- package/src/dsl.ts +11 -17
- package/src/examples/advanced-todo/App.svelte +506 -506
- package/src/examples/advanced-todo/README.md +58 -40
- package/src/examples/advanced-todo/index.ts +3 -3
- package/src/examples/auth-basic/index.ts +30 -30
- package/src/examples/cart/index.ts +50 -50
- package/src/examples/hero-ecommerce/index.ts +130 -157
- package/src/examples/svelte-counter/index.ts +22 -26
- package/src/flows.ts +6 -17
- package/src/index.browser.ts +204 -0
- package/src/index.ts +37 -42
- package/src/integrations/code-canvas.ts +237 -193
- package/src/integrations/pluresdb.ts +55 -35
- package/src/integrations/state-docs.ts +104 -104
- package/src/integrations/svelte.ts +35 -35
- package/src/integrations/tauri.ts +75 -73
- package/src/integrations/unum.ts +68 -61
- package/src/registry.ts +7 -14
- package/src/runtime/terminal-adapter.ts +31 -26
- package/src/step.ts +10 -16
- package/src/types.ts +1 -1
- package/templates/basic-app/README.md +6 -9
- package/templates/fullstack-app/README.md +10 -0
- package/dist/core/codegen/docs-generator.d.ts +0 -123
- package/dist/core/codegen/docs-generator.d.ts.map +0 -1
- package/dist/core/codegen/docs-generator.js +0 -674
- package/dist/core/codegen/docs-generator.js.map +0 -1
- package/dist/core/codegen/index.d.ts +0 -11
- package/dist/core/codegen/index.d.ts.map +0 -1
- package/dist/core/codegen/index.js +0 -13
- package/dist/core/codegen/index.js.map +0 -1
- package/dist/core/codegen/ts-generator.d.ts +0 -8
- package/dist/core/codegen/ts-generator.d.ts.map +0 -1
- package/dist/core/codegen/ts-generator.js +0 -8
- package/dist/core/codegen/ts-generator.js.map +0 -1
- package/dist/core/db-adapter/index.d.ts +0 -18
- package/dist/core/db-adapter/index.d.ts.map +0 -1
- package/dist/core/db-adapter/index.js +0 -23
- package/dist/core/db-adapter/index.js.map +0 -1
- package/dist/core/db-adapter/sync-engine.d.ts +0 -180
- package/dist/core/db-adapter/sync-engine.d.ts.map +0 -1
- package/dist/core/db-adapter/sync-engine.js +0 -342
- package/dist/core/db-adapter/sync-engine.js.map +0 -1
- package/dist/core/logic-engine/engine.d.ts +0 -8
- package/dist/core/logic-engine/engine.d.ts.map +0 -1
- package/dist/core/logic-engine/engine.js +0 -8
- package/dist/core/logic-engine/engine.js.map +0 -1
- package/dist/core/logic-engine/index.d.ts +0 -16
- package/dist/core/logic-engine/index.d.ts.map +0 -1
- package/dist/core/logic-engine/index.js +0 -16
- package/dist/core/logic-engine/index.js.map +0 -1
- package/dist/core/logic-engine/protocol.d.ts +0 -7
- package/dist/core/logic-engine/protocol.d.ts.map +0 -1
- package/dist/core/logic-engine/protocol.js +0 -7
- package/dist/core/logic-engine/protocol.js.map +0 -1
- package/dist/core/logic-engine/psf-adapter.d.ts +0 -88
- package/dist/core/logic-engine/psf-adapter.d.ts.map +0 -1
- package/dist/core/logic-engine/psf-adapter.js +0 -207
- package/dist/core/logic-engine/psf-adapter.js.map +0 -1
- package/dist/core/logic-engine/rules.d.ts +0 -7
- package/dist/core/logic-engine/rules.d.ts.map +0 -1
- package/dist/core/logic-engine/rules.js +0 -7
- package/dist/core/logic-engine/rules.js.map +0 -1
- package/dist/core/schema-engine/compiler.d.ts +0 -198
- package/dist/core/schema-engine/compiler.d.ts.map +0 -1
- package/dist/core/schema-engine/compiler.js +0 -262
- package/dist/core/schema-engine/compiler.js.map +0 -1
- package/dist/core/schema-engine/generator.d.ts +0 -115
- package/dist/core/schema-engine/generator.d.ts.map +0 -1
- package/dist/core/schema-engine/generator.js +0 -506
- package/dist/core/schema-engine/generator.js.map +0 -1
- package/dist/core/schema-engine/index.d.ts +0 -18
- package/dist/core/schema-engine/index.d.ts.map +0 -1
- package/dist/core/schema-engine/index.js +0 -18
- package/dist/core/schema-engine/index.js.map +0 -1
- package/dist/core/schema-engine/psf.d.ts +0 -612
- package/dist/core/schema-engine/psf.d.ts.map +0 -1
- package/dist/core/schema-engine/psf.js +0 -45
- package/dist/core/schema-engine/psf.js.map +0 -1
- package/dist/core/schema-engine/types.d.ts +0 -10
- package/dist/core/schema-engine/types.d.ts.map +0 -1
- package/dist/core/schema-engine/types.js +0 -7
- package/dist/core/schema-engine/types.js.map +0 -1
- package/dist/core/schema-engine/validator.d.ts +0 -140
- package/dist/core/schema-engine/validator.d.ts.map +0 -1
- package/dist/core/schema-engine/validator.js +0 -407
- package/dist/core/schema-engine/validator.js.map +0 -1
- package/dist/src/adapters/cli.d.ts +0 -43
- package/dist/src/adapters/cli.d.ts.map +0 -1
- package/dist/src/adapters/cli.js +0 -126
- package/dist/src/adapters/cli.js.map +0 -1
- package/dist/src/cli/commands/auth.d.ts +0 -26
- package/dist/src/cli/commands/auth.d.ts.map +0 -1
- package/dist/src/cli/commands/auth.js +0 -233
- package/dist/src/cli/commands/auth.js.map +0 -1
- package/dist/src/cli/commands/build.d.ts +0 -23
- package/dist/src/cli/commands/build.d.ts.map +0 -1
- package/dist/src/cli/commands/build.js +0 -162
- package/dist/src/cli/commands/build.js.map +0 -1
- package/dist/src/cli/commands/canvas.d.ts +0 -23
- package/dist/src/cli/commands/canvas.d.ts.map +0 -1
- package/dist/src/cli/commands/canvas.js +0 -215
- package/dist/src/cli/commands/canvas.js.map +0 -1
- package/dist/src/cli/commands/cloud.d.ts +0 -27
- package/dist/src/cli/commands/cloud.d.ts.map +0 -1
- package/dist/src/cli/commands/cloud.js +0 -232
- package/dist/src/cli/commands/cloud.js.map +0 -1
- package/dist/src/cli/commands/create.d.ts +0 -21
- package/dist/src/cli/commands/create.d.ts.map +0 -1
- package/dist/src/cli/commands/create.js +0 -621
- package/dist/src/cli/commands/create.js.map +0 -1
- package/dist/src/cli/commands/dev.d.ts +0 -21
- package/dist/src/cli/commands/dev.d.ts.map +0 -1
- package/dist/src/cli/commands/dev.js +0 -71
- package/dist/src/cli/commands/dev.js.map +0 -1
- package/dist/src/cli/commands/generate.d.ts +0 -25
- package/dist/src/cli/commands/generate.d.ts.map +0 -1
- package/dist/src/cli/commands/generate.js +0 -168
- package/dist/src/cli/commands/generate.js.map +0 -1
- package/dist/src/cli/commands/orchestrate.d.ts +0 -44
- package/dist/src/cli/commands/orchestrate.d.ts.map +0 -1
- package/dist/src/cli/commands/orchestrate.js +0 -150
- package/dist/src/cli/commands/orchestrate.js.map +0 -1
- package/dist/src/cli/commands/verify.d.ts +0 -10
- package/dist/src/cli/commands/verify.d.ts.map +0 -1
- package/dist/src/cli/commands/verify.js +0 -39
- package/dist/src/cli/commands/verify.js.map +0 -1
- package/dist/src/cli/index.d.ts +0 -8
- package/dist/src/cli/index.d.ts.map +0 -1
- package/dist/src/cli/index.js +0 -226
- package/dist/src/cli/index.js.map +0 -1
- package/dist/src/cloud/auth.d.ts +0 -51
- package/dist/src/cloud/auth.d.ts.map +0 -1
- package/dist/src/cloud/auth.js +0 -194
- package/dist/src/cloud/auth.js.map +0 -1
- package/dist/src/cloud/billing.d.ts +0 -184
- package/dist/src/cloud/billing.d.ts.map +0 -1
- package/dist/src/cloud/billing.js +0 -179
- package/dist/src/cloud/billing.js.map +0 -1
- package/dist/src/cloud/client.d.ts +0 -39
- package/dist/src/cloud/client.d.ts.map +0 -1
- package/dist/src/cloud/client.js +0 -176
- package/dist/src/cloud/client.js.map +0 -1
- package/dist/src/cloud/index.d.ts +0 -44
- package/dist/src/cloud/index.d.ts.map +0 -1
- package/dist/src/cloud/index.js +0 -44
- package/dist/src/cloud/index.js.map +0 -1
- package/dist/src/cloud/marketplace.d.ts +0 -166
- package/dist/src/cloud/marketplace.d.ts.map +0 -1
- package/dist/src/cloud/marketplace.js +0 -159
- package/dist/src/cloud/marketplace.js.map +0 -1
- package/dist/src/cloud/provisioning.d.ts +0 -110
- package/dist/src/cloud/provisioning.d.ts.map +0 -1
- package/dist/src/cloud/provisioning.js +0 -148
- package/dist/src/cloud/provisioning.js.map +0 -1
- package/dist/src/cloud/relay/endpoints.d.ts +0 -62
- package/dist/src/cloud/relay/endpoints.d.ts.map +0 -1
- package/dist/src/cloud/relay/endpoints.js +0 -217
- package/dist/src/cloud/relay/endpoints.js.map +0 -1
- package/dist/src/cloud/relay/health/index.d.ts +0 -5
- package/dist/src/cloud/relay/health/index.d.ts.map +0 -1
- package/dist/src/cloud/relay/health/index.js +0 -9
- package/dist/src/cloud/relay/health/index.js.map +0 -1
- package/dist/src/cloud/relay/stats/index.d.ts +0 -5
- package/dist/src/cloud/relay/stats/index.d.ts.map +0 -1
- package/dist/src/cloud/relay/stats/index.js +0 -9
- package/dist/src/cloud/relay/stats/index.js.map +0 -1
- package/dist/src/cloud/relay/sync/index.d.ts +0 -5
- package/dist/src/cloud/relay/sync/index.d.ts.map +0 -1
- package/dist/src/cloud/relay/sync/index.js +0 -9
- package/dist/src/cloud/relay/sync/index.js.map +0 -1
- package/dist/src/cloud/relay/usage/index.d.ts +0 -5
- package/dist/src/cloud/relay/usage/index.d.ts.map +0 -1
- package/dist/src/cloud/relay/usage/index.js +0 -9
- package/dist/src/cloud/relay/usage/index.js.map +0 -1
- package/dist/src/cloud/sponsors.d.ts +0 -81
- package/dist/src/cloud/sponsors.d.ts.map +0 -1
- package/dist/src/cloud/sponsors.js +0 -130
- package/dist/src/cloud/sponsors.js.map +0 -1
- package/dist/src/cloud/types.d.ts +0 -169
- package/dist/src/cloud/types.d.ts.map +0 -1
- package/dist/src/cloud/types.js +0 -7
- package/dist/src/cloud/types.js.map +0 -1
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/components/index.js +0 -17
- package/dist/src/components/index.js.map +0 -1
- package/dist/src/core/actors.d.ts +0 -95
- package/dist/src/core/actors.d.ts.map +0 -1
- package/dist/src/core/actors.js +0 -158
- package/dist/src/core/actors.js.map +0 -1
- package/dist/src/core/component/generator.d.ts.map +0 -1
- package/dist/src/core/component/generator.js +0 -349
- package/dist/src/core/component/generator.js.map +0 -1
- package/dist/src/core/engine.d.ts +0 -92
- package/dist/src/core/engine.d.ts.map +0 -1
- package/dist/src/core/engine.js +0 -199
- package/dist/src/core/engine.js.map +0 -1
- package/dist/src/core/introspection.d.ts +0 -141
- package/dist/src/core/introspection.d.ts.map +0 -1
- package/dist/src/core/introspection.js +0 -208
- package/dist/src/core/introspection.js.map +0 -1
- package/dist/src/core/logic/generator.d.ts +0 -76
- package/dist/src/core/logic/generator.d.ts.map +0 -1
- package/dist/src/core/logic/generator.js +0 -370
- package/dist/src/core/logic/generator.js.map +0 -1
- package/dist/src/core/pluresdb/adapter.d.ts +0 -72
- package/dist/src/core/pluresdb/adapter.d.ts.map +0 -1
- package/dist/src/core/pluresdb/adapter.js +0 -73
- package/dist/src/core/pluresdb/adapter.js.map +0 -1
- package/dist/src/core/pluresdb/generator.d.ts +0 -58
- package/dist/src/core/pluresdb/generator.d.ts.map +0 -1
- package/dist/src/core/pluresdb/generator.js +0 -191
- package/dist/src/core/pluresdb/generator.js.map +0 -1
- package/dist/src/core/pluresdb/index.d.ts +0 -15
- package/dist/src/core/pluresdb/index.d.ts.map +0 -1
- package/dist/src/core/pluresdb/index.js +0 -11
- package/dist/src/core/pluresdb/index.js.map +0 -1
- package/dist/src/core/pluresdb/schema-registry.d.ts +0 -104
- package/dist/src/core/pluresdb/schema-registry.d.ts.map +0 -1
- package/dist/src/core/pluresdb/schema-registry.js +0 -130
- package/dist/src/core/pluresdb/schema-registry.js.map +0 -1
- package/dist/src/core/pluresdb/store.d.ts +0 -199
- package/dist/src/core/pluresdb/store.d.ts.map +0 -1
- package/dist/src/core/pluresdb/store.js +0 -344
- package/dist/src/core/pluresdb/store.js.map +0 -1
- package/dist/src/core/protocol.d.ts.map +0 -1
- package/dist/src/core/protocol.js +0 -46
- package/dist/src/core/protocol.js.map +0 -1
- package/dist/src/core/rules.d.ts +0 -120
- package/dist/src/core/rules.d.ts.map +0 -1
- package/dist/src/core/rules.js +0 -81
- package/dist/src/core/rules.js.map +0 -1
- package/dist/src/core/schema/loader.d.ts +0 -47
- package/dist/src/core/schema/loader.d.ts.map +0 -1
- package/dist/src/core/schema/loader.js +0 -189
- package/dist/src/core/schema/loader.js.map +0 -1
- package/dist/src/core/schema/normalize.d.ts +0 -72
- package/dist/src/core/schema/normalize.d.ts.map +0 -1
- package/dist/src/core/schema/normalize.js +0 -190
- package/dist/src/core/schema/normalize.js.map +0 -1
- package/dist/src/core/schema/types.d.ts.map +0 -1
- package/dist/src/core/schema/types.js +0 -161
- package/dist/src/core/schema/types.js.map +0 -1
- package/dist/src/dsl/index.d.ts +0 -152
- package/dist/src/dsl/index.d.ts.map +0 -1
- package/dist/src/dsl/index.js +0 -132
- package/dist/src/dsl/index.js.map +0 -1
- package/dist/src/dsl.d.ts +0 -124
- package/dist/src/dsl.d.ts.map +0 -1
- package/dist/src/dsl.js +0 -130
- package/dist/src/dsl.js.map +0 -1
- package/dist/src/examples/advanced-todo/index.d.ts +0 -55
- package/dist/src/examples/advanced-todo/index.d.ts.map +0 -1
- package/dist/src/examples/advanced-todo/index.js +0 -222
- package/dist/src/examples/advanced-todo/index.js.map +0 -1
- package/dist/src/examples/auth-basic/index.d.ts +0 -17
- package/dist/src/examples/auth-basic/index.d.ts.map +0 -1
- package/dist/src/examples/auth-basic/index.js +0 -122
- package/dist/src/examples/auth-basic/index.js.map +0 -1
- package/dist/src/examples/cart/index.d.ts +0 -19
- package/dist/src/examples/cart/index.d.ts.map +0 -1
- package/dist/src/examples/cart/index.js +0 -202
- package/dist/src/examples/cart/index.js.map +0 -1
- package/dist/src/examples/hero-ecommerce/index.d.ts +0 -39
- package/dist/src/examples/hero-ecommerce/index.d.ts.map +0 -1
- package/dist/src/examples/hero-ecommerce/index.js +0 -506
- package/dist/src/examples/hero-ecommerce/index.js.map +0 -1
- package/dist/src/examples/svelte-counter/index.d.ts +0 -31
- package/dist/src/examples/svelte-counter/index.d.ts.map +0 -1
- package/dist/src/examples/svelte-counter/index.js +0 -123
- package/dist/src/examples/svelte-counter/index.js.map +0 -1
- package/dist/src/flows.d.ts +0 -125
- package/dist/src/flows.d.ts.map +0 -1
- package/dist/src/flows.js +0 -160
- package/dist/src/flows.js.map +0 -1
- package/dist/src/index.d.ts +0 -77
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -64
- package/dist/src/index.js.map +0 -1
- package/dist/src/integrations/code-canvas.d.ts +0 -265
- package/dist/src/integrations/code-canvas.d.ts.map +0 -1
- package/dist/src/integrations/code-canvas.js +0 -451
- package/dist/src/integrations/code-canvas.js.map +0 -1
- package/dist/src/integrations/pluresdb.d.ts +0 -117
- package/dist/src/integrations/pluresdb.d.ts.map +0 -1
- package/dist/src/integrations/pluresdb.js +0 -117
- package/dist/src/integrations/pluresdb.js.map +0 -1
- package/dist/src/integrations/state-docs.d.ts +0 -191
- package/dist/src/integrations/state-docs.d.ts.map +0 -1
- package/dist/src/integrations/state-docs.js +0 -515
- package/dist/src/integrations/state-docs.js.map +0 -1
- package/dist/src/integrations/svelte.d.ts.map +0 -1
- package/dist/src/integrations/svelte.js +0 -447
- package/dist/src/integrations/svelte.js.map +0 -1
- package/dist/src/integrations/tauri.d.ts +0 -360
- package/dist/src/integrations/tauri.d.ts.map +0 -1
- package/dist/src/integrations/tauri.js +0 -278
- package/dist/src/integrations/tauri.js.map +0 -1
- package/dist/src/integrations/unum.d.ts +0 -159
- package/dist/src/integrations/unum.d.ts.map +0 -1
- package/dist/src/integrations/unum.js +0 -240
- package/dist/src/integrations/unum.js.map +0 -1
- package/dist/src/registry.d.ts +0 -94
- package/dist/src/registry.d.ts.map +0 -1
- package/dist/src/registry.js +0 -181
- package/dist/src/registry.js.map +0 -1
- package/dist/src/runtime/terminal-adapter.d.ts.map +0 -1
- package/dist/src/runtime/terminal-adapter.js +0 -239
- package/dist/src/runtime/terminal-adapter.js.map +0 -1
- package/dist/src/step.d.ts +0 -34
- package/dist/src/step.d.ts.map +0 -1
- package/dist/src/step.js +0 -111
- package/dist/src/step.js.map +0 -1
- package/dist/src/types.d.ts +0 -63
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -6
- package/dist/src/types.js.map +0 -1
- package/dist/tools/ast-analyzer/src/ast-analyzer.d.ts +0 -8
- package/dist/tools/ast-analyzer/src/ast-analyzer.d.ts.map +0 -1
- package/dist/tools/ast-analyzer/src/ast-analyzer.js +0 -119
- package/dist/tools/ast-analyzer/src/ast-analyzer.js.map +0 -1
- package/dist/tools/cli/commands/index.d.ts +0 -7
- package/dist/tools/cli/commands/index.d.ts.map +0 -1
- package/dist/tools/cli/commands/index.js +0 -7
- package/dist/tools/cli/commands/index.js.map +0 -1
- package/dist/tools/cli/index.d.ts +0 -8
- package/dist/tools/cli/index.d.ts.map +0 -1
- package/dist/tools/cli/index.js +0 -9
- package/dist/tools/cli/index.js.map +0 -1
- package/dist/tools/watcher/index.d.ts +0 -105
- package/dist/tools/watcher/index.d.ts.map +0 -1
- package/dist/tools/watcher/index.js +0 -213
- package/dist/tools/watcher/index.js.map +0 -1
- package/dist/ui/canvas/canvas-projection.d.ts +0 -78
- package/dist/ui/canvas/canvas-projection.d.ts.map +0 -1
- package/dist/ui/canvas/canvas-projection.js +0 -416
- package/dist/ui/canvas/canvas-projection.js.map +0 -1
- package/dist/ui/canvas/canvas-state.d.ts +0 -200
- package/dist/ui/canvas/canvas-state.d.ts.map +0 -1
- package/dist/ui/canvas/canvas-state.js +0 -464
- package/dist/ui/canvas/canvas-state.js.map +0 -1
- package/dist/ui/canvas/components/index.d.ts +0 -95
- package/dist/ui/canvas/components/index.d.ts.map +0 -1
- package/dist/ui/canvas/components/index.js +0 -19
- package/dist/ui/canvas/components/index.js.map +0 -1
- package/dist/ui/canvas/index.d.ts +0 -32
- package/dist/ui/canvas/index.d.ts.map +0 -1
- package/dist/ui/canvas/index.js +0 -32
- package/dist/ui/canvas/index.js.map +0 -1
- package/dist/ui/canvas-inspector/src/server.d.ts +0 -2
- package/dist/ui/canvas-inspector/src/server.d.ts.map +0 -1
- package/dist/ui/canvas-inspector/src/server.js +0 -248
- package/dist/ui/canvas-inspector/src/server.js.map +0 -1
- package/dist/ui/canvas-inspector/src/verify-fsm-implementation.d.ts +0 -5
- package/dist/ui/canvas-inspector/src/verify-fsm-implementation.d.ts.map +0 -1
- package/dist/ui/canvas-inspector/src/verify-fsm-implementation.js +0 -58
- package/dist/ui/canvas-inspector/src/verify-fsm-implementation.js.map +0 -1
- package/dist/ui/svelte-generator/index.d.ts +0 -9
- package/dist/ui/svelte-generator/index.d.ts.map +0 -1
- package/dist/ui/svelte-generator/index.js +0 -11
- package/dist/ui/svelte-generator/index.js.map +0 -1
- package/dist/ui/svelte-generator/psf-generator.d.ts +0 -128
- package/dist/ui/svelte-generator/psf-generator.d.ts.map +0 -1
- package/dist/ui/svelte-generator/psf-generator.js +0 -506
- package/dist/ui/svelte-generator/psf-generator.js.map +0 -1
package/docs/MONETIZATION.md
CHANGED
|
@@ -40,6 +40,7 @@ Praxis Cloud uses GitHub as the exclusive authentication and billing provider, a
|
|
|
40
40
|
## Subscription Tiers
|
|
41
41
|
|
|
42
42
|
### Free Tier
|
|
43
|
+
|
|
43
44
|
- **Cost**: Free
|
|
44
45
|
- **Limits**:
|
|
45
46
|
- 1,000 syncs/month
|
|
@@ -48,6 +49,7 @@ Praxis Cloud uses GitHub as the exclusive authentication and billing provider, a
|
|
|
48
49
|
- Community support
|
|
49
50
|
|
|
50
51
|
### Solo Tier ($5/month via GitHub Sponsors)
|
|
52
|
+
|
|
51
53
|
- **Limits**:
|
|
52
54
|
- 50,000 syncs/month
|
|
53
55
|
- 1 GB storage
|
|
@@ -55,6 +57,7 @@ Praxis Cloud uses GitHub as the exclusive authentication and billing provider, a
|
|
|
55
57
|
- Standard support
|
|
56
58
|
|
|
57
59
|
### Team Tier ($20/month via GitHub Sponsors)
|
|
60
|
+
|
|
58
61
|
- **Limits**:
|
|
59
62
|
- 500,000 syncs/month
|
|
60
63
|
- 10 GB storage
|
|
@@ -63,6 +66,7 @@ Praxis Cloud uses GitHub as the exclusive authentication and billing provider, a
|
|
|
63
66
|
- Standard support
|
|
64
67
|
|
|
65
68
|
### Enterprise Tier ($50/month via GitHub Sponsors/Marketplace)
|
|
69
|
+
|
|
66
70
|
- **Limits**:
|
|
67
71
|
- 5,000,000 syncs/month
|
|
68
72
|
- 100 GB storage
|
|
@@ -102,9 +106,9 @@ praxis logout
|
|
|
102
106
|
### 3. Programmatic Authentication
|
|
103
107
|
|
|
104
108
|
```typescript
|
|
105
|
-
import { authenticateWithDeviceFlow } from
|
|
109
|
+
import { authenticateWithDeviceFlow } from '@plures/praxis/cloud';
|
|
106
110
|
|
|
107
|
-
const result = await authenticateWithDeviceFlow(
|
|
111
|
+
const result = await authenticateWithDeviceFlow('YOUR_CLIENT_ID');
|
|
108
112
|
if (result.success) {
|
|
109
113
|
console.log(`Authenticated as ${result.user?.login}`);
|
|
110
114
|
console.log(`Token: ${result.token}`);
|
|
@@ -153,10 +157,10 @@ PRAXIS_APP_ID=your_app_id
|
|
|
153
157
|
### Checking Subscription Status
|
|
154
158
|
|
|
155
159
|
```typescript
|
|
156
|
-
import { createSponsorsClient } from
|
|
160
|
+
import { createSponsorsClient } from '@plures/praxis/cloud';
|
|
157
161
|
|
|
158
162
|
const client = createSponsorsClient(githubToken);
|
|
159
|
-
const subscription = await client.getSubscription(
|
|
163
|
+
const subscription = await client.getSubscription('username');
|
|
160
164
|
|
|
161
165
|
console.log(`Tier: ${subscription.tier}`);
|
|
162
166
|
console.log(`Status: ${subscription.status}`);
|
|
@@ -199,21 +203,21 @@ See `github/marketplace/` for listing templates and screenshots.
|
|
|
199
203
|
### Webhook Handler
|
|
200
204
|
|
|
201
205
|
```typescript
|
|
202
|
-
import { createMarketplaceClient } from
|
|
206
|
+
import { createMarketplaceClient } from '@plures/praxis/cloud';
|
|
203
207
|
|
|
204
208
|
const client = createMarketplaceClient(githubToken);
|
|
205
209
|
|
|
206
210
|
// Handle webhook event
|
|
207
|
-
app.post(
|
|
211
|
+
app.post('/webhook/marketplace', (req, res) => {
|
|
208
212
|
const event = req.body;
|
|
209
213
|
const result = client.handleWebhookEvent(event);
|
|
210
|
-
|
|
214
|
+
|
|
211
215
|
if (result) {
|
|
212
216
|
// Provision or update tenant
|
|
213
217
|
console.log(`User ${result.userLogin} subscribed to ${result.subscription.tier}`);
|
|
214
218
|
}
|
|
215
|
-
|
|
216
|
-
res.status(200).send(
|
|
219
|
+
|
|
220
|
+
res.status(200).send('OK');
|
|
217
221
|
});
|
|
218
222
|
```
|
|
219
223
|
|
|
@@ -224,7 +228,7 @@ app.post("/webhook/marketplace", (req, res) => {
|
|
|
224
228
|
When a user authenticates, a tenant is automatically provisioned:
|
|
225
229
|
|
|
226
230
|
```typescript
|
|
227
|
-
import { provisionTenant, createTenant } from
|
|
231
|
+
import { provisionTenant, createTenant } from '@plures/praxis/cloud';
|
|
228
232
|
|
|
229
233
|
const result = await provisionTenant(githubUser, subscription);
|
|
230
234
|
|
|
@@ -248,7 +252,7 @@ Storage namespaces follow Azure Blob Storage naming rules:
|
|
|
248
252
|
Access to cloud features is controlled by subscription tier:
|
|
249
253
|
|
|
250
254
|
```typescript
|
|
251
|
-
import { hasAccessToTier, SubscriptionTier } from
|
|
255
|
+
import { hasAccessToTier, SubscriptionTier } from '@plures/praxis/cloud';
|
|
252
256
|
|
|
253
257
|
if (hasAccessToTier(subscription, SubscriptionTier.TEAM)) {
|
|
254
258
|
// Allow team features
|
|
@@ -264,6 +268,7 @@ praxis cloud usage
|
|
|
264
268
|
```
|
|
265
269
|
|
|
266
270
|
Output:
|
|
271
|
+
|
|
267
272
|
```
|
|
268
273
|
App ID: my-app
|
|
269
274
|
|
|
@@ -279,7 +284,7 @@ Period: 720.0 hours
|
|
|
279
284
|
### Enforcing Limits
|
|
280
285
|
|
|
281
286
|
```typescript
|
|
282
|
-
import { checkUsageLimits } from
|
|
287
|
+
import { checkUsageLimits } from '@plures/praxis/cloud';
|
|
283
288
|
|
|
284
289
|
const result = checkUsageLimits(subscription, {
|
|
285
290
|
syncCount: 1500,
|
|
@@ -289,8 +294,8 @@ const result = checkUsageLimits(subscription, {
|
|
|
289
294
|
});
|
|
290
295
|
|
|
291
296
|
if (!result.withinLimits) {
|
|
292
|
-
console.error(
|
|
293
|
-
result.violations.forEach(v => console.error(` - ${v}`));
|
|
297
|
+
console.error('Usage limits exceeded:');
|
|
298
|
+
result.violations.forEach((v) => console.error(` - ${v}`));
|
|
294
299
|
}
|
|
295
300
|
```
|
|
296
301
|
|
|
@@ -307,7 +312,7 @@ Authentication tokens are stored securely:
|
|
|
307
312
|
### Best Practices
|
|
308
313
|
|
|
309
314
|
1. **Never commit tokens** to source control
|
|
310
|
-
2. **Rotate tokens regularly**
|
|
315
|
+
2. **Rotate tokens regularly**
|
|
311
316
|
3. **Use environment variables** for CI/CD
|
|
312
317
|
4. **Revoke tokens** when no longer needed
|
|
313
318
|
5. **Use GitHub App tokens** for production services
|
|
@@ -335,7 +340,7 @@ For tests, use mock responses:
|
|
|
335
340
|
|
|
336
341
|
```typescript
|
|
337
342
|
// Mock GitHub API
|
|
338
|
-
vi.mock(
|
|
343
|
+
vi.mock('../cloud/sponsors.js', () => ({
|
|
339
344
|
createSponsorsClient: vi.fn(() => ({
|
|
340
345
|
getSubscription: vi.fn(async () => ({
|
|
341
346
|
tier: SubscriptionTier.SOLO,
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Praxis Reactive Redesign (Svelte 5 Native)
|
|
2
|
+
|
|
3
|
+
## 1. Vision
|
|
4
|
+
|
|
5
|
+
Praxis will evolve from a "step-based" logic engine to a **natively reactive** framework built on Svelte 5 Runes. This means the core `LogicEngine` will be a Svelte class, and state changes will propagate automatically through the dependency graph.
|
|
6
|
+
|
|
7
|
+
## 2. Core Architecture
|
|
8
|
+
|
|
9
|
+
### 2.1. The Reactive Engine (`LogicEngine.svelte.ts`)
|
|
10
|
+
|
|
11
|
+
The engine will no longer be a plain TS class. It will use `$state` to hold the application context and facts.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
// praxis/src/core/engine.svelte.ts
|
|
15
|
+
import { type Class } from 'type-fest';
|
|
16
|
+
|
|
17
|
+
export class LogicEngine<TContext extends object> {
|
|
18
|
+
// The single source of truth, reactive by default
|
|
19
|
+
state = $state<{
|
|
20
|
+
context: TContext;
|
|
21
|
+
facts: PraxisFact[];
|
|
22
|
+
meta: Record<string, unknown>;
|
|
23
|
+
}>({
|
|
24
|
+
context: {} as TContext,
|
|
25
|
+
facts: [],
|
|
26
|
+
meta: {}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
constructor(initialContext: TContext) {
|
|
30
|
+
this.state.context = initialContext;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Expose the raw reactive state for binding/derivation
|
|
34
|
+
get context() {
|
|
35
|
+
return this.state.context;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get facts() {
|
|
39
|
+
return this.state.facts;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2.2. Rules as Mutators
|
|
45
|
+
|
|
46
|
+
In the previous version, rules returned new facts. In the reactive version, rules are **mutators** that directly modify the reactive state. This allows Svelte's fine-grained reactivity to trigger only the necessary updates.
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
// praxis/src/core/types.ts
|
|
50
|
+
export type ReactiveRule<TContext> = (
|
|
51
|
+
state: { context: TContext; facts: PraxisFact[] },
|
|
52
|
+
event: PraxisEvent
|
|
53
|
+
) => void;
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 2.3. Derivations (Computed State)
|
|
57
|
+
|
|
58
|
+
Instead of recomputing state in every "step", we encourage using `$derived` for values that depend on the core state.
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// Example usage in an app
|
|
62
|
+
class AppState {
|
|
63
|
+
// Core state
|
|
64
|
+
connections = $state<Connection[]>([]);
|
|
65
|
+
activeId = $state<string | null>(null);
|
|
66
|
+
|
|
67
|
+
// Derived state (automatically updates)
|
|
68
|
+
activeConnection = $derived(
|
|
69
|
+
this.connections.find(c => c.id === this.activeId)
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 2.4. Actors as Effects
|
|
75
|
+
|
|
76
|
+
Actors are simply `$effect` blocks that watch the state.
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
// praxis/src/core/actor.ts
|
|
80
|
+
export function createActor<TContext>(
|
|
81
|
+
engine: LogicEngine<TContext>,
|
|
82
|
+
fn: (context: TContext) => void
|
|
83
|
+
) {
|
|
84
|
+
$effect(() => {
|
|
85
|
+
fn(engine.context);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## 3. Migration Plan
|
|
91
|
+
|
|
92
|
+
### Phase 1: Core Update
|
|
93
|
+
1. **Rename** `engine.ts` to `engine.svelte.ts`.
|
|
94
|
+
2. **Update** `LogicEngine` to use `$state`.
|
|
95
|
+
3. **Update** `PraxisRegistry` to support reactive rules.
|
|
96
|
+
4. **Add** `svelte` as a direct dependency (or ensure peer dependency is strictly enforced).
|
|
97
|
+
|
|
98
|
+
### Phase 2: Bridge Update
|
|
99
|
+
1. Create a `ReactiveBridge` that uses `$effect.root` to subscribe to state changes and send messages to the WebView.
|
|
100
|
+
2. This replaces the manual `getSerializableContext` calls.
|
|
101
|
+
|
|
102
|
+
### Phase 3: Tooling
|
|
103
|
+
1. Update the CLI to generate `.svelte.ts` files for schemas.
|
|
104
|
+
|
|
105
|
+
## 4. Example Usage
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
// defining the engine
|
|
109
|
+
const engine = new LogicEngine({ count: 0 });
|
|
110
|
+
|
|
111
|
+
// defining a rule
|
|
112
|
+
const incrementRule: ReactiveRule<any> = (state, event) => {
|
|
113
|
+
if (event.type === 'INCREMENT') {
|
|
114
|
+
state.context.count++;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// processing an event
|
|
119
|
+
engine.apply(incrementRule, { type: 'INCREMENT' });
|
|
120
|
+
|
|
121
|
+
// reacting (Actor)
|
|
122
|
+
$effect(() => {
|
|
123
|
+
console.log("Count is now:", engine.context.count);
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## 5. Benefits
|
|
128
|
+
|
|
129
|
+
1. **Simplicity**: No more complex "step" logic or diffing. Svelte handles the dependency tracking.
|
|
130
|
+
2. **Performance**: Fine-grained updates. Only the parts of the UI/logic that depend on changed data will re-run.
|
|
131
|
+
3. **Isomorphism**: The same logic code runs in the Extension Host (Node) and the WebView (Browser).
|
|
132
|
+
|
package/docs/README.md
CHANGED
|
@@ -21,47 +21,47 @@ npm run dev
|
|
|
21
21
|
|
|
22
22
|
### Core Concepts
|
|
23
23
|
|
|
24
|
-
| Document
|
|
25
|
-
|
|
26
|
-
| [What is Praxis](./core/what-is-praxis.md)
|
|
27
|
-
| [Schema Model](./core/schema-model.md)
|
|
28
|
-
| [Logic Engine](./core/logic-engine.md)
|
|
29
|
-
| [UI Generation](./core/ui-generation.md)
|
|
30
|
-
| [PluresDB Integration](./core/pluresdb-integration.md) | Local-first data with reactive storage
|
|
31
|
-
| [Code ↔ Canvas Sync](./core/code-canvas-sync.md)
|
|
32
|
-
| [CLI Usage](./core/cli-usage.md)
|
|
33
|
-
| [Building Extensions](./core/building-extensions.md)
|
|
24
|
+
| Document | Description |
|
|
25
|
+
| ------------------------------------------------------ | -------------------------------------------- |
|
|
26
|
+
| [What is Praxis](./core/what-is-praxis.md) | Overview of Praxis and its core philosophy |
|
|
27
|
+
| [Schema Model](./core/schema-model.md) | Understanding the Praxis Schema Format (PSF) |
|
|
28
|
+
| [Logic Engine](./core/logic-engine.md) | Facts, events, rules, and constraints |
|
|
29
|
+
| [UI Generation](./core/ui-generation.md) | Automatic component generation from schemas |
|
|
30
|
+
| [PluresDB Integration](./core/pluresdb-integration.md) | Local-first data with reactive storage |
|
|
31
|
+
| [Code ↔ Canvas Sync](./core/code-canvas-sync.md) | Bidirectional synchronization |
|
|
32
|
+
| [CLI Usage](./core/cli-usage.md) | Command-line interface reference |
|
|
33
|
+
| [Building Extensions](./core/building-extensions.md) | Extending Praxis functionality |
|
|
34
34
|
|
|
35
35
|
### Guides
|
|
36
36
|
|
|
37
|
-
| Guide
|
|
38
|
-
|
|
39
|
-
| [Getting Started](./guides/getting-started.md)
|
|
40
|
-
| [Svelte Integration](./guides/svelte-integration.md)
|
|
41
|
-
| [Canvas](./guides/canvas.md)
|
|
37
|
+
| Guide | Description |
|
|
38
|
+
| ------------------------------------------------------------- | ----------------------------------- |
|
|
39
|
+
| [Getting Started](./guides/getting-started.md) | First steps with Praxis |
|
|
40
|
+
| [Svelte Integration](./guides/svelte-integration.md) | Using Praxis with Svelte 5 |
|
|
41
|
+
| [Canvas](./guides/canvas.md) | Visual development with CodeCanvas |
|
|
42
42
|
| [History & State Patterns](./guides/history-state-pattern.md) | Undo/redo and time-travel debugging |
|
|
43
|
-
| [Parallel State Patterns](./guides/parallel-state-pattern.md) | Managing parallel state machines
|
|
44
|
-
| [Orchestration](./guides/orchestration.md)
|
|
43
|
+
| [Parallel State Patterns](./guides/parallel-state-pattern.md) | Managing parallel state machines |
|
|
44
|
+
| [Orchestration](./guides/orchestration.md) | Distributed system coordination |
|
|
45
45
|
|
|
46
46
|
### Tutorials
|
|
47
47
|
|
|
48
|
-
| Tutorial
|
|
49
|
-
|
|
50
|
-
| [Build Your First App](./tutorials/first-app.md)
|
|
51
|
-
| [Todo with PluresDB](./tutorials/todo-pluresdb.md) | Local-first todo application
|
|
52
|
-
| [Form Builder](./tutorials/form-builder.md)
|
|
53
|
-
| [E-commerce Cart](./tutorials/ecommerce-cart.md)
|
|
48
|
+
| Tutorial | Description |
|
|
49
|
+
| -------------------------------------------------- | -------------------------------- |
|
|
50
|
+
| [Build Your First App](./tutorials/first-app.md) | Step-by-step beginner tutorial |
|
|
51
|
+
| [Todo with PluresDB](./tutorials/todo-pluresdb.md) | Local-first todo application |
|
|
52
|
+
| [Form Builder](./tutorials/form-builder.md) | Dynamic form creation |
|
|
53
|
+
| [E-commerce Cart](./tutorials/ecommerce-cart.md) | Shopping cart with checkout flow |
|
|
54
54
|
|
|
55
55
|
### Examples
|
|
56
56
|
|
|
57
|
-
| Example
|
|
58
|
-
|
|
59
|
-
| [Hero Shop](../examples/hero-shop/)
|
|
60
|
-
| [Todo](../examples/todo/)
|
|
61
|
-
| [Form Builder](../examples/form-builder/)
|
|
62
|
-
| [Offline Chat](../examples/offline-chat/)
|
|
63
|
-
| [Terminal Node](../examples/terminal-node/) | Self-orchestrating node
|
|
64
|
-
| [Cloud Sync](../examples/cloud-sync/)
|
|
57
|
+
| Example | Description |
|
|
58
|
+
| ------------------------------------------- | ---------------------------- |
|
|
59
|
+
| [Hero Shop](../examples/hero-shop/) | Full e-commerce application |
|
|
60
|
+
| [Todo](../examples/todo/) | Minimal todo application |
|
|
61
|
+
| [Form Builder](../examples/form-builder/) | Dynamic form builder |
|
|
62
|
+
| [Offline Chat](../examples/offline-chat/) | Local-first chat application |
|
|
63
|
+
| [Terminal Node](../examples/terminal-node/) | Self-orchestrating node |
|
|
64
|
+
| [Cloud Sync](../examples/cloud-sync/) | Multi-client synchronization |
|
|
65
65
|
|
|
66
66
|
## Architecture Overview
|
|
67
67
|
|
|
@@ -70,27 +70,27 @@ flowchart TB
|
|
|
70
70
|
subgraph Schema["Schema Layer"]
|
|
71
71
|
PSF[Praxis Schema Format]
|
|
72
72
|
end
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
subgraph Generation["Code Generation"]
|
|
75
75
|
PSF --> Types[TypeScript Types]
|
|
76
76
|
PSF --> Components[Svelte Components]
|
|
77
77
|
PSF --> Logic[Logic Engine]
|
|
78
78
|
PSF --> Docs[Documentation]
|
|
79
79
|
end
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
subgraph Runtime["Runtime"]
|
|
82
82
|
Logic --> Engine[Praxis Engine]
|
|
83
83
|
Components --> UI[User Interface]
|
|
84
84
|
Engine <--> PluresDB[(PluresDB)]
|
|
85
85
|
Engine <--> Cloud[Praxis Cloud]
|
|
86
86
|
end
|
|
87
|
-
|
|
87
|
+
|
|
88
88
|
subgraph Tools["Development Tools"]
|
|
89
89
|
Canvas[CodeCanvas]
|
|
90
90
|
CLI[Praxis CLI]
|
|
91
91
|
StateDocs[State-Docs]
|
|
92
92
|
end
|
|
93
|
-
|
|
93
|
+
|
|
94
94
|
Canvas <--> PSF
|
|
95
95
|
CLI --> Generation
|
|
96
96
|
Engine --> StateDocs
|
|
@@ -99,42 +99,53 @@ flowchart TB
|
|
|
99
99
|
## Key Features
|
|
100
100
|
|
|
101
101
|
### 🎯 Schema-Driven Development
|
|
102
|
+
|
|
102
103
|
Define your entire application in PSF (Praxis Schema Format), then generate everything else.
|
|
103
104
|
|
|
104
105
|
### ⚡ Logic Engine
|
|
106
|
+
|
|
105
107
|
Pure, functional business logic with facts, events, rules, and constraints.
|
|
106
108
|
|
|
107
109
|
### 🧩 Component Generation
|
|
110
|
+
|
|
108
111
|
Automatically generate Svelte components from your schemas.
|
|
109
112
|
|
|
110
113
|
### 📱 Local-First
|
|
114
|
+
|
|
111
115
|
Built-in PluresDB integration for offline-capable, reactive data storage.
|
|
112
116
|
|
|
113
117
|
### 🎨 Visual Development
|
|
118
|
+
|
|
114
119
|
CodeCanvas provides visual schema and logic editing.
|
|
115
120
|
|
|
116
121
|
### 📚 Auto-Documentation
|
|
122
|
+
|
|
117
123
|
State-Docs generates documentation automatically from schemas.
|
|
118
124
|
|
|
119
125
|
### 🌐 Cross-Platform
|
|
126
|
+
|
|
120
127
|
Deploy to web, desktop (Tauri), and mobile from a single codebase.
|
|
121
128
|
|
|
122
129
|
### 🔄 Real-Time Sync
|
|
130
|
+
|
|
123
131
|
Praxis Cloud provides sync across devices and users.
|
|
124
132
|
|
|
125
133
|
## Installation Options
|
|
126
134
|
|
|
127
135
|
### npm
|
|
136
|
+
|
|
128
137
|
```bash
|
|
129
138
|
npm install @plures/praxis
|
|
130
139
|
```
|
|
131
140
|
|
|
132
141
|
### Deno
|
|
142
|
+
|
|
133
143
|
```typescript
|
|
134
|
-
import { createPraxisEngine } from
|
|
144
|
+
import { createPraxisEngine } from 'jsr:@plures/praxis';
|
|
135
145
|
```
|
|
136
146
|
|
|
137
147
|
### C# (.NET)
|
|
148
|
+
|
|
138
149
|
```bash
|
|
139
150
|
dotnet add package Plures.Praxis
|
|
140
151
|
```
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Svelte Integration Strategy for Praxis
|
|
2
|
+
|
|
3
|
+
## Current State
|
|
4
|
+
|
|
5
|
+
Praxis uses **Svelte 5 Runes** (`$state`, `$derived`, `$effect`) as its core reactivity engine. This provides excellent performance and developer experience but introduces a build-time dependency on the Svelte compiler.
|
|
6
|
+
|
|
7
|
+
## The Problem
|
|
8
|
+
|
|
9
|
+
Consumers of `@plures/praxis` in non-browser environments (Node.js, Electron Main, VS Code Extension Host) currently face a hurdle:
|
|
10
|
+
|
|
11
|
+
1. They import `ReactiveLogicEngine`.
|
|
12
|
+
2. This imports code containing `$state`.
|
|
13
|
+
3. **Runtime Error**: `$state is not defined`.
|
|
14
|
+
|
|
15
|
+
To fix this, the **consumer** currently has to configure their bundler (esbuild, webpack, vite) to compile the *library's* code (or their own usage of it) using `esbuild-svelte`. This leaks implementation details and increases friction.
|
|
16
|
+
|
|
17
|
+
## Strategy: Invisible Integration
|
|
18
|
+
|
|
19
|
+
We want users to `import { engine } from '@plures/praxis'` and have it "just work" anywhere, without knowing it uses Svelte under the hood.
|
|
20
|
+
|
|
21
|
+
### 1. Dual Distribution Builds (Recommended)
|
|
22
|
+
|
|
23
|
+
The `@plures/praxis` package should ship pre-compiled artifacts for different environments.
|
|
24
|
+
|
|
25
|
+
**`package.json` exports:**
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"node": "./dist/node/index.js", // Compiled with generate: 'server'
|
|
32
|
+
"browser": "./dist/browser/index.js", // Compiled with generate: 'client' (or raw?)
|
|
33
|
+
"default": "./dist/node/index.js"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Build Pipeline Changes:**
|
|
40
|
+
* Run `tsup` or `esbuild` twice during the library build process.
|
|
41
|
+
* **Build 1 (Node)**: Use `esbuild-svelte` with `generate: 'server'`. This bakes the reactivity into standard JS getters/setters/signals that Node can execute.
|
|
42
|
+
* **Build 2 (Browser)**: Use `esbuild-svelte` with `generate: 'client'` (or leave as raw `.svelte.ts` if we expect the user to bundle it, but pre-compiled is safer).
|
|
43
|
+
|
|
44
|
+
**Result**:
|
|
45
|
+
The consumer installs `@plures/praxis`.
|
|
46
|
+
* **In VS Code**: Node resolves `dist/node/index.js`. The code is standard JS. No `esbuild-svelte` needed in the consumer's build config (unless they write *their own* `.svelte.ts` files).
|
|
47
|
+
* **In Webview**: Bundler resolves `dist/browser/index.js`.
|
|
48
|
+
|
|
49
|
+
### 2. The "Core" vs "Reactive" Split
|
|
50
|
+
|
|
51
|
+
If we want to support users who strictly cannot have Svelte code (even compiled), we could separate the packages:
|
|
52
|
+
|
|
53
|
+
* `@plures/praxis-core`: Pure TS, no reactivity. Just the logic engine, types, and rule processing. State is a plain object.
|
|
54
|
+
* `@plures/praxis`: Re-exports core + the Svelte reactive engine.
|
|
55
|
+
|
|
56
|
+
### 3. Seamless Developer Experience (DX)
|
|
57
|
+
|
|
58
|
+
To make the integration invisible:
|
|
59
|
+
|
|
60
|
+
1. **Pre-compile everything**: Never force the user to compile `node_modules`.
|
|
61
|
+
2. **Type Definitions**: Ensure `.d.ts` files hide the Svelte implementation details (e.g., `state` property should just look like `TContext`, not a Svelte proxy type).
|
|
62
|
+
3. **Templates**: If the user *does* want to write reactive logic (e.g., `myRules.svelte.ts`), provide templates (`praxis init`) that set up the build tools automatically.
|
|
63
|
+
|
|
64
|
+
## Action Plan
|
|
65
|
+
|
|
66
|
+
1. **Update Praxis Build**: Modify `praxis/package.json` and build scripts to output a Node-compatible build.
|
|
67
|
+
2. **Verify**: Create a test consumer (simple Node script) that imports the library and runs without any build step.
|
|
68
|
+
3. **Document**: Update the main README to explain that Praxis works in Node.js out of the box.
|
package/docs/TERMINAL_NODE.md
CHANGED
|
@@ -57,8 +57,8 @@ const schema: PraxisSchema = {
|
|
|
57
57
|
### YAML
|
|
58
58
|
|
|
59
59
|
```yaml
|
|
60
|
-
version:
|
|
61
|
-
name:
|
|
60
|
+
version: '1.0.0'
|
|
61
|
+
name: 'MyApp'
|
|
62
62
|
orchestration:
|
|
63
63
|
type: custom
|
|
64
64
|
nodes:
|
|
@@ -129,10 +129,10 @@ const terminal = createTerminalAdapter({
|
|
|
129
129
|
// Execute a command
|
|
130
130
|
const result = await terminal.executeCommand('echo "Hello World"');
|
|
131
131
|
|
|
132
|
-
console.log(result.command);
|
|
133
|
-
console.log(result.output);
|
|
134
|
-
console.log(result.exitCode);
|
|
135
|
-
console.log(result.timestamp);
|
|
132
|
+
console.log(result.command); // 'echo "Hello World"'
|
|
133
|
+
console.log(result.output); // Command output (currently stubbed)
|
|
134
|
+
console.log(result.exitCode); // 0 for success
|
|
135
|
+
console.log(result.timestamp); // Execution timestamp
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
### Managing Command History
|
|
@@ -201,16 +201,16 @@ import TerminalNode from '@plures/praxis/components/TerminalNode.svelte';
|
|
|
201
201
|
|
|
202
202
|
**Props:**
|
|
203
203
|
|
|
204
|
-
| Prop
|
|
205
|
-
|
|
206
|
-
| `adapter`
|
|
207
|
-
| `x`
|
|
208
|
-
| `y`
|
|
209
|
-
| `width`
|
|
210
|
-
| `height`
|
|
211
|
-
| `draggable`
|
|
212
|
-
| `resizable`
|
|
213
|
-
| `showContextMenu` | `boolean`
|
|
204
|
+
| Prop | Type | Default | Description |
|
|
205
|
+
| ----------------- | ----------------- | -------- | -------------------------- |
|
|
206
|
+
| `adapter` | `TerminalAdapter` | required | Terminal adapter instance |
|
|
207
|
+
| `x` | `number` | `0` | X position on canvas |
|
|
208
|
+
| `y` | `number` | `0` | Y position on canvas |
|
|
209
|
+
| `width` | `number` | `600` | Component width in pixels |
|
|
210
|
+
| `height` | `number` | `400` | Component height in pixels |
|
|
211
|
+
| `draggable` | `boolean` | `true` | Enable drag to move |
|
|
212
|
+
| `resizable` | `boolean` | `true` | Enable resize handle |
|
|
213
|
+
| `showContextMenu` | `boolean` | `false` | Show context menu |
|
|
214
214
|
|
|
215
215
|
**Features:**
|
|
216
216
|
|
|
@@ -347,19 +347,19 @@ The main class for managing terminal node runtime behavior.
|
|
|
347
347
|
```typescript
|
|
348
348
|
class TerminalAdapter {
|
|
349
349
|
constructor(options: TerminalAdapterOptions);
|
|
350
|
-
|
|
350
|
+
|
|
351
351
|
/** Execute a terminal command */
|
|
352
352
|
executeCommand(command: string): Promise<TerminalExecutionResult>;
|
|
353
|
-
|
|
353
|
+
|
|
354
354
|
/** Get current terminal state */
|
|
355
355
|
getState(): Readonly<TerminalNodeState>;
|
|
356
|
-
|
|
356
|
+
|
|
357
357
|
/** Update terminal props */
|
|
358
358
|
updateProps(props: Partial<TerminalNodeProps>): void;
|
|
359
|
-
|
|
359
|
+
|
|
360
360
|
/** Clear command history */
|
|
361
361
|
clearHistory(): void;
|
|
362
|
-
|
|
362
|
+
|
|
363
363
|
/** Get command history */
|
|
364
364
|
getHistory(): ReadonlyArray<string>;
|
|
365
365
|
}
|
|
@@ -441,7 +441,7 @@ const terminal = createTerminalAdapter({
|
|
|
441
441
|
});
|
|
442
442
|
|
|
443
443
|
await terminal.executeCommand('echo "New session"');
|
|
444
|
-
console.log(terminal.getHistory());
|
|
444
|
+
console.log(terminal.getHistory());
|
|
445
445
|
// ['echo "Previous session"', 'echo "New session"']
|
|
446
446
|
```
|
|
447
447
|
|
|
@@ -469,8 +469,8 @@ Terminal nodes support PluresDB bindings for reactive state management:
|
|
|
469
469
|
```typescript
|
|
470
470
|
const terminal = createTerminalAdapter({
|
|
471
471
|
nodeId: 'reactive-terminal',
|
|
472
|
-
inputPath: '/app/terminal/input',
|
|
473
|
-
outputPath: '/app/terminal/output',
|
|
472
|
+
inputPath: '/app/terminal/input', // Listen for commands
|
|
473
|
+
outputPath: '/app/terminal/output', // Publish results
|
|
474
474
|
});
|
|
475
475
|
|
|
476
476
|
// When implemented, commands from inputPath will be auto-executed
|
|
@@ -521,6 +521,7 @@ Visual terminal component for Praxis Canvas is now available! Use the `TerminalN
|
|
|
521
521
|
```
|
|
522
522
|
|
|
523
523
|
**Component Features:**
|
|
524
|
+
|
|
524
525
|
- Drag and drop positioning
|
|
525
526
|
- Resizable dimensions
|
|
526
527
|
- Context menu operations
|
|
@@ -540,6 +541,7 @@ npm test
|
|
|
540
541
|
```
|
|
541
542
|
|
|
542
543
|
Tests cover:
|
|
544
|
+
|
|
543
545
|
- Schema validation with various configurations
|
|
544
546
|
- YAML and JSON loading
|
|
545
547
|
- Terminal adapter creation and configuration
|
|
@@ -580,6 +582,7 @@ To adopt terminal nodes:
|
|
|
580
582
|
## Support
|
|
581
583
|
|
|
582
584
|
For questions, issues, or feature requests:
|
|
585
|
+
|
|
583
586
|
- GitHub Issues: https://github.com/plures/praxis/issues
|
|
584
587
|
- Documentation: https://github.com/plures/praxis/tree/main/docs
|
|
585
588
|
|