holon-ui 0.0.1-dev.19 → 0.0.1-dev.20
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/package.json +1 -1
- package/runtime.d.ts +3 -1
- package/runtime.web.mjs +2 -2
package/package.json
CHANGED
package/runtime.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { App, AppOptions } from "@modelcontextprotocol/ext-apps";
|
|
2
2
|
import type { StandardSchemaV1, StandardSchemaWithJSON, ToolAnnotations } from "@modelcontextprotocol/client";
|
|
3
|
-
import type { Identity, Contract, RuntimeClient } from "holon-sh/runtime";
|
|
3
|
+
import type { EndpointBinding, Identity, Contract, RuntimeClient } from "holon-sh/runtime";
|
|
4
4
|
export type { CreateOptions, EndpointBinding, Identity, Contract, RuntimeClient } from "holon-sh/runtime";
|
|
5
5
|
export type { AuthProvider, CallOptions, CallMetadata, ToolResult, ToolClient } from "holon-sh/runtime";
|
|
6
6
|
export { bindApps, ToolCallError } from "holon-sh/runtime";
|
|
@@ -21,6 +21,8 @@ export interface ConnectOptions<S extends Record<string, unknown> = {}> {
|
|
|
21
21
|
tools?: { [K in keyof S]: PageTool<S[K]> };
|
|
22
22
|
/** The ext-apps App's options in an MCP Apps host, and the transport to connect it with; ignored on a web page. */
|
|
23
23
|
view?: AppOptions & { transport?: Parameters<App["connect"]>[0] };
|
|
24
|
+
/** The app's binding on a web page, in place of the generated one; its endpoint resolves against the page's origin. Ignored in an MCP Apps host. */
|
|
25
|
+
web?: EndpointBinding;
|
|
24
26
|
}
|
|
25
27
|
type Tools<C> = C extends { tools: infer T } ? T : never;
|
|
26
28
|
/** The tool call that opened a view: typed by its tool, or untyped when the host does not say which tool it was. */
|
package/runtime.web.mjs
CHANGED
|
@@ -6,8 +6,8 @@ import { bindApps, ToolCallError } from "holon-sh/runtime";
|
|
|
6
6
|
|
|
7
7
|
export { bindApps, ToolCallError };
|
|
8
8
|
|
|
9
|
-
export async function connect({ identity, contracts, own, endpoint }, { tools = {} } = {}) {
|
|
10
|
-
const client = bindApps(identity, contracts, { [own]: { endpoint: new URL(endpoint, location.origin) } })[own];
|
|
9
|
+
export async function connect({ identity, contracts, own, endpoint }, { tools = {}, web = { endpoint } } = {}) {
|
|
10
|
+
const client = bindApps(identity, contracts, { [own]: { ...web, endpoint: new URL(web.endpoint, location.origin) } })[own];
|
|
11
11
|
const lifetime = new AbortController();
|
|
12
12
|
const context = globalThis.document?.modelContext;
|
|
13
13
|
// Offering tools is secondary to the page working: the page does not wait for it, and a failure is only reported.
|