@owdproject/core 3.4.0 → 4.0.0-alpha.3

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 (108) hide show
  1. package/README.md +112 -13
  2. package/dist/dom/index.d.mts +65 -0
  3. package/dist/dom/index.d.ts +65 -0
  4. package/dist/dom/index.mjs +224 -0
  5. package/dist/events/index.d.mts +70 -0
  6. package/dist/events/index.d.ts +70 -0
  7. package/dist/events/index.mjs +3 -0
  8. package/dist/index.d.mts +73 -0
  9. package/dist/index.d.ts +73 -0
  10. package/dist/index.mjs +115 -0
  11. package/dist/layout/index.d.mts +41 -0
  12. package/dist/layout/index.d.ts +41 -0
  13. package/dist/layout/index.mjs +64 -0
  14. package/dist/machines/index.d.mts +31 -0
  15. package/dist/machines/index.d.ts +31 -0
  16. package/dist/machines/index.mjs +2 -0
  17. package/dist/managers/index.d.mts +117 -0
  18. package/dist/managers/index.d.ts +117 -0
  19. package/dist/managers/index.mjs +6 -0
  20. package/dist/session/index.d.mts +57 -0
  21. package/dist/session/index.d.ts +57 -0
  22. package/dist/session/index.mjs +65 -0
  23. package/dist/shared/core.B0B0KfVK.mjs +865 -0
  24. package/dist/shared/core.B1XxB289.mjs +239 -0
  25. package/dist/shared/core.B3mp7ztE.mjs +237 -0
  26. package/dist/shared/core.BOvFdEVQ.d.ts +114 -0
  27. package/dist/shared/core.CsDFgGnX.mjs +40 -0
  28. package/dist/shared/core.Di1eFcr_.d.mts +114 -0
  29. package/dist/shared/core.Pd_Ogt4g.mjs +101 -0
  30. package/dist/shared/core.b3Xldzyu.mjs +29 -0
  31. package/dist/types/index.d.mts +266 -0
  32. package/dist/types/index.d.ts +266 -0
  33. package/dist/types/index.mjs +1 -0
  34. package/package.json +56 -112
  35. package/CHANGELOG.md +0 -98
  36. package/DESKTOP_KERNEL.md +0 -232
  37. package/MIGRATION_3.3.2.md +0 -23
  38. package/MIGRATION_3.4.md +0 -126
  39. package/PLAYGROUND.md +0 -91
  40. package/dist/module.d.mts +0 -13
  41. package/dist/module.json +0 -9
  42. package/dist/module.mjs +0 -254
  43. package/dist/types.d.mts +0 -7
  44. package/index.ts +0 -8
  45. package/kit/authoring.ts +0 -340
  46. package/kit/defineDesktopApp.ts +0 -56
  47. package/module.ts +0 -203
  48. package/runtime/components/Application/DesktopCoreApplicationRender.vue +0 -20
  49. package/runtime/components/Application/DesktopCoreApplicationWindowsRender.vue +0 -38
  50. package/runtime/components/background/DesktopCoreBackground.vue +0 -16
  51. package/runtime/components/core/DesktopCore.vue +0 -43
  52. package/runtime/components/time/DesktopCoreTime.vue +0 -56
  53. package/runtime/components/window/DesktopCoreWindow.vue +0 -215
  54. package/runtime/components/window/DesktopCoreWindowContent.vue +0 -28
  55. package/runtime/components/window/DesktopCoreWindowNav.vue +0 -66
  56. package/runtime/components/window/DesktopCoreWindowSnapHintsBase.vue +0 -74
  57. package/runtime/components/workspace/DesktopCoreWorkspaceEdgeHintsBase.vue +0 -84
  58. package/runtime/composables/useApplicationEntries.ts +0 -51
  59. package/runtime/composables/useApplicationManager.ts +0 -285
  60. package/runtime/composables/useBlockNonInputContextMenu.ts +0 -30
  61. package/runtime/composables/useDesktopConfig.ts +0 -8
  62. package/runtime/composables/useDesktopDialogs.ts +0 -16
  63. package/runtime/composables/useDesktopExtension.ts +0 -8
  64. package/runtime/composables/useDesktopManager.ts +0 -51
  65. package/runtime/composables/useDesktopManifest.ts +0 -17
  66. package/runtime/composables/useDesktopSession.ts +0 -27
  67. package/runtime/composables/useDesktopShellIdentity.ts +0 -99
  68. package/runtime/composables/useDesktopShellOptions.ts +0 -36
  69. package/runtime/composables/useDesktopShellReady.ts +0 -7
  70. package/runtime/composables/useDesktopWorkArea.ts +0 -93
  71. package/runtime/composables/useTerminalManager.ts +0 -159
  72. package/runtime/composables/useToggleWindowMaximize.ts +0 -35
  73. package/runtime/composables/useWindowDragHandlers.ts +0 -47
  74. package/runtime/composables/useWindowSnapDrop.ts +0 -112
  75. package/runtime/composables/useWorkspaceEdgeDrop.ts +0 -176
  76. package/runtime/composables/useWorkspaceManager.ts +0 -67
  77. package/runtime/composables/useWorkspaceOverviewCapture.ts +0 -92
  78. package/runtime/composables/useWorkspaceOverviewLiveScale.ts +0 -151
  79. package/runtime/constants/desktopShellKeys.ts +0 -12
  80. package/runtime/constants/shellLayout.ts +0 -5
  81. package/runtime/dialogs/desktopDialogProvider.ts +0 -73
  82. package/runtime/internal/controllers/ApplicationController.ts +0 -351
  83. package/runtime/internal/controllers/WindowController.ts +0 -547
  84. package/runtime/plugins/01.desktop-shell-init.client.ts +0 -28
  85. package/runtime/plugins/02.desktop-register-desktop-apps.client.ts +0 -13
  86. package/runtime/plugins/resize.client.ts +0 -6
  87. package/runtime/stores/storeApplicationMeta.ts +0 -60
  88. package/runtime/stores/storeApplicationWindows.ts +0 -21
  89. package/runtime/stores/storeDesktop.ts +0 -71
  90. package/runtime/stores/storeDesktopDefaultApps.ts +0 -54
  91. package/runtime/stores/storeDesktopVolume.ts +0 -19
  92. package/runtime/stores/storeDesktopWindow.ts +0 -38
  93. package/runtime/stores/storeDesktopWorkspace.ts +0 -105
  94. package/runtime/stores/storeIds.ts +0 -35
  95. package/runtime/types/desktopMenu.ts +0 -10
  96. package/runtime/utils/initDesktopShell.ts +0 -80
  97. package/runtime/utils/migratePersistedStoreIds.ts +0 -57
  98. package/runtime/utils/utilApp.ts +0 -25
  99. package/runtime/utils/utilCaptureElementToCanvas.ts +0 -21
  100. package/runtime/utils/utilCommon.ts +0 -26
  101. package/runtime/utils/utilDebug.ts +0 -30
  102. package/runtime/utils/utilDetectSnapZone.ts +0 -57
  103. package/runtime/utils/utilTerminal.ts +0 -6
  104. package/runtime/utils/utilWindowControllerAdapter.ts +0 -15
  105. package/runtime/utils/utilWindowLayout.ts +0 -82
  106. package/runtime/utils/utilWindowMaximizeLayout.ts +0 -44
  107. package/runtime/utils/utilWorkspaceWindows.ts +0 -33
  108. package/types/index.d.ts +0 -531
