devframe 0.9.0-beta.1 → 0.9.0-beta.10
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-BPmX9fqK.d.mts} +2 -4
- package/dist/{_shared-CttmCMBi.mjs → _shared-CbZ_yhbz.mjs} +2 -4
- package/dist/adapters/build.d.mts +10 -12
- package/dist/adapters/build.mjs +26 -30
- package/dist/adapters/cac.d.mts +1 -1
- package/dist/adapters/cac.mjs +6 -7
- package/dist/adapters/dev.d.mts +22 -8
- package/dist/adapters/dev.mjs +2 -2
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/initiate.d.mts +5 -4
- 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 +4 -8
- package/dist/client/index.d.mts +5 -5
- package/dist/client/index.mjs +24 -1179
- package/dist/constants.d.mts +10 -2
- package/dist/constants.mjs +10 -2
- package/dist/{context-CSCwoABx.d.mts → context-B3YUu_95.d.mts} +19 -1
- package/dist/{context-Du11TLcO.mjs → context-CEe4PBz1.mjs} +23 -305
- package/dist/{context-C33rR7n0.mjs → context-xdynGSLP.mjs} +10 -1
- package/dist/{dev-BEveeA5H.mjs → dev--rAPzbvO.mjs} +16 -10
- package/dist/{devframe-Bdd9YXTy.d.mts → devframe-DJMg0WLe.d.mts} +97 -113
- package/dist/{diagnostics-hwjXp_UV.mjs → diagnostics-CD8nlgll.mjs} +1 -3
- package/dist/{diagnostics-DLYH5oD3.mjs → diagnostics-DOQPnQmX.mjs} +35 -5
- package/dist/{dist-D8jAMwxU.mjs → dist-eNI9qM_I.mjs} +1 -0
- package/dist/{host-agent-CpbAoqBx.mjs → host-agent-xLCSe65D.mjs} +41 -7
- package/dist/{host-h3-CzCZwtuV.mjs → host-h3-Crkzm42q.mjs} +2 -2
- package/dist/{http-DLr_cJZ7.mjs → http-DYpK0cUi.mjs} +5 -12
- package/dist/{index-CZRd2K1C.d.mts → index-CB-fSUyn.d.mts} +2 -2
- package/dist/{index-DSCq4M4q.d.mts → index-tdrk1bzV.d.mts} +1 -1
- package/dist/index.d.mts +7 -5
- package/dist/{instance-registry-BQqGoDO9.mjs → instance-registry-WvQkt42E.mjs} +1 -7
- package/dist/{instance-shell-KRdee1QF.mjs → instance-shell-CMFyszWJ.mjs} +9 -8
- package/dist/{instance-shell-DBTXTSjN.d.mts → instance-shell-CljiKq1c.d.mts} +3 -12
- package/dist/internal/index.d.mts +265 -18
- package/dist/internal/index.mjs +9 -7
- 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 +2 -2
- package/dist/node/index.d.mts +3 -3
- package/dist/node/index.mjs +2 -2
- package/dist/nostics-CzECRXpE.mjs +59 -0
- package/dist/nostics-SPGDgHEP.d.mts +33 -0
- 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 +3 -3
- package/dist/remote-assets-Bg4gCUZ_.d.mts +123 -0
- package/dist/remote-assets-nTTxY2MU.mjs +636 -0
- package/dist/rpc/dump.d.mts +1 -1
- package/dist/rpc/dump.mjs +1 -1
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/index.mjs +3 -3
- package/dist/rpc/transports/sse-client.d.mts +1 -1
- package/dist/rpc/transports/sse-client.mjs +1 -1
- package/dist/rpc/transports/sse-server.d.mts +2 -2
- package/dist/rpc/transports/sse-server.mjs +2 -2
- package/dist/rpc/transports/ws-bun.d.mts +2 -2
- package/dist/rpc/transports/ws-bun.mjs +1 -1
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +1 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +1 -1
- package/dist/{rpc-core-CGctXToO.d.mts → rpc-core-Cc4lucI0.d.mts} +3 -3
- package/dist/{rpc-core-CqcJkAu9.mjs → rpc-core-DMTe-hLo.mjs} +1 -1
- package/dist/{serialization-BHY8M5NQ.mjs → serialization-BGzEwAdr.mjs} +1 -1
- package/dist/{sse-client-BsIK3hMD.d.mts → sse-client-CFBOIaUi.d.mts} +1 -1
- package/dist/state-Cc1IeSmQ.mjs +1291 -0
- package/dist/{static-CvjkO8QE.mjs → static-BPZ1_OPA.mjs} +2 -2
- package/dist/storage-CYye7P7L.mjs +137 -0
- package/dist/types/index.d.mts +6 -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/get-port.d.mts +17 -0
- package/dist/utils/get-port.mjs +2 -0
- package/dist/utils/nostics.d.mts +2 -0
- package/dist/utils/nostics.mjs +2 -0
- package/dist/utils/open.d.mts +2 -10
- package/dist/utils/open.mjs +56 -1
- package/dist/utils/remote-assets.d.mts +15 -0
- package/dist/utils/remote-assets.mjs +2 -0
- package/dist/utils/serve-static.d.mts +13 -5
- package/dist/utils/serve-static.mjs +119 -9
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/{validation-BiuDXTKW.mjs → validation-CpXFB6Dz.mjs} +1 -1
- package/dist/{wire-codec-9VhIKnyp.mjs → wire-codec-0K-o5MYW.mjs} +1 -3
- package/dist/{ws-client-CdNuATYa.d.mts → ws-client-DhjNyQo3.d.mts} +1 -1
- package/dist/{ws-server-Bk1hOG3X.mjs → ws-server-BdSLrhxE.mjs} +1 -1
- package/dist/{ws-server-Ces08fjP.d.mts → ws-server-D1d3QM9f.d.mts} +1 -1
- package/package.json +4 -4
- package/skills/devframe/SKILL.md +10 -11
- package/dist/diagnostics-reporter-CsIG85Q5.mjs +0 -38
- package/dist/helpers/vite.d.mts +0 -104
- package/dist/helpers/vite.mjs +0 -93
- package/dist/open-Dz4V4irZ.mjs +0 -547
- package/dist/state-BeUHDDjk.mjs +0 -108
- package/dist/storage-BcmVEJRc.mjs +0 -1122
- package/skills/devframe/templates/spa-devframe.ts +0 -38
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as ConnectionMeta, l as McpRouteOptions, n as DevframeDefinition, r as DevframeDeploymentKind } from "./devframe-DJMg0WLe.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
|
|
5
5
|
* (`vite`, `embedded`) default to `/__<id>/` so they don't collide
|
|
6
|
-
* with the host app; standalone adapters (`cli`, `
|
|
6
|
+
* with the host app; standalone adapters (`cli`, `build`)
|
|
7
7
|
* default to `/` because they own the origin.
|
|
8
8
|
*
|
|
9
9
|
* The devframe author can override with `basePath` on the definition.
|
|
@@ -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,12 +1,12 @@
|
|
|
1
1
|
import "./constants.mjs";
|
|
2
|
-
import { n as getPort } from "./dist-
|
|
2
|
+
import { n as getPort } from "./dist-eNI9qM_I.mjs";
|
|
3
3
|
import { cleanDoubleSlashes, withLeadingSlash, withTrailingSlash, withoutLeadingSlash } from "ufo";
|
|
4
4
|
//#region src/adapters/_shared.ts
|
|
5
5
|
const DEFAULT_PORT = 9999;
|
|
6
6
|
/**
|
|
7
7
|
* Resolve the mount base path for a devframe's SPA. Hosted adapters
|
|
8
8
|
* (`vite`, `embedded`) default to `/__<id>/` so they don't collide
|
|
9
|
-
* with the host app; standalone adapters (`cli`, `
|
|
9
|
+
* with the host app; standalone adapters (`cli`, `build`)
|
|
10
10
|
* default to `/` because they own the origin.
|
|
11
11
|
*
|
|
12
12
|
* The devframe author can override with `basePath` on the definition.
|
|
@@ -54,8 +54,6 @@ function resolveMcpConfig(mcp) {
|
|
|
54
54
|
* and the client dials `<page-host>:<port><path>`. Without `port` the path
|
|
55
55
|
* stays relative, resolved against `__connection.json`'s own location (the
|
|
56
56
|
* same-server default).
|
|
57
|
-
*
|
|
58
|
-
* @experimental
|
|
59
57
|
*/
|
|
60
58
|
function resolveMcpConnectionMeta(def, mcp, port) {
|
|
61
59
|
const config = resolveMcpConfig(mcp ?? def.cli?.mcp);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as DevframeDefinition } from "../devframe-DJMg0WLe.mjs";
|
|
2
|
+
import { o as StaticAssetsSource } from "../remote-assets-Bg4gCUZ_.mjs";
|
|
2
3
|
//#region src/adapters/build.d.ts
|
|
3
4
|
interface CreateBuildOptions {
|
|
4
5
|
/** Output directory. Defaults to `dist-static`. */
|
|
5
6
|
outDir?: string;
|
|
6
|
-
/** Absolute URL base the output is served from (default: `/`). */
|
|
7
|
-
base?: string;
|
|
8
7
|
/**
|
|
9
|
-
* Override the SPA dist
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Override the SPA dist to copy into `outDir` — a local directory or a
|
|
9
|
+
* remote-assets declaration (materialized in full at build time). When
|
|
10
|
+
* omitted the adapter reads `devframe.cli?.distDir` — authors typically
|
|
11
|
+
* set this once on the definition itself.
|
|
12
12
|
*/
|
|
13
|
-
distDir?:
|
|
13
|
+
distDir?: StaticAssetsSource;
|
|
14
14
|
/**
|
|
15
15
|
* Pretty-print RPC dump JSON files. Defaults to `false` so payload
|
|
16
16
|
* shards (which can be multiple MB for graph-heavy tools) ship
|
|
@@ -32,11 +32,9 @@ interface CreateBuildOptions {
|
|
|
32
32
|
* - Copy the author's SPA dist into `<outDir>/`.
|
|
33
33
|
* - Write `<outDir>/__connection.json` (`{ backend: 'static' }`) and the
|
|
34
34
|
* sharded RPC dump under `<outDir>/__rpc-dump/` so the deployed SPA
|
|
35
|
-
* discovers both via relative paths from `document.baseURI`.
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* `'none'`). The output is mount-path agnostic — the same bundle
|
|
39
|
-
* works at `/`, `/devframe/`, or any base, no rewriting required.
|
|
35
|
+
* discovers both via relative paths from `document.baseURI`. The
|
|
36
|
+
* output is mount-path agnostic — the same bundle works at `/`,
|
|
37
|
+
* `/devframe/`, or any base, no rewriting required.
|
|
40
38
|
*/
|
|
41
39
|
declare function createBuild(d: DevframeDefinition, options?: CreateBuildOptions): Promise<void>;
|
|
42
40
|
//#endregion
|
package/dist/adapters/build.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as strictJsonStringify } from "../serialization-
|
|
1
|
+
import { s as colors } from "../nostics-CzECRXpE.mjs";
|
|
2
|
+
import { n as strictJsonStringify } from "../serialization-BGzEwAdr.mjs";
|
|
3
3
|
import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME } from "../constants.mjs";
|
|
4
|
-
import { t as collectStaticRpcDump } from "../static-
|
|
4
|
+
import { t as collectStaticRpcDump } from "../static-BPZ1_OPA.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 {
|
|
9
|
-
import { t as createH3DevframeHost } from "../host-h3-
|
|
6
|
+
import { t as diagnostics } from "../diagnostics-DOQPnQmX.mjs";
|
|
7
|
+
import { t as createHostContext } from "../context-CEe4PBz1.mjs";
|
|
8
|
+
import { t as resolveStaticAssetsSource } from "../remote-assets-nTTxY2MU.mjs";
|
|
9
|
+
import { t as createH3DevframeHost } from "../host-h3-Crkzm42q.mjs";
|
|
10
10
|
import { existsSync } from "node:fs";
|
|
11
|
+
import fs$1 from "node:fs/promises";
|
|
11
12
|
import { dirname, resolve } from "pathe";
|
|
12
13
|
import process from "node:process";
|
|
13
|
-
import fs$1 from "node:fs/promises";
|
|
14
14
|
//#region src/adapters/build.ts
|
|
15
15
|
/**
|
|
16
16
|
* Produce a self-contained static deploy of a devframe:
|
|
@@ -19,28 +19,33 @@ import fs$1 from "node:fs/promises";
|
|
|
19
19
|
* - Copy the author's SPA dist into `<outDir>/`.
|
|
20
20
|
* - Write `<outDir>/__connection.json` (`{ backend: 'static' }`) and the
|
|
21
21
|
* sharded RPC dump under `<outDir>/__rpc-dump/` so the deployed SPA
|
|
22
|
-
* discovers both via relative paths from `document.baseURI`.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* `'none'`). The output is mount-path agnostic — the same bundle
|
|
26
|
-
* works at `/`, `/devframe/`, or any base, no rewriting required.
|
|
22
|
+
* discovers both via relative paths from `document.baseURI`. The
|
|
23
|
+
* output is mount-path agnostic — the same bundle works at `/`,
|
|
24
|
+
* `/devframe/`, or any base, no rewriting required.
|
|
27
25
|
*/
|
|
28
26
|
async function createBuild(d, options = {}) {
|
|
29
27
|
if (d.capabilities?.build === false && !options.force) throw diagnostics.DF0042({ id: d.id });
|
|
30
28
|
const outDir = resolve(options.outDir ?? "dist-static");
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
29
|
+
const distSource = options.distDir ?? d.cli?.distDir;
|
|
30
|
+
if (!distSource) throw new Error(`[devframe] createBuild: no distDir for "${d.id}". Set \`cli.distDir\` on the definition or pass it as an option.`);
|
|
33
31
|
if (existsSync(outDir)) await fs$1.rm(outDir, { recursive: true });
|
|
34
32
|
await fs$1.mkdir(outDir, { recursive: true });
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
const host = createH3DevframeHost({
|
|
34
|
+
origin: "http://localhost",
|
|
35
|
+
appName: d.id
|
|
36
|
+
});
|
|
37
|
+
const resolved = resolveStaticAssetsSource(distSource, host.getStorageDir("project"));
|
|
38
|
+
if (typeof resolved === "string") {
|
|
39
|
+
console.log(colors.cyan`[devframe] copying SPA from ${resolved} -> ${outDir}`);
|
|
40
|
+
await fs$1.cp(resolved, outDir, { recursive: true });
|
|
41
|
+
} else {
|
|
42
|
+
console.log(colors.cyan`[devframe] materializing SPA from ${resolved.assets.package}@${resolved.assets.version} -> ${outDir}`);
|
|
43
|
+
await resolved.materialize(outDir);
|
|
44
|
+
}
|
|
37
45
|
const ctx = await createHostContext({
|
|
38
46
|
cwd: process.cwd(),
|
|
39
47
|
mode: "build",
|
|
40
|
-
host
|
|
41
|
-
origin: "http://localhost",
|
|
42
|
-
appName: d.id
|
|
43
|
-
})
|
|
48
|
+
host
|
|
44
49
|
});
|
|
45
50
|
await d.setup(ctx);
|
|
46
51
|
await fs$1.mkdir(resolve(outDir, DEVFRAME_RPC_DUMP_DIRNAME), { recursive: true });
|
|
@@ -60,15 +65,6 @@ async function createBuild(d, options = {}) {
|
|
|
60
65
|
await fs$1.writeFile(fullpath, file.serialization === "json" && indent != null ? JSON.stringify(JSON.parse(text), null, indent) : text, "utf-8");
|
|
61
66
|
}
|
|
62
67
|
await fs$1.writeFile(resolve(outDir, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME), JSON.stringify(dump.manifest, null, 2), "utf-8");
|
|
63
|
-
if (d.spa) {
|
|
64
|
-
const base = options.base ?? resolveBasePath(d, "standalone");
|
|
65
|
-
const spaLoader = {
|
|
66
|
-
version: 1,
|
|
67
|
-
mode: d.spa.loader ?? "none",
|
|
68
|
-
base
|
|
69
|
-
};
|
|
70
|
-
await fs$1.writeFile(resolve(outDir, "spa-loader.json"), JSON.stringify(spaLoader, null, 2), "utf-8");
|
|
71
|
-
}
|
|
72
68
|
console.log(colors.green`[devframe] built "${d.id}" -> ${outDir}`);
|
|
73
69
|
}
|
|
74
70
|
//#endregion
|
package/dist/adapters/cac.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as defineCliFlags, Ot as CliFlagsSchema, jt as parseCliFlags, kt as InferCliFlags, n as DevframeDefinition } from "../devframe-DJMg0WLe.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
|
-
import {
|
|
2
|
-
import { r as resolveDevServerPort } from "../_shared-
|
|
1
|
+
import { s as colors } from "../nostics-CzECRXpE.mjs";
|
|
2
|
+
import { r as resolveDevServerPort } from "../_shared-CbZ_yhbz.mjs";
|
|
3
3
|
import { createBuild } from "./build.mjs";
|
|
4
|
-
import { t as createDevServer } from "../dev
|
|
4
|
+
import { t as createDevServer } from "../dev--rAPzbvO.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 ?? "";
|
|
@@ -117,14 +117,13 @@ function createCac(d, options = {}) {
|
|
|
117
117
|
onReady: options.onReady
|
|
118
118
|
});
|
|
119
119
|
});
|
|
120
|
-
if (d.capabilities?.build !== false) cli.command("build", "Build a self-contained static deploy of the devframe").option("--out-dir <outDir>", "Output directory", { default: "dist-static" }).option("--
|
|
120
|
+
if (d.capabilities?.build !== false) cli.command("build", "Build a self-contained static deploy of the devframe").option("--out-dir <outDir>", "Output directory", { default: "dist-static" }).option("--pretty", "Pretty-print dump JSON (larger on disk)").action(async (flags) => {
|
|
121
121
|
await createBuild(d, {
|
|
122
122
|
outDir: flags.outDir,
|
|
123
|
-
base: flags.base,
|
|
124
123
|
pretty: flags.pretty
|
|
125
124
|
});
|
|
126
125
|
});
|
|
127
|
-
cli.command("mcp", "Start an MCP server exposing agent-facing tools (stdio)
|
|
126
|
+
cli.command("mcp", "Start an MCP server exposing agent-facing tools (stdio)").action(async () => {
|
|
128
127
|
const { createMcpServer } = await import("./mcp.mjs");
|
|
129
128
|
await createMcpServer(d, {
|
|
130
129
|
transport: "stdio",
|
package/dist/adapters/dev.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as DevframeRpcConnection, u as DevframeNodeRpcSessionMeta } from "../ws-server-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { R as DevframeNodeRpcSession, c as DevframeWsOptions, l as McpRouteOptions, n as DevframeDefinition, s as DevframeSseOptions, u as DevframeAuthHandler } from "../devframe-DJMg0WLe.mjs";
|
|
2
|
+
import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-D1d3QM9f.mjs";
|
|
3
|
+
import { o as StaticAssetsSource } from "../remote-assets-Bg4gCUZ_.mjs";
|
|
4
|
+
import { c as StartedServer } from "../instance-shell-CljiKq1c.mjs";
|
|
5
|
+
import { a as resolveMcpConnectionMeta, i as resolveDevServerPort, t as ResolveDevServerPortOptions } from "../_shared-BPmX9fqK.mjs";
|
|
5
6
|
import { H3 } from "h3";
|
|
6
7
|
//#region src/adapters/dev.d.ts
|
|
7
8
|
interface CreateDevServerOptions {
|
|
@@ -24,9 +25,9 @@ interface CreateDevServerOptions {
|
|
|
24
25
|
* `def.cli?.distDir` is set, the dev server runs in **bridge mode** —
|
|
25
26
|
* only `__connection.json` and the WS endpoint are mounted; the SPA
|
|
26
27
|
* is expected to be hosted elsewhere (e.g. by a parent Vite/Nuxt
|
|
27
|
-
* dev server via `
|
|
28
|
+
* dev server via `devframeViteBridge` from `@devframes/vite`).
|
|
28
29
|
*/
|
|
29
|
-
distDir?:
|
|
30
|
+
distDir?: StaticAssetsSource;
|
|
30
31
|
/**
|
|
31
32
|
* Override the SPA mount path. Defaults to
|
|
32
33
|
* `resolveBasePath(def, 'standalone')` (i.e. `def.basePath` or `/`).
|
|
@@ -39,6 +40,13 @@ interface CreateDevServerOptions {
|
|
|
39
40
|
* clients connect over the SSE endpoint instead (`backend: 'sse'`).
|
|
40
41
|
*/
|
|
41
42
|
ws?: DevframeWsOptions | false;
|
|
43
|
+
/**
|
|
44
|
+
* Extra origins to accept on the WS upgrade beyond the loopback default.
|
|
45
|
+
* Add your LAN/tunnel origin here when reaching the tool from another
|
|
46
|
+
* host. Pass `false` to disable origin checking entirely (not
|
|
47
|
+
* recommended). Default: loopback-only.
|
|
48
|
+
*/
|
|
49
|
+
allowedOrigins?: readonly string[] | WsOriginRegistry | false;
|
|
42
50
|
/**
|
|
43
51
|
* Override the SSE RPC endpoint control (`def.cli?.sse`) — enabled by
|
|
44
52
|
* default at `<base>__sse`. Pass `false` to disable, or a
|
|
@@ -63,7 +71,7 @@ interface CreateDevServerOptions {
|
|
|
63
71
|
* Override how authentication resolves, taking precedence over
|
|
64
72
|
* `def.cli?.auth`. Pass `false` to skip the gate entirely (the standard
|
|
65
73
|
* choice for a **hosted** deployment where the host manages auth — see
|
|
66
|
-
* {@link
|
|
74
|
+
* {@link devframeViteBridge} from `@devframes/vite`); a {@link DevframeAuthHandler} to install a custom
|
|
67
75
|
* scheme; or `true` to force devframe's interactive OTP gate on. When
|
|
68
76
|
* omitted, auth resolves from `flags.auth` / `def.cli?.auth` (the standalone
|
|
69
77
|
* default: gated). The `--no-auth` flag (`flags.auth === false`) still forces
|
|
@@ -97,6 +105,12 @@ interface CreateDevServerOptions {
|
|
|
97
105
|
port: number;
|
|
98
106
|
app: H3;
|
|
99
107
|
}) => void | Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Proceed even when the definition declares `capabilities.dev: false`.
|
|
110
|
+
* `createDevServer` otherwise refuses such a definition (`DF0058`) — this
|
|
111
|
+
* only matters for a caller invoking it directly, bypassing the CLI.
|
|
112
|
+
*/
|
|
113
|
+
force?: boolean;
|
|
100
114
|
}
|
|
101
115
|
/**
|
|
102
116
|
* Start a devframe dev server for a {@link DevframeDefinition} —
|
|
@@ -107,7 +121,7 @@ interface CreateDevServerOptions {
|
|
|
107
121
|
* server runs in **bridge mode**: only `__connection.json` and the WS
|
|
108
122
|
* endpoint are mounted, with no SPA mount. The SPA is expected to be
|
|
109
123
|
* hosted elsewhere (e.g. by a parent Vite/Nuxt dev server) — see
|
|
110
|
-
* `
|
|
124
|
+
* `devframeViteBridge` from `@devframes/vite`.
|
|
111
125
|
*
|
|
112
126
|
* Returns the underlying {@link StartedServer} handle so callers can
|
|
113
127
|
* 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-CbZ_yhbz.mjs";
|
|
2
|
+
import { t as createDevServer } from "../dev--rAPzbvO.mjs";
|
|
3
3
|
export { createDevServer, resolveDevServerPort, resolveMcpConnectionMeta };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as DevframeNodeContext, n as DevframeDefinition } from "../devframe-DJMg0WLe.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,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-
|
|
3
|
-
import {
|
|
1
|
+
import { F as DevframeStorageScope, R as DevframeNodeRpcSession, c as DevframeWsOptions, d as ConnectionMeta, g as DevframeNodeContext, l as McpRouteOptions, n as DevframeDefinition, s as DevframeSseOptions, u as DevframeAuthHandler } from "../devframe-DJMg0WLe.mjs";
|
|
2
|
+
import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-D1d3QM9f.mjs";
|
|
3
|
+
import { o as StaticAssetsSource } from "../remote-assets-Bg4gCUZ_.mjs";
|
|
4
|
+
import { c as StartedServer, f as DevframeInstanceRecord } from "../instance-shell-CljiKq1c.mjs";
|
|
4
5
|
import { Buffer } from "node:buffer";
|
|
5
6
|
import { IncomingMessage, Server, ServerResponse } from "node:http";
|
|
6
7
|
import { Duplex } from "node:stream";
|
|
@@ -22,7 +23,7 @@ interface InitDevframeOptions {
|
|
|
22
23
|
* **bridge mode**: only `__connection.json`, the WS endpoint, and the MCP
|
|
23
24
|
* route (when enabled) are served; the SPA is hosted elsewhere.
|
|
24
25
|
*/
|
|
25
|
-
distDir?:
|
|
26
|
+
distDir?: StaticAssetsSource | false;
|
|
26
27
|
/**
|
|
27
28
|
* Share the host's `node:http` server for the WebSocket RPC endpoint: the
|
|
28
29
|
* upgrade listener binds to `<base>__ws` on this server, so no extra port
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as getInstanceInternals, r as initDevframe } from "../dev
|
|
1
|
+
import { n as getInstanceInternals, r as initDevframe } from "../dev--rAPzbvO.mjs";
|
|
2
2
|
export { getInstanceInternals, initDevframe };
|
package/dist/adapters/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as DevframeNodeContext, n as DevframeDefinition } from "../devframe-DJMg0WLe.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-DYpK0cUi.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,7 +1,7 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as Diagnostic } from "../nostics-CzECRXpE.mjs";
|
|
2
|
+
import { t as diagnostics } from "../diagnostics-DOQPnQmX.mjs";
|
|
3
|
+
import { n as listLiveDevframeInstances, r as probeDevframeOrigin } from "../instance-registry-WvQkt42E.mjs";
|
|
4
|
+
import { t as toAgentToolName } from "../agent-tool-name-EgfoFO8C.mjs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { joinURL } from "ufo";
|
|
7
7
|
import { cac } from "cac";
|
|
@@ -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 { $ as
|
|
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 { $ as StreamReader, A as ScopedServerFunctions, H as RpcSharedStateHost, K as DevframeRpcClientFunctions, M as SettingsForNamespace, Tt as EventEmitter, V as RpcSharedStateGetOptions, d as ConnectionMeta, et as StreamSink, j as ScopedSharedStates, k as ScopedRpcFn, lt as SharedState, q as DevframeRpcServerFunctions, w as DevframeSettings } from "../devframe-DJMg0WLe.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 {
|