devframe 0.9.0-beta.1 → 0.9.0-beta.3
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/dist/{_shared-DmpWW-HH.d.mts → _shared-Bm8p4-fD.d.mts} +1 -3
- package/dist/{dist-D8jAMwxU.mjs → _shared-CGPVmXUM.mjs} +67 -1
- package/dist/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +3 -3
- package/dist/adapters/cac.d.mts +1 -1
- package/dist/adapters/cac.mjs +4 -4
- package/dist/adapters/dev.d.mts +7 -7
- package/dist/adapters/dev.mjs +2 -2
- 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 +1 -8
- package/dist/adapters/mcp.mjs +1 -1
- package/dist/{agent-tool-name-C3b5vEwJ.mjs → agent-tool-name-EgfoFO8C.mjs} +0 -3
- package/dist/cli/main.d.mts +0 -2
- package/dist/cli/main.mjs +3 -7
- package/dist/client/index.d.mts +5 -5
- package/dist/{context-C33rR7n0.mjs → context-CMSryXs-.mjs} +10 -1
- package/dist/{context-CSCwoABx.d.mts → context-DV4uWieM.d.mts} +19 -1
- package/dist/{context-Du11TLcO.mjs → context-b6iSomtv.mjs} +4 -5
- package/dist/{dev-BEveeA5H.mjs → dev-4xjiynUD.mjs} +6 -6
- package/dist/{devframe-Bdd9YXTy.d.mts → devframe-5oblos7I.d.mts} +52 -36
- package/dist/{diagnostics-DLYH5oD3.mjs → diagnostics-C7IGWppM.mjs} +2 -2
- package/dist/{host-agent-CpbAoqBx.mjs → host-agent-BBkKT27Q.mjs} +2 -6
- package/dist/{http-DLr_cJZ7.mjs → http-Z0w9baEe.mjs} +3 -10
- package/dist/{index-CZRd2K1C.d.mts → index-BzDl02lt.d.mts} +2 -2
- package/dist/{index-DSCq4M4q.d.mts → index-tdrk1bzV.d.mts} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/{instance-registry-BQqGoDO9.mjs → instance-registry-Du_hbx-j.mjs} +1 -7
- package/dist/{instance-shell-DBTXTSjN.d.mts → instance-shell-B-BSVp37.d.mts} +3 -12
- package/dist/{instance-shell-KRdee1QF.mjs → instance-shell-B0TwOxCl.mjs} +9 -8
- package/dist/internal/index.d.mts +202 -9
- package/dist/internal/index.mjs +7 -5
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/hub-internals.d.mts +2 -2
- package/dist/node/hub-internals.mjs +2 -2
- package/dist/node/index.d.mts +3 -3
- package/dist/node/index.mjs +2 -2
- package/dist/recipes/common-rpc-functions.d.mts +3 -3
- package/dist/recipes/interactive-auth.d.mts +2 -2
- package/dist/recipes/interactive-auth.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-server.d.mts +1 -1
- package/dist/{rpc-core-CGctXToO.d.mts → rpc-core-B4Qm66Qt.d.mts} +3 -3
- package/dist/{rpc-core-CqcJkAu9.mjs → rpc-core-Cva-0pw0.mjs} +1 -1
- package/dist/{sse-client-BsIK3hMD.d.mts → sse-client-CFBOIaUi.d.mts} +1 -1
- package/dist/{storage-BcmVEJRc.mjs → storage-CaUVrBrG.mjs} +1 -1
- package/dist/types/index.d.mts +4 -4
- package/dist/{types-CnJSgRVa.d.mts → types-Djq7CBXh.d.mts} +0 -7
- package/dist/utils/agent-tool-name.d.mts +0 -3
- package/dist/utils/agent-tool-name.mjs +0 -3
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/{ws-client-CdNuATYa.d.mts → ws-client-DhjNyQo3.d.mts} +1 -1
- package/dist/{ws-server-Ces08fjP.d.mts → ws-server-D1d3QM9f.d.mts} +1 -1
- package/package.json +1 -2
- package/skills/devframe/SKILL.md +6 -6
- package/dist/_shared-CttmCMBi.mjs +0 -70
- package/dist/helpers/vite.d.mts +0 -104
- package/dist/helpers/vite.mjs +0 -93
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as ConnectionMeta, f as McpRouteOptions, i as DevframeDeploymentKind, r as DevframeDefinition } from "./devframe-
|
|
1
|
+
import { _ as ConnectionMeta, f as McpRouteOptions, i as DevframeDeploymentKind, r as DevframeDefinition } from "./devframe-5oblos7I.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
|
|
@@ -35,8 +35,6 @@ declare function resolveDevServerPort(def: DevframeDefinition, options?: Resolve
|
|
|
35
35
|
* and the client dials `<page-host>:<port><path>`. Without `port` the path
|
|
36
36
|
* stays relative, resolved against `__connection.json`'s own location (the
|
|
37
37
|
* same-server default).
|
|
38
|
-
*
|
|
39
|
-
* @experimental
|
|
40
38
|
*/
|
|
41
39
|
declare function resolveMcpConnectionMeta(def: DevframeDefinition, mcp: boolean | McpRouteOptions | undefined, port?: number): ConnectionMeta['mcp'];
|
|
42
40
|
//#endregion
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { n as __exportAll } from "./rolldown-runtime-JspESFgx.mjs";
|
|
2
|
+
import "./constants.mjs";
|
|
2
3
|
import { createServer } from "node:net";
|
|
3
4
|
import { networkInterfaces } from "node:os";
|
|
5
|
+
import { cleanDoubleSlashes, withLeadingSlash, withTrailingSlash, withoutLeadingSlash } from "ufo";
|
|
4
6
|
//#region ../../node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.mjs
|
|
5
7
|
var dist_exports = /* @__PURE__ */ __exportAll({
|
|
6
8
|
checkPort: () => checkPort,
|
|
@@ -224,4 +226,68 @@ async function checkPort(port, host = process.env.HOST, verbose) {
|
|
|
224
226
|
return port;
|
|
225
227
|
}
|
|
226
228
|
//#endregion
|
|
227
|
-
|
|
229
|
+
//#region src/adapters/_shared.ts
|
|
230
|
+
const DEFAULT_PORT = 9999;
|
|
231
|
+
/**
|
|
232
|
+
* Resolve the mount base path for a devframe's SPA. Hosted adapters
|
|
233
|
+
* (`vite`, `embedded`) default to `/__<id>/` so they don't collide
|
|
234
|
+
* with the host app; standalone adapters (`cli`, `spa`, `build`)
|
|
235
|
+
* default to `/` because they own the origin.
|
|
236
|
+
*
|
|
237
|
+
* The devframe author can override with `basePath` on the definition.
|
|
238
|
+
*/
|
|
239
|
+
function resolveBasePath(def, kind) {
|
|
240
|
+
if (def.basePath) return normalizeBasePath(def.basePath);
|
|
241
|
+
return kind === "standalone" ? "/" : `/__${def.id}/`;
|
|
242
|
+
}
|
|
243
|
+
function normalizeBasePath(base) {
|
|
244
|
+
return cleanDoubleSlashes(withTrailingSlash(withLeadingSlash(base)));
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Resolve the listening port for `createDevServer` (and `createHandler`'s
|
|
248
|
+
* side-car tiers), honoring the definition's `cli.port` / `cli.portRange` /
|
|
249
|
+
* `cli.random` settings. Exposed separately so authors who run their own
|
|
250
|
+
* argv parsing can resolve a port up-front (to print it, log it, etc.)
|
|
251
|
+
* before starting the server.
|
|
252
|
+
*/
|
|
253
|
+
async function resolveDevServerPort(def, options = {}) {
|
|
254
|
+
const host = options.host ?? def.cli?.host ?? "localhost";
|
|
255
|
+
const portOptions = {
|
|
256
|
+
port: options.defaultPort ?? def.cli?.port ?? DEFAULT_PORT,
|
|
257
|
+
host
|
|
258
|
+
};
|
|
259
|
+
if (def.cli?.portRange) portOptions.portRange = def.cli.portRange;
|
|
260
|
+
if (def.cli?.random) portOptions.random = def.cli.random;
|
|
261
|
+
return getPort(portOptions);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Normalize the `cli.mcp` / `mcp` option (`boolean | McpRouteOptions`) into
|
|
265
|
+
* concrete options, or `undefined` when the MCP route is disabled.
|
|
266
|
+
*/
|
|
267
|
+
function resolveMcpConfig(mcp) {
|
|
268
|
+
if (!mcp) return void 0;
|
|
269
|
+
return mcp === true ? {} : mcp;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Resolve the `mcp` entry a `__connection.json` should advertise for a dev
|
|
273
|
+
* server started with the given `mcp` option (falling back to `def.cli?.mcp`,
|
|
274
|
+
* exactly like `createDevServer`), or `undefined` when the route is
|
|
275
|
+
* disabled.
|
|
276
|
+
*
|
|
277
|
+
* Hosted bridges that hand-roll their connection meta pass the side-car
|
|
278
|
+
* `port`: the advertised path becomes absolute (the side-car mounts at `/`)
|
|
279
|
+
* and the client dials `<page-host>:<port><path>`. Without `port` the path
|
|
280
|
+
* stays relative, resolved against `__connection.json`'s own location (the
|
|
281
|
+
* same-server default).
|
|
282
|
+
*/
|
|
283
|
+
function resolveMcpConnectionMeta(def, mcp, port) {
|
|
284
|
+
const config = resolveMcpConfig(mcp ?? def.cli?.mcp);
|
|
285
|
+
if (!config) return void 0;
|
|
286
|
+
const route = withoutLeadingSlash(config.path ?? "__mcp");
|
|
287
|
+
return port != null ? {
|
|
288
|
+
path: withLeadingSlash(route),
|
|
289
|
+
port
|
|
290
|
+
} : { path: route };
|
|
291
|
+
}
|
|
292
|
+
//#endregion
|
|
293
|
+
export { dist_exports as a, resolveMcpConnectionMeta as i, resolveBasePath as n, resolveDevServerPort as r, normalizeBasePath as t };
|
package/dist/adapters/build.mjs
CHANGED
|
@@ -3,9 +3,9 @@ import { n as strictJsonStringify } from "../serialization-BHY8M5NQ.mjs";
|
|
|
3
3
|
import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME } from "../constants.mjs";
|
|
4
4
|
import { t as collectStaticRpcDump } from "../static-CvjkO8QE.mjs";
|
|
5
5
|
import { n as structuredCloneStringify } from "../structured-clone-CbAV5rFI.mjs";
|
|
6
|
-
import { t as diagnostics } from "../diagnostics-
|
|
7
|
-
import { t as createHostContext } from "../context-
|
|
8
|
-
import { n as resolveBasePath } from "../_shared-
|
|
6
|
+
import { t as diagnostics } from "../diagnostics-C7IGWppM.mjs";
|
|
7
|
+
import { t as createHostContext } from "../context-b6iSomtv.mjs";
|
|
8
|
+
import { n as resolveBasePath } from "../_shared-CGPVmXUM.mjs";
|
|
9
9
|
import { t as createH3DevframeHost } from "../host-h3-CzCZwtuV.mjs";
|
|
10
10
|
import { existsSync } from "node:fs";
|
|
11
11
|
import { dirname, resolve } from "pathe";
|
package/dist/adapters/cac.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { It as CliFlagsSchema, Lt as InferCliFlags, Rt as defineCliFlags, r as DevframeDefinition, zt as parseCliFlags } from "../devframe-5oblos7I.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,7 @@
|
|
|
1
1
|
import { n as colors } from "../diagnostics-reporter-CsIG85Q5.mjs";
|
|
2
|
-
import { r as resolveDevServerPort } from "../_shared-
|
|
2
|
+
import { r as resolveDevServerPort } from "../_shared-CGPVmXUM.mjs";
|
|
3
3
|
import { createBuild } from "./build.mjs";
|
|
4
|
-
import { t as createDevServer } from "../dev-
|
|
4
|
+
import { t as createDevServer } from "../dev-4xjiynUD.mjs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import cac$1 from "cac";
|
|
7
7
|
//#region src/adapters/flags.ts
|
|
@@ -94,7 +94,7 @@ function createCac(d, options = {}) {
|
|
|
94
94
|
const defaultPort = options.defaultPort ?? d.cli?.port ?? 9999;
|
|
95
95
|
const defaultHost = d.cli?.host ?? "localhost";
|
|
96
96
|
const cli = cac$1(d.cli?.command ?? d.id);
|
|
97
|
-
const devCommand = cli.command("[...args]", "Start a local dev server").option("--port <port>", "Port to listen on").option("--host <host>", "Host to bind to", { default: defaultHost }).option("--open", "Open the browser on start").option("--no-open", "Do not open the browser").option("--no-auth", "Disable the interactive authentication gate").option("--mcp", "Expose an MCP server over HTTP at /__mcp (use --no-mcp to disable)
|
|
97
|
+
const devCommand = cli.command("[...args]", "Start a local dev server").option("--port <port>", "Port to listen on").option("--host <host>", "Host to bind to", { default: defaultHost }).option("--open", "Open the browser on start").option("--no-open", "Do not open the browser").option("--no-auth", "Disable the interactive authentication gate").option("--mcp", "Expose an MCP server over HTTP at /__mcp (use --no-mcp to disable)");
|
|
98
98
|
if (d.cli?.flags) for (const [key, schema] of Object.entries(d.cli.flags)) {
|
|
99
99
|
const optionName = flagKeyToOption(key);
|
|
100
100
|
const description = schema.description ?? "";
|
|
@@ -124,7 +124,7 @@ function createCac(d, options = {}) {
|
|
|
124
124
|
pretty: flags.pretty
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
|
-
cli.command("mcp", "Start an MCP server exposing agent-facing tools (stdio)
|
|
127
|
+
cli.command("mcp", "Start an MCP server exposing agent-facing tools (stdio)").action(async () => {
|
|
128
128
|
const { createMcpServer } = await import("./mcp.mjs");
|
|
129
129
|
await createMcpServer(d, {
|
|
130
130
|
transport: "stdio",
|
package/dist/adapters/dev.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as DevframeRpcConnection, u as DevframeNodeRpcSessionMeta } from "../ws-server-
|
|
3
|
-
import { c as StartedServer } from "../instance-shell-
|
|
4
|
-
import { a as resolveMcpConnectionMeta, i as resolveDevServerPort, t as ResolveDevServerPortOptions } from "../_shared-
|
|
1
|
+
import { K as DevframeNodeRpcSession, d as DevframeWsOptions, f as McpRouteOptions, p as DevframeAuthHandler, r as DevframeDefinition, u as DevframeSseOptions } from "../devframe-5oblos7I.mjs";
|
|
2
|
+
import { d as DevframeRpcConnection, u as DevframeNodeRpcSessionMeta } from "../ws-server-D1d3QM9f.mjs";
|
|
3
|
+
import { c as StartedServer } from "../instance-shell-B-BSVp37.mjs";
|
|
4
|
+
import { a as resolveMcpConnectionMeta, i as resolveDevServerPort, t as ResolveDevServerPortOptions } from "../_shared-Bm8p4-fD.mjs";
|
|
5
5
|
import { H3 } from "h3";
|
|
6
6
|
//#region src/adapters/dev.d.ts
|
|
7
7
|
interface CreateDevServerOptions {
|
|
@@ -24,7 +24,7 @@ interface CreateDevServerOptions {
|
|
|
24
24
|
* `def.cli?.distDir` is set, the dev server runs in **bridge mode** —
|
|
25
25
|
* only `__connection.json` and the WS endpoint are mounted; the SPA
|
|
26
26
|
* is expected to be hosted elsewhere (e.g. by a parent Vite/Nuxt
|
|
27
|
-
* dev server via `
|
|
27
|
+
* dev server via `devframeViteBridge` from `@devframes/vite`).
|
|
28
28
|
*/
|
|
29
29
|
distDir?: string;
|
|
30
30
|
/**
|
|
@@ -63,7 +63,7 @@ interface CreateDevServerOptions {
|
|
|
63
63
|
* Override how authentication resolves, taking precedence over
|
|
64
64
|
* `def.cli?.auth`. Pass `false` to skip the gate entirely (the standard
|
|
65
65
|
* choice for a **hosted** deployment where the host manages auth — see
|
|
66
|
-
* {@link
|
|
66
|
+
* {@link devframeViteBridge} from `@devframes/vite`); a {@link DevframeAuthHandler} to install a custom
|
|
67
67
|
* scheme; or `true` to force devframe's interactive OTP gate on. When
|
|
68
68
|
* omitted, auth resolves from `flags.auth` / `def.cli?.auth` (the standalone
|
|
69
69
|
* default: gated). The `--no-auth` flag (`flags.auth === false`) still forces
|
|
@@ -107,7 +107,7 @@ interface CreateDevServerOptions {
|
|
|
107
107
|
* server runs in **bridge mode**: only `__connection.json` and the WS
|
|
108
108
|
* endpoint are mounted, with no SPA mount. The SPA is expected to be
|
|
109
109
|
* hosted elsewhere (e.g. by a parent Vite/Nuxt dev server) — see
|
|
110
|
-
* `
|
|
110
|
+
* `devframeViteBridge` from `@devframes/vite`.
|
|
111
111
|
*
|
|
112
112
|
* Returns the underlying {@link StartedServer} handle so callers can
|
|
113
113
|
* close it gracefully (SIGINT, hot-reload, test teardown).
|
package/dist/adapters/dev.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as resolveMcpConnectionMeta, r as resolveDevServerPort } from "../_shared-
|
|
2
|
-
import { t as createDevServer } from "../dev-
|
|
1
|
+
import { i as resolveMcpConnectionMeta, r as resolveDevServerPort } from "../_shared-CGPVmXUM.mjs";
|
|
2
|
+
import { t as createDevServer } from "../dev-4xjiynUD.mjs";
|
|
3
3
|
export { createDevServer, resolveDevServerPort, resolveMcpConnectionMeta };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as DevframeNodeContext, r as DevframeDefinition } from "../devframe-5oblos7I.mjs";
|
|
2
2
|
//#region src/adapters/embedded.d.ts
|
|
3
3
|
interface CreateEmbeddedOptions {
|
|
4
4
|
/** Target context the devframe is registered into. Required. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-
|
|
3
|
-
import { c as StartedServer, f as DevframeInstanceRecord } from "../instance-shell-
|
|
1
|
+
import { K as DevframeNodeRpcSession, S as DevframeNodeContext, V as DevframeStorageScope, _ as ConnectionMeta, d as DevframeWsOptions, f as McpRouteOptions, p as DevframeAuthHandler, r as DevframeDefinition, u as DevframeSseOptions } from "../devframe-5oblos7I.mjs";
|
|
2
|
+
import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-D1d3QM9f.mjs";
|
|
3
|
+
import { c as StartedServer, f as DevframeInstanceRecord } from "../instance-shell-B-BSVp37.mjs";
|
|
4
4
|
import { Buffer } from "node:buffer";
|
|
5
5
|
import { IncomingMessage, Server, ServerResponse } from "node:http";
|
|
6
6
|
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-4xjiynUD.mjs";
|
|
2
2
|
export { getInstanceInternals, initDevframe };
|
package/dist/adapters/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as DevframeNodeContext, r as DevframeDefinition } from "../devframe-5oblos7I.mjs";
|
|
2
2
|
import { H3 } from "h3";
|
|
3
3
|
import "@modelcontextprotocol/server";
|
|
4
4
|
//#region src/adapters/mcp/build-server.d.ts
|
|
@@ -32,9 +32,6 @@ interface McpServerHandle {
|
|
|
32
32
|
/**
|
|
33
33
|
* Build an MCP server over the agent surface of a devframe definition.
|
|
34
34
|
* Currently supports `stdio` transport only.
|
|
35
|
-
*
|
|
36
|
-
* @experimental The agent-native surface is experimental and may change
|
|
37
|
-
* without a major version bump until it stabilizes.
|
|
38
35
|
*/
|
|
39
36
|
declare function createMcpServer(definition: DevframeDefinition, options?: CreateMcpServerOptions): Promise<McpServerHandle>;
|
|
40
37
|
//#endregion
|
|
@@ -81,8 +78,6 @@ interface McpFetchHandler {
|
|
|
81
78
|
* loopback-default DNS-rebinding protection that — unlike the WS upgrade's
|
|
82
79
|
* `isAllowedOrigin` — also rejects `Origin`-less requests, so a route-based
|
|
83
80
|
* endpoint isn't reachable by an arbitrary local process.
|
|
84
|
-
*
|
|
85
|
-
* @experimental
|
|
86
81
|
*/
|
|
87
82
|
declare function createMcpFetchHandler(ctx: DevframeNodeContext, options: CreateMcpFetchHandlerOptions): McpFetchHandler;
|
|
88
83
|
//#endregion
|
|
@@ -104,8 +99,6 @@ interface MountedMcpHttp {
|
|
|
104
99
|
* legitimate MCP 404 (unknown session) isn't swallowed by h3's
|
|
105
100
|
* "Response-with-404 falls through to the next handler" rule (which would
|
|
106
101
|
* otherwise hand the request to the SPA static catch-all).
|
|
107
|
-
*
|
|
108
|
-
* @experimental
|
|
109
102
|
*/
|
|
110
103
|
declare function mountMcpHttp(app: H3, ctx: DevframeNodeContext, path: string, options: MountMcpHttpOptions): MountedMcpHttp;
|
|
111
104
|
//#endregion
|
package/dist/adapters/mcp.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as createMcpServer, n as mountMcpHttp, r as createMcpFetchHandler } from "../http-
|
|
1
|
+
import { i as createMcpServer, n as mountMcpHttp, r as createMcpFetchHandler } from "../http-Z0w9baEe.mjs";
|
|
2
2
|
export { createMcpFetchHandler, createMcpServer, mountMcpHttp };
|
|
@@ -23,9 +23,6 @@ const MAX_TOOL_NAME_LENGTH = 128;
|
|
|
23
23
|
* A plain string transform with no node dependency, so browser-side UIs
|
|
24
24
|
* that display a tool's id (e.g. the inspect plugin's agent view) can
|
|
25
25
|
* import it too and show the name a client actually calls.
|
|
26
|
-
*
|
|
27
|
-
* @experimental The agent-native surface is experimental and may change
|
|
28
|
-
* without a major version bump until it stabilizes.
|
|
29
26
|
*/
|
|
30
27
|
function toAgentToolName(id) {
|
|
31
28
|
return id.replace(/[^\w-]+/g, "_").slice(0, MAX_TOOL_NAME_LENGTH);
|
package/dist/cli/main.d.mts
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
* The `devframe` bin — the framework's own CLI, distinct from the per-app
|
|
4
4
|
* CLI shells authors build with `createCac(definition)`. It hosts the
|
|
5
5
|
* app-independent commands; today that is `connect`, the MCP connector.
|
|
6
|
-
*
|
|
7
|
-
* @experimental
|
|
8
6
|
*/
|
|
9
7
|
declare function runDevframeCli(argv?: string[]): Promise<void>;
|
|
10
8
|
//#endregion
|
package/dist/cli/main.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as diagnostics } from "../diagnostics-
|
|
2
|
-
import { n as listLiveDevframeInstances, r as probeDevframeOrigin } from "../instance-registry-
|
|
3
|
-
import { t as toAgentToolName } from "../agent-tool-name-
|
|
1
|
+
import { t as diagnostics } from "../diagnostics-C7IGWppM.mjs";
|
|
2
|
+
import { n as listLiveDevframeInstances, r as probeDevframeOrigin } from "../instance-registry-Du_hbx-j.mjs";
|
|
3
|
+
import { t as toAgentToolName } from "../agent-tool-name-EgfoFO8C.mjs";
|
|
4
4
|
import { Diagnostic } from "nostics";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { joinURL } from "ufo";
|
|
@@ -54,8 +54,6 @@ const GATEWAY_TOOLS = [{
|
|
|
54
54
|
* the instance registry and list each one's MCP tools) and
|
|
55
55
|
* `devframe_connect_call-tool` (invoke one tool on one instance over its
|
|
56
56
|
* Streamable-HTTP endpoint) — and holds no domain knowledge of its own.
|
|
57
|
-
*
|
|
58
|
-
* @experimental
|
|
59
57
|
*/
|
|
60
58
|
async function startConnectServer(options = {}) {
|
|
61
59
|
const sdk = await importSdk();
|
|
@@ -259,8 +257,6 @@ function keepAlive() {
|
|
|
259
257
|
* The `devframe` bin — the framework's own CLI, distinct from the per-app
|
|
260
258
|
* CLI shells authors build with `createCac(definition)`. It hosts the
|
|
261
259
|
* app-independent commands; today that is `connect`, the MCP connector.
|
|
262
|
-
*
|
|
263
|
-
* @experimental
|
|
264
260
|
*/
|
|
265
261
|
async function runDevframeCli(argv = process.argv) {
|
|
266
262
|
const cli = cac("devframe");
|
package/dist/client/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as RpcCacheManager, p as RpcCacheOptions } from "../index-
|
|
3
|
-
import { _ as RpcFunctionDefinition, w as RpcFunctionsCollector } from "../types-
|
|
4
|
-
import { t as SseRpcChannelOptions } from "../sse-client-
|
|
5
|
-
import { t as WsRpcChannelOptions } from "../ws-client-
|
|
1
|
+
import { A as DevframeSettings, F as ScopedRpcFn, I as ScopedServerFunctions, L as ScopedSharedStates, Nt as EventEmitter, R as SettingsForNamespace, X as RpcSharedStateHost, Y as RpcSharedStateGetOptions, _ as ConnectionMeta, _t as SharedState, ct as StreamSink, et as DevframeRpcClientFunctions, st as StreamReader, tt as DevframeRpcServerFunctions } from "../devframe-5oblos7I.mjs";
|
|
2
|
+
import { f as RpcCacheManager, p as RpcCacheOptions } from "../index-tdrk1bzV.mjs";
|
|
3
|
+
import { _ as RpcFunctionDefinition, w as RpcFunctionsCollector } from "../types-Djq7CBXh.mjs";
|
|
4
|
+
import { t as SseRpcChannelOptions } from "../sse-client-CFBOIaUi.mjs";
|
|
5
|
+
import { t as WsRpcChannelOptions } from "../ws-client-DhjNyQo3.mjs";
|
|
6
6
|
import { BirpcOptions, BirpcReturn } from "birpc";
|
|
7
7
|
//#region src/client/connection.d.ts
|
|
8
8
|
interface DevframeConnection {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as randomToken } from "./crypto-token-XCqTSMg9.mjs";
|
|
2
|
-
import { t as createStorage } from "./storage-
|
|
2
|
+
import { t as createStorage } from "./storage-CaUVrBrG.mjs";
|
|
3
3
|
import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "./revoke-DZbJ7Cl0.mjs";
|
|
4
4
|
import { join } from "pathe";
|
|
5
5
|
//#region src/node/hub-internals/context.ts
|
|
@@ -11,6 +11,7 @@ function getInternalContext(context) {
|
|
|
11
11
|
initialValue: { trusted: {} }
|
|
12
12
|
});
|
|
13
13
|
const remoteTokens = /* @__PURE__ */ new Map();
|
|
14
|
+
const wsEndpointListeners = /* @__PURE__ */ new Set();
|
|
14
15
|
function revokeRemoteToken(token) {
|
|
15
16
|
if (!remoteTokens.delete(token)) return;
|
|
16
17
|
revokeActiveConnectionsForToken(context, token);
|
|
@@ -18,6 +19,14 @@ function getInternalContext(context) {
|
|
|
18
19
|
const internalContext = {
|
|
19
20
|
storage: { auth: storage },
|
|
20
21
|
revokeAuthToken: (token) => revokeAuthToken(context, storage, token),
|
|
22
|
+
setWsEndpoint(endpoint) {
|
|
23
|
+
internalContext.wsEndpoint = endpoint;
|
|
24
|
+
for (const listener of wsEndpointListeners) listener();
|
|
25
|
+
},
|
|
26
|
+
onWsEndpointChange(cb) {
|
|
27
|
+
wsEndpointListeners.add(cb);
|
|
28
|
+
return () => wsEndpointListeners.delete(cb);
|
|
29
|
+
},
|
|
21
30
|
remoteTokens,
|
|
22
31
|
allocateRemoteToken(dockId, origin, originLock) {
|
|
23
32
|
const token = randomToken();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as DevframeNodeContext, _t as SharedState } from "./devframe-5oblos7I.mjs";
|
|
2
2
|
//#region src/node/hub-internals/context.d.ts
|
|
3
3
|
interface InternalAnonymousAuthStorage {
|
|
4
4
|
trusted: Record<string, {
|
|
@@ -44,6 +44,24 @@ interface DevframeInternalContext {
|
|
|
44
44
|
/** Full `ws://` or `wss://` URL with host and port. */
|
|
45
45
|
url: string;
|
|
46
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Set {@link DevframeInternalContext.wsEndpoint} and notify subscribers —
|
|
49
|
+
* the WS-binding tiers (side-car, shared-server, and the `unbound` tier's
|
|
50
|
+
* `attach()`) call this once the socket is bound (or `undefined` once torn
|
|
51
|
+
* down) instead of assigning the field directly, so anything that already
|
|
52
|
+
* projected the endpoint (a hub's remote-dock URLs, registered before an
|
|
53
|
+
* async bind resolves) gets a chance to re-project it.
|
|
54
|
+
*/
|
|
55
|
+
setWsEndpoint: (endpoint: {
|
|
56
|
+
url: string;
|
|
57
|
+
} | undefined) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Subscribe to every {@link DevframeInternalContext.setWsEndpoint} call.
|
|
60
|
+
* Returns an unsubscribe function. The hub context uses this to refresh
|
|
61
|
+
* the `devframe:docks` shared state so a remote dock registered before the
|
|
62
|
+
* WS port resolves still ends up with a live connection URL.
|
|
63
|
+
*/
|
|
64
|
+
onWsEndpointChange: (cb: () => void) => () => void;
|
|
47
65
|
}
|
|
48
66
|
declare const internalContextMap: WeakMap<DevframeNodeContext, DevframeInternalContext>;
|
|
49
67
|
declare function getInternalContext(context: DevframeNodeContext): DevframeInternalContext;
|
|
@@ -2,9 +2,9 @@ import { t as devframeReporter } from "./diagnostics-reporter-CsIG85Q5.mjs";
|
|
|
2
2
|
import { t as diagnostics } from "./diagnostics-hwjXp_UV.mjs";
|
|
3
3
|
import { RpcFunctionsCollectorBase } from "./rpc/index.mjs";
|
|
4
4
|
import { defineRpcFunction } from "./index.mjs";
|
|
5
|
-
import { t as diagnostics$1 } from "./diagnostics-
|
|
6
|
-
import { i as createEventEmitter, n as createSharedState, r as nanoid, t as createStorage } from "./storage-
|
|
7
|
-
import { t as DevframeAgentHost } from "./host-agent-
|
|
5
|
+
import { t as diagnostics$1 } from "./diagnostics-C7IGWppM.mjs";
|
|
6
|
+
import { i as createEventEmitter, n as createSharedState, r as nanoid, t as createStorage } from "./storage-CaUVrBrG.mjs";
|
|
7
|
+
import { t as DevframeAgentHost } from "./host-agent-BBkKT27Q.mjs";
|
|
8
8
|
import { defineDiagnostics } from "nostics";
|
|
9
9
|
import { isatty } from "node:tty";
|
|
10
10
|
import { formatWithOptions, inspect } from "node:util";
|
|
@@ -1131,8 +1131,6 @@ const agentListResources = defineRpcFunction({
|
|
|
1131
1131
|
* Built-in agent introspection RPC functions. Registered automatically
|
|
1132
1132
|
* by `createHostContext`. Not themselves agent-exposed (no `agent`
|
|
1133
1133
|
* field) — they power the MCP adapter and any future agent CLI.
|
|
1134
|
-
*
|
|
1135
|
-
* @experimental
|
|
1136
1134
|
*/
|
|
1137
1135
|
const BUILTIN_AGENT_RPC = [
|
|
1138
1136
|
defineRpcFunction({
|
|
@@ -1297,6 +1295,7 @@ async function createHostContext(options) {
|
|
|
1297
1295
|
diagnostics: void 0,
|
|
1298
1296
|
agent: void 0,
|
|
1299
1297
|
services: void 0,
|
|
1298
|
+
staticConfig: {},
|
|
1300
1299
|
scope: void 0
|
|
1301
1300
|
};
|
|
1302
1301
|
const rpcHost = new RpcFunctionsHostImpl(context);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DEVFRAME_CONNECTION_META_FILENAME } from "./constants.mjs";
|
|
2
|
-
import { t as diagnostics } from "./diagnostics-
|
|
3
|
-
import { t as createHostContext } from "./context-
|
|
4
|
-
import { i as resolveMcpConnectionMeta, n as resolveBasePath, r as resolveDevServerPort, t as normalizeBasePath } from "./_shared-
|
|
2
|
+
import { t as diagnostics } from "./diagnostics-C7IGWppM.mjs";
|
|
3
|
+
import { t as createHostContext } from "./context-b6iSomtv.mjs";
|
|
4
|
+
import { i as resolveMcpConnectionMeta, n as resolveBasePath, r as resolveDevServerPort, t as normalizeBasePath } from "./_shared-CGPVmXUM.mjs";
|
|
5
5
|
import { t as createH3DevframeHost } from "./host-h3-CzCZwtuV.mjs";
|
|
6
|
-
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, t as createInstanceShell } from "./instance-shell-
|
|
6
|
+
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, t as createInstanceShell } from "./instance-shell-B0TwOxCl.mjs";
|
|
7
7
|
import { t as open } from "./open-Dz4V4irZ.mjs";
|
|
8
8
|
import { mountStaticHandler } from "./utils/serve-static.mjs";
|
|
9
9
|
import { createServer } from "node:http";
|
|
@@ -86,7 +86,7 @@ function initDevframe(def, options) {
|
|
|
86
86
|
const mcpPath = joinURL(base, mcpMeta.path);
|
|
87
87
|
let mountMcpHttp;
|
|
88
88
|
try {
|
|
89
|
-
({mountMcpHttp} = await import("./http-
|
|
89
|
+
({mountMcpHttp} = await import("./http-Z0w9baEe.mjs").then((n) => n.t));
|
|
90
90
|
} catch (error) {
|
|
91
91
|
const reason = error instanceof Error ? error.message : String(error);
|
|
92
92
|
throw diagnostics.DF0017({
|
|
@@ -138,7 +138,7 @@ function initDevframe(def, options) {
|
|
|
138
138
|
* server runs in **bridge mode**: only `__connection.json` and the WS
|
|
139
139
|
* endpoint are mounted, with no SPA mount. The SPA is expected to be
|
|
140
140
|
* hosted elsewhere (e.g. by a parent Vite/Nuxt dev server) — see
|
|
141
|
-
* `
|
|
141
|
+
* `devframeViteBridge` from `@devframes/vite`.
|
|
142
142
|
*
|
|
143
143
|
* Returns the underlying {@link StartedServer} handle so callers can
|
|
144
144
|
* close it gracefully (SIGINT, hot-reload, test teardown).
|