package/DESKTOP_KERNEL.md DELETED
@@ -1,232 +0,0 @@
1
- # Desktop kernel contract
2
-
3
- Public surface of `@owdproject/core` for themes, apps, and modules. Internal implementation lives under `runtime/internal/` and is not part of this contract.
4
-
5
- ## Bootstrap order
6
-
7
- 1. Load `desktop.config.ts` (or legacy `owd.config.ts`) from the Nuxt root.
8
- 2. Validate config; warn only on keys that look like Nuxt options (`ssr`, `vite`, …).
9
- 3. Merge the **full** export into `runtimeConfig.public.desktop` (plus `coreVersion`). Same object is assigned to `appConfig.desktop`. Never spread onto `_nuxt.options`.
10
- 4. Install **Pinia**, then **theme → modules → apps** via `installDesktopPackage` (passes `desktop[configKey]` when a package declares `meta.configKey`).
11
- 5. Client plugin **`desktop-shell-init`** binds Pinia, sets up workspaces, loads default apps, and merges shell keys onto `appConfig.desktop` (before `<Desktop />` renders).
12
- 6. Client plugin **`desktop-register-desktop-apps`** flushes queued `defineDesktopApp` calls (`app:created`; legacy apps may still queue until flush).
13
-
14
- ## Desktop subsystems
15
-
16
- Conceptual map of every desktop area **owned by core**. Use this when sculpting a theme: kernel provides state, contracts, and primitives; the theme renders chrome and wires DOM measurement. This section complements the API tables below — it does not replace them.
17
-
18
- ```mermaid
19
- flowchart TB
20
- subgraph core [core_kernel]
21
- Config[Config_and_extensions]
22
- Bootstrap[Shell_bootstrap]
23
- Apps[Application_registry]
24
- Windows[Window_lifecycle]
25
- Layout[Layout_snap_workArea]
26
- Workspaces[Workspace_state_API]
27
- Overview[Overview_interaction]
28
- Dialogs[Dialog_contract]
29
- ShellServices[Volume_defaults_terminal]
30
- end
31
-
32
- subgraph theme [theme_layer]
33
- DesktopEntry[Desktop.vue]
34
- Chrome[Taskbar_dock_launcher]
35
- WindowChrome[Window_visual_chrome]
36
- WorkspaceUI[Workspace_stack_cards]
37
- end
38
-
39
- subgraph modules [extension_modules]
40
- ModuleFs[module_fs_VFS]
41
- KitPV[kit_primevue_explorer_dialogs]
42
- end
43
-
44
- Config --> Bootstrap
45
- Bootstrap --> Apps
46
- Apps --> Windows
47
- Windows --> Layout
48
- Windows --> Workspaces
49
- Workspaces --> Overview
50
- Bootstrap --> DesktopEntry
51
- DesktopEntry --> Chrome
52
- DesktopEntry --> WindowChrome
53
- DesktopEntry --> WorkspaceUI
54
- Dialogs --> KitPV
55
- ModuleFs --> KitPV
56
- ```
57
-
58
- ### Subsystem catalog
59
-
60
- | # | Area | Kernel (core) | Theme / external modules | Key paths |
61
- |---|------|---------------|--------------------------|-----------|
62
- | 1 | **Bootstrap & shell init** | Pinia bind, workspace bootstrap, default-app load, shell key merge on `appConfig.desktop`. Plugins: `desktop-shell-init`, `desktop-register-desktop-apps`, `resize.client`. | Theme `Desktop.vue` mounts after `$desktopShellReady`. | `runtime/utils/initDesktopShell.ts`, `runtime/plugins/01.desktop-shell-init.client.ts`, `runtime/plugins/02.desktop-register-desktop-apps.client.ts` |
63
- | 2 | **Desktop configuration** | `defineDesktopConfig`, merge into `runtimeConfig.public.desktop` / `appConfig.desktop`, `useDesktopConfig`, `useDesktopExtension`, runtime overrides via `useDesktopManager().setConfig()`, config validation/warnings. | Theme defaults via `defineDesktopTheme` + `defu`. | `kit/authoring.ts`, `runtime/composables/useDesktopManager.ts`, `runtime/composables/useDesktopConfig.ts` |
64
- | 3 | **Package installation** | `defineDesktopTheme` / `defineDesktopModule`, `installDesktopPackage`, install order theme → modules → apps, per-package `configKey` namespace merge. | Each theme/app/module is its own Nuxt package. | `kit/authoring.ts` |
65
- | 4 | **Shell readiness & options** | `useDesktopShellReady` (`$desktopShellReady` after init). `useDesktopShellOptions` reads `systemBar` flags (`enabled`, `position`, `startButton`) — **config only**, no UI. | Theme renders taskbar/start button from those flags. | `runtime/composables/useDesktopShellReady.ts`, `runtime/composables/useDesktopShellOptions.ts` |
66
- | 5 | **Shell identity & session** | `useDesktopShellIdentity` (guest default, `userHome`, `setShellIdentity` for auth). `useDesktopSession` (`initiateShutdownToStart` → `/start`). | `/start`, `/boot` pages, shutdown/boot animations and styling. | `runtime/composables/useDesktopShellIdentity.ts`, `runtime/composables/useDesktopSession.ts` |
67
- | 6 | **Application registry** | `defineDesktopApp`, `flushPendingDesktopApps`, `useApplicationManager` (launch, running apps, open windows), `useApplicationEntries` (sorted/filtered launcher list), per-app meta store. | Theme launcher/grid consumes `useApplicationEntries`. | `kit/defineDesktopApp.ts`, `runtime/composables/useApplicationManager.ts`, `runtime/composables/useApplicationEntries.ts`, `runtime/stores/storeApplicationMeta.ts` |
68
- | 7 | **Window lifecycle** | Internal `WindowController` / `ApplicationController`: focus, z-index, minimize, `setWorkspace`. Global z-index counter and work-area rect in `useDesktopWindowStore`. Per-app window map in `storeApplicationWindows`. | Theme `Window*.vue` wraps kernel primitives; `provide/inject` for `windowController`. See **Window lifecycle** below. | `runtime/stores/storeDesktopWindow.ts`, `runtime/stores/storeApplicationWindows.ts` |
69
- | 8 | **Layout, maximize, work area** | `useToggleWindowMaximize`, `utilWindowMaximizeLayout`, `utilWindowLayout` (snap rects, bounds restore), `useDesktopWorkArea` writes measured stage rect to store. | Theme measures shell stage DOM and calls `useDesktopWorkArea`. | `runtime/composables/useToggleWindowMaximize.ts`, `runtime/utils/utilWindowMaximizeLayout.ts`, `runtime/utils/utilWindowLayout.ts`, `runtime/composables/useDesktopWorkArea.ts` |
70
- | 9 | **Drag, Aero snap, edge drop** | `useWindowDragHandlers`, `useWindowSnapDrop`, `utilDetectSnapZone`, `useWorkspaceEdgeDrop`, hint bases `DesktopWindowSnapHintsBase` / `DesktopWorkspaceEdgeHintsBase`. | Theme wires drag in `Window.vue`; styles snap/edge hints. | `runtime/composables/useWindowDragHandlers.ts`, `runtime/composables/useWindowSnapDrop.ts`, `runtime/utils/utilDetectSnapZone.ts`, `runtime/composables/useWorkspaceEdgeDrop.ts` |
71
- | 10 | **Workspaces — state & API** | `useDesktopStore` (overview flag, z-index seed, default-apps map). `useDesktopWorkspaceStore`: `list`, `active`, `overview`, `createWorkspace`, `removeWorkspace`, `resolveWorkspaceFallback`. `utilWorkspaceWindows` / `countWindowsOnWorkspace`. | Theme reads workspace list for tray, indicators, overview entry. | `runtime/stores/storeDesktop.ts`, `runtime/stores/storeDesktopWorkspace.ts`, `runtime/utils/utilWorkspaceWindows.ts` |
72
- | 11 | **Workspaces — interaction** | `useWorkspaceManager` (overview keyboard, HTML5 drop between desktops, `removeWorkspace` with window migration). `useWorkspaceOverviewLiveScale`, `useWorkspaceOverviewCapture`, `utilCaptureElementToCanvas`. | Theme overview UI (cards, wallpaper preview, remove button, scale shell). Workspace removal rules: see **Window lifecycle** below. | `runtime/composables/useWorkspaceManager.ts`, `runtime/composables/useWorkspaceOverviewLiveScale.ts`, `runtime/composables/useWorkspaceOverviewCapture.ts` |
73
- | 12 | **Kernel Vue components** | `DesktopCore`, `DesktopApplicationRender`, `DesktopApplicationWindowsRender`, `DesktopWindow` / `DesktopWindowNav` / `DesktopWindowContent`, `DesktopBackground`, `DesktopTime`, snap/edge hint bases. | `Desktop.vue` wraps `DesktopCore`; theme chrome around window primitives. | `runtime/components/` (`prefix: 'Desktop'` in core `module.ts`; source files e.g. `window/Window.vue`) |
74
- | 13 | **Dialogs** | Contract `desktopDialogProvider`, `useDesktopDialogs` (theme inject or browser fallback). Inject key: `runtime/constants/desktopShellKeys.ts`. | PV implementation: `@owdproject/kit-primevue` (`createDesktopDialogs`). | `runtime/dialogs/desktopDialogProvider.ts`, `runtime/composables/useDesktopDialogs.ts` |
75
- | 14 | **Secondary shell services** | `useDesktopDefaultAppsStore` + `useDesktopManager` default-app routing. `useDesktopVolumeStore` (master volume). `useTerminalManager` (command registry; `app-terminal` registers commands). | Theme volume control, terminal UI, “open with” flows. | `runtime/stores/storeDesktopDefaultApps.ts`, `runtime/stores/storeDesktopVolume.ts`, `runtime/composables/useTerminalManager.ts` |
76
- | 15 | **Global shell behaviour** | `useBlockNonInputContextMenu` (desktop-style context menu policy). `useDesktopStore` persistence when `@owdproject/module-persistence` is installed. Pinia ids: `desktop`, `desktop/workspace`, `desktop/window`, `desktop/volume`, `desktop/defaultApps`, `desktop/application/${appId}/windows`, `desktop/application/${appId}/meta`. Legacy `owd/*` keys are migrated once on client boot via `migratePersistedStoreIds`. | Theme chooses where to call context-menu blocking; boot/shutdown pages. | `runtime/composables/useBlockNonInputContextMenu.ts`, `runtime/stores/storeDesktop.ts`, `runtime/stores/storeIds.ts`, `runtime/utils/migratePersistedStoreIds.ts` |
77
-
78
- ### Out of core (by user-facing area)
79
-
80
- | User-facing area | Not in core |
81
- |------------------|-------------|
82
- | Launcher / Start menu | Theme (e.g. `NovaLauncherOverlay`) — uses `useApplicationEntries` |
83
- | Taskbar / Dock / System tray | Theme UI; core exposes `systemBar` / `dockBar` config keys only |
84
- | Workspace overview cards, wallpaper preview, remove button | Theme layout/CSS; core provides state, scale/capture helpers, `removeWorkspace` API |
85
- | Explorer file UI (`DesktopExplorer*`) | `@owdproject/kit-primevue` |
86
- | VFS, paths, headless explorer APIs | `@owdproject/module-fs` |
87
- | Window titlebar, chrome buttons, shadows | Theme wrappers around `DesktopWindow*` |
88
-
89
- ## Package layout
90
-
91
- | Path | Role | Auto-imported in apps? |
92
- |------|------|------------------------|
93
- | `kit/` | Module-time authoring (`defineDesktop*`, `installDesktopPackage`, validation) | No — import `@owdproject/core/kit/*` or root barrel |
94
- | `runtime/` | Client kernel (composables, stores, utils, components, plugins) | Composables, stores, utils only (via `addImportsDir`) |
95
- | `runtime/internal/` | Window/application controllers | No |
96
- | `runtime/constants/` | Shell layout bands, inject keys | No |
97
-
98
- ## Public API
99
-
100
- ### Configuration
101
-
102
- | Export | Use |
103
- |--------|-----|
104
- | `defineDesktopConfig({ theme, apps, modules, ... })` | Root `desktop.config.ts` — `@owdproject/core/kit/authoring` |
105
- | `defineDesktopModule` / `defineDesktopTheme` | Authoring extension modules and themes (`@owdproject/core/kit/*`); Tailwind v3 + `tailwindcss-primeui` live in `@owdproject/kit-primevue` — themes call `registerThemeTailwindPath` / `registerTailwindPath` from `@owdproject/kit-primevue/kit/registerTailwindPath` after `installModule('@owdproject/kit-primevue')` |
106
- | `runtimeConfig.public.desktop` | Full merged config (manifest + shell + extension namespaces) |
107
- | `useDesktopConfig()` | Reactive access to `public.desktop` |
108
- | `useDesktopExtension(key)` | One extension namespace (`fs`, `terminal`, …) |
109
- | `hasDesktopModule` / `hasDesktopApp` / `hasDesktopExtension` | Manifest and extension checks (`runtime/composables/useDesktopManifest.ts`) |
110
- | `useDesktopManager().setConfig()` | Runtime shell overrides on `appConfig.desktop` |
111
-
112
- Shell keys in core types: `name`, `defaultApps`, `features`, `systemBar`, `dockBar`, `workspaces`, `explorer`, `docs`. Extension keys (`fs`, `terminal`, …) are typed via **module augmentation** in each package (`types/desktop.d.ts`), not an allowlist in core.
113
-
114
- ### Applications
115
-
116
- | Export | Use |
117
- |--------|-----|
118
- | `defineDesktopApp(config)` | App plugin (`app:created` recommended; legacy sync `setup` still queues until flush) |
119
- | `useApplicationManager()` | Launch entries, list running apps, resolve open windows |
120
-
121
- Apps register via Nuxt modules listed in `desktop.config.ts` → `apps`.
122
-
123
- ### Kernel Vue components (global)
124
-
125
- Registered from `runtime/components` with `pathPrefix: false`:
126
-
127
- | Component | Role |
128
- |-----------|------|
129
- | `DesktopCore` | Kernel shell wrapper (props, workspace init, default slot) |
130
- | `DesktopApplicationRender` | Iterates running apps; delegates per-app window lists |
131
- | `DesktopApplicationWindowsRender` | Renders one app's open windows (workspace filter, slot for theme `Window`) |
132
- | `DesktopWindow` / `DesktopWindowNav` / `DesktopWindowContent` | Window chrome primitives |
133
- | `DesktopBackground` / `DesktopTime` | Optional shell utilities |
134
- | `DesktopWindowSnapHintsBase` / `DesktopWorkspaceEdgeHintsBase` | Unstyled snap and workspace-edge drop hints |
135
-
136
- Themes expose **`Desktop.vue`** or **`Desktop.client.vue`** as the theme entry point (`app.vue` → `<Desktop />`). Prefer **`Desktop.client.vue`** when the theme uses Pinia in shell chrome so the whole tree stays client-only. Themes wrap `DesktopCore` and kernel window components with theme-specific chrome.
137
-
138
- ### Stores & composables (auto-imported)
139
-
140
- | Symbol | Role |
141
- |--------|------|
142
- | `useDesktopStore` | Shell state (workspace overview flag, z-index counter, default-apps map); Pinia id `desktop`; persisted with `module-persistence` |
143
- | `useDesktopWorkspaceStore` | Active workspace, overview mode, `createWorkspace` / `removeWorkspace`, `resolveWorkspaceFallback` |
144
- | `useDesktopWindowStore` | Global z-index increment + measured work area (`workArea`, `setWorkArea`) |
145
- | `useDesktopDefaultAppsStore` | Feature → default app/entry mapping (`getDefaultApp`, `setDefaultApp`) |
146
- | `useDesktopVolumeStore` | Master volume level |
147
- | `useWorkspaceManager` | Overview keyboard, HTML5 drop between workspaces, `removeWorkspace` (migrates windows) |
148
- | `useApplicationManager` | Launch app entries, track running apps and open windows |
149
- | `useApplicationEntries` | Sorted/filtered app entry list for launchers |
150
- | `useDesktopDialogs` | Confirm/alert/prompt via theme inject or browser fallback |
151
- | `useToggleWindowMaximize` | Maximize/restore; work-area-aware via `useDesktopWindowStore.workArea` |
152
- | `useDesktopShellIdentity` | Shell user (`userId`, `displayName`, `avatarUrl`, `userHome`); Guest default; auth calls `setShellIdentity` |
153
- | `useDesktopSession` | Shutdown flow (`shuttingDown`, `initiateShutdownToStart` → `/start`) |
154
- | `useDesktopShellReady` | `true` after `desktop-shell-init` has bound Pinia and bootstrapped workspaces |
155
- | `useDesktopShellOptions` | Reactive `systemBar` flags from `appConfig.desktop` |
156
- | `useWindowSnapDrop` / `useWorkspaceEdgeDrop` | Aero snap zones and workspace edge drop while dragging windows |
157
- | `useWindowDragHandlers` | Theme `Window.vue` drag wiring (snap + edge drop; work area from store) |
158
- | `useWorkspaceOverviewLiveScale` / `useWorkspaceOverviewCapture` | Overview live fit and optional DOM snapshot capture |
159
- | `useDesktopWorkArea` | Measure shell stage DOM rect → writes `useDesktopWindowStore.workArea` |
160
- | `useTerminalManager` | Register and resolve shell terminal commands (used by `app-terminal`) |
161
- | `useBlockNonInputContextMenu` | Block browser context menu on non-input elements (skipped in debug mode) |
162
-
163
- Explorer headless APIs live in **`@owdproject/module-fs`**. PrimeVue explorer UI (`DesktopExplorer*`) is in `@owdproject/kit-primevue`.
164
-
165
- ### Window lifecycle (internal contract)
166
-
167
- `WindowController` (internal) guarantees:
168
-
169
- - `focus()` / `actions.bringToFront()` — exclusive focus + monotonic z-index via `useDesktopWindowStore`
170
- - `minimize()` / `unminimize()` — toggles `state.active`
171
- - `setWorkspace(id)` — assigns window to a workspace
172
-
173
- **Removing a workspace:** `useWorkspaceManager.removeWorkspace(id)` requires at least three desktops (minimum two after removal). Open windows on the removed desktop are **migrated** (not closed) to `resolveWorkspaceFallback(id)` — the last workspace in `list` excluding the removed id. Windows without an explicit `workspace` belong to the active desktop for this purpose. If the active desktop is removed, `active` becomes the fallback target.
174
-
175
- Contract tests: `packages/core/test/windowController.contract.test.ts`, `useWorkspaceManager.contract.test.ts`.
176
-
177
- ## Theme obligations
178
-
179
- 1. Provide `Desktop.vue` (theme entry) registered as a global component by the theme module.
180
- 2. Wrap kernel components; do not reimplement window manager logic in the theme.
181
- 3. Use `provide/inject` for `windowController` only inside theme `Window*.vue` wrappers.
182
- 4. Install `@owdproject/module-fs` when needed for VFS and headless explorer APIs. PV explorer UI: `@owdproject/kit-primevue`.
183
- 5. Prefer `defineDesktopTheme` so shell defaults merge with `defu(public.desktop, themeDefaults)`.
184
-
185
- ## Extension packages
186
-
187
- Keep these packages **separate** — do not merge explorer UI kits into `module-fs` or core.
188
-
189
- | Package | Layer |
190
- |---------|--------|
191
- | `@owdproject/core` | Kernel + shell composables/utils/components (flat `runtime/`) |
192
- | `@owdproject/kit-primevue` | PrimeVue Nuxt module, `createDesktopDialogs`, PV explorer chrome |
193
- | `@owdproject/module-fs` | ZenFS virtual filesystem + headless explorer (`defineDesktopModule`, `configKey: 'fs'`). Only package that imports `@zenfs/*`. |
194
- | `@owdproject/module-persistence` | Pinia persistence (optional) |
195
- | `@owdproject/app-terminal` | Terminal app (`configKey: 'terminal'`) |
196
-
197
- Deprecated (empty modules only): `@owdproject/kit-theme`, `@owdproject/kit-fs`, `@owdproject/kit-explorer`. Do not import `@owdproject/kit-*/runtime/*` — use `@owdproject/core`, `@owdproject/module-fs`, or `@owdproject/kit-primevue` directly.
198
-
199
- **Stacks** (see also `MIGRATION_3.4.md`):
200
-
201
- | Stack | Needs `module-fs`? |
202
- |-------|-------------------|
203
- | Core + theme (windows, apps) | No |
204
- | `kit-primevue` with `{ explorer: false }` (dialogs only) | No |
205
- | `DesktopExplorer*` (default `kit-primevue`) | Yes — list in `desktop.config.ts` `modules` |
206
-
207
- Themed file explorer: `module-fs` in `desktop.config.ts` → `@owdproject/kit-primevue` in theme → theme-specific explorer shell.
208
-
209
- Dialog and maximize contracts live in core (`runtime/dialogs/desktopDialogProvider.ts`, `useDesktopDialogs`, `useToggleWindowMaximize`, `useDesktopWindowStore.workArea`). PV dialog **implementation**: `@owdproject/kit-primevue`.
210
-
211
- ## Migrating packages (3.3.2)
212
-
213
- Themes, apps, and extension modules should adopt `defineDesktopTheme` / `defineDesktopModule`, module augmentation for `configKey`, and runtime composables. See **[MIGRATION_3.3.2.md](./MIGRATION_3.3.2.md)** and the full guide in `docs/content/6.setup/5.migrate-packages-3.3.2.md`.
214
-
215
- ## Package exports (semver-stable)
216
-
217
- Supported deep imports from `@owdproject/core`:
218
-
219
- - `@owdproject/core/kit/*` — authoring helpers (`defineDesktopConfig`, `defineDesktopModule`, …)
220
- - `@owdproject/core/runtime/composables/*`
221
- - `@owdproject/core/runtime/constants/*`
222
- - `@owdproject/core/runtime/dialogs/*`
223
- - `@owdproject/core/runtime/utils/*`
224
- - `@owdproject/core/runtime/stores/*`
225
- - `@owdproject/core/runtime/components/*`
226
- - `@owdproject/core/runtime/types/*`
227
-
228
- **Not supported:** `@owdproject/core/runtime/internal/*` (controllers and other implementation details). Importing internal paths is not part of the public contract and may break without a major release.
229
-
230
- ## Versioning
231
-
232
- Breaking changes to this contract require a semver major (or minor with explicit `BREAKING CHANGE` in changelog) and coordinated theme updates in separate repos.
@@ -1,23 +0,0 @@
1
- # Migrate to @owdproject/core 3.3.2
2
-
3
- **Audience:** maintainers and coding agents updating themes, apps, or extension modules.
4
-
5
- Full guide (checklists, before/after, pitfalls): **[docs/content/6.setup/5.migrate-packages-3.3.2.md](../../docs/content/6.setup/5.migrate-packages-3.3.2.md)** (published as `/setup/migrate-packages-3.3.2` on the docs site).
6
-
7
- ## Agent one-liner
8
-
9
- Extension/app `module.ts` → `defineDesktopModule` + `types/desktop.d.ts`; theme `module.ts` → `defineDesktopTheme(definition)` + `installModule('@owdproject/kit-primevue')` + `registerThemeTailwindPath` from kit-primevue (see MIGRATION_3.4.md — the second `import.meta.url` argument was removed in 3.4); keep `defineDesktopApp` in `plugin.ts`; read config via `public.desktop.<configKey>` or `useDesktopExtension`; import authoring helpers from `@owdproject/core/kit/*` (e.g. `defineDesktopModule`), not the root barrel.
10
-
11
- ## Reference packages (monorepo)
12
-
13
- | Package | Pattern |
14
- |---------|---------|
15
- | `packages/module-fs` | `defineDesktopModule`, `configKey: 'fs'`, augmentation |
16
- | `apps/app-terminal` | `defineDesktopModule`, `configKey: 'terminal'`, `defineDesktopApp` in plugin |
17
-
18
- ## Do not
19
-
20
- - Whitelist extension keys in core
21
- - Export composables from `index.ts`
22
- - Use `appConfig.terminal` / manual `public.desktop[key] = options` in extension setup
23
- - Reintroduce `splitDesktopUserConfig`
package/MIGRATION_3.4.md DELETED
@@ -1,126 +0,0 @@
1
- # Migration 3.4 — PrimeVue out of core
2
-
3
- ## Summary
4
-
5
- - **@owdproject/core** no longer installs PrimeVue. Module-time authoring lives in `kit/` (not auto-imported). Shell composables, utils, and hint components use `runtime/` (`composables`, `utils`, `constants`, `components/Desktop/`).
6
- - **@owdproject/module-fs** — ZenFS virtual filesystem + headless explorer (composables, stores, utils; no `.vue`).
7
- - **@owdproject/kit-primevue** — Nuxt PrimeVue module, `tailwindcss-primeui`, `createDesktopDialogs`, optional explorer UI (`DesktopExplorer*`; `{ explorer: false }` for dialogs only). Installs Tailwind today (duplicate of kit-tailwind; target: depend on `@owdproject/kit-tailwind`).
8
- - **@owdproject/kit-tailwind** — optional kit for Tailwind content registration (`registerTailwindPath`, `@nuxtjs/tailwindcss`). Canonical import for apps/themes with utility classes. Used alone on Nuxt UI stacks; PV themes should layer PrimeVue on top.
9
- - **Tailwind** — no longer installed by core. Register globs from `@owdproject/kit-tailwind/kit/registerTailwindPath`; PV themes also run `installModule('@owdproject/kit-primevue')` which installs Tailwind + PrimeUI preset.
10
- - **@owdproject/kit-theme**, **kit-fs**, **kit-explorer** — deprecated (empty Nuxt modules). **No Vite import shims** — update sources to explicit paths below.
11
-
12
- ## Stacks (what is optional)
13
-
14
- | Stack | `desktop.config` `modules` | Theme |
15
- |-------|---------------------------|--------|
16
- | Desktop only | — (no `module-fs`) | theme only |
17
- | PV dialogs | — | `installModule('@owdproject/kit-primevue', { explorer: false })` |
18
- | PV file explorer | `['@owdproject/module-fs', …]` | `installModule('@owdproject/kit-primevue')` |
19
-
20
- `module-fs` is optional at the **app** level (omit from `desktop.config` if you do not need a VFS). It is **required** when you mount `DesktopExplorer*` (default `kit-primevue`).
21
-
22
- ## Themes (demo PV)
23
-
24
- ```ts
25
- await installModule('@owdproject/kit-primevue')
26
- ```
27
-
28
- Dialogs only (no explorer components, no `module-fs`):
29
-
30
- ```ts
31
- await installModule('@owdproject/kit-primevue', { explorer: false })
32
- ```
33
-
34
- Remove `kit-theme`, `kit-explorer` from `package.json` / `installModule`. Keep mounting theme `<ConfirmDialog />` groups.
35
-
36
- Dialog plugin example (core inject key):
37
-
38
- ```ts
39
- import { DESKTOP_DIALOG_PROVIDER_KEY } from '@owdproject/core/runtime/constants/desktopShellKeys'
40
- import { createDesktopDialogs } from '@owdproject/kit-primevue/runtime/dialogs/createDesktopDialogs'
41
- ```
42
-
43
- Or rely on kit-primevue client plugin (no theme plugin needed).
44
-
45
- ## Imports
46
-
47
- | Old | New |
48
- |-----|-----|
49
- | `@owdproject/kit-theme/runtime/composables/*` | `@owdproject/core/runtime/composables/*` |
50
- | `@owdproject/kit-fs/runtime/*` (headless) | `@owdproject/module-fs/runtime/*` |
51
- | `@owdproject/kit-explorer/runtime/composables/*` | `@owdproject/module-fs/runtime/composables/*` |
52
- | `@owdproject/kit-explorer/runtime/components/*` | `@owdproject/kit-primevue/runtime/components/explorer/*` |
53
- | `@owdproject/kit-fs/runtime/components/*` | `@owdproject/kit-primevue/runtime/components/explorer/*` |
54
- | `createDesktopDialogs` from kit-theme | `@owdproject/kit-primevue/runtime/dialogs/createDesktopDialogs` |
55
- | PV explorer UI (Workspace, FileEntry, Frame, …) | `@owdproject/kit-primevue` (`DesktopExplorer*`) |
56
- | Shell snap/edge hints | `@owdproject/core` (`DesktopWindowSnapHintsBase`, `DesktopWorkspaceEdgeHintsBase`) |
57
- | `provideDesktopWorkArea` / `desktopWorkAreaKey` | `useDesktopWorkArea(shellStageRef)` → `useDesktopWindowStore.workArea` |
58
- | `useDesktopWindowDragHandlers` / `*Injected` | `useWindowDragHandlers` |
59
- | `useFileSystemExplorer` | `useExplorerWindow` |
60
- | `@owdproject/core/runtime/utils/defineDesktop*` | `@owdproject/core/kit/authoring` |
61
- | `@owdproject/core/runtime/utils/utilDesktop` (`defineDesktopApp`) | `@owdproject/core/kit/defineDesktopApp` |
62
- | `registerTailwindPath` from core | `@owdproject/kit-tailwind/kit/registerTailwindPath` (canonical; also re-exported from kit-primevue during transition) |
63
- | `defineDesktopTheme(definition, import.meta.url)` (auto Tailwind) | `defineDesktopTheme(definition)` + `registerThemeTailwindPath(nuxt, import.meta.url)` from kit-tailwind after theme installs its UI kit |
64
- | `runtime/utils/utilHasDesktop` | `runtime/composables/useDesktopManifest` (`hasDesktop*`) |
65
- | `runtime/utils/windowMaximizeLayout` | `runtime/utils/utilWindowMaximizeLayout` |
66
- | `runtime/utils/utilWindow` | `runtime/utils/utilWindowControllerAdapter` |
67
-
68
- ### Tailwind content registration
69
-
70
- `@nuxtjs/tailwindcss` is installed by `kit-tailwind` or `kit-primevue` during kit `setup` (not by core). Register globs during each module's `setup`; the active kit merges them on `tailwindcss:config`.
71
-
72
- | Caller | API |
73
- |--------|-----|
74
- | Theme `module.ts` (after installing its UI kit) | `registerThemeTailwindPath(nuxt, import.meta.url)` from `@owdproject/kit-tailwind/kit/registerTailwindPath` |
75
- | Apps / extension modules with utility classes | `registerTailwindPath(nuxt, resolve('./path/to/glob'))` from `@owdproject/kit-tailwind/kit/registerTailwindPath` + `"@owdproject/kit-tailwind"` in app `dependencies` |
76
-
77
- Registered paths merge into `content.files` (not a plain array — that breaks the generated PostCSS template). Duplicate globs are deduplicated.
78
-
79
- ## module-fs
80
-
81
- Use `useDesktopShellIdentity` from `@owdproject/core/runtime/composables/useDesktopShellIdentity`.
82
-
83
- **ZenFS boundary:** `@zenfs/core` (and `@zenfs/dom`, `@zenfs/archives`) are imported only inside `@owdproject/module-fs`. Do not import `@zenfs/*` from `kit-primevue`, themes, or core — use module-fs runtime APIs (e.g. `fetchExplorerEntryMetadata`, `useExplorerWindow`).
84
-
85
- Headless explorer: `useExplorerTabs`, `createExplorerWindowMenuItems`, `useExplorerStore`, DnD composables — all from `@owdproject/module-fs/runtime/...`. `useExplorerWindow(window, t)` defaults to `createExplorerFsOperations`.
86
-
87
- ## Shell identity
88
-
89
- See `DESKTOP_KERNEL.md` (`useDesktopShellIdentity`).
90
-
91
- ## Module naming (3.4)
92
-
93
- Runtime identifiers use the `desktop-` prefix. The npm scope `@owdproject/*` and CSS classes/tokens (`.owd-*`, `--owd-*`) are unchanged.
94
-
95
- | Surface | 3.4 convention | Legacy (warn only) |
96
- |---------|----------------|-------------------|
97
- | Core Nuxt module `configKey` | `desktop` | `owd` (nuxt.config module options) |
98
- | App `plugin.ts` `name` | `desktop-<slug>-register` | `owd-<slug>-register` |
99
- | App/module `meta.name` | `desktop-app-<slug>` / `desktop-module-<slug>` | `owd-app-*` / `owd-module-*` |
100
- | Theme `meta.name` | `desktop-theme-<slug>` | `owd-theme-*` |
101
- | Desktop manifest file | `desktop.config.ts` | `owd.config.ts` |
102
- | Kernel Vue source files | `runtime/components/<area>/<Name>.vue` + `prefix: 'Desktop'` | `runtime/components/Desktop/<area>/Desktop<Name>.vue` |
103
-
104
- Global component names (`DesktopWindow`, `DesktopCore`, …) are unchanged. Deep imports of hint bases: `runtime/components/workspace/WorkspaceEdgeHintsBase.vue`, `runtime/components/window/WindowSnapHintsBase.vue`.
105
-
106
- ## Pinia store ids (3.4.1)
107
-
108
- Pinia store ids were renamed to match the `desktop-*` runtime naming. CSS classes (`.owd-*`) and npm scope (`@owdproject/*`) are unchanged.
109
-
110
- | Legacy id | New id |
111
- |-----------|--------|
112
- | `owd/desktop` | `desktop` |
113
- | `owd/desktop/workspace` | `desktop/workspace` |
114
- | `owd/desktop/window` | `desktop/window` |
115
- | `owd/desktop/volume` | `desktop/volume` |
116
- | `owd/desktop/defaultApps` | `desktop/defaultApps` |
117
- | `owd/application/${appId}/windows` | `desktop/application/${appId}/windows` |
118
- | `owd/application/${appId}/meta` | `desktop/application/${appId}/meta` |
119
-
120
- When `@owdproject/module-persistence` is installed, persisted state is migrated automatically on the first client boot (`desktop-shell-init` runs `migratePersistedStoreIds` before Pinia hydration). No app or theme code changes are required.
121
-
122
- **Breaking only for tools that read raw localStorage keys** (e.g. custom debug scripts expecting `owd/desktop`). In-browser state is preserved via migration.
123
-
124
- `pnpm validate:modules` (or `desktop validate`) warns when a package still uses legacy `meta.name: "owd-*"` or Pinia `defineStore` ids containing `owd/`.
125
-
126
- Extension modules with their own persisted stores should use the `desktop/<module>/…` id pattern (e.g. `@owdproject/module-fs` explorer: `desktop/module-fs/explorer`). Core migrates only kernel ids (`owd/desktop`, `owd/application/*`); extension packages may omit a localStorage migration — users who already had legacy keys may see a one-time reset of that module's persisted prefs.
package/PLAYGROUND.md DELETED
@@ -1,91 +0,0 @@
1
- # App and theme module playground
2
-
3
- Checklist for `@owdproject/app-*`, `@owdproject/theme-*`, and `@owdproject/module-*` packages.
4
-
5
- ## Layout
6
-
7
- ```
8
- package/
9
- src/
10
- module.ts # Nuxt module (defineNuxtModule / defineDesktopModule / defineDesktopTheme)
11
- runtime/
12
- plugin.ts # apps: defineDesktopApp + name: desktop-<slug>-register
13
- components/ # optional Vue UI
14
- playground/
15
- desktop.config.ts # defineDesktopConfig({ theme, apps, modules, ... })
16
- nuxt.config.ts # ssr: false, modules: ['@owdproject/core']
17
- package.json
18
- dist/module.mjs # after dev:prepare / prepack
19
- ```
20
-
21
- ## Apps (`@owdproject/app-*`)
22
-
23
- - `src/runtime/plugin.ts` calls `defineDesktopApp` from `@owdproject/core/kit/defineDesktopApp`
24
- - Plugin `name`: `desktop-<slug>-register` (required for `dependsOn` ordering)
25
- - `src/module.ts` `meta.name`: `desktop-app-<slug>`
26
- - Tailwind utilities in Vue: `registerTailwindPath` from `@owdproject/kit-tailwind/kit/registerTailwindPath`
27
- - `"@owdproject/kit-tailwind": "workspace:*"` in app **`dependencies`** (build-time; not replaced by the playground theme)
28
- - Playground lists the app in `desktop.config.ts` `apps: ['@owdproject/app-<slug>']`
29
-
30
- ### Theme UI stack vs app Tailwind
31
-
32
- | Concern | Package | Who declares it |
33
- |---------|---------|-----------------|
34
- | Tailwind content globs (`registerTailwindPath`) | `kit-tailwind` | **App** (and theme) `module.ts` + app `dependencies` |
35
- | PrimeVue auto-import (`InputText`, `Button`, …) | `kit-primevue` | **PV theme** via `installModule('@owdproject/kit-primevue')` — not all themes |
36
- | Nuxt UI components | `kit-nuxt-ui` | **`theme-nuxt`** — no PrimeVue |
37
-
38
- PrimeVue markup in an app requires a PV theme at runtime. `@owdproject/theme-nuxt` does not install `kit-primevue`.
39
-
40
- ## Themes (`@owdproject/theme-*`)
41
-
42
- - `defineDesktopTheme` from `@owdproject/core`
43
- - **PrimeVue themes:** `installModule('@owdproject/kit-primevue')` then `registerThemeTailwindPath(nuxt, import.meta.url)` from `@owdproject/kit-tailwind/kit/registerTailwindPath`
44
- - **Nuxt UI themes:** install `@owdproject/kit-nuxt-ui` (optional) — no PrimeVue
45
- - `meta.name`: `desktop-theme-<slug>`
46
-
47
- ## Extension modules (`@owdproject/module-*`)
48
-
49
- - `defineDesktopModule` with `meta.configKey` (e.g. `fs`, `terminal`)
50
- - Module augmentation in `types/desktop.d.ts`
51
- - Headless modules skip Tailwind registration
52
-
53
- ## Scripts (publishable packages)
54
-
55
- | Script | Purpose |
56
- |--------|---------|
57
- | `dev:prepare` | `nuxt-module-build build --stub` + playground `nuxt prepare` |
58
- | `dev` | Local playground dev server |
59
- | `dev:generate` | Static GH Pages build (`NUXT_APP_BASE_URL=/<slug>/`) |
60
- | `prepack` | Full `nuxt-module-build build` before npm publish |
61
- | `validate` | `desktop validate .` |
62
-
63
- Do **not** add a `prepare` script on publishable packages.
64
-
65
- ## Validate
66
-
67
- From package root:
68
-
69
- ```bash
70
- pnpm run dev:prepare
71
- desktop validate .
72
- ```
73
-
74
- From monorepo client root:
75
-
76
- ```bash
77
- pnpm run validate:modules
78
- ```
79
-
80
- See [`MIGRATION_3.4.md`](./MIGRATION_3.4.md) for import path changes (kit-primevue, module-fs).
81
-
82
- ## Desktop control panel (TUI)
83
-
84
- Run `pnpm desktop` from the client monorepo root.
85
-
86
- - Toggle apps/modules in the catalog (tabs `1`/`2`), pick a theme in tab `3`, then press `w` to review installs.
87
- - Each **new** package opens an install wizard: choose **npm**, **GitHub HTTPS**, or **GitHub SSH** (when SSH auth is detected).
88
- - Catalog columns: `[+]` add, `[-]` remove, `[*]` on desktop; `NPM` / `GIT` / `LOC` source slots; yellow publisher = untrusted.
89
- - Sort: `o` cycle, `O` open sort picker (Updated, Name, Stars, Installed). Pending toggles affect Installed sort.
90
- - Settings (`g`): GitHub username (fork clones), trusted orgs list, SSH test (`t`).
91
- - CLI: `desktop add <pkg> --npm`, `--dev`, `--from <user>`, `--protocol ssh`.
package/dist/module.d.mts DELETED
@@ -1,13 +0,0 @@
1
- import * as nuxt_schema from 'nuxt/schema';
2
-
3
- declare const _default: nuxt_schema.NuxtModule<{
4
- theme: string;
5
- apps: never[];
6
- modules: never[];
7
- }, {
8
- theme: string;
9
- apps: never[];
10
- modules: never[];
11
- }, false>;
12
-
13
- export { _default as default };
package/dist/module.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "name": "desktop",
3
- "configKey": "desktop",
4
- "version": "3.4.0",
5
- "builder": {
6
- "@nuxt/module-builder": "1.0.2",
7
- "unbuild": "unknown"
8
- }
9
- }