aeon-ui-engine 1.3.5 → 1.5.1

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 (104) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/CONSUMER.md +67 -27
  3. package/INTEGRATION.md +1 -1
  4. package/README.md +17 -8
  5. package/package.json +4 -1
  6. package/packages/cli/README.md +13 -1
  7. package/packages/cli/dist/bin.js +50 -6
  8. package/packages/cli/dist/chunk-JMNRJCWF.js +301 -0
  9. package/packages/cli/dist/index.d.ts +31 -1
  10. package/packages/cli/dist/index.js +7 -3
  11. package/packages/cli/src/bin.ts +50 -4
  12. package/packages/cli/src/index.ts +2 -0
  13. package/packages/cli/src/init.ts +10 -4
  14. package/packages/cli/src/link.ts +61 -0
  15. package/packages/cli/src/migrate.ts +170 -0
  16. package/packages/core/dist/index.d.ts +35 -7
  17. package/packages/core/dist/index.js +102 -2
  18. package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  19. package/packages/core/src/anatomy.ts +39 -3
  20. package/packages/core/src/identicon.test.ts +39 -0
  21. package/packages/core/src/identicon.ts +79 -0
  22. package/packages/core/src/index.ts +1 -0
  23. package/packages/panda/panda.config.ts +4 -0
  24. package/packages/panda/src/recipes/composer.ts +58 -4
  25. package/packages/panda/src/recipes/file-upload.ts +100 -0
  26. package/packages/panda/src/recipes/index.ts +2 -0
  27. package/packages/panda/src/recipes/range-slider.ts +59 -0
  28. package/packages/panda/src/recipes/thread.ts +77 -2
  29. package/packages/panda/styled-system/recipes/aeon-composer.d.ts +1 -1
  30. package/packages/panda/styled-system/recipes/aeon-composer.mjs +12 -0
  31. package/packages/panda/styled-system/recipes/aeon-file-upload.d.ts +31 -0
  32. package/packages/panda/styled-system/recipes/aeon-file-upload.mjs +61 -0
  33. package/packages/panda/styled-system/recipes/aeon-range-slider.d.ts +31 -0
  34. package/packages/panda/styled-system/recipes/aeon-range-slider.mjs +49 -0
  35. package/packages/panda/styled-system/recipes/aeon-thread.d.ts +1 -1
  36. package/packages/panda/styled-system/recipes/aeon-thread.mjs +20 -0
  37. package/packages/panda/styled-system/recipes/index.d.ts +2 -0
  38. package/packages/panda/styled-system/recipes/index.mjs +2 -0
  39. package/packages/panda/styled-system/styles.css +292 -0
  40. package/packages/primitives/dist/chunk-CV4UXXZF.js +44 -0
  41. package/packages/primitives/dist/chunk-IZKQSCYU.js +164 -0
  42. package/packages/primitives/dist/{chunk-PB3LFHXU.js → chunk-VUPWYBGU.js} +14 -0
  43. package/packages/primitives/dist/index.d.ts +2 -0
  44. package/packages/primitives/dist/index.js +23 -7
  45. package/packages/primitives/dist/machines/file-upload.d.ts +39 -0
  46. package/packages/primitives/dist/machines/file-upload.js +8 -0
  47. package/packages/primitives/dist/machines/range-slider.d.ts +129 -0
  48. package/packages/primitives/dist/machines/range-slider.js +12 -0
  49. package/packages/primitives/dist/machines/slider.d.ts +22 -0
  50. package/packages/primitives/dist/machines/slider.js +1 -1
  51. package/packages/primitives/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  52. package/packages/primitives/src/__tests__/file-upload.test.ts +25 -0
  53. package/packages/primitives/src/__tests__/range-slider.test.ts +39 -0
  54. package/packages/primitives/src/index.ts +2 -0
  55. package/packages/primitives/src/machines/file-upload.ts +55 -0
  56. package/packages/primitives/src/machines/range-slider.ts +209 -0
  57. package/packages/primitives/src/machines/slider.ts +17 -0
  58. package/packages/react/dist/index.d.ts +132 -26
  59. package/packages/react/dist/index.js +1822 -1029
  60. package/packages/react/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  61. package/packages/react/src/button/index.tsx +50 -15
  62. package/packages/react/src/composer/index.tsx +58 -3
  63. package/packages/react/src/file-upload/index.tsx +322 -0
  64. package/packages/react/src/floating/FloatingPositioner.tsx +8 -0
  65. package/packages/react/src/hooks/use-anchor-position.ts +88 -17
  66. package/packages/react/src/index.ts +3 -0
  67. package/packages/react/src/menu/index.tsx +37 -3
  68. package/packages/react/src/popover/index.tsx +7 -1
  69. package/packages/react/src/prompt/index.tsx +45 -0
  70. package/packages/react/src/range-slider/index.tsx +322 -0
  71. package/packages/react/src/slider/index.tsx +54 -14
  72. package/packages/react/src/thread/index.tsx +74 -3
  73. package/packages/react/src/tooltip/index.tsx +7 -1
  74. package/packages/react/src/utils/slot.tsx +47 -0
  75. package/packages/schemas/dist/index.d.ts +4 -0
  76. package/packages/schemas/dist/index.js +67 -1
  77. package/packages/schemas/json/button.json +6 -0
  78. package/packages/schemas/json/catalog.json +333 -0
  79. package/packages/schemas/json/fileUpload.json +168 -0
  80. package/packages/schemas/json/rangeSlider.json +157 -0
  81. package/packages/schemas/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  82. package/packages/schemas/prompts/cursorrules.md +3 -1
  83. package/packages/schemas/prompts/statecharts.md +1 -1
  84. package/packages/schemas/registry/catalog.json +18 -0
  85. package/packages/schemas/registry/components/button.json +6 -0
  86. package/packages/schemas/registry/components/fileUpload.json +168 -0
  87. package/packages/schemas/registry/components/rangeSlider.json +157 -0
  88. package/packages/schemas/registry/machines/fileUpload.json +182 -0
  89. package/packages/schemas/registry/machines/rangeSlider.json +201 -0
  90. package/packages/schemas/scripts/emit.ts +4 -0
  91. package/packages/schemas/src/components.ts +70 -0
  92. package/packages/schemas/src/prompts.ts +3 -1
  93. package/packages/schemas/tsconfig.json +1 -1
  94. package/packages/ui/dist/index.d.ts +100 -46
  95. package/packages/ui/dist/index.js +463 -341
  96. package/packages/ui/src/composer.tsx +37 -11
  97. package/packages/ui/src/file-upload.tsx +36 -0
  98. package/packages/ui/src/index.ts +2 -0
  99. package/packages/ui/src/prompt.tsx +3 -0
  100. package/packages/ui/src/range-slider.tsx +24 -0
  101. package/packages/ui/src/thread.tsx +40 -0
  102. package/scripts/link-scoped-packages.mjs +206 -0
  103. package/scripts/vite-aliases.mjs +6 -8
  104. package/packages/cli/dist/chunk-IW5NT2Z2.js +0 -103
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.5.1] - 2026-08-18
4
+
5
+ ### Added
6
+
7
+ - **Scoped package linking (Next.js works without aliases)** — `postinstall` and `npx aeon-ui link` symlink `node_modules/@aeon-ui/*` → `aeon-ui-engine/packages/*`. Next.js consumers now need only `transpilePackages` plus `"use client"`; the Vite plugin is optional (optimizeDeps convenience).
8
+ - **`aeon-ui link` CLI command** — `--cwd`, `--force`, `--quiet`; also runs at the end of `npx aeon-ui init`. Exported as `aeon-ui-engine/link`.
9
+
10
+ ### Changed
11
+
12
+ - CONSUMER.md, README, INTEGRATION, VITE_CONSUMER, MIGRATION_FROM_ARK, PUBLISHING: install once, link automatically, Vite plugin optional; `file:` link workaround for Next.js removed.
13
+ - Landing FAQ and Cursor rules snippet state that Aeon is React-first with Next.js supported, and that Vue / Solid / Svelte are thin adapters rather than the main catalog.
14
+
15
+ ## [1.4.1] - 2026-08-17
16
+
17
+ ### Fixed
18
+
19
+ - **Floating surfaces are collision aware** — `Menu` / `Popover` / `Tooltip` / `Select` positioners now accept `bottom-end` / `top-end` / `*-center` placements, flip when the preferred side has no room, and clamp inside the viewport. Right-aligned triggers (avatar menus in a sticky header) no longer render offscreen.
20
+ - **Positioner stacking is configurable** — `gutter` and `zIndex` props on `Menu.Positioner`, `Popover.Positioner`, `Tooltip.Positioner` replace the hardcoded 4px gap and `z-index: 50`, so menus can sit above app chrome.
21
+ - **Menu keyboard behavior** — `Menu.Content` takes focus while open, restores focus to the trigger on dismiss, and closes on Escape from anywhere on the page (previously only when focus was already inside the surface).
22
+ - **Controlled `Slider` reports interaction** — pointer and keyboard input now call `onValueChange` even when `value` is set, so a controlled thumb (audio seek bar) follows its prop instead of Aeon's internal value. `onValueChange` no longer fires on mount or echoes the controlled prop.
23
+ - **`sliderMachine` bounds follow the host** — new `SET_BOUNDS` / `SET_DISABLED` events, sent by `Slider.Root` on prop change, so a range that grows later (track duration arriving) stops clamping to the initial `max`.
24
+
25
+ ### Added
26
+
27
+ - Positioners publish `data-side`, `data-align`, `--aeon-available-height`, and `--aeon-anchor-width` for recipes that cap their own scroll area.
28
+
29
+ ## [1.4.0] - 2026-08-17
30
+
31
+ ### Added
32
+
33
+ - **RangeSlider** — `rangeSliderMachine` + headless/styled compound (two thumbs, `minStepsBetween`).
34
+ - **FileUpload** — `fileUploadMachine` + dropzone compound (`idle | dragging | rejected`; file bytes in React).
35
+ - **Button `asChild`** + exported `Slot` — merge button attrs onto `Link` / `<a>`.
36
+ - **`npx aeon-ui migrate`** — scan known workarounds + write `AEON_MIGRATION_CHECKLIST.md`.
37
+ - **docs/MIGRATION.md** — greenfield + upgrade playbook for future app migrations.
38
+
39
+ ### Changed
40
+
41
+ - COMPONENTS / MACHINES / PRIMITIVE_COVERAGE / API_PATTERNS updated for 1.4 primitives.
42
+ - **aeon-ui.com** hero, FAQ, Cursor docs, CONSUMER, and README now lead with `npx aeon-ui migrate` for existing apps.
43
+
44
+ ## [1.3.6] - 2026-07-31
45
+
46
+ ### Changed
47
+
48
+ - **Landing hero** — “A better way to build with AI” (title, OG, tagline).
49
+ - **Builder statecharts** — live chart follows the active UX scope/machine and highlights more reliably as you interact.
50
+
51
+ ### Earlier in 1.3.6
52
+
53
+ - **Landing why-first** — philosophy, pillars, FAQ, and charts/totality support that outcome instead of leading with mechanics.
54
+
3
55
  ## [1.3.5] - 2026-07-31
