holon-ui 0.0.1-dev.27 → 0.0.1-dev.29

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.
Files changed (2) hide show
  1. package/README.md +9 -11
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Docs](https://img.shields.io/badge/docs-holonlabs.ai-blue)](https://holonlabs.ai/docs/)
4
4
 
5
- Typed MCP clients for browser pages. One `connect()` serves a page as an MCP Apps view inside a host and as a web page that offers its tools to the browser's agent through WebMCP.
5
+ `holon-ui` lets a browser page call your MCP server's tools, with type checking. The same page runs in two places. Inside an MCP Apps host, it appears next to a tool's result. On the open web, it is a regular page that can offer tools to the browser's AI agent through WebMCP.
6
6
 
7
7
  ## Install
8
8
 
@@ -37,7 +37,7 @@ server.registerTool(
37
37
  );
38
38
  ```
39
39
 
40
- `connect` from `#holon-ui` types the server's tools, so a wrong tool name, argument or result is a type error:
40
+ The page connects and calls it. `holon types check` checks those calls against the server's tools, so a wrong tool name, argument, or result type fails the check:
41
41
 
42
42
  ```sh
43
43
  npx holon types check
@@ -51,7 +51,7 @@ const app = await connect();
51
51
  const { result } = await app.tools.greet({ name: "Ada" });
52
52
 
53
53
  await app.tools.great({ name: "Ada" });
54
- // error TS2551: Property 'great' does not exist on type '{ readonly greet: (input: { name: string; }, options?: ToolCallOptions | undefined) => Promise<{ result: string; }>; }'. Did you mean 'greet'?
54
+ // error TS2551: Property 'great' does not exist on type '{ ... }'. Did you mean 'greet'?
55
55
 
56
56
  await app.tools.greet({ name: 42 });
57
57
  // error TS2322: Type 'number' is not assignable to type 'string'.
@@ -62,7 +62,7 @@ result.toFixed();
62
62
 
63
63
  ## Tools that run in the page
64
64
 
65
- `connect` offers them to whichever agent is present: the host's agent in an MCP Apps host, the browser's agent through WebMCP on a web page.
65
+ A page can define its own tools for an AI agent to use, such as selecting shapes on a board the person is looking at. `connect` offers them to whichever agent is present, the host's agent or the browser's:
66
66
 
67
67
  ```ts
68
68
  const app = await connect({
@@ -78,20 +78,18 @@ const app = await connect({
78
78
  });
79
79
  ```
80
80
 
81
- `execute` also receives a `signal` that aborts when the agent cancels.
82
-
83
- On a web page, the browser's agent is also offered the server's tools that the generated clients know, leaving out those whose `_meta.ui.visibility` lacks `"model"` and those that need a file argument. In a host, its agent already has them.
81
+ On a web page, the browser's agent can also use your server's tools. Inside a host, the host's agent already has them.
84
82
 
85
83
  ## The call that opened a view
86
84
 
87
- In an MCP Apps host, `app.opened` is the tool call that opened the view, with the output its tool returns. On a web page it is `undefined`.
85
+ Inside an MCP Apps host, a page opens because a tool ran. `app.opened` is that tool call and its result. On a web page it is `undefined`.
88
86
 
89
87
  ```ts
90
88
  const opened = await app.opened;
91
89
  if (opened?.tool === "greet") greeting.value = opened.output.result;
92
90
  ```
93
91
 
94
- Host-only features are on `app.view`, the ext-apps `App`:
92
+ Features that only exist inside a host are on `app.view`:
95
93
 
96
94
  ```ts
97
95
  if (app.view) app.view.onhostcontextchanged = ({ theme }) => { if (theme) document.documentElement.style.colorScheme = theme; };
@@ -99,7 +97,7 @@ if (app.view) app.view.onhostcontextchanged = ({ theme }) => { if (theme) docume
99
97
 
100
98
  ## Building the page
101
99
 
102
- `holon-ui/vite` builds `ui/index.html` twice in one `vite build`: the web page into `dist/web`, and the view into `dist/mcp/index.html`, one self-contained file in which `holon-ui` calls through the host:
100
+ `holon-ui/vite` builds the page twice in one `vite build`, once as a web page and once as a single-file view for MCP Apps hosts:
103
101
 
104
102
  ```ts
105
103
  import { defineConfig } from "vite";
@@ -108,7 +106,7 @@ import { holon } from "holon-ui/vite";
108
106
  export default defineConfig({ plugins: [holon()] });
109
107
  ```
110
108
 
111
- `create-holon-app` sets this up. With another bundler, build the view with the `mcp-app` export condition.
109
+ `create-holon-app` sets this up for you.
112
110
 
113
111
  ## Community
114
112
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "holon-ui",
3
- "version": "0.0.1-dev.27",
3
+ "version": "0.0.1-dev.29",
4
4
  "description": "Typed MCP clients for browser pages: one connect() for MCP Apps views and WebMCP pages.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,8 +44,8 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@modelcontextprotocol/ext-apps": "^2.0.4",
47
- "@modelcontextprotocol/node": "2.1.1",
48
- "@modelcontextprotocol/server": "2.3.1",
47
+ "@modelcontextprotocol/node": "2.1.2",
48
+ "@modelcontextprotocol/server": "2.4.0",
49
49
  "@types/node": "^22.0.0",
50
50
  "typescript": "~5.9.3",
51
51
  "vite": "8.3.8",