devframe 0.9.9 → 0.9.11

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 (69) hide show
  1. package/dist/{_shared-CK3czkH4.d.mts → _shared-DEAMiPfH.d.mts} +26 -7
  2. package/dist/{_shared-C08SdQRl.mjs → _shared-U8D-xzrp.mjs} +41 -5
  3. package/dist/adapters/build.d.mts +1 -1
  4. package/dist/adapters/build.mjs +13 -26
  5. package/dist/adapters/cac.d.mts +6 -10
  6. package/dist/adapters/cac.mjs +3 -4
  7. package/dist/adapters/dev.d.mts +7 -7
  8. package/dist/adapters/dev.mjs +2 -2
  9. package/dist/adapters/embedded.d.mts +1 -1
  10. package/dist/adapters/initiate.d.mts +5 -4
  11. package/dist/adapters/initiate.mjs +1 -1
  12. package/dist/adapters/mcp.d.mts +1 -1
  13. package/dist/adapters/mcp.mjs +3 -3
  14. package/dist/cli/main.mjs +2 -2
  15. package/dist/client/index.d.mts +1 -1
  16. package/dist/client/index.mjs +7 -1
  17. package/dist/{context-4AIVRLYF.d.mts → context-BBWPLDHh.d.mts} +57 -18
  18. package/dist/{context-CwPUinjn.mjs → context-Bq27SDK-.mjs} +49 -13
  19. package/dist/{context-rgBSPFHS.d.mts → context-_temOGDB.d.mts} +1 -1
  20. package/dist/{context-DIUvJW4D.mjs → context-jXO5vzjH.mjs} +1 -1
  21. package/dist/{dev-Eqq5PX0k.mjs → dev-B32EVw5w.mjs} +49 -35
  22. package/dist/{diagnostics-BMfN8mb1.mjs → diagnostics-DZA6KQ_Z.mjs} +3 -3
  23. package/dist/{services-install-P_DV7VYL.mjs → host-agent-CKqSTEX9.mjs} +8 -155
  24. package/dist/in-page-channel/index.d.mts +1 -1
  25. package/dist/{index-pKl67H6w.d.mts → index-1ezCLThh.d.mts} +2 -2
  26. package/dist/index.d.mts +2 -2
  27. package/dist/{instance-registry-C7-41RSp.mjs → instance-registry-DCq762YJ.mjs} +2 -2
  28. package/dist/{instance-shell-7Z52PE4_.d.mts → instance-shell-BWh0JQuo.d.mts} +2 -2
  29. package/dist/{instance-shell-cdVETpfz.mjs → instance-shell-DvYCwrDy.mjs} +5 -18
  30. package/dist/internal/index.d.mts +11 -9
  31. package/dist/internal/index.mjs +9 -9
  32. package/dist/node/auth.d.mts +2 -2
  33. package/dist/node/auth.mjs +1 -1
  34. package/dist/node/hub-internals.d.mts +2 -2
  35. package/dist/node/hub-internals.mjs +2 -2
  36. package/dist/node/index.d.mts +1 -1
  37. package/dist/node/index.mjs +2 -2
  38. package/dist/recipes/common-rpc-functions.d.mts +1 -1
  39. package/dist/recipes/interactive-auth.d.mts +2 -2
  40. package/dist/recipes/interactive-auth.mjs +2 -2
  41. package/dist/{remote-assets-BIFWOlBW.mjs → remote-assets-DMFzLSoH.mjs} +3 -3
  42. package/dist/rpc/dump.d.mts +17 -1
  43. package/dist/rpc/dump.mjs +2 -2
  44. package/dist/rpc/index.mjs +2 -3
  45. package/dist/rpc/transports/sse-client.mjs +1 -1
  46. package/dist/rpc/transports/sse-server.mjs +1 -1
  47. package/dist/rpc/transports/ws-bun.d.mts +1 -1
  48. package/dist/rpc/transports/ws-client.mjs +1 -1
  49. package/dist/rpc/transports/ws-deno.d.mts +1 -1
  50. package/dist/rpc/transports/ws-server.mjs +1 -1
  51. package/dist/{rpc-core-DVQ7xi89.mjs → rpc-core-CvkU23bQ.mjs} +1 -1
  52. package/dist/{rpc-core-Ceu6AUz8.d.mts → rpc-core-DiCr5etS.d.mts} +2 -2
  53. package/dist/{serialization-DTZnPQ1-.mjs → serialization-DFg5sUt6.mjs} +39 -2
  54. package/dist/services-install-Ben4yh52.mjs +154 -0
  55. package/dist/{state-CeQQWzM-.mjs → state-Mwt6--el.mjs} +13 -5
  56. package/dist/{storage-Dccf_IyD.mjs → storage-B70AXK64.mjs} +2 -2
  57. package/dist/types/index.d.mts +2 -2
  58. package/dist/utils/events.d.mts +1 -1
  59. package/dist/utils/remote-assets.mjs +1 -1
  60. package/dist/utils/serve-static.mjs +1 -1
  61. package/dist/utils/shared-state.d.mts +1 -1
  62. package/dist/utils/streaming-channel.d.mts +1 -1
  63. package/dist/{validation-BOy8IoFZ.mjs → validation-CfV1s0SF.mjs} +1 -1
  64. package/dist/{wire-codec-dcCeXcSo.mjs → wire-codec-BHGt0sSs.mjs} +1 -1
  65. package/dist/{static-DZ8P2Kn7.mjs → write-BuLCrn9h.mjs} +25 -4
  66. package/package.json +2 -6
  67. package/skills/devframe/SKILL.md +5 -3
  68. package/dist/diagnostics-D0EVm5M6.mjs +0 -39
  69. package/dist/{host-h3-BJ4siyz7.mjs → host-h3-BROI6SQ4.mjs} +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "devframe",