4
56
 
5
57
  ### Added
package/CONSUMER.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # Using `aeon-ui-engine` from npm
2
2
 
3
- One package. One plugin. Done.
3
+ One package. Install once. `@aeon-ui/*` resolves automatically.
4
+
5
+ Aeon is **React-first** (Next.js included). Vue / Solid / Svelte adapters are thin — not the main product.
6
+
7
+ ## 0. Existing app? Migrate first
8
+
9
+ ```bash
10
+ npx aeon-ui migrate
11
+ ```
12
+
13
+ Scans for known local workarounds (custom dropzones, range sliders, toast bridges, hand-rolled link buttons) and writes `AEON_MIGRATION_CHECKLIST.md`. Use `--check` to print findings only. New projects can skip straight to install + `npx aeon-ui init`.
4
14
 
5
15
  ## 1. Install
6
16
 
@@ -8,51 +18,81 @@ One package. One plugin. Done.
8
18
  npm install aeon-ui-engine react react-dom xstate @xstate/react
9
19
  ```
10
20
 
11
- ## 2. Vite plugin
21
+ **Postinstall** runs `scripts/link-scoped-packages.mjs`, which symlinks:
12
22
 
13
- ```ts
14
- // vite.config.ts
15
- import react from '@vitejs/plugin-react'
16
- import { defineConfig } from 'vite'
17
- import { aeonUiVitePlugin } from 'aeon-ui-engine/vite'
23
+ `node_modules/@aeon-ui/*` → `node_modules/aeon-ui-engine/packages/*`
18
24
 
