devframe 1.0.0 → 1.1.0
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/adapters/build.mjs +1 -1
- package/dist/adapters/cac.mjs +1 -1
- package/dist/adapters/dev.d.mts +1 -1
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/initiate.d.mts +1 -1
- package/dist/adapters/initiate.mjs +1 -1
- package/dist/cli/main.mjs +2 -1
- package/dist/{dev-BTbLJekh.mjs → dev-IkdtaiLZ.mjs} +1 -1
- package/dist/{instance-registry-DtvYxc0Y.mjs → instance-registry-C-nC0By7.mjs} +6 -2
- package/dist/{instance-shell-CXnpSuK7.d.mts → instance-shell-Cpz5d2CI.d.mts} +4 -2
- package/dist/{instance-shell-wC2sfEU_.mjs → instance-shell-kUeR59CR.mjs} +1 -1
- package/dist/internal/index.d.mts +10 -2
- package/dist/internal/index.mjs +17 -3
- package/dist/rpc/dump.mjs +1 -1
- package/dist/{write-DoXJzGUH.mjs → write-BWIO0h0Z.mjs} +12 -2
- package/package.json +6 -6
package/dist/adapters/build.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as colors } from "../nostics-D0PvLZsn.mjs";
|
|
2
2
|
import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME } from "../constants.mjs";
|
|
3
|
-
import { n as collectStaticRpcDump, t as writeStaticRpcDump } from "../write-
|
|
3
|
+
import { n as collectStaticRpcDump, t as writeStaticRpcDump } from "../write-BWIO0h0Z.mjs";
|
|
4
4
|
import { t as diagnostics } from "../diagnostics-Cx4_VjlG.mjs";
|
|
5
5
|
import { t as createHostContext } from "../context-BqpgC5tq.mjs";
|
|
6
6
|
import { t as resolveStaticAssetsSource } from "../remote-assets-B9MeWmW6.mjs";
|
package/dist/adapters/cac.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as colors } from "../nostics-D0PvLZsn.mjs";
|
|
2
2
|
import { i as resolveDevServerPort, s as importAgenticMcp } from "../_shared-B2PZsp-J.mjs";
|
|
3
3
|
import { createBuild } from "./build.mjs";
|
|
4
|
-
import { t as createDevServer } from "../dev-
|
|
4
|
+
import { t as createDevServer } from "../dev-IkdtaiLZ.mjs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import cac$1 from "cac";
|
|
7
7
|
//#region src/adapters/flags.ts
|
package/dist/adapters/dev.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { At as DevframeAuthHandler, B as DevframeDefinition, J as DevframeSseOpt
|
|
|
2
2
|
import { n as DevframeRpcConnection, t as DevframeNodeRpcSessionMeta } from "../session-r6PDixP6.mjs";
|
|
3
3
|
import { o as StaticAssetsSource } from "../remote-assets-eBvSKZMS.mjs";
|
|
4
4
|
import { n as WsOriginRegistry } from "../ws-server-y2R76aSW.mjs";
|
|
5
|
-
import { c as StartedServer } from "../instance-shell-
|
|
5
|
+
import { c as StartedServer } from "../instance-shell-Cpz5d2CI.mjs";
|
|
6
6
|
import { c as resolveMcpConnectionMeta, o as resolveDevServerPort, t as ResolveDevServerPortOptions } from "../_shared-D1ebaX_J.mjs";
|
|
7
7
|
import { H3 } from "h3";
|
|
8
8
|
//#region src/adapters/dev.d.ts
|
package/dist/adapters/dev.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as resolveDevServerPort, o as resolveMcpConnectionMeta } from "../_shared-B2PZsp-J.mjs";
|
|
2
|
-
import { t as createDevServer } from "../dev-
|
|
2
|
+
import { t as createDevServer } from "../dev-IkdtaiLZ.mjs";
|
|
3
3
|
export { createDevServer, resolveDevServerPort, resolveMcpConnectionMeta };
|
|
@@ -2,7 +2,7 @@ import { At as DevframeAuthHandler, B as DevframeDefinition, Dt as DevframeStora
|
|
|
2
2
|
import { n as DevframeRpcConnection, t as DevframeNodeRpcSessionMeta } from "../session-r6PDixP6.mjs";
|
|
3
3
|
import { o as StaticAssetsSource } from "../remote-assets-eBvSKZMS.mjs";
|
|
4
4
|
import { n as WsOriginRegistry } from "../ws-server-y2R76aSW.mjs";
|
|
5
|
-
import { c as StartedServer, f as DevframeInstanceRecord } from "../instance-shell-
|
|
5
|
+
import { c as StartedServer, f as DevframeInstanceRecord } from "../instance-shell-Cpz5d2CI.mjs";
|
|
6
6
|
import { H3 } from "h3";
|
|
7
7
|
import { Buffer } from "node:buffer";
|
|
8
8
|
import { IncomingMessage, Server, ServerResponse } from "node:http";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as getInstanceInternals, r as initDevframe } from "../dev-
|
|
1
|
+
import { n as getInstanceInternals, r as initDevframe } from "../dev-IkdtaiLZ.mjs";
|
|
2
2
|
export { getInstanceInternals, initDevframe };
|
package/dist/cli/main.mjs
CHANGED
|
@@ -29,10 +29,11 @@ async function importConnect() {
|
|
|
29
29
|
*/
|
|
30
30
|
async function runDevframeCli(argv = process.argv) {
|
|
31
31
|
const cli = cac("devframe");
|
|
32
|
-
cli.command("connect", "Run the devframe MCP connector on stdio (discovers running devframe dev servers and proxies their tools)").option("--port <port>", "Probe an explicit port besides the instance registry (repeatable)").option("--instances-dir <dir>", "Override the instance registry directory (default: ~/.devframe/instances, or $DEVFRAME_INSTANCES_DIR)").option("--timeout <ms>", "Probe timeout per instance in milliseconds", { default: 1e3 }).action(async (options) => {
|
|
32
|
+
cli.command("connect", "Run the devframe MCP connector on stdio (discovers running devframe dev servers and proxies their tools)").option("--port <port>", "Probe an explicit port besides the instance registry (repeatable)").option("--base <path>", "Base path the --port probes look for __connection.json under, for a devframe mounted below the root (e.g. /__devtools/ for Vite DevTools)", { default: "/" }).option("--instances-dir <dir>", "Override the instance registry directory (default: ~/.devframe/instances, or $DEVFRAME_INSTANCES_DIR)").option("--timeout <ms>", "Probe timeout per instance in milliseconds", { default: 1e3 }).action(async (options) => {
|
|
33
33
|
const { startConnectServer } = await importConnect();
|
|
34
34
|
await startConnectServer({
|
|
35
35
|
ports: parsePortsFlag(options.port),
|
|
36
|
+
base: typeof options.base === "string" ? options.base : void 0,
|
|
36
37
|
instancesDir: options.instancesDir,
|
|
37
38
|
timeoutMs: options.timeout,
|
|
38
39
|
/**
|
|
@@ -4,7 +4,7 @@ import { t as createHostContext } from "./context-BqpgC5tq.mjs";
|
|
|
4
4
|
import { t as resolveStaticAssetsSource } from "./remote-assets-B9MeWmW6.mjs";
|
|
5
5
|
import { a as resolveMcpConfig, c as joinURL, d as withoutLeadingSlash, i as resolveDevServerPort, l as withBase, n as normalizeBasePath, r as resolveBasePath, s as importAgenticMcp, t as loadAutoMcpAdapter } from "./_shared-B2PZsp-J.mjs";
|
|
6
6
|
import { t as createH3DevframeHost } from "./host-h3-BROI6SQ4.mjs";
|
|
7
|
-
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, t as createInstanceShell } from "./instance-shell-
|
|
7
|
+
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, t as createInstanceShell } from "./instance-shell-kUeR59CR.mjs";
|
|
8
8
|
import { open } from "./utils/open.mjs";
|
|
9
9
|
import { mountStaticHandler } from "./utils/serve-static.mjs";
|
|
10
10
|
import { resolve } from "pathe";
|
|
@@ -116,7 +116,9 @@ function originCandidates(origin) {
|
|
|
116
116
|
* Probe `<origin><basePath>__connection.json`, trying each dialable
|
|
117
117
|
* candidate for the origin (see {@link originCandidates}). The single
|
|
118
118
|
* probe primitive behind both registry liveness checks and the
|
|
119
|
-
* connector's explicit `--port` probes.
|
|
119
|
+
* connector's explicit `--port` probes. A candidate counts only when it
|
|
120
|
+
* answers `2xx` with a JSON object; anything else (an HTML SPA fallback, a
|
|
121
|
+
* JSON array, an unparseable body) is treated as "no devframe here".
|
|
120
122
|
*
|
|
121
123
|
* @internal
|
|
122
124
|
*/
|
|
@@ -125,9 +127,11 @@ async function probeDevframeOrigin(origin, basePath, timeoutMs) {
|
|
|
125
127
|
for (const candidate of originCandidates(origin)) try {
|
|
126
128
|
const response = await fetch(`${candidate}${base}__connection.json`, { signal: AbortSignal.timeout(timeoutMs ?? 1e3) });
|
|
127
129
|
if (!response.ok) continue;
|
|
130
|
+
const meta = await response.json().catch(() => void 0);
|
|
131
|
+
if (!meta || typeof meta !== "object" || Array.isArray(meta)) continue;
|
|
128
132
|
return {
|
|
129
133
|
origin: candidate,
|
|
130
|
-
meta
|
|
134
|
+
meta
|
|
131
135
|
};
|
|
132
136
|
} catch {}
|
|
133
137
|
return null;
|
|
@@ -74,7 +74,7 @@ declare function registerDevframeInstance(record: DevframeInstanceRecord, option
|
|
|
74
74
|
interface ProbedDevframeOrigin {
|
|
75
75
|
/** The origin that answered (may be an explicit address family for a `localhost` bind). */
|
|
76
76
|
origin: string;
|
|
77
|
-
/** The parsed `__connection.json` payload (
|
|
77
|
+
/** The parsed `__connection.json` payload (always a JSON object). */
|
|
78
78
|
meta: {
|
|
79
79
|
mcp?: {
|
|
80
80
|
path: string;
|
|
@@ -86,7 +86,9 @@ interface ProbedDevframeOrigin {
|
|
|
86
86
|
* Probe `<origin><basePath>__connection.json`, trying each dialable
|
|
87
87
|
* candidate for the origin (see {@link originCandidates}). The single
|
|
88
88
|
* probe primitive behind both registry liveness checks and the
|
|
89
|
-
* connector's explicit `--port` probes.
|
|
89
|
+
* connector's explicit `--port` probes. A candidate counts only when it
|
|
90
|
+
* answers `2xx` with a JSON object; anything else (an HTML SPA fallback, a
|
|
91
|
+
* JSON array, an unparseable body) is treated as "no devframe here".
|
|
90
92
|
*
|
|
91
93
|
* @internal
|
|
92
94
|
*/
|
|
@@ -311,7 +311,7 @@ function createInstanceShell(options) {
|
|
|
311
311
|
const origin = currentOrigin();
|
|
312
312
|
if (!cfg || registerPromise || !origin || !meta) return;
|
|
313
313
|
const resolvedMeta = meta;
|
|
314
|
-
registerPromise = import("./instance-registry-
|
|
314
|
+
registerPromise = import("./instance-registry-C-nC0By7.mjs").then((n) => n.t).then(({ registerDevframeInstance }) => {
|
|
315
315
|
let port = 0;
|
|
316
316
|
try {
|
|
317
317
|
const url = new URL(origin);
|
|
@@ -2,7 +2,7 @@ import { t as StandardSchemaV1 } from "../index-CeEtxDmK.mjs";
|
|
|
2
2
|
import { g as RpcFunctionDefinitionAny } from "../types-BmDbfHCx.mjs";
|
|
3
3
|
import { Bt as AgentTool, Et as DevframeHost, Ft as AgentHandle, Gt as DevframeAgentHostEvents, Ht as AgentToolProvider, It as AgentManifest, Kt as EventEmitter, Lt as AgentResource, Rt as AgentResourceContent, Ut as AgentToolProviderHandle, Vt as AgentToolInput, Wt as DevframeAgentHost$1, o as DevframeNodeContext, zt as AgentResourceInput } from "../context--tVkJw3W.mjs";
|
|
4
4
|
import { a as RemoteAssetsStore } from "../remote-assets-eBvSKZMS.mjs";
|
|
5
|
-
import { a as InstanceShellInit, c as StartedServer, d as samePath, f as DevframeInstanceRecord, g as registerDevframeInstance, h as probeDevframeOrigin, i as InstanceShellApi, l as createInstanceShell, m as listLiveDevframeInstances, n as InstanceRegisterConfig, o as InstanceShellInternals, p as DevframeInstanceRegistration, r as InstanceShell, s as InstanceWsTier, t as CreateInstanceShellOptions, u as resolveInstanceRegister } from "../instance-shell-
|
|
5
|
+
import { a as InstanceShellInit, c as StartedServer, d as samePath, f as DevframeInstanceRecord, g as registerDevframeInstance, h as probeDevframeOrigin, i as InstanceShellApi, l as createInstanceShell, m as listLiveDevframeInstances, n as InstanceRegisterConfig, o as InstanceShellInternals, p as DevframeInstanceRegistration, r as InstanceShell, s as InstanceWsTier, t as CreateInstanceShellOptions, u as resolveInstanceRegister } from "../instance-shell-Cpz5d2CI.mjs";
|
|
6
6
|
import { i as importAgenticMcp, n as MountMcpHttpOptions, r as MountedMcpHttp, t as AgenticMcpModule } from "../agentic-DLqHMOyN.mjs";
|
|
7
7
|
import { a as resolveBasePath, i as normalizeBasePath, n as ResolvedMcpConfig, r as loadAutoMcpAdapter, s as resolveMcpConfig } from "../_shared-D1ebaX_J.mjs";
|
|
8
8
|
import { n as CreateContextRpcServerOptions, r as createContextRpcServer, t as ContextRpcServer } from "../rpc-core-B6n9MQsc.mjs";
|
|
@@ -41,6 +41,14 @@ export declare function formatMcpError(error: unknown): string;
|
|
|
41
41
|
//#region src/agent/to-json-schema.d.ts
|
|
42
42
|
/**
|
|
43
43
|
* JSON Schema for an RPC return value on the agent/MCP surface.
|
|
44
|
+
*
|
|
45
|
+
* Unlike args, a return value has no permissive fallback: the schema is
|
|
46
|
+
* advertised as an MCP `outputSchema`, which obliges the tool to return a
|
|
47
|
+
* matching object on every call. A validator with no native converter
|
|
48
|
+
* (e.g. valibot), or one whose converter cannot express the schema, yields
|
|
49
|
+
* no output schema rather than an unfounded object one, so array- and
|
|
50
|
+
* primitive-returning tools still work. Conversion uses the converter's
|
|
51
|
+
* `output`, since a transforming validator returns its output type.
|
|
44
52
|
* @internal
|
|
45
53
|
*/
|
|
46
54
|
export declare function returnToJsonSchema(schema: StandardSchemaV1 | undefined): unknown;
|
|
@@ -374,7 +382,7 @@ export declare const diagnostics: import("nostics").Diagnostics<{
|
|
|
374
382
|
};
|
|
375
383
|
}, readonly [(d: import("nostics").Diagnostic, { method }?: {
|
|
376
384
|
method?: "log" | "warn" | "error";
|
|
377
|
-
}) => void]>;
|
|
385
|
+
}) => void], never>;
|
|
378
386
|
//#endregion
|
|
379
387
|
//#region src/node/host-agent.d.ts
|
|
380
388
|
/**
|
package/dist/internal/index.mjs
CHANGED
|
@@ -5,8 +5,8 @@ import { n as toolInputToCommandArgs, t as DevframeAgentHost } from "../host-age
|
|
|
5
5
|
import { a as resolveMcpConfig, n as normalizeBasePath, r as resolveBasePath, s as importAgenticMcp, t as loadAutoMcpAdapter } from "../_shared-B2PZsp-J.mjs";
|
|
6
6
|
import { t as importRuntimeModule } from "../import-runtime-module-BzlEQ9PI.mjs";
|
|
7
7
|
import { t as createH3DevframeHost } from "../host-h3-BROI6SQ4.mjs";
|
|
8
|
-
import { i as registerDevframeInstance, n as listLiveDevframeInstances, r as probeDevframeOrigin } from "../instance-registry-
|
|
9
|
-
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, r as samePath, t as createInstanceShell } from "../instance-shell-
|
|
8
|
+
import { i as registerDevframeInstance, n as listLiveDevframeInstances, r as probeDevframeOrigin } from "../instance-registry-C-nC0By7.mjs";
|
|
9
|
+
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, r as samePath, t as createInstanceShell } from "../instance-shell-kUeR59CR.mjs";
|
|
10
10
|
import { t as createContextRpcServer } from "../rpc-core-BXyMjbKG.mjs";
|
|
11
11
|
//#region src/agent/stringify.ts
|
|
12
12
|
/**
|
|
@@ -107,11 +107,25 @@ function safeToJsonSchema(schema) {
|
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* JSON Schema for an RPC return value on the agent/MCP surface.
|
|
110
|
+
*
|
|
111
|
+
* Unlike args, a return value has no permissive fallback: the schema is
|
|
112
|
+
* advertised as an MCP `outputSchema`, which obliges the tool to return a
|
|
113
|
+
* matching object on every call. A validator with no native converter
|
|
114
|
+
* (e.g. valibot), or one whose converter cannot express the schema, yields
|
|
115
|
+
* no output schema rather than an unfounded object one, so array- and
|
|
116
|
+
* primitive-returning tools still work. Conversion uses the converter's
|
|
117
|
+
* `output`, since a transforming validator returns its output type.
|
|
110
118
|
* @internal
|
|
111
119
|
*/
|
|
112
120
|
function returnToJsonSchema(schema) {
|
|
113
121
|
if (!schema) return void 0;
|
|
114
|
-
|
|
122
|
+
const standard = schema["~standard"];
|
|
123
|
+
if (!standard.jsonSchema) return void 0;
|
|
124
|
+
try {
|
|
125
|
+
return standard.jsonSchema.output({ target: "draft-2020-12" });
|
|
126
|
+
} catch {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
115
129
|
}
|
|
116
130
|
/**
|
|
117
131
|
* JSON Schema for an RPC function's positional args on the agent/MCP
|
package/dist/rpc/dump.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getDefinitionsWithDumps, i as dumpFunctions, n as collectStaticRpcDump, o as reviveDumpError, r as createClientFromDump, s as serializeDumpError, t as writeStaticRpcDump } from "../write-
|
|
1
|
+
import { a as getDefinitionsWithDumps, i as dumpFunctions, n as collectStaticRpcDump, o as reviveDumpError, r as createClientFromDump, s as serializeDumpError, t as writeStaticRpcDump } from "../write-BWIO0h0Z.mjs";
|
|
2
2
|
export { collectStaticRpcDump, createClientFromDump, dumpFunctions, getDefinitionsWithDumps, reviveDumpError, serializeDumpError, writeStaticRpcDump };
|
|
@@ -62,7 +62,7 @@ var Queue = class {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
//#endregion
|
|
65
|
-
//#region ../../node_modules/.pnpm/p-limit@7.3.
|
|
65
|
+
//#region ../../node_modules/.pnpm/p-limit@7.3.3/node_modules/p-limit/index.js
|
|
66
66
|
function pLimit(concurrency) {
|
|
67
67
|
let rejectOnClear = false;
|
|
68
68
|
if (typeof concurrency === "object") ({concurrency, rejectOnClear = false} = concurrency);
|
|
@@ -121,7 +121,17 @@ function pLimit(concurrency) {
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
map: { async value(iterable, function_) {
|
|
124
|
-
const promises =
|
|
124
|
+
const promises = [];
|
|
125
|
+
try {
|
|
126
|
+
Array.from(iterable, (value, index) => {
|
|
127
|
+
const promise = generator(function_, value, index);
|
|
128
|
+
promises.push(promise);
|
|
129
|
+
return promise;
|
|
130
|
+
});
|
|
131
|
+
} catch (error) {
|
|
132
|
+
for (const promise of promises) promise.catch(() => {});
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
125
135
|
return Promise.all(promises);
|
|
126
136
|
} }
|
|
127
137
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "devframe",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"description": "Framework for building one portable devtool integration that runs in any viewer.",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"skills"
|
|
78
78
|
],
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@devframes/agentic": "1.
|
|
80
|
+
"@devframes/agentic": "1.1.0",
|
|
81
81
|
"cac": "^7.0.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependenciesMeta": {
|
|
@@ -90,12 +90,12 @@
|
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"crossws": "^0.4.12",
|
|
93
|
-
"h3": "^2.0.1-rc.
|
|
94
|
-
"nostics": "^1.
|
|
93
|
+
"h3": "^2.0.1-rc.32",
|
|
94
|
+
"nostics": "^1.3.0",
|
|
95
95
|
"pathe": "^2.0.3"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"@devframes/agentic": "1.
|
|
98
|
+
"@devframes/agentic": "1.1.0",
|
|
99
99
|
"@standard-schema/spec": "^1.1.0",
|
|
100
100
|
"birpc": "^4.2.0",
|
|
101
101
|
"cac": "^7.0.0",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"mrmime": "^2.0.1",
|
|
107
107
|
"obug": "^3.0.0",
|
|
108
108
|
"ohash": "^2.0.12",
|
|
109
|
-
"p-limit": "^7.3.
|
|
109
|
+
"p-limit": "^7.3.3",
|
|
110
110
|
"perfect-debounce": "^2.1.0",
|
|
111
111
|
"structured-clone-es": "^2.0.1",
|
|
112
112
|
"tinyglobby": "^0.2.17",
|