3
3
  "type": "module",
4
- "version": "0.9.9",
4
+ "version": "0.9.11",
5
5
  "description": "Framework for building one portable devtool integration that runs in any viewer.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -77,21 +77,18 @@
77
77
  ],
78
78
  "peerDependencies": {
79
79
  "@modelcontextprotocol/client": "^2.0.0",
80
- "@modelcontextprotocol/server": "^2.0.0",
81
80
  "cac": "^7.0.0"
82
81
  },
83
82
  "peerDependenciesMeta": {
84
83
  "@modelcontextprotocol/client": {
85
84
  "optional": true
86
85
  },
87
- "@modelcontextprotocol/server": {
88
- "optional": true
89
- },
90
86
  "cac": {
91
87
  "optional": true
92
88
  }
93
89
  },
94
90
  "dependencies": {
91
+ "@modelcontextprotocol/server": "^2.0.0",
95
92
  "@standard-schema/spec": "^1.1.0",
96
93
  "birpc": "^4.2.0",
97
94
  "crossws": "^0.4.12",
@@ -103,7 +100,6 @@
103
100
  },
104
101
  "devDependencies": {
105
102
  "@modelcontextprotocol/client": "^2.0.0",
106
- "@modelcontextprotocol/server": "^2.0.0",
107
103
  "cac": "^7.0.0",
108
104
  "get-port-please": "^3.2.0",
109
105
  "immer": "^11.1.18",
@@ -405,7 +405,9 @@ defineRpcFunction({
405
405
  })
406
406
  ```
407
407
 
408
- Or register tools / resources directly on `ctx.agent.registerTool({ id, description, safety, handler })` and `ctx.agent.registerResource({ id, name, mimeType, read })`. Expose the API over MCP:
408
+ Or register tools / resources directly on `ctx.agent.registerTool({ id, description, safety, handler })` and `ctx.agent.registerResource({ id, name, mimeType, read })`.
409
+
410
+ The dev server serves this surface over HTTP automatically: the `mcp: 'auto'` default mounts the Streamable-HTTP route at `<base>__mcp` once the agent surface is non-empty (`mcp: true` forces on, `mcp: false` off). For stdio:
409
411
 
410
412
  ```ts
411
413
  import { createMcpServer } from 'devframe/adapters/mcp'
@@ -413,7 +415,7 @@ import { createMcpServer } from 'devframe/adapters/mcp'
413
415
  await createMcpServer(myDevframe, { transport: 'stdio' })
414
416
  ```
415
417
 
416
- `@modelcontextprotocol/server` is a peer dependency. The CLI adapter also exposes `my-tool mcp` (route node-side logs to stderr - stdout is the transport). Safety classifications (`'read' | 'action' | 'destructive'`) drive MCP hint annotations that coding agents use to prompt for confirmation. In a hub, `ctx.commands` entries opt into the same agent-facing API with an `agent` field and reach MCP through the aggregate endpoint.
418
+ The CLI adapter also exposes `my-tool mcp` (route node-side logs to stderr - stdout is the transport). Safety classifications (`'read' | 'action' | 'destructive'`) drive MCP hint annotations that coding agents use to prompt for confirmation. In a hub, `ctx.commands` entries opt into the same agent-facing API with an `agent` field and reach MCP through the aggregate endpoint.
417
419
 
418
420
  ## Author SPA
419
421
 
@@ -508,7 +510,7 @@ Plus broadcasts (`devframe:docks:activate`, `devframe:terminals:updated`, `devfr
508
510
 
509
511
  The hub is headless; `DevframeHubUi` is pure data (`viewer` / `embedded` / `assets` / `setup`). `@devframes/hub-ui`'s `createUi()` is the reference hub UI provider - a standalone devtools page plus a floating dock injected via one `<script type="module" src="/__devframes/embedded.js">` tag. It takes `branding`, `dockPreferences`, and `embeddedVisibility` (`'normal'` / `'passive'` / `'hidden'`). Another hub UI provider supplies a different object to the same slot and reuses all the infrastructure. Renderer modules for opt-in dock types compose at the hub via `initHub({ renderers })`.
510
512
 
511
- Two copyable reference hubs mount every built-in devframe behind an icon dock rail - the shape Vite DevTools wears, shrunk to the smallest thing you can build your own hub UI provider from: [`examples/hub-vite/`](https://github.com/devframes/devframe/tree/main/examples/hub-vite) (~120-line Vite host, vanilla DOM UI) and [`examples/hub-next/`](https://github.com/devframes/devframe/tree/main/examples/hub-next) (Next.js App Router). The `hub-*-minimal` family shows the default `createUi()` mount across Vite, Next, Nitro, Hono, Fastify, SvelteKit, Deno, and Rsbuild.
513
+ Two copyable reference hubs mount every built-in devframe behind an icon dock rail - the shape Vite DevTools wears, shrunk to the smallest thing you can build your own hub UI provider from: [`examples/custom-hub-vite/`](https://github.com/devframes/devframe/tree/main/examples/custom-hub-vite) (~120-line Vite host, vanilla DOM UI) and [`examples/custom-hub-next/`](https://github.com/devframes/devframe/tree/main/examples/custom-hub-next) (Next.js App Router). The `hub-*` family (`hub-vite`, `hub-next`, `hub-deno`, `hub-fastify`, `hub-hono`, `hub-nitro`, `hub-rsbuild`, `hub-sveltekit`) shows the default `createUi()` mount across Vite, Next, Nitro, Hono, Fastify, SvelteKit, Deno, and Rsbuild.
512
514
 
513
515
  ## Framework kits: two scopes
514
516
 
@@ -1,39 +0,0 @@
1
- import { i as defineDiagnostics } from "./nostics-D0PvLZsn.mjs";
2
- //#region src/rpc/diagnostics.ts
3
- const diagnostics = defineDiagnostics({
4
- docsBase: "https://devfra.me/errors",
5
- codes: {
6
- DF0019: {
7
- why: (p) => `RPC function "${p.name}" has \`agent\` set but \`jsonSerializable\` is not \`true\`; MCP requires JSON-serializable data.`,
8
- fix: "Set `jsonSerializable: true` if the payload is JSON-safe, or remove `agent` to keep it RPC-only."
9
- },
10
- DF0020: {
11
- why: (p) => `RPC function "${p.name}" declares \`jsonSerializable: true\` but the value at "${p.path}" is a ${p.type}.`,
12
- fix: "Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."
13
- },
14
- DF0021: {
15
- why: (p) => `RPC function "${p.name}" is already registered`,
16
- fix: "Use the `force` parameter to overwrite an existing registration."
17
- },
18
- DF0022: { why: (p) => `RPC function "${p.name}" is not registered. Use register() to add new functions.` },
19
- DF0023: { why: (p) => `RPC function "${p.name}" is not registered` },
20
- DF0024: { why: (p) => `Either handler or setup function must be provided for RPC function "${p.name}"` },
21
- DF0025: { why: (p) => `Function "${p.name}" not found in dump store` },
22
- DF0026: { why: (p) => `No dump match for "${p.name}" with args: ${p.args}` },
23
- DF0027: { why: (p) => `Function "${p.name}" with type "${p.type}" cannot have dump configuration. Only "static" and "query" types support dumps.` },
24
- DF0028: {
25
- why: (p) => `Function "${p.name}" with type "${p.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,
26
- fix: "Remove `snapshot: true`, or change the function type to `query`."
27
- },
28
- DF0043: {
29
- why: (p) => `RPC function "${p.name}" received an invalid argument at position ${p.index}: ${p.issues}`,
30
- fix: "Pass a value that satisfies the `args` schema declared for this function."
31
- },
32
- DF0044: {
33
- why: (p) => `RPC function "${p.name}" returned a value that failed its \`returns\` schema: ${p.issues}`,
34
- fix: "Make the handler return a value that satisfies the `returns` schema, or relax the schema."
35
- }
36
- }
37
- });
38
- //#endregion
39
- export { diagnostics as t };
@@ -1,5 +1,5 @@
1
- import process from "node:process";
2
1
  import { join } from "pathe";
2
+ import process from "node:process";
3
3
  import { homedir } from "node:os";
4
4
  //#region src/node/host-h3.ts
5
5
  /**