19
- export default defineConfig({
20
- plugins: [react(), aeonUiVitePlugin()],
21
- })
25
+ Re-run manually anytime:
26
+
27
+ ```bash
28
+ npx aeon-ui link
29
+ # or
30
+ node node_modules/aeon-ui-engine/scripts/link-scoped-packages.mjs
22
31
  ```
23
32
 
24
- ## 3. Import CSS (one line)
33
+ No bundler aliases are required for `@aeon-ui/ui` / `@aeon-ui/react` imports.
34
+
35
+ ## 2. Import CSS (one line)
25
36
 
26
37
  ```tsx
27
- // main.tsx or app entry
38
+ // app/layout.tsx (Next.js) or main.tsx (Vite)
28
39
  import 'aeon-ui-engine/aeon.css'
29
40
  ```
30
41
 
31
- ## 4. Use components
42
+ ## 3. Use components
32
43
 
33
44
  ```tsx
34
45
  import { Button, Dialog, Menu, Toast } from '@aeon-ui/ui'
35
46
  ```
36
47
 
37
- That's it. The plugin handles all `@aeon-ui/*` aliases, TypeScript paths, and optimizeDeps.
48
+ ---
49
+
50
+ ## Next.js
51
+
52
+ ```js
53
+ // next.config.mjs
54
+ export default {
55
+ transpilePackages: [
56
+ '@aeon-ui/ui',
57
+ '@aeon-ui/react',
58
+ '@aeon-ui/core',
59
+ '@aeon-ui/primitives',
60
+ '@aeon-ui/panda',
61
+ ],
62
+ }
63
+ ```
64
+
65
+ Mark interactive surfaces as Client Components:
66
+
67
+ ```tsx
68
+ 'use client'
69
+ import { Button } from '@aeon-ui/ui'
70
+ ```
71
+
72
+ No `resolve.alias` / webpack alias block. If Turbopack mis-resolves after install, run `npx aeon-ui link` and prefer `next dev --webpack` while evaluating.
38
73
 
