@happyvertical/smrt-svelte 0.51.36 → 0.51.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -38,6 +38,12 @@ principal tools, opaque action preview/apply, and ContentList/report adapters.
38
38
  When changing a data-surface wire field or refusal reason, update the
39
39
  versioned normalizers and the conformance fixture together.
40
40
 
41
+ The explicit `./mcp-apps` subpath owns portable MCP Apps mount/dispose bindings.
42
+ It reuses `compileViewIntentToolSpec` for local registry interactions, never
43
+ advertises browser closures as remote tools, and does not use
44
+ `document.modelContext`. See [bridge contract](../mcp-apps/README.md). Its browser
45
+ gate is `e2e/mcp-apps.spec.ts`, including trusted human staged-review enforcement.
46
+
41
47
  ## The UI split — primitive-adoption contract (#1589)
42
48
 
43
49
  SMRT's shared UI primitives are split by concern: **`smrt-ui` owns the
package/README.md CHANGED
@@ -438,3 +438,12 @@ all other currencies render their ISO code for deterministic SSR hydration.
438
438
 
439
439
  - `@happyvertical/smrt-types` -- shared type definitions
440
440
  - Peer: `svelte` >=5.18.2, `@happyvertical/smrt-jobs`, `@happyvertical/smrt-profiles`, `@happyvertical/smrt-users` (all optional)
