holon-types 0.0.1-dev.17 → 0.0.1-dev.19

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 CHANGED
@@ -21,6 +21,28 @@ Or with [Go](https://go.dev/doc/install) 1.27+:
21
21
  go install github.com/holon-sh/cli/cmd/holon@latest
22
22
  ```
23
23
 
24
+ ## Create an app
25
+
26
+ ```sh
27
+ holon init orders --lang py
28
+ ```
29
+
30
+ `--lang ts` writes the server in TypeScript instead, and `--lang go` in Go. Each app has an MCP server with one tool, `greet`, and a view the server returns as an [MCP App](https://modelcontextprotocol.io/extensions/apps/overview) and Holon serves as a page. The view calls the tool through a typed client:
31
+
32
+ ```ts
33
+ // orders/ui/main.ts
34
+ const { result } = await server.tools.greet({ name: name.value });
35
+ ```
36
+
37
+ `holon init` pins the newest Holon SDK releases (on npm, those that read the clients it writes), installs the dependencies (`uv` for Python, `go get` for Go, the project's package manager for Node.js), generates the clients, and adds the app to `holon.yaml`. `holon types check` then type-checks the server and the view. A Go server's contract isn't read from its source, so its view calls `greet` untyped, and `go build` type-checks the server. Run the app with [`holon dev`](https://holon-labs.dev/docs/).
38
+
39
+ In an existing Go module, Python project or Node.js project, `holon init` adds the server and the view beside the project's files, and the dependencies to its `go.mod`, `pyproject.toml` or `package.json`:
40
+
41
+ ```sh
42
+ cd billing
43
+ holon init
44
+ ```
45
+
24
46
  ## Example
25
47
 
26
48
  Declare dependencies under `sh.holon.requires` in your project's [`server.json`](https://modelcontextprotocol.io/registry/quickstart#step-4-create-server-json) ([publisher-provided metadata](https://modelcontextprotocol.io/registry/faq#can-i-add-custom-metadata-when-publishing)). This example uses the public [Context7](https://registry.modelcontextprotocol.io/v0.1/servers/io.github.upstash%2Fcontext7/versions/4.4.4) server.
@@ -77,7 +99,7 @@ await apps.context7.tools.resolve_library(libraryName="Next.js", query="app rout
77
99
  <summary><h4>TypeScript</h4></summary>
78
100
 
79
101
  ```ts
80
- import { apps } from "holon-sh";
102
+ import { apps } from "#holon-sh";
81
103
 
82
104
  const libraries = await apps.context7.tools["resolve-library-id"]({ libraryName: "Next.js", query: "app router" });
83
105
  libraries.content; // Context7 declares no output schema, so the complete result is returned
@@ -141,7 +163,7 @@ greeting["text"]
141
163
  <summary><h4>TypeScript</h4></summary>
142
164
 
143
165
  ```ts
144
- import { apps } from "holon-sh";
166
+ import { apps } from "#holon-sh";
145
167
 
146
168
  const greeting = await apps.bar.tools.greet({ name: "world" });
147
169
  greeting.result;
@@ -160,7 +182,7 @@ greeting.text;
160
182
 
161
183
  ## Dependencies
162
184
 
163
- A dependency is an MCP server your project calls. For each one `holon` obtains a contract—the JSON Schemas of the server's tools and resources—and writes a typed client `apps.<alias>` into the SDK package your project declares. `holon types check` then runs the language's type checker over your code against those clients. A TypeScript project needs a `tsconfig.json`, found as `tsc` finds it.
185
+ A dependency is an MCP server your project calls. For each one `holon` obtains a contract—the JSON Schemas of the server's tools and resources—and writes a typed client `apps.<alias>` into your project, for the SDK it declares: `generated/holon-sh/` for `holon-sh`, `generated/holon-ui/` for `holon-ui`, `holon/apps/` for Python and `holon/` for Go. TypeScript imports them as `#holon-sh` or `#holon-ui`, names `holon` adds to the `imports` of your `package.json`. A package that publishes code calling its clients lists `generated/holon-sh` in its `files`, so the projects that install it need not generate. `holon types check` then runs the language's type checker over your code against those clients. A TypeScript project needs a `tsconfig.json`, found as `tsc` finds it.
164
186
 
165
187
  A dependency is written in one of three ways.
166
188
 
@@ -206,6 +228,46 @@ holon types check -s docs=https://mcp.example.com/mcp
206
228
 
207
229
  ## Reference
208
230
 
231
+ <details open>
232
+ <summary><code>holon init</code></summary>
233
+
234
+ ```text
235
+ Create an app in DIR, or the working directory: an MCP server in Go, Python or TypeScript, and a
236
+ view it serves as an MCP App and as a page. The app is named after DIR.
237
+
238
+ In an empty or absent DIR, holon init writes a new project. In a Go module (go.mod), a Python
239
+ project (pyproject.toml) or a Node.js project (package.json), it adds the server and the view beside
240
+ the project's own files: Go and Python dependencies through go get and uv, npm packages into
241
+ package.json, and lines to .gitignore. It leaves the project's scripts and tsconfig.json as written.
242
+
243
+ holon init pins the newest Holon SDK releases, on npm those that read the clients this holon writes,
244
+ installs the dependencies, generates the clients, and adds the app to the working directory's
245
+ holon.yaml when DIR is inside it, or else to DIR's.
246
+
247
+ Usage:
248
+ holon init [DIR] [flags]
249
+
250
+ Examples:
251
+ # A Go app in ./orders
252
+ holon init orders --lang go
253
+
254
+ # A Python app in ./orders
255
+ holon init orders --lang py
256
+
257
+ # A TypeScript app in the working directory, with its MCP server name
258
+ holon init --lang ts --name io.github.acme/orders
259
+
260
+ # Add an app to the Python project in the working directory
261
+ holon init
262
+
263
+ Flags:
264
+ -h, --help help for init
265
+ --lang string The server's language: go, py or ts; detected in an existing project
266
+ --name string The MCP server name (default com.example/APP)
267
+ ```
268
+
269
+ </details>
270
+
209
271
  <details open>
210
272
  <summary><code>holon types generate</code></summary>
211
273
 
@@ -2,7 +2,7 @@ Third-party notices for holon, generated by scripts/third-party-notices from the
2
2
 
3
3
  --------------------------------------------------------------------------------
4
4
 
5
- holon-mcp-runtime, github.com/holon-sh/runtime v0.0.1-dev.4
5
+ holon-mcp-runtime, github.com/holon-sh/runtime v0.0.1-dev.5
6
6
  Its linux/amd64 and linux/arm64 binaries are embedded in holon.
7
7
 
8
8
  Apache License
@@ -212,7 +212,7 @@ Copyright 2026 Holon Systems, Inc.
212
212
 
213
213
  --------------------------------------------------------------------------------
214
214
 
215
- Kiln SDK, https://github.com/hughhan1/kiln at 196a7b2ed65da5f91ed13c44b7e4b5477a888ed5
215
+ Kiln SDK, https://github.com/hughhan1/kiln at c996ac50ae051bd0fcb8793d40cd13a1bc83bbd9
216
216
  Linked into holon through cgo. kiln_ocaml.opam.locked at that commit pins the opam packages it links.
217
217
 
218
218
  MIT License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "holon-types",
3
- "version": "0.0.1-dev.17",
3
+ "version": "0.0.1-dev.19",
4
4
  "description": "The holon CLI: typed clients for MCP servers, generated and type-checked",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,9 +15,9 @@
15
15
  "node": ">=22"
16
16
  },
17
17
  "optionalDependencies": {
18
- "holon-types-darwin-x64": "0.0.1-dev.17",
19
- "holon-types-darwin-arm64": "0.0.1-dev.17",
20
- "holon-types-linux-x64": "0.0.1-dev.17",
21
- "holon-types-linux-arm64": "0.0.1-dev.17"
18
+ "holon-types-darwin-x64": "0.0.1-dev.19",
19
+ "holon-types-darwin-arm64": "0.0.1-dev.19",
20
+ "holon-types-linux-x64": "0.0.1-dev.19",
21
+ "holon-types-linux-arm64": "0.0.1-dev.19"
22
22
  }
23
23
  }