39
74
  ---
40
75
 
41
- ## Optional: TypeScript
76
+ ## Vite (optional plugin)
42
77
 
43
- If your tsconfig doesn't extend the engine base:
78
+ Scoped imports already work via the link step. The Vite plugin is optional — it still helps with `optimizeDeps` and monorepo `packagesRoot`:
44
79
 
45
- ```json
46
- {
47
- "compilerOptions": {
48
- "paths": {
49
- "@aeon-ui/*": ["./node_modules/aeon-ui-engine/packages/*/src"]
50
- }
51
- }
52
- }
80
+ ```ts
81
+ // vite.config.ts
82
+ import react from '@vitejs/plugin-react'
83
+ import { defineConfig } from 'vite'
84
+ import { aeonUiVitePlugin } from 'aeon-ui-engine/vite'
85
+
86
+ export default defineConfig({
87
+ plugins: [react(), aeonUiVitePlugin()],
88
+ })
53
89
  ```
54
90
 
55
- Or extend directly:
91
+ ---
92
+
93
+ ## Optional: TypeScript
94
+
95
+ Linked packages usually typecheck via each package’s `types` field. If needed:
56
96
 
57
97
  ```json
58
98
  {
@@ -117,7 +157,7 @@ Style with any CSS system using `data-aeon-scope`, `data-aeon-part`, `data-aeon-
117
157
 
118
158
  ## Optional: Local monorepo
119
159
 
120
- Point the plugin at a local checkout:
160
+ Point the Vite plugin at a local checkout (or set `AEON_UI_ROOT` before `aeon-ui link`):
121
161
 
122
162
  ```ts
123
163
  aeonUiVitePlugin({ packagesRoot: '/path/to/aeon-ui/packages' })
@@ -125,4 +165,4 @@ aeonUiVitePlugin({ packagesRoot: '/path/to/aeon-ui/packages' })
125
165
 
126
166
  ## Reference consumer
127
167
 
128
- [Casino-games](https://github.com/GenericCPU/Casino-games) uses this exact pattern.
168
+ [Casino-games](https://github.com/GenericCPU/Casino-games) uses the engine install pattern. Next.js consumers: install + link + `transpilePackages` (see above).
package/INTEGRATION.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Agents:** [AGENTS.md](./AGENTS.md) · [docs/API_PATTERNS.md](./docs/API_PATTERNS.md)
4
4
 
5
- **npm consumers:** start with **[CONSUMER.md](./CONSUMER.md)** — install `aeon-ui-engine`, peer deps, and `aeonUiViteAliases()` before any `@aeon-ui/*` import works.
5
+ **npm consumers:** start with **[CONSUMER.md](./CONSUMER.md)** — install `aeon-ui-engine` (postinstall links `@aeon-ui/*`), peer deps, then import. Vite plugin is optional; Next.js needs `transpilePackages` only.
6
6
 
7
7
  Aeon UI is **three layers**. You can use one or all.
8
8
 
package/README.md CHANGED
@@ -16,7 +16,7 @@ Aeon UI models interactive behavior as executable [statecharts](https://www.thes
16
16
  | `@aeon-ui/primitives` | XState machines (toggle, dialog, tabs, accordion, async, button lifecycle, field) |
17
17
  | `@aeon-ui/react` | React headless bindings |
18
18
  | `@aeon-ui/schemas` | JSON Schema catalog + agent system prompts |
19
- | `@aeon-ui/cli` | `npx aeon-ui init` — Cursor rules, schemas, starter |
19
+ | `@aeon-ui/cli` | `npx aeon-ui init` · `link` · `migrate` — Cursor rules, scoped package link, migration checklist |
20
20
  | `@aeon-ui/panda` | Design tokens, `defineSlotRecipe` styles, generated `styled-system` |
21
21
  | `@aeon-ui/ui` | Styled components (`aeonButton`, `aeonAccordion`, …) |
22
22
  | `@aeon-ui/vue` | Vue 3 headless adapter (v0.1: Switch + `useAeonMachine`) |
@@ -33,13 +33,27 @@ Teach an AI agent first (optional but recommended):
33
33
  npx aeon-ui init
34
34
  ```
35
35
 
36
- The monorepo is published on npm as **`aeon-ui-engine`** (bundles all `@aeon-ui/*` workspace packages):
36
+ Migrating an existing app? Scan for known workarounds and write a checklist:
37
+
38
+ ```bash
39
+ npx aeon-ui migrate
40
+ ```
41
+
42
+ The monorepo is published on npm as **`aeon-ui-engine`** (bundles all `@aeon-ui/*` workspace packages). Postinstall links `node_modules/@aeon-ui/*` so **Next.js and Vite** resolve imports without aliases:
37
43
 
38
44
  ```bash
39
45
  npm install aeon-ui-engine react react-dom xstate @xstate/react
46
+ # re-link if needed: npx aeon-ui link
40
47
  ```
41
48
 
42
- Add the Vite plugin and import CSS:
49
+ ```tsx
50
+ // app/layout.tsx or main.tsx
51
+ import 'aeon-ui-engine/aeon.css'
52
+ ```
53
+
54
+ **Next.js** — add `transpilePackages` for `@aeon-ui/ui`, `@aeon-ui/react`, `@aeon-ui/core`, `@aeon-ui/primitives`, `@aeon-ui/panda`, and use `"use client"` for interactive components.
55
+
56
+ **Vite (optional)** — `aeonUiVitePlugin()` still helps with optimizeDeps; linking alone is enough for `@aeon-ui/*` resolution:
43
57
 
44
58
  ```ts
45
59
  // vite.config.ts
@@ -49,11 +63,6 @@ export default defineConfig({
49
63
  })
50
64
  ```
51
65
 
52
- ```tsx
53
- // main.tsx
54
- import 'aeon-ui-engine/aeon.css'
55
- ```
56
-
57
66
  Full setup guide: **[CONSUMER.md](./CONSUMER.md)**.
58
67
 
59
68
  Open [https://github.com/GenericCPU/aeon-ui](https://github.com/GenericCPU/aeon-ui) for the repo. The marketing demo lives at [https://aeon-ui.com](https://aeon-ui.com) — set `VITE_SITE_ORIGIN` to that origin in Vercel so Open Graph previews resolve the social image in `apps/demo/public/` correctly.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aeon-ui-engine",
3
- "version": "1.3.5",
3
+ "version": "1.5.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "exports": {
10
10
  "./vite": "./scripts/vite-aliases.mjs",
11
+ "./link": "./scripts/link-scoped-packages.mjs",
11
12
  "./aeon.css": "./packages/panda/aeon.css",
12
13
  "./tsconfig.base.json": "./tsconfig.base.json",
13
14
  "./CONSUMER.md": "./CONSUMER.md",
@@ -25,6 +26,8 @@
25
26
  "CHANGELOG.md"
26
27
  ],
27
28
  "scripts": {
29
+ "postinstall": "node ./scripts/link-scoped-packages.mjs",
30
+ "link:scoped": "node ./scripts/link-scoped-packages.mjs",
28
31
  "build": "pnpm --filter @aeon-ui/panda run codegen && pnpm -r run build",
29
32
  "build:headless": "pnpm --filter @aeon-ui/core --filter @aeon-ui/primitives --filter @aeon-ui/react run build",
30
33
  "codegen": "pnpm --filter @aeon-ui/panda codegen",
@@ -4,14 +4,26 @@ AI-optimized CLI for Aeon UI.
4
4
 
5
5
  ```bash
6
6
  npx aeon-ui init
7
+ npx aeon-ui migrate
7
8
  ```
8
9
 
10
+ ## `init`
11
+
9
12
  Injects:
10
13
 
11
14
  - `.cursor/rules/aeon-ui.mdc` — always-on Cursor rule
12
15
  - `aeon.cursorrules.md` / `aeon.system-prompt.md` — paste into any agent
13
16
  - `aeon.schemas/` — deterministic JSON schemas per component
14
- - `src/components/AeonStarter.tsx` — minimal Field + Button + Async scaffold
17
+ - `src/components/AeonStarter.tsx` — minimal Field + Button scaffold
15
18
  - `AEON_AI.md` — next steps
16
19
 
17
20
  Use `--force` to overwrite.
21
+
22
+ ## `migrate`
23
+
24
+ Scans for known local workarounds (preview-window machine, file dropzone, sonner bridge, etc.) and writes `AEON_MIGRATION_CHECKLIST.md`.
25
+
26
+ ```bash
27
+ npx aeon-ui migrate # write checklist
28
+ npx aeon-ui migrate --check # print findings only
29
+ ```
@@ -1,32 +1,76 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- initAeon
4
- } from "./chunk-IW5NT2Z2.js";
3
+ initAeon,
4
+ linkAeon,
5
+ migrateAeon
6
+ } from "./chunk-JMNRJCWF.js";
5
7
 
6
8
  // src/bin.ts
7
9
  var args = process.argv.slice(2);
8
10
  var cmd = args[0] ?? "help";
9
11
  var force = args.includes("--force") || args.includes("-f");
12
+ var checkOnly = args.includes("--check");
13
+ var quiet = args.includes("--quiet") || args.includes("-q");
14
+ function argValue(flag) {
15
+ const i = args.indexOf(flag);
16
+ if (i >= 0 && args[i + 1] && !args[i + 1].startsWith("-")) return args[i + 1];
17
+ return void 0;
18
+ }
19
+ var cwdArg = argValue("--cwd");
10
20
  function help() {
11
21
  console.log(`aeon-ui \u2014 AI-optimized CLI for Aeon UI
12
22
 
13
23
  Usage:
14
24
  npx aeon-ui init [--force]
25
+ npx aeon-ui link [--quiet] [--force] [--cwd <dir>]
26
+ npx aeon-ui migrate [--check]
15
27
 
16
28
  Commands:
17
- init Inject Cursor rules, JSON schemas, system prompt, and a starter component
18
- help Show this message
29
+ init Inject Cursor rules, JSON schemas, system prompt, and a starter component
30
+ link Symlink node_modules/@aeon-ui/* \u2192 aeon-ui-engine/packages/* (also runs on postinstall)
31
+ migrate Scan for known workarounds and write AEON_MIGRATION_CHECKLIST.md
32
+ help Show this message
19
33
 
20
34
  Options:
21
- --force, -f Overwrite existing generated files
35
+ --force, -f Overwrite existing generated files (init); replace existing @aeon-ui links (link)
36
+ --check Report findings only; do not write checklist (migrate)
37
+ --quiet, -q Suppress link output (link)
38
+ --cwd <dir> Project root for link (defaults to process.cwd())
22
39
  `);
23
40
  }
24
41
  if (cmd === "init") {
25
- const result = initAeon({ force });
42
+ const result = initAeon({ force, cwd: cwdArg });
26
43
  console.log(`Aeon UI init \u2192 ${result.cwd}`);
27
44
  for (const line of result.written) console.log(` ${line}`);
45
+ try {
46
+ linkAeon({ cwd: result.cwd, quiet: true });
47
+ console.log(" link @aeon-ui/* (scoped packages)");
48
+ } catch {
49
+ console.log(" link skipped (install aeon-ui-engine first, then: npx aeon-ui link)");
50
+ }
28
51
  console.log("\nNext: npm install aeon-ui-engine react react-dom xstate @xstate/react");
29
52
  console.log("Docs: AEON_AI.md \xB7 paste aeon.cursorrules.md into your agent system prompt");
53
+ } else if (cmd === "link") {
54
+ try {
55
+ const result = linkAeon({ quiet, force, cwd: cwdArg });
56
+ if (quiet) console.log(`Aeon UI link \u2192 ${result.cwd}`);
57
+ } catch (err) {
58
+ console.error(err instanceof Error ? err.message : err);
59
+ process.exitCode = 1;
60
+ }
61
+ } else if (cmd === "migrate") {
62
+ const result = migrateAeon({ write: !checkOnly });
63
+ console.log(`Aeon UI migrate \u2192 ${result.cwd}`);
64
+ for (const line of result.written) console.log(` ${line}`);
65
+ if (result.findings.length === 0) {
66
+ console.log(" (no known workarounds matched in quick scan)");
67
+ } else {
68
+ for (const f of result.findings) {
69
+ console.log(` [${f.severity}] ${f.id}: ${f.advice}`);
70
+ }
71
+ }
72
+ console.log("\nInstall: npm install aeon-ui-engine@^1.4.0 xstate @xstate/react");
73
+ console.log("Docs: https://aeon-ui.com \xB7 repo docs/MIGRATION.md");
30
74
  } else {
31
75
  help();
32
76
  if (cmd !== "help" && cmd !== "--help" && cmd !== "-h") {