@salsita-ai/sdk 0.50.0-develop.3f44338ee8 → 0.50.0-develop.419ade6b74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/README.md +1 -1
  2. package/dist/application-spec/core/enhanced-json-value.d.ts +2 -31
  3. package/dist/application-spec/core/enhanced-json-value.js +1 -1
  4. package/dist/application-spec/core/index.d.ts +1 -3
  5. package/dist/application-spec/core/index.js +1 -1
  6. package/dist/application-spec/core/json-schema.d.ts +2 -52
  7. package/dist/application-spec/core/markers/index.d.ts +1 -1
  8. package/dist/application-spec/core/markers/index.js +1 -1
  9. package/dist/application-spec/core/markers/msg-marker.d.ts +2 -28
  10. package/dist/application-spec/core/markers/msg-marker.js +1 -1
  11. package/dist/application-spec/core/markers/raw-eval-write-marker.d.ts +1 -1
  12. package/dist/application-spec/core/markers/raw-eval-write-marker.js +1 -1
  13. package/dist/application-spec/core/markers/raw-read-write-marker.js +1 -1
  14. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  15. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
  16. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  17. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
  18. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
  19. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  20. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +2 -2
  21. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +1 -1
  22. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -1
  23. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -1
  24. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -1
  25. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.d.ts +1 -1
  26. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +1 -1
  27. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  28. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +1 -1
  29. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  30. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -1
  31. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  32. package/dist/application-spec/generate-application/runtime/sections/preset-runtime.d.ts +2 -3
  33. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +2 -1
  34. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +1 -1
  35. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.d.ts +1 -1
  36. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.js +1 -1
  37. package/dist/application-spec/parse-application-files/spec/model/aliases.d.ts +3 -9
  38. package/dist/application-spec/parse-application-files/spec/model/common-types.d.ts +6 -14
  39. package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +6 -31
  40. package/dist/application-spec/parse-application-files/spec/model/entity-types.d.ts +3 -8
  41. package/dist/application-spec/parse-application-files/spec/model/model-version-key.d.ts +3 -3
  42. package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +3 -7
  43. package/dist/application-spec/parse-application-files/spec/model/names/alias-name.d.ts +3 -7
  44. package/dist/application-spec/parse-application-files/spec/model/names/entity-or-alias-name.d.ts +3 -8
  45. package/dist/application-spec/parse-application-files/spec/model/names/entity-type-name.d.ts +3 -8
  46. package/dist/application-spec/parse-application-files/spec/model/names/expression-name.d.ts +3 -6
  47. package/dist/application-spec/parse-application-files/spec/model/names/instance-name.d.ts +3 -7
  48. package/dist/application-spec/parse-application-files/spec/model/names/invariant-name.d.ts +3 -3
  49. package/dist/application-spec/parse-application-files/spec/model/names/shape-property-name.d.ts +3 -11
  50. package/dist/application-spec/parse-application-files/spec/model/names/violation-type-name.d.ts +3 -3
  51. package/dist/application-spec/parse-application-files/spec/model/presets.d.ts +6 -29
  52. package/dist/client/authorized-client.d.ts +3 -1
  53. package/dist/client/authorized-client.js +1 -1
  54. package/dist/client/contract.d.ts +17 -0
  55. package/dist/client/index.d.ts +1 -1
  56. package/dist/client/local-authorized-client.d.ts +3 -1
  57. package/dist/client/local-authorized-client.js +1 -1
  58. package/dist/client/memory-authorized-client.d.ts +4 -1
  59. package/dist/client/memory-authorized-client.js +1 -1
  60. package/dist/client/phoenix-api.d.ts +228 -0
  61. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  62. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +13 -0
  63. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  64. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +2 -1
  65. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  66. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +15 -9
  67. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  68. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +1 -1
  69. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
  70. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +12 -4
  71. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
  72. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
  73. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
  74. package/dist/docs/index.json +1 -1
  75. package/dist/docs/phoenix/domain-model.mdx +4 -1
  76. package/dist/docs/phoenix/phoenix-cli.mdx +14 -6
  77. package/dist/docs/phoenix/project-structure.mdx +21 -17
  78. package/dist/docs/phoenix/sdk-builder-workflow.mdx +2 -2
  79. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  80. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  81. package/dist/domain/index.d.ts +1 -0
  82. package/dist/domain/index.js +1 -1
  83. package/dist/domain/spec/application/index.d.ts +1 -0
  84. package/dist/domain/spec/application/index.js +1 -0
  85. package/dist/{application-spec/core → domain/spec}/components/component-filter.d.ts +3 -2
  86. package/dist/domain/spec/enhanced-json-value.d.ts +30 -0
  87. package/dist/domain/spec/enhanced-json-value.js +1 -0
  88. package/dist/domain/spec/index.d.ts +7 -0
  89. package/dist/domain/spec/index.js +1 -0
  90. package/dist/domain/spec/json-schema.d.ts +52 -0
  91. package/dist/domain/spec/json-schema.js +1 -0
  92. package/dist/domain/spec/markers/index.d.ts +2 -0
  93. package/dist/domain/spec/markers/index.js +1 -0
  94. package/dist/domain/spec/markers/msg-marker.d.ts +28 -0
  95. package/dist/domain/spec/markers/msg-marker.js +1 -0
  96. package/dist/domain/spec/model/aliases.d.ts +9 -0
  97. package/dist/domain/spec/model/aliases.js +1 -0
  98. package/dist/domain/spec/model/common-types.d.ts +15 -0
  99. package/dist/domain/spec/model/common-types.js +1 -0
  100. package/dist/domain/spec/model/defaults.d.ts +33 -0
  101. package/dist/domain/spec/model/defaults.js +1 -0
  102. package/dist/domain/spec/model/entity-types.d.ts +8 -0
  103. package/dist/domain/spec/model/entity-types.js +1 -0
  104. package/dist/domain/spec/model/index.d.ts +7 -0
  105. package/dist/domain/spec/model/index.js +1 -0
  106. package/dist/domain/spec/model/model-version-key.d.ts +3 -0
  107. package/dist/domain/spec/model/model-version-key.js +1 -0
  108. package/dist/domain/spec/model/names/action-name.d.ts +7 -0
  109. package/dist/domain/spec/model/names/action-name.js +1 -0
  110. package/dist/domain/spec/model/names/alias-name.d.ts +7 -0
  111. package/dist/domain/spec/model/names/alias-name.js +1 -0
  112. package/dist/domain/spec/model/names/entity-or-alias-name.d.ts +8 -0
  113. package/dist/domain/spec/model/names/entity-or-alias-name.js +1 -0
  114. package/dist/domain/spec/model/names/entity-type-name.d.ts +8 -0
  115. package/dist/domain/spec/model/names/entity-type-name.js +1 -0
  116. package/dist/domain/spec/model/names/expression-name.d.ts +6 -0
  117. package/dist/domain/spec/model/names/expression-name.js +1 -0
  118. package/dist/domain/spec/model/names/index.d.ts +9 -0
  119. package/dist/domain/spec/model/names/index.js +1 -0
  120. package/dist/domain/spec/model/names/instance-name.d.ts +7 -0
  121. package/dist/domain/spec/model/names/instance-name.js +1 -0
  122. package/dist/domain/spec/model/names/invariant-name.d.ts +3 -0
  123. package/dist/domain/spec/model/names/invariant-name.js +1 -0
  124. package/dist/domain/spec/model/names/shape-property-name.d.ts +11 -0
  125. package/dist/domain/spec/model/names/shape-property-name.js +1 -0
  126. package/dist/domain/spec/model/names/violation-type-name.d.ts +3 -0
  127. package/dist/domain/spec/model/names/violation-type-name.js +1 -0
  128. package/dist/domain/spec/model/presets.d.ts +30 -0
  129. package/dist/domain/spec/model/presets.js +1 -0
  130. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  131. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +11 -0
  132. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  133. package/dist/phoenix/bin.js +1 -1
  134. package/dist/phoenix/cli.js +1 -1
  135. package/dist/phoenix/commands/deploy.js +1 -1
  136. package/dist/phoenix/commands/dev.js +5 -5
  137. package/dist/phoenix/commands/generated-env-markers.d.ts +1 -0
  138. package/dist/phoenix/commands/generated-env-markers.js +1 -1
  139. package/dist/phoenix/commands/index.d.ts +1 -1
  140. package/dist/phoenix/commands/index.js +1 -1
  141. package/dist/phoenix/lingui/index.d.ts +1 -0
  142. package/dist/phoenix/lingui/index.js +1 -0
  143. package/dist/phoenix/{services → lingui}/lingui.d.ts +5 -2
  144. package/dist/phoenix/lingui/lingui.js +1 -0
  145. package/dist/phoenix/services/application-spec-project-watcher.d.ts +3 -1
  146. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  147. package/dist/phoenix/services/index.d.ts +1 -0
  148. package/dist/phoenix/services/index.js +1 -1
  149. package/dist/phoenix/services/lingui-watcher.js +1 -1
  150. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  151. package/dist/phoenix/services/vite-config.js +1 -1
  152. package/package.json +3 -3
  153. package/dist/phoenix/services/lingui.js +0 -1
  154. /package/dist/{application-spec/core → domain/spec/application}/application-instance.d.ts +0 -0
  155. /package/dist/{application-spec/core → domain/spec/application}/application-instance.js +0 -0
  156. /package/dist/{application-spec/core → domain/spec}/components/component-filter.js +0 -0
  157. /package/dist/{application-spec/core → domain/spec}/components/index.d.ts +0 -0
  158. /package/dist/{application-spec/core → domain/spec}/components/index.js +0 -0
  159. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.d.ts +0 -0
  160. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.js +0 -0
  161. /package/dist/{application-spec/core → domain/spec}/expressions/index.d.ts +0 -0
  162. /package/dist/{application-spec/core → domain/spec}/expressions/index.js +0 -0
  163. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.d.ts +0 -0
  164. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.js +0 -0
  165. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.d.ts +0 -0
  166. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.js +0 -0
  167. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.d.ts +0 -0
  168. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.js +0 -0
package/README.md CHANGED
@@ -103,7 +103,7 @@ The `package.json` `exports` map is the machine-readable list, and the TypeScrip
103
103
  ## Documentation and support
104
104
 
105
105
  - `pnpm phoenix docs -s "<topic>"` searches the bundled documentation; `phoenix docs -r <path>` reads a page.
