holon-types 0.0.1-dev.18 → 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/README.md +32 -147
- package/THIRD-PARTY-NOTICES +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# holon
|
|
2
2
|
|
|
3
3
|
[](https://github.com/holon-sh/cli/actions/workflows/ci.yml)
|
|
4
|
+
[](https://holon-labs.dev/docs/)
|
|
4
5
|
[](https://go.dev/doc/install)
|
|
5
|
-
[](https://github.com/holon-sh/cli/releases/latest)
|
|
6
6
|
[](LICENSE)
|
|
7
|
+
[](https://discord.gg/jXExyBdy)
|
|
7
8
|
|
|
8
|
-
`holon`
|
|
9
|
-
|
|
10
|
-
This is currently supported via the [Python SDK](https://github.com/holon-sh/sdk-py), [TypeScript SDK](https://github.com/holon-sh/sdk-ts) and [Go SDK](https://github.com/holon-sh/sdk-go).
|
|
9
|
+
`holon` is a framework for [type-safe](https://holon-labs.dev/docs/#types) [MCP servers](https://modelcontextprotocol.io/docs/learn/server-concepts).
|
|
11
10
|
|
|
12
11
|
## Install
|
|
13
12
|
|
|
@@ -15,15 +14,18 @@ This is currently supported via the [Python SDK](https://github.com/holon-sh/sdk
|
|
|
15
14
|
curl -fsSL https://holon-labs.dev/install.sh | sh
|
|
16
15
|
```
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
### Create an app
|
|
19
20
|
|
|
20
21
|
```sh
|
|
21
|
-
|
|
22
|
+
holon init foo --lang py # python
|
|
23
|
+
holon init foo --lang ts # typescript
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
### Dependencies
|
|
25
27
|
|
|
26
|
-
Declare dependencies under `sh.holon.requires` in
|
|
28
|
+
Declare dependencies under `sh.holon.requires` in a [`server.json`](https://modelcontextprotocol.io/registry/quickstart#step-4-create-server-json) beside the server ([publisher-provided metadata](https://modelcontextprotocol.io/registry/faq#can-i-add-custom-metadata-when-publishing)). This example uses the public [Hugging Face](https://huggingface.co/docs/hub/en/hf-mcp-server) MCP server.
|
|
27
29
|
|
|
28
30
|
```json
|
|
29
31
|
{
|
|
@@ -34,7 +36,7 @@ Declare dependencies under `sh.holon.requires` in your project's [`server.json`]
|
|
|
34
36
|
"io.modelcontextprotocol.registry/publisher-provided": {
|
|
35
37
|
"sh.holon": {
|
|
36
38
|
"requires": {
|
|
37
|
-
"
|
|
39
|
+
"huggingface": { "url": "https://huggingface.co/mcp" }
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
}
|
|
@@ -42,6 +44,8 @@ Declare dependencies under `sh.holon.requires` in your project's [`server.json`]
|
|
|
42
44
|
}
|
|
43
45
|
```
|
|
44
46
|
|
|
47
|
+
### Types
|
|
48
|
+
|
|
45
49
|
Generate the typed clients and type-check the calls to them.
|
|
46
50
|
|
|
47
51
|
```sh
|
|
@@ -51,7 +55,7 @@ holon types check
|
|
|
51
55
|
Or name the servers yourself. Any `-s` replaces the whole `requires` list, so `server.json` is not needed.
|
|
52
56
|
|
|
53
57
|
```sh
|
|
54
|
-
holon types check -s https://
|
|
58
|
+
holon types check -s huggingface=https://huggingface.co/mcp
|
|
55
59
|
```
|
|
56
60
|
|
|
57
61
|
Call the server. A wrong tool name or argument is a type error.
|
|
@@ -62,13 +66,16 @@ Call the server. A wrong tool name or argument is a type error.
|
|
|
62
66
|
```python
|
|
63
67
|
from holon.apps import apps
|
|
64
68
|
|
|
65
|
-
await apps.
|
|
69
|
+
await apps.huggingface.tools.hub_repo_search(query="llama")
|
|
70
|
+
|
|
71
|
+
await apps.huggingface.tools.hub_repo_search(limit="3")
|
|
72
|
+
# error: Argument "limit" to "hub_repo_search" of "HuggingfaceTools" has incompatible type "str"; expected "float" [arg-type]
|
|
66
73
|
|
|
67
|
-
await apps.
|
|
68
|
-
# error:
|
|
74
|
+
await apps.huggingface.tools.hub_repo_details()
|
|
75
|
+
# error: Missing named argument "repo_ids" for "hub_repo_details" of "HuggingfaceTools" [call-arg]
|
|
69
76
|
|
|
70
|
-
await apps.
|
|
71
|
-
# error: "
|
|
77
|
+
await apps.huggingface.tools.hub_search(query="llama")
|
|
78
|
+
# error: "HuggingfaceTools" has no attribute "hub_search"; maybe "hub_repo_search"? [attr-defined]
|
|
72
79
|
```
|
|
73
80
|
|
|
74
81
|
</details>
|
|
@@ -79,17 +86,16 @@ await apps.context7.tools.resolve_library(libraryName="Next.js", query="app rout
|
|
|
79
86
|
```ts
|
|
80
87
|
import { apps } from "#holon-sh";
|
|
81
88
|
|
|
82
|
-
|
|
83
|
-
libraries.content; // Context7 declares no output schema, so the complete result is returned
|
|
89
|
+
await apps.huggingface.tools.hub_repo_search({ query: "llama" });
|
|
84
90
|
|
|
85
|
-
await apps.
|
|
86
|
-
// error TS2322: Type '
|
|
91
|
+
await apps.huggingface.tools.hub_repo_search({ limit: "3" });
|
|
92
|
+
// error TS2322: Type 'string' is not assignable to type 'number'.
|
|
87
93
|
|
|
88
|
-
await apps.
|
|
89
|
-
// error TS2741: Property '"
|
|
94
|
+
await apps.huggingface.tools.hub_repo_details({});
|
|
95
|
+
// error TS2741: Property '"repo_ids"' is missing in type '{}' but required in type '{ config?: string | undefined; limit?: number | undefined; offset?: number | undefined; operations?: ("dataset_preview" | "dataset_structure" | "overview")[] | undefined; repo_ids: string[]; repo_type?: "dataset" | ... 2 more ... | undefined; split?: string | undefined; }'.
|
|
90
96
|
|
|
91
|
-
await apps.
|
|
92
|
-
// error
|
|
97
|
+
await apps.huggingface.tools.hub_search({ query: "llama" });
|
|
98
|
+
// error TS2339: Property 'hub_search' does not exist on type '{ readonly hf_fs: (input: { operations: { args: string[]; cmd: "attach" | "cat" | "find" | "ls" | "search" | "stat"; }[]; }, options?: ToolCallOptions | undefined) => Promise<{ results: ({ ...; } | { ...; })[]; truncated?: boolean | undefined; truncation_reason?: "output_budget" | undefined; }>; readonly hf_whoami: ...'.
|
|
93
99
|
```
|
|
94
100
|
|
|
95
101
|
</details>
|
|
@@ -158,131 +164,10 @@ greeting.text;
|
|
|
158
164
|
|
|
159
165
|
</details>
|
|
160
166
|
|
|
161
|
-
##
|
|
162
|
-
|
|
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 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
|
-
|
|
165
|
-
A dependency is written in one of three ways.
|
|
166
|
-
|
|
167
|
-
<details open>
|
|
168
|
-
<summary><h3>Source code</h3></summary>
|
|
169
|
-
|
|
170
|
-
An implementation of an MCP server, or its parent directory.
|
|
171
|
-
|
|
172
|
-
```sh
|
|
173
|
-
holon types check -s bar/server.py
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
</details>
|
|
177
|
-
|
|
178
|
-
<details open>
|
|
179
|
-
<summary><h3>Registry</h3></summary>
|
|
180
|
-
|
|
181
|
-
A `sh.holon.requires` entry in [`server.json`](https://modelcontextprotocol.io/registry/quickstart#step-4-create-server-json), or `-s` with a registry version URL. The record is fetched for its contract.
|
|
182
|
-
|
|
183
|
-
```sh
|
|
184
|
-
holon types check -s https://registry.modelcontextprotocol.io/v0.1/servers/io.github.upstash%2Fcontext7/versions/4.4.4
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
</details>
|
|
188
|
-
|
|
189
|
-
<details open>
|
|
190
|
-
<summary><h3>Server</h3></summary>
|
|
191
|
-
|
|
192
|
-
An endpoint URL. The running server is asked for `tools/list` and `resources/list`.
|
|
193
|
-
|
|
194
|
-
```sh
|
|
195
|
-
holon types check -s https://mcp.context7.com/mcp
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
If the server requires a token, name it and set `<ALIAS>_MCP_TOKEN`. The token is sent only to that URL's origin, as a bearer token, and is not written anywhere.
|
|
199
|
-
|
|
200
|
-
```sh
|
|
201
|
-
export DOCS_MCP_TOKEN=...
|
|
202
|
-
holon types check -s docs=https://mcp.example.com/mcp
|
|
203
|
-
```
|
|
167
|
+
## Community
|
|
204
168
|
|
|
205
|
-
|
|
169
|
+
Ask questions and share what you're building on the [Holon Discord](https://discord.gg/jXExyBdy).
|
|
206
170
|
|
|
207
171
|
## Reference
|
|
208
172
|
|
|
209
|
-
|
|
210
|
-
<summary><code>holon types generate</code></summary>
|
|
211
|
-
|
|
212
|
-
```text
|
|
213
|
-
Generate typed clients for MCP servers.
|
|
214
|
-
|
|
215
|
-
Leverages sh.holon.requires in the publisher-provided metadata field
|
|
216
|
-
(https://modelcontextprotocol.io/registry/faq#can-i-add-custom-metadata-when-publishing) to
|
|
217
|
-
resolve dependencies, or the -s list for explicit dependencies.
|
|
218
|
-
|
|
219
|
-
Usage:
|
|
220
|
-
holon types generate [DIR] [flags]
|
|
221
|
-
|
|
222
|
-
Examples:
|
|
223
|
-
# Generate for the current project
|
|
224
|
-
holon types generate
|
|
225
|
-
|
|
226
|
-
# Another project
|
|
227
|
-
holon types generate ../checkout
|
|
228
|
-
|
|
229
|
-
# Name the project's own server to call it from outside the browser too, as apps.orders
|
|
230
|
-
holon types generate -s orders=./server
|
|
231
|
-
|
|
232
|
-
# Explicit dependencies: a server directory, a server entry, an MCP registry server, a remote
|
|
233
|
-
# MCP server named docs
|
|
234
|
-
holon types generate -s ../orders
|
|
235
|
-
holon types generate -s ../orders/server.py
|
|
236
|
-
holon types generate -s https://registry.modelcontextprotocol.io/v0.1/servers/io.github.upstash%2Fcontext7/versions/4.4.4
|
|
237
|
-
holon types generate -s docs=https://mcp.context7.com/mcp
|
|
238
|
-
|
|
239
|
-
# A remote MCP server that requires a token: DOCS_MCP_TOKEN is sent to it as a bearer token
|
|
240
|
-
DOCS_MCP_TOKEN=... holon types generate -s docs=https://mcp.example.com/mcp
|
|
241
|
-
|
|
242
|
-
# Print one server's contract, or commit it beside its server.json
|
|
243
|
-
holon types generate --contract ../orders
|
|
244
|
-
holon types generate --contract ../orders -o ../orders/holon-contract.json
|
|
245
|
-
|
|
246
|
-
Flags:
|
|
247
|
-
--contract string Print one server's MCP contract instead of generating
|
|
248
|
-
-h, --help help for generate
|
|
249
|
-
-o, --output string Write the --contract document to FILE, such as holon-contract.json
|
|
250
|
-
-s, --server stringArray A dependency, [ALIAS=]PATH or URL, paths relative to the working
|
|
251
|
-
directory
|
|
252
|
-
-v, --verbose Show generation details
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
</details>
|
|
256
|
-
|
|
257
|
-
<details open>
|
|
258
|
-
<summary><code>holon types check</code></summary>
|
|
259
|
-
|
|
260
|
-
```text
|
|
261
|
-
Generate typed clients for MCP servers, then type-check the project's calls to them.
|
|
262
|
-
|
|
263
|
-
Leverages sh.holon.requires in the publisher-provided metadata field
|
|
264
|
-
(https://modelcontextprotocol.io/registry/faq#can-i-add-custom-metadata-when-publishing) to
|
|
265
|
-
resolve dependencies, or the -s list for explicit dependencies.
|
|
266
|
-
|
|
267
|
-
Usage:
|
|
268
|
-
holon types check [DIR] [flags]
|
|
269
|
-
|
|
270
|
-
Examples:
|
|
271
|
-
# Generate, then type-check
|
|
272
|
-
holon types check
|
|
273
|
-
|
|
274
|
-
# Type-check the existing clients only (no network, no writes)
|
|
275
|
-
holon types check --no-generate
|
|
276
|
-
|
|
277
|
-
# Explicit dependencies, as for generate
|
|
278
|
-
holon types check -s orders=../orders
|
|
279
|
-
|
|
280
|
-
Flags:
|
|
281
|
-
-h, --help help for check
|
|
282
|
-
--no-generate Type-check the existing clients only: no network, no install, no
|
|
283
|
-
writes
|
|
284
|
-
-s, --server stringArray A dependency, [ALIAS=]PATH or URL, paths relative to the working
|
|
285
|
-
directory
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
</details>
|
|
173
|
+
See the [CLI reference](https://holon-labs.dev/docs/#cli-reference).
|
package/THIRD-PARTY-NOTICES
CHANGED
|
@@ -212,7 +212,7 @@ Copyright 2026 Holon Systems, Inc.
|
|
|
212
212
|
|
|
213
213
|
--------------------------------------------------------------------------------
|
|
214
214
|
|
|
215
|
-
Kiln SDK, https://github.com/hughhan1/kiln at
|
|
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.
|
|
3
|
+
"version": "0.0.1-dev.20",
|
|
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.
|
|
19
|
-
"holon-types-darwin-arm64": "0.0.1-dev.
|
|
20
|
-
"holon-types-linux-x64": "0.0.1-dev.
|
|
21
|
-
"holon-types-linux-arm64": "0.0.1-dev.
|
|
18
|
+
"holon-types-darwin-x64": "0.0.1-dev.20",
|
|
19
|
+
"holon-types-darwin-arm64": "0.0.1-dev.20",
|
|
20
|
+
"holon-types-linux-x64": "0.0.1-dev.20",
|
|
21
|
+
"holon-types-linux-arm64": "0.0.1-dev.20"
|
|
22
22
|
}
|
|
23
23
|
}
|