@salsita-ai/sdk 0.50.0-develop.bfba230ad7 → 0.50.0-develop.d81d7591c5
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/dist/application-spec/generate-application/code/common/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/common/index.js +1 -1
- package/dist/application-spec/generate-application/code/common/project-module-list.d.ts +8 -0
- package/dist/application-spec/generate-application/code/common/project-module-list.js +3 -0
- package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
- package/dist/application-spec/generate-application/code/templates/admin-domain-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/admin-domain-code.js +6 -14
- package/dist/application-spec/generate-application/code/templates/admin-frontend-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/admin-frontend-code.js +4 -4
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +7 -16
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +7 -9
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.d.ts +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec.js +4 -4
- package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +2 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -2
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +8 -4
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +4 -3
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +3 -8
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +9 -43
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +2 -2
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.d.ts +5 -21
- package/dist/client/phoenix-api.d.ts +58 -30
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +15 -3
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
- package/dist/configurator/ui/assistant/tool-chip.d.ts +8 -1
- package/dist/configurator/ui/assistant/tool-chip.js +1 -1
- package/dist/docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx +84 -98
- package/dist/docs/complex-use-cases/navigation-reset-selection.mdx +18 -12
- package/dist/docs/index.json +1 -1
- package/dist/docs/layouts/custom-price.mdx +14 -16
- package/dist/docs/layouts/sidebar/tabs.mdx +24 -21
- package/dist/docs/other-features/domain-actions.mdx +1 -1
- package/dist/docs/other-features/side-effects.mdx +42 -34
- package/dist/docs/other-features/transformers.mdx +1 -1
- package/dist/docs/phoenix/admin.mdx +9 -24
- package/dist/docs/phoenix/localization.mdx +3 -22
- package/dist/docs/phoenix/project-structure.mdx +6 -0
- package/dist/docs/recipes-and-delete/recipe-hierarchy-selection.mdx +15 -13
- package/dist/docs/relations/hierarchy.mdx +13 -2
- package/dist/domain/actions/action-factory.d.ts +3 -2
- package/dist/domain/application/application-config.d.ts +25 -75
- package/dist/domain/application/assistant/assistant-manifest.d.ts +61 -0
- package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +95 -0
- package/dist/domain/application/assistant/assistant-value-type.d.ts +9 -0
- package/dist/domain/application/assistant/assistant-value-type.js +1 -0
- package/dist/domain/application/assistant/build-assistant-manifest.d.ts +4 -0
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -0
- package/dist/{phoenix/application-spec → domain/application/assistant}/generate-assistant-prompt.d.ts +3 -3
- package/dist/{phoenix/application-spec → domain/application/assistant}/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/assistant/index.d.ts +4 -0
- package/dist/domain/application/assistant/index.js +1 -0
- package/dist/domain/application/assistant-field-options.d.ts +1 -1
- package/dist/domain/application/assistant-mutations.d.ts +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +1 -1
- package/dist/domain/application/configurator-builder.d.ts +33 -18
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/element-registration.d.ts +5 -0
- package/dist/domain/application/element-registration.js +1 -1
- package/dist/domain/application/handler-registration.d.ts +5 -0
- package/dist/domain/application/handler-registration.js +1 -1
- package/dist/domain/application/index.d.ts +5 -4
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/application/resolve-imported-transformers.d.ts +11 -1
- package/dist/domain/application/resolve-imported-transformers.js +1 -1
- package/dist/domain/components/domain-component-optic.d.ts +3 -0
- package/dist/domain/components/domain-component-optic.js +2 -2
- package/dist/domain/components/system-component-builder.js +1 -1
- package/dist/domain/core/action.d.ts +1 -1
- package/dist/domain/core/component.d.ts +1 -1
- package/dist/domain/core/decoder/create-decoder.d.ts +6 -0
- package/dist/domain/core/decoder/create-decoder.js +1 -0
- package/dist/domain/core/decoder/decoder.d.ts +6 -0
- package/dist/domain/core/decoder/decoder.js +1 -0
- package/dist/domain/core/decoder/index.d.ts +2 -0
- package/dist/domain/core/decoder/index.js +1 -0
- package/dist/domain/core/domain-factory.js +1 -1
- package/dist/domain/core/index.d.ts +1 -3
- package/dist/domain/core/index.js +1 -1
- package/dist/domain/core/reflection.d.ts +1 -1
- package/dist/domain/core/reflection.js +1 -1
- package/dist/domain/core/schema/enhanced-json-schema.js +1 -0
- package/dist/domain/core/schema/extended-schema-validator.js +1 -0
- package/dist/domain/core/schema/index.d.ts +3 -0
- package/dist/domain/core/schema/index.js +1 -0
- package/dist/domain/core/schema/schema-validator.js +1 -0
- package/dist/domain/domain-builder.d.ts +10 -1
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-context/action-system/action-system.js +1 -1
- package/dist/domain/domain-context/transformers/chain-builder.d.ts +1 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +4 -4
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
- package/dist/domain/domain-runtime/spec/selectors.js +1 -1
- package/dist/domain/domain-runtime/spec/types.d.ts +3 -3
- package/dist/domain/index.d.ts +3 -2
- package/dist/domain/index.js +1 -1
- package/dist/domain/invariants/invariants.d.ts +9 -0
- package/dist/domain/invariants/invariants.js +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +3 -3
- package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
- package/dist/domain/project-modules/index.d.ts +1 -0
- package/dist/domain/project-modules/index.js +1 -0
- package/dist/domain/project-modules/project-modules.d.ts +41 -0
- package/dist/domain/project-modules/project-modules.js +1 -0
- package/dist/domain/system-components/common/dimension-indicator-schema.d.ts +1 -1
- package/dist/domain/system-components/common/dimension-indicator-schema.js +1 -1
- package/dist/editor/domain-editors/use-implementation-files.d.ts +7 -6
- package/dist/editor/domain-editors/use-implementation-files.js +1 -1
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/legacy/domain-cli/gen/configurator-builder.js +21 -8
- 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/frontend-admin.js +18 -19
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +15 -16
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +22 -23
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +15 -16
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.d.ts +7 -2
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.js +8 -12
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.js +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/webhook-builders.js +7 -7
- package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +4 -3
- package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
- package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
- package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
- package/dist/phoenix/services/prepare-development-environment.js +1 -1
- package/dist/phoenix/services/variant-file-session.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-domain-application-props.d.ts +5 -2
- package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.d.ts +1 -1
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +4 -4
- package/dist/webhook/builders/common.d.ts +3 -0
- package/dist/webhook/builders/webhook-builder.d.ts +1 -1
- package/dist/webhook/builders/webhook-builder.js +1 -1
- package/package.json +3 -3
- package/dist/domain/core/json-schema.js +0 -1
- /package/dist/domain/{core/enhanced-json-schema.js → application/assistant/assistant-manifest.js} +0 -0
- /package/dist/domain/{core/schema-validator.js → application/assistant/assistant-resolved-manifest.js} +0 -0
- /package/dist/domain/core/{schema-validator-ajv.d.ts → schema/create-ajv-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator-ajv.js → schema/create-ajv-schema-validator.js} +0 -0
- /package/dist/domain/core/{schema-validator-csp.d.ts → schema/create-csp-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator-csp.js → schema/create-csp-schema-validator.js} +0 -0
- /package/dist/domain/core/{enhanced-json-schema.d.ts → schema/enhanced-json-schema.d.ts} +0 -0
- /package/dist/domain/core/{json-schema.d.ts → schema/extended-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator.d.ts → schema/schema-validator.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./application-type-imports.js";export*from"./code-imports.js";export*from"./exported-type-declarations.js";export*from"./env-reader.js";export*from"./file-headers.js";
|
|
1
|
+
export*from"./application-type-imports.js";export*from"./code-imports.js";export*from"./exported-type-declarations.js";export*from"./env-reader.js";export*from"./file-headers.js";export*from"./project-module-list.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The default imports of one convention folder's files, as a generated barrel lists them. */
|
|
2
|
+
export declare const generateProjectModuleImports: (files: readonly string[], prefix: string) => readonly string[];
|
|
3
|
+
/**
|
|
4
|
+
* The origin-tagged module list a generated barrel exports for one convention folder. The barrel only
|
|
5
|
+
* pairs each default export with its project path; the SDK validates and merges the exports, so that an
|
|
6
|
+
* invalid file is reported by name and the built app and the editor's hot reload share one implementation.
|
|
7
|
+
*/
|
|
8
|
+
export declare const generateProjectModuleList: (files: readonly string[], prefix: string) => string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const generateProjectModuleImports=(e,t)=>e.map((e,r)=>`import ${t}${r} from '../${e.replace(/\.tsx?$/,".js")}'`);export const generateProjectModuleList=(e,t)=>{if(0===e.length)return"[]";let r=e.map((e,r)=>` { origin: '${e}', exports: ${t}${r} },`);return`[
|
|
2
|
+
${r.join("\n")}
|
|
3
|
+
]`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{GeneratedApplicationFile as n}from"../../core/index.js";import{createApplicationTypeImportRegistrar as e}from"./common/index.js";import{generateAdminGlobalBindingBlock as i,generateApplicationSpecAdminCode as o,generateApplicationSpecAdminFrontendCode as t,generateApplicationSpecAdminGlobals as a,generateApplicationSpecConfiguratorCode as r,generateApplicationSpecConfiguratorConfig as s,generateApplicationSpecConfiguratorFrontendCode as d,generateApplicationSpecConfiguratorGlobals as c,generateApplicationSpecDomainFile as g,generateApplicationSpecDomainSpecFile as m,generateApplicationSpecGlobals as p,generateApplicationSpecTypesModule as l,generateConfiguratorGlobalBindingBlock as f,generateImportedStateConstants as B,generatePhxExportsBlock as u,generatePhxGlobalsBlock as x,generateStateConstants as h}from"./templates/index.js";import{splitWebhookMembership as k}from"./webhook-safe-files.js";let y=()=>"";export const globalPhxBindingStrategy={generateApplicationTypesFile:(e,i)=>n("globals.d.ts",p(e,i)),generateDomainBindingBlock:x,generateStateConstants:h,generateConfiguratorBindingBlock:f,configuratorBindingDescription:"Creates the configurator interface and sets phx.frontend — must run before any user code imports.",generateAdminBindingBlock:i,adminBindingDescription:"Creates the admin interface and sets phx.frontend.admin — must run before admin user code imports."};export const modulePhxBindingStrategy={applicationTypeImportSource:"./application-types.js",generateApplicationTypesFile:(e,i)=>n("application-types.ts",l(e,i)),generateDomainBindingBlock:u,generateStateConstants:B,generateConfiguratorBindingBlock:y,configuratorBindingDescription:"Creates and exports the configurator interface for a module-scoped phx binding.",generateAdminBindingBlock:y,adminBindingDescription:"Creates and exports the admin interface for a module-scoped phx binding."};let C=n=>n.map(n=>n.file.name);export const generateDomainRuntimeFiles=(i,p)=>{let{applicationSpec:l,categorizedFiles:f,phxDefinitions:B,includeDefaultEnvs:u}=i,x=e(p.applicationTypeImportSource),h=C(f.expressions),y=C(f.actions),b=C(f.handlers),D=C(f.elements),S=C(f.transformers),A=C(f.invariants),F=C(f.adminInvariants),j=C(f.adminExpressions),I=C(f.adminElements),T=k(f.components),w=C(T.webhookIncluded),v=C(T.frontendOnly),E=k(f.adminComponents),O=C(E.webhookIncluded),P=C(E.frontendOnly);return[n("domain-spec.ts",m(l,{generateBindingBlock:p.generateDomainBindingBlock,generateStateConstants:p.generateStateConstants,registerApplicationTypeImports:x})),n("configurator-globals.ts",c(p.generateConfiguratorBindingBlock,p.configuratorBindingDescription)),n("configurator-domain-code.ts",r({expressionFiles:h,actionFiles:y,invariantFiles:A,componentFiles:w}
|
|
1
|
+
import{GeneratedApplicationFile as n}from"../../core/index.js";import{createApplicationTypeImportRegistrar as e}from"./common/index.js";import{generateAdminGlobalBindingBlock as i,generateApplicationSpecAdminCode as o,generateApplicationSpecAdminFrontendCode as t,generateApplicationSpecAdminGlobals as a,generateApplicationSpecConfiguratorCode as r,generateApplicationSpecConfiguratorConfig as s,generateApplicationSpecConfiguratorFrontendCode as d,generateApplicationSpecConfiguratorGlobals as c,generateApplicationSpecDomainFile as g,generateApplicationSpecDomainSpecFile as m,generateApplicationSpecGlobals as p,generateApplicationSpecTypesModule as l,generateConfiguratorGlobalBindingBlock as f,generateImportedStateConstants as B,generatePhxExportsBlock as u,generatePhxGlobalsBlock as x,generateStateConstants as h}from"./templates/index.js";import{splitWebhookMembership as k}from"./webhook-safe-files.js";let y=()=>"";export const globalPhxBindingStrategy={generateApplicationTypesFile:(e,i)=>n("globals.d.ts",p(e,i)),generateDomainBindingBlock:x,generateStateConstants:h,generateConfiguratorBindingBlock:f,configuratorBindingDescription:"Creates the configurator interface and sets phx.frontend — must run before any user code imports.",generateAdminBindingBlock:i,adminBindingDescription:"Creates the admin interface and sets phx.frontend.admin — must run before admin user code imports."};export const modulePhxBindingStrategy={applicationTypeImportSource:"./application-types.js",generateApplicationTypesFile:(e,i)=>n("application-types.ts",l(e,i)),generateDomainBindingBlock:u,generateStateConstants:B,generateConfiguratorBindingBlock:y,configuratorBindingDescription:"Creates and exports the configurator interface for a module-scoped phx binding.",generateAdminBindingBlock:y,adminBindingDescription:"Creates and exports the admin interface for a module-scoped phx binding."};let C=n=>n.map(n=>n.file.name);export const generateDomainRuntimeFiles=(i,p)=>{let{applicationSpec:l,categorizedFiles:f,phxDefinitions:B,includeDefaultEnvs:u}=i,x=e(p.applicationTypeImportSource),h=C(f.expressions),y=C(f.actions),b=C(f.handlers),D=C(f.elements),S=C(f.transformers),A=C(f.invariants),F=C(f.adminInvariants),j=C(f.adminExpressions),I=C(f.adminElements),T=k(f.components),w=C(T.webhookIncluded),v=C(T.frontendOnly),E=k(f.adminComponents),O=C(E.webhookIncluded),P=C(E.frontendOnly);return[n("domain-spec.ts",m(l,{generateBindingBlock:p.generateDomainBindingBlock,generateStateConstants:p.generateStateConstants,registerApplicationTypeImports:x})),n("configurator-globals.ts",c(p.generateConfiguratorBindingBlock,p.configuratorBindingDescription)),n("configurator-domain-code.ts",r({expressionFiles:h,actionFiles:y,invariantFiles:A,componentFiles:w})),n("configurator-frontend-code.ts",d({transformerFiles:S,handlerFiles:b,elementFiles:D,componentFiles:v})),n("admin-domain-code.ts",o({adminExpressionFiles:j,adminInvariantFiles:F,adminComponentFiles:O})),n("admin-frontend-code.ts",t({adminElementFiles:I,adminComponentFiles:P})),n("domain.ts",g(l)),n("configurator-config.ts",s(l,{includeDefaultEnvs:u})),p.generateApplicationTypesFile(l,B),n("admin-globals.ts",a(p.generateAdminBindingBlock,p.adminBindingDescription))]};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { type ApplicationTypeImportRegistrar } from '../common/index.js';
|
|
2
1
|
interface GenerateAdminCodeOptions {
|
|
3
2
|
readonly adminExpressionFiles: readonly string[];
|
|
4
3
|
readonly adminInvariantFiles: readonly string[];
|
|
5
4
|
readonly adminComponentFiles: readonly string[];
|
|
6
5
|
}
|
|
7
|
-
export declare const generateApplicationSpecAdminCode: (options: GenerateAdminCodeOptions
|
|
6
|
+
export declare const generateApplicationSpecAdminCode: (options: GenerateAdminCodeOptions) => string;
|
|
8
7
|
export {};
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import{autoHeader as n}from"../common/file-headers.js";import{CodeImports as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}`),l=d.map((n,t)=>`adminComponents${t}`);return`${n("admin-domain-code.ts","Barrel file for user-authored admin domain code — expressions, invariants and components.")}
|
|
6
|
-
${p.toString()}
|
|
7
|
-
${i(c)}
|
|
8
|
-
const mergedExpressions: Record<string, Record<string, unknown>> = {}
|
|
9
|
-
${i(A,"\n\n")}
|
|
10
|
-
export const customAdminExpressions = mergedExpressions as AliasedExpressions<Admin.AnyDomainEntity, Admin.RootEntity, PublishedData, SessionData, FrontendData, Admin.Aliases>
|
|
1
|
+
import{autoHeader as n}from"../common/file-headers.js";import{CodeImports as o,generateProjectModuleImports as e,generateProjectModuleList as t}from"../common/index.js";export const generateApplicationSpecAdminCode=i=>{let{adminExpressionFiles:s,adminInvariantFiles:r,adminComponentFiles:a}=i,d=new o;d.addTypeImport("@salsita-ai/sdk/domain","ProjectModule");let m=[...e(s,"adminExpressions"),...e(r,"adminInvariants"),...e(a,"adminComponents")];return`${n("admin-domain-code.ts","Barrel file for user-authored admin domain code — expressions, invariants and components.")}
|
|
2
|
+
${d.toString()}
|
|
3
|
+
${m.length>0?"\n"+m.join("\n")+"\n":""}
|
|
4
|
+
export const customAdminExpressions: readonly ProjectModule[] = ${t(s,"adminExpressions")}
|
|
11
5
|
|
|
12
|
-
const
|
|
13
|
-
${i(y,"\n\n")}
|
|
14
|
-
export const customAdminInvariants = mergedInvariants as AliasedInvariants<Admin.AnyDomainEntity, Admin.RootEntity, PublishedData, SessionData, FrontendData, Admin.Aliases, string>
|
|
6
|
+
export const customAdminInvariants: readonly ProjectModule[] = ${t(r,"adminInvariants")}
|
|
15
7
|
|
|
16
|
-
export const customAdminComponentOptics:
|
|
8
|
+
export const customAdminComponentOptics: readonly ProjectModule[] = ${t(a,"adminComponents")}
|
|
17
9
|
`};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type ApplicationTypeImportRegistrar } from '../common/index.js';
|
|
2
1
|
interface GenerateAdminFrontendCodeOptions {
|
|
3
2
|
readonly adminElementFiles: readonly string[];
|
|
4
3
|
readonly adminComponentFiles: readonly string[];
|
|
5
4
|
}
|
|
6
|
-
export declare const generateApplicationSpecAdminFrontendCode: (options: GenerateAdminFrontendCodeOptions
|
|
5
|
+
export declare const generateApplicationSpecAdminFrontendCode: (options: GenerateAdminFrontendCodeOptions) => string;
|
|
7
6
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{autoHeader as n}from"../common/file-headers.js";import{CodeImports as
|
|
2
|
-
${
|
|
1
|
+
import{autoHeader as n}from"../common/file-headers.js";import{CodeImports as e,generateProjectModuleImports as o,generateProjectModuleList as t}from"../common/index.js";export const generateApplicationSpecAdminFrontendCode=d=>{let{adminElementFiles:m,adminComponentFiles:r}=d,i=new e;i.addTypeImport("@salsita-ai/sdk/domain","ProjectModule");let s=[...o(m,"adminElements"),...o(r,"frontendAdminComponents")];return`${n("admin-frontend-code.ts","Barrel file for user-authored admin frontend code — elements and frontend-only components. Needs phx.frontend.admin.")}
|
|
2
|
+
${i.toString()}
|
|
3
3
|
|
|
4
4
|
import './admin-globals.js'
|
|
5
5
|
${s.length>0?"\n"+s.join("\n")+"\n":""}
|
|
6
|
-
export const customAdminElements: readonly
|
|
6
|
+
export const customAdminElements: readonly ProjectModule[] = ${t(m,"adminElements")}
|
|
7
7
|
|
|
8
|
-
export const customFrontendAdminComponentOptics:
|
|
8
|
+
export const customFrontendAdminComponentOptics: readonly ProjectModule[] = ${t(r,"frontendAdminComponents")}
|
|
9
9
|
`};
|
package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { type ApplicationTypeImportRegistrar } from '../common/index.js';
|
|
2
1
|
interface GenerateConfiguratorCodeOptions {
|
|
3
2
|
readonly expressionFiles: readonly string[];
|
|
4
3
|
readonly actionFiles: readonly string[];
|
|
5
4
|
readonly invariantFiles: readonly string[];
|
|
6
5
|
readonly componentFiles: readonly string[];
|
|
7
6
|
}
|
|
8
|
-
export declare const generateApplicationSpecConfiguratorCode: (options: GenerateConfiguratorCodeOptions
|
|
7
|
+
export declare const generateApplicationSpecConfiguratorCode: (options: GenerateConfiguratorCodeOptions) => string;
|
|
9
8
|
export {};
|
package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import{autoHeader as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}`),A=d.map((t,n)=>`components${n}`);return`${t("configurator-domain-code.ts","Barrel file for user-authored domain code — expressions, actions, invariants and components. Needs only phx.domain.")}
|
|
6
|
-
${c.toString()}
|
|
7
|
-
${a(l)}
|
|
8
|
-
const mergedExpressions: Record<string, Record<string, unknown>> = {}
|
|
9
|
-
${a(D,"\n\n")}
|
|
10
|
-
export const customExpressions = mergedExpressions as AliasedExpressions<AnyDomainEntity, RootEntity, PublishedData, SessionData, FrontendData, Aliases>
|
|
1
|
+
import{autoHeader as o}from"../common/file-headers.js";import{CodeImports as n,generateProjectModuleImports as e,generateProjectModuleList as t}from"../common/index.js";export const generateApplicationSpecConfiguratorCode=s=>{let{expressionFiles:r,actionFiles:i,invariantFiles:a,componentFiles:c}=s,d=new n;d.addTypeImport("@salsita-ai/sdk/domain","ProjectModule");let p=[...e(r,"expressions"),...e(i,"actions"),...e(a,"invariants"),...e(c,"components")];return`${o("configurator-domain-code.ts","Barrel file for user-authored domain code — expressions, actions, invariants and components. Needs only phx.domain.")}
|
|
2
|
+
${d.toString()}
|
|
3
|
+
${p.length>0?"\n"+p.join("\n")+"\n":""}
|
|
4
|
+
export const customExpressions: readonly ProjectModule[] = ${t(r,"expressions")}
|
|
11
5
|
|
|
12
|
-
|
|
13
|
-
export const customActions: ActionImplementations<AnyDomainEntity, RootEntity, $Map, PublishedData, SessionData, FrontendData, NavigationState, ViewState, ToolState, ExportState, ActionTypes> = { ${y.join(", ")} }
|
|
6
|
+
export const customActions: readonly ProjectModule[] = ${t(i,"actions")}
|
|
14
7
|
|
|
15
|
-
const
|
|
16
|
-
${a(x,"\n\n")}
|
|
17
|
-
export const customInvariants = mergedInvariants as AliasedInvariants<AnyDomainEntity, RootEntity, PublishedData, SessionData, FrontendData, Aliases, string>
|
|
8
|
+
export const customInvariants: readonly ProjectModule[] = ${t(a,"invariants")}
|
|
18
9
|
|
|
19
|
-
export const customComponentOptics:
|
|
10
|
+
export const customComponentOptics: readonly ProjectModule[] = ${t(c,"components")}
|
|
20
11
|
`};
|
package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { type ApplicationTypeImportRegistrar } from '../common/index.js';
|
|
2
1
|
interface GenerateConfiguratorFrontendCodeOptions {
|
|
3
2
|
readonly transformerFiles: readonly string[];
|
|
4
3
|
readonly handlerFiles: readonly string[];
|
|
5
4
|
readonly elementFiles: readonly string[];
|
|
6
5
|
readonly componentFiles: readonly string[];
|
|
7
6
|
}
|
|
8
|
-
export declare const generateApplicationSpecConfiguratorFrontendCode: (options: GenerateConfiguratorFrontendCodeOptions
|
|
7
|
+
export declare const generateApplicationSpecConfiguratorFrontendCode: (options: GenerateConfiguratorFrontendCodeOptions) => string;
|
|
9
8
|
export {};
|
package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import{autoHeader as
|
|
2
|
-
${
|
|
1
|
+
import{autoHeader as o}from"../common/file-headers.js";import{CodeImports as e,generateProjectModuleImports as n,generateProjectModuleList as r}from"../common/index.js";export const generateApplicationSpecConfiguratorFrontendCode=t=>{let{transformerFiles:s,handlerFiles:d,elementFiles:l,componentFiles:a}=t,m=new e;m.addTypeImport("@salsita-ai/sdk/domain","ProjectModule");let c=[...n(s,"transformers"),...n(d,"handlers"),...n(l,"elements"),...n(a,"frontendComponents")];return`${o("configurator-frontend-code.ts","Barrel file for user-authored frontend code — transformers, handlers, elements and frontend-only components. Needs phx.frontend.")}
|
|
2
|
+
${m.toString()}
|
|
3
3
|
|
|
4
4
|
import './configurator-globals.js'
|
|
5
|
-
${
|
|
6
|
-
export const customTransformers:
|
|
7
|
-
${f.join(",\n")}
|
|
8
|
-
]
|
|
5
|
+
${c.length>0?"\n"+c.join("\n")+"\n":""}
|
|
6
|
+
export const customTransformers: readonly ProjectModule[] = ${r(s,"transformers")}
|
|
9
7
|
|
|
10
|
-
export const customHandlers:
|
|
8
|
+
export const customHandlers: readonly ProjectModule[] = ${r(d,"handlers")}
|
|
11
9
|
|
|
12
|
-
export const customElements: readonly
|
|
10
|
+
export const customElements: readonly ProjectModule[] = ${r(l,"elements")}
|
|
13
11
|
|
|
14
|
-
export const customFrontendComponentOptics:
|
|
12
|
+
export const customFrontendComponentOptics: readonly ProjectModule[] = ${r(a,"frontendComponents")}
|
|
15
13
|
`};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AssistantSpec } from '../../../../parse-application-files/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* Emits the `$assistant` constant handed to `baseConfiguratorBuilder.withAssistant()`: the
|
|
4
|
-
*
|
|
3
|
+
* Emits the `$assistant` constant handed to `baseConfiguratorBuilder.withAssistant()`: the resolved
|
|
4
|
+
* JSON manifest, or `null` when the spec declares no `assistant` section.
|
|
5
5
|
*/
|
|
6
6
|
export declare const generateAssistantBlock: (assistant: AssistantSpec) => string;
|
package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const generateAssistantBlock=s=>`const $assistant:
|
|
1
|
+
export const generateAssistantBlock=s=>`const $assistant: AssistantResolvedManifest | null = ${JSON.stringify(s?.resolved??null,null,2)}`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{CodeImports as e,autoHeader as a,skipApplicationTypeImports as i}from"../common/index.js";import{generateApplicationMetadataBlock as o,generateAssistantBlock as n,generateBaseConfiguratorBuilder as t,generateChunksSpec as s,generateDataSchemaConstants as r,generateDataSpec as p,generateDomainBlock as m,generateLocaleCodegen as d,generatePhxGlobalsBlock as c,generateResourcesCodegen as l,generateStateConstants as u}from"./domain-spec/index.js";let x="@salsita-ai/sdk/domain",g="@salsita-ai/sdk/i18n";export const globalDomainSpecPhxBinding={generateBindingBlock:c,generateStateConstants:u,registerApplicationTypeImports:i};export const generateApplicationSpecDomainSpecFile=(i,c=globalDomainSpecPhxBinding)=>{let u=new e,{registerApplicationTypeImports:f}=c,E=m({domainSpec:i.configurator,invariants:i.configurator.invariants,actions:i.configurator.actions,typePrefix:"",versionNsPrefix:"ModelV",isAdmin:!1,modelVersionsExportName:"modelVersions",relationExpressionsExportName:"relationExpressions",componentOpticsExportName:"componentOptics",valueExpressionsExportName:"valueExpressions",createRecipeExportName:"createRecipe",imports:u,registerApplicationTypeImports:f}),S=m({domainSpec:i.admin,invariants:i.admin.invariants,actions:void 0,typePrefix:"Admin",versionNsPrefix:"AdminV",isAdmin:!0,modelVersionsExportName:"adminModelVersions",relationExpressionsExportName:"adminRelationExpressions",componentOpticsExportName:"adminComponentOptics",valueExpressionsExportName:"adminValueExpressions",createRecipeExportName:"createAdminRecipe",imports:u,registerApplicationTypeImports:f}),{hasResources:$}=l(i);u.addImport(x,"ConfiguratorBuilder"),u.addImport(x,"EnumReflection"),u.addTypeImport(x,"
|
|
1
|
+
import{CodeImports as e,autoHeader as a,skipApplicationTypeImports as i}from"../common/index.js";import{generateApplicationMetadataBlock as o,generateAssistantBlock as n,generateBaseConfiguratorBuilder as t,generateChunksSpec as s,generateDataSchemaConstants as r,generateDataSpec as p,generateDomainBlock as m,generateLocaleCodegen as d,generatePhxGlobalsBlock as c,generateResourcesCodegen as l,generateStateConstants as u}from"./domain-spec/index.js";let x="@salsita-ai/sdk/domain",g="@salsita-ai/sdk/i18n";export const globalDomainSpecPhxBinding={generateBindingBlock:c,generateStateConstants:u,registerApplicationTypeImports:i};export const generateApplicationSpecDomainSpecFile=(i,c=globalDomainSpecPhxBinding)=>{let u=new e,{registerApplicationTypeImports:f}=c,E=m({domainSpec:i.configurator,invariants:i.configurator.invariants,actions:i.configurator.actions,typePrefix:"",versionNsPrefix:"ModelV",isAdmin:!1,modelVersionsExportName:"modelVersions",relationExpressionsExportName:"relationExpressions",componentOpticsExportName:"componentOptics",valueExpressionsExportName:"valueExpressions",createRecipeExportName:"createRecipe",imports:u,registerApplicationTypeImports:f}),S=m({domainSpec:i.admin,invariants:i.admin.invariants,actions:void 0,typePrefix:"Admin",versionNsPrefix:"AdminV",isAdmin:!0,modelVersionsExportName:"adminModelVersions",relationExpressionsExportName:"adminRelationExpressions",componentOpticsExportName:"adminComponentOptics",valueExpressionsExportName:"adminValueExpressions",createRecipeExportName:"createAdminRecipe",imports:u,registerApplicationTypeImports:f}),{hasResources:$}=l(i);u.addImport(x,"ConfiguratorBuilder"),u.addImport(x,"EnumReflection"),u.addTypeImport(x,"AssistantResolvedManifest"),u.addTypeImport(x,"ChunksSpec"),u.addTypeImport(x,"DataSpec"),u.addTypeImport(x,"EnumLike"),$&&u.addImport(x,"ResourceBuilder"),u.addImport(g,"mergeCatalogs"),u.addImport(g,"sdkCatalog"),u.addImport("@lingui/core","setupI18n");let v=r(i.configurator.dataSchemas,u,f),k=c.generateStateConstants({configuratorStates:i.configurator.states,adminStates:i.admin.states},u,f),I=o(i),{importBlock:N,catalogBlock:h,createI18nExport:A}=d(i.configurator.ui.availableLocales),{preBlock:B,builderBlock:C}=t(i,u,f),R=c.generateBindingBlock();return`${a("domain-spec.ts","Domain builders, model schemas, component optics and expression definitions derived from the spec.")}
|
|
2
2
|
${u.toString()}${N}
|
|
3
3
|
|
|
4
4
|
// ---- Data schemas ----
|
|
5
5
|
|
|
6
|
-
${
|
|
6
|
+
${v}
|
|
7
7
|
|
|
8
8
|
// ---- Admin domain ----
|
|
9
9
|
|
|
@@ -25,7 +25,7 @@ ${I}
|
|
|
25
25
|
|
|
26
26
|
// ---- State enums ----
|
|
27
27
|
|
|
28
|
-
${
|
|
28
|
+
${k}
|
|
29
29
|
|
|
30
30
|
const $dataSpec: DataSpec = ${p(i.dataSpec.entries)}
|
|
31
31
|
|
|
@@ -35,4 +35,4 @@ ${n(i.configurator.assistant)}
|
|
|
35
35
|
${B}
|
|
36
36
|
${C}
|
|
37
37
|
|
|
38
|
-
${
|
|
38
|
+
${R}`};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CodeImports as i}from"../common/code-imports.js";import{autoHeader as
|
|
1
|
+
import{CodeImports as i}from"../common/code-imports.js";import{autoHeader as o}from"../common/file-headers.js";let n=/v(\d+)\.ts$/,t=(i,o)=>i.versionedModels.filter(i=>void 0!==i.migrationFile).map(i=>({version:i.version,file:i.migrationFile,importName:o?`${o}MigrateToV${i.version}`:`migrateToV${i.version}`})),s=i=>i.map(i=>{let o=i.file.replace(n,`v${i.version}.js`),t=`migrateToV${i.version}`,s=i.importName!==t?` as ${i.importName}`:"";return`import { ${t}${s} } from '../${o}'`}).join("\n"),e=(i,o,n,t)=>[`const ${t}Migrations = {`,...i.map(i=>` ${i.version}: ${i.importName},`),"}","",`const ${t} = MigrateFunctionBuilder`,` .fromVersions(${o})`,` .to(${n})`,` .using(${t}Migrations)`," .build()"].join("\n");export const generateApplicationSpecDomainFile=n=>{let r=new i,a="./domain-spec.js",m="./configurator-domain-code.js",d="./admin-domain-code.js",p=i=>[...i.expressions.values()].some(i=>[...i.values()].some(i=>"relation"===i.implementation.kind)),l=p(n.configurator.expressions),c=p(n.admin.expressions),u=t(n.configurator.resolvedVersions,""),g=t(n.admin.resolvedVersions,"admin"),h=u.length>0,I=g.length>0;r.addImport(a,"baseConfiguratorBuilder"),r.addImport(a,"domainBuilder"),r.addImport(a,"adminDomainBuilder"),r.addImport(a,"attachComponent"),r.addImport(a,"attachAdminComponent"),r.addImport(a,"implementCustomExpressions"),r.addImport(a,"implementAdminCustomExpressions"),r.addImport(a,"createI18n"),r.addImport(a,"componentOptics"),r.addImport(a,"adminComponentOptics"),r.addImport(a,"invariantBuilder"),r.addImport(a,"adminInvariantBuilder"),r.addImport(m,"customExpressions"),r.addImport(m,"customInvariants"),r.addImport(m,"customActions"),r.addImport(d,"customAdminExpressions"),r.addImport(d,"customAdminInvariants"),l&&r.addImport(a,"relationExpressions"),c&&r.addImport(a,"adminRelationExpressions"),(h||I)&&r.addImport("@salsita-ai/sdk/domain","MigrateFunctionBuilder"),h&&r.addImport(a,"modelVersions"),I&&r.addImport(a,"adminModelVersions");let x=[];h&&x.push(s(u)),I&&x.push(s(g));let v=x.length>0?"\n"+x.join("\n")+"\n":"",$=[];h&&$.push(e(u,"modelVersions",n.configurator.schemaVersion,"migrate")),I&&$.push(e(g,"adminModelVersions",n.admin.schemaVersion,"migrateAdmin"));let E=$.length>0?"\n"+$.join("\n\n")+"\n":"",f=["const domainFactory = domainBuilder",l?" .withExpressions(relationExpressions)":null," .withExpressions(invariantBuilder.withInvariantModules(customInvariants).buildViolationExpressions())"," .withExpressionModules(customExpressions)"," .withActionModules(customActions)",h?" .withMigrate(migrate)":null," .build()"].filter(Boolean).join("\n"),A=["const adminDomainFactory = adminDomainBuilder",c?" .withExpressions(adminRelationExpressions)":null," .withExpressions(adminInvariantBuilder.withInvariantModules(customAdminInvariants).buildViolationExpressions())"," .withExpressionModules(customAdminExpressions)",I?" .withMigrate(migrateAdmin)":null," .build()"].filter(Boolean).join("\n");return`${o("domain.ts","Assembles domain and admin domain factories from builders, migrations, expressions and invariants.")}
|
|
2
2
|
${r.toString()}
|
|
3
3
|
${v}export { attachComponent, attachAdminComponent, implementCustomExpressions, implementAdminCustomExpressions, createI18n }
|
|
4
4
|
${E}
|
|
@@ -8,6 +8,6 @@ ${A}
|
|
|
8
8
|
export const configuratorBuilder = baseConfiguratorBuilder
|
|
9
9
|
.withDomainFactory(domainFactory)
|
|
10
10
|
.withAdminDomainFactory(adminDomainFactory)
|
|
11
|
-
.withComponentOptics(componentOptics)
|
|
12
|
-
.withAdminComponentOptics(adminComponentOptics)
|
|
11
|
+
.withComponentOptics([{ origin: '.phoenix/domain-spec.ts', exports: componentOptics }])
|
|
12
|
+
.withAdminComponentOptics([{ origin: '.phoenix/domain-spec.ts', exports: adminComponentOptics }])
|
|
13
13
|
`};
|
package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js
CHANGED
|
@@ -7,7 +7,7 @@ import{renderAgentSkill as e}from"./agent-skill.js";let i=`Review all current gi
|
|
|
7
7
|
- [ ] Relations properly define parent-child ownership (1-N, 0-1)
|
|
8
8
|
- [ ] Expressions have matching implementations in src/expressions/
|
|
9
9
|
- [ ] Invariants have matching implementations in src/invariants/
|
|
10
|
-
- [ ] Actions declared under actions: have matching implementations in src/actions/ (a missing one
|
|
10
|
+
- [ ] Actions declared under actions: have matching implementations in src/actions/ (a missing one stops the application at start; it is not a type error)
|
|
11
11
|
- [ ] Component bindings use correct entity types or aliases
|
|
12
12
|
- [ ] $read/$write/$bind reference valid properties or expressions
|
|
13
13
|
- [ ] A model that has been deployed is unchanged under its version: the change is in \`model.latest\`, the deployed model is kept as \`model.v<N>\`, and \`src/migrations/v<N+1>.ts\` migrates saved configurations
|
|
@@ -65,7 +65,8 @@ Declarative 3D product configurator built with Phoenix SDK. Domain model defined
|
|
|
65
65
|
- Underscore folders (_shared/, _utils/) are NOT auto-imported`;
|
|
66
66
|
/** The default-export rule of the SDK auto-import system. */
|
|
67
67
|
readonly exportRules: `## Export Rules
|
|
68
|
-
All files in src/expressions/, src/actions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system
|
|
68
|
+
All files in src/expressions/, src/actions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/elements/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.
|
|
69
|
+
The default export must be what the folder's phx factory returns (for example \`phx.frontend.createCustomPhoenixLayoutElement()\` in src/elements/). Any other value, such as a plain React component, stops the application at start with an "Invalid default export in <file>" error. Put plain components and helpers in an underscore folder.`;
|
|
69
70
|
/** Which components and handlers are bundled into the webhook. */
|
|
70
71
|
readonly webhookMembership: `## Webhook Membership
|
|
71
72
|
- User-authored components, admin components, and handlers are frontend-only by default.
|
|
@@ -6,8 +6,7 @@ Declarative 3D product configurator built with Phoenix SDK. Domain model defined
|
|
|
6
6
|
- Expressions: entity-name.ts
|
|
7
7
|
- Migrations: v*.ts (sequential)
|
|
8
8
|
- Specs: kebab-case.yaml
|
|
9
|
-
- Underscore folders (_shared/, _utils/) are NOT auto-imported`,exportRules
|
|
10
|
-
All files in src/expressions/, src/actions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.`,webhookMembership:"## Webhook Membership\n- User-authored components, admin components, and handlers are frontend-only by default.\n- A handler that registers `createMapPublishedRevisionDataHandler`, `createMapPublishedChunkedDataHandler`, `createDataRowValidatorHandler`, or `createSheetValidatorHandler` is included in the webhook automatically.\n- To include another component or handler in the webhook, put `'use webhook'` as its first statement (leading comments are allowed).\n- A webhook-included file and its runtime local-import closure must not import browser SDK entrypoints (`application`, `admin`, `configurator`, `editor`, `react`, `ui`) or style/font/image assets. Spec parsing reports the unsafe import and inclusion reason as a diagnostic.\n- Keep browser rendering in an unpinned file. Move shared server-safe logic into a separate module when both frontend and webhook code need it.",doNotEdit:"## Do Not Edit\n- `.phoenix/` directory — completely regenerated on each build. The one exception is `.phoenix/variants/`, where the `phoenix-variants` skill has you write option files; a rebuild keeps it\n- `tsconfig.json`, `eslint.config.js`, `prettier.config.js`, `.prettierignore`, `.linguirc`, `.nvmrc`\n- `src/locales/` .ts files — compiled from .po files",modelVersioning:"## Version the Domain Model Once It Is Deployed\nA deployed model version cannot change, because saved configurations depend on it. `pnpm phoenix deploy` is refused, before anything is uploaded, when the model differs from the one already deployed under the same version. The version is not written anywhere: `model.latest` is always the highest numbered version plus one, so a spec with only `latest` is v1, and `applicationVersion` plays no part. `pnpm phoenix dev` accepts every model change, so a working preview does not show that the deploy will pass.\n\nTo change a model that has been deployed as v<N>:\n1. Keep the deployed model, unchanged, as `model.v<N>` in the spec. A file of its own, such as `spec/model-v<N>.yaml`, keeps `latest` readable.\n2. Make the change in `model.latest`, which is now v<N+1>.\n3. Add `src/migrations/v<N+1>.ts` exporting `migrateToV<N+1>`. It receives the saved entities of v<N> and returns entities that are valid in v<N+1>; `ModelV<N>` and `ModelV<N+1>` are generated global namespaces.\n\nThe admin model is versioned on its own, under `src/admin/migrations/`, with its types in `AdminV<N>`.\n\n**Replacing the starter.** When the first deployment of the workspace was the starter, its `Box` model is v1 in production. When the real model replaces it, keep the starter's model as `model.v1` and define the real model in `latest`. Configurations saved from the starter are not worth converting, so the migration returns the starting state of the new model, the `initialDomainEntities` of its preset, and drops the boxes:\n```typescript\n// src/migrations/v2.ts\nimport type { Migration } from '@salsita-ai/sdk/domain'\n\nexport const migrateToV2: Migration<ModelV1.AnyDomainEntity, ModelV2.AnyDomainEntity> = () => [\n // the entities of the new model's preset\n]\n```\nAn entity of a type the new version no longer has must not stay in the returned state. An entity id starts with its type (`Box-1`), so an entity that keeps its data under a new type name needs a new id and every relation pointing at it rewritten. Read `docs/phoenix/migrations.mdx` before writing any other migration.",sdkDocumentation:'## SDK Documentation\n\nAlways search SDK docs for relevant examples before implementing Phoenix features.\n\n### Commands\n- `pnpm phoenix docs` — Full documentation index with descriptions\n- `pnpm phoenix docs -s <term>` — Search all doc content and metadata (case-insensitive)\n- `pnpm phoenix docs --dir` — Print the absolute docs directory for grep or ripgrep\n- `pnpm phoenix docs -r <path>` — Read specific doc (raw text to stdout)\n- `pnpm phoenix docs -c <category>` — List docs in a category\n- `pnpm phoenix docs -l` — List all doc paths with titles\n\n### Key Docs\n- `docs/phoenix/getting-started.mdx` — Setup, prerequisites, first project\n- `docs/phoenix/quickstart.mdx` — End-to-end tutorial building a configurator\n- `docs/phoenix/domain-model.mdx` — Entities, attributes, relations, specs\n- `docs/phoenix/components.mdx` — ECS pattern, YAML components, custom components\n- `docs/phoenix/project-structure.mdx` — Files, folders, conventions\n- `docs/phoenix/best-practices.mdx` — YAML-first, code patterns, common pitfalls\n- `docs/phoenix/state-management.mdx` — Reactive state, RxJS pipelines, data flow\n- `docs/phoenix/expression-context.mdx` — Expression API, context object, helpers\n- `docs/phoenix/webhooks.mdx` — Server-side finalization workflows\n- `docs/phoenix/finalization.mdx` — Finalization system, PDF/email/CSV generation\n- `docs/phoenix/migrations.mdx` — Schema versioning, migration files\n\n### Agent Workflow\n1. Find relevant docs by content: `pnpm phoenix docs -s \'camera\'`\n2. Read matching doc: `pnpm phoenix docs -r docs/3d-scene/cameras/transitions.mdx`\n3. Search within a doc: `pnpm phoenix docs -r <path> | grep "example"`\n4. Search titles only as a fallback: `pnpm phoenix docs -l | grep "camera"`\n5. Search generated files directly when needed: `grep -rn "camera" "$(pnpm phoenix docs --dir)"`\n6. Browse a topic area: `pnpm phoenix docs -c "Layouts"`',assetInspection:"## 3D Asset Inspection\n\nRun `pnpm phoenix inspect:assets` to discover all glTF/GLB files in `public/` and get a summary table. Use `--file <path>` for detailed single-file inspection.\n\n**When to use:** before writing YAML/code that references objectName, materialsToOverride, morphTargetInfluences, or object positioning.\n\n**What it shows per node:**\n- Name, type (Mesh/Light/Camera/Empty), children\n- Transform: `pos=`, `rot=`, `scale=` (only non-default values shown)\n- Per-node morph targets: `morphs=Width,Height`\n- Bounding box: `bounds=WxHxD` (width x height x depth in meters)\n- Origin placement: `origin=center`, `bottom-center`, `top-center`, `bottom-corner`, etc. with numerical offset\n\n**Use cases:**\n- Find exact node names for `objectName` in scene entity components\n- Find material names for `materialsToOverride`\n- Find morph target names for `morphTargetInfluences`\n- Check model dimensions (bounds) for positioning, dimension indicators, or invariants\n- Check origin placement to understand how models anchor (center vs bottom-center)\n- Use `--json` for programmatic access to all data\n\n**Flags:** `--objects`, `--materials`, `--morphs`, `--animations`, `--json`",screenshotCli:"## Screenshot CLI\n\nCapture 3D canvas screenshots from a running dev server via `pnpm phoenix screenshot`.\n\n**Prerequisites:**\n1. `phoenix dev` must be running (starts the WebSocket server on port 3020)\n2. Configurator must be open in a browser (the browser does the actual rendering)\n\n**Options:**\n- `--output, -o` — Output file path (default: `./screenshot.png`)\n- `--width, -w` — Width in pixels (default: 1920)\n- `--height` — Height in pixels (default: 1080)\n- `--format, -f` — Image format: PNG or JPEG (default: PNG)\n- `--port` — WebSocket server port (default: 3020)\n\n**Example workflow:**\n1. Start dev server: `pnpm phoenix dev`\n2. Open configurator in browser (or via Playwright MCP)\n3. Take screenshot: `pnpm phoenix screenshot -o ./render.png -w 2560 --height 1440`\n\n**Use cases:** visual regression testing, generating product images, debugging 3D renders",inspectState:"## Inspect: State\n\nGet the current editor runtime state as JSON via `pnpm phoenix inspect:state`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` — Output file path (prints to stdout if omitted)\n- `--sections, -s` — Comma-separated: entities, navigation, validation (default: all)\n- `--pretty` — Pretty-print JSON (default: true)\n- `--port` — WebSocket server port (default: 3020)\n\n**Example:** `pnpm phoenix inspect:state -o ./state.json -s entities,navigation`\n\n**Lifecycle status:** Always included in response. Shows which systems are ready:\n- `domainLoaded` — domain data loaded\n- `domainContextReady` — domain context initialized (entities available)\n- `configuratorReady` — 3D configurator initialized\n- `sessionAuthenticated` — session service active\n- `editorMode` — editor mode enabled\n\n**Tips:** Use `--sections` to limit payload size. Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:state | head -50`).\n\n**Use cases:** AI agent context, debugging entity state, inspecting navigation/validation",inspectData:`## Inspect: Data
|
|
9
|
+
- Underscore folders (_shared/, _utils/) are NOT auto-imported`,exportRules:'## Export Rules\nAll files in src/expressions/, src/actions/, src/invariants/, src/transformers/, src/components/, src/handlers/, src/elements/, src/webhooks/ MUST use default exports. Can be a single item or an array. Named exports are ignored by the SDK auto-import system.\nThe default export must be what the folder\'s phx factory returns (for example `phx.frontend.createCustomPhoenixLayoutElement()` in src/elements/). Any other value, such as a plain React component, stops the application at start with an "Invalid default export in <file>" error. Put plain components and helpers in an underscore folder.',webhookMembership:"## Webhook Membership\n- User-authored components, admin components, and handlers are frontend-only by default.\n- A handler that registers `createMapPublishedRevisionDataHandler`, `createMapPublishedChunkedDataHandler`, `createDataRowValidatorHandler`, or `createSheetValidatorHandler` is included in the webhook automatically.\n- To include another component or handler in the webhook, put `'use webhook'` as its first statement (leading comments are allowed).\n- A webhook-included file and its runtime local-import closure must not import browser SDK entrypoints (`application`, `admin`, `configurator`, `editor`, `react`, `ui`) or style/font/image assets. Spec parsing reports the unsafe import and inclusion reason as a diagnostic.\n- Keep browser rendering in an unpinned file. Move shared server-safe logic into a separate module when both frontend and webhook code need it.",doNotEdit:"## Do Not Edit\n- `.phoenix/` directory — completely regenerated on each build. The one exception is `.phoenix/variants/`, where the `phoenix-variants` skill has you write option files; a rebuild keeps it\n- `tsconfig.json`, `eslint.config.js`, `prettier.config.js`, `.prettierignore`, `.linguirc`, `.nvmrc`\n- `src/locales/` .ts files — compiled from .po files",modelVersioning:"## Version the Domain Model Once It Is Deployed\nA deployed model version cannot change, because saved configurations depend on it. `pnpm phoenix deploy` is refused, before anything is uploaded, when the model differs from the one already deployed under the same version. The version is not written anywhere: `model.latest` is always the highest numbered version plus one, so a spec with only `latest` is v1, and `applicationVersion` plays no part. `pnpm phoenix dev` accepts every model change, so a working preview does not show that the deploy will pass.\n\nTo change a model that has been deployed as v<N>:\n1. Keep the deployed model, unchanged, as `model.v<N>` in the spec. A file of its own, such as `spec/model-v<N>.yaml`, keeps `latest` readable.\n2. Make the change in `model.latest`, which is now v<N+1>.\n3. Add `src/migrations/v<N+1>.ts` exporting `migrateToV<N+1>`. It receives the saved entities of v<N> and returns entities that are valid in v<N+1>; `ModelV<N>` and `ModelV<N+1>` are generated global namespaces.\n\nThe admin model is versioned on its own, under `src/admin/migrations/`, with its types in `AdminV<N>`.\n\n**Replacing the starter.** When the first deployment of the workspace was the starter, its `Box` model is v1 in production. When the real model replaces it, keep the starter's model as `model.v1` and define the real model in `latest`. Configurations saved from the starter are not worth converting, so the migration returns the starting state of the new model, the `initialDomainEntities` of its preset, and drops the boxes:\n```typescript\n// src/migrations/v2.ts\nimport type { Migration } from '@salsita-ai/sdk/domain'\n\nexport const migrateToV2: Migration<ModelV1.AnyDomainEntity, ModelV2.AnyDomainEntity> = () => [\n // the entities of the new model's preset\n]\n```\nAn entity of a type the new version no longer has must not stay in the returned state. An entity id starts with its type (`Box-1`), so an entity that keeps its data under a new type name needs a new id and every relation pointing at it rewritten. Read `docs/phoenix/migrations.mdx` before writing any other migration.",sdkDocumentation:'## SDK Documentation\n\nAlways search SDK docs for relevant examples before implementing Phoenix features.\n\n### Commands\n- `pnpm phoenix docs` — Full documentation index with descriptions\n- `pnpm phoenix docs -s <term>` — Search all doc content and metadata (case-insensitive)\n- `pnpm phoenix docs --dir` — Print the absolute docs directory for grep or ripgrep\n- `pnpm phoenix docs -r <path>` — Read specific doc (raw text to stdout)\n- `pnpm phoenix docs -c <category>` — List docs in a category\n- `pnpm phoenix docs -l` — List all doc paths with titles\n\n### Key Docs\n- `docs/phoenix/getting-started.mdx` — Setup, prerequisites, first project\n- `docs/phoenix/quickstart.mdx` — End-to-end tutorial building a configurator\n- `docs/phoenix/domain-model.mdx` — Entities, attributes, relations, specs\n- `docs/phoenix/components.mdx` — ECS pattern, YAML components, custom components\n- `docs/phoenix/project-structure.mdx` — Files, folders, conventions\n- `docs/phoenix/best-practices.mdx` — YAML-first, code patterns, common pitfalls\n- `docs/phoenix/state-management.mdx` — Reactive state, RxJS pipelines, data flow\n- `docs/phoenix/expression-context.mdx` — Expression API, context object, helpers\n- `docs/phoenix/webhooks.mdx` — Server-side finalization workflows\n- `docs/phoenix/finalization.mdx` — Finalization system, PDF/email/CSV generation\n- `docs/phoenix/migrations.mdx` — Schema versioning, migration files\n\n### Agent Workflow\n1. Find relevant docs by content: `pnpm phoenix docs -s \'camera\'`\n2. Read matching doc: `pnpm phoenix docs -r docs/3d-scene/cameras/transitions.mdx`\n3. Search within a doc: `pnpm phoenix docs -r <path> | grep "example"`\n4. Search titles only as a fallback: `pnpm phoenix docs -l | grep "camera"`\n5. Search generated files directly when needed: `grep -rn "camera" "$(pnpm phoenix docs --dir)"`\n6. Browse a topic area: `pnpm phoenix docs -c "Layouts"`',assetInspection:"## 3D Asset Inspection\n\nRun `pnpm phoenix inspect:assets` to discover all glTF/GLB files in `public/` and get a summary table. Use `--file <path>` for detailed single-file inspection.\n\n**When to use:** before writing YAML/code that references objectName, materialsToOverride, morphTargetInfluences, or object positioning.\n\n**What it shows per node:**\n- Name, type (Mesh/Light/Camera/Empty), children\n- Transform: `pos=`, `rot=`, `scale=` (only non-default values shown)\n- Per-node morph targets: `morphs=Width,Height`\n- Bounding box: `bounds=WxHxD` (width x height x depth in meters)\n- Origin placement: `origin=center`, `bottom-center`, `top-center`, `bottom-corner`, etc. with numerical offset\n\n**Use cases:**\n- Find exact node names for `objectName` in scene entity components\n- Find material names for `materialsToOverride`\n- Find morph target names for `morphTargetInfluences`\n- Check model dimensions (bounds) for positioning, dimension indicators, or invariants\n- Check origin placement to understand how models anchor (center vs bottom-center)\n- Use `--json` for programmatic access to all data\n\n**Flags:** `--objects`, `--materials`, `--morphs`, `--animations`, `--json`",screenshotCli:"## Screenshot CLI\n\nCapture 3D canvas screenshots from a running dev server via `pnpm phoenix screenshot`.\n\n**Prerequisites:**\n1. `phoenix dev` must be running (starts the WebSocket server on port 3020)\n2. Configurator must be open in a browser (the browser does the actual rendering)\n\n**Options:**\n- `--output, -o` — Output file path (default: `./screenshot.png`)\n- `--width, -w` — Width in pixels (default: 1920)\n- `--height` — Height in pixels (default: 1080)\n- `--format, -f` — Image format: PNG or JPEG (default: PNG)\n- `--port` — WebSocket server port (default: 3020)\n\n**Example workflow:**\n1. Start dev server: `pnpm phoenix dev`\n2. Open configurator in browser (or via Playwright MCP)\n3. Take screenshot: `pnpm phoenix screenshot -o ./render.png -w 2560 --height 1440`\n\n**Use cases:** visual regression testing, generating product images, debugging 3D renders",inspectState:"## Inspect: State\n\nGet the current editor runtime state as JSON via `pnpm phoenix inspect:state`.\n\n**Prerequisites:** same as screenshot (dev server running + browser open)\n\n**Options:**\n- `--output, -o` — Output file path (prints to stdout if omitted)\n- `--sections, -s` — Comma-separated: entities, navigation, validation (default: all)\n- `--pretty` — Pretty-print JSON (default: true)\n- `--port` — WebSocket server port (default: 3020)\n\n**Example:** `pnpm phoenix inspect:state -o ./state.json -s entities,navigation`\n\n**Lifecycle status:** Always included in response. Shows which systems are ready:\n- `domainLoaded` — domain data loaded\n- `domainContextReady` — domain context initialized (entities available)\n- `configuratorReady` — 3D configurator initialized\n- `sessionAuthenticated` — session service active\n- `editorMode` — editor mode enabled\n\n**Tips:** Use `--sections` to limit payload size. Pipe through `head`/`tail` for partial output (e.g., `pnpm phoenix inspect:state | head -50`).\n\n**Use cases:** AI agent context, debugging entity state, inspecting navigation/validation",inspectData:`## Inspect: Data
|
|
11
10
|
|
|
12
11
|
Get the current editor context data as JSON via \`pnpm phoenix inspect:data\`.
|
|
13
12
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
let e=e=>`webhookHandlers${e}`;export const generateApplicationSpecWebhookBuilders=(o
|
|
1
|
+
let e=e=>`webhookHandlers${e}`;export const generateApplicationSpecWebhookBuilders=(t,o)=>{let i=t.appMetadata.useClerk?` clerk: {
|
|
2
2
|
apiKey: phx.webhooksEnv.CLERK_API_KEY,
|
|
3
3
|
authorizedParties: [phx.webhooksEnv.FRONTEND_URL, phx.webhooksEnv.RESOURCES_URL],
|
|
4
4
|
jwtSecret: phx.webhooksEnv.JWT_SECRET_BASE64,
|
|
5
5
|
oauthClientId: phx.webhooksEnv.OAUTH_PROVIDER_CLIENT_ID,
|
|
6
6
|
oauthClientSecret: phx.webhooksEnv.OAUTH_PROVIDER_CLIENT_SECRET,
|
|
7
7
|
oauthProviderBaseUrl: phx.webhooksEnv.OAUTH_PROVIDER_BASE_URL,
|
|
8
|
-
},`:"",r=
|
|
9
|
-
.withHandlers(${
|
|
8
|
+
},`:"",r=o.map((t,o)=>{let i=e(o),r=t.replace(/\.tsx?$/,".js");return`import ${i} from '../${r}'`}).join("\n"),n=o.length>0,s=o.map((t,o)=>`{ origin: '${t}', exports: ${e(o)} }`),a=`[${s.join(", ")}]`,l=n?`
|
|
9
|
+
.withHandlers(${a})`:"";return`// Auto-generated by application-spec pipeline. Do not edit.
|
|
10
10
|
import { createDomainWebhook } from '@salsita-ai/sdk/webhook'
|
|
11
|
+
import type { DeploymentAssistant } from '@salsita-ai/sdk/contracts/assistant'
|
|
11
12
|
|
|
12
13
|
import { configuratorBuilder, createI18n } from './domain.js'
|
|
13
14
|
import { customComponentOptics } from './configurator-domain-code.js'
|
|
@@ -15,12 +16,14 @@ import { customAdminComponentOptics } from './admin-domain-code.js'
|
|
|
15
16
|
${r?`
|
|
16
17
|
${r}
|
|
17
18
|
`:""}
|
|
19
|
+
const $assistantServerSettings: Pick<DeploymentAssistant, 'instructions' | 'ai'> | null = ${JSON.stringify(t.configurator.assistantServerSettings?{instructions:t.configurator.assistantServerSettings.instructions??void 0,ai:t.configurator.assistantServerSettings.ai}:null)}
|
|
20
|
+
|
|
18
21
|
const webhookConfiguratorBuilder = configuratorBuilder
|
|
19
22
|
.withComponentOptics(customComponentOptics)
|
|
20
23
|
.withAdminComponentOptics(customAdminComponentOptics)
|
|
21
24
|
.withDefaultEnvs({
|
|
22
25
|
isDev: phx.webhooksEnv.IS_DEV,
|
|
23
|
-
})${
|
|
26
|
+
})${l}
|
|
24
27
|
|
|
25
28
|
export const {
|
|
26
29
|
authHandlerBuilder,
|
|
@@ -33,6 +36,7 @@ export const {
|
|
|
33
36
|
} = createDomainWebhook({
|
|
34
37
|
configuratorBuilder: webhookConfiguratorBuilder,
|
|
35
38
|
createI18n,
|
|
39
|
+
assistantServerSettings: $assistantServerSettings,
|
|
36
40
|
${i}
|
|
37
41
|
})
|
|
38
42
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Branded } from '@salsita-ai/common/utils';
|
|
2
|
+
import type { AssistantResolvedManifest } from '#package/domain';
|
|
2
3
|
import type { RuntimeReferenceStore } from '../../../caching/index.js';
|
|
3
|
-
import type { ApplicationSpec
|
|
4
|
-
/**
|
|
4
|
+
import type { ApplicationSpec } from '../../../parse-application-files/index.js';
|
|
5
|
+
/** Resolved assistant manifest with change tracking, carried to the runtime spec on hot reload. */
|
|
5
6
|
export type AssistantRuntime = Branded<'AssistantRuntime', {
|
|
6
|
-
readonly assistant:
|
|
7
|
+
readonly assistant: AssistantResolvedManifest | null;
|
|
7
8
|
readonly changed: boolean;
|
|
8
9
|
}>;
|
|
9
10
|
export declare const AssistantRuntime: (spec: ApplicationSpec, referenceStore: RuntimeReferenceStore) => AssistantRuntime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import s from"lodash-es/isEqual.js";import{Branded as t}from"@salsita-ai/common/utils";export const AssistantRuntime=(a,i)=>{let
|
|
1
|
+
import s from"lodash-es/isEqual.js";import{Branded as t}from"@salsita-ai/common/utils";export const AssistantRuntime=(a,i)=>{let e=i.createBuilder("assistant",{build:s=>s,getKey:()=>"assistant",compare:(t,a)=>s(t,a)}).build({assistant:a.configurator.assistant?.resolved??null});return t({assistant:e.output.assistant,changed:e.changed})};
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { AssistantValueType } from '#package/domain';
|
|
2
2
|
import { type EnhancedJsonSchemaType } from '../../../../core/index.js';
|
|
3
3
|
import { type SchemaRefResolver } from '../../common/index.js';
|
|
4
|
-
/**
|
|
5
|
-
* Opaque scalar for values the assistant schema does not type: objects, custom TypeScript types and
|
|
6
|
-
* loose unions. A value is plain serializable data and passes through unchanged.
|
|
7
|
-
*/
|
|
8
|
-
export declare const GraphQLJSON: GraphQLScalarType<unknown, unknown>;
|
|
9
4
|
/**
|
|
10
5
|
* The GraphQL type of one whitelisted stored field or declared expression. `enumValues` lists the
|
|
11
6
|
* allowed values of a string enum, which the schema exposes as `String` and names in the field
|
|
12
7
|
* description.
|
|
13
8
|
*/
|
|
14
9
|
export interface AssistantFieldType {
|
|
15
|
-
readonly type:
|
|
10
|
+
readonly type: AssistantValueType;
|
|
16
11
|
readonly enumValues?: readonly string[];
|
|
17
12
|
/**
|
|
18
13
|
* The schema's own description, or without one that of the common type it references, directly or
|
|
@@ -30,4 +25,4 @@ export interface AssistantFieldType {
|
|
|
30
25
|
* `String` with their values, primitives → scalars, arrays of mappable items → lists, and everything
|
|
31
26
|
* else → `JSON`. Every type, `JSON` included, is non-null unless the schema admits `null`.
|
|
32
27
|
*/
|
|
33
|
-
export declare const
|
|
28
|
+
export declare const resolveAssistantFieldType: (schema: EnhancedJsonSchemaType, resolveRef: SchemaRefResolver) => AssistantFieldType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isArray as e}from"@salsita-ai/common/utils";import{extractPhxDefName as n}from"../../../../core/index.js";import{commonTypeRefName as t,isNullableSchema as l,phxDefinitionRefName as r}from"../../common/index.js";let i={number:{kind:"scalar",name:"Float",nonNull:!1},integer:{kind:"scalar",name:"Int",nonNull:!1},string:{kind:"scalar",name:"String",nonNull:!1},boolean:{kind:"scalar",name:"Boolean",nonNull:!1}},a={kind:"scalar",name:"String",nonNull:!1},o={kind:"scalar",name:"ID",nonNull:!1},u=new Set(["Localizable","EnhancedLocalizable","MessageDescriptor","EnhancedMessageDescriptor","MultilingualString"]),s={type:{kind:"scalar",name:"JSON",nonNull:!1}},d=({anyOf:e,oneOf:n})=>[...e??[],...n??[]].filter(e=>"null"!==e.type),f=e=>"scalar"===e.kind?"JSON"===e.name:f(e.item),p=(l,y,c)=>{let v;if(void 0!==(v=void 0===l.$ref?void 0:r(l.$ref))&&u.has(v))return{type:a,localized:!0};if(l.tsType)return s;if(l.$ref){var g=l.$ref;if("DomainEntityId"===n(g))return{type:o};let e=t(g),r=void 0===e||c.has(e)?void 0:y(g);return void 0!==e&&r?p(r,y,new Set([...c,e])):s}if(l.anyOf||l.oneOf)return((e,n,t)=>{let l=d(e).map(e=>p(e,n,t)),[r]=l;if(1===l.length&&r)return r;let i=l.flatMap(({type:e,enumValues:n})=>e===a&&n?[n]:[]);if(l.length<2||i.length!==l.length||e.anyOf&&e.oneOf)return s;let o=i.flatMap(e=>[...new Set(e)]);return{type:a,enumValues:e.oneOf?o.filter(e=>o.indexOf(e)===o.lastIndexOf(e)):[...new Set(o)]}})(l,y,c);if(l.enum){let e;return(e=l.enum.filter(e=>null!==e)).every(e=>"string"==typeof e)?{type:a,enumValues:e}:s}if(e(l.type)){let e=l.type.filter(e=>"null"!==e),[n]=e;return 1===e.length&&n?p({...l,type:n},y,c):s}if("array"===l.type){var S=l.items;if(!S||e(S))return s;let n=m(S,y,c);return f(n.type)?s:{type:{kind:"list",item:n.type,nonNull:!1},enumValues:n.enumValues,localized:n.localized}}let h="string"==typeof l.type?i[l.type]:void 0;return h?{type:h}:s},m=(e,n,t)=>{let r=p(e,n,t);return{...r,type:{...r.type,nonNull:!l(e,n)}}},y=e=>{let n=d(e);return e.$ref??(1===n.length?n[0]?.$ref:void 0)},c=(e,n,l)=>{let r=t(e),i=void 0===r||l.has(r)?void 0:n(e);if(void 0===r||!i)return;let a=y(i);return void 0===i.description&&a?c(a,n,new Set([...l,r])):i.description};export const resolveAssistantFieldType=(e,n)=>{let t=y(e),l=void 0===e.description&&t?c(t,n,new Set):e.description;return{...m(e,n,new Set),...void 0===l?{}:{description:l}}};
|
package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type AssistantFieldSource, type AssistantManifest, type AssistantRecipeGroup, type AssistantResolvedManifest, type AssistantStates } from '#package/domain';
|
|
2
2
|
import type { ParseContext, PhoenixDefinitions } from '../../../../core/index.js';
|
|
3
3
|
import { type RawAssistant } from '../../../raw-spec/index.js';
|
|
4
4
|
import type { Components } from '../../components/index.js';
|
|
5
5
|
import type { Expressions } from '../../expressions/index.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { ModelVersion } from '../../model/index.js';
|
|
7
7
|
import type { Actions } from '../actions.js';
|
|
8
8
|
/**
|
|
9
9
|
* The field sources of every entity object type: GraphQL object type name → GraphQL field name →
|
|
@@ -11,28 +11,11 @@ import type { Actions } from '../actions.js';
|
|
|
11
11
|
* a concrete type; `id` and `type` are implicit and never listed.
|
|
12
12
|
*/
|
|
13
13
|
export type AssistantFieldSources = Readonly<Record<string, Readonly<Record<string, AssistantFieldSource>>>>;
|
|
14
|
-
/**
|
|
15
|
-
* The stored property each delta field of a `modify<Type>` mutation writes: entity type → delta
|
|
16
|
-
* field name → shape property. Only entity types with at least one writable field appear, aliases
|
|
17
|
-
* expanded to their members.
|
|
18
|
-
*/
|
|
19
|
-
export type AssistantWritableFields = Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
20
14
|
/**
|
|
21
15
|
* The recipe groups of one kind per entity type, in manifest
|
|
22
16
|
* order. Only entity types with at least one group appear, aliases expanded to their members.
|
|
23
17
|
*/
|
|
24
18
|
export type AssistantRecipeGroups = Readonly<Record<string, readonly AssistantRecipeGroup[]>>;
|
|
25
|
-
/**
|
|
26
|
-
* The options edges `meta` exposes per entity type, which are also the choices `modify<Type>` checks
|
|
27
|
-
* a written value against, in manifest order. Only entity types with at least one edge appear,
|
|
28
|
-
* aliases expanded to their members.
|
|
29
|
-
*/
|
|
30
|
-
export type AssistantFieldOptionsByType = Readonly<Record<string, readonly AssistantFieldOptions[]>>;
|
|
31
|
-
/**
|
|
32
|
-
* The custom mutations the manifest exposes: `Mutation` field name → the declared action it runs,
|
|
33
|
-
* in manifest order. Empty when the manifest exposes no action.
|
|
34
|
-
*/
|
|
35
|
-
export type AssistantActions = Readonly<Record<string, string>>;
|
|
36
19
|
/**
|
|
37
20
|
* The printed assistant GraphQL schema, the field sources its runtime resolvers read through, the
|
|
38
21
|
* entity types `deleteEntity` may delete, the fields the `modify<Type>` mutations may write, the
|
|
@@ -40,16 +23,9 @@ export type AssistantActions = Readonly<Record<string, string>>;
|
|
|
40
23
|
* of writable fields, aliases expanded, and the actions the custom mutations run,
|
|
41
24
|
* so the runtime checks the same sets the schema describes.
|
|
42
25
|
*/
|
|
43
|
-
export
|
|
44
|
-
readonly
|
|
45
|
-
|
|
46
|
-
readonly deletableTypes: readonly EntityTypeName[];
|
|
47
|
-
readonly writableFields: AssistantWritableFields;
|
|
48
|
-
readonly childRecipes: AssistantRecipeGroups;
|
|
49
|
-
readonly replaceRecipes: AssistantRecipeGroups;
|
|
50
|
-
readonly fieldOptions: AssistantFieldOptionsByType;
|
|
51
|
-
readonly actions: AssistantActions;
|
|
52
|
-
}
|
|
26
|
+
export type AssistantSchema = Required<AssistantManifest> & {
|
|
27
|
+
readonly resolved: AssistantResolvedManifest;
|
|
28
|
+
};
|
|
53
29
|
/** What the assistant schema is built from, besides the manifest. */
|
|
54
30
|
export interface AssistantSchemaInput {
|
|
55
31
|
readonly model: ModelVersion;
|
|
@@ -63,17 +39,7 @@ export interface AssistantSchemaInput {
|
|
|
63
39
|
/** The declared actions, which `actions` manifest entries expose as custom mutations. */
|
|
64
40
|
readonly actions: Actions;
|
|
65
41
|
}
|
|
66
|
-
/**
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
readonly toolStates: readonly string[];
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Builds the assistant GraphQL schema from the manifest whitelist, the latest model and the
|
|
74
|
-
* configurator states: aliases become interfaces implementing `AnyDomainEntity`, entity types become
|
|
75
|
-
* object types implementing every alias that contains them, and `Query` exposes the root, entities,
|
|
76
|
-
* selection and navigation entry points. Returns `undefined` after reporting diagnostics when the
|
|
77
|
-
* manifest does not fit the model or the generated schema is not valid GraphQL.
|
|
78
|
-
*/
|
|
79
|
-
export declare const createAssistantSchema: (manifest: RawAssistant, { model, states, phxDefinitions, expressions, components, actions }: AssistantSchemaInput, ctx: ParseContext) => AssistantSchema | undefined;
|
|
42
|
+
/** Resolves the whitelist against parse-time models, keeping only JSON data needed to build its schema. */
|
|
43
|
+
export declare const resolveAssistantManifest: (manifest: RawAssistant, { model, states, phxDefinitions, expressions, components, actions }: AssistantSchemaInput, ctx: ParseContext) => AssistantResolvedManifest | undefined;
|
|
44
|
+
/** Builds at parse time as well, translating GraphQL construction failures into the existing diagnostic. */
|
|
45
|
+
export declare const createAssistantSchema: (manifest: RawAssistant, input: AssistantSchemaInput, ctx: ParseContext) => AssistantSchema | undefined;
|