106
- - `phoenix sync` generates agent skills into `.claude/skills/` and `.agents/skills/`, so coding agents know the project conventions and the CLI.
106
+ - `phoenix sync` generates one `phoenix` skill under `.claude/skills/` and `.agents/skills/`, with task-specific project, CLI, workflow, review, variants and feedback guides linked from its entry point.
107
107
  - The builder docs at [docs.salsita.ai](https://docs.salsita.ai) have the guides for getting started and the CLI reference; Studio is where you sign in and manage projects.
108
108
  - `pnpm phoenix feedback "<message>"` reaches the team directly.
109
109
 
@@ -1,26 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { type EvalMarker } from './markers/eval-marker.js';
3
- import { type MsgMarker } from './markers/msg-marker.js';
4
- /**
5
- * A JSON-serialisable value augmented with Phoenix structural markers:
6
- * `$msg` (i18n) and `$eval` (self-scoped code).
7
- *
8
- * Single shared shape across components, expressions, and defaults — lowered
9
- * either to TypeScript source via {@link stringifyEnhancedJsonValue} or to a
10
- * runtime value via {@link resolveEnhancedJsonValue}.
11
- *
12
- * Which markers are allowed at a given slot is controlled by
13
- * {@link EnhancedJsonValueCaps}, not by the type — all markers parse
14
- * identically, capability checks kick in at lowering time.
15
- */
16
- export type EnhancedJsonValue = string | number | boolean | null | MsgMarker | EvalMarker | EnhancedJsonArray | EnhancedJsonObject;
17
- /** Array form of {@link EnhancedJsonValue} — extracted as a named interface so `z.lazy` can close the recursion. */
18
- export interface EnhancedJsonArray extends ReadonlyArray<EnhancedJsonValue> {
19
- }
20
- /** Object form of {@link EnhancedJsonValue} — extracted for the same reason as {@link EnhancedJsonArray}. */
21
- export interface EnhancedJsonObject {
22
- readonly [key: string]: EnhancedJsonValue;
23
- }
2
+ import { type EnhancedJsonObject, type EnhancedJsonValue } from '#package/domain';
3
+ export { type EnhancedJsonArray, type EnhancedJsonObject, type EnhancedJsonValue, type SelfAccessor, canonicalEnhancedJsonValueKey, } from '#package/domain';
24
4
  /** Historical component-value shape used by domain-spec to import a project module member. */
25
5
  export interface ImportRefShape {
26
6
  readonly $importRef: {
@@ -63,18 +43,9 @@ export declare const CONSTANT_CAPS: EnhancedJsonValueCaps;
63
43
  export interface ImportSink {
64
44
  addImport(module: string, member: string): void;
65
45
  }
66
- /** Runtime `self` accessor — shape-agnostic entity state. */
67
- export type SelfAccessor = object;
68
46
  /**
69
47
  * Type guard that narrows an {@link EnhancedJsonValue} to the generic
70
48
  * {@link EnhancedJsonObject} branch — excludes primitives, arrays, and the
71
49
  * known structural markers (`$eval`, `$msg`).
72
50
  */
73
51
  export declare const isEnhancedJsonObject: (value: EnhancedJsonValue) => value is EnhancedJsonObject;
74
- /**
75
- * Deterministic string key for a value — sorted object keys, JSON-encoded.
76
- * Used by the expression runtime's reference store to preserve an evaluator when the
77
- * underlying value is structurally unchanged (mirrors the content-hash pattern
78
- * used for components).
79
- */
80
- export declare const canonicalEnhancedJsonValueKey: (value: EnhancedJsonValue) => string;
@@ -1 +1 @@
1
- import{z as e}from"zod";import{evalMarkerSchema as r,isEvalMarker as o}from"./markers/eval-marker.js";import{isMsgMarker as t,msgMarkerSchema as n}from"./markers/msg-marker.js";let s=e.object({$importRef:e.object({module:e.string(),member:e.string()}).strict()}).strict();export const isImportRefShaped=e=>s.safeParse(e).success;export const enhancedJsonValueSchema=e.lazy(()=>e.union([e.string(),e.number(),e.boolean(),e.null(),n,r,e.array(enhancedJsonValueSchema),e.record(e.string(),enhancedJsonValueSchema)]));export const CONSTANT_CAPS={selfScoped:!1,localizable:!0};export const isEnhancedJsonObject=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&!t(e)&&!o(e);export const canonicalEnhancedJsonValueKey=e=>{let r=e=>{if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(r);let o={};for(let t of Object.keys(e).sort())o[t]=r(e[t]);return o};return JSON.stringify(r(e))};
1
+ import{z as e}from"zod";import{evalMarkerSchema as o,isEvalMarker as n,isMsgMarker as a,msgMarkerSchema as r}from"#package/domain";export{canonicalEnhancedJsonValueKey}from"#package/domain";let c=e.object({$importRef:e.object({module:e.string(),member:e.string()}).strict()}).strict();export const isImportRefShaped=e=>c.safeParse(e).success;export const enhancedJsonValueSchema=e.lazy(()=>e.union([e.string(),e.number(),e.boolean(),e.null(),r,o,e.array(enhancedJsonValueSchema),e.record(e.string(),enhancedJsonValueSchema)]));export const CONSTANT_CAPS={selfScoped:!1,localizable:!0};export const isEnhancedJsonObject=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&!a(e)&&!n(e);
@@ -1,8 +1,6 @@
1
+ export { ApplicationInstance, FILTER_CRITERION_KEYS, type FilterCriterion, type RelationExpressionParams, type SdkCodeRef, type SdkExpressionImplementation, type SpecComponentFilter as ComponentFilter, isSdkCodeRef, isSdkExpressionImplementation, } from '#package/domain';
1
2
  export * from './application-file.js';
2
- export * from './components/index.js';
3
- export * from './expressions/index.js';
4
3
  export * from './specification-files.js';
5
- export * from './application-instance.js';
6
4
  export * from './spec-diagnostic.js';
7
5
  export * from './enhanced-json-schema.js';
8
6
  export * from './enhanced-json-value.js';
@@ -1 +1 @@
1
- export*from"./application-file.js";export*from"./components/index.js";export*from"./expressions/index.js";export*from"./specification-files.js";export*from"./application-instance.js";export*from"./spec-diagnostic.js";export*from"./enhanced-json-schema.js";export*from"./enhanced-json-value.js";export*from"./eval-expression-parser.js";export*from"./json-schema.js";export*from"./json-value.js";export*from"./markers/index.js";export*from"./phoenix-definitions.js";export*from"./project-path.js";
1
+ export{ApplicationInstance,FILTER_CRITERION_KEYS,isSdkCodeRef,isSdkExpressionImplementation}from"#package/domain";export*from"./application-file.js";export*from"./specification-files.js";export*from"./spec-diagnostic.js";export*from"./enhanced-json-schema.js";export*from"./enhanced-json-value.js";export*from"./eval-expression-parser.js";export*from"./json-schema.js";export*from"./json-value.js";export*from"./markers/index.js";export*from"./phoenix-definitions.js";export*from"./project-path.js";
@@ -1,55 +1,5 @@
1
- import type { JsonSchemaType } from './enhanced-json-schema.js';
2
- /**
3
- * Plain AJV-ready JSON Schema — the output of {@link import('./enhanced-json-schema.js').toRuntimeSchema}.
4
- *
5
- * Identical in structure to `EnhancedJsonSchemaType` except the Phoenix-only
6
- * extensions (`tsType`, `import`, `references`) are gone; those are
7
- * stripped by `stripCustomKeywords` before this type is produced. All `$ref`
8
- * targets are local (`#/$defs/{name}`) — no external references remain. Shapes
9
- * stored under `$defs` are themselves `JsonSchema`s.
10
- *
11
- * Use this type anywhere the runtime AJV shape is required (validators,
12
- * serializers, migration tools). Schema producers (`Shapes`, `CommonTypes`,
13
- * relation inference) keep using `EnhancedJsonSchemaType`.
14
- */
15
- export interface JsonSchema {
16
- readonly id?: string;
17
- readonly $ref?: string;
18
- readonly $schema?: string;
19
- readonly $defs?: Readonly<Record<string, JsonSchema>>;
20
- readonly title?: string;
21
- readonly description?: string;
22
- readonly default?: unknown;
23
- readonly format?: string;
24
- readonly multipleOf?: number;
25
- readonly maximum?: number;
26
- readonly exclusiveMaximum?: boolean;
27
- readonly minimum?: number;
28
- readonly exclusiveMinimum?: boolean;
29
- readonly maxLength?: number;
30
- readonly minLength?: number;
31
- readonly pattern?: string;
32
- readonly additionalItems?: boolean | JsonSchema;
33
- readonly items?: JsonSchema | readonly JsonSchema[];
34
- readonly maxItems?: number;
35
- readonly minItems?: number;
36
- readonly uniqueItems?: boolean;
37
- readonly maxProperties?: number;
38
- readonly minProperties?: number;
39
- readonly required?: readonly string[];
40
- readonly additionalProperties?: boolean | JsonSchema;
41
- readonly definitions?: Readonly<Record<string, JsonSchema>>;
42
- readonly properties?: Readonly<Record<string, JsonSchema>>;
43
- readonly patternProperties?: Readonly<Record<string, JsonSchema>>;
44
- readonly dependencies?: Readonly<Record<string, JsonSchema | readonly string[]>>;
45
- readonly enum?: readonly unknown[];
46
- readonly type?: JsonSchemaType | readonly JsonSchemaType[];
47
- readonly allOf?: readonly JsonSchema[];
48
- readonly anyOf?: readonly JsonSchema[];
49
- readonly oneOf?: readonly JsonSchema[];
50
- readonly not?: JsonSchema;
51
- readonly [k: string]: unknown;
52
- }
1
+ import type { JsonSchema } from '#package/domain';
2
+ export type { JsonSchema } from '#package/domain';
53
3
  /**
54
4
  * Clones `schema` with top-level `required` cleared. Nested object schemas
55
5
  * keep their own `required` arrays — only the outer one is relaxed. Used by
@@ -1,4 +1,4 @@
1
- export * from './eval-marker.js';
1
+ export { EVAL_MARKER_KEY, type EvalMarker, evalMarkerSchema, isEvalMarker } from '#package/domain';
2
2
  export * from './filter-keys.js';
3
3
  export * from './msg-marker.js';
4
4
  export * from './raw-bind-marker.js';
@@ -1 +1 @@
1
- export*from"./eval-marker.js";export*from"./filter-keys.js";export*from"./msg-marker.js";export*from"./raw-bind-marker.js";export*from"./raw-data-ref-marker.js";export*from"./raw-eval-write-marker.js";export*from"./raw-read-marker.js";export*from"./raw-read-write-marker.js";export*from"./raw-write-marker.js";
1
+ export{EVAL_MARKER_KEY,evalMarkerSchema,isEvalMarker}from"#package/domain";export*from"./filter-keys.js";export*from"./msg-marker.js";export*from"./raw-bind-marker.js";export*from"./raw-data-ref-marker.js";export*from"./raw-eval-write-marker.js";export*from"./raw-read-marker.js";export*from"./raw-read-write-marker.js";export*from"./raw-write-marker.js";
@@ -1,31 +1,5 @@
1
- import type { MessageDescriptor } from '@lingui/core';
2
- import { z } from 'zod';
3
- /** Key literal for the `$msg` marker in raw YAML. */
4
- export declare const MSG_MARKER_KEY: '$msg';
5
- /** Key literal for the optional `$msgId` qualifier on `$msg`. */
6
- export declare const MSG_ID_MARKER_KEY: '$msgId';
7
- /**
8
- * YAML marker produced by `$msg: 'text'` / `$msg: 'text', $msgId: 'id'` entries.
9
- * `$msgId` is a qualifier on `$msg`, not a standalone marker.
10
- */
11
- export interface MsgMarker {
12
- readonly $msg: string;
13
- readonly $msgId?: string;
14
- }
15
- /** Zod decoder for {@link MsgMarker}. Strict — rejects extra keys. */
16
- export declare const msgMarkerSchema: z.ZodObject<{
17
- $msg: z.ZodString;
18
- $msgId: z.ZodOptional<z.ZodString>;
19
- }, "strict", z.ZodTypeAny, {
20
- $msg: string;
21
- $msgId?: string | undefined;
22
- }, {
23
- $msg: string;
24
- $msgId?: string | undefined;
25
- }>;
26
- /** Structural type guard for {@link MsgMarker}. */
27
- export declare const isMsgMarker: (value: unknown) => value is MsgMarker;
28
- export declare const createMessageDescriptor: (marker: MsgMarker) => MessageDescriptor;
1
+ import type { MsgMarker } from '#package/domain';
2
+ export { MSG_ID_MARKER_KEY, MSG_MARKER_KEY, type MsgMarker, createMessageDescriptor, isMsgMarker, msgMarkerSchema, } from '#package/domain';
29
3
  /**
30
4
  * Serializes a {@link MsgMarker} to lingui macro source — `` msg`…` `` or
31
5
  * `msg({ id, message })` with `$msgId` — escaping template-literal syntax in
@@ -1 +1 @@
1
- import{generateMessageId as s}from"@lingui/message-utils/generateMessageId";import{z as e}from"zod";export const MSG_MARKER_KEY="$msg";export const MSG_ID_MARKER_KEY="$msgId";export const msgMarkerSchema=e.object({$msg:e.string(),$msgId:e.string().optional()}).strict();export const isMsgMarker=s=>msgMarkerSchema.safeParse(s).success;export const createMessageDescriptor=e=>({id:e.$msgId??s(e.$msg),message:e.$msg});export const stringifyMsgMacroCode=s=>void 0!==s.$msgId?`msg({ id: ${JSON.stringify(s.$msgId)}, message: ${JSON.stringify(s.$msg)} })`:`msg\`${s.$msg.replaceAll("\\","\\\\").replaceAll("`","\\`").replaceAll("${","\\${")}\``;
1
+ export{MSG_ID_MARKER_KEY,MSG_MARKER_KEY,createMessageDescriptor,isMsgMarker,msgMarkerSchema}from"#package/domain";export const stringifyMsgMacroCode=e=>void 0!==e.$msgId?`msg({ id: ${JSON.stringify(e.$msgId)}, message: ${JSON.stringify(e.$msg)} })`:`msg\`${e.$msg.replaceAll("\\","\\\\").replaceAll("`","\\`").replaceAll("${","\\${")}\``;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { type EvalMarker } from './eval-marker.js';
2
+ import { type EvalMarker } from '#package/domain';
3
3
  import { type RawWriteMarker } from './raw-write-marker.js';
4
4
  /**
5
5
  * YAML marker produced by `$eval: '…', $write: 'fieldName'` — computed read via
@@ -1 +1 @@
1
- import{z as r}from"zod";import{EVAL_MARKER_KEY as e}from"./eval-marker.js";import{WRITE_MARKER_KEY as a}from"./raw-write-marker.js";export const rawEvalWriteMarkerSchema=r.object({[e]:r.string(),[a]:r.string()}).strict();export const isRawEvalWriteMarker=r=>rawEvalWriteMarkerSchema.safeParse(r).success;
1
+ import{z as r}from"zod";import{EVAL_MARKER_KEY as a}from"#package/domain";import{WRITE_MARKER_KEY as e}from"./raw-write-marker.js";export const rawEvalWriteMarkerSchema=r.object({[a]:r.string(),[e]:r.string()}).strict();export const isRawEvalWriteMarker=r=>rawEvalWriteMarkerSchema.safeParse(r).success;
@@ -1 +1 @@
1
- import{z as r}from"zod";import{EVAL_MARKER_KEY as e}from"./eval-marker.js";import{bindMarkerDefinition as t}from"./raw-bind-marker.js";import{READ_MARKER_KEY as i,readMarkerDefinition as o}from"./raw-read-marker.js";import{WRITE_MARKER_KEY as a,writeMarkerDefinition as s}from"./raw-write-marker.js";export const rawReadWriteMarkerSchema=r.object({[i]:r.string(),[a]:r.string()}).strict();export const isRawReadWriteMarker=r=>rawReadWriteMarkerSchema.safeParse(r).success;export const readWriteMarkerDefinition={anyOf:[t,{type:"object",properties:{...o.properties??{},...s.properties??{}},required:o.required,additionalProperties:!1},{type:"object",properties:{[e]:{type:"string"},...s.properties??{}},required:[e,...s.required??[]],additionalProperties:!1}]};
1
+ import{z as r}from"zod";import{EVAL_MARKER_KEY as e}from"#package/domain";import{bindMarkerDefinition as t}from"./raw-bind-marker.js";import{READ_MARKER_KEY as i,readMarkerDefinition as o}from"./raw-read-marker.js";import{WRITE_MARKER_KEY as a,writeMarkerDefinition as p}from"./raw-write-marker.js";export const rawReadWriteMarkerSchema=r.object({[i]:r.string(),[a]:r.string()}).strict();export const isRawReadWriteMarker=r=>rawReadWriteMarkerSchema.safeParse(r).success;export const readWriteMarkerDefinition={anyOf:[t,{type:"object",properties:{...o.properties??{},...p.properties??{}},required:o.required,additionalProperties:!1},{type:"object",properties:{[e]:{type:"string"},...p.properties??{}},required:[e,...p.required??[]],additionalProperties:!1}]};
@@ -1,6 +1,6 @@
1
- import{GeneratedApplicationFile as e}from"../../core/index.js";import{followsCanaryBuilds as r,generateApplicationSpecEslintConfig as t,generateApplicationSpecFavicon as i,generateApplicationSpecGitignore as n,generateApplicationSpecPrettierConfig as a,generateApplicationSpecRobotsTxt as o,generateApplicationSpecRootTsconfig as l,generateApplicationSpecTsconfig as s,generateLinguiRcFile as c,generatePhoenixCliSkill as f,generatePhoenixCreateConfiguratorSkill as p,generatePhoenixCreateConfiguratorSkillReferences as d,generatePhoenixFeedbackSkill as m,generatePhoenixReviewSkill as g,generatePhoenixSkill as h,generatePhoenixVariantsSkill as u,stripSdkMarkerContent as j}from"./templates/index.js";export const agentSkillRoots=[".claude/skills",".agents/skills"];let x=[{path:"CLAUDE.md",generatedPrefix:""},{path:".cursor/rules/phoenix.mdc",generatedPrefix:`---
1
+ import{GeneratedApplicationFile as e}from"../../core/index.js";import{followsCanaryBuilds as i,generateApplicationSpecEslintConfig as r,generateApplicationSpecFavicon as t,generateApplicationSpecGitignore as a,generateApplicationSpecPrettierConfig as o,generateApplicationSpecRobotsTxt as n,generateApplicationSpecRootTsconfig as l,generateApplicationSpecTsconfig as s,generateLinguiRcFile as c,generatePhoenixSkillBundle as d,stripSdkMarkerContent as f}from"./templates/index.js";export const agentSkillRoots=[".claude/skills",".agents/skills"];let p=[{path:"CLAUDE.md",generatedPrefix:""},{path:".cursor/rules/phoenix.mdc",generatedPrefix:`---
2
2
  description: Phoenix SDK project rules
3
3
  globs:
4
4
  alwaysApply: true
5
5
  ---
6
- `}],P=[".claude/commands/review.md",".cursor/commands/review.md"],v=(e,r)=>e.projectFiles.find(e=>e.file.name===r)?.file.content;export const generateProjectScaffolding=F=>{let E,G,{applicationSpec:b,categorizedFiles:k,sdkVersion:w,projectInGitRepository:L=!0,cliUseWorkspace:S}=F,$=v(k,".gitignore"),y=void 0!==S?S:b.appMetadata.workspace,C=(r=>{let t=[],i=[...P];for(let{path:n,generatedPrefix:a}of x){let o=v(r,n);if(void 0===o)continue;let l=j(o,a);void 0===l?i.push(n):l!==o&&t.push(e(n,l,{format:!1}))}return{strippedFiles:t,removedFiles:i}})(k),M={generatedProjectFiles:(E=[{file:e("tsconfig.json",l()),hasEarlierGenerated:k.hasEarlierGeneratedTsconfig},{file:e("eslint.config.js",t()),hasEarlierGenerated:k.hasEarlierGeneratedEslintConfig},{file:e("prettier.config.js",a()),hasEarlierGenerated:k.hasEarlierGeneratedPrettierConfig}]).filter(e=>e.hasEarlierGenerated).map(e=>e.file),initialProjectFiles:E.filter(e=>!e.hasEarlierGenerated).map(e=>e.file)};return{phoenixFiles:[e("tsconfig.json",s()),e(".linguirc",c(b.configurator.ui.availableLocales),{format:!1})],generatedProjectFiles:[...M.generatedProjectFiles,...L?[e(".gitignore",n($))]:[],...(G=[{name:"phoenix",content:h({checkLatestCanary:r({useWorkspace:y,sdkVersion:w})}),references:[]},{name:"phoenix-cli",content:f(),references:[]},{name:"phoenix-create-configurator",content:p(),references:d()},{name:"phoenix-feedback",content:m(),references:[]},{name:"phoenix-review",content:g(),references:[]},{name:"phoenix-variants",content:u(),references:[]}],agentSkillRoots.flatMap(r=>G.flatMap(t=>[e(`${r}/${t.name}/SKILL.md`,t.content),...t.references.map(i=>e(`${r}/${t.name}/${i.path}`,i.content))]))),...C.strippedFiles],initialProjectFiles:[...M.initialProjectFiles,e("public/favicon.ico",i(),{binary:!0}),e("public/robots.txt",o(),{format:!1})],removedProjectFiles:C.removedFiles}};
6
+ `}],g=[".claude/commands/review.md",".cursor/commands/review.md"],m=(e,i)=>e.projectFiles.find(e=>e.file.name===i)?.file.content;export const generateProjectScaffolding=h=>{let u,j,{applicationSpec:x,categorizedFiles:P,sdkVersion:F,projectInGitRepository:E=!0,cliUseWorkspace:v}=h,G=m(P,".gitignore"),b=void 0!==v?v:x.appMetadata.workspace,k=(i=>{let r=[],t=[...g];for(let{path:a,generatedPrefix:o}of p){let n=m(i,a);if(void 0===n)continue;let l=f(n,o);void 0===l?t.push(a):l!==n&&r.push(e(a,l,{format:!1}))}return{strippedFiles:r,removedFiles:t}})(P),L={generatedProjectFiles:(u=[{file:e("tsconfig.json",l()),hasEarlierGenerated:P.hasEarlierGeneratedTsconfig},{file:e("eslint.config.js",r()),hasEarlierGenerated:P.hasEarlierGeneratedEslintConfig},{file:e("prettier.config.js",o()),hasEarlierGenerated:P.hasEarlierGeneratedPrettierConfig}]).filter(e=>e.hasEarlierGenerated).map(e=>e.file),initialProjectFiles:u.filter(e=>!e.hasEarlierGenerated).map(e=>e.file)};return{phoenixFiles:[e("tsconfig.json",s()),e(".linguirc",c(x.configurator.ui.availableLocales),{format:!1})],generatedProjectFiles:[...L.generatedProjectFiles,...E?[e(".gitignore",a(G))]:[],...(j=d({checkLatestCanary:i({useWorkspace:b,sdkVersion:F})}),agentSkillRoots.flatMap(i=>[e(`${i}/phoenix/SKILL.md`,j.content),...j.references.map(r=>e(`${i}/phoenix/${r.path}`,r.content))])),...k.strippedFiles],initialProjectFiles:[...L.initialProjectFiles,e("public/favicon.ico",t(),{binary:!0}),e("public/robots.txt",n(),{format:!1})],removedProjectFiles:k.removedFiles}};
@@ -37,12 +37,8 @@ export { generateApplicationSpecGlobals } from './globals.js';
37
37
  export { generateApplicationSpecHtmlAdminIndex } from './html-admin-index.js';
38
38
  export { generateApplicationSpecHtmlIndex } from './html-index.js';
39
39
  export { generateLinguiRcFile } from './lingui-rc.js';
40
- export { generatePhoenixCliSkill } from './skills/phoenix-cli-skill.js';
41
- export { generatePhoenixCreateConfiguratorSkill, generatePhoenixCreateConfiguratorSkillReferences, } from './skills/phoenix-create-configurator-skill.js';
42
- export { generatePhoenixFeedbackSkill } from './skills/phoenix-feedback-skill.js';
43
- export { generatePhoenixReviewSkill } from './skills/phoenix-review-skill.js';
44
- export { type PhoenixSkillOptions, followsCanaryBuilds, generatePhoenixSkill } from './skills/phoenix-skill.js';
45
- export { generatePhoenixVariantsSkill } from './skills/phoenix-variants-skill.js';
40
+ export { generatePhoenixSkillBundle } from './skills/phoenix-skill-bundle.js';
41
+ export { type PhoenixSkillOptions, followsCanaryBuilds } from './skills/phoenix-skill.js';
46
42
  export { generateApplicationSpecPrettierConfig } from './prettier-config.js';
47
43
  export { generateApplicationSpecRobotsTxt } from './robots-txt.js';
48
44
  export { generateApplicationSpecRootTsconfig } from './root-tsconfig.js';
@@ -1 +1 @@
1
- export{stripSdkMarkerContent}from"./common/strip-sdk-marker-content.js";export{generateApplicationSpecAdminConfig}from"./admin-config.js";export{generateApplicationSpecAdminCode}from"./admin-domain-code.js";export{generateApplicationSpecAdminFrontendCode}from"./admin-frontend-code.js";export{generateAdminGlobalBindingBlock,generateApplicationSpecAdminGlobals}from"./admin-globals.js";export{generateApplicationSpecTypesModule}from"./application-types.js";export{generateApplicationSpecAdminFile}from"./admin.js";export{generateApplicationSpecConfiguratorConfig}from"./configurator-config.js";export{generateApplicationSpecConfiguratorCode}from"./configurator-domain-code.js";export{generateApplicationSpecConfiguratorFrontendCode}from"./configurator-frontend-code.js";export{generateApplicationSpecConfiguratorGlobals,generateConfiguratorGlobalBindingBlock}from"./configurator-globals.js";export{generateApplicationSpecConfiguratorFile}from"./configurator.js";export{generateApplicationSpecDomainSpecFile}from"./domain-spec.js";export{generateImportedStateConstants,generatePhxExportsBlock,generatePhxGlobalsBlock,generateStateConstants}from"./domain-spec/index.js";export{generateApplicationSpecDomainFile}from"./domain.js";export{generateApplicationSpecEditorFile}from"./editor.js";export{generateApplicationSpecEmbeddedAdmin}from"./embedded-admin.js";export{generateApplicationSpecEmbeddedConfigurator}from"./embedded-configurator.js";export{generateApplicationSpecEslintConfig}from"./eslint-config.js";export{generateApplicationSpecFavicon}from"./favicon.js";export{generateApplicationSpecFrontendConfig}from"./frontend-config.js";export{generateApplicationSpecGitignore}from"./gitignore.js";export{generateApplicationSpecGlobals}from"./globals.js";export{generateApplicationSpecHtmlAdminIndex}from"./html-admin-index.js";export{generateApplicationSpecHtmlIndex}from"./html-index.js";export{generateLinguiRcFile}from"./lingui-rc.js";export{generatePhoenixCliSkill}from"./skills/phoenix-cli-skill.js";export{generatePhoenixCreateConfiguratorSkill,generatePhoenixCreateConfiguratorSkillReferences}from"./skills/phoenix-create-configurator-skill.js";export{generatePhoenixFeedbackSkill}from"./skills/phoenix-feedback-skill.js";export{generatePhoenixReviewSkill}from"./skills/phoenix-review-skill.js";export{followsCanaryBuilds,generatePhoenixSkill}from"./skills/phoenix-skill.js";export{generatePhoenixVariantsSkill}from"./skills/phoenix-variants-skill.js";export{generateApplicationSpecPrettierConfig}from"./prettier-config.js";export{generateApplicationSpecRobotsTxt}from"./robots-txt.js";export{generateApplicationSpecRootTsconfig}from"./root-tsconfig.js";export{generateApplicationSpecStoryDevDeclaration,generateApplicationSpecStoryPhxModule,generateApplicationSpecStoryRawProjectFiles,generateApplicationSpecStoryWrapper}from"./story/index.js";export{generateApplicationSpecCodeFile}from"./spec-code/index.js";export{generateApplicationSpecMessagesFile}from"./spec-messages/index.js";export{generateApplicationSpecTsconfig}from"./tsconfig.js";export{generateApplicationSpecWebhookBuilders}from"./webhook-builders.js";export{generateApplicationSpecWebhookIndex}from"./webhook-index.js";export{generateApplicationSpecWebhooksConfig}from"./webhooks-config.js";
1
+ export{stripSdkMarkerContent}from"./common/strip-sdk-marker-content.js";export{generateApplicationSpecAdminConfig}from"./admin-config.js";export{generateApplicationSpecAdminCode}from"./admin-domain-code.js";export{generateApplicationSpecAdminFrontendCode}from"./admin-frontend-code.js";export{generateAdminGlobalBindingBlock,generateApplicationSpecAdminGlobals}from"./admin-globals.js";export{generateApplicationSpecTypesModule}from"./application-types.js";export{generateApplicationSpecAdminFile}from"./admin.js";export{generateApplicationSpecConfiguratorConfig}from"./configurator-config.js";export{generateApplicationSpecConfiguratorCode}from"./configurator-domain-code.js";export{generateApplicationSpecConfiguratorFrontendCode}from"./configurator-frontend-code.js";export{generateApplicationSpecConfiguratorGlobals,generateConfiguratorGlobalBindingBlock}from"./configurator-globals.js";export{generateApplicationSpecConfiguratorFile}from"./configurator.js";export{generateApplicationSpecDomainSpecFile}from"./domain-spec.js";export{generateImportedStateConstants,generatePhxExportsBlock,generatePhxGlobalsBlock,generateStateConstants}from"./domain-spec/index.js";export{generateApplicationSpecDomainFile}from"./domain.js";export{generateApplicationSpecEditorFile}from"./editor.js";export{generateApplicationSpecEmbeddedAdmin}from"./embedded-admin.js";export{generateApplicationSpecEmbeddedConfigurator}from"./embedded-configurator.js";export{generateApplicationSpecEslintConfig}from"./eslint-config.js";export{generateApplicationSpecFavicon}from"./favicon.js";export{generateApplicationSpecFrontendConfig}from"./frontend-config.js";export{generateApplicationSpecGitignore}from"./gitignore.js";export{generateApplicationSpecGlobals}from"./globals.js";export{generateApplicationSpecHtmlAdminIndex}from"./html-admin-index.js";export{generateApplicationSpecHtmlIndex}from"./html-index.js";export{generateLinguiRcFile}from"./lingui-rc.js";export{generatePhoenixSkillBundle}from"./skills/phoenix-skill-bundle.js";export{followsCanaryBuilds}from"./skills/phoenix-skill.js";export{generateApplicationSpecPrettierConfig}from"./prettier-config.js";export{generateApplicationSpecRobotsTxt}from"./robots-txt.js";export{generateApplicationSpecRootTsconfig}from"./root-tsconfig.js";export{generateApplicationSpecStoryDevDeclaration,generateApplicationSpecStoryPhxModule,generateApplicationSpecStoryRawProjectFiles,generateApplicationSpecStoryWrapper}from"./story/index.js";export{generateApplicationSpecCodeFile}from"./spec-code/index.js";export{generateApplicationSpecMessagesFile}from"./spec-messages/index.js";export{generateApplicationSpecTsconfig}from"./tsconfig.js";export{generateApplicationSpecWebhookBuilders}from"./webhook-builders.js";export{generateApplicationSpecWebhookIndex}from"./webhook-index.js";export{generateApplicationSpecWebhooksConfig}from"./webhooks-config.js";
@@ -0,0 +1,10 @@
1
+ import { type AgentSkillReference } from './agent-skill.js';
2
+ import { type PhoenixSkillOptions } from './phoenix-skill.js';
3
+ /** The discoverable entry point and the documents it ships beside it. */
4
+ interface PhoenixSkillBundle {
5
+ readonly content: string;
6
+ readonly references: readonly AgentSkillReference[];
7
+ }
8
+ /** Keeps the existing generators as content owners while changing only discovery and relative routing. */
9
+ export declare const generatePhoenixSkillBundle: (options: PhoenixSkillOptions) => PhoenixSkillBundle;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import{renderAgentSkill as e}from"./agent-skill.js";import{generatePhoenixCliSkill as t}from"./phoenix-cli-skill.js";import{generatePhoenixCreateConfiguratorSkill as n,generatePhoenixCreateConfiguratorSkillReferences as r}from"./phoenix-create-configurator-skill.js";import{generatePhoenixFeedbackSkill as i}from"./phoenix-feedback-skill.js";import{generatePhoenixReviewSkill as o}from"./phoenix-review-skill.js";import{generatePhoenixSkill as a}from"./phoenix-skill.js";import{generatePhoenixVariantsSkill as s}from"./phoenix-variants-skill.js";let l=(e,t,n)=>n.reduce((e,n)=>{let r="../".repeat(t.split("/").length-2),i=`[${n.title}](${r}${n.path.slice(11)})`;return e.replaceAll(`\`${n.name}\` skill`,i).replaceAll(`${n.name} skill`,i)},e),c=e=>{let t="\n---\n\n",n=e.content.indexOf(t),r=e.content.slice(0,n).split("\n").find(e=>e.startsWith("description: "));if(-1===n||void 0===r)throw Error(`Cannot emit the ${e.name} guide: its skill frontmatter is missing. Render it with renderAgentSkill.`);return{description:r.slice(13),body:e.content.slice(n+t.length)}};export const generatePhoenixSkillBundle=h=>{let p=[{name:"phoenix",title:"Project guidance",path:"references/project.md",content:a(h),references:[]},{name:"phoenix-create-configurator",title:"Configurator workflow",path:"references/create-configurator/guide.md",content:n(),references:r()},{name:"phoenix-cli",title:"CLI guide",path:"references/cli.md",content:t(),references:[]},{name:"phoenix-review",title:"Code review guide",path:"references/review.md",content:o(),references:[]},{name:"phoenix-variants",title:"Variants guide",path:"references/variants.md",content:s(),references:[]},{name:"phoenix-feedback",title:"Feedback guide",path:"references/feedback.md",content:i(),references:[]}];return{content:e({name:"phoenix",description:"Build, change, inspect, deploy or review a Phoenix configurator project. Use for Phoenix project work, visual alternatives, and platform feedback.",sections:[`# Phoenix
2
+
3
+ Load the guides for the work in hand before doing that work. Several may apply. Follow their existing instructions; this entry point only routes to them. Reuse guidance already read in the conversation unless sync or an SDK update changed it.`,`## Choose the relevant guidance
4
+
5
+ | When | Read |
6
+ | --- | --- |
7
+ ${p.map(e=>`| ${c(e).description} | [${e.title}](${e.path}) |`).join("\n")}`,"The workflow guide links to product discovery, asset conversion, UX guidance and appearance review at the stages that use them. An isolated code fix needs project guidance and the applicable CLI/review guides; it does not restart the configurator workflow.\n\nEarlier Phoenix skill names refer to these guides: ask for the same task through `phoenix`. Read linked documents when their task applies, not the whole reference tree."]}),references:p.flatMap(e=>[{path:e.path,content:l(c(e).body,e.path,p)},...e.references.map(t=>{let n=`${e.path.slice(0,e.path.lastIndexOf("/")+1)}${t.path}`;return{path:n,content:l(t.content,n,p)}})])}};
@@ -1 +1 @@
1
- import{renderAgentSkill as e}from"./agent-skill.js";import{sdkGuidanceSections as t}from"./sdk-content.js";export const followsCanaryBuilds=e=>!e.useWorkspace&&e.sdkVersion.includes("-develop.");export const generatePhoenixSkill=({checkLatestCanary:n})=>e({name:"phoenix",description:`Phoenix SDK project conventions, covering project structure, architecture principles, key patterns, file and export rules, webhook membership, versioning the domain model once it is deployed, showing the user the dev preview and the build of a deploy, the run evaluation that follows a live deploy, inspecting the rendered result, and how to search the SDK documentation${n?", and the internal-beta check for the latest canary SDK build":""}. Use before writing or changing specs or source code, or deploying this Phoenix configurator project.`,sections:[t.packageManager,...n?["## Stay on the Latest Canary\nDuring the internal beta this project uses the `canary` build of the SDK, which is published from every change to the platform. Once per conversation, before you change anything, compare the installed version, the `version` in `node_modules/@salsita-ai/sdk/package.json`, with the newest canary:\n```bash\nnpm view @salsita-ai/sdk@canary version\n```\nWhen they differ, tell the user which version you are moving to, then update the SDK, bring the packages it needs next to it in line, and regenerate the project's files:\n```bash\npnpm add @salsita-ai/sdk@canary && pnpm phoenix deps && pnpm install && pnpm phoenix sync\n```\n`sync` rewrites the Phoenix skills, so read the ones you use again after it. When the user runs a globally installed `phoenix`, update that too with `npm install -g @salsita-ai/sdk@canary`. If the project no longer builds after the update, stop and tell the user; the `phoenix-feedback` skill covers reporting it."]:[],t.projectStructure,t.architecturePrinciples,t.keyPatterns,t.fileConventions,t.exportRules,t.webhookMembership,t.doNotEdit,t.modelVersioning,"## Show the Preview While You Work\nThe user should see the configurator change as you build it. Before your first change in a conversation, make sure `pnpm phoenix dev` is running (start it in the background when it is not) and open the address it prints as `Preview: <url>` (also written to `.phoenix/phoenix-dev.log`) in the user's browser: `open '<url>'` on macOS, `xdg-open '<url>'` on Linux, `Start-Process '<url>'` in PowerShell, `start \"\" \"<url>\"` in cmd. Keep the quotes, the shell would otherwise read a `?` in the address as a pattern. The log keeps the lines of earlier runs, so when you have just started dev, wait for the `Preview:` line written after your start and use the last one. Open it once; the preview reloads on every change, so tell the user to keep that tab open instead of opening it again.",t.visualInspection,"## Show the Build After a Deploy\nImmediately before invoking `pnpm phoenix deploy`, refresh `conversation.log` in the project root with the current conversation. Prefer the agent application's native session export when available; do not invent an export command or scan unrelated sessions. Otherwise write the messages still available in context and label the log `reconstructed; incomplete`. Never present a compaction summary as verbatim earlier messages.\n\nUse UTF-8 text with a header naming the agent, export time, source (native export or reconstructed), covered session and known omissions. Preserve user and assistant messages in chronological order, plus tool names, arguments and results when available. Keep each tool result to at most 16 KiB of text, marking truncation explicitly; describe image attachments by reference rather than embedding binary/base64 data, and mark references whose files are not uploaded. Exclude internal instructions, hidden reasoning, credentials and unrelated sensitive content; mark redactions without repeating the removed content. Refresh the current session's log rather than appending duplicate copies or silently carrying over a previous session.\n\nShow the user the exact file to review or redact and obtain approval to include it before deploying; do not ask again when they have already approved that file. If they decline, move it out of the project root before deployment so it cannot be collected. Deploy includes the file in the build's private source archive, downloadable by those authorized to download that build's sources, and leaves it out when extracting build inputs. A missing log warns but does not block deployment. The CLI does not export, redact or validate the transcript's completeness for you.\n\n`pnpm phoenix deploy` starts a build on the server and waits for it to go live. Right after `Build <id> started` it prints `Follow the build in Studio: <url>`. Run the deploy so that you can read its output while it runs, and open that link in the user's browser, quoted as above, as soon as it appears, so they can follow the build they just triggered. When the line is missing, the sign-in is older than the link: tell the user the build is listed under Deployments in Studio, and that `pnpm phoenix login <workspace>` brings the link back.\n\nWhen the deploy reports the configurator live, load the `phoenix-feedback` skill before you write your final message and follow its \"Evaluate the Run\" section, so the user is asked about the run while they are still there. It is asked once per conversation, and only once the user has nothing more to build.","## Code Review\nUse the `phoenix-review` skill to review code changes before committing.",t.sdkDocumentation]});
1
+ import{renderAgentSkill as e}from"./agent-skill.js";import{sdkGuidanceSections as t}from"./sdk-content.js";export const followsCanaryBuilds=e=>!e.useWorkspace&&e.sdkVersion.includes("-develop.");export const generatePhoenixSkill=({checkLatestCanary:n})=>e({name:"phoenix",description:`Phoenix SDK project conventions, covering project structure, architecture principles, key patterns, file and export rules, webhook membership, versioning the domain model once it is deployed, showing the user the dev preview and the build of a deploy, the run evaluation that follows a live deploy, inspecting the rendered result, and how to search the SDK documentation${n?", and the internal-beta check for the latest canary SDK build":""}. Use before writing or changing specs or source code, or deploying this Phoenix configurator project.`,sections:[t.packageManager,...n?["## Stay on the Latest Canary\nDuring the internal beta this project uses the `canary` build of the SDK, which is published from every change to the platform. Once per conversation, before you change anything, compare the installed version, the `version` in `node_modules/@salsita-ai/sdk/package.json`, with the newest canary:\n```bash\nnpm view @salsita-ai/sdk@canary version\n```\nWhen they differ, tell the user which version you are moving to, then update the SDK, bring the packages it needs next to it in line, and regenerate the project's files:\n```bash\npnpm add @salsita-ai/sdk@canary && pnpm phoenix deps && pnpm install && pnpm phoenix sync\n```\n`sync` rewrites the Phoenix skills, so read the ones you use again after it. When the user runs a globally installed `phoenix`, update that too with `npm install -g @salsita-ai/sdk@canary`. If the project no longer builds after the update, stop and tell the user; the `phoenix-feedback` skill covers reporting it."]:[],t.projectStructure,t.architecturePrinciples,t.keyPatterns,t.fileConventions,t.exportRules,t.webhookMembership,t.doNotEdit,t.modelVersioning,"## Show the Preview While You Work\nThe user should see the configurator change as you build it. Before your first change in a conversation, make sure `pnpm phoenix dev` is running (start it in the background when it is not) and open the address it prints as `Preview: <url>` (also written to `.phoenix/phoenix-dev.log`) in the user's browser: `open '<url>'` on macOS, `xdg-open '<url>'` on Linux, `Start-Process '<url>'` in PowerShell, `start \"\" \"<url>\"` in cmd. Keep the quotes, the shell would otherwise read a `?` in the address as a pattern. The log keeps the lines of earlier runs, so when you have just started dev, wait for the `Preview:` line written after your start and use the last one. Open it once; the preview reloads on every change, so tell the user to keep that tab open instead of opening it again. A domain model change is the exception: `pnpm phoenix dev` registers the model with the server only when it starts, and after the change it logs an error that asks for a restart. Restart it, wait for the new `Preview:` line and open that address in place of the old tab, whose address carries the `?cid=` of a configuration saved with the earlier model, which the new model rejects.",t.visualInspection,"## Show the Build After a Deploy\nImmediately before invoking `pnpm phoenix deploy`, refresh `conversation.log` in the project root with the current conversation. Prefer the agent application's native session export when available; do not invent an export command or scan unrelated sessions. Otherwise write the messages still available in context and label the log `reconstructed; incomplete`. Never present a compaction summary as verbatim earlier messages.\n\nUse UTF-8 text with a header naming the agent, export time, source (native export or reconstructed), covered session and known omissions. Preserve user and assistant messages in chronological order, plus tool names, arguments and results when available. Keep each tool result to at most 16 KiB of text, marking truncation explicitly; describe image attachments by reference rather than embedding binary/base64 data, and mark references whose files are not uploaded. Exclude internal instructions, hidden reasoning, credentials and unrelated sensitive content; mark redactions without repeating the removed content. Refresh the current session's log rather than appending duplicate copies or silently carrying over a previous session.\n\nShow the user the exact file to review or redact and obtain approval to include it before deploying; do not ask again when they have already approved that file. If they decline, move it out of the project root before deployment so it cannot be collected. Deploy includes the file in the build's private source archive, downloadable by those authorized to download that build's sources, and leaves it out when extracting build inputs. A missing log warns but does not block deployment. The CLI does not export, redact or validate the transcript's completeness for you.\n\n`pnpm phoenix deploy` starts a build on the server and waits for it to go live. Right after `Build <id> started` it prints `Follow the build in Studio: <url>`. Run the deploy so that you can read its output while it runs, and open that link in the user's browser, quoted as above, as soon as it appears, so they can follow the build they just triggered. When the line is missing, the sign-in is older than the link: tell the user the build is listed under Deployments in Studio, and that `pnpm phoenix login <workspace>` brings the link back.\n\nWhen the deploy reports the configurator live, load the `phoenix-feedback` skill before you write your final message and follow its \"Evaluate the Run\" section, so the user is asked about the run while they are still there. It is asked once per conversation, and only once the user has nothing more to build.","## Code Review\nUse the `phoenix-review` skill to review code changes before committing.",t.sdkDocumentation]});
@@ -1,7 +1,7 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
- import type { AnyEntityReflections, DomainEntity, DomainEntityReflection } from '#package/domain';
2
+ import type { AnyEntityReflections, Defaults, DomainEntity, DomainEntityReflection } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { Defaults, Invariants } from '../../../parse-application-files/index.js';
4
+ import type { Invariants } from '../../../parse-application-files/index.js';
5
5
  import { type RecipeDefaults } from './recipe-defaults.js';
6
6
  import { type StaticViolations } from './static-violations.js';
7
7
  interface FactoryDataRuntimeFields {
@@ -1,4 +1,4 @@
1
- import type { Defaults } from '../../../parse-application-files/index.js';
1
+ import { type Defaults } from '#package/domain';
2
2
  /**
3
3
  * The default property values of each entity type, keyed by entity type: what
4
4
  * `phx.domain.createRecipe` puts into a new recipe before the caller's overrides. Alias entries are
@@ -1 +1 @@
1
- import{createMessageDescriptor as e,isEvalMarker as t,isMsgMarker as r}from"../../../core/index.js";let s=(a,i)=>{if(null===a||"object"!=typeof a)return a;if(r(a))return e(a);if(t(a))throw Error(`The default at ${i} is an $eval expression. Defaults are static values; the parser rejects $eval in them, so the spec given to the runtime was not produced by it. Parse the spec again and pass the result.`);return Array.isArray(a)?a.map((e,t)=>s(e,`${i}[${t}]`)):Object.fromEntries(Object.entries(a).map(([e,t])=>[e,s(t,`${i}.${e}`)]))};export const createRecipeDefaults=e=>Object.fromEntries(Object.entries(e.entries).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([t,r])=>[t,s(r,`${e}.${t}`)]))]));
1
+ import{createMessageDescriptor as e,isEvalMarker as t,isMsgMarker as r}from"#package/domain";let a=(s,i)=>{if(null===s||"object"!=typeof s)return s;if(r(s))return e(s);if(t(s))throw Error(`The default at ${i} is an $eval expression. Defaults are static values; the parser rejects $eval in them, so the spec given to the runtime was not produced by it. Parse the spec again and pass the result.`);return Array.isArray(s)?s.map((e,t)=>a(e,`${i}[${t}]`)):Object.fromEntries(Object.entries(s).map(([e,t])=>[e,a(t,`${i}.${e}`)]))};export const createRecipeDefaults=e=>Object.fromEntries(Object.entries(e.entries).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([t,r])=>[t,a(r,`${e}.${t}`)]))]));
@@ -1,4 +1,4 @@
1
- import type { Violation } from '#package/domain';
1
+ import { type Violation } from '#package/domain';
2
2
  import type { Invariants } from '../../../parse-application-files/index.js';
3
3
  /**
4
4
  * The violation each static invariant of a domain reports when its implementation returns `false`,
@@ -1 +1 @@
1
- import{createMessageDescriptor as t}from"../../../core/index.js";export const createStaticViolations=e=>{let i={};for(let[o,r]of Object.entries(e.entries))for(let e of Object.values(r)){if("static"!==e.kind)continue;let r={type:String(e.violationType),severity:e.severity,message:"string"==typeof e.message?e.message:t(e.message),...void 0===e.controlViolationPriority?{}:{controlViolationPriority:e.controlViolationPriority}};i[o]={...i[o],[String(e.name)]:r}}return i};
1
+ import{createMessageDescriptor as t}from"#package/domain";export const createStaticViolations=e=>{let i={};for(let[o,r]of Object.entries(e.entries))for(let e of Object.values(r)){if("static"!==e.kind)continue;let r={type:String(e.violationType),severity:e.severity,message:"string"==typeof e.message?e.message:t(e.message),...void 0===e.controlViolationPriority?{}:{controlViolationPriority:e.controlViolationPriority}};i[o]={...i[o],[String(e.name)]:r}}return i};
@@ -1,2 +1,2 @@
1
- import { ApplicationInstance } from '../../core/index.js';
1
+ import { ApplicationInstance } from '#package/domain';
2
2
  export declare const generateRuntimeInstance: (applicationInstance: ApplicationInstance) => ApplicationInstance;
@@ -1 +1 @@
1
- import{ApplicationInstance as e}from"../../core/index.js";export const generateRuntimeInstance=n=>e(n.applicationVersion);
1
+ import{ApplicationInstance as e}from"#package/domain";export const generateRuntimeInstance=n=>e(n.applicationVersion);
@@ -1 +1 @@
1
- import{Branded as e}from"@salsita-ai/common/utils";import{DomainComponentOpticBuilder as t,adminSidebarComponent as a,attributeSelectionComponent as i,componentsByName as r,composedOfComponent as n,navigationPageComponent as o,navigationPanelListComponent as d,referenceComponent as c}from"#package/domain";import*as m from"#package/domain";import{FILTER_CRITERION_KEYS as s,isSdkCodeRef as l}from"../../../core/index.js";import{specCodeComponentKey as g,specCodeFilterId as p}from"../../runtime-spec/index.js";import{resolveSpecCode as R}from"../spec-code/index.js";let A=new Map([["reference",c],["composedOf",n],["adminSidebar",a],["attributeSelection",i],["navigationPage",o],["navigationPanelList",d]]),f={createAdminCustomPageRead:m.createAdminCustomPageRead,createAdminCustomSidebarRead:m.createAdminCustomSidebarRead,createAdminDataPageRead:m.createAdminDataPageRead,createAdminDataTableSidebarRead:m.createAdminDataTableSidebarRead,createAdminNavigationPanelRead:m.createAdminNavigationPanelRead,createAdminPresetCategoryPageRead:m.createAdminPresetCategoryPageRead,createAdminPresetCategorySelectionRead:m.createAdminPresetCategorySelectionRead,createAdminPresetCategorySelectionWrite:m.createAdminPresetCategorySelectionWrite,createAdminPresetCategorySidebarRead:m.createAdminPresetCategorySidebarRead,createAdminPresetListPageRead:m.createAdminPresetListPageRead,createAdminPresetSidebarRead:m.createAdminPresetSidebarRead,createAdminRecipeCollectionPageRead:m.createAdminRecipeCollectionPageRead,createAdminRecipeSidebarRead:m.createAdminRecipeSidebarRead},u=(e,t)=>{let a=f[e.sdkFunction]??m[e.sdkFunction];if("function"!=typeof a)throw Error(`SDK factory function "${e.sdkFunction}" not found. Make sure it is exported from the package.`);return a(...e.params.map(e=>{if(l(e)){let a=t.entities[e.$codeRef]??t.aliasReflections[e.$codeRef];if(!a)throw Error(`Reflection "${e.$codeRef}" not found in ModelRuntime. This is a bug — the target was validated at parse time.`);return a}return e}))};export const buildSdkOptic=(a,i,n,o,d)=>{let c=t.from(n),m=r.get(a.componentName)??A.get(a.componentName);if(!m)throw Error(`SDK component "${a.componentName}" not found. This is a bug — the component was validated at parse time.`);let l=c.withComponent(m,a.instanceName,!0),f=a.isAlias?l.withAlias(String(a.typeOrAlias)):l.withEntity(String(a.typeOrAlias)),P=g(String(a.typeOrAlias),String(a.instanceName),a.componentName);for(let[e,t]of i.filters.items.entries()){if("root"===t.kind){let e=t.target,a=t=>t[e];f=f.withFilter(a);continue}let a={};for(let i of s){let r=t[i];void 0!==r&&("dynamic"===r.kind?a[i]=e=>e[r.target]:"eval"===r.kind?a[i]=R(d,p(P,e,i,r.code),r.code):a[i]=r.value)}f=f.withGradualFilter(a)}let S=u(i.readFactory,o),y=u(i.writeFactory,o),b=f.attach(S,y);return e({typeOrAlias:String(a.typeOrAlias),componentName:a.componentName,instanceName:String(a.instanceName),optic:b})};
1
+ import{Branded as e}from"@salsita-ai/common/utils";import{DomainComponentOpticBuilder as t,FILTER_CRITERION_KEYS as a,adminSidebarComponent as i,attributeSelectionComponent as r,componentsByName as n,composedOfComponent as o,isSdkCodeRef as d,navigationPageComponent as c,navigationPanelListComponent as m,referenceComponent as s}from"#package/domain";import*as l from"#package/domain";import{specCodeComponentKey as g,specCodeFilterId as p}from"../../runtime-spec/index.js";import{resolveSpecCode as R}from"../spec-code/index.js";let A=new Map([["reference",s],["composedOf",o],["adminSidebar",i],["attributeSelection",r],["navigationPage",c],["navigationPanelList",m]]),f={createAdminCustomPageRead:l.createAdminCustomPageRead,createAdminCustomSidebarRead:l.createAdminCustomSidebarRead,createAdminDataPageRead:l.createAdminDataPageRead,createAdminDataTableSidebarRead:l.createAdminDataTableSidebarRead,createAdminNavigationPanelRead:l.createAdminNavigationPanelRead,createAdminPresetCategoryPageRead:l.createAdminPresetCategoryPageRead,createAdminPresetCategorySelectionRead:l.createAdminPresetCategorySelectionRead,createAdminPresetCategorySelectionWrite:l.createAdminPresetCategorySelectionWrite,createAdminPresetCategorySidebarRead:l.createAdminPresetCategorySidebarRead,createAdminPresetListPageRead:l.createAdminPresetListPageRead,createAdminPresetSidebarRead:l.createAdminPresetSidebarRead,createAdminRecipeCollectionPageRead:l.createAdminRecipeCollectionPageRead,createAdminRecipeSidebarRead:l.createAdminRecipeSidebarRead},u=(e,t)=>{let a=f[e.sdkFunction]??l[e.sdkFunction];if("function"!=typeof a)throw Error(`SDK factory function "${e.sdkFunction}" not found. Make sure it is exported from the package.`);return a(...e.params.map(e=>{if(d(e)){let a=t.entities[e.$codeRef]??t.aliasReflections[e.$codeRef];if(!a)throw Error(`Reflection "${e.$codeRef}" not found in ModelRuntime. This is a bug — the target was validated at parse time.`);return a}return e}))};export const buildSdkOptic=(i,r,o,d,c)=>{let m=t.from(o),s=n.get(i.componentName)??A.get(i.componentName);if(!s)throw Error(`SDK component "${i.componentName}" not found. This is a bug — the component was validated at parse time.`);let l=m.withComponent(s,i.instanceName,!0),f=i.isAlias?l.withAlias(String(i.typeOrAlias)):l.withEntity(String(i.typeOrAlias)),P=g(String(i.typeOrAlias),String(i.instanceName),i.componentName);for(let[e,t]of r.filters.items.entries()){if("root"===t.kind){let e=t.target,a=t=>t[e];f=f.withFilter(a);continue}let i={};for(let r of a){let a=t[r];void 0!==a&&("dynamic"===a.kind?i[r]=e=>e[a.target]:"eval"===a.kind?i[r]=R(c,p(P,e,r,a.code),a.code):i[r]=a.value)}f=f.withGradualFilter(i)}let S=u(r.readFactory,d),y=u(r.writeFactory,d),b=f.attach(S,y);return e({typeOrAlias:String(i.typeOrAlias),componentName:i.componentName,instanceName:String(i.instanceName),optic:b})};
@@ -1,5 +1,5 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
- import type { DomainEntity, Expression as DomainExpression, Invariant as DomainInvariant, ImplementationErrorCollector, ProjectModule } from '#package/domain';
2
+ import { type DomainEntity, type Expression as DomainExpression, type Invariant as DomainInvariant, type ImplementationErrorCollector, type ProjectModule } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
4
  import type { Expressions } from '../../../parse-application-files/index.js';
5
5
  import { type RuntimeModelVersion } from '../../runtime-spec/index.js';
@@ -1 +1 @@
1
- import e from"lodash-es/isEqual.js";import{Branded as t}from"@salsita-ai/common/utils";import{ImplementationError as i,createRelationFactory as n,mergeExpressionModules as a}from"#package/domain";import{canonicalEnhancedJsonValueKey as r,isSdkExpressionImplementation as o}from"../../../core/index.js";import{specCodeExpressionKey as l}from"../../runtime-spec/index.js";import{generateMemoEvalPlanRuntime as s}from"./generate-memo-eval-plan-runtime.js";let p={},m=["0-1","1-1","0-N","1-N"],d={relation:(e,t)=>{let i=t[0];if(!("object"==typeof i&&null!==i&&"kind"in i&&"target"in i&&"string"==typeof i.target&&"cardinality"in i&&m.includes(i.cardinality)&&("allOfType"===i.kind||("direct"===i.kind||"indirect"===i.kind)&&"field"in i&&"string"==typeof i.field)))throw Error("Cannot create the relation expression because its parameter is not a relation declaration. The application spec is inconsistent; rebuild it from a valid relations declaration.");return n(e.aliasMap)(i)},violations:(e,t)=>{let i=t[0];if("object"!=typeof i||null===i||!("entityType"in i)||"string"!=typeof i.entityType)throw Error("Cannot create the violations expression because its entityType parameter is missing. The application spec is inconsistent; rebuild it from a valid invariants declaration.");let n=i.entityType,a=Object.entries(e.invariantImplementations).flatMap(([t,i])=>{let a=e.aliasMap[t];return t===n||a?.includes(n)?i:[]});return{origin:{name:"$violations",typeOrAlias:n},evaluate:(e,t,i)=>a.flatMap(n=>n.evaluate(e,t,i)),meta:{}}}},f=e=>{let t=s(e.plan,l(e.entityOrAlias,e.name),e.code);return{origin:{name:e.name,typeOrAlias:e.entityOrAlias},evaluate:(e,i,n)=>t(n.domain.get$Entity(e,i),i,n),meta:{}}},u=e=>({...(0,d[e.kind])({aliasMap:e.aliasMap,invariantImplementations:e.invariantImplementations},e.params),origin:{name:e.name,typeOrAlias:e.entityOrAlias}});export const ExpressionRuntime=(n,l,s,m,d=p,c,g,y={})=>{let v={};for(let[e,t]of n.latestModel.aliases)v[String(e)]=t.map(String);let x={...y};for(let[e,t]of Object.entries(a(s,v,g,((e,t,i)=>{let n=new Map,a=(e,t)=>{n.set(e,(n.get(e)??new Set).add(t))};for(let[i,n]of e.expressions.expressions)for(let[e,r]of n)if("user"!==r.implementation.kind)for(let n of t[String(i)]??[String(i)])a(n,String(e));for(let[e,t]of Object.entries(i))for(let i of Object.keys(t))a(e,i);return n})(n,v,y))))x[e]={...x[e],...t};let S=l.createBuilder(`${m}/sdk`,{build:u,getKey:e=>`sdk::${e.entityOrAlias}::${e.name}`,compare:(t,i)=>t.kind===i.kind&&e(t.params,i.params)&&e(t.aliasMap,i.aliasMap)&&("violations"!==i.kind||t.invariantImplementations===i.invariantImplementations)}),h=l.createBuilder(`${m}/user`,{build:e=>e.impl,getKey:e=>`user::${e.entityType}::${e.name}`,compare:(e,t)=>{let i,n;return(i=e.impl)===(n=t.impl)||i.evaluate===n.evaluate&&i.meta===n.meta&&i.origin.name===n.origin.name&&i.origin.typeOrAlias===n.origin.typeOrAlias}}),O=l.createBuilder(`${m}/value`,{build:f,getKey:e=>`value::${e.entityOrAlias}::${e.name}`,compare:(e,t)=>e.valueKey===t.valueKey&&e.code===t.code}),b={},k=!1,$=new Set,M=new Set,j=new Set;for(let[e,t]of n.expressions.expressions)for(let[,i]of t){let t=v[String(e)]??[String(e)];if(o(i.implementation)){let n={entityOrAlias:String(e),name:String(i.name),kind:i.implementation.kind,params:i.implementation.params,aliasMap:v,invariantImplementations:d},a=S.build(n);for(let e of(a.changed&&(k=!0),$.add(S.getKey(n)),t))b[e]||(b[e]={}),b[e][String(i.name)]=a.output;continue}if("value"===i.implementation.kind){let n=i.implementation.value,a={entityOrAlias:String(e),name:String(i.name),valueKey:r(n),plan:i.implementation.plan,code:c},o=O.build(a);for(let e of(o.changed&&(k=!0),j.add(O.getKey(a)),t))b[e]||(b[e]={}),b[e][String(i.name)]=o.output;continue}}for(let[e,t]of Object.entries(x))for(let[i,n]of Object.entries(t)){let t={entityType:e,name:i,impl:n},a=h.build(t);a.changed&&(k=!0),M.add(h.getKey(t)),b[e]||(b[e]={}),b[e][i]=a.output}S.cleanup($)&&(k=!0),h.cleanup(M)&&(k=!0),O.cleanup(j)&&(k=!0);let A=[];for(let[e,t]of n.expressions.entityExpressions)for(let i of t.shapeGroups){let t=n.expressions.expressions.get(i);if(t)for(let[i]of t)b[String(e)]?.[String(i)]||A.push({entityType:String(e),exprName:String(i)})}return A.length>0?(A.forEach(e=>g.add(new i({code:"MISSING_IMPLEMENTATION",origin:null,problem:`Missing implementation of expression ${e.entityType}.${e.exprName}`,fix:"The spec declares it without a value of its own ($eval, $msg or a read), so a project file implements it: a default export of phx.domain.implementCustomExpressions({ ... }) in src/expressions/, or of phx.domain.admin.implementCustomExpressions({ ... }) in src/admin/expressions/ for an admin entity type. Implement it, or remove the declaration from the spec."}))),{ok:!1,missing:A}):{ok:!0,runtime:t({merged:b,changed:k})}};
1
+ import e from"lodash-es/isEqual.js";import{Branded as t}from"@salsita-ai/common/utils";import{ImplementationError as i,canonicalEnhancedJsonValueKey as n,createRelationFactory as a,isSdkExpressionImplementation as r,mergeExpressionModules as o}from"#package/domain";import{specCodeExpressionKey as l}from"../../runtime-spec/index.js";import{generateMemoEvalPlanRuntime as s}from"./generate-memo-eval-plan-runtime.js";let p={},m=["0-1","1-1","0-N","1-N"],d={relation:(e,t)=>{let i=t[0];if(!("object"==typeof i&&null!==i&&"kind"in i&&"target"in i&&"string"==typeof i.target&&"cardinality"in i&&m.includes(i.cardinality)&&("allOfType"===i.kind||("direct"===i.kind||"indirect"===i.kind)&&"field"in i&&"string"==typeof i.field)))throw Error("Cannot create the relation expression because its parameter is not a relation declaration. The application spec is inconsistent; rebuild it from a valid relations declaration.");return a(e.aliasMap)(i)},violations:(e,t)=>{let i=t[0];if("object"!=typeof i||null===i||!("entityType"in i)||"string"!=typeof i.entityType)throw Error("Cannot create the violations expression because its entityType parameter is missing. The application spec is inconsistent; rebuild it from a valid invariants declaration.");let n=i.entityType,a=Object.entries(e.invariantImplementations).flatMap(([t,i])=>{let a=e.aliasMap[t];return t===n||a?.includes(n)?i:[]});return{origin:{name:"$violations",typeOrAlias:n},evaluate:(e,t,i)=>a.flatMap(n=>n.evaluate(e,t,i)),meta:{}}}},f=e=>{let t=s(e.plan,l(e.entityOrAlias,e.name),e.code);return{origin:{name:e.name,typeOrAlias:e.entityOrAlias},evaluate:(e,i,n)=>t(n.domain.get$Entity(e,i),i,n),meta:{}}},u=e=>({...(0,d[e.kind])({aliasMap:e.aliasMap,invariantImplementations:e.invariantImplementations},e.params),origin:{name:e.name,typeOrAlias:e.entityOrAlias}});export const ExpressionRuntime=(a,l,s,m,d=p,c,g,y={})=>{let v={};for(let[e,t]of a.latestModel.aliases)v[String(e)]=t.map(String);let x={...y};for(let[e,t]of Object.entries(o(s,v,g,((e,t,i)=>{let n=new Map,a=(e,t)=>{n.set(e,(n.get(e)??new Set).add(t))};for(let[i,n]of e.expressions.expressions)for(let[e,r]of n)if("user"!==r.implementation.kind)for(let n of t[String(i)]??[String(i)])a(n,String(e));for(let[e,t]of Object.entries(i))for(let i of Object.keys(t))a(e,i);return n})(a,v,y))))x[e]={...x[e],...t};let S=l.createBuilder(`${m}/sdk`,{build:u,getKey:e=>`sdk::${e.entityOrAlias}::${e.name}`,compare:(t,i)=>t.kind===i.kind&&e(t.params,i.params)&&e(t.aliasMap,i.aliasMap)&&("violations"!==i.kind||t.invariantImplementations===i.invariantImplementations)}),h=l.createBuilder(`${m}/user`,{build:e=>e.impl,getKey:e=>`user::${e.entityType}::${e.name}`,compare:(e,t)=>{let i,n;return(i=e.impl)===(n=t.impl)||i.evaluate===n.evaluate&&i.meta===n.meta&&i.origin.name===n.origin.name&&i.origin.typeOrAlias===n.origin.typeOrAlias}}),O=l.createBuilder(`${m}/value`,{build:f,getKey:e=>`value::${e.entityOrAlias}::${e.name}`,compare:(e,t)=>e.valueKey===t.valueKey&&e.code===t.code}),b={},k=!1,$=new Set,M=new Set,A=new Set;for(let[e,t]of a.expressions.expressions)for(let[,i]of t){let t=v[String(e)]??[String(e)];if(r(i.implementation)){let n={entityOrAlias:String(e),name:String(i.name),kind:i.implementation.kind,params:i.implementation.params,aliasMap:v,invariantImplementations:d},a=S.build(n);for(let e of(a.changed&&(k=!0),$.add(S.getKey(n)),t))b[e]||(b[e]={}),b[e][String(i.name)]=a.output;continue}if("value"===i.implementation.kind){let a=i.implementation.value,r={entityOrAlias:String(e),name:String(i.name),valueKey:n(a),plan:i.implementation.plan,code:c},o=O.build(r);for(let e of(o.changed&&(k=!0),A.add(O.getKey(r)),t))b[e]||(b[e]={}),b[e][String(i.name)]=o.output;continue}}for(let[e,t]of Object.entries(x))for(let[i,n]of Object.entries(t)){let t={entityType:e,name:i,impl:n},a=h.build(t);a.changed&&(k=!0),M.add(h.getKey(t)),b[e]||(b[e]={}),b[e][i]=a.output}S.cleanup($)&&(k=!0),h.cleanup(M)&&(k=!0),O.cleanup(A)&&(k=!0);let T=[];for(let[e,t]of a.expressions.entityExpressions)for(let i of t.shapeGroups){let t=a.expressions.expressions.get(i);if(t)for(let[i]of t)b[String(e)]?.[String(i)]||T.push({entityType:String(e),exprName:String(i)})}return T.length>0?(T.forEach(e=>g.add(new i({code:"MISSING_IMPLEMENTATION",origin:null,problem:`Missing implementation of expression ${e.entityType}.${e.exprName}`,fix:"The spec declares it without a value of its own ($eval, $msg or a read), so a project file implements it: a default export of phx.domain.implementCustomExpressions({ ... }) in src/expressions/, or of phx.domain.admin.implementCustomExpressions({ ... }) in src/admin/expressions/ for an admin entity type. Implement it, or remove the declaration from the spec."}))),{ok:!1,missing:T}):{ok:!0,runtime:t({merged:b,changed:k})}};
@@ -1,4 +1,4 @@
1
- import type { SelfAccessor } from '../../../core/index.js';
1
+ import { type SelfAccessor } from '#package/domain';
2
2
  import type { MemoEvalPlan } from '../../../parse-application-files/spec/index.js';
3
3
  import { type SpecCodeMap } from '../spec-code/index.js';
4
4
  /**
@@ -1 +1 @@
1
- import{memoEval as e}from"#package/domain";import{createMessageDescriptor as t}from"../../../core/index.js";import{specCodeEvalIds as r}from"../../runtime-spec/index.js";import{resolveSpecCode as a}from"../spec-code/index.js";let n=(e,r)=>{if("literal"===e.kind)return e.value;if("slot"===e.kind)return r[e.depIndex];if("msg"===e.kind)return t(e.marker);if("array"===e.kind)return e.items.map(e=>n(e,r));let a={};for(let[t,l]of e.entries)a[t]=n(l,r);return a};export const generateMemoEvalPlanRuntime=(t,l,i)=>{if(0===t.deps.length){let e=n(t.template,[]);return()=>e}let o=r(t,l),s=t.deps.map((e,t)=>{let r=o[t];return"eval"===e.kind&&void 0!==r?a(i,r,e.code):void 0});return e(e=>t.deps.map((t,r)=>"eval"===t.kind?s[r](e):Reflect.get(e,t.target)),(...e)=>n(t.template,e))};export const evaluateStaticMemoEvalPlan=(e,t,l)=>{if(e.usesSelf)throw Error("Cannot evaluate a plan that uses self as a static value. Filter self-dependent plans before evaluating constants.");let i=r(e,t),o=e.deps.map((e,t)=>{if("read"===e.kind)throw Error(`Cannot evaluate the self-dependent read "${e.target}" as a static value. Filter self-dependent plans before evaluating constants.`);return a(l,i[t],e.code)()});return n(e.template,o)};
1
+ import{createMessageDescriptor as e,memoEval as t}from"#package/domain";import{specCodeEvalIds as a}from"../../runtime-spec/index.js";import{resolveSpecCode as r}from"../spec-code/index.js";let n=(t,a)=>{if("literal"===t.kind)return t.value;if("slot"===t.kind)return a[t.depIndex];if("msg"===t.kind)return e(t.marker);if("array"===t.kind)return t.items.map(e=>n(e,a));let r={};for(let[e,l]of t.entries)r[e]=n(l,a);return r};export const generateMemoEvalPlanRuntime=(e,l,i)=>{if(0===e.deps.length){let t=n(e.template,[]);return()=>t}let s=a(e,l),o=e.deps.map((e,t)=>{let a=s[t];return"eval"===e.kind&&void 0!==a?r(i,a,e.code):void 0});return t(t=>e.deps.map((e,a)=>"eval"===e.kind?o[a](t):Reflect.get(t,e.target)),(...t)=>n(e.template,t))};export const evaluateStaticMemoEvalPlan=(e,t,l)=>{if(e.usesSelf)throw Error("Cannot evaluate a plan that uses self as a static value. Filter self-dependent plans before evaluating constants.");let i=a(e,t),s=e.deps.map((e,t)=>{if("read"===e.kind)throw Error(`Cannot evaluate the self-dependent read "${e.target}" as a static value. Filter self-dependent plans before evaluating constants.`);return r(l,i[t],e.code)()});return n(e.template,s)};
@@ -1,7 +1,6 @@
1
1
  import { Branded } from '@salsita-ai/common/utils';
2
- import type { DomainEntity, ProductPreset } from '#package/domain';
2
+ import type { DomainEntity, ProductPreset, SpecPreset } from '#package/domain';
3
3
  import type { RuntimeReferenceStore } from '../../../caching/index.js';
4
- import type { Preset } from '../../../parse-application-files/index.js';
5
4
  type AnyProductPreset = ProductPreset<DomainEntity<string>, DomainEntity<string>>;
6
5
  /** Collection of runtime presets with change tracking. */
7
6
  export type PresetRuntime = Branded<'PresetRuntime', {
@@ -10,7 +9,7 @@ export type PresetRuntime = Branded<'PresetRuntime', {
10
9
  }>;
11
10
  interface PresetRuntimeProps {
12
11
  readonly referenceScope: string;
13
- readonly presets: readonly Preset[];
12
+ readonly presets: readonly SpecPreset[];
14
13
  }
15
14
  /**
16
15
  * Builds preset runtime objects with per-item reference stability.
@@ -1,4 +1,5 @@
1
- import type { ExpressionName, Expressions, MemoEvalPlan } from '../../../parse-application-files/index.js';
1
+ import type { ExpressionName } from '#package/domain';
2
+ import type { Expressions, MemoEvalPlan } from '../../../parse-application-files/index.js';
2
3
  import type { SpecCodeMap } from '../spec-code/index.js';
3
4
  /** The self-free `constants:` plans declared on one entity or alias, or `undefined` when it has none. */
4
5
  export declare const findReflectionConstants: (expressions: Expressions, entityOrAlias: string) => ReadonlyMap<ExpressionName, MemoEvalPlan> | undefined;
@@ -1,4 +1,4 @@
1
- import type { SelfAccessor } from '../../../core/index.js';
1
+ import type { SelfAccessor } from '#package/domain';
2
2
  import type { SpecCodeId } from '../../runtime-spec/index.js';
3
3
  import type { SpecCodeMap } from './spec-code-module.js';
4
4
  /**
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
+ import { type EnhancedJsonValue } from '#package/domain';
2
3
  import { type EnhancedJsonSchemaType } from '../../core/enhanced-json-schema.js';
3
- import { type EnhancedJsonValue } from '../../core/enhanced-json-value.js';
4
4
  /**
5
5
  * Discriminator tag for a single parsed expression entry.
6
6
  *
@@ -1 +1 @@
1
- import{z as r}from"zod";import{enhancedJsonSchema as e,extendEnhancedJsonSchema as s}from"../../core/enhanced-json-schema.js";import{EVAL_MARKER_KEY as n,evalMarkerSchema as o}from"../../core/markers/eval-marker.js";import{MSG_ID_MARKER_KEY as a,MSG_MARKER_KEY as t,msgMarkerSchema as i}from"../../core/markers/msg-marker.js";export const RawExpressionKind={User:"user",Value:"value"};let m=s(o),c=s(i),d=[n,t,a],l=r=>{let e={};for(let[s,n]of Object.entries(r))d.includes(s)||(e[s]=n);return e};export const rawExpressionEntrySchema=r.union([m,c,e]).transform(r=>{if(n in r)return{kind:RawExpressionKind.Value,constant:!1,value:{[n]:r.$eval},schema:l(r)};if(t in r){let e=void 0!==r.$msgId?{[t]:r.$msg,[a]:r.$msgId}:{[t]:r.$msg};return{kind:RawExpressionKind.Value,constant:!1,value:e,schema:l(r)}}return{kind:RawExpressionKind.User,schema:r}});export const rawExpressionsSchema=r.record(r.string(),r.record(r.string(),rawExpressionEntrySchema).readonly()).readonly();
1
+ import{z as e}from"zod";import{EVAL_MARKER_KEY as r,MSG_ID_MARKER_KEY as n,MSG_MARKER_KEY as s,evalMarkerSchema as o,msgMarkerSchema as a}from"#package/domain";import{enhancedJsonSchema as i,extendEnhancedJsonSchema as t}from"../../core/enhanced-json-schema.js";export const RawExpressionKind={User:"user",Value:"value"};let c=t(o),m=t(a),d=[r,s,n],p=e=>{let r={};for(let[n,s]of Object.entries(e))d.includes(n)||(r[n]=s);return r};export const rawExpressionEntrySchema=e.union([c,m,i]).transform(e=>{if(r in e)return{kind:RawExpressionKind.Value,constant:!1,value:{[r]:e.$eval},schema:p(e)};if(s in e){let r=void 0!==e.$msgId?{[s]:e.$msg,[n]:e.$msgId}:{[s]:e.$msg};return{kind:RawExpressionKind.Value,constant:!1,value:r,schema:p(e)}}return{kind:RawExpressionKind.User,schema:e}});export const rawExpressionsSchema=e.record(e.string(),e.record(e.string(),rawExpressionEntrySchema).readonly()).readonly();
@@ -1,16 +1,10 @@
1
- import { Branded } from '@salsita-ai/common/utils';
1
+ import type { SpecAliases } from '#package/domain';
2
2
  import type { ParseContext } from '../../../core/index.js';
3
3
  import type { MergedModelVersion } from '../../merge/index.js';
4
4
  import type { EntityTypes } from './entity-types.js';
5
5
  import { AliasName } from './names/alias-name.js';
6
- import type { EntityTypeName } from './names/entity-type-name.js';
7
- /**
8
- * Flattened alias map — each alias name maps to the concrete entity types it resolves to.
9
- * Nested aliases (e.g. AllLegs → [SteelLegs, LegsOak] where SteelLegs is itself an alias)
10
- * are fully resolved to leaf entity types. Includes the synthetic "AnyDomainEntity" alias
11
- * that maps to all entity types in the version.
12
- */
13
- export type Aliases = Branded<'Aliases', ReadonlyMap<AliasName, readonly EntityTypeName[]>>;
6
+ /** The flattened alias map of a model version; see {@link SpecAliases} in `domain`. */
7
+ export type Aliases = SpecAliases;
14
8
  /** Well-known alias name for root entity types — required in every model version. */
15
9
  export declare const ROOT_ENTITY_ALIAS: AliasName;
16
10
  export declare const Aliases: (merged: MergedModelVersion, entityTypes: EntityTypes, ctx: ParseContext) => Aliases | undefined;
@@ -1,18 +1,10 @@
1
- import { Branded } from '@salsita-ai/common/utils';
2
- import { type EnhancedJsonSchemaType, type JsonSchema, type ParseContext, type PhoenixDefinitions } from '../../../core/index.js';
1
+ import type { CommonType as CommonTypeData, CommonTypes as CommonTypesData } from '#package/domain';
2
+ import { type ParseContext, type PhoenixDefinitions } from '../../../core/index.js';
3
3
  import type { MergedModelVersion } from '../../merge/index.js';
4
- /** A single common type definition with both enhanced schema (for type inference) and resolved runtime schema. */
5
- export type CommonType = Branded<'CommonType', {
6
- readonly name: string;
7
- readonly schema: EnhancedJsonSchemaType;
8
- readonly runtimeSchema: JsonSchema;
9
- }>;
10
- /**
11
- * Branded map of common type name to CommonType.
12
- * Entries are in topo-sorted order (dependencies before dependents),
13
- * so iterating the map yields types in valid emission order.
14
- */
15
- export type CommonTypes = Branded<'CommonTypes', ReadonlyMap<string, CommonType>>;
4
+ /** A common type with its enhanced and runtime schemas; see {@link CommonTypeData | CommonType} in `domain`. */
5
+ export type CommonType = CommonTypeData;
6
+ /** The common types of a model version by name; see {@link CommonTypesData | CommonTypes} in `domain`. */
7
+ export type CommonTypes = CommonTypesData;
16
8
  /**
17
9
  * Validates, topo-sorts, and resolves commonType entries from the merged model version.
18
10
  *