holon-ui 0.0.1-dev.15 → 0.0.1-dev.16
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 +2 -2
- package/runtime.web.mjs +1 -1
package/package.json
CHANGED
package/runtime.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export type Page<C> =
|
|
|
48
48
|
/** connect, narrowed by the generated #holon-ui module to the client C of the project's own app. A page tool cannot take the name of one of the app's tools. */
|
|
49
49
|
export type Connect<C> = <S extends Record<string, unknown> = {}>(options?: ConnectOptions<S> & { tools?: { [K in keyof Tools<C>]?: never } }) => Promise<Page<C>>;
|
|
50
50
|
/** Bind the page to its own app on the surface its build chose, and offer every tool to whichever agent is present. Most pages call the generated connect from #holon-ui. */
|
|
51
|
-
export declare function connect<S extends Record<string, unknown> = {}
|
|
52
|
-
app: { identity: Identity;
|
|
51
|
+
export declare function connect<S extends Record<string, unknown> = {}>(
|
|
52
|
+
app: { identity: Identity; contracts: Record<string, Contract | null>; own: string; /** The app's MCP endpoint on the page's origin, such as "/mcp/checkout". */ endpoint: string },
|
|
53
53
|
options?: ConnectOptions<S>,
|
|
54
54
|
): Promise<Page<RuntimeClient>>;
|
package/runtime.web.mjs
CHANGED
|
@@ -16,7 +16,7 @@ export async function connect({ identity, contracts, own, endpoint }, { tools =
|
|
|
16
16
|
const { signal } = lifetime;
|
|
17
17
|
const offer = tool => context.registerTool(tool, { signal }).catch(error => console.warn(`WebMCP did not accept the tool ${tool.name}:`, error));
|
|
18
18
|
for (const [name, tool] of Object.entries(tools)) offer(pageTool(name, tool));
|
|
19
|
-
const contracted = name => contracts[own].tools.some(tool => tool.name === name);
|
|
19
|
+
const contracted = name => !contracts[own] || contracts[own].tools.some(tool => tool.name === name);
|
|
20
20
|
client.listTools({ signal }).then(
|
|
21
21
|
({ tools: listed }) => {
|
|
22
22
|
for (const tool of listed) {
|