holon-ui 0.0.1-dev.3 → 0.0.1-dev.4
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 +5 -5
- package/package.json +3 -11
- package/generated/holon-generated.json +0 -4
- package/generated/index.d.ts +0 -12
- package/generated/index.js +0 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# holon-ui
|
|
2
2
|
|
|
3
|
-
Typed MCP clients for browser pages: views that run inside an MCP Apps host, or standalone pages that talk to MCP servers directly. The [`holon` CLI](https://github.com/holon-sh/cli) generates
|
|
3
|
+
Typed MCP clients for browser pages: views that run inside an MCP Apps host, or standalone pages that talk to MCP servers directly. The [`holon` CLI](https://github.com/holon-sh/cli) generates your app's clients into its `generated/holon-ui/` directory, beside its `package.json`, and maps `#holon-ui` to them there. Clients validate arguments before each call and results after it, and can expose tools to the page's WebMCP agent.
|
|
4
4
|
|
|
5
5
|
`holon-ui` contains only browser code. Server code uses `holon-sh` ([Node.js](https://github.com/holon-sh/sdk-ts) or [Python](https://github.com/holon-sh/sdk-py)). Start with the [CLI README](https://github.com/holon-sh/cli) for the walkthrough.
|
|
6
6
|
|
|
@@ -12,12 +12,12 @@ In the app's root directory, next to its `server.json`:
|
|
|
12
12
|
npm install holon-ui@dev
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Declare `holon-ui` in the app root's `package.json` even when the view's sources live in a subdirectory: `holon types generate` writes browser clients into `
|
|
15
|
+
Declare `holon-ui` in the app root's `package.json` even when the view's sources live in a subdirectory: `holon types generate` writes browser clients into `generated/holon-ui/` beside the `package.json` that declares `holon-ui` (and Node clients into `generated/holon-sh/` when it declares `holon-sh` too). The generated module imports `holon-ui/runtime` and, for `App`, `@modelcontextprotocol/ext-apps`, so the app installs both.
|
|
16
16
|
|
|
17
17
|
## The generated module
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
|
-
import { App, ToolCallError, createApps, exposeTools, registerPageTools, type Inputs, type Outputs, type Resources } from "holon-ui";
|
|
20
|
+
import { App, ToolCallError, createApps, exposeTools, registerPageTools, type Inputs, type Outputs, type Resources } from "#holon-ui";
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
| Export | What it is |
|
|
@@ -38,7 +38,7 @@ Your own server appears under the last segment of its `server.json` name, e.g. `
|
|
|
38
38
|
A view embedded in an MCP Apps host calls its own server through the host, which owns the connection and the credentials. Construct and connect `App` exactly as you would the one from `@modelcontextprotocol/ext-apps`; it is that class with typed members added:
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
|
-
import { App } from "holon-ui";
|
|
41
|
+
import { App } from "#holon-ui";
|
|
42
42
|
|
|
43
43
|
const view = new App({ name: "checkout-view", version: "1.0.0" });
|
|
44
44
|
view.ontoolresult = ({ structuredContent }) => render(structuredContent);
|
|
@@ -131,7 +131,7 @@ npm install @modelcontextprotocol/ext-apps
|
|
|
131
131
|
npx vite build
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
Then serve `dist/index.html` from the server
|
|
134
|
+
Then serve `dist/index.html` from the server as an [MCP App](https://modelcontextprotocol.io/extensions/apps/overview) resource.
|
|
135
135
|
|
|
136
136
|
## Low-level runtime
|
|
137
137
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "holon-ui",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.4",
|
|
4
4
|
"description": "Typed MCP clients for browser views: MCP Apps host bindings and WebMCP tool exposure.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,14 +13,9 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"holon": {
|
|
16
|
-
"
|
|
17
|
-
"contractVersion": 1
|
|
16
|
+
"contractVersion": 2
|
|
18
17
|
},
|
|
19
18
|
"exports": {
|
|
20
|
-
".": {
|
|
21
|
-
"types": "./generated/index.d.ts",
|
|
22
|
-
"import": "./generated/index.js"
|
|
23
|
-
},
|
|
24
19
|
"./runtime": {
|
|
25
20
|
"types": "./runtime.d.ts",
|
|
26
21
|
"import": "./runtime.mjs"
|
|
@@ -29,13 +24,10 @@
|
|
|
29
24
|
"files": [
|
|
30
25
|
"runtime.mjs",
|
|
31
26
|
"runtime.d.ts",
|
|
32
|
-
"generated/",
|
|
33
27
|
"README.md"
|
|
34
28
|
],
|
|
35
29
|
"scripts": {
|
|
36
|
-
"
|
|
37
|
-
"prepack": "npm run build",
|
|
38
|
-
"test": "npm run build && node --test tests/*.test.mjs",
|
|
30
|
+
"test": "node --test tests/*.test.mjs",
|
|
39
31
|
"fixtures": "node scripts/fixtures.mjs"
|
|
40
32
|
},
|
|
41
33
|
"dependencies": {
|
package/generated/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// holon-generated-apps-v1 placeholder
|
|
2
|
-
export type Apps = Record<never, never>;
|
|
3
|
-
export type Inputs = Record<never, never>;
|
|
4
|
-
export type Outputs = Record<never, never>;
|
|
5
|
-
export type InputTypes = Inputs;
|
|
6
|
-
export type OutputTypes = Outputs;
|
|
7
|
-
export type Resources = Record<never, never>;
|
|
8
|
-
export { ToolCallError } from "holon-sh/protocol";
|
|
9
|
-
export type { EndpointBinding, CreateOptions } from "../runtime.js";
|
|
10
|
-
export { exposeTools, registerPageTools } from "../runtime.js";
|
|
11
|
-
import type { CreateOptions } from "../runtime.js";
|
|
12
|
-
export declare function createApps(bindings: Record<string, never>, options?: CreateOptions): Apps;
|
package/generated/index.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// holon-generated-apps-v1 placeholder
|
|
2
|
-
import {bindApps} from "../runtime.mjs";
|
|
3
|
-
export {ToolCallError,exposeTools,registerPageTools} from "../runtime.mjs";
|
|
4
|
-
export function createApps(bindings, options) { return bindApps({name:"unconfigured",version:"0",requires:{}}, {}, bindings, options); }
|