@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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where one exposed assistant GraphQL field reads its value on the `$` entity: a stored field name,
|
|
3
|
+
* or an expression name including its `$`. `localized` marks a localizable value that resolves to a
|
|
4
|
+
* string in the current locale.
|
|
5
|
+
*/
|
|
6
|
+
export interface AssistantFieldSource {
|
|
7
|
+
readonly source: string;
|
|
8
|
+
readonly localized?: true;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* One recipe group the assistant manifest exposes on an entity type: a `childEntityRecipes` instance
|
|
12
|
+
* under `childRecipes`, a `replaceEntityRecipes` instance under `replaceRecipes`. `groupId` is the
|
|
13
|
+
* name the agent addresses the group by, `instanceName` the component instance it reads,
|
|
14
|
+
* `description` the manifest's text replacing the component's group description, and `dryRuns`
|
|
15
|
+
* whether the recipes of the group can be dry-run.
|
|
16
|
+
*/
|
|
17
|
+
export interface AssistantRecipeGroup {
|
|
18
|
+
readonly groupId: string;
|
|
19
|
+
readonly instanceName: string;
|
|
20
|
+
readonly description?: string;
|
|
21
|
+
readonly dryRuns: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The options edge of one writable field the assistant manifest links to its component. `field` is
|
|
25
|
+
* the delta field of `modify<Type>` the choices are for, `edgeName` the field of `<Type>Meta` that
|
|
26
|
+
* lists them, `componentType` and `instanceName` the component instance they are read from, and
|
|
27
|
+
* `validate` whether `modify<Type>` rejects a value that is not among them, and `dryRuns` whether
|
|
28
|
+
* the choices can be dry-run.
|
|
29
|
+
*/
|
|
30
|
+
export interface AssistantFieldOptions {
|
|
31
|
+
readonly field: string;
|
|
32
|
+
readonly edgeName: string;
|
|
33
|
+
readonly componentType: 'materialSwatch' | 'attributeSelection' | 'distanceDimensionSelect';
|
|
34
|
+
readonly instanceName: string;
|
|
35
|
+
readonly validate: boolean;
|
|
36
|
+
readonly dryRuns: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Experimental assistant manifest generated from the application spec `assistant` section. `sdl` is
|
|
40
|
+
* the GraphQL schema text rebuilt from the resolved manifest; `fields` maps each GraphQL object type's exposed
|
|
41
|
+
* fields (type name → GraphQL field name) to the stored field or expression its resolvers read;
|
|
42
|
+
* `deletableTypes` lists the entity types the `deleteEntity` mutation may delete, with aliases
|
|
43
|
+
* already expanded, and absent means none; `writableFields` maps, per entity type with a
|
|
44
|
+
* `modify<Type>` mutation, each field of its delta input to the stored property it writes, and
|
|
45
|
+
* absent means no entity type is writable; `childRecipes` lists, per entity type with a `meta` field,
|
|
46
|
+
* the recipe groups `meta { childRecipes }` and `addChild` expose, in manifest order, and absent
|
|
47
|
+
* means none; `replaceRecipes` lists the same for `meta { replaceRecipes }` and `replaceEntity`;
|
|
48
|
+
* `fieldOptions` lists, per entity type, the options edges `meta` exposes for its
|
|
49
|
+
* writable fields, and absent means none; `actions` maps each custom `Mutation` field to the
|
|
50
|
+
* declared action it runs, and absent means none. Consumed by the configurator GraphQL system.
|
|
51
|
+
*/
|
|
52
|
+
export interface AssistantManifest {
|
|
53
|
+
readonly sdl: string;
|
|
54
|
+
readonly fields: Readonly<Record<string, Readonly<Record<string, AssistantFieldSource>>>>;
|
|
55
|
+
readonly deletableTypes?: readonly string[];
|
|
56
|
+
readonly writableFields?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
57
|
+
readonly childRecipes?: Readonly<Record<string, readonly AssistantRecipeGroup[]>>;
|
|
58
|
+
readonly replaceRecipes?: Readonly<Record<string, readonly AssistantRecipeGroup[]>>;
|
|
59
|
+
readonly fieldOptions?: Readonly<Record<string, readonly AssistantFieldOptions[]>>;
|
|
60
|
+
readonly actions?: Readonly<Record<string, string>>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { AssistantFieldOptions, AssistantRecipeGroup } from './assistant-manifest.js';
|
|
2
|
+
/** JSON description of a scalar or recursively nested list, including nullability at each level. */
|
|
3
|
+
export type AssistantValueType = {
|
|
4
|
+
readonly kind: 'scalar';
|
|
5
|
+
readonly name: 'Int' | 'Float' | 'String' | 'Boolean' | 'ID' | 'JSON';
|
|
6
|
+
readonly nonNull: boolean;
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: 'list';
|
|
9
|
+
readonly item: AssistantValueType;
|
|
10
|
+
readonly nonNull: boolean;
|
|
11
|
+
};
|
|
12
|
+
/** A relation edge resolved against the model at parse time, linked to GraphQL types only during building. */
|
|
13
|
+
export interface AssistantRelationType {
|
|
14
|
+
readonly kind: 'edge';
|
|
15
|
+
readonly target: string;
|
|
16
|
+
readonly cardinality: '1-1' | '0-1' | '0-N' | '1-N';
|
|
17
|
+
}
|
|
18
|
+
/** A field's source and resolved type, carried in the application bundle without GraphQL instances. */
|
|
19
|
+
export interface AssistantResolvedField {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly source: string;
|
|
22
|
+
readonly type: {
|
|
23
|
+
readonly kind: 'value';
|
|
24
|
+
readonly type: AssistantValueType;
|
|
25
|
+
} | AssistantRelationType;
|
|
26
|
+
readonly localized: boolean;
|
|
27
|
+
readonly description?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Declared UI state values used to describe the navigation query. */
|
|
30
|
+
export interface AssistantStates {
|
|
31
|
+
readonly navigationStates: readonly string[];
|
|
32
|
+
readonly viewStates: readonly string[];
|
|
33
|
+
readonly toolStates: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
/** Serializable resolved whitelist from which the browser or backend constructs the assistant schema. */
|
|
36
|
+
export interface AssistantResolvedManifest {
|
|
37
|
+
readonly entityTypes: readonly string[];
|
|
38
|
+
readonly aliases: Readonly<Record<string, readonly string[]>>;
|
|
39
|
+
readonly exampleType?: string;
|
|
40
|
+
readonly fields: Readonly<Record<string, readonly AssistantResolvedField[]>>;
|
|
41
|
+
readonly states: AssistantStates;
|
|
42
|
+
readonly deletableTypes: readonly string[];
|
|
43
|
+
readonly writableTypes: readonly AssistantWritableType[];
|
|
44
|
+
readonly childRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
|
|
45
|
+
readonly replaceRecipes: Readonly<Record<string, AssistantResolvedRecipes>>;
|
|
46
|
+
readonly optionsEdges: Readonly<Record<string, readonly AssistantResolvedOptionsEdge[]>>;
|
|
47
|
+
readonly actionFields: readonly AssistantResolvedAction[];
|
|
48
|
+
}
|
|
49
|
+
/** Optional mutation input for one stored field, using its exposed name. */
|
|
50
|
+
export interface AssistantWritableField {
|
|
51
|
+
readonly name: string;
|
|
52
|
+
readonly property: string;
|
|
53
|
+
readonly type: AssistantValueType;
|
|
54
|
+
readonly description?: string;
|
|
55
|
+
}
|
|
56
|
+
/** One entity type's writable fields, in manifest order. */
|
|
57
|
+
export interface AssistantWritableType {
|
|
58
|
+
readonly entityType: string;
|
|
59
|
+
readonly fields: readonly AssistantWritableField[];
|
|
60
|
+
}
|
|
61
|
+
/** Description hints resolved from recipe/option entries; no parse context is retained. */
|
|
62
|
+
export type AssistantResolvedHint = 'sameForAllInstances' | 'constantDuringSession';
|
|
63
|
+
/** Recipe groups and their description hints for one entity type. */
|
|
64
|
+
export interface AssistantResolvedRecipes {
|
|
65
|
+
readonly groups: readonly AssistantRecipeGroup[];
|
|
66
|
+
readonly hints: readonly AssistantResolvedHint[];
|
|
67
|
+
}
|
|
68
|
+
/** One options edge, carrying the write-validation contract and schema description hints. */
|
|
69
|
+
export interface AssistantResolvedOptionsEdge {
|
|
70
|
+
readonly options: AssistantFieldOptions;
|
|
71
|
+
readonly hints: readonly AssistantResolvedHint[];
|
|
72
|
+
}
|
|
73
|
+
/** An action result field, either an entity edge or a plain JSON-described value. */
|
|
74
|
+
export type AssistantResolvedActionResult = {
|
|
75
|
+
readonly kind: 'edge';
|
|
76
|
+
readonly target: string;
|
|
77
|
+
readonly list: boolean;
|
|
78
|
+
readonly nullable: boolean;
|
|
79
|
+
readonly description?: string;
|
|
80
|
+
} | {
|
|
81
|
+
readonly kind: 'value';
|
|
82
|
+
readonly type: AssistantValueType;
|
|
83
|
+
readonly description?: string;
|
|
84
|
+
};
|
|
85
|
+
/** A custom mutation resolved against the declared action, independent of its implementation. */
|
|
86
|
+
export interface AssistantResolvedAction {
|
|
87
|
+
readonly fieldName: string;
|
|
88
|
+
readonly actionName: string;
|
|
89
|
+
readonly description?: string;
|
|
90
|
+
readonly args: Readonly<Record<string, {
|
|
91
|
+
readonly type: AssistantValueType;
|
|
92
|
+
readonly description?: string;
|
|
93
|
+
}>>;
|
|
94
|
+
readonly result: Readonly<Record<string, AssistantResolvedActionResult>>;
|
|
95
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type GraphQLInputType, type GraphQLOutputType, GraphQLScalarType } from 'graphql';
|
|
2
|
+
import type { AssistantValueType } from './assistant-resolved-manifest.js';
|
|
3
|
+
/**
|
|
4
|
+
* Opaque scalar for values the assistant schema does not type: objects, custom TypeScript types and
|
|
5
|
+
* loose unions. A value is plain serializable data and passes through unchanged.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GraphQLJSON: GraphQLScalarType<unknown, unknown>;
|
|
8
|
+
/** Recreates a GraphQL value type from the JSON descriptor, preserving every list and nullability layer. */
|
|
9
|
+
export declare const createAssistantValueType: (descriptor: AssistantValueType) => GraphQLInputType & GraphQLOutputType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{GraphQLBoolean as e,GraphQLFloat as t,GraphQLID as a,GraphQLInt as n,GraphQLList as r,GraphQLNonNull as l,GraphQLScalarType as s,GraphQLString as i}from"graphql";export const GraphQLJSON=new s({name:"JSON",description:"Any JSON value, returned as stored. Always plain serializable data."});let o={Int:n,Float:t,String:i,Boolean:e,ID:a,JSON:GraphQLJSON};export const createAssistantValueType=e=>{let t="list"===e.kind?new r(createAssistantValueType(e.item)):o[e.name];return e.nonNull?new l(t):t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AssistantManifest } from './assistant-manifest.js';
|
|
2
|
+
import type { AssistantResolvedManifest } from './assistant-resolved-manifest.js';
|
|
3
|
+
/** Constructs the schema and runtime sources exclusively from serializable resolved data. */
|
|
4
|
+
export declare const buildAssistantManifest: (resolved: AssistantResolvedManifest) => Required<AssistantManifest>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{GraphQLBoolean as e,GraphQLID as t,GraphQLInputObjectType as n,GraphQLInterfaceType as i,GraphQLList as o,GraphQLNonNull as r,GraphQLObjectType as s,GraphQLSchema as a,GraphQLString as p,printSchema as d,validateSchema as h}from"graphql";import{GraphQLJSON as c,createAssistantValueType as l}from"./assistant-value-type.js";let y="AnyDomainEntity",u="RootEntity",f={section:"childRecipes",mutation:"addChild"},g={section:"replaceRecipes",mutation:"replaceEntity"},w=(e,t)=>Object.entries(e).find(([e])=>e===t)?.[1],m=(e,t)=>{if(!t||0===t.length)return e;let n=`One of: ${t.map(e=>`"${e}"`).join(", ")}.`;return e?/[.!?]$/.test(e)?`${e} ${n}`:`${e}. ${n}`:n},b=({target:e,cardinality:t},n)=>{let i=n(e);switch(t){case"1-1":return new r(i);case"0-1":return i;case"0-N":case"1-N":return new r(new o(new r(i)))}},v=(e,n,i)=>{let o={id:{type:new r(t),description:i?`Unique id of the entity, e.g. "${i}-1".`:void 0},type:{type:new r(p),description:i?`Entity type name, e.g. "${i}".`:void 0}};for(let t of e)o[t.name]={type:"edge"===t.type.kind?b(t.type,n):l(t.type.type),description:t.description};return o},$=e=>Object.fromEntries(e.map(({name:e,source:t,localized:n})=>[e,n?{source:t,localized:!0}:{source:t}])),j={sameForAllInstances:e=>`All ${e} instances have the same recipe groups and recipes.`,constantDuringSession:()=>"They do not change during the session."},O={sameForAllInstances:e=>`All ${e} instances have the same options.`,constantDuringSession:()=>"The options do not change during the session."},E=(e,t,n)=>e.map(e=>` ${t[e](n)}`).join(""),R=({section:e},{groups:t,hints:n},{entityType:i,purpose:s,recipeGroup:a})=>{let p=t.filter(({dryRuns:e})=>!e).map(({groupId:e})=>e);return 0===t.length?{}:{[e]:{type:new r(new o(new r(a))),description:`The recipe groups for ${s} this ${i}: ${t.map(({groupId:e})=>e).join(", ")}. A group is listed only while the configurator offers it on the entity.${p.length>0?` Recipes of these groups cannot be dry-run: ${p.join(", ")}.`:""}${E(n,j,i)}`}}},k=({entityType:e,childRecipes:t,replaceRecipes:n,optionsEdges:i},{recipeGroup:a,fieldOption:p})=>new s({name:`${e}Meta`,fields:Object.assign(R(f,t,{entityType:e,purpose:"adding children to",recipeGroup:a}),R(g,n,{entityType:e,purpose:"replacing",recipeGroup:a}),...i.map(({options:{edgeName:t,field:n,validate:i,dryRuns:s},hints:a})=>({[t]:{type:new o(new r(p)),description:`The values "${n}" of this ${e} can take, as the configurator offers them in the current state of the entity. Null when the configurator does not offer a choice on this entity. ${i?`modify${e} rejects a "${n}" value that is not in the list.`:`modify${e} does not check "${n}" against the list.`}${s?"":" Its options cannot be dry-run."}${E(a,O,e)}`}})))}),I=e=>Object.entries(e).map(([e,t])=>`${e} (${t.map(({groupId:e})=>e).join(", ")})`);export const buildAssistantManifest=b=>{var j,O,E,R,T;let A,N,D,M,{entityTypes:S,aliases:q,exampleType:W,fields:C,states:G,deletableTypes:K,writableTypes:U,actionFields:F,optionsEdges:x}=b,z=Object.fromEntries(Object.entries(b.childRecipes).map(([e,t])=>[e,t.groups])),Q=Object.fromEntries(Object.entries(b.replaceRecipes).map(([e,t])=>[e,t.groups])),B=new Map,H=new Map,J=new Map,L=e=>{let[t,...n]=Object.entries(q).find(([t])=>t===e)?.[1]??[];return(t&&0===n.length?H.get(t):void 0)??J.get(e)??V},P=e=>H.get(e)??L(e),V=new i({name:y,description:"Every domain entity.",fields:()=>v(C[y]??[],P,W)});for(let e of(J.set(y,V),Object.keys(q)))e!==y&&J.set(e,new i({name:e,interfaces:[V],fields:()=>v(C[e]??[],P)}));let X={};for(let e of S){let t=[y,...Object.entries(q).filter(([t,n])=>t!==y&&n.includes(e)).map(([e])=>e)],n=C[e]??[];X[e]=$(n),H.set(e,new s({name:e,interfaces:t.flatMap(e=>J.get(e)??[]),fields:()=>{let t=B.get(e);return{...v(n,P),...t?{meta:{type:new r(t),description:"What the configurator offers on this entity besides its fields."}}:{}}}}))}let Y=(j=()=>L(J.has(u)?u:y),O=()=>L(y),A=new s({name:"DryRunError",description:"One reason a change cannot be made right now.",fields:{type:{type:new r(p),description:'Kind of the problem, or "uncaught".'},entityId:{type:t,description:"The entity the problem is on, when it is on one."},message:{type:p,description:"The problem as the configurator words it for the user."}}}),new s({name:"DryRun",description:"What using a recipe or writing an option would do, tried out on the configuration the query reads. Nothing is changed.",fields:()=>({ok:{type:new r(e),description:"Whether the change would succeed on the configuration the query reads."},root:{type:j(),description:"The root entity of the configuration as it would be after the change; null when ok is false. Everything selected under it reads that configuration."},changedEntities:{type:new r(new o(new r(O()))),description:"Every entity the change would add or modify, read from that configuration; empty when ok is false. An entity whose id the configuration does not have yet would be added, and its id may differ in the real mutation. An entity that is written to is listed even when it gets the values it already has."},deletedEntityIds:{type:new r(new o(new r(t))),description:"The ids of the entities the change would remove; empty when ok is false."},sideEffects:{type:new r(new o(new r(p))),description:"What the configurator would do beyond the change itself, such as parts it would add or replace, in its own words; empty when ok is false."},errors:{type:new r(new o(new r(A))),description:"Why the change cannot be made; empty when ok is true."}})})),Z={recipeGroup:(E=[...Object.keys(z).length>0?[f.mutation]:[],...Object.keys(Q).length>0?[g.mutation]:[]],N=E.join(" or "),D=new s({name:"Recipe",description:"One recipe of a recipe group: something that can be added to the entity, or something the entity can be replaced with, depending on the edge the group is listed under.",fields:{key:{type:new r(p),description:`Identifies the recipe within its group; pass it to ${N} as recipeKey. Keys can change with the configuration and with the language, so read them from the listing rather than remembering them.`},name:{type:new r(p),description:"Name shown to the user."},description:{type:p},imageUrl:{type:p,description:"Thumbnail shown to the user."},dryRun:{type:Y,description:"Tries the recipe out. Each selected dry-run costs a full recalculation, so select it only on the recipes you are deciding between. Null for a group whose recipes cannot be dry-run."}}}),new s({name:"RecipeGroup",description:"A group of recipes of an entity, as the configurator offers them to the user.",fields:{groupId:{type:new r(p),description:`Identifies the group on its entity; pass it to ${N} as recipeGroupId.`},name:{type:new r(p),description:"Name shown to the user."},description:{type:p},recipes:{type:new r(new o(new r(D)))}}})),fieldOption:new s({name:"FieldOption",description:"One choice of a field, as the configurator offers it to the user.",fields:{value:{type:new r(c),description:"The value to write to the field."},name:{type:p,description:"Name shown to the user."},description:{type:p},imageUrl:{type:p,description:"Image shown to the user."},color:{type:p,description:'Color shown to the user, as "#rrggbb".'},dryRun:{type:Y,description:"Tries writing the value to the field. Each selected dry-run costs a full recalculation, so select it only on the options you are deciding between. Null for a field whose options cannot be dry-run."}}})};for(let e of S){let t=w(b.childRecipes,e)??{groups:[],hints:[]},n=w(b.replaceRecipes,e)??{groups:[],hints:[]},i=w(x,e)??[];(t.groups.length>0||n.groups.length>0||i.length>0)&&B.set(e,k({entityType:e,childRecipes:t,replaceRecipes:n,optionsEdges:i},Z))}let _=new a({query:(R=L(J.has(u)?u:y),T=L(y),M=(e=>{let t={};for(let[n,i,o]of[["navigationState","Active navigation state.",e.navigationStates],["viewState","Active view state.",e.viewStates],["toolState","Active tool state.",e.toolStates]])o.length>1&&(t[n]={type:new r(p),description:m(i,o)});if(0!==Object.keys(t).length)return new s({name:"Navigation",description:"The active UI states of the configurator.",fields:t})})(G),new s({name:"Query",fields:{root:{type:new r(R),description:"The root entity of the configuration."},entities:{type:new r(new o(T)),args:{ids:{type:new o(new r(t))}},description:`Every entity of the configuration, or, when ids are given, those entities in the same order with null for an unknown id. Ids have the form "<Type>-<number>"${W?`, e.g. "${W}-1"`:""}; any other id is an error.`},selectedEntity:{type:new r(T),description:"The selected entity, or the root entity when nothing is selected."},...M?{navigation:{type:new r(M)}}:{}}})),mutation:(({deletableTypes:e,writableTypes:i,childRecipes:a,replaceRecipes:d,actionFields:h,objectTypes:c,anyDomainEntity:y,targetOutputType:u})=>{let f,g;if(0!==e.length||0!==i.length||0!==Object.keys(a).length||0!==Object.keys(d).length||0!==h.length)return new s({name:"Mutation",fields:Object.assign(0===e.length?{}:{deleteEntity:{type:new r(new o(new r(t))),args:{id:{type:new r(t)}},description:`Deletes the entity with the given id, together with the entities composed into it, and returns the ids of every entity the deletion removed, the given one first. Deletable entity types: ${e.join(", ")}. Nothing can be read from removed entities afterwards, so query what you need from them before deleting.`}},0===(f=I(a)).length?{}:{addChild:{type:new r(new o(new r(y))),args:{parentId:{type:new r(t)},recipeGroupId:{type:new r(p)},recipeKey:{type:new r(p)}},description:`Adds a child to the entity with the id parentId by one recipe of one of its recipe groups. Entity types with recipe groups: ${f.join("; ")}. Read the groupId and the recipe key from "meta { childRecipes }" of the parent. Returns every entity the change added, the recipe's own first and then whatever the configurator added in response, such as a part the new child needs; the list is empty when the configurator removed them again.`}},0===(g=I(d)).length?{}:{replaceEntity:{type:new r(new o(new r(y))),args:{entityId:{type:new r(t)},recipeGroupId:{type:new r(p)},recipeKey:{type:new r(p)}},description:`Replaces the entity with the id entityId by one recipe of one of its replace recipe groups. Entity types with replace recipe groups: ${g.join("; ")}. Read the groupId and the recipe key from "meta { replaceRecipes }" of the entity. The replacement is a new entity with a new id: the id passed in no longer exists afterwards, and the replacement has the field values of its recipe, not those of the entity it replaces. Returns every entity the change added, the replacement first and then whatever the configurator added in response, such as a part the replacement needs; the list is empty when the configurator removed them again.`}},...i.flatMap(e=>{let i=c.get(e.entityType);return i?[(({entityType:e,fields:i},o)=>{let s=Object.fromEntries(i.map(({name:e,type:t,description:n})=>[e,{type:l(t),description:n}]));return{[`modify${e}`]:{type:o,args:{id:{type:new r(t)},delta:{type:new r(new n({name:`${e}Delta`,fields:s}))}},description:`Changes writable fields of the one ${e} with the given id: ${i.map(({name:e})=>e).join(", ")}. The delta sets only the fields it names and needs at least one; values are in stored units, as the field descriptions say. Returns the entity as it is after the change, including what the configurator adjusted in response, or null when the change caused the entity to be removed.`}}})(e,i)]:[]}),Object.fromEntries(h.map(e=>{var t;return[e.fieldName,{type:new r(new s({name:(t=e.fieldName,`${t.charAt(0).toUpperCase()+t.slice(1)}Result`),description:`What ${e.fieldName} returns, read from the configuration after the change.`,fields:()=>Object.fromEntries(Object.entries(e.result).map(([e,t])=>[e,{type:"edge"===t.kind?(({target:e,list:t,nullable:n},i)=>{let s=t?new o(new r(i(e))):i(e);return n?s:new r(s)})(t,u):l(t.type),description:t.description}]))})),args:Object.fromEntries(Object.entries(e.args).map(([e,t])=>[e,{type:l(t.type),description:t.description}])),description:e.description}]})))})})({deletableTypes:K,writableTypes:U,childRecipes:z,replaceRecipes:Q,actionFields:F,objectTypes:H,anyDomainEntity:L(y),targetOutputType:P}),types:[...J.values(),...H.values()]}),ee=h(_);if(ee.length>0)throw Error(ee.map(e=>e.message).join(" "));return{sdl:d(_),fields:X,deletableTypes:K,writableFields:Object.fromEntries(U.map(({entityType:e,fields:t})=>[e,Object.fromEntries(t.map(({name:e,property:t})=>[e,t]))])),childRecipes:z,replaceRecipes:Q,fieldOptions:Object.fromEntries(S.flatMap(e=>{let t=w(x,e);return t?[[e,t.map(({options:e})=>e)]]:[]})),actions:Object.fromEntries(F.map(({fieldName:e,actionName:t})=>[e,t]))}};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AssistantManifest } from './assistant-manifest.js';
|
|
2
2
|
/**
|
|
3
3
|
* The part of the assistant's system prompt that explains how to read the generated GraphQL schema.
|
|
4
|
-
* It is generated here, by the SDK that also runs in the browser, and
|
|
4
|
+
* It is generated here, by the SDK that also runs in the browser, and returned by the deployment webhook,
|
|
5
5
|
* because the conventions it describes belong to this SDK version and not to the server. The part
|
|
6
6
|
* about changes is left out when the schema has no `Mutation` type, the part about adding
|
|
7
7
|
* entities when it has no `addChild` mutation, the part about replacing them when it has no
|
|
@@ -10,4 +10,4 @@ import type { AssistantSpec } from '#package/application-spec';
|
|
|
10
10
|
* `query` and `apply` tools, which every run registers whatever the schema holds, and the change
|
|
11
11
|
* record the `AssistantSystem` attaches to every user message.
|
|
12
12
|
*/
|
|
13
|
-
export declare const generateAssistantPrompt: (assistant:
|
|
13
|
+
export declare const generateAssistantPrompt: (assistant: AssistantManifest) => string;
|
package/dist/{phoenix/application-spec → domain/application/assistant}/generate-assistant-prompt.js
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
let e=["How to read the GraphQL schema of this configurator:","- A configuration is a set of entities. `root` is the root entity, `entities` lists every entity or the ones with the given ids, and `selectedEntity` is the entity the user has selected, or the root entity when nothing is selected.","- Every entity has an `id` of the form `<Type>-<number>`, for example `Table-1`, and a `type` with its entity type name. Ids are assigned by the configurator: read them from the configuration and never make one up.","- A field whose name starts with `_` is computed by the configurator from other values. It can be read like any other field and never written.","- Numbers are in the units the configuration stores them in. A field description names the unit when the product defines one.",'- A text field that only takes fixed values lists them in its description as "One of: ...". Use exactly those values.',"- A field typed as another entity type or as a list of one is a relation: select fields on it to read the related entities.","- Field and type descriptions come from the team that built the configurator and say what a value means for the product."],t=["How changes work:","- Every field of the `Mutation` type is one change. Its description says what it changes and what it returns.","- The configurator checks the whole configuration after each change. A change that would leave it invalid fails with an error that names the entities at fault, and it is not applied. Later changes of the same request are then not run.","- The configurator may adjust other values in response to a change, so read what a mutation returns instead of assuming the values you sent."],a=["How to add entities:","- Entities are added from recipes, the same ones the configurator offers the user. An entity type that can take children has a `meta` field; `meta { childRecipes }` lists its recipe groups and their recipes.","- List the recipes of the group first, pick one by its `key`, then call `addChild` with the id of the parent, the `groupId` and the `key`. Keys change with the configuration and the language, so never reuse one from memory.","- `dryRun` on a recipe shows what adding it would do without adding it: whether it is `ok`, the `changedEntities` it would add or modify, the `deletedEntityIds` it would remove, the `sideEffects` the configurator says it would have, and the `errors` when it cannot be added. An entity whose id the configuration does not have yet is new. It is costly, so select it only on the recipes you are deciding between.","- Put each `addChild` in its own operation. The recipes of a group and what they add depend on the configuration before them, so after adding something, list the group again before adding from it once more."],n=["How to replace entities:","- An entity is replaced from recipes, the same ones the configurator offers the user. An entity type that can be replaced has a `meta` field; `meta { replaceRecipes }` lists its replace recipe groups and what the entity can be replaced with.","- List the recipes of the group first, pick one by its `key`, then call `replaceEntity` with the id of the entity, the `groupId` and the `key`. `dryRun` on a replace recipe shows what replacing would do without doing it: the replacement and everything else that changes are under `changedEntities`, and the replaced entity is among the `deletedEntityIds`.","- The replacement is a new entity with a new id, and its field values come from the recipe, so they can differ from those of the entity it replaces. Read the ids and values `replaceEntity` returns, and never use the old id again.","- Put each `replaceEntity` in its own operation. The recipes of a group and what they do depend on the configuration before them, so after replacing something, list the group of the replacement again before replacing once more."],o=["How to find the values a field can take:","- Some fields store a key whose choices the configurator holds elsewhere. Such a field has an edge under `meta` named after it: `meta { <field>Options }` lists its choices, each with the `value` to write and the `name` the user sees.","- Read the choices before you write such a field or name a choice to the user, and write the `value`, not the `name`. A value outside the list is rejected unless the edge description says the field is not checked.","- `dryRun` on an option shows what writing its value would do without writing it: whether it is `ok`, the `changedEntities` it would add or modify, the `deletedEntityIds` it would remove, the `sideEffects` the configurator says it would have, and the `errors` when the value cannot be written. It is costly, so select it only on the options you are deciding between. It is null when the edge description says the options cannot be dry-run.","- The choices can depend on the entity and on its current state. Read them again after a change, unless the edge description says they are the same for all instances or do not change."],i=["How the custom changes of this configurator work:","- Besides the generic changes, the `Mutation` type has fields the team built for this product. Each runs one domain operation the configurator itself uses, so prefer it over composing the same change from generic mutations. Its description says what it does and what its arguments mean.","- Its arguments are checked against what the operation declares; an argument that does not fit, or a change the product does not allow, fails the field with a message that says what to send instead.","- It returns an object whose fields the description names; a field typed as an entity reads that entity after the change."],s=["How to use the `query` and `apply` tools:","- Both take `operations`, a list of GraphQL documents that run in order. Each document holds exactly one operation. To do several things, send several items in one call instead of several calls.","- Write values into the document as literals. Use `variables` only for a value that cannot be written as a literal.","- Select only the fields you need: results are returned whole.","- The result has one GraphQL result per operation, in the order sent. When an operation fails, its `errors` say why and the operations after it are not run.","- `query` reads the configuration the user has open and never changes it. Call it before you say anything about the configuration."],h=["- This configurator exposes no changes, so there is nothing for `apply` to run. Say so when the user asks you to change the configuration."],r=['- Mutations inside `query` answer "what if" questions. Each operation sees the changes of the ones before it, so a mutation followed by a query shows the configuration as it would be. Nothing is kept and the user sees no change.',"- `apply` makes the changes the user asked for. It is all or nothing: when any operation fails, nothing is changed; when all succeed, the user gets them as one undo step.","- `committed` in the result says whether the changes were kept. When it is false although no operation failed, `message` says why: the changes may be waiting for the approval of the user, the user may have changed the configuration meanwhile, or this session may not change the configuration at all. Without a `message`, the operations changed nothing. Never tell the user a change was made unless `committed` is true.","- `sideEffects` in the result lists what the configurator did beyond what the operations asked for, such as parts it added or replaced to keep the configuration valid, in its own words. Tell the user about them when the changes were kept. When they were not, or in `query`, it lists what the mutations that succeeded would do. `dryRun` has the same list for a single recipe or option."],d=["How to read the change record:","- Every user message starts with a change record of the configuration since your previous action. It is the complete list of the entities that were added or deleted, of the stored fields of this schema that changed, and of the selection and navigation changes, so update your picture from it and do not query those again when it does not mention them.","- Fields whose name starts with `_` are computed and are never listed. Read them again when the record lists a change they may depend on.","- `[changes: none]`: nothing changed. Do not query again what you already know.","- `[changes]` is followed by one line per change. `selected`, `navigationState`, `viewState` and `toolState` lines show `<old> -> <new>` of what `selectedEntity` and `navigation` return, with `none` for an empty value. `A <id>` is an added entity and `D <id>` a deleted one. `M <id>` is a modified entity, followed by one `<field>: <old> -> <new>` line per changed field, under the name the field has in this schema. A `reset: undo/redo` line says the user undid or redid changes.","- The `#` comment at the end of a line names the control, the transformer or the explanation of the last change to that line.","- `[changes: unavailable]`: the page was loaded since your previous action, so earlier values may be stale. `[changes: too many (n)]`: n entities changed and are not listed. In both cases query what you need."],c=["- Changes you applied are not in the record, except those that were waiting for the approval of the user: they appear in it once approved."];export const generateAssistantPrompt=l=>{let u=/^type Mutation\b/m.test(l.sdl);return[e,...u?[t]:[],.../^\s+addChild\(/m.test(l.sdl)?[a]:[],.../^\s+replaceEntity\(/m.test(l.sdl)?[n]:[],.../^type FieldOption\b/m.test(l.sdl)?[o]:[],...Object.keys(l.actions).length>0?[i]:[],[...s,...u?r:h],[...d,...u?c:[]]].map(e=>e.join("\n")).join("\n\n")};
|
|
1
|
+
let e=["How to read the GraphQL schema of this configurator:","- A configuration is a set of entities. `root` is the root entity, `entities` lists every entity or the ones with the given ids, and `selectedEntity` is the entity the user has selected, or the root entity when nothing is selected.","- Every entity has an `id` of the form `<Type>-<number>`, for example `Table-1`, and a `type` with its entity type name. Ids are assigned by the configurator: read them from the configuration and never make one up.","- A field whose name starts with `_` is computed by the configurator from other values. It can be read like any other field and never written.","- Numbers are in the units the configuration stores them in. A field description names the unit when the product defines one.",'- A text field that only takes fixed values lists them in its description as "One of: ...". Use exactly those values.',"- A field typed as another entity type or as a list of one is a relation: select fields on it to read the related entities.","- Field and type descriptions come from the team that built the configurator and say what a value means for the product."],t=["How changes work:","- Every field of the `Mutation` type is one change. Its description says what it changes and what it returns.","- The configurator checks the whole configuration after each change. A change that would leave it invalid fails with an error that names the entities at fault, and it is not applied. Later changes of the same request are then not run.","- The configurator may adjust other values in response to a change, so read what a mutation returns instead of assuming the values you sent."],a=["How to add entities:","- Entities are added from recipes, the same ones the configurator offers the user. An entity type that can take children has a `meta` field; `meta { childRecipes }` lists its recipe groups and their recipes.","- List the recipes of the group first, pick one by its `key`, then call `addChild` with the id of the parent, the `groupId` and the `key`. Keys change with the configuration and the language, so never reuse one from memory.","- `dryRun` on a recipe shows what adding it would do without adding it: whether it is `ok`, the `changedEntities` it would add or modify, the `deletedEntityIds` it would remove, the `sideEffects` the configurator says it would have, and the `errors` when it cannot be added. An entity whose id the configuration does not have yet is new. It is costly, so select it only on the recipes you are deciding between.","- Put each `addChild` in its own operation. The recipes of a group and what they add depend on the configuration before them, so after adding something, list the group again before adding from it once more."],n=["How to replace entities:","- An entity is replaced from recipes, the same ones the configurator offers the user. An entity type that can be replaced has a `meta` field; `meta { replaceRecipes }` lists its replace recipe groups and what the entity can be replaced with.","- List the recipes of the group first, pick one by its `key`, then call `replaceEntity` with the id of the entity, the `groupId` and the `key`. `dryRun` on a replace recipe shows what replacing would do without doing it: the replacement and everything else that changes are under `changedEntities`, and the replaced entity is among the `deletedEntityIds`.","- The replacement is a new entity with a new id, and its field values come from the recipe, so they can differ from those of the entity it replaces. Read the ids and values `replaceEntity` returns, and never use the old id again.","- Put each `replaceEntity` in its own operation. The recipes of a group and what they do depend on the configuration before them, so after replacing something, list the group of the replacement again before replacing once more."],o=["How to find the values a field can take:","- Some fields store a key whose choices the configurator holds elsewhere. Such a field has an edge under `meta` named after it: `meta { <field>Options }` lists its choices, each with the `value` to write and the `name` the user sees.","- Read the choices before you write such a field or name a choice to the user, and write the `value`, not the `name`. A value outside the list is rejected unless the edge description says the field is not checked.","- `dryRun` on an option shows what writing its value would do without writing it: whether it is `ok`, the `changedEntities` it would add or modify, the `deletedEntityIds` it would remove, the `sideEffects` the configurator says it would have, and the `errors` when the value cannot be written. It is costly, so select it only on the options you are deciding between. It is null when the edge description says the options cannot be dry-run.","- The choices can depend on the entity and on its current state. Read them again after a change, unless the edge description says they are the same for all instances or do not change."],i=["How the custom changes of this configurator work:","- Besides the generic changes, the `Mutation` type has fields the team built for this product. Each runs one domain operation the configurator itself uses, so prefer it over composing the same change from generic mutations. Its description says what it does and what its arguments mean.","- Its arguments are checked against what the operation declares; an argument that does not fit, or a change the product does not allow, fails the field with a message that says what to send instead.","- It returns an object whose fields the description names; a field typed as an entity reads that entity after the change."],s=["How to use the `query` and `apply` tools:","- Both take `operations`, a list of GraphQL documents that run in order. Each document holds exactly one operation. To do several things, send several items in one call instead of several calls.","- Write values into the document as literals. Use `variables` only for a value that cannot be written as a literal.","- Select only the fields you need: results are returned whole.","- The result has one GraphQL result per operation, in the order sent. When an operation fails, its `errors` say why and the operations after it are not run.","- `query` reads the configuration the user has open and never changes it. Call it before you say anything about the configuration."],h=["- This configurator exposes no changes, so there is nothing for `apply` to run. Say so when the user asks you to change the configuration."],r=['- Mutations inside `query` answer "what if" questions. Each operation sees the changes of the ones before it, so a mutation followed by a query shows the configuration as it would be. Nothing is kept and the user sees no change.',"- `apply` makes the changes the user asked for. It is all or nothing: when any operation fails, nothing is changed; when all succeed, the user gets them as one undo step.","- `committed` in the result says whether the changes were kept. When it is false although no operation failed, `message` says why: the changes may be waiting for the approval of the user, the user may have changed the configuration meanwhile, or this session may not change the configuration at all. Without a `message`, the operations changed nothing. Never tell the user a change was made unless `committed` is true.","- `sideEffects` in the result lists what the configurator did beyond what the operations asked for, such as parts it added or replaced to keep the configuration valid, in its own words. Tell the user about them when the changes were kept. When they were not, or in `query`, it lists what the mutations that succeeded would do. `dryRun` has the same list for a single recipe or option."],d=["How to read the change record:","- Every user message starts with a change record of the configuration since your previous action. It is the complete list of the entities that were added or deleted, of the stored fields of this schema that changed, and of the selection and navigation changes, so update your picture from it and do not query those again when it does not mention them.","- Fields whose name starts with `_` are computed and are never listed. Read them again when the record lists a change they may depend on.","- `[changes: none]`: nothing changed. Do not query again what you already know.","- `[changes]` is followed by one line per change. `selected`, `navigationState`, `viewState` and `toolState` lines show `<old> -> <new>` of what `selectedEntity` and `navigation` return, with `none` for an empty value. `A <id>` is an added entity and `D <id>` a deleted one. `M <id>` is a modified entity, followed by one `<field>: <old> -> <new>` line per changed field, under the name the field has in this schema. A `reset: undo/redo` line says the user undid or redid changes.","- The `#` comment at the end of a line names the control, the transformer or the explanation of the last change to that line.","- `[changes: unavailable]`: the page was loaded since your previous action, so earlier values may be stale. `[changes: too many (n)]`: n entities changed and are not listed. In both cases query what you need."],c=["- Changes you applied are not in the record, except those that were waiting for the approval of the user: they appear in it once approved."];export const generateAssistantPrompt=l=>{let u=/^type Mutation\b/m.test(l.sdl);return[e,...u?[t]:[],.../^\s+addChild\(/m.test(l.sdl)?[a]:[],.../^\s+replaceEntity\(/m.test(l.sdl)?[n]:[],.../^type FieldOption\b/m.test(l.sdl)?[o]:[],...Object.keys(l.actions??{}).length>0?[i]:[],[...s,...u?r:h],[...d,...u?c:[]]].map(e=>e.join("\n")).join("\n\n")};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { AssistantResolvedManifest, AssistantResolvedField, AssistantValueType, AssistantRelationType, AssistantStates, AssistantWritableType, AssistantWritableField, AssistantResolvedHint, AssistantResolvedRecipes, AssistantResolvedOptionsEdge, AssistantResolvedAction, AssistantResolvedActionResult, } from './assistant-resolved-manifest.js';
|
|
2
|
+
export { buildAssistantManifest } from './build-assistant-manifest.js';
|
|
3
|
+
export type { AssistantFieldSource, AssistantRecipeGroup, AssistantFieldOptions, AssistantManifest, } from './assistant-manifest.js';
|
|
4
|
+
export { generateAssistantPrompt } from './generate-assistant-prompt.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{buildAssistantManifest}from"./build-assistant-manifest.js";export{generateAssistantPrompt}from"./generate-assistant-prompt.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DomainEntity, DomainEntityId } from '../core/model.js';
|
|
2
2
|
import type { DomainState } from '../core/state.js';
|
|
3
|
-
import type { AssistantFieldOptions, AssistantManifest } from './application-config.js';
|
|
4
3
|
import type { AssistantRecipeContext } from './assistant-recipe-groups.js';
|
|
4
|
+
import type { AssistantFieldOptions, AssistantManifest } from './assistant/index.js';
|
|
5
5
|
type AnyDomainState = DomainState<DomainEntity<string>>;
|
|
6
6
|
/**
|
|
7
7
|
* One choice of a writable field as the assistant reads it, whatever component holds it: the value
|
|
@@ -3,7 +3,7 @@ import { type StateUpdate } from '../components/updates.js';
|
|
|
3
3
|
import type { AnyActionContext } from '../core/action.js';
|
|
4
4
|
import { type DomainEntity } from '../core/model.js';
|
|
5
5
|
import type { DomainState } from '../core/state.js';
|
|
6
|
-
import type { AssistantManifest } from './
|
|
6
|
+
import type { AssistantManifest } from './assistant/index.js';
|
|
7
7
|
type AnyDomainState = DomainState<DomainEntity<string>>;
|
|
8
8
|
/**
|
|
9
9
|
* Update tag of user-intended entity deletions, from the configurator's delete controls and the
|
|
@@ -11,7 +11,7 @@ import type { RecipeListItem } from '../system-components/common/recipes.js';
|
|
|
11
11
|
import type { DistanceDimensionSelectComponent } from '../system-components/distance-dimension-select.js';
|
|
12
12
|
import type { MaterialSwatchComponent } from '../system-components/material-swatch.js';
|
|
13
13
|
import { type ReplaceEntityRecipesComponent } from '../system-components/replace-entity-recipes.js';
|
|
14
|
-
import type { AssistantManifest, AssistantRecipeGroup } from './
|
|
14
|
+
import type { AssistantManifest, AssistantRecipeGroup } from './assistant/index.js';
|
|
15
15
|
type AnyDomainState = DomainState<DomainEntity<string>>;
|
|
16
16
|
/** An update a recipe cooks to: the creation of an entity, or the replacement of the entity a replace recipe is for. */
|
|
17
17
|
type AnyRecipeUpdate = DomainEntityCreation<DomainEntity<string>, DomainEntity<string>> | DomainEntityReplacement<DomainEntity<string>>;
|
|
@@ -2,12 +2,10 @@ import type { I18n } from '@lingui/core';
|
|
|
2
2
|
import type { ThemeOptions } from '@mui/material';
|
|
3
3
|
import type { z } from 'zod';
|
|
4
4
|
import type { FinalizeTaskResource } from '@salsita-ai/contracts/webhook';
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type { ElementRegistration } from './element-registration.js';
|
|
10
|
-
import type { HandlerRegistration } from './handler-registration.js';
|
|
5
|
+
import type { $DomainEntity, DomainEntity, DomainFactory, EnumLike, ProductPreset, SchemaOfObject } from '../core/index.js';
|
|
6
|
+
import type { ProjectModule } from '../project-modules/index.js';
|
|
7
|
+
import type { AclConfig, ApplicationConfig, DataSpec, DefaultEnvs, ResourcesConfig, SpecTransformer, TransformersConfig, UserInterfaceConfig } from './application-config.js';
|
|
8
|
+
import type { AssistantResolvedManifest } from './assistant/index.js';
|
|
11
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> {
|
|
12
10
|
version?: string;
|
|
13
11
|
textLanguages?: string[];
|
|
@@ -18,13 +16,13 @@ interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = nev
|
|
|
18
16
|
viewState?: EnumLike<VIEW_STATES>;
|
|
19
17
|
toolState?: EnumLike<TOOL_STATES>;
|
|
20
18
|
exportState?: EnumLike<EXPORT_STATES>;
|
|
21
|
-
componentOptics:
|
|
19
|
+
componentOptics: readonly ProjectModule[];
|
|
22
20
|
i18n?: I18n;
|
|
23
21
|
adminDomainFactory?: DomainFactory<ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
24
22
|
adminPresets?: ReadonlyArray<ProductPreset<ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES>>;
|
|
25
23
|
adminNavigationState?: EnumLike<ADMIN_NAVIGATION_STATES>;
|
|
26
24
|
adminViewState?: EnumLike<ADMIN_VIEW_STATES>;
|
|
27
|
-
adminComponentOptics:
|
|
25
|
+
adminComponentOptics: readonly ProjectModule[];
|
|
28
26
|
publishedData?: z.ZodType<PUBLISHED_DATA>;
|
|
29
27
|
finalizeData?: SchemaOfObject<FINALIZE_DATA>;
|
|
30
28
|
prefetchedFinalizeData?: SchemaOfObject<PREFETCHED_FINALIZE_DATA>;
|
|
@@ -32,7 +30,7 @@ interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = nev
|
|
|
32
30
|
callbackData?: SchemaOfObject<CALLBACK_DATA>;
|
|
33
31
|
resources?: ReadonlyArray<FinalizeTaskResource<RESOURCE>>;
|
|
34
32
|
dataSpec?: DataSpec;
|
|
35
|
-
|
|
33
|
+
transformers?: TransformersConfig;
|
|
36
34
|
acl?: AclConfig;
|
|
37
35
|
enableAdminRelease?: boolean;
|
|
38
36
|
ui?: Pick<UserInterfaceConfig, 'appLoader' | 'preview' | 'alwaysExpand'>;
|
|
@@ -41,11 +39,11 @@ interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = nev
|
|
|
41
39
|
readonly scope: string;
|
|
42
40
|
}>>;
|
|
43
41
|
publishedDataHash?: string;
|
|
44
|
-
assistant?:
|
|
42
|
+
assistant?: AssistantResolvedManifest | null;
|
|
45
43
|
theme?: ThemeOptions;
|
|
46
44
|
tagName?: string;
|
|
47
|
-
handlers?:
|
|
48
|
-
elements?: readonly
|
|
45
|
+
handlers?: readonly ProjectModule[];
|
|
46
|
+
elements?: readonly ProjectModule[];
|
|
49
47
|
}
|
|
50
48
|
export declare class ConfiguratorBuilder<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> {
|
|
51
49
|
private readonly _context;
|
|
@@ -61,7 +59,7 @@ export declare class ConfiguratorBuilder<ENTITIES extends DomainEntity<string> =
|
|
|
61
59
|
readonly scope: string;
|
|
62
60
|
}>>): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
63
61
|
withPublishedDataHash(publishedDataHash: string): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
64
|
-
withAssistant(assistant:
|
|
62
|
+
withAssistant(assistant: AssistantResolvedManifest | null): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
65
63
|
withTheme(theme: ThemeOptions): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
66
64
|
withDomainFactory<NEW_ENTITIES extends DomainEntity<string>, NEW_ALLOWED_ROOT_ENTITIES extends NEW_ENTITIES, NEW_MAP extends Record<NEW_ENTITIES['type'], $DomainEntity<NEW_ENTITIES>>, NEW_PUBLISHED_DATA extends Record<string, unknown>, NEW_SESSION_DATA extends Record<string, unknown>, NEW_FRONTEND_DATA extends Record<string, unknown>>(domainFactory: DomainFactory<NEW_ENTITIES, NEW_ALLOWED_ROOT_ENTITIES, NEW_MAP, NEW_PUBLISHED_DATA, NEW_SESSION_DATA, NEW_FRONTEND_DATA>): ConfiguratorBuilder<NEW_ENTITIES, NEW_ALLOWED_ROOT_ENTITIES, NEW_MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, NEW_PUBLISHED_DATA, NEW_SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
67
65
|
withAdminDomainFactory<NEW_ADMIN_ENTITIES extends DomainEntity<string>, NEW_ADMIN_ALLOWED_ROOT_ENTITIES extends NEW_ADMIN_ENTITIES, NEW_ADMIN_MAP extends Record<NEW_ADMIN_ENTITIES['type'], $DomainEntity<NEW_ADMIN_ENTITIES>>>(adminDomainFactory: DomainFactory<NEW_ADMIN_ENTITIES, NEW_ADMIN_ALLOWED_ROOT_ENTITIES, NEW_ADMIN_MAP, any, any, any>): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, NEW_ADMIN_ENTITIES, NEW_ADMIN_ALLOWED_ROOT_ENTITIES, NEW_ADMIN_MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
@@ -78,17 +76,34 @@ export declare class ConfiguratorBuilder<ENTITIES extends DomainEntity<string> =
|
|
|
78
76
|
withAdminViewState<NEW_ADMIN_VIEW_STATES extends string>(adminViewState: EnumLike<NEW_ADMIN_VIEW_STATES>): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, NEW_ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
79
77
|
withPresets(presets: ReadonlyArray<ProductPreset<ENTITIES, ALLOWED_ROOT_ENTITIES>>): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
80
78
|
withAdminPresets(adminPresets: ReadonlyArray<ProductPreset<ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES>>): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
/** Adds component optics as project modules: the `src/components/` files, or the optics a generated file lists. The runtime spec validates them. */
|
|
80
|
+
withComponentOptics(componentOptics: readonly ProjectModule[]): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
81
|
+
/** Adds admin component optics as project modules: the `src/admin/components/` files, or the optics a generated file lists. The runtime spec validates them. */
|
|
82
|
+
withAdminComponentOptics(componentOptics: readonly ProjectModule[]): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the handlers as project modules, one per `src/handlers/` file. They are stored unread: the
|
|
85
|
+
* runtime spec validates them, and `buildConfig` inspects them only afterwards.
|
|
86
|
+
*/
|
|
87
|
+
withHandlers(handlers: readonly ProjectModule[]): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
88
|
+
/** Sets the elements as project modules, one per `src/elements/` file, for the runtime spec to validate. */
|
|
89
|
+
withElements(elements: readonly ProjectModule[]): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
85
90
|
withResources<NEW_RESOURCE extends string>(resources: ReadonlyArray<FinalizeTaskResource<NEW_RESOURCE>>): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, NEW_RESOURCE>;
|
|
86
91
|
withWebComponentTag(tagName: string): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
87
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Sets the transformers: the `src/transformers/` files as project modules, and the spec's `transformers`
|
|
94
|
+
* section that selects and orders them. The runtime spec validates the files and builds the factory.
|
|
95
|
+
*/
|
|
96
|
+
withTransformers(importedTransformers: readonly ProjectModule[], specTransformers: readonly SpecTransformer[]): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
88
97
|
withInterface(_interface: unknown): this;
|
|
89
98
|
withDataSpec: (dataSpec: DataSpec) => ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
90
99
|
private _computeInitialPublishedData;
|
|
91
100
|
buildConfig(): ApplicationConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, Record<string, unknown>, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>;
|
|
101
|
+
/**
|
|
102
|
+
* Builds the config together with the validated handlers. The handlers are read from the bootstrap
|
|
103
|
+
* runtime's spec rather than from the builder context, so nothing here touches a project file's
|
|
104
|
+
* export before the spec has checked it against its folder's contract.
|
|
105
|
+
*/
|
|
106
|
+
private _buildConfigWithHandlers;
|
|
92
107
|
buildWebhookContext(): {
|
|
93
108
|
config: ApplicationConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, Record<string, unknown>, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>;
|
|
94
109
|
parseFinalizeData: (data: unknown) => FINALIZE_DATA;
|
|
@@ -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/
|
|
1
|
+
import{initConsoleLogger as t}from"@salsita-ai/common/utils";import{defaultI18n as e}from"#package/i18n";import{extendedSchemaValidator as i}from"../core/schema/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{createInitialPublishedData as s}from"./create-initial-published-data.js";import{isDataRowValidatorHandler as h}from"./published-data/DataRowValidatorHandler.js";import{isFilterPublishedChunksHandler as l}from"./published-data/FilterPublishedChunksHandler.js";import{isMapPublishedChunkedDataHandler as u}from"./published-data/MapPublishedChunkedDataHandler.js";import{isMapPublishedRevisionDataHandler as d}from"./published-data/MapPublishedRevisionDataHandler.js";import{isSheetValidatorHandler as c}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 s({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",s={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},u=t(),d=n({config:s,services:{analyticsService:new r,i18n:e,logger:u}}),m=d.getState().spec.configurator.handlers;if(m.filter(t=>l(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=>c(t)).length>1)throw Error("Multiple createSheetValidatorHandler handlers found. Only one handler is allowed.");let f=m.find(o)?.handler().handler,x=m.find(a)?.handler().handler(void 0),w=this._computeInitialPublishedData(u,d,m);return{config:{...s,mount:{tag:i,options:x??{},Application:f},initialPublishedData:w},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(d)?.handler().handler,s=e.find(u)?.handler().handler,l=e.find(h)?.handler().handler,m=e.find(c)?.handler().handler;return{config:t,parseFinalizeData:r,parseFinalizeResult:n,resources:this._context.resources??[],parseCallbackData:o,mapPublishedRevisionData:a,mapPublishedChunkedData:s,dataRowValidator:l,sheetValidator:m}}}
|
|
@@ -2,6 +2,7 @@ import type { SvgIconProps } from '@mui/material';
|
|
|
2
2
|
import type { PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
import type { ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
4
4
|
import type { DomainEntityId } from '../core/index.js';
|
|
5
|
+
import { type ProjectModule } from '../project-modules/index.js';
|
|
5
6
|
export interface PhoenixEntityElementProps {
|
|
6
7
|
entityId: DomainEntityId<string>;
|
|
7
8
|
children?: ReactNode;
|
|
@@ -102,4 +103,8 @@ export declare const createPhoenixEntityElement: <SCHEMA extends {
|
|
|
102
103
|
} = never>(element: PhoenixEntityElementDefinition<SCHEMA>) => import("react").FunctionComponent<SCHEMA["props"] & CustomPhoenixEntityElementProps>;
|
|
103
104
|
export declare const createCustomPhoenixEntityElement: (name: string, element: (props: CustomPhoenixEntityElementProps) => JSX.Element) => PhoenixEntityElementRegistration;
|
|
104
105
|
export type CreateCustomPhoenixEntityElement = (name: string, element: (props: CustomPhoenixEntityElementProps) => JSX.Element) => PhoenixEntityElementRegistration;
|
|
106
|
+
/** The element registrations of one `src/elements/` file; the editor keys its per-file reload cache on this. */
|
|
107
|
+
export declare const resolveElementModule: (module: ProjectModule) => readonly ElementRegistration[];
|
|
108
|
+
/** Validates the `src/elements/` files of an application config and flattens their registrations. */
|
|
109
|
+
export declare const resolveElementModules: (modules: readonly ProjectModule[]) => readonly ElementRegistration[];
|
|
105
110
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const systemElementRegistry={layoutElements:{},entityElements:{}};export const createPhoenixLayoutElement=e=>(systemElementRegistry.layoutElements[e.schema.properties.kind.enum[0]]=e.component,e.component);export const createCustomPhoenixLayoutElement=(e,t)=>({type:"layout",name:e,element:t});export const createPhoenixEntityElement=e=>(systemElementRegistry.entityElements[e.schema.properties.kind.enum[0]]=e.component,e.component);export const createCustomPhoenixEntityElement=(e,t)=>({type:"entity",name:e,element:t});
|
|
1
|
+
import{SHARED_FOLDER_HINT as e,isRecord as t,resolveListModule as n}from"../project-modules/index.js";export const systemElementRegistry={layoutElements:{},entityElements:{}};export const createPhoenixLayoutElement=e=>(systemElementRegistry.layoutElements[e.schema.properties.kind.enum[0]]=e.component,e.component);export const createCustomPhoenixLayoutElement=(e,t)=>({type:"layout",name:e,element:t});export const createPhoenixEntityElement=e=>(systemElementRegistry.entityElements[e.schema.properties.kind.enum[0]]=e.component,e.component);export const createCustomPhoenixEntityElement=(e,t)=>({type:"entity",name:e,element:t});let o={expected:"an element registration, or an array of them",fix:`Create it with phx.frontend.createCustomPhoenixLayoutElement(...) or phx.frontend.createCustomPhoenixEntityElement(...), ${e}.`},r=e=>!!t(e)&&("icon"===e.type?Array.isArray(e.elements):("entity"===e.type||"layout"===e.type)&&"string"==typeof e.name&&"function"==typeof e.element);export const resolveElementModule=e=>n(e,o,r);export const resolveElementModules=e=>e.flatMap(resolveElementModule);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ProjectModule } from '../project-modules/index.js';
|
|
1
2
|
export type PhoenixHandlerDefinition = {
|
|
2
3
|
handler: () => Promise<void>;
|
|
3
4
|
};
|
|
@@ -27,3 +28,7 @@ export declare const createPhoenixHandler: (name: string, handler: () => Phoenix
|
|
|
27
28
|
export type CreatePhoenixHandler = (name: string, handler: () => PhoenixHandlerDefinition) => PhoenixHandlerRegistration;
|
|
28
29
|
export declare const createSystemPhoenixHandler: <P, R>(name: string, handler: () => SystemPhoenixHandlerDefinition<P, R>) => SystemPhoenixHandlerRegistration<P, R>;
|
|
29
30
|
export declare const createSystemPhoenixAsyncHandler: <P, R>(name: string, handler: () => SystemPhoenixAsyncHandlerDefinition<P, R>) => SystemPhoenixAsyncHandlerRegistration<P, R>;
|
|
31
|
+
/** The handler registrations of one `src/handlers/` file; the editor keys its per-file reload cache on this. */
|
|
32
|
+
export declare const resolveHandlerModule: (module: ProjectModule) => ReadonlyArray<HandlerRegistration<any, any>>;
|
|
33
|
+
/** Validates the `src/handlers/` files of an application config and flattens their registrations. */
|
|
34
|
+
export declare const resolveHandlerModules: (modules: readonly ProjectModule[]) => ReadonlyArray<HandlerRegistration<any, any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const createPhoenixHandler=(e,t)=>({type:"phoenix",name:e,handler:t});export const createSystemPhoenixHandler=(e,t)=>({type:"system",name:e,handler:t});export const createSystemPhoenixAsyncHandler=(e,t)=>({type:"system-async",name:e,handler:t});
|
|
1
|
+
import{SHARED_FOLDER_HINT as e,isRecord as t,resolveListModule as o}from"../project-modules/index.js";export const createPhoenixHandler=(e,t)=>({type:"phoenix",name:e,handler:t});export const createSystemPhoenixHandler=(e,t)=>({type:"system",name:e,handler:t});export const createSystemPhoenixAsyncHandler=(e,t)=>({type:"system-async",name:e,handler:t});let r={expected:"a handler registration, or an array of them",fix:`Create it with phx.frontend.createPhoenixHandler(...) or one of the other phx.frontend.create…Handler(...) factories, ${e}.`},n=e=>t(e)&&("phoenix"===e.type||"system"===e.type||"system-async"===e.type)&&"string"==typeof e.name&&"function"==typeof e.handler;export const resolveHandlerModule=e=>o(e,r,n);export const resolveHandlerModules=e=>e.flatMap(resolveHandlerModule);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { type DomainConfig, type NavigationConfig, type ISessionService, type Session, type ResourcesConfig, type ApplicationConfig, type UserInterfaceConfig, type MountConfig, type WebComponentOptions, type SessionState, type AuthenticationErrorCode, type DataCellValue, type DataSchema, type DataSchemaArrayField, type DataSchemaField, type DataSchemaFieldObject, type DataSpec, type DataSpecEntry, type SwatchSpecEntry, type ChunksSpec, type
|
|
1
|
+
export { type DomainConfig, type NavigationConfig, type ISessionService, type Session, type ResourcesConfig, type ApplicationConfig, type UserInterfaceConfig, type MountConfig, type WebComponentOptions, type SessionState, type AuthenticationErrorCode, type DataCellValue, type DataSchema, type DataSchemaArrayField, type DataSchemaField, type DataSchemaFieldObject, type DataSpec, type DataSpecEntry, type SwatchSpecEntry, type ChunksSpec, type ImportedTransformer, type SpecTransformer, type TransformersConfig, type AdminPagesSpec, type AnyApplicationConfig, type DefaultEnvs, } from './application-config.js';
|
|
2
2
|
export { type AssistantFieldOption, findAssistantFieldOptions, readAssistantFieldOptions, } from './assistant-field-options.js';
|
|
3
3
|
export { deleteEntityUpdateTag, findAssistantMutation, modifyEntityUpdateTag } from './assistant-mutations.js';
|
|
4
4
|
export { type AssistantRecipe, type AssistantRecipeContext, type AssistantRecipeGroupSnapshot, type AssistantRecipeKind, assistantAddedEntityIds, findAssistantRecipeGroups, prepareAssistantRecipeUpdates, readAssistantRecipeGroup, } from './assistant-recipe-groups.js';
|
|
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 } from './resolve-imported-transformers.js';
|
|
8
|
+
export { resolveImportedTransformers, resolveTransformerModule, resolveTransformerModules, } from './resolve-imported-transformers.js';
|
|
9
9
|
export { webComponentAttributeParsers, createWebComponentPropertyDescriptor, type AttributeParser, type WebComponentPropertyDescriptor, } from './web-component-property.js';
|
|
10
10
|
export { createWebComponentEventDescriptor, type WebComponentEventDescriptor } from './web-component-event.js';
|
|
11
11
|
export { standardWebComponentProperties, type StandardConfiguratorElement } from './standard-properties.js';
|
|
@@ -26,5 +26,6 @@ export { createDataRowValidatorHandler, DataRowValidatorHandlerName, isDataRowVa
|
|
|
26
26
|
export { createSheetValidatorHandler, SheetValidatorHandlerName, isSheetValidatorHandler, type CreateSheetValidatorHandler, type SheetValidatorResult, } from './published-data/SheetValidatorHandler.js';
|
|
27
27
|
export { createMapPublishedRevisionDataHandler, createMapPublishedRevisionDataHandlerFactory, isMapPublishedRevisionDataHandler, type CreateMapPublishedRevisionDataHandler, type TypedCreateMapPublishedRevisionDataHandler, } from './published-data/MapPublishedRevisionDataHandler.js';
|
|
28
28
|
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, } 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, } from './element-registration.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
|
+
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{assistantAddedEntityIds,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{resolveImportedTransformers}from"./resolve-imported-transformers.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{ResourceBuilder}from"./resource-builder.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{createPhoenixHandler,createSystemPhoenixHandler,createSystemPhoenixAsyncHandler}from"./handler-registration.js";export{createPhoenixLayoutElement,createPhoenixEntityElement,createCustomPhoenixLayoutElement,createCustomPhoenixEntityElement}from"./element-registration.js";
|
|
1
|
+
export{findAssistantFieldOptions,readAssistantFieldOptions}from"./assistant-field-options.js";export{deleteEntityUpdateTag,findAssistantMutation,modifyEntityUpdateTag}from"./assistant-mutations.js";export{assistantAddedEntityIds,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{resolveImportedTransformers,resolveTransformerModule,resolveTransformerModules}from"./resolve-imported-transformers.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{ResourceBuilder}from"./resource-builder.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{createPhoenixHandler,createSystemPhoenixHandler,createSystemPhoenixAsyncHandler,resolveHandlerModule,resolveHandlerModules}from"./handler-registration.js";export{createPhoenixLayoutElement,createPhoenixEntityElement,createCustomPhoenixLayoutElement,createCustomPhoenixEntityElement,resolveElementModule,resolveElementModules}from"./element-registration.js";export*from"./assistant/index.js";
|