@happyvertical/smrt-svelte 0.53.3 → 0.53.5

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 (56) hide show
  1. package/AGENTS.md +4 -1
  2. package/README.md +4 -1
  3. package/agents/i18n.md +3 -0
  4. package/agents/workspace.md +53 -0
  5. package/dist/components/app/AppShell.svelte +157 -0
  6. package/dist/components/app/AppShell.svelte.d.ts +58 -0
  7. package/dist/components/app/AppShell.svelte.d.ts.map +1 -0
  8. package/dist/components/app/DockSlot.svelte +20 -0
  9. package/dist/components/app/DockSlot.svelte.d.ts +10 -0
  10. package/dist/components/app/DockSlot.svelte.d.ts.map +1 -0
  11. package/dist/components/app/OwnerSetupForm.svelte +89 -0
  12. package/dist/components/app/OwnerSetupForm.svelte.d.ts +22 -0
  13. package/dist/components/app/OwnerSetupForm.svelte.d.ts.map +1 -0
  14. package/dist/components/app/RuntimeDiagnosticsWebMcp.svelte +18 -0
  15. package/dist/components/app/RuntimeDiagnosticsWebMcp.svelte.d.ts +10 -0
  16. package/dist/components/app/RuntimeDiagnosticsWebMcp.svelte.d.ts.map +1 -0
  17. package/dist/components/app/ShellSettingsPage.svelte +32 -0
  18. package/dist/components/app/ShellSettingsPage.svelte.d.ts +19 -0
  19. package/dist/components/app/ShellSettingsPage.svelte.d.ts.map +1 -0
  20. package/dist/components/app/index.d.ts +14 -0
  21. package/dist/components/app/index.d.ts.map +1 -0
  22. package/dist/components/app/index.js +12 -0
  23. package/dist/components/app/owner-setup-types.d.ts +14 -0
  24. package/dist/components/app/owner-setup-types.d.ts.map +1 -0
  25. package/dist/components/app/owner-setup-types.js +1 -0
  26. package/dist/components/app/runtime-diagnostics-webmcp.d.ts +33 -0
  27. package/dist/components/app/runtime-diagnostics-webmcp.d.ts.map +1 -0
  28. package/dist/components/app/runtime-diagnostics-webmcp.js +68 -0
  29. package/dist/components/workspace/README.md +3 -2
  30. package/dist/components/workspace/admin-shell/ActivityTicker.svelte +92 -0
  31. package/dist/components/workspace/admin-shell/ActivityTicker.svelte.d.ts +15 -0
  32. package/dist/components/workspace/admin-shell/ActivityTicker.svelte.d.ts.map +1 -0
  33. package/dist/components/workspace/admin-shell/AdminShell.svelte +5 -2
  34. package/dist/components/workspace/admin-shell/AdminShell.svelte.d.ts +4 -1
  35. package/dist/components/workspace/admin-shell/AdminShell.svelte.d.ts.map +1 -1
  36. package/dist/components/workspace/index.d.ts +1 -0
  37. package/dist/components/workspace/index.d.ts.map +1 -1
  38. package/dist/components/workspace/index.js +1 -0
  39. package/dist/i18n/server.d.ts +1 -0
  40. package/dist/i18n/server.d.ts.map +1 -1
  41. package/dist/i18n/server.js +1 -0
  42. package/dist/i18n/strings.workspace.d.ts +16 -0
  43. package/dist/i18n/strings.workspace.d.ts.map +1 -1
  44. package/dist/i18n/strings.workspace.js +17 -0
  45. package/dist/mcp-apps/McpAppsBridge.svelte +123 -0
  46. package/dist/mcp-apps/McpAppsBridge.svelte.d.ts +38 -0
  47. package/dist/mcp-apps/McpAppsBridge.svelte.d.ts.map +1 -0
  48. package/dist/mcp-apps/index.d.ts +1 -0
  49. package/dist/mcp-apps/index.d.ts.map +1 -1
  50. package/dist/mcp-apps/index.js +1 -0
  51. package/dist/mcp-apps/mcp-apps.svelte.d.ts.map +1 -1
  52. package/dist/mcp-apps/mcp-apps.svelte.js +10 -1
  53. package/dist/mcp-apps/strings.d.ts +7 -0
  54. package/dist/mcp-apps/strings.d.ts.map +1 -0
  55. package/dist/mcp-apps/strings.js +7 -0
  56. package/package.json +26 -15
package/AGENTS.md CHANGED
@@ -14,6 +14,7 @@ subpath you are editing. This file keeps what holds in every module.
14
14
  | `src/themes/` + `src/theme/` | which theme system is canonical and the full `--smrt-*` design-token vocabulary with its alias rules | [agents/themes.md](agents/themes.md) |
15
15
  | `src/test-support/` + `__tests__/` | the golden-test harness and pattern for Svelte component tests | [agents/testing.md](agents/testing.md) |
16
16
  | `src/components/settings/` (`./settings`) | `SettingsCatalog`, `paginateSettingsCatalog`, and the summary-vs-detail scalability contract | [agents/settings.md](agents/settings.md) |
