@salsita-ai/sdk 0.50.0-develop.8f6deac646 → 0.50.0-develop.9267bdc12e
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/README.md +2 -2
- package/dist/application-spec/errors/diagnostic-codes.d.ts +5 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +5 -0
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +8 -1
- package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-defaults.d.ts +4 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +48 -48
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-relation-expressions.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.d.ts +6 -8
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.js +11 -11
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec.js +12 -12
- package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
- package/dist/application-spec/generate-application/code/templates/globals.js +5 -4
- package/dist/application-spec/generate-application/code/templates/index.d.ts +0 -7
- package/dist/application-spec/generate-application/code/templates/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/package-json.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +8 -2
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +9 -10
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -4
- package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +1 -3
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +1 -3
- package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/transformers-runtime.d.ts +2 -4
- package/dist/application-spec/parse-application-files/categorize/module-analysis.d.ts +1 -1
- package/dist/application-spec/parse-application-files/categorize/module-analysis.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +7 -2
- package/dist/application-spec/parse-application-files/spec/model/defaults.js +1 -1
- package/dist/application-spec/parse-application-files/spec/relations/reference-field-type.d.ts +25 -0
- package/dist/application-spec/parse-application-files/spec/relations/reference-field-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/relations/relation-field-mismatch.d.ts +46 -0
- package/dist/application-spec/parse-application-files/spec/relations/relation-field-mismatch.js +1 -0
- package/dist/application-spec/parse-application-files/spec/relations/relations.d.ts +4 -3
- package/dist/application-spec/parse-application-files/spec/relations/relations.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/infra.d.ts +2 -0
- package/dist/application-spec/parse-application-files/spec/sections/infra.js +1 -1
- package/dist/configurator/application-runtime/extensions/create-configurator-extensions.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.d.ts +3 -1
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +3 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +3 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
- package/dist/configurator/common/configurator-interface.d.ts +5 -1
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +6 -0
- package/dist/configurator/pages/DefaultConfiguratorLayout.js +1 -0
- package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.d.ts +1 -75
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -20
- package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/DesktopSidebar.d.ts +92 -0
- package/dist/configurator/ui/configurator-layout/universal/DesktopSidebar.js +16 -0
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
- package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.d.ts +47 -0
- package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -0
- package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.d.ts +11 -26
- package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.js +1 -1
- package/dist/docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx +16 -19
- package/dist/docs/complex-use-cases/sketching.mdx +0 -38
- package/dist/docs/controls/select-attribute/cardselect.mdx +9 -13
- package/dist/docs/index.json +11 -1
- package/dist/docs/integrations/woocommerce/local-development.mdx +1 -1
- package/dist/docs/layouts/custom-layout.mdx +981 -0
- package/dist/docs/other-features/side-effects.mdx +8 -11
- package/dist/docs/other-features/violation-messages.mdx +52 -56
- package/dist/docs/phoenix/configurator-interface.mdx +105 -65
- package/dist/docs/phoenix/domain-model.mdx +4 -0
- package/dist/docs/phoenix/getting-started.mdx +1 -1
- package/dist/docs/phoenix/phoenix-cli.mdx +19 -26
- package/dist/docs/phoenix/project-structure.mdx +16 -10
- package/dist/docs/phoenix/quickstart.mdx +2 -2
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +2 -2
- package/dist/docs/phoenix/webhook-membership.mdx +10 -9
- package/dist/docs/phoenix/webhooks.mdx +2 -2
- package/dist/domain/admin-domain/implementation/common-admin-expressions.d.ts +26 -11
- package/dist/domain/admin-domain/implementation/common-admin-publish.d.ts +1 -2
- package/dist/domain/admin-domain/index.js +1 -1
- package/dist/domain/application/GetApplicationWrapperHandler.d.ts +2 -2
- package/dist/domain/application/GetThemeHandler.d.ts +1 -1
- package/dist/domain/application/GetWebComponentOptions.d.ts +1 -1
- package/dist/domain/application/application-config.d.ts +5 -3
- package/dist/domain/application/assistant/assistant-fields.d.ts +5 -0
- package/dist/domain/application/assistant/assistant-fields.js +1 -0
- package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +27 -1
- package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -1
- package/dist/domain/application/assistant/index.d.ts +4 -1
- package/dist/domain/application/assistant/index.js +1 -1
- package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.d.ts +20 -0
- package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.js +1 -0
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.d.ts +10 -0
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -0
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +48 -0
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -0
- package/dist/domain/application/assistant/session-setup/create-session-assistant.d.ts +15 -0
- package/dist/domain/application/assistant/session-setup/create-session-assistant.js +1 -0
- package/dist/domain/application/assistant/session-setup/index.d.ts +4 -0
- package/dist/domain/application/assistant/session-setup/index.js +1 -0
- package/dist/domain/application/configurator-builder.d.ts +2 -2
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/create-initial-published-data.d.ts +6 -7
- package/dist/domain/application/index.d.ts +0 -4
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/application/published-data/DataRowValidatorHandler.d.ts +1 -1
- package/dist/domain/application/published-data/FilterPublishedChunksHandler.d.ts +1 -1
- package/dist/domain/application/published-data/MapPublishedChunkedDataHandler.d.ts +1 -1
- package/dist/domain/application/published-data/MapPublishedRevisionDataHandler.d.ts +1 -1
- package/dist/domain/application/published-data/SheetValidatorHandler.d.ts +1 -1
- package/dist/domain/application/published-data/map-published-chunked-data.d.ts +1 -1
- package/dist/domain/application/published-data/map-published-data.d.ts +7 -3
- package/dist/domain/core/component/domain-component-optic.d.ts +11 -19
- package/dist/domain/core/component/domain-component-optic.js +2 -2
- package/dist/domain/core/component/legacy-filter.d.ts +2 -17
- package/dist/domain/core/component/system-component-filter.d.ts +36 -18
- package/dist/domain/core/expression/constant-expressions.d.ts +16 -8
- package/dist/domain/core/expression/constant-expressions.js +1 -1
- package/dist/domain/core/expression/custom-expression.d.ts +17 -4
- package/dist/domain/core/expression/custom-expression.js +1 -1
- package/dist/domain/core/expression/expression.d.ts +1 -2
- package/dist/domain/core/invariant/custom-invariants.d.ts +6 -14
- package/dist/domain/core/invariant/invariants.d.ts +1 -4
- package/dist/domain/core/recipe/recipes.d.ts +18 -50
- package/dist/domain/core/recipe/recipes.js +1 -1
- package/dist/domain/core/relation/all-of-type-relation.d.ts +8 -21
- package/dist/domain/core/relation/all-of-type-relation.js +1 -1
- package/dist/domain/core/relation/direct-relation.d.ts +13 -24
- package/dist/domain/core/relation/index.d.ts +0 -1
- package/dist/domain/core/relation/indirect-relation.d.ts +12 -67
- package/dist/domain/core/relation/indirect-relation.js +1 -1
- package/dist/domain/core/relation/relation-factory.d.ts +19 -15
- package/dist/domain/core/relation/relation-factory.js +1 -1
- package/dist/domain/core/state/migrations.d.ts +14 -45
- package/dist/domain/core/state/migrations.js +1 -1
- package/dist/domain/core/state/state.d.ts +1 -1
- package/dist/domain/domain-builder.d.ts +1 -1
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-runtime/access/selectors.d.ts +9 -0
- package/dist/domain/domain-runtime/access/selectors.js +1 -1
- package/dist/domain/domain-runtime/access/types.d.ts +2 -0
- package/dist/domain/domain-runtime/access/types.js +1 -1
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +14 -13
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-context/types.d.ts +4 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +56 -40
- package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +19 -0
- package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -0
- package/dist/domain/domain-runtime/errors/implementation-error.d.ts +46 -0
- package/dist/domain/domain-runtime/errors/implementation-error.js +1 -0
- package/dist/domain/domain-runtime/errors/implementation-errors.d.ts +13 -0
- package/dist/domain/domain-runtime/errors/implementation-errors.js +1 -0
- package/dist/domain/domain-runtime/errors/index.d.ts +4 -0
- package/dist/domain/domain-runtime/errors/index.js +1 -0
- package/dist/domain/domain-runtime/errors/to-implementation-errors.d.ts +10 -0
- package/dist/domain/domain-runtime/errors/to-implementation-errors.js +1 -0
- package/dist/domain/domain-runtime/index.d.ts +1 -0
- package/dist/domain/domain-runtime/index.js +1 -1
- package/dist/domain/domain-runtime/spec/create-violation-expressions.d.ts +24 -0
- package/dist/domain/domain-runtime/spec/create-violation-expressions.js +1 -0
- package/dist/domain/domain-runtime/spec/index.d.ts +2 -5
- package/dist/domain/domain-runtime/spec/index.js +1 -1
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/{application → domain-runtime/spec/module-checks}/element-registration.d.ts +2 -2
- package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -0
- package/dist/domain/{application → domain-runtime/spec/module-checks}/handler-registration.d.ts +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/handler-registration.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +8 -0
- package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -0
- package/dist/domain/{project-modules → domain-runtime/spec/module-checks}/project-modules.d.ts +8 -1
- package/dist/domain/domain-runtime/spec/module-checks/project-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/{resolve-action-modules.d.ts → module-checks/resolve-action-modules.d.ts} +2 -2
- package/dist/domain/domain-runtime/spec/module-checks/resolve-action-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/{resolve-component-optic-modules.d.ts → module-checks/resolve-component-optic-modules.d.ts} +2 -2
- package/dist/domain/domain-runtime/spec/module-checks/resolve-component-optic-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/{resolve-expression-modules.d.ts → module-checks/resolve-expression-modules.d.ts} +2 -2
- package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.d.ts +22 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.d.ts +6 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/selectors.d.ts +5 -6
- package/dist/domain/domain-runtime/spec/selectors.js +1 -1
- package/dist/domain/domain-runtime/spec/types.d.ts +2 -1
- package/dist/domain/index.d.ts +0 -1
- package/dist/domain/mocks/create-mock-domain-context.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +18 -9
- package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
- package/dist/domain/mocks/create-mock-domain.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain.js +1 -1
- package/dist/domain/mocks/create-mock-state.d.ts +2 -2
- package/dist/domain/projections/blender-projections/camera.d.ts +1 -1
- package/dist/domain/utils/eval-cache.d.ts +1 -1
- package/dist/domain/utils/map-nested-object.d.ts +1 -1
- package/dist/editor/domain-editors/use-implementation-files.d.ts +1 -2
- package/dist/editor/mocks/EditorMockContext.js +1 -1
- package/dist/legacy/domain-cli/gen/configurator-builder.js +13 -12
- package/dist/legacy/domain-cli/gen/constant-expressions.js +1 -3
- package/dist/legacy/domain-cli/gen/defaults.js +1 -7
- package/dist/legacy/domain-cli/gen/implementation.js +7 -11
- package/dist/legacy/domain-cli/gen/invariants.js +3 -4
- package/dist/legacy/domain-cli/gen/relations.js +1 -1
- package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
- package/dist/legacy/domain-cli/utils/cache.js +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +1 -0
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/domain-index.js +17 -15
- package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
- package/dist/phoenix/commands/init.d.ts +4 -4
- package/dist/phoenix/commands/init.js +1 -1
- package/dist/phoenix/commands/prettier.js +1 -1
- package/dist/phoenix/utils/git/index.d.ts +1 -0
- package/dist/phoenix/utils/git/index.js +1 -0
- package/dist/phoenix/utils/git/is-inside-git-repository.d.ts +6 -0
- package/dist/phoenix/utils/git/is-inside-git-repository.js +1 -0
- package/dist/phoenix/utils/index.d.ts +1 -0
- package/dist/phoenix/utils/index.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +2 -0
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
- package/dist/react-sdk/application-runtime/routing/access-service.d.ts +1 -0
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +33 -16
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +4 -4
- package/dist/react-sdk/domain-context/index.d.ts +1 -1
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +6 -0
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
- package/dist/webhook/builders/webhook-builder.js +1 -1
- package/package.json +3 -3
- package/dist/application-spec/generate-application/code/templates/env-ci.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/env-ci.js +0 -25
- package/dist/application-spec/generate-application/code/templates/env-example.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/env-example.js +0 -94
- package/dist/application-spec/generate-application/code/templates/prettier-ignore.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/prettier-ignore.js +0 -6
- package/dist/application-spec/generate-application/code/templates/private-assets-readme.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/private-assets-readme.js +0 -24
- package/dist/application-spec/generate-application/code/templates/public-assets-readme.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/public-assets-readme.js +0 -24
- package/dist/application-spec/generate-application/code/templates/readme.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/readme.js +0 -23
- package/dist/application-spec/generate-application/code/templates/skills/agents-md.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/skills/agents-md.js +0 -2
- package/dist/domain/application/element-registration.js +0 -1
- package/dist/domain/application/handler-registration.js +0 -1
- package/dist/domain/application/resolve-imported-transformers.d.ts +0 -22
- package/dist/domain/application/resolve-imported-transformers.js +0 -1
- package/dist/domain/application/resource-builder.d.ts +0 -13
- package/dist/domain/application/resource-builder.js +0 -1
- package/dist/domain/core/relation/relation-implementation.d.ts +0 -7
- package/dist/domain/core/relation/relation-implementation.js +0 -1
- package/dist/domain/domain-runtime/spec/invariant-builder.d.ts +0 -26
- package/dist/domain/domain-runtime/spec/invariant-builder.js +0 -1
- package/dist/domain/domain-runtime/spec/resolve-action-modules.js +0 -1
- package/dist/domain/domain-runtime/spec/resolve-component-optic-modules.js +0 -1
- package/dist/domain/domain-runtime/spec/resolve-expression-modules.js +0 -1
- package/dist/domain/domain-runtime/spec/resolve-invariant-modules.d.ts +0 -6
- package/dist/domain/domain-runtime/spec/resolve-invariant-modules.js +0 -1
- package/dist/domain/project-modules/index.d.ts +0 -1
- package/dist/domain/project-modules/index.js +0 -1
- package/dist/domain/project-modules/project-modules.js +0 -1
|
@@ -104,10 +104,10 @@ pnpm install
|
|
|
104
104
|
pnpm phoenix sync
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
`phoenix sync` keeps `spec/` and `src/` as your authored inputs and generates the application shell,
|
|
107
|
+
`phoenix sync` keeps `spec/` and `src/` as your authored inputs and generates the application shell, types, and `.phoenix/` implementation. Start development without a server:
|
|
108
108
|
|
|
109
109
|
```sh
|
|
110
|
-
pnpm dev
|
|
110
|
+
pnpm phoenix dev --persistence local-storage
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
Open the URL printed by the command. The application shell loads with the default `<salsita-configurator>` element and an empty 3D scene.
|
|
@@ -22,7 +22,7 @@ pnpm install
|
|
|
22
22
|
pnpm phoenix sync
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
`phoenix init [folder]` writes the starter project: `package.json`, `pnpm-workspace.yaml` and the starter spec, `spec/application.yaml` and `spec/configurator.yaml`, which describe one box you can resize and recolour. The starter depends on the same SDK version as the CLI that created it. `phoenix sync` then adds the rest of the project:
|
|
25
|
+
`phoenix init [folder]` writes the starter project: `package.json`, `pnpm-workspace.yaml` and the starter spec, `spec/application.yaml` and `spec/configurator.yaml`, which describe one box you can resize and recolour. The starter depends on the same SDK version as the CLI that created it, and its `package.json` has the `dev`, `build`, `deploy`, `check` and `fix` scripts, which are yours to change. `phoenix sync` then adds the rest of the project: webhooks and lint config. It writes a `.gitignore` only when the folder is inside a git repository; run `git init` before the first sync, or sync again after it, to get the file.
|
|
26
26
|
|
|
27
27
|
`init` only writes these files: it asks nothing and contacts no server. It refuses a folder that already has a `spec/` folder. A `package.json` already in the folder is kept, as long as it depends on the SDK.
|
|
28
28
|
|
|
@@ -61,7 +61,7 @@ Signed in, `phoenix dev` needs no `.env` and nothing set up in Studio. When it s
|
|
|
61
61
|
|
|
62
62
|
Every user who signs the CLI in gets their own development environment, so a teammate (a super admin of the workspace, like you) who clones the project and signs in doesn't overwrite your schema or take over your webhooks. The development environment is separate from `production`: nothing you do in `phoenix dev` changes the live configurator.
|
|
63
63
|
|
|
64
|
-
`pnpm dev
|
|
64
|
+
`pnpm phoenix dev --persistence local-storage` still runs the project without any server, with state kept in the browser.
|
|
65
65
|
|
|
66
66
|
Coding agents follow the generated `phoenix` skill: before their first change they start `phoenix dev` and open the preview in your browser, and after `phoenix deploy` starts a build they open its page in Studio.
|
|
67
67
|
|
|
@@ -4,21 +4,22 @@ Build component controls with React and browser SDKs without pulling them into t
|
|
|
4
4
|
|
|
5
5
|
## Choose Where Each File Runs
|
|
6
6
|
|
|
7
|
-
| User file
|
|
8
|
-
|
|
|
9
|
-
| Component or admin component without a directive
|
|
10
|
-
| Component or admin component with `'use webhook'`
|
|
11
|
-
| Ordinary handler
|
|
12
|
-
| Published-data or
|
|
13
|
-
| Any other handler with `'use webhook'`
|
|
14
|
-
| File under `src/webhooks/`
|
|
7
|
+
| User file | Frontend | Webhook |
|
|
8
|
+
| ---------------------------------------------------- | -------- | ------- |
|
|
9
|
+
| Component or admin component without a directive | Yes | No |
|
|
10
|
+
| Component or admin component with `'use webhook'` | Yes | Yes |
|
|
11
|
+
| Ordinary handler | Yes | No |
|
|
12
|
+
| Published-data, validator or assistant setup handler | Yes | Yes |
|
|
13
|
+
| Any other handler with `'use webhook'` | Yes | Yes |
|
|
14
|
+
| File under `src/webhooks/` | No | Yes |
|
|
15
15
|
|
|
16
|
-
Published-data and
|
|
16
|
+
Published-data, validator and assistant setup handlers are detected when they register one of these APIs:
|
|
17
17
|
|
|
18
18
|
- `createMapPublishedRevisionDataHandler`
|
|
19
19
|
- `createMapPublishedChunkedDataHandler`
|
|
20
20
|
- `createDataRowValidatorHandler`
|
|
21
21
|
- `createSheetValidatorHandler`
|
|
22
|
+
- `phx.domain.createAssistantSetupHandler`
|
|
22
23
|
|
|
23
24
|
## Pin a Server-Safe Component
|
|
24
25
|
|
|
@@ -148,7 +148,7 @@ resources:
|
|
|
148
148
|
s3Key: clientImage
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
These resources are automatically made available as typed properties in task handlers via the `resources` parameter.
|
|
151
|
+
These resources are automatically made available as typed properties in task handlers via the `resources` parameter. Two static resources with the same name are an error: `phoenix check` and `phoenix build` report the second entry (`DUPLICATE_RESOURCE_NAME`).
|
|
152
152
|
|
|
153
153
|
#### Task Payload
|
|
154
154
|
|
|
@@ -991,7 +991,7 @@ Save the same OAuth client ID, client secret, and base URL in the customer's **C
|
|
|
991
991
|
JWT_SECRET_BASE64=<base64 of a long random key>
|
|
992
992
|
```
|
|
993
993
|
|
|
994
|
-
For a deployment, run `pnpm phoenix deployment:prepare` followed by `pnpm phoenix deployment:finish`. For local development, run `pnpm deployment:prepare-local`. These current commands use the customer settings stored in Studio; the removed `environment:create` and `deployment:register` commands are not part of the setup flow.
|
|
994
|
+
For a deployment, run `pnpm phoenix deployment:prepare` followed by `pnpm phoenix deployment:finish`. For local development, run `pnpm phoenix deployment:prepare-local`. These current commands use the customer settings stored in Studio; the removed `environment:create` and `deployment:register` commands are not part of the setup flow.
|
|
995
995
|
|
|
996
996
|
#### Clerk organization
|
|
997
997
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DomainEntity,
|
|
1
|
+
import type { DomainEntity, MigrateFunction, Violation } from '../../core/index.js';
|
|
2
2
|
import type { ChildEntitySelectionOption } from '../../system-components/child-entity-selection.js';
|
|
3
3
|
import type { RecipeListItem } from '../../system-components/index.js';
|
|
4
4
|
import type { SwatchOptionMap } from '../../system-components/material-swatch.js';
|
|
@@ -17,11 +17,23 @@ export declare const commonAdminCustomExpressions: {
|
|
|
17
17
|
readonly $isDraft: (self: PresetCategory) => boolean;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* An expression of this file. It reads nothing of the entity or of the state, and of the context
|
|
22
|
+
* only `CONTEXT`, so it is written against that part alone: it fits every entity of every project
|
|
23
|
+
* whose expression context has that part, because the project's own entity view, state and context
|
|
24
|
+
* are assignable to these parameters.
|
|
25
|
+
*/
|
|
26
|
+
type CommonAdminExpression<CONTEXT, T> = (self: unknown, state: unknown, ctx: CONTEXT) => T;
|
|
27
|
+
/** The part of the expression context a recipe expression reads. */
|
|
28
|
+
interface RecipeExpressionContext<PUBLISHED_DATA> {
|
|
29
|
+
readonly publishedData: PUBLISHED_DATA;
|
|
30
|
+
readonly migrate: MigrateFunction<DomainEntity<string>>;
|
|
31
|
+
}
|
|
20
32
|
export declare const CommonAdminExpressionBuilder: {
|
|
21
|
-
createConstantSwatchExpression:
|
|
22
|
-
createConstantRecipeExpression:
|
|
23
|
-
createConstantChildEntitySelectionExpression:
|
|
24
|
-
createRecipeExpression:
|
|
33
|
+
createConstantSwatchExpression: (swatches: SwatchOptionMap) => (() => SwatchOptionMap);
|
|
34
|
+
createConstantRecipeExpression: (recipes: RecipeListItem[]) => (() => RecipeListItem[]);
|
|
35
|
+
createConstantChildEntitySelectionExpression: (entities: ChildEntitySelectionOption[]) => (() => ChildEntitySelectionOption[]);
|
|
36
|
+
createRecipeExpression: (collection: string, defaults: RecipeListItem[]) => CommonAdminExpression<RecipeExpressionContext<CommonAdminPublishedData>, RecipeListItem[]>;
|
|
25
37
|
};
|
|
26
38
|
/**
|
|
27
39
|
* Expression helpers for projects with chunked published data.
|
|
@@ -30,13 +42,16 @@ export declare const CommonAdminExpressionBuilder: {
|
|
|
30
42
|
* Use {@link CommonAdminExpressionBuilder} for projects with flat published data.
|
|
31
43
|
*/
|
|
32
44
|
export declare const ChunkedCommonAdminExpressionBuilder: {
|
|
33
|
-
createConstantSwatchExpression:
|
|
34
|
-
createConstantRecipeExpression:
|
|
35
|
-
createConstantChildEntitySelectionExpression:
|
|
36
|
-
createRecipeExpression:
|
|
45
|
+
createConstantSwatchExpression: (swatches: SwatchOptionMap) => (() => SwatchOptionMap);
|
|
46
|
+
createConstantRecipeExpression: (recipes: RecipeListItem[]) => (() => RecipeListItem[]);
|
|
47
|
+
createConstantChildEntitySelectionExpression: (entities: ChildEntitySelectionOption[]) => (() => ChildEntitySelectionOption[]);
|
|
48
|
+
createRecipeExpression: (collection: string, defaults: RecipeListItem[]) => CommonAdminExpression<RecipeExpressionContext<{
|
|
37
49
|
readonly system?: CommonAdminPublishedData;
|
|
38
|
-
}
|
|
50
|
+
}>, RecipeListItem[]>;
|
|
39
51
|
};
|
|
40
52
|
export declare const createDataSwatchMap: (tableName: string, chunkKey?: string) => {
|
|
41
|
-
bind:
|
|
53
|
+
bind: () => CommonAdminExpression<{
|
|
54
|
+
readonly publishedData: Record<string, unknown>;
|
|
55
|
+
}, SwatchOptionMap>;
|
|
42
56
|
};
|
|
57
|
+
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { DomainEntity } from '../../core/index.js';
|
|
2
2
|
import type { PublishedData } from '../__generated/application-types.js';
|
|
3
|
-
import { type AnyDomainEntity } from '../__generated/model/index.js';
|
|
4
3
|
export type CommonAdminPublishedData = PublishedData;
|
|
5
4
|
export declare const CommonAdminPublishedDataSchema: {
|
|
6
5
|
type: "object";
|
|
@@ -182,4 +181,4 @@ export declare const CommonAdminPublishedDataSchema: {
|
|
|
182
181
|
additionalProperties: false;
|
|
183
182
|
required: never[];
|
|
184
183
|
};
|
|
185
|
-
export declare const mapCommonAdminPublishedData:
|
|
184
|
+
export declare const mapCommonAdminPublishedData: (entities: ReadonlyArray<DomainEntity<string>>) => CommonAdminPublishedData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DomainComponentOpticBuilder as o,
|
|
1
|
+
import{DomainComponentOpticBuilder as o,createRecipeFactory as e}from"../core/index.js";import{attributeSelectionComponent as n}from"../system-components/index.js";import{AnyDomainEntity as m,PresetCategory as t,aliases as i}from"./__generated/model/index.js";import{DraftId as a}from"./implementation/common-admin-expressions.js";export{migrateCommonAdminDomain}from"./implementation/common-admin-migrations.js";export*from"./__generated/model/index.js";export*from"./implementation/common-admin-expressions.js";export*from"./implementation/common-admin-publish.js";export*from"./schema/index.js";export const createCommonAdminRecipe=e(i,m.reflections,{});export const attachCommonAdminDomainComponent=o.from(i);export const commonAdminComponents=[attachCommonAdminDomainComponent.withEntity("Preset").withComponent(n,"category").attach((o,e)=>{let n=e.entities.filter(t.is);return null===o.categoryId?{value:a,options:n.map(o=>({value:o.id,label:o.name})).concat([{value:a,label:{$lang:{en:"Draft"}}}])}:{value:o.categoryId,options:n.map(o=>({value:o.id,label:o.name}))}},o=>({categoryId:o.value===a?null:o.value}))];export const configuratorBuilder=null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { $DomainEntity, DomainEntity } from '../core/index.js';
|
|
3
|
+
import type { HandlerRegistration, SystemPhoenixHandlerRegistration } from '../domain-runtime/index.js';
|
|
3
4
|
import type { ApplicationConfig } from './application-config.js';
|
|
4
|
-
import type { HandlerRegistration, SystemPhoenixHandlerRegistration } from './handler-registration.js';
|
|
5
5
|
export declare const createGetApplicationWrapperHandler: (fn: (ctx: ApplicationConfig<any, any, any, any, any, any, never, any, any, any, any, any, any, any, any, any>) => ComponentType) => SystemPhoenixHandlerRegistration<ApplicationConfig<any, any, any, any, any, any, never, any, any, any, any, any, any, any, any, any>, ComponentType>;
|
|
6
|
-
export type CreateGetApplicationWrapperHandler
|
|
6
|
+
export type CreateGetApplicationWrapperHandler = typeof createGetApplicationWrapperHandler;
|
|
7
7
|
export declare const isGetApplicationWrapperHandler: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, CHAT_CONTEXT extends Record<string, unknown>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ADMIN_ENTITIES extends DomainEntity<string>, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>>, ADMIN_NAVIGATION_STATES extends string, ADMIN_VIEW_STATES extends string>(handler: HandlerRegistration<ApplicationConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, CHAT_CONTEXT, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>, ComponentType>) => handler is SystemPhoenixHandlerRegistration<ApplicationConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, CHAT_CONTEXT, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>, ComponentType>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ThemeOptions } from '@mui/material';
|
|
2
|
-
import type { HandlerRegistration, SystemPhoenixHandlerRegistration } from '
|
|
2
|
+
import type { HandlerRegistration, SystemPhoenixHandlerRegistration } from '../domain-runtime/index.js';
|
|
3
3
|
export declare const GetThemeHandlerName = "GetThemeHandler";
|
|
4
4
|
export declare const createGetThemeHandler: (fn: () => ThemeOptions) => SystemPhoenixHandlerRegistration<void, ThemeOptions>;
|
|
5
5
|
export type CreateGetThemeHandler = (fn: () => ThemeOptions) => SystemPhoenixHandlerRegistration<void, ThemeOptions>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { HandlerRegistration, SystemPhoenixHandlerRegistration } from '../domain-runtime/index.js';
|
|
1
2
|
import type { WebComponentOptions } from './application-config.js';
|
|
2
|
-
import type { HandlerRegistration, SystemPhoenixHandlerRegistration } from './handler-registration.js';
|
|
3
3
|
export declare const createGetWebComponentOptionsHandler: (fn: () => WebComponentOptions) => SystemPhoenixHandlerRegistration<undefined, WebComponentOptions>;
|
|
4
4
|
export type CreateGetWebComponentOptionsHandler = (fn: () => WebComponentOptions) => SystemPhoenixHandlerRegistration<undefined, WebComponentOptions>;
|
|
5
5
|
export declare const isGetWebComponentOptionsHandler: (handler: HandlerRegistration<any, any>) => handler is SystemPhoenixHandlerRegistration<undefined, WebComponentOptions>;
|
|
@@ -8,13 +8,15 @@ import type { CellValue } from '@salsita-ai/contracts/webhook';
|
|
|
8
8
|
import type { AdminIntegrationService } from '#package/react-sdk';
|
|
9
9
|
import type { $DomainEntity, DataCellValue, DataSchema, DomainEntity, DomainFactory, ProductPreset } from '../core/index.js';
|
|
10
10
|
import type { AnalyticsSystem, RegistrableTransformer, TransformerFactory } from '../domain-context/index.js';
|
|
11
|
-
import type { ProjectModule } from '../
|
|
11
|
+
import type { ProjectModule } from '../domain-runtime/index.js';
|
|
12
12
|
import type { AssistantResolvedManifest } from './assistant/index.js';
|
|
13
13
|
import type { WebComponentEventDescriptor } from './web-component-event.js';
|
|
14
14
|
import type { WebComponentPropertyDescriptor } from './web-component-property.js';
|
|
15
|
-
|
|
15
|
+
type TransformerExport = ReturnType<TransformerFactory<any, any, any, any, any, any, any>> | RegistrableTransformer<any, any, any, any, any, any, any>;
|
|
16
|
+
/** The transformers one `src/transformers/` file exports, under the name of the file. */
|
|
17
|
+
export type ImportedTransformer = {
|
|
16
18
|
name: string;
|
|
17
|
-
transformer:
|
|
19
|
+
transformer: TransformerExport | ReadonlyArray<TransformerExport>;
|
|
18
20
|
};
|
|
19
21
|
export type SpecTransformer = {
|
|
20
22
|
name: string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AssistantDeclaredField } from './assistant-resolved-manifest.js';
|
|
2
|
+
/** Combines the effective description with allowed string values. */
|
|
3
|
+
export declare const describeAssistantValues: (description: string | undefined, values: readonly string[] | undefined) => string | undefined;
|
|
4
|
+
/** Applies GraphQL field inheritance identically at parse time and after session narrowing. */
|
|
5
|
+
export declare const mergeAssistantFields: (inherited: ReadonlyArray<readonly AssistantDeclaredField[]>, own: readonly AssistantDeclaredField[], ownEnumValues: (source: string) => readonly string[] | undefined, conflict: (name: string, first: string, second: string) => void) => readonly AssistantDeclaredField[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const describeAssistantValues=(e,s)=>{if(!s?.length)return e;let t=`One of: ${s.map(e=>`"${e}"`).join(", ")}.`;return e?`${e}${/[.!?]$/.test(e)?"":"."} ${t}`:t};export const mergeAssistantFields=(e,s,t,n)=>{let r=new Map,i=new Set(s);for(let t of[...e.flat(),...s]){let e=r.get(t.name);e?e.source!==t.source?n(t.name,e.source,t.source):r.set(t.name,{...e,...i.has(t)&&t.describedByManifest?{description:t.description,describedByManifest:!0,valueDescription:t.valueDescription}:{}}):r.set(t.name,t)}return[...r.values()].map(e=>{let s=e.enumValues&&t(e.source);return s?{...e,enumValues:s,description:describeAssistantValues(e.valueDescription,s)}:e})};
|
|
@@ -34,6 +34,7 @@ export interface AssistantStates {
|
|
|
34
34
|
}
|
|
35
35
|
/** Serializable resolved whitelist from which the browser or backend constructs the assistant schema. */
|
|
36
36
|
export interface AssistantResolvedManifest {
|
|
37
|
+
readonly declarations: AssistantDeclarations;
|
|
37
38
|
readonly entityTypes: readonly string[];
|
|
38
39
|
readonly aliases: Readonly<Record<string, readonly string[]>>;
|
|
39
40
|
readonly exampleType?: string;
|
|
@@ -59,7 +60,8 @@ export interface AssistantWritableType {
|
|
|
59
60
|
readonly fields: readonly AssistantWritableField[];
|
|
60
61
|
}
|
|
61
62
|
/** Description hints resolved from recipe/option entries; no parse context is retained. */
|
|
62
|
-
export
|
|
63
|
+
export declare const ASSISTANT_HINTS: readonly ['sameForAllInstances', 'constantDuringSession'];
|
|
64
|
+
export type AssistantResolvedHint = (typeof ASSISTANT_HINTS)[number];
|
|
63
65
|
/** Recipe groups and their description hints for one entity type. */
|
|
64
66
|
export interface AssistantResolvedRecipes {
|
|
65
67
|
readonly groups: readonly AssistantRecipeGroup[];
|
|
@@ -93,3 +95,27 @@ export interface AssistantResolvedAction {
|
|
|
93
95
|
}>>;
|
|
94
96
|
readonly result: Readonly<Record<string, AssistantResolvedActionResult>>;
|
|
95
97
|
}
|
|
98
|
+
/** Immutable, validated declaration bindings retained before alias expansion for session narrowing. */
|
|
99
|
+
export interface AssistantDeclarations {
|
|
100
|
+
readonly entities: Readonly<Record<string, readonly AssistantDeclaredField[]>>;
|
|
101
|
+
readonly enumValues: Readonly<Record<string, Readonly<Record<string, readonly string[]>>>>;
|
|
102
|
+
readonly deletable: readonly string[];
|
|
103
|
+
readonly writable: Readonly<Record<string, Readonly<Record<string, AssistantDeclaredWrite>>>>;
|
|
104
|
+
readonly childRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
|
|
105
|
+
readonly replaceRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
|
|
106
|
+
}
|
|
107
|
+
/** An original field declaration, including metadata needed to reapply inheritance and enum descriptions. */
|
|
108
|
+
export interface AssistantDeclaredField extends AssistantResolvedField {
|
|
109
|
+
readonly describedByManifest: boolean;
|
|
110
|
+
readonly enumValues?: readonly string[];
|
|
111
|
+
readonly valueDescription?: string;
|
|
112
|
+
}
|
|
113
|
+
/** Stored-property types and component bindings, resolved separately for each concrete member. */
|
|
114
|
+
export interface AssistantDeclaredWrite {
|
|
115
|
+
readonly members: Readonly<Record<string, {
|
|
116
|
+
readonly exposedDescription?: string;
|
|
117
|
+
readonly field: AssistantWritableField;
|
|
118
|
+
readonly options?: AssistantResolvedOptionsEdge;
|
|
119
|
+
}>>;
|
|
120
|
+
readonly defaultOptionsName: boolean;
|
|
121
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const ASSISTANT_HINTS=["sameForAllInstances","constantDuringSession"];
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { ASSISTANT_HINTS } from './assistant-resolved-manifest.js';
|
|
2
|
+
export type { AssistantResolvedManifest, AssistantDeclaredField, AssistantDeclarations, AssistantDeclaredWrite, AssistantResolvedField, AssistantValueType, AssistantRelationType, AssistantStates, AssistantWritableType, AssistantWritableField, AssistantResolvedHint, AssistantResolvedRecipes, AssistantResolvedOptionsEdge, AssistantResolvedAction, AssistantResolvedActionResult, } from './assistant-resolved-manifest.js';
|
|
2
3
|
export { buildAssistantManifest } from './build-assistant-manifest.js';
|
|
3
4
|
export type { AssistantFieldSource, AssistantRecipeGroup, AssistantFieldOptions, AssistantManifest, } from './assistant-manifest.js';
|
|
4
5
|
export { generateAssistantPrompt } from './generate-assistant-prompt.js';
|
|
6
|
+
export * from './session-setup/index.js';
|
|
7
|
+
export { describeAssistantValues, mergeAssistantFields } from './assistant-fields.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{buildAssistantManifest}from"./build-assistant-manifest.js";export{generateAssistantPrompt}from"./generate-assistant-prompt.js";
|
|
1
|
+
export{ASSISTANT_HINTS}from"./assistant-resolved-manifest.js";export{buildAssistantManifest}from"./build-assistant-manifest.js";export{generateAssistantPrompt}from"./generate-assistant-prompt.js";export*from"./session-setup/index.js";export{describeAssistantValues,mergeAssistantFields}from"./assistant-fields.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AccessLevel, SessionRole } from '@salsita-ai/contracts/api';
|
|
2
|
+
import type { $DomainEntity, ActionTypes, DomainEntity } from '../../../core/index.js';
|
|
3
|
+
import type { HandlerRegistration, SystemPhoenixHandlerRegistration } from '../../../domain-runtime/index.js';
|
|
4
|
+
import type { AssistantSetupManifest } from './assistant-setup-manifest.js';
|
|
5
|
+
/** Project-defined session inputs used by browser execution and the assistant setup webhook. */
|
|
6
|
+
export interface AssistantSetupInputs<SESSION_DATA> {
|
|
7
|
+
readonly role: SessionRole;
|
|
8
|
+
readonly sessionData: SESSION_DATA;
|
|
9
|
+
readonly access: AccessLevel;
|
|
10
|
+
}
|
|
11
|
+
/** Arguments carried by the standard single-props system-handler registration. */
|
|
12
|
+
export interface AssistantSetupHandlerProps<SESSION_DATA, ENTITIES extends DomainEntity<string> = DomainEntity<string>, $MAP extends Record<keyof $MAP, $DomainEntity<ENTITIES>> = Record<string, $DomainEntity<ENTITIES>>, ACTIONS extends ActionTypes = ActionTypes> {
|
|
13
|
+
readonly manifest: AssistantSetupManifest<ENTITIES, $MAP, ACTIONS>;
|
|
14
|
+
readonly inputs: AssistantSetupInputs<SESSION_DATA>;
|
|
15
|
+
}
|
|
16
|
+
/** A project setup handler is synchronous, pure and deterministic. Return null to disable the assistant. */
|
|
17
|
+
export type TypedCreateAssistantSetupHandler<SESSION_DATA, ENTITIES extends DomainEntity<string> = DomainEntity<string>, $MAP extends Record<keyof $MAP, $DomainEntity<ENTITIES>> = Record<string, $DomainEntity<ENTITIES>>, ACTIONS extends ActionTypes = ActionTypes> = (fn: (manifest: AssistantSetupManifest<ENTITIES, $MAP, ACTIONS>, inputs: AssistantSetupInputs<SESSION_DATA>) => AssistantSetupManifest<ENTITIES, $MAP, ACTIONS> | null) => SystemPhoenixHandlerRegistration<AssistantSetupHandlerProps<SESSION_DATA, ENTITIES, $MAP, ACTIONS>, AssistantSetupManifest<ENTITIES, $MAP, ACTIONS> | null>;
|
|
18
|
+
export declare const createAssistantSetupHandler: <SESSION_DATA, ENTITIES extends DomainEntity<string> = DomainEntity<string>, $MAP extends Record<keyof $MAP, $DomainEntity<ENTITIES>> = Record<string, $DomainEntity<ENTITIES>>, ACTIONS extends ActionTypes = ActionTypes>(fn: (manifest: AssistantSetupManifest<ENTITIES, $MAP, ACTIONS>, inputs: AssistantSetupInputs<SESSION_DATA>) => AssistantSetupManifest<ENTITIES, $MAP, ACTIONS> | null) => SystemPhoenixHandlerRegistration<AssistantSetupHandlerProps<SESSION_DATA, ENTITIES, $MAP, ACTIONS>, AssistantSetupManifest<ENTITIES, $MAP, ACTIONS> | null>;
|
|
19
|
+
export declare const createAssistantSetupHandlerFactory: <SESSION_DATA, ENTITIES extends DomainEntity<string> = DomainEntity<string>, $MAP extends Record<keyof $MAP, $DomainEntity<ENTITIES>> = Record<string, $DomainEntity<ENTITIES>>, ACTIONS extends ActionTypes = ActionTypes>() => TypedCreateAssistantSetupHandler<SESSION_DATA, ENTITIES, $MAP, ACTIONS>;
|
|
20
|
+
export declare const isAssistantSetupHandler: (handler: Pick<HandlerRegistration<never, unknown>, 'type' | 'name'>) => handler is SystemPhoenixHandlerRegistration<AssistantSetupHandlerProps<Record<string, unknown>>, AssistantSetupManifest | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const createAssistantSetupHandler=t=>({type:"system",name:"AssistantSetupHandler",handler:()=>({handler:({manifest:e,inputs:s})=>t(e,s)})});export const createAssistantSetupHandlerFactory=()=>createAssistantSetupHandler;export const isAssistantSetupHandler=t=>"system"===t.type&&"AssistantSetupHandler"===t.name;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AssistantResolvedManifest } from '../assistant-resolved-manifest.js';
|
|
2
|
+
import { type AssistantSetupManifest, type AssistantSetupSettings } from './assistant-setup-manifest.js';
|
|
3
|
+
/** A project returned a setup that broadens or invalidates its declared whitelist. */
|
|
4
|
+
export declare class AssistantSetupError extends Error {
|
|
5
|
+
constructor(key: string, reason: string);
|
|
6
|
+
}
|
|
7
|
+
export declare const applyAssistantSetup: (resolved: AssistantResolvedManifest, settings: AssistantSetupSettings | null, returned: AssistantSetupManifest | null) => {
|
|
8
|
+
readonly resolved: AssistantResolvedManifest;
|
|
9
|
+
readonly settings: AssistantSetupSettings | null;
|
|
10
|
+
} | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ASSISTANT_AI_PROVIDERS as e,ASSISTANT_MODEL_TIERS as t,ASSISTANT_REASONING_LEVELS as i}from"@salsita-ai/contracts/assistant";import{describeAssistantValues as s,mergeAssistantFields as n}from"../assistant-fields.js";import{ASSISTANT_HINTS as o}from"../assistant-resolved-manifest.js";import{projectAssistantSetupManifest as a}from"./assistant-setup-manifest.js";export class AssistantSetupError extends Error{constructor(e,t){super(`${e}: ${t}`),this.name="AssistantSetupError"}}let r=(e,t)=>{throw new AssistantSetupError(e,t)},l=(e,t,i)=>{for(let s of((null===t||"object"!=typeof t||Array.isArray(t))&&r(i,"expected an object; omit an entry to remove it"),Object.keys(t)))Object.hasOwn(e,s)||r(`${i}.${s}`,"not declared in the spec; remove this key")},p=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0,d=(e,t,i)=>(void 0!==e&&"string"!=typeof e&&r(`${i}.description`,"expected a string"),e??t),c=(e,t,i)=>(void 0!==e&&!1!==e&&r(`${i}.allowDryRuns`,"can only disable dry-runs; omit this flag or set false"),!1!==e&&t);export const applyAssistantSetup=(u,f,m)=>{if(null===m)return null;let b=a(u,f),y=u.declarations;l({entities:{},deletable:{},writable:{},childRecipes:{},replaceRecipes:{},actions:{},instructions:"",ai:{}},m,"assistant"),l(b.entities,m.entities,"assistant.entities"),l(b.deletable,m.deletable,"assistant.deletable"),l(b.writable,m.writable,"assistant.writable"),l(b.actions,m.actions,"assistant.actions");let g=Object.fromEntries(Object.entries(m.entities).map(([e,t])=>{let i=`assistant.entities.${e}`;l(b.entities[e],t,i);let n=y.entities[e];return[e,Object.entries(t).map(([e,t])=>{l({description:""},t,`${i}.${e}`);let o=n.find(t=>t.source===e),a=d(t.description,o.valueDescription,`${i}.${e}`);return{...o,valueDescription:a,description:s(a,o.enumValues),describedByManifest:void 0!==t.description||o.describedByManifest}})]})),v=(e,t,i)=>r(`assistant.entities.${e}`,`conflicting sources ${t} and ${i}`),w=n([],p(g,"AnyDomainEntity")??[],()=>void 0,v),$=new Map([["AnyDomainEntity",w]]);for(let e of Object.keys(u.aliases))"AnyDomainEntity"!==e&&$.set(e,n([w],p(g,e)??[],()=>void 0,v));for(let e of u.entityTypes){let t=Object.entries(u.aliases).filter(([t,i])=>"AnyDomainEntity"!==t&&i.includes(e));$.set(e,n([w,...t.map(([e])=>$.get(e)??[])],p(g,e)??[],t=>y.enumValues[e]?.[t],v))}let h=Object.fromEntries([...$].map(([e,t])=>[e,t.map(e=>({name:e.name,source:e.source,localized:e.localized,type:e.type,...void 0===e.description?{}:{description:e.description}}))])),j=new Map,O=new Map;for(let[e,t]of Object.entries(m.writable)){let i=`assistant.writable.${e}`;for(let[s,n]of(l(b.writable[e],t,i),Object.entries(t))){let t=`${i}.${s}`,o=y.writable[e][s];for(let[e,{field:i,options:a,exposedDescription:d}]of(l(Object.values(o.members).some(e=>e.options)?{options:{}}:{},n,t),void 0!==n.options&&(l({validate:!0,allowDryRuns:!1},n.options,`${t}.options`),void 0!==n.options.validate&&!0!==n.options.validate&&r(`${t}.options.validate`,"can only enable validation; omit this flag or set true"),c(n.options.allowDryRuns,!0,`${t}.options`)),Object.entries(o.members))){let l=p(g,e)?.find(e=>e.source===s)?.name??$.get(e)?.find(e=>e.source===s)?.name,u=l??s;void 0===l&&$.get(e)?.some(e=>e.name===s&&e.source!==s)&&r(t,`narrowing leaves ${e}.${s} bound to another read field; retain its original exposure or remove this writable property`);let f=j.get(e)??new Map;if([...f.values()].some(e=>e.name===u&&e.property!==s)&&r(t,`narrowing maps multiple writable properties to ${e}.${u}; retain their original exposures or remove the conflicting property`),f.has(s)||f.set(s,{...i,name:u,...void 0===l?{}:{description:d}}),j.set(e,f),a){let i=o.defaultOptionsName?`${u}Options`:a.options.edgeName;O.get(e)?.some(e=>e.options.edgeName===i||e.options.field===u)&&r(`${t}.options`,`narrowing duplicates options edge ${e}.${i}; retain the original field exposures or remove the conflicting writable declaration`),O.set(e,[...O.get(e)??[],{hints:a.hints,options:{...a.options,field:u,edgeName:i,validate:n.options?.validate??a.options.validate,dryRuns:c(n.options?.allowDryRuns,a.options.dryRuns,`${t}.options`)}}])}}}}for(let[e,t]of Object.entries(u.optionsEdges))for(let i of t){let t=u.writableTypes.find(t=>t.entityType===e)?.fields.find(e=>e.name===i.options.field)?.property;if(i.options.validate&&t&&j.get(e)?.has(t)&&!O.get(e)?.some(i=>i.options.field===j.get(e)?.get(t)?.name&&i.options.validate)){let i=Object.keys(m.writable).find(i=>Object.hasOwn(m.writable[i],t)&&y.writable[i]?.[t]?.members[e]);r(`assistant.writable.${i}.${t}`,`cannot remove declared validation while another declaration keeps ${e}.${t} writable; remove all writable declarations for it`)}}let x=e=>{l(b[e],m[e],`assistant.${e}`);let t=new Map;for(let[i,s]of Object.entries(m[e])){let n=`assistant.${e}.${i}`;l({groups:{}},s,n),l(b[e][i].groups,s.groups,`${n}.groups`);let a=y[e][i],r=Object.entries(s.groups).map(([e,t])=>{let i=`${n}.groups.${e}`;l({description:"",allowDryRuns:!1},t,i);let s=a.groups.find(t=>t.instanceName===e);return{...s,description:d(t.description,s.description,i),dryRuns:c(t.allowDryRuns,s.dryRuns,i)}});for(let e of u.entityTypes.includes(i)?[i]:u.aliases[i]??[]){let i=t.get(e);t.set(e,{groups:[...i?.groups??[],...r],hints:o.filter(e=>a.hints.includes(e)||i?.hints.includes(e))})}}return Object.fromEntries(u.entityTypes.flatMap(e=>{let i=t.get(e);return i?.groups.length?[[e,i]]:[]}))};for(let[e,t]of Object.entries(m.deletable))l({},t,`assistant.deletable.${e}`);let R=new Set(Object.keys(m.deletable).flatMap(e=>u.entityTypes.includes(e)?[e]:u.aliases[e]??[])),E=u.actionFields.flatMap(e=>{let t=p(m.actions,e.actionName);if(void 0===t)return[];let i=`assistant.actions.${e.actionName}`;return l({description:""},t,i),[{...e,description:d(t.description,e.description,i)}]}),T=f;if(f){void 0!==m.ai&&l({...f.ai,maxThreadSize:void 0},m.ai,"assistant.ai");let s={...f.ai,...Object.fromEntries(Object.entries(m.ai??{}).filter(([,e])=>void 0!==e))};e.includes(s.provider)&&t.includes(s.model)&&i.includes(s.reasoning)||r("assistant.ai","expected a supported provider, model and reasoning level"),void 0!==s.maxThreadSize&&(!Number.isInteger(s.maxThreadSize)||s.maxThreadSize<=0)&&r("assistant.ai.maxThreadSize","expected a positive whole number of input tokens"),void 0!==m.instructions&&"string"!=typeof m.instructions&&r("assistant.instructions","expected a string"),T={instructions:""===m.instructions?null:m.instructions??f.instructions,ai:s}}return{resolved:{...u,fields:h,deletableTypes:u.entityTypes.filter(e=>R.has(e)),writableTypes:u.entityTypes.flatMap(e=>{let t=[...j.get(e)?.values()??[]];return t.length?[{entityType:e,fields:t}]:[]}),optionsEdges:Object.fromEntries(O),childRecipes:x("childRecipes"),replaceRecipes:x("replaceRecipes"),actionFields:E},settings:T}};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { AssistantAiSettings } from '@salsita-ai/contracts/assistant';
|
|
2
|
+
import type { $DomainEntity, ActionTypes, DomainEntity } from '../../../core/index.js';
|
|
3
|
+
import type { AssistantResolvedManifest } from '../assistant-resolved-manifest.js';
|
|
4
|
+
/** Declaration-shaped whitelist a project may narrow; bindings and hints stay internal. */
|
|
5
|
+
export interface AssistantSetupManifest<ENTITIES extends DomainEntity<string> = DomainEntity<string>, $MAP extends Record<keyof $MAP, $DomainEntity<ENTITIES>> = Record<string, $DomainEntity<ENTITIES>>, ACTIONS extends ActionTypes = ActionTypes> {
|
|
6
|
+
readonly entities: string extends keyof $MAP ? Readonly<Record<string, Readonly<Record<string, AssistantSetupField>>>> : {
|
|
7
|
+
readonly [TYPE in keyof $MAP]?: Readonly<Partial<Record<Exclude<keyof $MAP[TYPE], 'id' | 'type' | '_raw' | 'meta'>, AssistantSetupField>>>;
|
|
8
|
+
};
|
|
9
|
+
readonly deletable: Readonly<Record<string, Readonly<Record<never, never>>>>;
|
|
10
|
+
readonly writable: string extends ENTITIES['type'] ? Readonly<Record<string, Readonly<Record<string, AssistantSetupWritableField>>>> : {
|
|
11
|
+
readonly [TYPE in keyof $MAP]?: Readonly<Partial<Record<Exclude<keyof $MAP[TYPE]['_raw'], 'id' | 'type'>, AssistantSetupWritableField>>>;
|
|
12
|
+
};
|
|
13
|
+
readonly childRecipes: Readonly<Record<string, AssistantSetupRecipes>>;
|
|
14
|
+
readonly replaceRecipes: Readonly<Record<string, AssistantSetupRecipes>>;
|
|
15
|
+
readonly actions: {
|
|
16
|
+
readonly [ACTION in keyof ACTIONS]?: AssistantSetupField;
|
|
17
|
+
};
|
|
18
|
+
readonly instructions?: string;
|
|
19
|
+
readonly ai?: Partial<AssistantAiSettings>;
|
|
20
|
+
}
|
|
21
|
+
/** Optional description override; omission preserves the declaration's effective text. */
|
|
22
|
+
export interface AssistantSetupField {
|
|
23
|
+
readonly description?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Only stricter validation and disabled dry-runs are configurable. */
|
|
26
|
+
export interface AssistantSetupOptions {
|
|
27
|
+
readonly validate?: true;
|
|
28
|
+
readonly allowDryRuns?: false;
|
|
29
|
+
}
|
|
30
|
+
/** Keeping a property also keeps its declared options binding and baseline restrictions. */
|
|
31
|
+
export interface AssistantSetupWritableField {
|
|
32
|
+
readonly options?: AssistantSetupOptions;
|
|
33
|
+
}
|
|
34
|
+
/** A recipe group's editable description and dry-run restriction. */
|
|
35
|
+
export interface AssistantSetupRecipeGroup {
|
|
36
|
+
readonly description?: string;
|
|
37
|
+
readonly allowDryRuns?: false;
|
|
38
|
+
}
|
|
39
|
+
/** Only explicitly declared groups appear, under their original entity or alias key. */
|
|
40
|
+
export interface AssistantSetupRecipes {
|
|
41
|
+
readonly groups: Readonly<Record<string, AssistantSetupRecipeGroup>>;
|
|
42
|
+
}
|
|
43
|
+
/** Server settings baseline, kept out of the browser spec. */
|
|
44
|
+
export interface AssistantSetupSettings {
|
|
45
|
+
readonly instructions?: string | null;
|
|
46
|
+
readonly ai: AssistantAiSettings;
|
|
47
|
+
}
|
|
48
|
+
export declare const projectAssistantSetupManifest: (resolved: AssistantResolvedManifest, settings: AssistantSetupSettings | null) => AssistantSetupManifest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const projectAssistantSetupManifest=(e,i)=>{let t=e=>Object.fromEntries(Object.entries(e).map(([e,i])=>[e,{groups:Object.fromEntries(i.groups.map(e=>[e.instanceName,{...void 0===e.description?{}:{description:e.description},...!e.dryRuns?{allowDryRuns:!1}:{}}]))}])),s=e.declarations;return{entities:Object.fromEntries(Object.entries(s.entities).map(([e,i])=>[e,Object.fromEntries(i.map(e=>[e.source,{...!e.describedByManifest||void 0===e.valueDescription?{}:{description:e.valueDescription}}]))])),deletable:Object.fromEntries(s.deletable.map(e=>[e,{}])),writable:Object.fromEntries(Object.entries(s.writable).map(([e,i])=>[e,Object.fromEntries(Object.entries(i).map(([e,i])=>{let t=Object.values(i.members).find(e=>e.options)?.options?.options;return[e,t?{options:{...t.validate?{validate:!0}:{},...!t.dryRuns?{allowDryRuns:!1}:{}}}:{}]}))])),childRecipes:t(s.childRecipes),replaceRecipes:t(s.replaceRecipes),actions:Object.fromEntries(e.actionFields.map(e=>[e.actionName,void 0===e.description?{}:{description:e.description}])),...i?{instructions:i.instructions??void 0,ai:{...i.ai}}:{}}};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AssistantManifest } from '../assistant-manifest.js';
|
|
2
|
+
import type { AssistantResolvedManifest } from '../assistant-resolved-manifest.js';
|
|
3
|
+
import type { AssistantSetupHandlerProps, TypedCreateAssistantSetupHandler } from './AssistantSetupHandler.js';
|
|
4
|
+
/** Session-derived browser manifest; a rejected setup retains its error without exposing the baseline. */
|
|
5
|
+
export interface SessionAssistantSetup {
|
|
6
|
+
readonly manifest: AssistantManifest | null;
|
|
7
|
+
readonly error: Error | null;
|
|
8
|
+
}
|
|
9
|
+
interface Props {
|
|
10
|
+
readonly resolved: AssistantResolvedManifest | null;
|
|
11
|
+
readonly handler: ReturnType<TypedCreateAssistantSetupHandler<Record<string, unknown>>> | undefined;
|
|
12
|
+
readonly inputs: AssistantSetupHandlerProps<Record<string, unknown>>['inputs'] | null;
|
|
13
|
+
}
|
|
14
|
+
export declare const createSessionAssistant: ({ resolved, handler, inputs }: Props) => SessionAssistantSetup;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{buildAssistantManifest as r}from"../build-assistant-manifest.js";import{applyAssistantSetup as n}from"./apply-assistant-setup.js";import{projectAssistantSetupManifest as t}from"./assistant-setup-manifest.js";export const createSessionAssistant=({resolved:e,handler:s,inputs:l})=>{if(!e)return{manifest:null,error:null};try{if(!s)return{manifest:r(e),error:null};if(!l)return{manifest:null,error:null};let i=n(e,null,s.handler().handler({manifest:t(e,null),inputs:l}));return{manifest:i?r(i.resolved):null,error:null}}catch(r){return{manifest:null,error:r instanceof Error?r:Error(String(r))}}};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from './assistant-setup-manifest.js';
|
|
2
|
+
export * from './AssistantSetupHandler.js';
|
|
3
|
+
export { applyAssistantSetup, AssistantSetupError } from './apply-assistant-setup.js';
|
|
4
|
+
export { createSessionAssistant, type SessionAssistantSetup } from './create-session-assistant.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./assistant-setup-manifest.js";export*from"./AssistantSetupHandler.js";export{applyAssistantSetup,AssistantSetupError}from"./apply-assistant-setup.js";export{createSessionAssistant}from"./create-session-assistant.js";
|
|
@@ -3,9 +3,9 @@ import type { ThemeOptions } from '@mui/material';
|
|
|
3
3
|
import type { z } from 'zod';
|
|
4
4
|
import type { FinalizeTaskResource } from '@salsita-ai/contracts/webhook';
|
|
5
5
|
import { type $DomainEntity, type DomainEntity, type DomainFactory, type EnumLike, type ProductPreset, type SchemaOfObject } from '../core/index.js';
|
|
6
|
-
import type
|
|
6
|
+
import { type ProjectModule } from '../domain-runtime/index.js';
|
|
7
7
|
import type { AclConfig, ApplicationConfig, DataSpec, DefaultEnvs, ResourcesConfig, SpecTransformer, TransformersConfig, UserInterfaceConfig } from './application-config.js';
|
|
8
|
-
import type
|
|
8
|
+
import { type AssistantResolvedManifest } from './assistant/index.js';
|
|
9
9
|
interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = never, ALLOWED_ROOT_ENTITIES extends ENTITIES = never, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>> = never, NAVIGATION_STATES extends string = never, VIEW_STATES extends string = never, TOOL_STATES extends string = never, EXPORT_STATES extends string = never, PUBLISHED_DATA extends Record<string, unknown> = never, SESSION_DATA extends Record<string, unknown> = never, FRONTEND_DATA extends Record<string, unknown> = never, ADMIN_ENTITIES extends DomainEntity<string> = never, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES = never, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>> = never, ADMIN_NAVIGATION_STATES extends string = never, ADMIN_VIEW_STATES extends string = never, FINALIZE_DATA extends Record<string, unknown> = never, PREFETCHED_FINALIZE_DATA extends Record<string, unknown> = never, FINALIZE_RESULT extends Record<string, unknown> = never, CALLBACK_DATA extends Record<string, unknown> = never, RESOURCE extends string = never> {
|
|
10
10
|
version?: string;
|
|
11
11
|
textLanguages?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initConsoleLogger as t}from"@salsita-ai/common/utils";import{defaultI18n as e}from"#package/i18n";import{extendedSchemaValidator as i}from"../core/index.js";import{NoopAnalyticsSystem as r}from"../domain-context/index.js";import{createDomainRuntime as n}from"../domain-runtime/index.js";import{isGetApplicationWrapperHandler as o}from"./GetApplicationWrapperHandler.js";import{isGetWebComponentOptionsHandler as a}from"./GetWebComponentOptions.js";import{
|
|
1
|
+
import{initConsoleLogger as t}from"@salsita-ai/common/utils";import{defaultI18n as e}from"#package/i18n";import{extendedSchemaValidator as i}from"../core/index.js";import{NoopAnalyticsSystem as r}from"../domain-context/index.js";import{createDomainRuntime as n}from"../domain-runtime/index.js";import{isGetApplicationWrapperHandler as o}from"./GetApplicationWrapperHandler.js";import{isGetWebComponentOptionsHandler as a}from"./GetWebComponentOptions.js";import{isAssistantSetupHandler as s}from"./assistant/index.js";import{createInitialPublishedData as l}from"./create-initial-published-data.js";import{isDataRowValidatorHandler as h}from"./published-data/DataRowValidatorHandler.js";import{isFilterPublishedChunksHandler as u}from"./published-data/FilterPublishedChunksHandler.js";import{isMapPublishedChunkedDataHandler as d}from"./published-data/MapPublishedChunkedDataHandler.js";import{isMapPublishedRevisionDataHandler as c}from"./published-data/MapPublishedRevisionDataHandler.js";import{isSheetValidatorHandler as f}from"./published-data/SheetValidatorHandler.js";export class ConfiguratorBuilder{_context;constructor(t){this._context=t}withDefaultEnvs(t){return new ConfiguratorBuilder({...this._context,defaultEnvs:t})}withVersion(t){return new ConfiguratorBuilder({...this._context,version:t})}withTextLanguages(t){return new ConfiguratorBuilder({...this._context,textLanguages:t})}withAcl(t){return new ConfiguratorBuilder({...this._context,acl:t})}withAdminRelease(t){return new ConfiguratorBuilder({...this._context,enableAdminRelease:t})}withUi(t){return new ConfiguratorBuilder({...this._context,ui:t})}withResourcesConfig(t){return new ConfiguratorBuilder({...this._context,resourcesConfig:t})}withChunks(t){return new ConfiguratorBuilder({...this._context,chunks:t})}withPublishedDataHash(t){return new ConfiguratorBuilder({...this._context,publishedDataHash:t})}withAssistant(t){return new ConfiguratorBuilder({...this._context,assistant:t})}withTheme(t){return new ConfiguratorBuilder({...this._context,theme:t})}withDomainFactory(t){return new ConfiguratorBuilder({...this._context,domainFactory:t})}withAdminDomainFactory(t){return new ConfiguratorBuilder({...this._context,adminDomainFactory:t})}withI18n=t=>new ConfiguratorBuilder({...this._context,i18n:t});withPrefetchedFinalizeData(t){return new ConfiguratorBuilder({...this._context,prefetchedFinalizeData:t})}withFinalizeData(t){return new ConfiguratorBuilder({...this._context,finalizeData:t})}withFinalizeResult(t){return new ConfiguratorBuilder({...this._context,finalizeResult:t})}withCallbackData(t){return new ConfiguratorBuilder({...this._context,callbackData:t})}withNavigationState(t){return new ConfiguratorBuilder({...this._context,navigationState:t})}withViewState(t){return new ConfiguratorBuilder({...this._context,viewState:t})}withToolState(t){return new ConfiguratorBuilder({...this._context,toolState:t})}withExportState(t){return new ConfiguratorBuilder({...this._context,exportState:t})}withAdminNavigationState(t){return new ConfiguratorBuilder({...this._context,adminNavigationState:t})}withAdminViewState(t){return new ConfiguratorBuilder({...this._context,adminViewState:t})}withPresets(t){return new ConfiguratorBuilder({...this._context,presets:t})}withAdminPresets(t){return new ConfiguratorBuilder({...this._context,adminPresets:t})}withComponentOptics(t){return new ConfiguratorBuilder({...this._context,componentOptics:[...this._context.componentOptics,...t]})}withAdminComponentOptics(t){return new ConfiguratorBuilder({...this._context,adminComponentOptics:[...this._context.adminComponentOptics??[],...t]})}withHandlers(t){return new ConfiguratorBuilder({...this._context,handlers:t})}withElements(t){return new ConfiguratorBuilder({...this._context,elements:t})}withResources(t){return new ConfiguratorBuilder({...this._context,resources:t})}withWebComponentTag(t){return new ConfiguratorBuilder({...this._context,tagName:t})}withTransformers(t,e){return new ConfiguratorBuilder({...this._context,transformers:{importedTransformers:t,specTransformers:e}})}withInterface(t){return this}withDataSpec=t=>new ConfiguratorBuilder({...this._context,dataSpec:t});_computeInitialPublishedData(t,e,i){if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");return l({adminDomainFactory:this._context.adminDomainFactory,domainRuntime:e,adminPresets:this._context.adminPresets??[],handlers:i,dataSpec:this._context.dataSpec,chunks:this._context.chunks,logger:t})}buildConfig(){return this._buildConfigWithHandlers().config}_buildConfigWithHandlers(){if(!this._context.domainFactory)throw Error("Can not create application config, domainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.presets)throw Error("Can not create application config, presets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminDomainFactory)throw Error("Can not create application config, adminDomainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminPresets)throw Error("Can not create application config, adminPresets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.version)throw Error("Can not create application config, version is required!");let i=this._context.tagName??"salsita-configurator",l={defaultEnvs:this._context.defaultEnvs,services:{i18n:this._context.i18n},version:this._context.version,initialPublishedData:{},domain:{textLanguages:this._context.textLanguages,componentOptics:this._context.componentOptics,presets:this._context.presets,domainFactory:this._context.domainFactory},navigation:{navigationStates:this._context.navigationState?.values(),viewStates:this._context.viewState?.values(),toolStates:this._context.toolState?.values(),exportStates:this._context.exportState?.values()},adminNavigation:{navigationStates:this._context.adminNavigationState?.values(),viewStates:this._context.adminViewState?.values()},adminDomain:{textLanguages:this._context.textLanguages,componentOptics:this._context.adminComponentOptics??[],presets:this._context.adminPresets,domainFactory:this._context.adminDomainFactory},mount:{tag:i,options:{}},handlers:this._context.handlers??[],elements:this._context.elements??[],transformers:this._context.transformers,features:{acl:this._context.acl,enableAdminRelease:this._context.enableAdminRelease},ui:{preview:this._context.ui?.preview,alwaysExpand:this._context.ui?.alwaysExpand,theme:this._context.theme},resources:this._context.resourcesConfig,chunks:this._context.chunks,publishedDataHash:this._context.publishedDataHash,assistant:this._context.assistant,dataSpec:this._context.dataSpec},d=t(),c=n({config:l,services:{analyticsService:new r,i18n:e,logger:d}}),m=c.getState().spec.configurator.handlers;if(m.filter(s).length>1)throw Error("Multiple createAssistantSetupHandler handlers found. Only one handler is allowed.");if(m.filter(t=>u(t)).length>1)throw Error("Multiple createFilterPublishedChunksHandler handlers found. Only one handler is allowed.");if(m.filter(t=>h(t)).length>1)throw Error("Multiple createDataRowValidatorHandler handlers found. Only one handler is allowed.");if(m.filter(t=>f(t)).length>1)throw Error("Multiple createSheetValidatorHandler handlers found. Only one handler is allowed.");let w=m.find(o)?.handler().handler,x=m.find(a)?.handler().handler(void 0),p=this._computeInitialPublishedData(d,c,m);return{config:{...l,mount:{tag:i,options:x??{},Application:w},initialPublishedData:p},handlers:m}}buildWebhookContext(){if(!this._context.domainFactory)throw Error("domainFactory is required!");if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");if(!this._context.adminPresets)throw Error("adminPresets are required!");let{config:t,handlers:e}=this._buildConfigWithHandlers(),r=t=>{if(null==this._context.finalizeData)return{};let e=i.compile(this._context.finalizeData);if(!e(t))throw console.error("Finalize data validation errors:",e.errors),Error("Invalid finalize data!");return t},n=t=>{if(null==this._context.finalizeResult)return{};let e=i.compile(this._context.finalizeResult);if(!e(t))throw console.error("Finalize result validation errors:",e.errors),Error("Invalid finalize result!");return t},o=t=>{if(null==this._context.callbackData)return{};let e=i.compile(this._context.callbackData);if(!e(t))throw console.error("Callback data validation errors:",e.errors),Error("Invalid callback data!");return t},a=e.find(c)?.handler().handler,s=e.find(d)?.handler().handler,l=e.find(h)?.handler().handler,u=e.find(f)?.handler().handler;return{config:t,parseFinalizeData:r,parseFinalizeResult:n,resources:this._context.resources??[],parseCallbackData:o,mapPublishedRevisionData:a,mapPublishedChunkedData:s,dataRowValidator:l,sheetValidator:u}}}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import type { Logger } from '@salsita-ai/common/utils';
|
|
2
|
-
import type {
|
|
3
|
-
import type { DomainRuntime } from '../domain-runtime/index.js';
|
|
2
|
+
import type { DomainEntity, DomainFactory, ProductPreset } from '../core/index.js';
|
|
3
|
+
import type { DomainRuntime, HandlerRegistration } from '../domain-runtime/index.js';
|
|
4
4
|
import type { ChunksSpec, DataSpec } from './application-config.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly adminDomainFactory: DomainFactory<ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
5
|
+
export interface CreateInitialPublishedDataProps<PUBLISHED_DATA extends Record<string, unknown>> {
|
|
6
|
+
readonly adminDomainFactory: DomainFactory<any, any, any, PUBLISHED_DATA, any, any>;
|
|
8
7
|
readonly domainRuntime: DomainRuntime;
|
|
9
|
-
readonly adminPresets: ReadonlyArray<ProductPreset<
|
|
8
|
+
readonly adminPresets: ReadonlyArray<ProductPreset<DomainEntity<string>, DomainEntity<string>>>;
|
|
10
9
|
readonly handlers?: ReadonlyArray<HandlerRegistration<any, any>>;
|
|
11
10
|
readonly dataSpec?: DataSpec;
|
|
12
11
|
readonly chunks?: ChunksSpec;
|
|
13
12
|
readonly logger: Logger;
|
|
14
13
|
}
|
|
15
|
-
export declare const createInitialPublishedData: <
|
|
14
|
+
export declare const createInitialPublishedData: <PUBLISHED_DATA extends Record<string, unknown>>(props: CreateInitialPublishedDataProps<PUBLISHED_DATA>) => PUBLISHED_DATA;
|
|
@@ -5,12 +5,10 @@ export { type AssistantRecipe, type AssistantRecipeContext, type AssistantRecipe
|
|
|
5
5
|
export { ConfiguratorBuilder } from './configurator-builder.js';
|
|
6
6
|
export * from './admin-page-factories.js';
|
|
7
7
|
export { createInitialPublishedData, type CreateInitialPublishedDataProps } from './create-initial-published-data.js';
|
|
8
|
-
export { resolveImportedTransformers, resolveTransformerModule, resolveTransformerModules, } from './resolve-imported-transformers.js';
|
|
9
8
|
export { webComponentAttributeParsers, createWebComponentPropertyDescriptor, type AttributeParser, type WebComponentPropertyDescriptor, } from './web-component-property.js';
|
|
10
9
|
export { createWebComponentEventDescriptor, type WebComponentEventDescriptor } from './web-component-event.js';
|
|
11
10
|
export { standardWebComponentProperties, type StandardConfiguratorElement } from './standard-properties.js';
|
|
12
11
|
export { standardWebComponentEvents } from './standard-events.js';
|
|
13
|
-
export { ResourceBuilder } from './resource-builder.js';
|
|
14
12
|
export { createGetApplicationWrapperHandler, isGetApplicationWrapperHandler, type CreateGetApplicationWrapperHandler, } from './GetApplicationWrapperHandler.js';
|
|
15
13
|
export { createGetThemeHandler, GetThemeHandlerName, isGetThemeHandler, type CreateGetThemeHandler, } from './GetThemeHandler.js';
|
|
16
14
|
export { createGetWebComponentOptionsHandler, isGetWebComponentOptionsHandler, type CreateGetWebComponentOptionsHandler, } from './GetWebComponentOptions.js';
|
|
@@ -26,6 +24,4 @@ export { createDataRowValidatorHandler, DataRowValidatorHandlerName, isDataRowVa
|
|
|
26
24
|
export { createSheetValidatorHandler, SheetValidatorHandlerName, isSheetValidatorHandler, type CreateSheetValidatorHandler, type SheetValidatorResult, } from './published-data/SheetValidatorHandler.js';
|
|
27
25
|
export { createMapPublishedRevisionDataHandler, createMapPublishedRevisionDataHandlerFactory, isMapPublishedRevisionDataHandler, type CreateMapPublishedRevisionDataHandler, type TypedCreateMapPublishedRevisionDataHandler, } from './published-data/MapPublishedRevisionDataHandler.js';
|
|
28
26
|
export { createMapPublishedChunkedDataHandler, createMapPublishedChunkedDataHandlerFactory, isMapPublishedChunkedDataHandler, type CreateMapPublishedChunkedDataHandler, type MapPublishedChunkedDataHandlerProps, type MapPublishedChunkedDataResult, type TypedCreateMapPublishedChunkedDataHandler, } from './published-data/MapPublishedChunkedDataHandler.js';
|
|
29
|
-
export { type PhoenixHandlerDefinition, type SystemPhoenixHandlerDefinition, type PhoenixHandlerRegistration, type SystemPhoenixHandlerRegistration, type SystemPhoenixAsyncHandlerDefinition, type SystemPhoenixAsyncHandlerRegistration, type HandlerRegistration, type CreatePhoenixHandler, createPhoenixHandler, createSystemPhoenixHandler, createSystemPhoenixAsyncHandler, resolveHandlerModule, resolveHandlerModules, } from './handler-registration.js';
|
|
30
|
-
export { type PhoenixEntityElementProps, type PhoenixEntityElementRegistration, type PhoenixLayoutElementRegistration, type PhoenixIconRegistration, type ElementRegistration, type CustomPhoenixEntityElementProps, type PhoenixLayoutElementDefinition, type PhoenixEntityElementDefinition, type CreateCustomPhoenixLayoutElement, type CreateCustomPhoenixEntityElement, createPhoenixLayoutElement, createPhoenixEntityElement, createCustomPhoenixLayoutElement, createCustomPhoenixEntityElement, resolveElementModule, resolveElementModules, } from './element-registration.js';
|
|
31
27
|
export * from './assistant/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{findAssistantFieldOptions,readAssistantFieldOptions}from"./assistant-field-options.js";export{deleteEntityUpdateTag,findAssistantMutation,modifyEntityUpdateTag}from"./assistant-mutations.js";export{findAssistantRecipeGroups,prepareAssistantRecipeUpdates,readAssistantRecipeGroup}from"./assistant-recipe-groups.js";export{ConfiguratorBuilder}from"./configurator-builder.js";export*from"./admin-page-factories.js";export{createInitialPublishedData}from"./create-initial-published-data.js";export{
|
|
1
|
+
export{findAssistantFieldOptions,readAssistantFieldOptions}from"./assistant-field-options.js";export{deleteEntityUpdateTag,findAssistantMutation,modifyEntityUpdateTag}from"./assistant-mutations.js";export{findAssistantRecipeGroups,prepareAssistantRecipeUpdates,readAssistantRecipeGroup}from"./assistant-recipe-groups.js";export{ConfiguratorBuilder}from"./configurator-builder.js";export*from"./admin-page-factories.js";export{createInitialPublishedData}from"./create-initial-published-data.js";export{webComponentAttributeParsers,createWebComponentPropertyDescriptor}from"./web-component-property.js";export{createWebComponentEventDescriptor}from"./web-component-event.js";export{standardWebComponentProperties}from"./standard-properties.js";export{standardWebComponentEvents}from"./standard-events.js";export{createGetApplicationWrapperHandler,isGetApplicationWrapperHandler}from"./GetApplicationWrapperHandler.js";export{createGetThemeHandler,GetThemeHandlerName,isGetThemeHandler}from"./GetThemeHandler.js";export{createGetWebComponentOptionsHandler,isGetWebComponentOptionsHandler}from"./GetWebComponentOptions.js";export{createFinalizeAdminDomain}from"./published-data/create-finalize-admin-domain.js";export{FilterPublishedChunksHandlerName,isFilterPublishedChunksHandler}from"./published-data/FilterPublishedChunksHandler.js";export{mapPublishedData}from"./published-data/map-published-data.js";export{flattenTabData,mapDefaultValuesToRecords,mapPublishedChunkedData,SYSTEM_CHUNK_KEY,SYSTEM_CHUNK_SCOPE,SWATCH_DEFINITION}from"./published-data/map-published-chunked-data.js";export{buildLegendRows}from"./published-data/build-legend-data.js";export{formatFieldType,getFieldDescription}from"./published-data/format-field-type.js";export{mapDataToSheet}from"./published-data/map-data-to-sheet.js";export{validateRows}from"./published-data/validate-sheet-data.js";export{createDataRowValidatorHandler,DataRowValidatorHandlerName,isDataRowValidatorHandler}from"./published-data/DataRowValidatorHandler.js";export{createSheetValidatorHandler,SheetValidatorHandlerName,isSheetValidatorHandler}from"./published-data/SheetValidatorHandler.js";export{createMapPublishedRevisionDataHandler,createMapPublishedRevisionDataHandlerFactory,isMapPublishedRevisionDataHandler}from"./published-data/MapPublishedRevisionDataHandler.js";export{createMapPublishedChunkedDataHandler,createMapPublishedChunkedDataHandlerFactory,isMapPublishedChunkedDataHandler}from"./published-data/MapPublishedChunkedDataHandler.js";export*from"./assistant/index.js";
|