devframe 0.9.5 → 0.9.7

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 (66) hide show
  1. package/README.md +1 -1
  2. package/dist/{_shared-CsBsnhuO.d.mts → _shared-BJ6AmwTu.d.mts} +1 -1
  3. package/dist/adapters/build.d.mts +1 -1
  4. package/dist/adapters/build.mjs +1 -1
  5. package/dist/adapters/cac.d.mts +1 -1
  6. package/dist/adapters/cac.mjs +3 -2
  7. package/dist/adapters/dev.d.mts +4 -4
  8. package/dist/adapters/dev.mjs +1 -1
  9. package/dist/adapters/embedded.d.mts +1 -1
  10. package/dist/adapters/initiate.d.mts +3 -3
  11. package/dist/adapters/initiate.mjs +1 -1
  12. package/dist/adapters/mcp.d.mts +30 -26
  13. package/dist/adapters/mcp.mjs +559 -1
  14. package/dist/cli/main.mjs +1 -1
  15. package/dist/client/index.d.mts +5 -5
  16. package/dist/client/index.mjs +1 -64
  17. package/dist/constants.d.mts +13 -1
  18. package/dist/constants.mjs +1 -1
  19. package/dist/{context-c0OlSc12.d.mts → context-BhBzOXVa.d.mts} +3 -3
  20. package/dist/{context-DO0Qu1O8.d.mts → context-HOnG-WvG.d.mts} +1 -1
  21. package/dist/{context-Cx9V9Grq.mjs → context-KUqAfawQ.mjs} +1 -1
  22. package/dist/{context-Bc5S40Qt.mjs → context-omlma_1n.mjs} +3 -150
  23. package/dist/{dev-BRQA42Lh.mjs → dev-Czit5IP4.mjs} +3 -3
  24. package/dist/{events-DzolaBEs.mjs → events-4daw0uK9.mjs} +16 -2
  25. package/dist/in-page-channel/index.d.mts +306 -0
  26. package/dist/in-page-channel/index.mjs +816 -0
  27. package/dist/{index-DOg4S5wk.d.mts → index-BzyopqxV.d.mts} +1 -1
  28. package/dist/{index-B_DPNIT4.d.mts → index-DcKxIMoI.d.mts} +2 -2
  29. package/dist/index.d.mts +4 -4
  30. package/dist/{instance-shell-CPuYY8pw.d.mts → instance-shell-Bh4l9Vz_.d.mts} +3 -3
  31. package/dist/{instance-shell-fB5PyVtR.mjs → instance-shell-CpVW4zG0.mjs} +15 -2
  32. package/dist/internal/index.d.mts +16 -6
  33. package/dist/internal/index.mjs +3 -3
  34. package/dist/node/auth.d.mts +2 -2
  35. package/dist/node/auth.mjs +1 -1
  36. package/dist/node/hub-internals.d.mts +2 -2
  37. package/dist/node/hub-internals.mjs +1 -1
  38. package/dist/node/index.d.mts +3 -3
  39. package/dist/node/index.mjs +1 -1
  40. package/dist/recipes/common-rpc-functions.d.mts +3 -3
  41. package/dist/recipes/interactive-auth.d.mts +13 -2
  42. package/dist/recipes/interactive-auth.mjs +5 -1
  43. package/dist/{revoke-PihtvVil.mjs → revoke-COLW0cOi.mjs} +1 -1
  44. package/dist/rpc/dump.d.mts +1 -1
  45. package/dist/rpc/index.d.mts +2 -2
  46. package/dist/rpc/transports/sse-client.d.mts +1 -1
  47. package/dist/rpc/transports/sse-server.d.mts +2 -2
  48. package/dist/rpc/transports/ws-bun.d.mts +2 -2
  49. package/dist/rpc/transports/ws-client.d.mts +1 -1
  50. package/dist/rpc/transports/ws-deno.d.mts +2 -2
  51. package/dist/rpc/transports/ws-server.d.mts +1 -1
  52. package/dist/{rpc-core-Oyz-cJBC.d.mts → rpc-core-BHUsDl7s.d.mts} +3 -3
  53. package/dist/{host-agent-DbPWo0Bl.mjs → services-install-CqqQVls5.mjs} +150 -2
  54. package/dist/{sse-client-CdGD_B8_.d.mts → sse-client-DwX021ST.d.mts} +1 -1
  55. package/dist/types/index.d.mts +3 -3
  56. package/dist/{types-BBLeGfpt.d.mts → types-CMdPYhOx.d.mts} +1 -1
  57. package/dist/utils/events.d.mts +1 -1
  58. package/dist/utils/serve-static.mjs +1 -1
  59. package/dist/utils/shared-state.d.mts +1 -1
  60. package/dist/utils/streaming-channel.d.mts +1 -1
  61. package/dist/{ws-client-Bo2t6hES.d.mts → ws-client-7_lZi-B9.d.mts} +1 -1
  62. package/dist/{ws-server-DLtEoLdR.d.mts → ws-server-Di2oqr4q.d.mts} +1 -1
  63. package/package.json +2 -1
  64. package/skills/devframe/SKILL.md +86 -82
  65. package/dist/http-D7wWuy7-.mjs +0 -569
  66. package/dist/transports-vhizgqXM.mjs +0 -15
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![JSDocs][jsdocs-src]][jsdocs-href]
7
7
  [![License][license-src]][license-href]