17
+ | `src/components/app/` (`./app`) | `AppShell` (Provider + ThemeProvider + theme CSS + AdminShell + nav/dock slots), `OwnerSetupForm` (props-driven first-run owner form), `ShellSettingsPage`, `RuntimeDiagnosticsWebMcp`. Browser-only; no `$app/*` or server imports | [agents/workspace.md](agents/workspace.md#app-shell-and-owner-setup-app) |
17
18
  | `src/components/workspace/` (`./workspace` + `./web`) | the AdminShell family and its principles, the legacy ToolsDock surface, the `./web` activity-feed and `updateAvailable` adapters, and server-side dock gates | [agents/workspace.md](agents/workspace.md) |
18
19
  | `src/web/remote-query.svelte.ts` | Svelte 5 binding for query-shaped remote pages: rows, page, totals, loading/refreshing/stale/error, retry, last-updated, and query-scoped live subscriptions (#2445) | — |
19
20
  | `src/web/list-data-surface.svelte.ts` (`mountListDataSurface`) | One-call registration of an existing, non-`DataTable` list (already mirroring a headless `DataTableController`) as a mounted `DataSurfaceDescriptor` — a same-behavior port of `registerContentListDataSurface`'s registration/translation logic (`@happyvertical/smrt-content/svelte`), generalized off ContentList's view-mode concept, so any custom list markup can adopt it directly instead of hand-mirroring the registry contract. Not yet unified behind a shared `@happyvertical/smrt-ui/data` implementation (#2917) — this copy is currently ahead; see its own module doc comment for the current, authoritative list of divergences #2917 must adopt rather than assume parity (#2906) | — |
@@ -44,7 +45,9 @@ versioned normalizers and the conformance fixture together.
44
45
  The explicit `./mcp-apps` subpath owns portable MCP Apps mount/dispose bindings.
45
46
  It reuses `compileViewIntentToolSpec` for local registry interactions, never
46
47
  advertises browser closures as remote tools, and does not use
47
- `document.modelContext`. See [bridge contract](../mcp-apps/README.md). Its browser
48
+ `document.modelContext`. `McpAppsBridge` is the shipped view shell: portable
49
+ display-mode request only when the host advertises it, otherwise inline status;
50
+ no OpenAI helpers. See [bridge contract](../mcp-apps/README.md). Its browser
48
51
  gate is `e2e/mcp-apps.spec.ts`, including trusted human staged-review enforcement.
49
52
 
50
53
  ## The UI split — primitive-adoption contract (#1589)
package/README.md CHANGED
@@ -505,6 +505,8 @@ importable, even if it appears in `dist/`.
505
505
  | `@happyvertical/smrt-svelte/forms` | Form inputs (TextInput, Select, MoneyInput, DateTimeInput, Toggle, etc.) |
506
506
  | `@happyvertical/smrt-svelte/settings` | Server-paged settings search, selection, and list/detail layout (`SettingsCatalog`, `paginateSettingsCatalog`) |
507
507
  | `@happyvertical/smrt-svelte/workspace` | AdminShell, ShellState, tenant nav, focus tools, settings, activities, and system/app panels |
508
+ | `@happyvertical/smrt-svelte/app` | `AppShell` (Provider + themes + AdminShell + nav/dock slots), `OwnerSetupForm` (first-run owner setup), `ShellSettingsPage`, `RuntimeDiagnosticsWebMcp` |
509
+ | `@happyvertical/smrt-svelte/app/runtime-diagnostics` | Svelte-free diagnostics WebMCP registration and its tool name/endpoint constants, importable from server routes |
508
510
  | `@happyvertical/smrt-svelte/workspace/legacy` | Opt-in ToolsDock compatibility surface for applications migrating to AdminShell |
509
511
  | `@happyvertical/smrt-svelte/workspace/server` | Server-side workspace helpers (Node only) |
510
512
  | `@happyvertical/smrt-svelte/workspace/live` | `systemFeed` — the AdminShell system scope (jobs/schedules/dispatch) polled from an app status endpoint; deliberately carries no `smrt-web` dependency |
@@ -639,7 +641,8 @@ Use `shell.setPanelState(edge, 'hidden' | 'collapsed' | 'expanded')` to persist
639
641
  runtime panel preferences; app-configured hidden edges remain unavailable.
640
642
  AdminShell keeps a discoverable tenant collapse control with supplied navigation
641
643
  (`showTenantToggle={false}` opts out), a Menu opener in narrow layouts, and the
642
- system toggle alongside a custom `systemBar`. Closed narrow drawers are inert;
644
+ system toggle alongside a custom `systemBar` that has a `systemPanel` to open
645
+ (a `systemBar` with no `systemPanel` owns the bottom band and draws no toggle). Closed narrow drawers are inert;
643
646
  opening focuses the first control, and closing or Escape restores the opener.
644
647
  TenantNav accepts `density="touch"` for canonical 48px link targets, including
645
648
  collapsed rail links; omit density to inherit the theme's control density.
package/agents/i18n.md CHANGED
@@ -30,6 +30,9 @@ languages root is imported only by the Node-only `/i18n/server` subpath. See
30
30
  — a consumer's load function calls it for the request locale and passes the
31
31
  result to `<Provider>`. It seeds the languages registry from `defineMessages`
32
32
  defaults, then resolves each key through the override/tenant/locale chain.
33
+ `server.ts` side-effect-imports every shipped catalog (including
34
+ `mcp-apps/strings.ts`) so its keys resolve even when the components are
35
+ never imported server-side; add new catalogs there.
33
36
  - Enforcement: `scripts/check-hardcoded-strings.mjs` (`pnpm
34
37
  check:hardcoded-strings`) flags hardcoded prose in `.svelte` markup —
35
38
  report-only until a package's extraction completes, then add it to the
@@ -75,6 +75,26 @@ and touch input across mobile widths and desktop panel-state combinations.
75
75
 
76
76
  See `src/components/workspace/MIGRATION.md` for the old-to-new concept map.
77
77
 
78
+ ### Activity ticker
79
+
80
+ `ActivityTicker` accepts app-owned `activities: ReadonlyArray<ShellActivity>` plus
81
+ optional `label` and `emptyLabel`. It never fetches data or establishes authority.
82
+ Render it in `AdminShell`'s `systemBar` slot with `activities={shell.activities}`;
83
+ render `ActivityList filter={{ status: 'running' }}` in `systemPanel` for details.
84
+ Connect the same registry to actual jobs through an authenticated app adapter or
85
+ the `activityFeed` below. Queued and terminal records never appear as running.
86
+
87
+ A single running activity is static. Multiple activities scroll continuously with
88
+ a persistent Pause/Resume control and pause on hover/focus. A separate accessible
89
+ list contains each process once; visual loop copies are hidden from assistive
90
+ technology. Reduced motion disables animation and allows manual horizontal
91
+ scrolling. Optional finite 0–100 progress is shown; no progress is inferred.
92
+
93
+ Focused validation: `pnpm --filter @happyvertical/smrt-svelte exec vitest run
94
+ src/components/workspace/__tests__/ActivityTicker.test.ts
95
+ src/components/workspace/__tests__/index.test.ts`, then the activity ticker's
96
+ Chromium scenarios via the package's documented `test:e2e` command.
97
+
78
98
  ### Live activity feed adapter (`./web`, #1779)
79
99
 
80
100
  `activityFeed({ collection, map, shell })` (from `@happyvertical/smrt-svelte/web`)
@@ -149,3 +169,36 @@ failure; a context change or later successful refresh clears the signal, and
149
169
  success applies the new snapshot.
150
170
  Availability is never an authorization boundary—server operations must still
151
171
  enforce permissions.
172
+
173
+ `ActivityTicker` accepts optional `statuses` restricted to queued/running; running-only remains the default. Opting into queued work adds an explicit localized Queued label without progress. Terminal outcomes belong in expanded `ActivityList`, with retention controlled by the app-owned data source.
174
+
175
+ ## App shell and owner setup (`./app`)
176
+
177
+ `@happyvertical/smrt-svelte/app` (`src/components/app/`) is browser-only. It
178
+ lives beside, not inside, `./workspace` so the AdminShell barrel stays free of
179
+ `Provider` and its tests.
180
+
181
+ - `AppShell` composes `Provider` (`webmcp`, `user`, `permissions` pass through
182
+ unchanged), `ThemeProvider`, the theme CSS (`themes/styles/{all,fonts}.css`
183
+ are imported by the component — forgetting them leaves `--smrt-*` unresolved),
184
+ `AdminShell`, `TenantNav` from the consumer's `nav`/`navGroups`/`currentHref`,
185
+ and an `AppScopePanel`. Panels start collapsed as in `AdminShell`; pass
186
+ `config` to change that. `dock` is a snippet rendered inside the shell: a host
187
+ places its assistant there in a `ShellDockTool`, so this package never
188
+ imports `smrt-chat`. It receives the Provider's `DataSurfaceRegistry`
189
+ (`{#snippet dock(registry)}`), the instance mounted routes register on
190
+ when `webmcp` UI is on; pass it to `<AssistantDock {registry} />`. `runtimeDiagnostics` (default false) mounts the
191
+ read-only `smrt.runtime.diagnostics.read` WebMCP tool. Server code that
192
+ lists that tool (the diagnostics route's `toolNames`) imports
193
+ `RUNTIME_DIAGNOSTICS_WEBMCP_TOOL_NAME` from `./app/runtime-diagnostics`,
194
+ which is plain TypeScript; the `./app` barrel loads Svelte components and
195
+ theme CSS.
196
+ - `OwnerSetupForm` is props-driven and imports nothing server-side. Contract
197
+ (lane 3369 server): `default` form action; fields `token` (hidden), `name`,
198
+ `email`, optional `tenantName` (`askTenantName`); `load` data
199
+ `{ available, token }` (`available: false` renders a neutral unavailable
200
+ state); failures `fail(status, { code, message })`, `message` shown as given
201
+ and never branched on. Pass `data` and `form` straight from the route. The
202
+ form is a plain `method="POST"`; pass `enhance` from `$app/forms` to enhance
203
+ it. The token is a hidden field only and is never stored, logged or shown.
204
+ Single-use, loopback-only enforcement stays server-side.
@@ -0,0 +1,157 @@
1
+ <script lang="ts">
2
+ import {
3
+ type ColorScheme,
4
+ type ThemePreset,
5
+ ThemeProvider,
6
+ } from '@happyvertical/smrt-ui/themes';
7
+ import '@happyvertical/smrt-ui/themes/styles/all.css';
8
+ import '@happyvertical/smrt-ui/themes/styles/fonts.css';
9
+ import type { DataSurfaceRegistry } from '@happyvertical/smrt-ui/data';
10
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
11
+ import type { Snippet } from 'svelte';
12
+ import { M } from '../../i18n/strings.workspace.js';
13
+ import Provider from '../../Provider.svelte';
14
+ import type { User } from '../../state/app-state.js';
15
+ import type { WebMcpProviderConfig } from '../../web/webmcp-provider.js';
16
+ import AdminShell from '../workspace/admin-shell/AdminShell.svelte';
17
+ import AppScopePanel from '../workspace/admin-shell/AppScopePanel.svelte';
18
+ import TenantNav from '../workspace/admin-shell/TenantNav.svelte';
19
+ import type {
20
+ ShellNavGroup,
21
+ ShellNavItem,
22
+ ShellPanelDefaults,
23
+ } from '../workspace/admin-shell/types.js';
24
+ import DockSlot from './DockSlot.svelte';
25
+ import RuntimeDiagnosticsWebMcp from './RuntimeDiagnosticsWebMcp.svelte';
26
+
27
+ interface Props {
28
+ /** Application name shown in the shell brand and app panel. */
29
+ title?: string;
30
+ /** Secondary line under the application name in the shell brand. */
31
+ subtitle?: string;
32
+ /** localStorage key for the user's shell layout preferences. */
33
+ storageKey?: string;
34
+ /** Navigation rendered in the tenant (left) panel. */
35
+ nav?: ShellNavItem[];
36
+ /** Grouped navigation sections rendered below the flat `nav` items. */
37
+ navGroups?: ShellNavGroup[];
38
+ /** Current path, used to highlight the active link (e.g. `page.url.pathname`). */
39
+ currentHref?: string;
40
+ /** Tenant label shown in the app panel. */
41
+ tenantLabel?: string;
42
+ /** Environment badge text (e.g. `local`). */
43
+ environment?: string;
44
+ /** When set, the app panel links here (e.g. a settings route). */
45
+ settingsHref?: string;
46
+ /** Options for the Provider's WebMCP integration; passed through unchanged. */
47
+ webmcp?: boolean | WebMcpProviderConfig;
48
+ /** Authenticated user forwarded to the Provider; `null` renders the shell signed out. */
49
+ user?: User | null;
50
+ /** The user's resolved permission slugs, forwarded to the Provider for permission-gated UI. */
51
+ permissions?: string[];
52
+ /** Register the read-only runtime diagnostics WebMCP tool. */
53
+ runtimeDiagnostics?: boolean;
54
+ /** Initial panel states and presentation; forwarded to AdminShell. */
55
+ config?: ShellPanelDefaults;
56
+ /** Theme preset applied by the ThemeProvider. */
57
+ preset?: ThemePreset;
58
+ /** Light, dark or system color scheme; the user's persisted choice wins. */
59
+ colorScheme?: ColorScheme;
60
+ /** Extra app-panel content (e.g. selected-tenant notes). */
61
+ appPanelDocs?: Snippet;
62
+ /**
63
+ * Dock slot, rendered inside the shell so a host can place an assistant in
64
+ * a `ShellDockTool` without this package depending on it. It receives the
65
+ * `DataSurfaceRegistry` of the Provider the shell mounts, the same instance
66
+ * mounted routes register their surfaces on, so
67
+ * `<AssistantDock {registry} />` sees them with no second registry. Routes
68
+ * register on it when the `webmcp` UI is enabled (`webmcp: true`).
69
+ */
70
+ dock?: Snippet<[DataSurfaceRegistry]>;
71
+ children: Snippet;
72
+ }
73
+
74
+ let {
75
+ title = 'SMRT',
76
+ subtitle,
77
+ storageKey = 'smrt-app-shell',
78
+ nav = [],
79
+ navGroups = [],
80
+ currentHref = '',
81
+ tenantLabel = '',
82
+ environment = 'local',
83
+ settingsHref,
84
+ webmcp = false,
85
+ user = null,
86
+ permissions = [],
87
+ runtimeDiagnostics = false,
88
+ config,
89
+ preset = 'smrt',
90
+ colorScheme = 'system',
91
+ appPanelDocs,
92
+ dock,
93
+ children,
94
+ }: Props = $props();
95
+ const { t } = useI18n();
96
+ const hasNav = $derived(nav.length > 0 || navGroups.length > 0);
97
+ </script>
98
+
99
+ <Provider {webmcp} {user} {permissions}>
100
+ <RuntimeDiagnosticsWebMcp enabled={runtimeDiagnostics} />
101
+ <ThemeProvider {preset} {colorScheme} persist={true}>
102
+ <AdminShell {title} {subtitle} {storageKey} {config} path={currentHref}>
103
+ {#snippet appPanel()}
104
+ <AppScopePanel
105
+ appName={title}
106
+ tenantName={tenantLabel}
107
+ {environment}
108
+ showSettings={false}
109
+ >
110
+ {#snippet docs()}
111
+ {@render appPanelDocs?.()}
112
+ {#if settingsHref}
113
+ <a href={settingsHref}>{t(M['ui.app_shell.settings_link'])}</a>
114
+ {/if}
115
+ {/snippet}
116
+ </AppScopePanel>
117
+ {/snippet}
118
+
119
+ {#snippet tenantPanel()}
120
+ {#if hasNav}
121
+ <TenantNav
122
+ items={nav}
123
+ groups={navGroups}
124
+ {currentHref}
125
+ aria-label={t(M['ui.app_shell.navigation'])}
126
+ />
127
+ {/if}
128
+ {/snippet}
129
+
130
+ {#if dock}
131
+ <DockSlot {dock} />
132
+ {/if}
133
+ {@render children()}
134
+ </AdminShell>
135
+ </ThemeProvider>
136
+ </Provider>
137
+
138
+ <style>
139
+ :global(*),
140
+ :global(*::before),
141
+ :global(*::after) {
142
+ box-sizing: border-box;
143
+ }
144
+ :global(html),
145
+ :global(body) {
146
+ min-height: 100%;
147
+ margin: 0;
148
+ }
149
+ :global(body) {
150
+ background: var(--smrt-color-background);
151
+ color: var(--smrt-color-on-background);
152
+ font-family: var(--smrt-font-family, Inter, system-ui, sans-serif);
153
+ }
154
+ a {
155
+ color: var(--smrt-color-primary);
156
+ }
157
+ </style>
@@ -0,0 +1,58 @@
1
+ import { type ColorScheme, type ThemePreset } from '@happyvertical/smrt-ui/themes';
2
+ import '@happyvertical/smrt-ui/themes/styles/all.css';
3
+ import '@happyvertical/smrt-ui/themes/styles/fonts.css';
4
+ import type { DataSurfaceRegistry } from '@happyvertical/smrt-ui/data';
5
+ import type { Snippet } from 'svelte';
6
+ import type { User } from '../../state/app-state.js';
7
+ import type { WebMcpProviderConfig } from '../../web/webmcp-provider.js';
8
+ import type { ShellNavGroup, ShellNavItem, ShellPanelDefaults } from '../workspace/admin-shell/types.js';
9
+ interface Props {
10
+ /** Application name shown in the shell brand and app panel. */
11
+ title?: string;
12
+ /** Secondary line under the application name in the shell brand. */
13
+ subtitle?: string;
14
+ /** localStorage key for the user's shell layout preferences. */
15
+ storageKey?: string;
16
+ /** Navigation rendered in the tenant (left) panel. */
17
+ nav?: ShellNavItem[];
18
+ /** Grouped navigation sections rendered below the flat `nav` items. */
19
+ navGroups?: ShellNavGroup[];
20
+ /** Current path, used to highlight the active link (e.g. `page.url.pathname`). */
21
+ currentHref?: string;
22
+ /** Tenant label shown in the app panel. */
23
+ tenantLabel?: string;
24
+ /** Environment badge text (e.g. `local`). */
25
+ environment?: string;
26
+ /** When set, the app panel links here (e.g. a settings route). */
27
+ settingsHref?: string;
28
+ /** Options for the Provider's WebMCP integration; passed through unchanged. */
29
+ webmcp?: boolean | WebMcpProviderConfig;
30
+ /** Authenticated user forwarded to the Provider; `null` renders the shell signed out. */
31
+ user?: User | null;
32
+ /** The user's resolved permission slugs, forwarded to the Provider for permission-gated UI. */
33
+ permissions?: string[];
34
+ /** Register the read-only runtime diagnostics WebMCP tool. */
35
+ runtimeDiagnostics?: boolean;
36
+ /** Initial panel states and presentation; forwarded to AdminShell. */
37
+ config?: ShellPanelDefaults;
38
+ /** Theme preset applied by the ThemeProvider. */
39
+ preset?: ThemePreset;
40
+ /** Light, dark or system color scheme; the user's persisted choice wins. */
41
+ colorScheme?: ColorScheme;
42
+ /** Extra app-panel content (e.g. selected-tenant notes). */
43
+ appPanelDocs?: Snippet;
44
+ /**
45
+ * Dock slot, rendered inside the shell so a host can place an assistant in
46
+ * a `ShellDockTool` without this package depending on it. It receives the
47
+ * `DataSurfaceRegistry` of the Provider the shell mounts, the same instance
48
+ * mounted routes register their surfaces on, so
49
+ * `<AssistantDock {registry} />` sees them with no second registry. Routes
50
+ * register on it when the `webmcp` UI is enabled (`webmcp: true`).
51
+ */
52
+ dock?: Snippet<[DataSurfaceRegistry]>;
53
+ children: Snippet;
54
+ }
55
+ declare const AppShell: import("svelte").Component<Props, {}, "">;
56
+ type AppShell = ReturnType<typeof AppShell>;
57
+ export default AppShell;
58
+ //# sourceMappingURL=AppShell.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppShell.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/app/AppShell.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAEjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,8CAA8C,CAAC;AACtD,OAAO,gDAAgD,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIzE,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,kBAAkB,EACnB,MAAM,mCAAmC,CAAC;AAK3C,UAAU,KAAK;IACb,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC;IACrB,uEAAuE;IACvE,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAC5B,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,OAAO,GAAG,oBAAoB,CAAC;IACxC,yFAAyF;IACzF,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,sEAAsE;IACtE,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,iDAAiD;IACjD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACtC,QAAQ,EAAE,OAAO,CAAC;CACnB;AA8ED,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { DataSurfaceRegistry } from '@happyvertical/smrt-ui/data';
3
+ import type { Snippet } from 'svelte';
4
+ import { tryGetWebMcpUiContext } from '../../web/webmcp-ui-context.js';
5
+
6
+ interface Props {
7
+ /** The host's dock snippet; receives the Provider's data-surface registry. */
8
+ dock: Snippet<[DataSurfaceRegistry]>;
9
+ }
10
+
11
+ let { dock }: Props = $props();
12
+ // Rendered inside the Provider, so this is the registry mounted routes
13
+ // register their surfaces on (when the Provider's WebMCP UI is on).
14
+ const ui = tryGetWebMcpUiContext();
15
+ const registry = $derived(ui?.dataSurfaceRegistry);
16
+ </script>
17
+
18
+ {#if registry}
19
+ {@render dock(registry)}
20
+ {/if}
@@ -0,0 +1,10 @@
1
+ import type { DataSurfaceRegistry } from '@happyvertical/smrt-ui/data';
2
+ import type { Snippet } from 'svelte';
3
+ interface Props {
4
+ /** The host's dock snippet; receives the Provider's data-surface registry. */
5
+ dock: Snippet<[DataSurfaceRegistry]>;
6
+ }
7
+ declare const DockSlot: import("svelte").Component<Props, {}, "">;
8
+ type DockSlot = ReturnType<typeof DockSlot>;
9
+ export default DockSlot;
10
+ //# sourceMappingURL=DockSlot.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DockSlot.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/app/DockSlot.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAItC,UAAU,KAAK;IACb,8EAA8E;IAC9E,IAAI,EAAE,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;CACtC;AAoBD,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,89 @@
1
+ <script lang="ts">
2
+ import { Input } from '@happyvertical/smrt-ui/forms';
3
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
4
+ import { Button } from '@happyvertical/smrt-ui/ui';
5
+ import { M } from '../../i18n/strings.workspace.js';
6
+ import type {
7
+ OwnerSetupData,
8
+ OwnerSetupFormResult,
9
+ } from './owner-setup-types.js';
10
+
11
+ interface Props {
12
+ /** The route's `load` data. The token is rendered only as a hidden field. */
13
+ data: OwnerSetupData;
14
+ /** The route's `form` prop (action failure data). */
15
+ form?: OwnerSetupFormResult | null;
16
+ /** Also ask for an optional workspace name (field `tenantName`). */
17
+ askTenantName?: boolean;
18
+ /** Form action URL; omit to post to the current route's default action. */
19
+ action?: string;
20
+ /**
21
+ * SvelteKit's `enhance` from `$app/forms`, for progressive enhancement.
22
+ * Optional: without it the form is a plain POST that works without JS.
23
+ */
24
+ enhance?: (form: HTMLFormElement) => { destroy?: () => void } | void;
25
+ }
26
+
27
+ let {
28
+ data,
29
+ form = null,
30
+ askTenantName = false,
31
+ action,
32
+ enhance,
33
+ }: Props = $props();
34
+ const { t } = useI18n();
35
+
36
+ function enhanceForm(form: HTMLFormElement) {
37
+ const handle = enhance?.(form);
38
+ return () => handle?.destroy?.();
39
+ }
40
+ </script>
41
+
42
+ <main class="smrt-owner-setup">
43
+ <h1>{t(M['ui.owner_setup.heading'])}</h1>
44
+ {#if !data.available}
45
+ <p data-owner-setup="unavailable">{t(M['ui.owner_setup.unavailable'])}</p>
46
+ {:else}
47
+ <p>{t(M['ui.owner_setup.intro'])}</p>
48
+ {#if form?.message}<p role="alert" data-owner-setup="error">{form.message}</p>{/if}
49
+ <!-- raw-primitive-allow: native POST form so owner setup works without JavaScript; the host's SvelteKit `enhance` is attached when available -->
50
+ <form method="POST" {action} {@attach enhanceForm}>
51
+ <!-- raw-primitive-allow: hidden, non-interactive carrier for the single-use bootstrap token -->
52
+ <input type="hidden" name="token" value={data.token} />
53
+ <label>
54
+ {t(M['ui.owner_setup.name'])}
55
+ <Input name="name" autocomplete="name" required />
56
+ </label>
57
+ <label>
58
+ {t(M['ui.owner_setup.email'])}
59
+ <Input name="email" type="email" autocomplete="email" required />
60
+ </label>
61
+ {#if askTenantName}
62
+ <label>
63
+ {t(M['ui.owner_setup.tenant_name'])}
64
+ <Input name="tenantName" autocomplete="organization" />
65
+ </label>
66
+ {/if}
67
+ <Button type="submit">{t(M['ui.owner_setup.submit'])}</Button>
68
+ </form>
69
+ {/if}
70
+ </main>
71
+
72
+ <style>
73
+ .smrt-owner-setup {
74
+ max-width: 36rem;
75
+ margin: 4rem auto;
76
+ padding: 1.5rem;
77
+ }
78
+ form {
79
+ display: grid;
80
+ gap: 1rem;
81
+ }
82
+ label {
83
+ display: grid;
84
+ gap: 0.35rem;
85
+ }
86
+ [role='alert'] {
87
+ color: var(--smrt-color-error, #b3261e);
88
+ }
89
+ </style>
@@ -0,0 +1,22 @@
1
+ import type { OwnerSetupData, OwnerSetupFormResult } from './owner-setup-types.js';
2
+ interface Props {
3
+ /** The route's `load` data. The token is rendered only as a hidden field. */
4
+ data: OwnerSetupData;
5
+ /** The route's `form` prop (action failure data). */
6
+ form?: OwnerSetupFormResult | null;
7
+ /** Also ask for an optional workspace name (field `tenantName`). */
8
+ askTenantName?: boolean;
9
+ /** Form action URL; omit to post to the current route's default action. */
10
+ action?: string;
11
+ /**
12
+ * SvelteKit's `enhance` from `$app/forms`, for progressive enhancement.
13
+ * Optional: without it the form is a plain POST that works without JS.
14
+ */
15
+ enhance?: (form: HTMLFormElement) => {
16
+ destroy?: () => void;
17
+ } | void;
18
+ }
19
+ declare const OwnerSetupForm: import("svelte").Component<Props, {}, "">;
20
+ type OwnerSetupForm = ReturnType<typeof OwnerSetupForm>;
21
+ export default OwnerSetupForm;
22
+ //# sourceMappingURL=OwnerSetupForm.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnerSetupForm.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/app/OwnerSetupForm.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAGhC,UAAU,KAAK;IACb,6EAA6E;IAC7E,IAAI,EAAE,cAAc,CAAC;IACrB,qDAAqD;IACrD,IAAI,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACnC,oEAAoE;IACpE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK;QAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;CACtE;AA0DD,QAAA,MAAM,cAAc,2CAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import { registerRuntimeDiagnosticsWebMcp } from './runtime-diagnostics-webmcp.js';
3
+
4
+ interface Props {
5
+ /** Register the read-only diagnostics tool while true. */
6
+ enabled?: boolean;
7
+ /** Same-origin diagnostics endpoint. */
8
+ endpoint?: string;
9
+ }
10
+
11
+ let { enabled = true, endpoint }: Props = $props();
12
+
13
+ $effect(() => {
14
+ if (!enabled) return;
15
+ const owner = registerRuntimeDiagnosticsWebMcp({ endpoint });
16
+ return () => owner?.dispose();
17
+ });
18
+ </script>
@@ -0,0 +1,10 @@
1
+ interface Props {
2
+ /** Register the read-only diagnostics tool while true. */
3
+ enabled?: boolean;
4
+ /** Same-origin diagnostics endpoint. */
5
+ endpoint?: string;
6
+ }
7
+ declare const RuntimeDiagnosticsWebMcp: import("svelte").Component<Props, {}, "">;
8
+ type RuntimeDiagnosticsWebMcp = ReturnType<typeof RuntimeDiagnosticsWebMcp>;
9
+ export default RuntimeDiagnosticsWebMcp;
10
+ //# sourceMappingURL=RuntimeDiagnosticsWebMcp.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RuntimeDiagnosticsWebMcp.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/app/RuntimeDiagnosticsWebMcp.svelte.ts"],"names":[],"mappings":"AAMA,UAAU,KAAK;IACb,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAgBD,QAAA,MAAM,wBAAwB,2CAAwC,CAAC;AACvE,KAAK,wBAAwB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC5E,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,32 @@
1
+ <script lang="ts">
2
+ import { useI18n } from '@happyvertical/smrt-ui/i18n';
3
+ import { M } from '../../i18n/strings.workspace.js';
4
+ import ShellSettingsPanel from '../workspace/admin-shell/ShellSettingsPanel.svelte';
5
+
6
+ const { t } = useI18n();
7
+ </script>
8
+
9
+ <section class="smrt-shell-settings-page">
10
+ <header>
11
+ <h1>{t(M['ui.shell_settings_page.heading'])}</h1>
12
+ <p>{t(M['ui.shell_settings_page.description'])}</p>
13
+ </header>
14
+ <ShellSettingsPanel />
15
+ </section>
16
+
17
+ <style>
18
+ .smrt-shell-settings-page {
19
+ display: grid;
20
+ gap: var(--smrt-spacing-6, 1.5rem);
21
+ max-width: 720px;
22
+ padding: var(--smrt-spacing-8, 2rem);
23
+ }
24
+ header {
25
+ display: grid;
26
+ gap: var(--smrt-spacing-2, 0.5rem);
27
+ }
28
+ h1,
29
+ p {
30
+ margin: 0;
31
+ }
32
+ </style>
@@ -0,0 +1,19 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const ShellSettingsPage: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type ShellSettingsPage = InstanceType<typeof ShellSettingsPage>;
18
+ export default ShellSettingsPage;
19
+ //# sourceMappingURL=ShellSettingsPage.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShellSettingsPage.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/app/ShellSettingsPage.svelte.ts"],"names":[],"mappings":"AA2BA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,iBAAiB;;kBAA+E,CAAC;AACrF,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @happyvertical/smrt-svelte/app
3
+ *
4
+ * Packaged application shell and first-run owner setup UI. Browser-only: no
5
+ * server or `$app/*` imports. Pair with the server `load`/`actions` from
6
+ * `@happyvertical/smrt-app-runtime/sveltekit`.
7
+ */
8
+ export { default as AppShell } from './AppShell.svelte';
9
+ export { default as OwnerSetupForm } from './OwnerSetupForm.svelte';
10
+ export type { OwnerSetupData, OwnerSetupFormResult, } from './owner-setup-types.js';
11
+ export { default as RuntimeDiagnosticsWebMcp } from './RuntimeDiagnosticsWebMcp.svelte';
12
+ export { createRuntimeDiagnosticsWebMcpTool, type RegisterRuntimeDiagnosticsWebMcpOptions, RUNTIME_DIAGNOSTICS_ENDPOINT, RUNTIME_DIAGNOSTICS_WEBMCP_TOOL_NAME, type RuntimeDiagnosticsWebMcpOwner, registerRuntimeDiagnosticsWebMcp, } from './runtime-diagnostics-webmcp.js';
13
+ export { default as ShellSettingsPage } from './ShellSettingsPage.svelte';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/app/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,YAAY,EACV,cAAc,EACd,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,EACL,kCAAkC,EAClC,KAAK,uCAAuC,EAC5C,4BAA4B,EAC5B,oCAAoC,EACpC,KAAK,6BAA6B,EAClC,gCAAgC,GACjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @happyvertical/smrt-svelte/app
3
+ *
4
+ * Packaged application shell and first-run owner setup UI. Browser-only: no
5
+ * server or `$app/*` imports. Pair with the server `load`/`actions` from
6
+ * `@happyvertical/smrt-app-runtime/sveltekit`.
7
+ */
8
+ export { default as AppShell } from './AppShell.svelte';
9
+ export { default as OwnerSetupForm } from './OwnerSetupForm.svelte';
10
+ export { default as RuntimeDiagnosticsWebMcp } from './RuntimeDiagnosticsWebMcp.svelte';
11
+ export { createRuntimeDiagnosticsWebMcpTool, RUNTIME_DIAGNOSTICS_ENDPOINT, RUNTIME_DIAGNOSTICS_WEBMCP_TOOL_NAME, registerRuntimeDiagnosticsWebMcp, } from './runtime-diagnostics-webmcp.js';
12
+ export { default as ShellSettingsPage } from './ShellSettingsPage.svelte';
@@ -0,0 +1,14 @@
1
+ /** Shape of the setup route's `load` data. */
2
+ export interface OwnerSetupData {
3
+ /** False (with an empty token) when setup is not offered. */
4
+ available: boolean;
5
+ /** Single-use bootstrap token carried from the setup link. */
6
+ token: string;
7
+ }
8
+ /** Shape of the setup action's failure data (`fail(status, { code, message })`). */
9
+ export interface OwnerSetupFormResult {
10
+ code?: string;
11
+ /** Fixed server-provided text; displayed as given. */
12
+ message?: string;
13
+ }
14
+ //# sourceMappingURL=owner-setup-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"owner-setup-types.d.ts","sourceRoot":"","sources":["../../../src/components/app/owner-setup-types.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,SAAS,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oFAAoF;AACpF,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1 @@
1
+ export {};