devframe 0.9.5 → 0.9.6
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 +1 -1
- package/dist/{_shared-CsBsnhuO.d.mts → _shared-BJ6AmwTu.d.mts} +1 -1
- package/dist/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +1 -1
- package/dist/adapters/cac.d.mts +1 -1
- package/dist/adapters/cac.mjs +3 -2
- package/dist/adapters/dev.d.mts +4 -4
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/initiate.d.mts +3 -3
- package/dist/adapters/initiate.mjs +1 -1
- package/dist/adapters/mcp.d.mts +30 -26
- package/dist/adapters/mcp.mjs +559 -1
- package/dist/cli/main.mjs +1 -1
- package/dist/client/index.d.mts +5 -5
- package/dist/client/index.mjs +1 -64
- package/dist/constants.d.mts +13 -1
- package/dist/constants.mjs +1 -1
- package/dist/{context-c0OlSc12.d.mts → context-BhBzOXVa.d.mts} +3 -3
- package/dist/{context-DO0Qu1O8.d.mts → context-HOnG-WvG.d.mts} +1 -1
- package/dist/{context-Cx9V9Grq.mjs → context-KUqAfawQ.mjs} +1 -1
- package/dist/{context-Bc5S40Qt.mjs → context-omlma_1n.mjs} +3 -150
- package/dist/{dev-BRQA42Lh.mjs → dev-Czit5IP4.mjs} +3 -3
- package/dist/{events-DzolaBEs.mjs → events-4daw0uK9.mjs} +16 -2
- package/dist/in-page-channel/index.d.mts +306 -0
- package/dist/in-page-channel/index.mjs +816 -0
- package/dist/{index-DOg4S5wk.d.mts → index-BzyopqxV.d.mts} +1 -1
- package/dist/{index-B_DPNIT4.d.mts → index-DcKxIMoI.d.mts} +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/{instance-shell-CPuYY8pw.d.mts → instance-shell-Bh4l9Vz_.d.mts} +3 -3
- package/dist/{instance-shell-fB5PyVtR.mjs → instance-shell-CpVW4zG0.mjs} +15 -2
- package/dist/internal/index.d.mts +16 -6
- package/dist/internal/index.mjs +3 -3
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/auth.mjs +1 -1
- package/dist/node/hub-internals.d.mts +2 -2
- package/dist/node/hub-internals.mjs +1 -1
- package/dist/node/index.d.mts +3 -3
- package/dist/node/index.mjs +1 -1
- package/dist/recipes/common-rpc-functions.d.mts +3 -3
- package/dist/recipes/interactive-auth.d.mts +13 -2
- package/dist/recipes/interactive-auth.mjs +5 -1
- package/dist/{revoke-PihtvVil.mjs → revoke-COLW0cOi.mjs} +1 -1
- package/dist/rpc/dump.d.mts +1 -1
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/transports/sse-client.d.mts +1 -1
- package/dist/rpc/transports/sse-server.d.mts +2 -2
- package/dist/rpc/transports/ws-bun.d.mts +2 -2
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-deno.d.mts +2 -2
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/{rpc-core-Oyz-cJBC.d.mts → rpc-core-BHUsDl7s.d.mts} +3 -3
- package/dist/{host-agent-DbPWo0Bl.mjs → services-install-CqqQVls5.mjs} +150 -2
- package/dist/{sse-client-CdGD_B8_.d.mts → sse-client-DwX021ST.d.mts} +1 -1
- package/dist/types/index.d.mts +3 -3
- package/dist/{types-BBLeGfpt.d.mts → types-CMdPYhOx.d.mts} +1 -1
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/serve-static.mjs +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/{ws-client-Bo2t6hES.d.mts → ws-client-7_lZi-B9.d.mts} +1 -1
- package/dist/{ws-server-DLtEoLdR.d.mts → ws-server-Di2oqr4q.d.mts} +1 -1
- package/package.json +2 -1
- package/skills/devframe/SKILL.md +86 -82
- package/dist/http-D7wWuy7-.mjs +0 -569
- 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
|
|
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-
|
|
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-
|
|
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 {
|
package/dist/adapters/build.mjs
CHANGED
|
@@ -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-
|
|
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";
|
package/dist/adapters/cac.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dt as parseCliFlags, Et as defineCliFlags, F as DevframeDefinition, Tt as InferCliFlags, wt as CliFlagsSchema } from "../context-
|
|
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
|
package/dist/adapters/cac.mjs
CHANGED
|
@@ -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-
|
|
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
|
|
129
|
+
const { createMcpServer } = await importRuntimeModule("devframe/adapters/mcp");
|
|
129
130
|
await createMcpServer(d, {
|
|
130
131
|
transport: "stdio",
|
|
131
132
|
onReady: ({ transport }) => {
|
package/dist/adapters/dev.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-
|
|
2
|
-
import { Ct as DevframeAuthHandler, F as DevframeDefinition, G as McpRouteOptions, U as DevframeSseOptions, W as DevframeWsOptions, s as DevframeNodeRpcSession } from "../context-
|
|
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-
|
|
5
|
-
import { a as resolveMcpConnectionMeta, i as resolveDevServerPort, t as ResolveDevServerPortOptions } from "../_shared-
|
|
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 {
|
package/dist/adapters/dev.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as resolveMcpConnectionMeta, r as resolveDevServerPort } from "../_shared-BM3PdYli.mjs";
|
|
2
|
-
import { t as createDevServer } from "../dev-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
1
|
+
import { n as getInstanceInternals, r as initDevframe } from "../dev-Czit5IP4.mjs";
|
|
2
2
|
export { getInstanceInternals, initDevframe };
|
package/dist/adapters/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as DevframeDefinition, o as DevframeNodeContext } from "../context-
|
|
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
|
|
60
|
-
*
|
|
61
|
-
*
|
|
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
|
|
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
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
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
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* `
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* `
|
|
80
|
-
*
|
|
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
|
|
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
|
|
92
|
-
*
|
|
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
|
|
97
|
-
*
|
|
98
|
-
* its body rather than returning the `Response` object directly, so
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
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
|