@noodleseed/assistant 1.22.0 → 1.24.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/README.md +43 -8
- package/dist/app-view-element-DDtXu08a.d.ts +40 -0
- package/dist/app-view-element-DSPtyEul.d.cts +40 -0
- package/dist/app-view.cjs +18666 -0
- package/dist/app-view.cjs.map +1 -0
- package/dist/app-view.d.cts +9 -0
- package/dist/app-view.d.ts +9 -0
- package/dist/app-view.js +15 -0
- package/dist/app-view.js.map +1 -0
- package/dist/{appearance-Cc-eqSbp.d.cts → appearance-0nS2LFjb.d.cts} +1 -0
- package/dist/{appearance-Cc-eqSbp.d.ts → appearance-0nS2LFjb.d.ts} +1 -0
- package/dist/chunk-5NBHHNI3.js +180 -0
- package/dist/chunk-5NBHHNI3.js.map +1 -0
- package/dist/{chunk-6TT3R555.js → chunk-6PVDV7SO.js} +823 -4062
- package/dist/chunk-6PVDV7SO.js.map +1 -0
- package/dist/{chunk-ZPZHPXIQ.js → chunk-IBDP6PXQ.js} +9 -3882
- package/dist/chunk-IBDP6PXQ.js.map +1 -0
- package/dist/chunk-P223CYPO.js +3880 -0
- package/dist/chunk-P223CYPO.js.map +1 -0
- package/dist/chunk-XKTUXFGX.js +3323 -0
- package/dist/chunk-XKTUXFGX.js.map +1 -0
- package/dist/{client-BZ7xPwfW.d.cts → client-By4gqB1k.d.cts} +2 -2
- package/dist/{client-BkJlpN5N.d.ts → client-Cf38TgwN.d.ts} +2 -2
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +2 -1
- package/dist/embed.global.js +87 -73
- package/dist/index.cjs +110 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/react/client.d.cts +2 -2
- package/dist/react/client.d.ts +2 -2
- package/dist/react/client.js +2 -1
- package/dist/react/client.js.map +1 -1
- package/dist/react.cjs +298 -69
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +8 -9
- package/dist/react.d.ts +8 -9
- package/dist/react.js +31 -41
- package/dist/react.js.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/package.json +16 -2
- package/dist/chunk-6TT3R555.js.map +0 -1
- package/dist/chunk-ZPZHPXIQ.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Customer-branded embedded assistant surfaces for Noodle Seed deployments.
|
|
4
4
|
|
|
5
|
-
The package exports the canonical `<noodle-assistant>` Web Component,
|
|
6
|
-
|
|
5
|
+
The package exports the canonical `<noodle-assistant>` managed Web Component, the framework-neutral
|
|
6
|
+
`<noodle-app-view>` MCP App host from `@noodleseed/assistant/app-view`, a managed React wrapper and
|
|
7
|
+
`NoodleAppView` adapter from `@noodleseed/assistant/react`, a renderer-free React hook from
|
|
7
8
|
`@noodleseed/assistant/react/client`, a DOM-free client from `@noodleseed/assistant/client`, and the
|
|
8
9
|
backend-only `createAssistantSession` helper from `@noodleseed/assistant/server`. Light, dark, and automatic
|
|
9
10
|
themes work without configuration; the component inherits the deployed MCP server's brand kit while slots,
|
|
@@ -376,20 +377,54 @@ if (part.type === "data-view") {
|
|
|
376
377
|
}
|
|
377
378
|
```
|
|
378
379
|
|
|
379
|
-
|
|
380
|
+
`<noodle-app-view>` owns the double iframe and AppBridge; `NoodleAppView` delegates to it. Its lifecycle identity is the supplied client plus
|
|
380
381
|
`view.id` plus `view.resourceUri`: ordinary parent rerenders and fresh view/callback objects retain the
|
|
381
382
|
iframe, while a semantic view replacement or unmount requests standard App teardown and closes the bridge.
|
|
382
383
|
Do not also key an ancestor by the whole view object or a callback. Pass the embedding application's
|
|
383
384
|
resolved `"light"` or `"dark"` theme; later changes are published through MCP Apps host context without
|
|
384
385
|
replacing the iframe.
|
|
385
386
|
|
|
387
|
+
App views stay inline by default. The host advertises only inline presentation and rejects an untrusted
|
|
388
|
+
App's fullscreen request, so stale or third-party widget code cannot take over the embedding application's
|
|
389
|
+
viewport. If fullscreen is an intentional part of the customer-owned experience, opt in explicitly with
|
|
390
|
+
`allowFullscreen` on `NoodleAppView` or `allow-fullscreen` on `<noodle-app-view>`; do not enable it merely
|
|
391
|
+
because a widget requests it. After an accepted fullscreen request, the host displays an accessible exit
|
|
392
|
+
control in the top-right corner. It returns the same mounted App to inline mode without resetting its state.
|
|
393
|
+
|
|
394
|
+
Vue, Angular, and plain DOM renderers use the same host without installing React. Import its dedicated entry
|
|
395
|
+
once, then assign the complex values as element properties. In Vue, the explicit `.prop` modifier makes that
|
|
396
|
+
boundary unambiguous:
|
|
397
|
+
|
|
398
|
+
```vue
|
|
399
|
+
<script setup lang="ts">
|
|
400
|
+
import "@noodleseed/assistant/app-view";
|
|
401
|
+
</script>
|
|
402
|
+
|
|
403
|
+
<template>
|
|
404
|
+
<noodle-app-view
|
|
405
|
+
:client.prop="assistant"
|
|
406
|
+
:view.prop="part.data"
|
|
407
|
+
:theme="resolvedTheme"
|
|
408
|
+
@assistant-error="reportAssistantError"
|
|
409
|
+
/>
|
|
410
|
+
</template>
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
Configure Vue's `isCustomElement` for `noodle-app-view`. Angular uses the same element with `[client]`,
|
|
414
|
+
`[view]`, and `[theme]` property bindings. Do not serialize `client` or `view` into attributes.
|
|
415
|
+
|
|
416
|
+
`<noodle-app-view>` is the canonical host; `NoodleAppView` delegates to it. Both use the
|
|
417
|
+
service-advertised sandbox URL, route App calls through the supplied client, publish theme changes without
|
|
418
|
+
replacing the iframe, and request standard teardown on semantic replacement, disconnect, or an App teardown
|
|
419
|
+
request.
|
|
420
|
+
|
|
386
421
|
The App document owns its action intent: it calls standard `tools/call` after connecting and never relies on
|
|
387
422
|
native form navigation. If that call needs input or confirmation, the same `client` publishes the normal
|
|
388
423
|
pending interaction part for either managed or customer-owned rendering. The original App call stays pending
|
|
389
424
|
and receives its MCP result after `client.respond(...)`; applications must not retry or translate the click.
|
|
390
425
|
|
|
391
|
-
Outside React, subscribe to the DOM-free AI SDK `UIMessage` state without
|
|
392
|
-
|
|
426
|
+
Outside React, subscribe to the DOM-free AI SDK `UIMessage` state without touching browser storage. The
|
|
427
|
+
client itself registers no element; import `/app-view` only when the transcript renders linked MCP Apps:
|
|
393
428
|
|
|
394
429
|
```ts
|
|
395
430
|
import { createAssistantClient } from "@noodleseed/assistant/client";
|
|
@@ -491,8 +526,8 @@ flow collects all elicited input before its first connector operation.
|
|
|
491
526
|
|
|
492
527
|
A completed widget-linked tool emits typed `view_available` data with its call/interaction id, tool,
|
|
493
528
|
`ui://` resource identity, optional title, bounded/redacted public result, and—on current services—the
|
|
494
|
-
self-contained App document. This is an availability signal, not proof of rendering. A customer-owned
|
|
495
|
-
renderer either mounts the actual App with `NoodleAppView` or deliberately substitutes a component already
|
|
529
|
+
self-contained App document. This is an availability signal, not proof of rendering. A customer-owned
|
|
530
|
+
renderer either mounts the actual App with `<noodle-app-view>` (or its React `NoodleAppView` adapter) or deliberately substitutes a component already
|
|
496
531
|
trusted by the application and selected by `resourceUri`/tool. The JSON `result` is data for a native
|
|
497
532
|
component; serializing it is not a rendering of the linked App. Never fetch the `ui://` URI, inject
|
|
498
533
|
`part.data.html`, or assign it to `srcdoc` yourself. The standard element also forwards the same detail as a
|
|
@@ -615,7 +650,7 @@ shadow-DOM selectors and classes are not public API.
|
|
|
615
650
|
|
|
616
651
|
`theme="auto"` follows the browser's operating-system color preference. When the embedding application has
|
|
617
652
|
its own theme toggle, pass its resolved `"light"` or `"dark"` value to `NoodleAssistant` and every
|
|
618
|
-
|
|
653
|
+
`<noodle-app-view>`/`NoodleAppView`. Updates change the assistant in place and notify mounted MCP Apps through standard host
|
|
619
654
|
context.
|
|
620
655
|
|
|
621
656
|
Server branding controls customer name, themed logo/mark/avatar assets, semantic light/dark colors, density,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { A as AssistantClient, a as AssistantViewAvailableDetail, e as AssistantErrorDetail } from './client-Cf38TgwN.js';
|
|
2
|
+
|
|
3
|
+
declare const APP_VIEW_TAG_NAME = "noodle-app-view";
|
|
4
|
+
interface AssistantAppViewErrorDetail {
|
|
5
|
+
readonly code: 'view_render_timeout';
|
|
6
|
+
readonly retryable: false;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'noodle-app-view': NoodleAppViewElement;
|
|
11
|
+
}
|
|
12
|
+
interface HTMLElementEventMap {
|
|
13
|
+
'assistant-error': CustomEvent<AssistantErrorDetail>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
declare const HTMLElementBase: typeof HTMLElement;
|
|
17
|
+
/**
|
|
18
|
+
* Framework-neutral host for one service-resolved MCP App view.
|
|
19
|
+
*
|
|
20
|
+
* `client` and `view` are object properties, not serialized attributes. Vue, Angular, and plain DOM
|
|
21
|
+
* renderers can therefore pass the same `data-view` payload without taking a React dependency.
|
|
22
|
+
*/
|
|
23
|
+
declare class NoodleAppViewElement extends HTMLElementBase {
|
|
24
|
+
#private;
|
|
25
|
+
static readonly observedAttributes: string[];
|
|
26
|
+
get client(): AssistantClient | undefined;
|
|
27
|
+
/** Allow the hosted App to request fullscreen. Disabled by default. */
|
|
28
|
+
get allowFullscreen(): boolean;
|
|
29
|
+
set allowFullscreen(value: boolean);
|
|
30
|
+
set client(value: AssistantClient | undefined);
|
|
31
|
+
get view(): AssistantViewAvailableDetail | undefined;
|
|
32
|
+
set view(value: AssistantViewAvailableDetail | undefined);
|
|
33
|
+
get theme(): 'light' | 'dark';
|
|
34
|
+
set theme(value: 'light' | 'dark');
|
|
35
|
+
connectedCallback(): void;
|
|
36
|
+
disconnectedCallback(): void;
|
|
37
|
+
attributeChangedCallback(name: string, _previous: string | null, value: string | null): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { APP_VIEW_TAG_NAME as A, NoodleAppViewElement as N, type AssistantAppViewErrorDetail as a };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { A as AssistantClient, a as AssistantViewAvailableDetail, e as AssistantErrorDetail } from './client-By4gqB1k.cjs';
|
|
2
|
+
|
|
3
|
+
declare const APP_VIEW_TAG_NAME = "noodle-app-view";
|
|
4
|
+
interface AssistantAppViewErrorDetail {
|
|
5
|
+
readonly code: 'view_render_timeout';
|
|
6
|
+
readonly retryable: false;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'noodle-app-view': NoodleAppViewElement;
|
|
11
|
+
}
|
|
12
|
+
interface HTMLElementEventMap {
|
|
13
|
+
'assistant-error': CustomEvent<AssistantErrorDetail>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
declare const HTMLElementBase: typeof HTMLElement;
|
|
17
|
+
/**
|
|
18
|
+
* Framework-neutral host for one service-resolved MCP App view.
|
|
19
|
+
*
|
|
20
|
+
* `client` and `view` are object properties, not serialized attributes. Vue, Angular, and plain DOM
|
|
21
|
+
* renderers can therefore pass the same `data-view` payload without taking a React dependency.
|
|
22
|
+
*/
|
|
23
|
+
declare class NoodleAppViewElement extends HTMLElementBase {
|
|
24
|
+
#private;
|
|
25
|
+
static readonly observedAttributes: string[];
|
|
26
|
+
get client(): AssistantClient | undefined;
|
|
27
|
+
/** Allow the hosted App to request fullscreen. Disabled by default. */
|
|
28
|
+
get allowFullscreen(): boolean;
|
|
29
|
+
set allowFullscreen(value: boolean);
|
|
30
|
+
set client(value: AssistantClient | undefined);
|
|
31
|
+
get view(): AssistantViewAvailableDetail | undefined;
|
|
32
|
+
set view(value: AssistantViewAvailableDetail | undefined);
|
|
33
|
+
get theme(): 'light' | 'dark';
|
|
34
|
+
set theme(value: 'light' | 'dark');
|
|
35
|
+
connectedCallback(): void;
|
|
36
|
+
disconnectedCallback(): void;
|
|
37
|
+
attributeChangedCallback(name: string, _previous: string | null, value: string | null): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { APP_VIEW_TAG_NAME as A, NoodleAppViewElement as N, type AssistantAppViewErrorDetail as a };
|