holon-sh 0.0.1-dev.6 → 0.0.1-dev.8

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 (45) hide show
  1. package/README.md +36 -87
  2. package/dist/context.d.ts +55 -0
  3. package/dist/context.d.ts.map +1 -0
  4. package/dist/context.js +9 -0
  5. package/dist/context.js.map +1 -0
  6. package/dist/ext/files.client.d.ts +50 -0
  7. package/dist/ext/files.client.d.ts.map +1 -0
  8. package/dist/ext/files.client.js +359 -0
  9. package/dist/ext/files.client.js.map +1 -0
  10. package/dist/ext/files.d.ts +21 -0
  11. package/dist/ext/files.d.ts.map +1 -0
  12. package/dist/ext/files.js +3 -0
  13. package/dist/ext/files.js.map +1 -0
  14. package/dist/ext/platform.browser.d.ts +4 -0
  15. package/dist/ext/platform.browser.d.ts.map +1 -0
  16. package/dist/ext/platform.browser.js +15 -0
  17. package/dist/ext/platform.browser.js.map +1 -0
  18. package/dist/ext/platform.node.d.ts +4 -0
  19. package/dist/ext/platform.node.d.ts.map +1 -0
  20. package/dist/ext/platform.node.js +45 -0
  21. package/dist/ext/platform.node.js.map +1 -0
  22. package/dist/protocol.d.ts +76 -0
  23. package/dist/protocol.d.ts.map +1 -0
  24. package/dist/protocol.js +32 -0
  25. package/dist/protocol.js.map +1 -0
  26. package/dist/runtime.d.ts +67 -0
  27. package/dist/runtime.d.ts.map +1 -0
  28. package/dist/runtime.js +276 -0
  29. package/dist/runtime.js.map +1 -0
  30. package/package.json +42 -28
  31. package/src/context.ts +29 -0
  32. package/src/ext/files.client.ts +329 -0
  33. package/src/ext/files.ts +16 -0
  34. package/src/ext/platform.browser.ts +15 -0
  35. package/src/ext/platform.node.ts +43 -0
  36. package/{protocol.d.ts → src/protocol.ts} +38 -14
  37. package/src/runtime.ts +315 -0
  38. package/generated/holon-generated.json +0 -4
  39. package/generated/index.d.ts +0 -12
  40. package/generated/index.js +0 -5
  41. package/runtime.d.ts +0 -49
  42. package/runtime.mjs +0 -191
  43. package/validate.mjs +0 -10
  44. package/view.d.ts +0 -47
  45. package/view.js +0 -30
package/view.js DELETED
@@ -1,30 +0,0 @@
1
- import { readFile } from "node:fs/promises";
2
- /** MIME type of an MCP App HTML resource. */
3
- export const VIEW_MIME_TYPE = "text/html;profile=mcp-app";
4
- /**
5
- * Create a registration tuple for server.registerResource(...appView(...)).
6
- * Node only: the HTML file is read once when this helper is called.
7
- * Resource reads reuse that promise; file read failures reject resource requests.
8
- * @param name Human-readable resource name.
9
- * @param uri Resource URI, usually starting with ui://.
10
- * @param file Built HTML file path or file URL.
11
- * @param options View content security policy.
12
- * @returns Name, URI, metadata, and resource-read callback.
13
- * @example
14
- * server.registerResource(...appView("App", "ui://app/index.html", new URL("./index.html", import.meta.url)));
15
- */
16
- export function appView(name, uri, file, options = {}) {
17
- const csp = { connectDomains: [], resourceDomains: [], ...options.csp };
18
- const page = readFile(file, "utf8");
19
- page.catch(() => { });
20
- return [
21
- name,
22
- uri,
23
- { mimeType: VIEW_MIME_TYPE, _meta: { ui: { csp } } },
24
- async () => ({
25
- ttlMs: 0,
26
- cacheScope: "private",
27
- contents: [{ uri, mimeType: VIEW_MIME_TYPE, text: await page }],
28
- }),
29
- ];
30
- }