441
+
442
+ ## Portable MCP Apps
443
+
444
+ The opt-in `@happyvertical/smrt-svelte/mcp-apps` entry exports `useMcpApp` for
445
+ mount-owned host negotiation/disposal and `useMcpAppIntent` for component-local
446
+ public registry interactions. It does not require `document.modelContext` or
447
+ export mounted closures to remote MCP. Agent proposals retain trusted human
448
+ staged review. See the [bridge contract](../mcp-apps/README.md) for origin
449
+ configuration, capabilities, fallback and synthetic-browser evidence limits.
@@ -772,9 +772,18 @@ function buildLayoutStyle(shell: ModuleShellState): string {
772
772
 
773
773
  .smrt-admin-shell__drawer--bottom {
774
774
  inset-block-end: var(--smrt-admin-shell-bottom-track);
775
- inset-inline: var(--smrt-admin-shell-left-track)
776
- var(--smrt-admin-shell-right-track);
775
+ /* The system scope is the application footer. Its expanded drawer must
776
+ remain footer-wide while it rises above every desktop pane. */
777
+ inset-inline: 0;
777
778
  max-block-size: var(--smrt-admin-shell-bottom-expanded);
779
+ animation: smrt-admin-shell-bottom-drawer-in var(--smrt-duration-short2)
780
+ var(--smrt-easing-standard);
781
+ }
782
+
783
+ @keyframes smrt-admin-shell-bottom-drawer-in {
784
+ from {
785
+ transform: translateY(100%);
786
+ }
778
787
  }
779
788
 
780
789
  .smrt-admin-shell__corner {
@@ -912,5 +921,9 @@ function buildLayoutStyle(shell: ModuleShellState): string {
912
921
  .smrt-admin-shell__edge--right {
913
922
  transition: none;
914
923
  }
924
+
925
+ .smrt-admin-shell__drawer--bottom {
926
+ animation: none;
927
+ }
915
928
  }
916
929
  </style>
@@ -0,0 +1,3 @@
1
+ export type { McpAppState } from './mcp-apps.svelte.js';
2
+ export { useMcpApp, useMcpAppIntent } from './mcp-apps.svelte.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp-apps/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1 @@
1
+ export { useMcpApp, useMcpAppIntent } from './mcp-apps.svelte.js';
@@ -0,0 +1,18 @@
1
+ import type { McpAppBridgeOptions, McpAppSnapshot } from '@happyvertical/smrt-mcp-apps';
2
+ import { McpAppBridge } from '@happyvertical/smrt-mcp-apps';
3
+ import type { ViewIntent, ViewIntentBinding } from '@happyvertical/smrt-web/intents';
4
+ export interface McpAppState {
5
+ readonly bridge: McpAppBridge | undefined;
6
+ readonly snapshot: McpAppSnapshot | undefined;
7
+ readonly error: string | undefined;
8
+ }
9
+ /** Mount-owned bridge. Options factory runs only in the browser; SSR stays inert. */
10
+ export declare function useMcpApp(options: () => McpAppBridgeOptions): McpAppState;
11
+ /**
12
+ * Component-local intent; never advertised to the remote host. The public compiler
13
+ * dispatches to ControlInteractionRegistry/DataSurfaceRegistry. Control commands
14
+ * retain source=agent, so staged edits require the existing trusted human review.
15
+ * Explicit bindings also work without Provider or document.modelContext.
16
+ */
17
+ export declare function useMcpAppIntent(intent: ViewIntent, binding: ViewIntentBinding): (args?: Record<string, unknown>) => Promise<string>;
18
+ //# sourceMappingURL=mcp-apps.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-apps.svelte.d.ts","sourceRoot":"","sources":["../../src/mcp-apps/mcp-apps.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EAClB,MAAM,iCAAiC,CAAC;AAIzC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AACD,qFAAqF;AACrF,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,mBAAmB,GAAG,WAAW,CAiCzE;AACD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,iBAAiB,GACzB,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAerD"}
@@ -0,0 +1,63 @@
1
+ import { McpAppBridge } from '@happyvertical/smrt-mcp-apps';
2
+ import { compileViewIntentToolSpec } from '@happyvertical/smrt-web/intents';
3
+ import { onMount } from 'svelte';
4
+ /** Mount-owned bridge. Options factory runs only in the browser; SSR stays inert. */
5
+ export function useMcpApp(options) {
6
+ let bridge = $state();
7
+ let snapshot = $state();
8
+ let error = $state();
9
+ onMount(() => {
10
+ let active = true;
11
+ const current = new McpAppBridge(options());
12
+ bridge = current;
13
+ const unsubscribe = current.subscribe((next) => {
14
+ if (active)
15
+ snapshot = next;
16
+ });
17
+ void current.connect().catch((failure) => {
18
+ if (active)
19
+ error = failure instanceof Error ? failure.message : 'Host unavailable';
20
+ });
21
+ return () => {
22
+ active = false;
23
+ unsubscribe();
24
+ current.dispose();
25
+ bridge = undefined;
26
+ };
27
+ });
28
+ return {
29
+ get bridge() {
30
+ return bridge;
31
+ },
32
+ get snapshot() {
33
+ return snapshot;
34
+ },
35
+ get error() {
36
+ return error;
37
+ },
38
+ };
39
+ }
40
+ /**
41
+ * Component-local intent; never advertised to the remote host. The public compiler
42
+ * dispatches to ControlInteractionRegistry/DataSurfaceRegistry. Control commands
43
+ * retain source=agent, so staged edits require the existing trusted human review.
44
+ * Explicit bindings also work without Provider or document.modelContext.
45
+ */
46
+ export function useMcpAppIntent(intent, binding) {
47
+ const spec = compileViewIntentToolSpec(intent, binding);
48
+ let active = false;
49
+ onMount(() => {
50
+ active = true;
51
+ return () => {
52
+ active = false;
53
+ };
54
+ });
55
+ return async (args = {}) => {
56
+ if (!active)
57
+ throw new Error('MCP App intent is not mounted');
58
+ const result = await spec.execute(args);
59
+ if (!active)
60
+ throw new Error('MCP App intent was unmounted');
61
+ return result;
62
+ };
63
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-svelte",
3
- "version": "0.51.36",
3
+ "version": "0.51.38",
4
4
  "smrtJsdoc": "strict",
5
5
  "description": "Svelte 5 components for SMRT user management - auth, users, tenants, roles, permissions, groups",
6
6
  "type": "module",
@@ -89,6 +89,12 @@
89
89
  "svelte": "./dist/data-surface.js",
90
90
  "import": "./dist/data-surface.js",
91
91
  "default": "./dist/data-surface.js"
92
+ },
93
+ "./mcp-apps": {
94
+ "types": "./dist/mcp-apps/index.d.ts",
95
+ "svelte": "./dist/mcp-apps/index.js",
96
+ "import": "./dist/mcp-apps/index.js",
97
+ "default": "./dist/mcp-apps/index.js"
92
98
  }
93
99
  },
94
100
  "files": [
@@ -121,10 +127,11 @@
121
127
  },
122
128
  "dependencies": {
123
129
  "@happyvertical/logger": "^0.96.0",
124
- "@happyvertical/smrt-languages": "0.51.36",
125
- "@happyvertical/smrt-types": "0.51.36",
126
- "@happyvertical/smrt-ui": "0.51.36",
127
- "@happyvertical/smrt-web": "0.51.36",
130
+ "@happyvertical/smrt-languages": "0.51.38",
131
+ "@happyvertical/smrt-mcp-apps": "0.51.38",
132
+ "@happyvertical/smrt-types": "0.51.38",
133
+ "@happyvertical/smrt-ui": "0.51.38",
134
+ "@happyvertical/smrt-web": "0.51.38",
128
135
  "@tanstack/db": "^0.6.14",
129
136
  "@tanstack/svelte-db": "^0.1.91",
130
137
  "esm-env": "^1.2.2"
@@ -159,14 +166,14 @@
159
166
  }
160
167
  },
161
168
  "devDependencies": {
162
- "@happyvertical/smrt-agents": "0.51.36",
163
- "@happyvertical/smrt-chat": "0.51.36",
164
- "@happyvertical/smrt-content": "0.51.36",
165
- "@happyvertical/smrt-core": "0.51.36",
166
- "@happyvertical/smrt-reports": "0.51.36",
167
- "@happyvertical/smrt-scanner": "0.51.36",
168
- "@happyvertical/smrt-tenancy": "0.51.36",
169
- "@happyvertical/smrt-users": "0.51.36",
169
+ "@happyvertical/smrt-agents": "0.51.38",
170
+ "@happyvertical/smrt-chat": "0.51.38",
171
+ "@happyvertical/smrt-content": "0.51.38",
172
+ "@happyvertical/smrt-core": "0.51.38",
173
+ "@happyvertical/smrt-reports": "0.51.38",
174
+ "@happyvertical/smrt-scanner": "0.51.38",
175
+ "@happyvertical/smrt-tenancy": "0.51.38",
176
+ "@happyvertical/smrt-users": "0.51.38",
170
177
  "@sveltejs/package": "^2.5.8",
171
178
  "@sveltejs/vite-plugin-svelte": "^7.3.0",
172
179
  "@testing-library/jest-dom": "^7.0.1",