8
8
 
9
- Framework-neutral foundation for building generic devframes.
9
+ Framework-neutral foundation for building DevTools.
10
10
 
11
11
  Documentation: [https://devfra.me/](https://devfra.me/).
12
12
 
@@ -1,4 +1,4 @@
1
- import { F as DevframeDefinition, G as McpRouteOptions, I as DevframeDeploymentKind, t as ConnectionMeta } from "./context-c0OlSc12.mjs";
1
+ import { F as DevframeDefinition, G as McpRouteOptions, I as DevframeDeploymentKind, t as ConnectionMeta } from "./context-BhBzOXVa.mjs";
2
2
  //#region src/adapters/_shared.d.ts
3
3
  /**
4
4
  * Resolve the mount base path for a devframe's SPA. Hosted adapters
@@ -1,4 +1,4 @@
1
- import { F as DevframeDefinition, V as DevframeSnapshotRpcEntry, o as DevframeNodeContext } from "../context-c0OlSc12.mjs";
1
+ import { F as DevframeDefinition, V as DevframeSnapshotRpcEntry, o as DevframeNodeContext } from "../context-BhBzOXVa.mjs";
2
2
  import { o as StaticAssetsSource } from "../remote-assets-B13_vRkJ.mjs";
3
3
  //#region src/adapters/build.d.ts
4
4
  interface CreateBuildOptions {
@@ -5,7 +5,7 @@ import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_
5
5
  import { t as collectStaticRpcDump } from "../static-DV_qUSRS.mjs";
6
6
  import { n as structuredCloneStringify } from "../structured-clone-CbAV5rFI.mjs";
7
7
  import { t as diagnostics } from "../diagnostics-BXWW3VK-.mjs";
8
- import { t as createHostContext } from "../context-Bc5S40Qt.mjs";
8
+ import { t as createHostContext } from "../context-omlma_1n.mjs";
9
9
  import { t as resolveStaticAssetsSource } from "../remote-assets-DezQmPQU.mjs";
10
10
  import { t as createH3DevframeHost } from "../host-h3-fRbF9yor.mjs";
11
11
  import process from "node:process";
@@ -1,4 +1,4 @@
1
- import { Dt as parseCliFlags, Et as defineCliFlags, F as DevframeDefinition, Tt as InferCliFlags, wt as CliFlagsSchema } from "../context-c0OlSc12.mjs";
1
+ import { Dt as parseCliFlags, Et as defineCliFlags, F as DevframeDefinition, Tt as InferCliFlags, wt as CliFlagsSchema } from "../context-BhBzOXVa.mjs";
2
2
  import { CAC } from "cac";
3
3
  import { H3 } from "h3";
4
4
  //#region src/adapters/cac.d.ts
@@ -1,7 +1,8 @@
1
1
  import { s as colors } from "../nostics-CzECRXpE.mjs";
2
2
  import { r as resolveDevServerPort } from "../_shared-BM3PdYli.mjs";
3
+ import { a as importRuntimeModule } from "../instance-shell-CpVW4zG0.mjs";
3
4
  import { createBuild } from "./build.mjs";
4
- import { t as createDevServer } from "../dev-BRQA42Lh.mjs";
5
+ import { t as createDevServer } from "../dev-Czit5IP4.mjs";
5
6
  import process from "node:process";
6
7
  import cac$1 from "cac";
7
8
  //#region src/adapters/flags.ts
@@ -125,7 +126,7 @@ function createCac(d, options = {}) {
125
126
  });
126
127
  });
127
128
  cli.command("mcp", "Start an MCP server exposing agent-facing tools (stdio)").action(async () => {
128
- const { createMcpServer } = await import("./mcp.mjs");
129
+ const { createMcpServer } = await importRuntimeModule("devframe/adapters/mcp");
129
130
  await createMcpServer(d, {
130
131
  transport: "stdio",
131
132
  onReady: ({ transport }) => {
@@ -1,8 +1,8 @@
1
- import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-DLtEoLdR.mjs";
2
- import { Ct as DevframeAuthHandler, F as DevframeDefinition, G as McpRouteOptions, U as DevframeSseOptions, W as DevframeWsOptions, s as DevframeNodeRpcSession } from "../context-c0OlSc12.mjs";
1
+ import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-Di2oqr4q.mjs";
2
+ import { Ct as DevframeAuthHandler, F as DevframeDefinition, G as McpRouteOptions, U as DevframeSseOptions, W as DevframeWsOptions, s as DevframeNodeRpcSession } from "../context-BhBzOXVa.mjs";
3
3
  import { o as StaticAssetsSource } from "../remote-assets-B13_vRkJ.mjs";
4
- import { c as StartedServer } from "../instance-shell-CPuYY8pw.mjs";
5
- import { a as resolveMcpConnectionMeta, i as resolveDevServerPort, t as ResolveDevServerPortOptions } from "../_shared-CsBsnhuO.mjs";
4
+ import { c as StartedServer } from "../instance-shell-Bh4l9Vz_.mjs";
5
+ import { a as resolveMcpConnectionMeta, i as resolveDevServerPort, t as ResolveDevServerPortOptions } from "../_shared-BJ6AmwTu.mjs";
6
6
  import { H3 } from "h3";
7
7
  //#region src/adapters/dev.d.ts
8
8
  interface CreateDevServerOptions {
@@ -1,3 +1,3 @@
1
1
  import { i as resolveMcpConnectionMeta, r as resolveDevServerPort } from "../_shared-BM3PdYli.mjs";
2
- import { t as createDevServer } from "../dev-BRQA42Lh.mjs";
2
+ import { t as createDevServer } from "../dev-Czit5IP4.mjs";
3
3
  export { createDevServer, resolveDevServerPort, resolveMcpConnectionMeta };
@@ -1,4 +1,4 @@
1
- import { F as DevframeDefinition, o as DevframeNodeContext } from "../context-c0OlSc12.mjs";
1
+ import { F as DevframeDefinition, o as DevframeNodeContext } from "../context-BhBzOXVa.mjs";
2
2
  //#region src/adapters/embedded.d.ts
3
3
  interface CreateEmbeddedOptions {
4
4
  /** Target context the devframe is registered into. Required. */
@@ -1,7 +1,7 @@
1
- import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-DLtEoLdR.mjs";
2
- import { Ct as DevframeAuthHandler, F as DevframeDefinition, G as McpRouteOptions, U as DevframeSseOptions, W as DevframeWsOptions, bt as DevframeStorageScope, o as DevframeNodeContext, s as DevframeNodeRpcSession, t as ConnectionMeta } from "../context-c0OlSc12.mjs";
1
+ import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-Di2oqr4q.mjs";
2
+ import { Ct as DevframeAuthHandler, F as DevframeDefinition, G as McpRouteOptions, U as DevframeSseOptions, W as DevframeWsOptions, bt as DevframeStorageScope, o as DevframeNodeContext, s as DevframeNodeRpcSession, t as ConnectionMeta } from "../context-BhBzOXVa.mjs";
3
3
  import { o as StaticAssetsSource } from "../remote-assets-B13_vRkJ.mjs";
4
- import { c as StartedServer, f as DevframeInstanceRecord } from "../instance-shell-CPuYY8pw.mjs";
4
+ import { c as StartedServer, f as DevframeInstanceRecord } from "../instance-shell-Bh4l9Vz_.mjs";
5
5
  import { Buffer } from "node:buffer";
6
6
  import { IncomingMessage, Server, ServerResponse } from "node:http";
7
7
  import { Duplex } from "node:stream";
@@ -1,2 +1,2 @@
1
- import { n as getInstanceInternals, r as initDevframe } from "../dev-BRQA42Lh.mjs";
1
+ import { n as getInstanceInternals, r as initDevframe } from "../dev-Czit5IP4.mjs";
2
2
  export { getInstanceInternals, initDevframe };
@@ -1,4 +1,4 @@
1
- import { F as DevframeDefinition, o as DevframeNodeContext } from "../context-c0OlSc12.mjs";
1
+ import { F as DevframeDefinition, o as DevframeNodeContext } from "../context-BhBzOXVa.mjs";
2
2
  import { H3 } from "h3";
3
3
  import "@modelcontextprotocol/server";
4
4
  //#region src/adapters/mcp/build-server.d.ts
@@ -56,49 +56,53 @@ interface CreateMcpFetchHandlerOptions {
56
56
  }
57
57
  interface McpFetchHandler {
58
58
  /**
59
- * WHATWG-`fetch` handler for the MCP Streamable-HTTP endpoint. Hand every
60
- * method (POST/GET/DELETE) on the endpoint's path to it — routing by path
61
- * is the host's job.
59
+ * WHATWG-`fetch` handler for the MCP endpoint. Hand every method
60
+ * (POST/GET/DELETE) on the endpoint's path to it — routing by path is the
61
+ * host's job.
62
62
  */
63
63
  fetch: (request: Request) => Promise<Response>;
64
- /** Tear down every live MCP session (closes servers, drops subscriptions). */
64
+ /** Tear down the handler (aborts in-flight exchanges, drops the change bridge). */
65
65
  dispose: () => Promise<void>;
66
66
  }
67
67
  /**
68
- * Build a framework-agnostic MCP Streamable-HTTP endpoint over a devframe
69
- * context: a web-standard `Request → Response` handler any host can mount —
70
- * h3 (see `mountMcpHttp`), a Next.js App Router route, or any other
71
- * fetch-shaped server.
68
+ * Build a framework-agnostic MCP endpoint over a devframe context: a
69
+ * web-standard `Request → Response` handler any host can mount — h3 (see
70
+ * `mountMcpHttp`), a Next.js App Router route, or any other fetch-shaped
71
+ * server.
72
72
  *
73
- * Each MCP session gets its own {@link WebStandardStreamableHTTPServerTransport}
74
- * and MCP server (built from the shared, live `ctx` via
75
- * `buildMcpServerFromContext`), correlated by the `Mcp-Session-Id` header: an
76
- * `initialize` POST spins up a session; later requests route to it; a `DELETE`
77
- * (or client disconnect) tears it down. The origin gate guards every request:
78
- * loopback-default DNS-rebinding protection that — unlike the WS upgrade's
79
- * `isAllowedOrigin` — also rejects `Origin`-less requests, so a route-based
80
- * endpoint isn't reachable by an arbitrary local process.
73
+ * The endpoint is **stateless**: it serves the 2026-07-28 revision per request
74
+ * through the SDK's {@link createMcpHandler}, which builds a fresh MCP server
75
+ * (from the shared, live `ctx` via `buildMcpServerFromContext`) for each
76
+ * request — no `Mcp-Session-Id` registry, no session-local routing, no
77
+ * GET/DELETE teardown protocol. 2025-era clients are still served through the
78
+ * SDK's default stateless legacy path. `list_changed` events reach modern
79
+ * `subscriptions/listen` streams through the handler's `notify` bus.
80
+ *
81
+ * The origin gate guards every request: loopback-default DNS-rebinding
82
+ * protection that — unlike the WS upgrade's `isAllowedOrigin` — also rejects
83
+ * `Origin`-less requests, so a route-based endpoint isn't reachable by an
84
+ * arbitrary local process.
81
85
  */
82
86
  declare function createMcpFetchHandler(ctx: DevframeNodeContext, options: CreateMcpFetchHandlerOptions): McpFetchHandler;
83
87
  //#endregion
84
88
  //#region src/adapters/mcp/http.d.ts
85
89
  interface MountMcpHttpOptions extends CreateMcpFetchHandlerOptions {}
86
90
  interface MountedMcpHttp {
87
- /** Tear down every live MCP session (closes servers, drops subscriptions). */
91
+ /** Tear down the MCP handler (aborts in-flight exchanges, drops the change bridge). */
88
92
  dispose: () => Promise<void>;
89
93
  }
90
94
  /**
91
- * Mount an MCP Streamable-HTTP endpoint on an h3 app at `path` — the h3
92
- * binding over {@link createMcpFetchHandler}, which owns the sessions, the
95
+ * Mount a stateless MCP endpoint on an h3 app at `path` — the h3 binding over
96
+ * {@link createMcpFetchHandler}, which owns the per-request serving, the
93
97
  * origin gate, and the transport plumbing.
94
98
  *
95
99
  * The handler is web-standard — it takes the h3 event's web `Request` and
96
- * returns a web `Response` (an SSE `ReadableStream` body for the
97
- * server→client stream). We copy that response onto `event.res` and return
98
- * its body rather than returning the `Response` object directly, so a
99
- * legitimate MCP 404 (unknown session) isn't swallowed by h3's
100
- * "Response-with-404 falls through to the next handler" rule (which would
101
- * otherwise hand the request to the SPA static catch-all).
100
+ * returns a web `Response` (an SSE `ReadableStream` body for a
101
+ * `subscriptions/listen` stream). We copy that response onto `event.res` and
102
+ * return its body rather than returning the `Response` object directly, so an
103
+ * MCP error response (e.g. a 4xx) isn't swallowed by h3's "Response-with-404
104
+ * falls through to the next handler" rule (which would otherwise hand the
105
+ * request to the SPA static catch-all).
102
106
  */
103
107
  declare function mountMcpHttp(app: H3, ctx: DevframeNodeContext, path: string, options: MountMcpHttpOptions): MountedMcpHttp;
104
108
  //#endregion