@happyvertical/smrt-svelte 0.45.3 → 0.47.0

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
@@ -29,6 +29,14 @@ all registrations abort when their owning component unmounts. It also covers
29
29
  an undeclared bespoke tool being excluded under the default read-only policy
30
30
  (#2586) — never remove that assertion when editing the fixture.
31
31
 
32
+ The app-level data-surface parity/security gate is
33
+ `src/web/__tests__/data-surface-conformance.integration.svelte.test.ts`. Keep
34
+ it production-backed: the fixture uses a real SQLite collection, generated
35
+ REST auth, mounted DataTable/controller snapshots, authenticated bridge ACKs,
36
+ principal tools, opaque action preview/apply, and ContentList/report adapters.
37
+ When changing a data-surface wire field or refusal reason, update the
38
+ versioned normalizers and the conformance fixture together.
39
+
32
40
  ## The UI split — primitive-adoption contract (#1589)
33
41
 
34
42
  SMRT's shared UI primitives are split by concern: **`smrt-ui` owns the
@@ -109,6 +117,15 @@ share an application registry. The adapter resolves registry state at execution
109
117
  time, never reads the DOM, never accepts agent confirmation, and removes the
110
118
  entire tool set with one abort signal. A document may have only one active
111
119
  adapter for a prefix; configure distinct prefixes for intentional coexistence.
120
+ The six derived names are also reserved through smrt-web's document-global
121
+ tool-name lock (`@happyvertical/smrt-web/webmcp-tool-names`, #2613), so a
122
+ generated model tool, a view intent, or a `useWebMcpTool` tool that would
123
+ occupy one of them under the configured prefix fails at registration with the
124
+ owner named instead of losing a tool at the host. Reserve before the first
125
+ `registerTool` and release on dispose. Both locks here — the per-document
126
+ prefix set and the shared name table — are stamped with the `modelContext`
127
+ they were taken against and reset when a host installs a new one; keep them in
128
+ step, or a prefix stays refused against a registry that never held its tools.
112
129
 
113
130
  ## Hooks
114
131
 
@@ -135,6 +152,20 @@ for a data-surface one — for exactly the component's lifetime.
135
152
  compilation to a browser tool live in `@happyvertical/smrt-web` with no
136
153
  Svelte dependency. This binding is the thin part; a second framework is a
137
154
  binding, not a rewrite. Do not add intent semantics to this package.
155
+ - **`useViewIntent` reserves as `intent`, not `bespoke`.** It reuses
156
+ `useWebMcpTool` rather than `registerViewIntent`, so it passes
157
+ `owner: 'intent'` explicitly; drop that and every intent collision blames a
158
+ `useWebMcpTool` call that does not exist. Diagnostic label only.
159
+ - **A tool-name collision (#2613) reports, it does not throw at the caller.**
160
+ `registerWebMcpBespokeTool` throws synchronously, but both bindings here run
161
+ it after a lazy import inside an effect, so neither can hand the exception
162
+ back to a component. `<Provider>` catches the UI and generated registrars
163
+ into `logger.warn`; `useWebMcpTool` catches only
164
+ `WebMcpToolNameCollisionError` into its existing
165
+ `console.warn('[smrt-svelte] bespoke WebMCP tool registration failed', …)`
166
+ path — its `register()` is fire-and-forget, so anything it does not catch
167
+ becomes a page-level unhandled rejection. Every other synchronous throw (an
168
+ invalid `effects` policy) still propagates: that is an author bug.
138
169
  - **Built on `useWebMcpTool`.** Do not write a second WebMCP lifecycle: the
139
170
  synchronous Provider policy read, the `options.effects` fallback, serialized
140
171
  same-name re-registration across effect reruns, and the lazy
package/README.md CHANGED
@@ -145,7 +145,12 @@ should be discoverable:
145
145
  ```
146
146
 
147
147
  The default prefix is `smrt_ui_`. Configure `ui.prefix` when multiple Providers
148
- must coexist in one document; the same prefix cannot be registered twice.
148
+ must coexist in one document; the same prefix cannot be registered twice. The
149
+ six derived names are reserved through the document-global tool-name lock, so
150
+ a generated model tool, a view intent, or a `useWebMcpTool` tool that would
151
+ take one of them under your prefix fails at registration with a message naming
152
+ the tool and its current owner, rather than being silently dropped by the
153
+ browser.
149
154
  `ui: false` disables only the fixed UI adapter while leaving generated model
150
155
  tools enabled. For compatibility, an object config that omits `ui` continues to
151
156
  enable only generated model tools; use `webmcp={true}` or provide `ui: {}` to