@touchcastllc/napster-companion-api-dev 1.0.0-alpha.75 → 1.0.0-alpha.78
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/lib/index.d.ts +1 -0
- package/lib/index.esm.js +1 -1
- package/lib/index.js +1 -1
- package/lib/index.standalone.js +1 -1
- package/lib/services/edge-mcp/edge-mcp-bridge.d.ts +10 -0
- package/lib/shell/mount-shell.d.ts +14 -0
- package/lib/types/index.d.ts +8 -0
- package/lib/utils/PiPManager.d.ts +2 -0
- package/package.json +1 -1
|
@@ -44,6 +44,16 @@ export declare class EdgeMcpBridge {
|
|
|
44
44
|
constructor(options: EdgeMcpBridgeOptions);
|
|
45
45
|
/** The document whose `modelContext` we read — the target iframe's, or this window's. */
|
|
46
46
|
private targetDoc;
|
|
47
|
+
/**
|
|
48
|
+
* Switch the bridge's target to a different iframe (or back to this window's document)
|
|
49
|
+
* at runtime, then re-discover the model context there. Used by the persistent-agent
|
|
50
|
+
* shell's frame-on-navigate mode: the site starts UN-framed — its WebMCP tools live on
|
|
51
|
+
* the top-level `document.modelContext` — and only gets wrapped in an iframe on the first
|
|
52
|
+
* navigation, at which point the bridge must re-target from the top-level document to the
|
|
53
|
+
* new iframe. Detaches the old iframe's `load` listener, installs one on the new iframe,
|
|
54
|
+
* and calls `reattach()` (which polls, so a not-yet-loaded iframe still binds once ready).
|
|
55
|
+
*/
|
|
56
|
+
setIframe(iframe: HTMLIFrameElement | null): void;
|
|
47
57
|
/**
|
|
48
58
|
* Discover `document.modelContext` in the page, cache its tools, and wire up
|
|
49
59
|
* the `toolchange` / `resourceupdated` listeners. Returns the model context,
|
|
@@ -13,6 +13,20 @@ export interface ShellOptions {
|
|
|
13
13
|
* persistence.
|
|
14
14
|
*/
|
|
15
15
|
persist?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Defer the iframe wrap until the user first navigates (requires `persist`). Instead of
|
|
18
|
+
* wrapping the current page on connect, the landing page stays fully native — no iframe —
|
|
19
|
+
* and the avatar mounts in the top-level document. The shell intercepts the first in-site
|
|
20
|
+
* link click and, if the target is allowed (not matched by `persistConfig`), wraps the site
|
|
21
|
+
* into an iframe THEN, loading the clicked page, so the session persists from that point on.
|
|
22
|
+
*
|
|
23
|
+
* Only anchor clicks are caught. Programmatic navigation (`location.assign`, `location.href=`),
|
|
24
|
+
* address-bar/bookmark loads, modified/`_blank` clicks, and links matched by `persistConfig`
|
|
25
|
+
* fall through to a normal top-level navigation, which ends the session (as a plain widget would).
|
|
26
|
+
*
|
|
27
|
+
* Default: `false` (wrap eagerly on connect). Ignored unless `persist` is on.
|
|
28
|
+
*/
|
|
29
|
+
frameOnNavigate?: boolean;
|
|
16
30
|
/**
|
|
17
31
|
* The ONLY URLs that break out of the iframe (open at the top window and end the session).
|
|
18
32
|
* A link is opened inside the iframe unless it matches this denylist — use it for URLs that
|
package/lib/types/index.d.ts
CHANGED
|
@@ -379,6 +379,14 @@ export interface NapsterCompanionApiInstance {
|
|
|
379
379
|
avatarIsVisible: () => boolean;
|
|
380
380
|
/** Tear down the SDK, remove DOM nodes and clean up resources. */
|
|
381
381
|
destroy: () => void;
|
|
382
|
+
/**
|
|
383
|
+
* Re-target the Edge MCP bridge at runtime: read the site's WebMCP tools from the given
|
|
384
|
+
* same-origin iframe's `document.modelContext`, or pass `null` to read them from this
|
|
385
|
+
* window's document. Used by the persistent-agent shell's frame-on-navigate mode, where
|
|
386
|
+
* the site is only wrapped in an iframe on the first navigation. No-op if the bridge is
|
|
387
|
+
* inactive.
|
|
388
|
+
*/
|
|
389
|
+
setEdgeMcpIframe: (iframe: HTMLIFrameElement | null) => void;
|
|
382
390
|
/**
|
|
383
391
|
* The current session identifier. Available after a connection is established
|
|
384
392
|
* and reset to `undefined` once the connection is closed.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface PiPController {
|
|
2
2
|
destroy: () => void;
|
|
3
3
|
}
|
|
4
|
+
export declare function checkPiPSupport(): boolean;
|
|
5
|
+
export declare function resetPiPSupportCache(): void;
|
|
4
6
|
/**
|
|
5
7
|
* Creates a PiP controller that opens a Document Picture-in-Picture window
|
|
6
8
|
* via Media Session API when the user switches tabs, and closes it on return.
|