devframe 0.9.9 → 0.9.11
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-CK3czkH4.d.mts → _shared-DEAMiPfH.d.mts} +26 -7
- package/dist/{_shared-C08SdQRl.mjs → _shared-U8D-xzrp.mjs} +41 -5
- package/dist/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +13 -26
- package/dist/adapters/cac.d.mts +6 -10
- package/dist/adapters/cac.mjs +3 -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 +5 -4
- package/dist/adapters/initiate.mjs +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +3 -3
- package/dist/cli/main.mjs +2 -2
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +7 -1
- package/dist/{context-4AIVRLYF.d.mts → context-BBWPLDHh.d.mts} +57 -18
- package/dist/{context-CwPUinjn.mjs → context-Bq27SDK-.mjs} +49 -13
- package/dist/{context-rgBSPFHS.d.mts → context-_temOGDB.d.mts} +1 -1
- package/dist/{context-DIUvJW4D.mjs → context-jXO5vzjH.mjs} +1 -1
- package/dist/{dev-Eqq5PX0k.mjs → dev-B32EVw5w.mjs} +49 -35
- package/dist/{diagnostics-BMfN8mb1.mjs → diagnostics-DZA6KQ_Z.mjs} +3 -3
- package/dist/{services-install-P_DV7VYL.mjs → host-agent-CKqSTEX9.mjs} +8 -155
- package/dist/in-page-channel/index.d.mts +1 -1
- package/dist/{index-pKl67H6w.d.mts → index-1ezCLThh.d.mts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/{instance-registry-C7-41RSp.mjs → instance-registry-DCq762YJ.mjs} +2 -2
- package/dist/{instance-shell-7Z52PE4_.d.mts → instance-shell-BWh0JQuo.d.mts} +2 -2
- package/dist/{instance-shell-cdVETpfz.mjs → instance-shell-DvYCwrDy.mjs} +5 -18
- package/dist/internal/index.d.mts +11 -9
- package/dist/internal/index.mjs +9 -9
- 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 +1 -1
- package/dist/node/index.mjs +2 -2
- package/dist/recipes/common-rpc-functions.d.mts +1 -1
- package/dist/recipes/interactive-auth.d.mts +2 -2
- package/dist/recipes/interactive-auth.mjs +2 -2
- package/dist/{remote-assets-BIFWOlBW.mjs → remote-assets-DMFzLSoH.mjs} +3 -3
- package/dist/rpc/dump.d.mts +17 -1
- package/dist/rpc/dump.mjs +2 -2
- package/dist/rpc/index.mjs +2 -3
- package/dist/rpc/transports/sse-client.mjs +1 -1
- package/dist/rpc/transports/sse-server.mjs +1 -1
- package/dist/rpc/transports/ws-bun.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +1 -1
- package/dist/rpc/transports/ws-deno.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +1 -1
- package/dist/{rpc-core-DVQ7xi89.mjs → rpc-core-CvkU23bQ.mjs} +1 -1
- package/dist/{rpc-core-Ceu6AUz8.d.mts → rpc-core-DiCr5etS.d.mts} +2 -2
- package/dist/{serialization-DTZnPQ1-.mjs → serialization-DFg5sUt6.mjs} +39 -2
- package/dist/services-install-Ben4yh52.mjs +154 -0
- package/dist/{state-CeQQWzM-.mjs → state-Mwt6--el.mjs} +13 -5
- package/dist/{storage-Dccf_IyD.mjs → storage-B70AXK64.mjs} +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/remote-assets.mjs +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/{validation-BOy8IoFZ.mjs → validation-CfV1s0SF.mjs} +1 -1
- package/dist/{wire-codec-dcCeXcSo.mjs → wire-codec-BHGt0sSs.mjs} +1 -1
- package/dist/{static-DZ8P2Kn7.mjs → write-BuLCrn9h.mjs} +25 -4
- package/package.json +2 -6
- package/skills/devframe/SKILL.md +5 -3
- package/dist/diagnostics-D0EVm5M6.mjs +0 -39
- package/dist/{host-h3-BJ4siyz7.mjs → host-h3-BROI6SQ4.mjs} +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { i as defineDiagnostics } from "./nostics-D0PvLZsn.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { r as diagnostics } from "./serialization-DFg5sUt6.mjs";
|
|
3
3
|
import { RpcFunctionsCollectorBase } from "./rpc/index.mjs";
|
|
4
4
|
import { defineRpcFunction } from "./index.mjs";
|
|
5
5
|
import { t as DEVFRAME_EVENTS } from "./events-BV4Dj59a.mjs";
|
|
6
6
|
import { DEVFRAME_SERVICES_STATE_KEY } from "./constants.mjs";
|
|
7
|
-
import { t as diagnostics$1 } from "./diagnostics-
|
|
8
|
-
import {
|
|
9
|
-
import { n as createDebug, t as resolveStaticAssetsSource } from "./remote-assets-
|
|
10
|
-
import { t as
|
|
7
|
+
import { t as diagnostics$1 } from "./diagnostics-DZA6KQ_Z.mjs";
|
|
8
|
+
import { r as createEventEmitter, t as DevframeAgentHost } from "./host-agent-CKqSTEX9.mjs";
|
|
9
|
+
import { n as createDebug, t as resolveStaticAssetsSource } from "./remote-assets-DMFzLSoH.mjs";
|
|
10
|
+
import { i as satisfiesVersionRange, n as expandResolveFrom, r as importServicePackage, t as deepMergeOptionSets } from "./services-install-Ben4yh52.mjs";
|
|
11
|
+
import { t as createStorage } from "./storage-B70AXK64.mjs";
|
|
12
|
+
import { join } from "pathe";
|
|
11
13
|
import { createSharedState } from "devframe/utils/shared-state";
|
|
12
14
|
import process from "node:process";
|
|
13
|
-
import { join } from "pathe";
|
|
14
15
|
import { existsSync } from "node:fs";
|
|
15
16
|
//#region src/node/host-diagnostics.ts
|
|
16
17
|
var DevframeDiagnosticsHost = class {
|
|
@@ -129,9 +130,14 @@ function createRpcSharedStateServerHost(rpc) {
|
|
|
129
130
|
},
|
|
130
131
|
/**
|
|
131
132
|
* Pre-compute snapshots for the build-mode static dump so the SPA
|
|
132
|
-
* can read them without a live server.
|
|
133
|
+
* can read them without a live server. The `undefined` fallback makes
|
|
134
|
+
* a key the build never created resolve like the live handler does
|
|
135
|
+
* (returning `undefined`) instead of failing the dump lookup.
|
|
133
136
|
*/
|
|
134
|
-
dump: () => ({
|
|
137
|
+
dump: () => ({
|
|
138
|
+
inputs: host.keys().map((key) => [key]),
|
|
139
|
+
fallback: void 0
|
|
140
|
+
})
|
|
135
141
|
});
|
|
136
142
|
rpc.register({
|
|
137
143
|
name: "devframe:rpc:server-state:set",
|
|
@@ -777,6 +783,17 @@ var RpcFunctionsHostImpl = class extends RpcFunctionsCollectorBase {
|
|
|
777
783
|
//#endregion
|
|
778
784
|
//#region src/node/host-services.ts
|
|
779
785
|
const debug = createDebug("devframe:services");
|
|
786
|
+
/**
|
|
787
|
+
* Per-RPC-host registry of the services already installed against it, keyed
|
|
788
|
+
* by the RPC host object. A single wire service can be declared from more
|
|
789
|
+
* than one devframe context that shares one RPC host (e.g. a kit that mounts
|
|
790
|
+
* a definition alongside another context, so both iterate `def.services`).
|
|
791
|
+
* The per-instance `installed` guard can't see across those sibling hosts, so
|
|
792
|
+
* the second context would re-run the service factory and re-register its RPC,
|
|
793
|
+
* hitting DF0021. Sharing the registry by RPC host makes the first install win
|
|
794
|
+
* across every context on that host.
|
|
795
|
+
*/
|
|
796
|
+
const installedByRpcHost = /* @__PURE__ */ new WeakMap();
|
|
780
797
|
function isServiceDefinition(input) {
|
|
781
798
|
return typeof input.setup === "function";
|
|
782
799
|
}
|
|
@@ -825,11 +842,27 @@ var DevframeServicesHostImpl = class {
|
|
|
825
842
|
services = /* @__PURE__ */ new Map();
|
|
826
843
|
listeners = /* @__PURE__ */ new Map();
|
|
827
844
|
pending = /* @__PURE__ */ new Map();
|
|
828
|
-
|
|
845
|
+
localInstalled = /* @__PURE__ */ new Map();
|
|
829
846
|
readyPromise;
|
|
830
847
|
constructor(context) {
|
|
831
848
|
this.context = context;
|
|
832
849
|
}
|
|
850
|
+
/**
|
|
851
|
+
* The install-dedup registry, shared across every services host that shares
|
|
852
|
+
* this host's RPC host so the first install of a package wins across sibling
|
|
853
|
+
* contexts. Falls back to a per-instance map when there is no RPC host (a
|
|
854
|
+
* context-less host only exercises the in-process `provide`/`get` tier).
|
|
855
|
+
*/
|
|
856
|
+
get installed() {
|
|
857
|
+
const rpc = this.context?.rpc;
|
|
858
|
+
if (!rpc) return this.localInstalled;
|
|
859
|
+
let registry = installedByRpcHost.get(rpc);
|
|
860
|
+
if (!registry) {
|
|
861
|
+
registry = /* @__PURE__ */ new Map();
|
|
862
|
+
installedByRpcHost.set(rpc, registry);
|
|
863
|
+
}
|
|
864
|
+
return registry;
|
|
865
|
+
}
|
|
833
866
|
provide(id, service) {
|
|
834
867
|
const key = id;
|
|
835
868
|
if (this.services.has(key)) throw diagnostics$1.DF0037({ id: key });
|
|
@@ -907,8 +940,10 @@ var DevframeServicesHostImpl = class {
|
|
|
907
940
|
}
|
|
908
941
|
async installPackage(pkg, entries) {
|
|
909
942
|
if (this.installed.has(pkg)) {
|
|
910
|
-
|
|
911
|
-
|
|
943
|
+
const api = this.installed.get(pkg);
|
|
944
|
+
if (this.services.has(pkg)) diagnostics$1.DF0066({ package: pkg });
|
|
945
|
+
else this.provide(pkg, api);
|
|
946
|
+
return api;
|
|
912
947
|
}
|
|
913
948
|
let def = entries.filter((entry) => isServiceDefinition(entry.input))[0]?.input;
|
|
914
949
|
if (!def) {
|
|
@@ -924,7 +959,7 @@ var DevframeServicesHostImpl = class {
|
|
|
924
959
|
debug("installing service %s@%s (scope %s)", def.package, def.version, def.scope);
|
|
925
960
|
const scoped = this.context.scope(def.scope);
|
|
926
961
|
const api = await def.setup(scoped, options === void 0 ? {} : { options });
|
|
927
|
-
this.installed.set(
|
|
962
|
+
this.installed.set(pkg, api);
|
|
928
963
|
this.provide(def.package, api);
|
|
929
964
|
await this.advertise(def);
|
|
930
965
|
return api;
|
|
@@ -1024,7 +1059,8 @@ var DevframeViewHost = class {
|
|
|
1024
1059
|
if (typeof resolved === "string" && !existsSync(resolved)) throw diagnostics$1.DF0008({ distDir: resolved });
|
|
1025
1060
|
this.buildStaticDirs.push({
|
|
1026
1061
|
baseUrl,
|
|
1027
|
-
source
|
|
1062
|
+
source,
|
|
1063
|
+
resolveFrom: defaultResolveFrom
|
|
1028
1064
|
});
|
|
1029
1065
|
this.context.host.mountStatic(baseUrl, resolved);
|
|
1030
1066
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as SharedState, o as DevframeNodeContext } from "./context-
|
|
1
|
+
import { k as SharedState, o as DevframeNodeContext } from "./context-BBWPLDHh.mjs";
|
|
2
2
|
//#region src/node/hub-internals/context.d.ts
|
|
3
3
|
interface InternalAnonymousAuthStorage {
|
|
4
4
|
trusted: Record<string, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as randomToken } from "./crypto-token-TVbGGFuj.mjs";
|
|
2
|
-
import { t as createStorage } from "./storage-
|
|
2
|
+
import { t as createStorage } from "./storage-B70AXK64.mjs";
|
|
3
3
|
import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "./revoke-cqztiCX4.mjs";
|
|
4
4
|
import { join } from "pathe";
|
|
5
5
|
//#region src/node/hub-internals/context.ts
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as resolveClientAssets } from "./client-assets-DNdhagGm.mjs";
|
|
2
2
|
import { DEVFRAME_CONNECTION_META_FILENAME } from "./constants.mjs";
|
|
3
|
-
import { t as diagnostics } from "./diagnostics-
|
|
4
|
-
import { t as createHostContext } from "./context-
|
|
5
|
-
import { t as resolveStaticAssetsSource } from "./remote-assets-
|
|
6
|
-
import {
|
|
7
|
-
import { t as createH3DevframeHost } from "./host-h3-
|
|
8
|
-
import {
|
|
3
|
+
import { t as diagnostics } from "./diagnostics-DZA6KQ_Z.mjs";
|
|
4
|
+
import { t as createHostContext } from "./context-Bq27SDK-.mjs";
|
|
5
|
+
import { t as resolveStaticAssetsSource } from "./remote-assets-DMFzLSoH.mjs";
|
|
6
|
+
import { a as resolveMcpConfig, i as resolveDevServerPort, n as normalizeBasePath, r as resolveBasePath, s as importRuntimeModule, t as loadAutoMcpAdapter } from "./_shared-U8D-xzrp.mjs";
|
|
7
|
+
import { t as createH3DevframeHost } from "./host-h3-BROI6SQ4.mjs";
|
|
8
|
+
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, t as createInstanceShell } from "./instance-shell-DvYCwrDy.mjs";
|
|
9
9
|
import { open } from "./utils/open.mjs";
|
|
10
10
|
import { mountStaticHandler } from "./utils/serve-static.mjs";
|
|
11
|
+
import { resolve } from "pathe";
|
|
11
12
|
import { createServer } from "node:http";
|
|
12
13
|
import process from "node:process";
|
|
13
|
-
import { resolve } from "pathe";
|
|
14
14
|
import { joinURL, withBase, withoutLeadingSlash } from "ufo";
|
|
15
15
|
import { H3, toNodeHandler } from "h3";
|
|
16
16
|
//#region src/adapters/initiate.ts
|
|
@@ -88,36 +88,11 @@ function initDevframe(def, options) {
|
|
|
88
88
|
for (const input of def.services ?? []) context.services.install(input, { resolveFrom: def.importMetaUrl });
|
|
89
89
|
await context.services.ready();
|
|
90
90
|
await def.setup(context, setupInfo);
|
|
91
|
-
const
|
|
92
|
-
let mcpMeta;
|
|
93
|
-
let mcpDispose;
|
|
94
|
-
if (mcpConfig) {
|
|
95
|
-
const mcpRoute = withoutLeadingSlash(mcpConfig.path ?? "__mcp");
|
|
96
|
-
mcpMeta = { path: mcpRoute };
|
|
97
|
-
const mcpPath = joinURL(base, mcpRoute);
|
|
98
|
-
let mountMcpHttp;
|
|
99
|
-
try {
|
|
100
|
-
({mountMcpHttp} = await importRuntimeModule("devframe/adapters/mcp"));
|
|
101
|
-
} catch (error) {
|
|
102
|
-
const reason = error instanceof Error ? error.message : String(error);
|
|
103
|
-
throw diagnostics.DF0017({
|
|
104
|
-
transport: "http",
|
|
105
|
-
reason,
|
|
106
|
-
cause: error
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
mcpDispose = mountMcpHttp(app, context, mcpPath, {
|
|
110
|
-
serverName: `${def.id} (devframe)`,
|
|
111
|
-
serverVersion: def.version ?? "0.0.0",
|
|
112
|
-
exposeSharedState: true,
|
|
113
|
-
authorization: mcpConfig.authorization,
|
|
114
|
-
allowedOrigins: mcpConfig.allowedOrigins
|
|
115
|
-
}).dispose;
|
|
116
|
-
}
|
|
91
|
+
const mcp = await mountMcpRoute(app, context, def, base, options.mcp ?? def.cli?.mcp ?? "auto");
|
|
117
92
|
return {
|
|
118
93
|
context,
|
|
119
|
-
...
|
|
120
|
-
...
|
|
94
|
+
...mcp?.meta ? { mcp: mcp.meta } : {},
|
|
95
|
+
...mcp?.dispose ? { dispose: mcp.dispose } : {}
|
|
121
96
|
};
|
|
122
97
|
},
|
|
123
98
|
mount(context, meta) {
|
|
@@ -142,6 +117,45 @@ function initDevframe(def, options) {
|
|
|
142
117
|
INSTANCE_INTERNALS.set(instance, shell.internals);
|
|
143
118
|
return instance;
|
|
144
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Mount the route-based MCP server at `<base>__mcp`, before the SPA static
|
|
122
|
+
* catch-all so the exact route wins. The MCP SDK is pulled in dynamically
|
|
123
|
+
* only when the route mounts, keeping it out of consumer bundles: `'auto'`
|
|
124
|
+
* mounts once `setup()` left a non-empty agent surface (an empty surface
|
|
125
|
+
* loads no MCP code); an explicit setting mounts unconditionally. The
|
|
126
|
+
* resolved config is origin-only unless it opts into a bearer/callback.
|
|
127
|
+
*/
|
|
128
|
+
async function mountMcpRoute(app, context, def, base, setting) {
|
|
129
|
+
let module;
|
|
130
|
+
let config;
|
|
131
|
+
if (setting === "auto") {
|
|
132
|
+
module = await loadAutoMcpAdapter(context.agent);
|
|
133
|
+
if (module) config = { authorization: false };
|
|
134
|
+
} else config = resolveMcpConfig(setting);
|
|
135
|
+
if (!config) return void 0;
|
|
136
|
+
const route = withoutLeadingSlash(config.path ?? "__mcp");
|
|
137
|
+
if (!module) try {
|
|
138
|
+
module = await importRuntimeModule("devframe/adapters/mcp");
|
|
139
|
+
} catch (error) {
|
|
140
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
141
|
+
throw diagnostics.DF0017({
|
|
142
|
+
transport: "http",
|
|
143
|
+
reason,
|
|
144
|
+
cause: error
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const mounted = module.mountMcpHttp(app, context, joinURL(base, route), {
|
|
148
|
+
serverName: `${def.id} (devframe)`,
|
|
149
|
+
serverVersion: def.version ?? "0.0.0",
|
|
150
|
+
exposeSharedState: true,
|
|
151
|
+
authorization: config.authorization,
|
|
152
|
+
allowedOrigins: config.allowedOrigins
|
|
153
|
+
});
|
|
154
|
+
return {
|
|
155
|
+
meta: { path: route },
|
|
156
|
+
dispose: mounted.dispose
|
|
157
|
+
};
|
|
158
|
+
}
|
|
145
159
|
//#endregion
|
|
146
160
|
//#region src/adapters/dev.ts
|
|
147
161
|
/**
|
|
@@ -68,8 +68,8 @@ const diagnostics = defineDiagnostics({
|
|
|
68
68
|
fix: "Discovery tooling (`devframe connect`) will not see this instance. Check that the registry directory is writable, point `DEVFRAME_INSTANCES_DIR` at a writable directory, or set `DEVFRAME_DISABLE_INSTANCE_REGISTRY=1` to opt out of registration."
|
|
69
69
|
},
|
|
70
70
|
DF0046: {
|
|
71
|
-
why: (p) => `\`devframe connect\` requires the optional peer dependency @modelcontextprotocol/
|
|
72
|
-
fix: "Install it next to devframe (e.g. `npm install @modelcontextprotocol/
|
|
71
|
+
why: (p) => `\`devframe connect\` requires the optional peer dependency @modelcontextprotocol/client: ${p.reason}`,
|
|
72
|
+
fix: "Install it next to devframe (e.g. `npm install @modelcontextprotocol/client`) and run `devframe connect` again."
|
|
73
73
|
},
|
|
74
74
|
DF0047: {
|
|
75
75
|
why: (p) => `Agent tool "${p.id}" is hidden from the MCP surface: its wire name "${p.name}" collides with the tool "${p.existing}".`,
|
|
@@ -173,7 +173,7 @@ const diagnostics = defineDiagnostics({
|
|
|
173
173
|
},
|
|
174
174
|
DF0076: {
|
|
175
175
|
why: (p) => `\`attach\` / \`handleUpgrade\` drive a raw \`node:http\` upgrade into crossws's Node adapter, which refuses to run on ${p.runtime}.`,
|
|
176
|
-
fix: "On Bun/Deno, serve the advertised `__ws` route from `Bun.serve` / `Deno.serve` with `attachBunWsTransport` / `attachDenoWsTransport` (see the hub-deno
|
|
176
|
+
fix: "On Bun/Deno, serve the advertised `__ws` route from `Bun.serve` / `Deno.serve` with `attachBunWsTransport` / `attachDenoWsTransport` (see the hub-deno example), or connect over the SSE endpoint instead."
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
});
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { t as DEVFRAME_EVENTS } from "./events-BV4Dj59a.mjs";
|
|
2
|
-
import { t as diagnostics } from "./diagnostics-
|
|
3
|
-
import { createRequire } from "node:module";
|
|
4
|
-
import { pathToFileURL } from "node:url";
|
|
5
|
-
import { isAbsolute, join } from "pathe";
|
|
2
|
+
import { t as diagnostics } from "./diagnostics-DZA6KQ_Z.mjs";
|
|
6
3
|
//#region src/utils/events.ts
|
|
7
4
|
/**
|
|
8
5
|
* Create event emitter.
|
|
@@ -174,6 +171,12 @@ var DevframeAgentHost = class {
|
|
|
174
171
|
resources
|
|
175
172
|
};
|
|
176
173
|
}
|
|
174
|
+
hasSurface() {
|
|
175
|
+
if (this.tools.size > 0 || this.resources.size > 0) return true;
|
|
176
|
+
for (const [, def] of this.context.rpc.definitions) if (def.agent) return true;
|
|
177
|
+
for (const provider of this.providers) if (provider().length > 0) return true;
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
177
180
|
getTool(id) {
|
|
178
181
|
const plain = this.tools.get(id);
|
|
179
182
|
if (plain) return plain.tool;
|
|
@@ -271,154 +274,4 @@ function inferSafety(type) {
|
|
|
271
274
|
return "action";
|
|
272
275
|
}
|
|
273
276
|
//#endregion
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Turn a `resolveFrom` value (a file path, a file URL like `import.meta.url`,
|
|
277
|
-
* or a directory) into something `createRequire` accepts; a directory gets a
|
|
278
|
-
* synthetic filename appended so resolution starts inside it.
|
|
279
|
-
*/
|
|
280
|
-
function toRequireBase(resolveFrom) {
|
|
281
|
-
if (resolveFrom.startsWith("file://")) return resolveFrom;
|
|
282
|
-
if ((resolveFrom.split(/[/\\]/).pop() ?? "").includes(".")) return resolveFrom;
|
|
283
|
-
return join(resolveFrom, "_devframe_resolve.js");
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Normalize an `install()` `resolveFrom` into a resolution base. Paths and
|
|
287
|
-
* file URLs pass through (the common case: the declaring plugin's
|
|
288
|
-
* `importMetaUrl`, so a service it declares resolves against the plugin's own
|
|
289
|
-
* dependencies); a bare npm package name resolves to that package's location
|
|
290
|
-
* from `cwd`. An unresolvable package name reads as no base (the caller's
|
|
291
|
-
* workspace fallbacks apply).
|
|
292
|
-
*/
|
|
293
|
-
function expandResolveFrom(resolveFrom, cwd) {
|
|
294
|
-
if (resolveFrom.startsWith("file://") || resolveFrom.startsWith(".") || isAbsolute(resolveFrom)) return resolveFrom;
|
|
295
|
-
const require = createRequire(join(cwd, "_devframe_resolve.js"));
|
|
296
|
-
try {
|
|
297
|
-
return require.resolve(`${resolveFrom}/package.json`);
|
|
298
|
-
} catch {}
|
|
299
|
-
try {
|
|
300
|
-
return require.resolve(resolveFrom);
|
|
301
|
-
} catch {}
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* Import a service package's module, trying each `resolveFrom` candidate in
|
|
305
|
-
* order (so a plugin-declared service resolves against the plugin's own
|
|
306
|
-
* dependency tree first, then the workspace fallback). Throws the last
|
|
307
|
-
* resolution error when no candidate succeeds.
|
|
308
|
-
*/
|
|
309
|
-
async function importServicePackage(pkg, resolveFroms) {
|
|
310
|
-
const candidates = [...new Set(resolveFroms.filter((x) => typeof x === "string" && x.length > 0))];
|
|
311
|
-
let lastError = /* @__PURE__ */ new Error(`no resolution base available for "${pkg}"`);
|
|
312
|
-
for (const from of candidates) {
|
|
313
|
-
let resolved;
|
|
314
|
-
try {
|
|
315
|
-
resolved = createRequire(toRequireBase(from)).resolve(pkg);
|
|
316
|
-
} catch (error) {
|
|
317
|
-
lastError = error;
|
|
318
|
-
continue;
|
|
319
|
-
}
|
|
320
|
-
return await import(
|
|
321
|
-
/* webpackIgnore: true */
|
|
322
|
-
/* @vite-ignore */
|
|
323
|
-
/* turbopackIgnore: true */
|
|
324
|
-
pathToFileURL(resolved).href
|
|
325
|
-
);
|
|
326
|
-
}
|
|
327
|
-
throw lastError;
|
|
328
|
-
}
|
|
329
|
-
function parseVersion(input) {
|
|
330
|
-
const [core, ...prerelease] = input.trim().replace(/^v/, "").split("-");
|
|
331
|
-
if (!core) return void 0;
|
|
332
|
-
const parts = core.split(".").map((part) => Number.parseInt(part, 10));
|
|
333
|
-
if (parts.length === 0 || parts.some((part) => Number.isNaN(part) || part < 0)) return void 0;
|
|
334
|
-
while (parts.length < 3) parts.push(0);
|
|
335
|
-
return {
|
|
336
|
-
parts,
|
|
337
|
-
...prerelease.length ? { prerelease: prerelease.join("-") } : {}
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
function compareVersions(a, b) {
|
|
341
|
-
for (let i = 0; i < 3; i++) {
|
|
342
|
-
const diff = (a.parts[i] ?? 0) - (b.parts[i] ?? 0);
|
|
343
|
-
if (diff !== 0) return diff;
|
|
344
|
-
}
|
|
345
|
-
if (a.prerelease && !b.prerelease) return -1;
|
|
346
|
-
if (!a.prerelease && b.prerelease) return 1;
|
|
347
|
-
if (a.prerelease && b.prerelease) return a.prerelease < b.prerelease ? -1 : a.prerelease > b.prerelease ? 1 : 0;
|
|
348
|
-
return 0;
|
|
349
|
-
}
|
|
350
|
-
/** Whether `version` and `base` share their first `lockUpTo + 1` parts. */
|
|
351
|
-
function partsMatchUpTo(version, base, lockUpTo) {
|
|
352
|
-
for (let i = 0; i <= lockUpTo; i++) if ((version.parts[i] ?? 0) !== (base.parts[i] ?? 0)) return false;
|
|
353
|
-
return true;
|
|
354
|
-
}
|
|
355
|
-
function satisfiesCaret(version, base) {
|
|
356
|
-
if (compareVersions(version, base) < 0) return false;
|
|
357
|
-
const fixedIndex = base.parts.findIndex((part) => part !== 0);
|
|
358
|
-
return partsMatchUpTo(version, base, fixedIndex === -1 ? base.parts.length - 1 : fixedIndex);
|
|
359
|
-
}
|
|
360
|
-
function satisfiesTilde(version, base, segments) {
|
|
361
|
-
if (compareVersions(version, base) < 0) return false;
|
|
362
|
-
return partsMatchUpTo(version, base, segments.length >= 2 ? 1 : 0);
|
|
363
|
-
}
|
|
364
|
-
function satisfiesExactOrPrefix(version, base, segments) {
|
|
365
|
-
for (let i = 0; i < Math.max(segments.length, 3); i++) if (i < segments.length && (version.parts[i] ?? 0) !== (base.parts[i] ?? 0)) return false;
|
|
366
|
-
return segments.length >= 3 ? compareVersions(version, base) === 0 : true;
|
|
367
|
-
}
|
|
368
|
-
function satisfiesComparator(version, comparator) {
|
|
369
|
-
const raw = comparator.trim();
|
|
370
|
-
if (!raw || raw === "*" || raw === "x") return true;
|
|
371
|
-
const operatorMatch = raw.match(/^([\^~]|>=|<=|[><=])?(.+)$/);
|
|
372
|
-
if (!operatorMatch) return false;
|
|
373
|
-
const operator = operatorMatch[1];
|
|
374
|
-
const rest = operatorMatch[2].trim();
|
|
375
|
-
const segments = rest.replace(/\.[x*]/gi, "").split(".").filter(Boolean);
|
|
376
|
-
const base = parseVersion(rest.replace(/[x*]/gi, "0"));
|
|
377
|
-
if (!base) return false;
|
|
378
|
-
switch (operator) {
|
|
379
|
-
case ">": return compareVersions(version, base) > 0;
|
|
380
|
-
case ">=": return compareVersions(version, base) >= 0;
|
|
381
|
-
case "<": return compareVersions(version, base) < 0;
|
|
382
|
-
case "<=": return compareVersions(version, base) <= 0;
|
|
383
|
-
case "^": return satisfiesCaret(version, base);
|
|
384
|
-
case "~": return satisfiesTilde(version, base, segments);
|
|
385
|
-
default: return satisfiesExactOrPrefix(version, base, segments);
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* Pragmatic semver range check for service version declarations; supports
|
|
390
|
-
* the common forms (`1.2.3`, `^1.2.3`, `~1.2`, `>=1 <3`, `1.x`, `*`, and
|
|
391
|
-
* `||`-joined alternatives) without pulling in a semver dependency. An
|
|
392
|
-
* unparseable version or range reads as **not satisfied**.
|
|
393
|
-
*/
|
|
394
|
-
function satisfiesVersionRange(version, range) {
|
|
395
|
-
const parsed = parseVersion(version);
|
|
396
|
-
if (!parsed) return false;
|
|
397
|
-
const alternatives = range.split("||").map((alt) => alt.trim()).filter(Boolean);
|
|
398
|
-
if (alternatives.length === 0) return true;
|
|
399
|
-
return alternatives.some((alternative) => alternative.split(/\s+/).every((comparator) => satisfiesComparator(parsed, comparator)));
|
|
400
|
-
}
|
|
401
|
-
function isPlainObject(value) {
|
|
402
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
403
|
-
}
|
|
404
|
-
/** Deep-merge two values with the service option-set rules (see below). */
|
|
405
|
-
function deepMergeTwo(a, b) {
|
|
406
|
-
if (Array.isArray(a) && Array.isArray(b)) return [.../* @__PURE__ */ new Set([...a, ...b])];
|
|
407
|
-
if (isPlainObject(a) && isPlainObject(b)) {
|
|
408
|
-
const out = { ...a };
|
|
409
|
-
for (const key of Object.keys(b)) out[key] = key in a ? deepMergeTwo(a[key], b[key]) : b[key];
|
|
410
|
-
return out;
|
|
411
|
-
}
|
|
412
|
-
return b;
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* Default option-set merge when a service declares no `mergeOptions`:
|
|
416
|
-
* deep-merge in declaration order: objects recurse, arrays union-dedupe,
|
|
417
|
-
* scalars take the later value. Covers the built-in services (`roots` /
|
|
418
|
-
* `langs` union, `themes` per-key last-wins) without a custom hook.
|
|
419
|
-
*/
|
|
420
|
-
function deepMergeOptionSets(sets) {
|
|
421
|
-
return sets.reduce((merged, set) => deepMergeTwo(merged, set));
|
|
422
|
-
}
|
|
423
|
-
//#endregion
|
|
424
|
-
export { DevframeAgentHost as a, satisfiesVersionRange as i, expandResolveFrom as n, coerceAgentPositionalArgs as o, importServicePackage as r, createEventEmitter as s, deepMergeOptionSets as t };
|
|
277
|
+
export { coerceAgentPositionalArgs as n, createEventEmitter as r, DevframeAgentHost as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as InferArgsType, E as Thenable, O as InferReturnType, T as RpcReturnSchema, i as RpcArgsSchema } from "../types-Dq4i156u.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { Vt as EventEmitter, k as SharedState } from "../context-BBWPLDHh.mjs";
|
|
3
3
|
import { BirpcReturn } from "birpc";
|
|
4
4
|
//#region src/in-page-channel/types.d.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as SharedState, o as DevframeNodeContext, s as DevframeNodeRpcSession } from "./context-
|
|
2
|
-
import { n as InternalAnonymousAuthStorage } from "./context-
|
|
1
|
+
import { k as SharedState, o as DevframeNodeContext, s as DevframeNodeRpcSession } from "./context-BBWPLDHh.mjs";
|
|
2
|
+
import { n as InternalAnonymousAuthStorage } from "./context-_temOGDB.mjs";
|
|
3
3
|
//#region src/node/auth/revoke.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Flip `isTrusted` to false on any live WS clients connected with `token`
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./index-pIVt92jP.mjs";
|
|
2
2
|
import { C as RpcFunctionType, T as RpcReturnSchema, _ as RpcFunctionDefinition, g as RpcFunctionAgentOptions, i as RpcArgsSchema } from "./types-Dq4i156u.mjs";
|
|
3
3
|
import { c as DevframeNodeRpcSessionMeta, d as DevframeRpcTransportKind, l as DevframeRpcConnection, u as DevframeRpcConnectionRequest } from "./ws-server-D2nv68Hg.mjs";
|
|
4
|
-
import { $ as
|
|
4
|
+
import { $ as DevframeServiceOf, At as AgentHandle, B as DevframeSetupInfo, Bt as DevframeAgentHostEvents, Ct as DevframeDiagnosticsHost, F as DevframeDefinition, Ft as AgentTool, G as McpAuthorization, H as DevframeSnapshotRpcInputs, Ht as EventUnsubscribe, I as DevframeDeploymentKind, It as AgentToolInput, J as DevframeServiceDefinition, K as McpRouteOptions, L as DevframeDockDefaults, Lt as AgentToolProvider, Mt as AgentResource, Nt as AgentResourceContent, P as DevframeCliOptions, Pt as AgentResourceInput, Q as DevframeServiceMeta, R as DevframeDuplicationStrategy, Rt as AgentToolProviderHandle, St as DevframeStorageScope, U as DevframeSseOptions, Ut as EventsMap, V as DevframeSnapshotRpcEntry, Vt as EventEmitter, W as DevframeWsOptions, X as DevframeServiceId, Y as DevframeServiceDescriptor, Z as DevframeServiceInput, _t as DevframeViewHost, a as DevframeConnectionConfigsRegistry, at as DevframeScopedNodeContext, bt as DevframeRpcSharedStates, c as RpcBroadcastOptions, ct as DevframeSettings, d as RpcSharedStateHost, dt as ScopedBroadcastOptions, et as DevframeServiceScopeOf, f as RpcStreamingChannel, ft as ScopedClientFunctions, gt as SettingsForNamespace, ht as ScopedSharedStates, i as DevframeCapabilities, it as DevframeServicesState, jt as AgentManifest, l as RpcFunctionsHost, lt as DevframeSettingsRegistry, m as RpcStreamingHost, mt as ScopedServerFunctions, n as ConnectionMetaSse, nt as DevframeServicesRegistry, o as DevframeNodeContext, ot as DevframeScopedNodeRpc, p as RpcStreamingChannelOptions, pt as ScopedRpcFn, q as McpSetting, r as ConnectionMetaWebsocket, rt as DevframeServicesScopeRegistry, s as DevframeNodeRpcSession, st as DevframeScopedStreamingHost, t as ConnectionMeta, tt as DevframeServicesHost, u as RpcSharedStateGetOptions, ut as DevframeSettingsStore, vt as DevframeRpcClientFunctions, wt as DevframeDiagnosticsLogger, xt as DevframeHost, yt as DevframeRpcServerFunctions, z as DevframeRpcOptions, zt as DevframeAgentHost } from "./context-BBWPLDHh.mjs";
|
|
5
5
|
import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "./remote-assets-eBvSKZMS.mjs";
|
|
6
6
|
import { i as DevframeDefineDiagnosticsOptions } from "./nostics-0sKe5HIj.mjs";
|
|
7
7
|
//#region src/define.d.ts
|
|
@@ -18,4 +18,4 @@ declare function defineDevframe(d: DevframeDefinition): DevframeDefinition;
|
|
|
18
18
|
*/
|
|
19
19
|
declare function resolveClientAssets(d: DevframeDefinition): StaticAssetsSource | undefined;
|
|
20
20
|
//#endregion
|
|
21
|
-
export { type AgentHandle, type AgentManifest, type AgentResource, type AgentResourceContent, type AgentResourceInput, type AgentTool, type AgentToolInput, type AgentToolProvider, type AgentToolProviderHandle, type ConnectionMeta, type ConnectionMetaSse, type ConnectionMetaWebsocket, type DevframeAgentHost, type DevframeAgentHostEvents, type DevframeCapabilities, type DevframeCliOptions, type DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, type DevframeDefinition, type DevframeDeploymentKind, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDockDefaults, type DevframeDuplicationStrategy, type DevframeHost, type DevframeNodeContext, type DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, type DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, type DevframeRpcOptions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeRpcTransportKind, type DevframeScopedNodeContext, type DevframeScopedNodeRpc, type DevframeScopedStreamingHost, type DevframeServiceDefinition, type DevframeServiceDescriptor, type DevframeServiceId, type DevframeServiceInput, type DevframeServiceMeta, type DevframeServiceOf, type DevframeServiceScopeOf, type DevframeServicesHost, type DevframeServicesRegistry, type DevframeServicesScopeRegistry, type DevframeServicesState, type DevframeSettings, type DevframeSettingsRegistry, type DevframeSettingsStore, type DevframeSetupInfo, type DevframeSnapshotRpcEntry, type DevframeSnapshotRpcInputs, type DevframeSseOptions, type DevframeStorageScope, type DevframeViewHost, type DevframeWsOptions, type EventEmitter, type EventUnsubscribe, type EventsMap, type McpAuthorization, type McpRouteOptions, type RemoteAssets, type RemoteAssetsErrorMessage, type RemoteAssetsProvider, type RemoteAssetsProviderCustom, type RemoteAssetsStore, type RpcBroadcastOptions, type RpcFunctionAgentOptions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type ScopedBroadcastOptions, type ScopedClientFunctions, type ScopedRpcFn, type ScopedServerFunctions, type ScopedSharedStates, type SettingsForNamespace, type StaticAssetsSource, defineDevframe, defineRpcFunction, resolveClientAssets };
|
|
21
|
+
export { type AgentHandle, type AgentManifest, type AgentResource, type AgentResourceContent, type AgentResourceInput, type AgentTool, type AgentToolInput, type AgentToolProvider, type AgentToolProviderHandle, type ConnectionMeta, type ConnectionMetaSse, type ConnectionMetaWebsocket, type DevframeAgentHost, type DevframeAgentHostEvents, type DevframeCapabilities, type DevframeCliOptions, type DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, type DevframeDefinition, type DevframeDeploymentKind, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDockDefaults, type DevframeDuplicationStrategy, type DevframeHost, type DevframeNodeContext, type DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, type DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, type DevframeRpcOptions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeRpcTransportKind, type DevframeScopedNodeContext, type DevframeScopedNodeRpc, type DevframeScopedStreamingHost, type DevframeServiceDefinition, type DevframeServiceDescriptor, type DevframeServiceId, type DevframeServiceInput, type DevframeServiceMeta, type DevframeServiceOf, type DevframeServiceScopeOf, type DevframeServicesHost, type DevframeServicesRegistry, type DevframeServicesScopeRegistry, type DevframeServicesState, type DevframeSettings, type DevframeSettingsRegistry, type DevframeSettingsStore, type DevframeSetupInfo, type DevframeSnapshotRpcEntry, type DevframeSnapshotRpcInputs, type DevframeSseOptions, type DevframeStorageScope, type DevframeViewHost, type DevframeWsOptions, type EventEmitter, type EventUnsubscribe, type EventsMap, type McpAuthorization, type McpRouteOptions, type McpSetting, type RemoteAssets, type RemoteAssetsErrorMessage, type RemoteAssetsProvider, type RemoteAssetsProviderCustom, type RemoteAssetsStore, type RpcBroadcastOptions, type RpcFunctionAgentOptions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type ScopedBroadcastOptions, type ScopedClientFunctions, type ScopedRpcFn, type ScopedServerFunctions, type ScopedSharedStates, type SettingsForNamespace, type StaticAssetsSource, defineDevframe, defineRpcFunction, resolveClientAssets };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as __exportAll } from "./rolldown-runtime-B4iAMlE-.mjs";
|
|
2
|
-
import { t as diagnostics } from "./diagnostics-
|
|
3
|
-
import process from "node:process";
|
|
2
|
+
import { t as diagnostics } from "./diagnostics-DZA6KQ_Z.mjs";
|
|
4
3
|
import { join } from "pathe";
|
|
4
|
+
import process from "node:process";
|
|
5
5
|
import { mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
//#region src/node/instance-registry.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as DevframeNodeRpcSessionMeta, l as DevframeRpcConnection, n as WsOriginRegistry } from "./ws-server-D2nv68Hg.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import "./index-
|
|
2
|
+
import { Tt as DevframeAuthHandler, U as DevframeSseOptions, W as DevframeWsOptions, o as DevframeNodeContext, s as DevframeNodeRpcSession, t as ConnectionMeta, vt as DevframeRpcClientFunctions, yt as DevframeRpcServerFunctions } from "./context-BBWPLDHh.mjs";
|
|
3
|
+
import "./index-1ezCLThh.mjs";
|
|
4
4
|
import { BirpcGroup } from "birpc";
|
|
5
5
|
import { NodeAdapter } from "crossws/adapters/node";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
import "./constants.mjs";
|
|
2
2
|
import { r as validateOriginCandidate } from "./origin-DZit9g29.mjs";
|
|
3
|
-
import { t as diagnostics } from "./diagnostics-
|
|
4
|
-
import {
|
|
5
|
-
import { t as getInternalContext } from "./context-DIUvJW4D.mjs";
|
|
3
|
+
import { t as diagnostics } from "./diagnostics-DZA6KQ_Z.mjs";
|
|
4
|
+
import { t as getInternalContext } from "./context-jXO5vzjH.mjs";
|
|
6
5
|
import { createInteractiveAuth } from "./recipes/interactive-auth.mjs";
|
|
7
6
|
import { createServer } from "node:http";
|
|
8
7
|
import process from "node:process";
|
|
9
8
|
import { isIP } from "node:net";
|
|
10
9
|
import { joinURL, withLeadingSlash, withoutLeadingSlash, withoutTrailingSlash } from "ufo";
|
|
11
10
|
import { H3, defineHandler, toNodeHandler } from "h3";
|
|
12
|
-
//#region src/node/import-runtime-module.ts
|
|
13
|
-
/**
|
|
14
|
-
* Resolve and import a package at runtime without adding it to a consumer's
|
|
15
|
-
* bundle graph. First-party adapters use this for optional peers whose code
|
|
16
|
-
* is needed only when the matching feature is enabled.
|
|
17
|
-
*
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
async function importRuntimeModule(specifier) {
|
|
21
|
-
return await importServicePackage(specifier, [import.meta.url]);
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
11
|
//#region src/node/runtime.ts
|
|
25
12
|
/**
|
|
26
13
|
* Detect the current server runtime from its runtime-specific global. The
|
|
@@ -330,7 +317,7 @@ function createInstanceShell(options) {
|
|
|
330
317
|
const origin = currentOrigin();
|
|
331
318
|
if (!cfg || registerPromise || !origin || !meta) return;
|
|
332
319
|
const resolvedMeta = meta;
|
|
333
|
-
registerPromise = import("./instance-registry-
|
|
320
|
+
registerPromise = import("./instance-registry-DCq762YJ.mjs").then((n) => n.t).then(({ registerDevframeInstance }) => {
|
|
334
321
|
let port = 0;
|
|
335
322
|
try {
|
|
336
323
|
const url = new URL(origin);
|
|
@@ -402,7 +389,7 @@ function createInstanceShell(options) {
|
|
|
402
389
|
let resolvedAuth = false;
|
|
403
390
|
let corePromise;
|
|
404
391
|
function ensureCore() {
|
|
405
|
-
corePromise ??= import("./rpc-core-
|
|
392
|
+
corePromise ??= import("./rpc-core-CvkU23bQ.mjs").then((n) => n.n).then(({ createContextRpcServer }) => createContextRpcServer({
|
|
406
393
|
context: ctx,
|
|
407
394
|
auth: resolvedAuth,
|
|
408
395
|
onPeerConnect: options.onPeerConnect,
|
|
@@ -665,4 +652,4 @@ function createInstanceShell(options) {
|
|
|
665
652
|
};
|
|
666
653
|
}
|
|
667
654
|
//#endregion
|
|
668
|
-
export {
|
|
655
|
+
export { normalizeHttpServerUrl as i, resolveInstanceRegister as n, samePath as r, createInstanceShell as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { v as RpcFunctionDefinitionAny } from "../types-Dq4i156u.mjs";
|
|
2
|
-
import { At as
|
|
2
|
+
import { At as AgentHandle, Bt as DevframeAgentHostEvents, F as DevframeDefinition, Ft as AgentTool, It as AgentToolInput, Lt as AgentToolProvider, Mt as AgentResource, Nt as AgentResourceContent, Pt as AgentResourceInput, Rt as AgentToolProviderHandle, Vt as EventEmitter, jt as AgentManifest, o as DevframeNodeContext, xt as DevframeHost, zt as DevframeAgentHost$1 } from "../context-BBWPLDHh.mjs";
|
|
3
3
|
import { a as RemoteAssetsStore, o as StaticAssetsSource } from "../remote-assets-eBvSKZMS.mjs";
|
|
4
|
-
import { a as InstanceShellInit, c as StartedServer, d as samePath, f as DevframeInstanceRecord, h as registerDevframeInstance, 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 {
|
|
6
|
-
import { n as CreateContextRpcServerOptions, r as createContextRpcServer, t as ContextRpcServer } from "../rpc-core-
|
|
4
|
+
import { a as InstanceShellInit, c as StartedServer, d as samePath, f as DevframeInstanceRecord, h as registerDevframeInstance, 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-BWh0JQuo.mjs";
|
|
5
|
+
import { a as resolveBasePath, i as normalizeBasePath, n as ResolvedMcpConfig, r as loadAutoMcpAdapter, s as resolveMcpConfig } from "../_shared-DEAMiPfH.mjs";
|
|
6
|
+
import { n as CreateContextRpcServerOptions, r as createContextRpcServer, t as ContextRpcServer } from "../rpc-core-DiCr5etS.mjs";
|
|
7
7
|
//#region src/client-assets.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* Resolve a definition's client assets source: the built SPA served as its
|
|
@@ -175,7 +175,7 @@ declare const diagnostics: import("nostics").Diagnostics<{
|
|
|
175
175
|
readonly why: (p: {
|
|
176
176
|
reason: string;
|
|
177
177
|
}) => string;
|
|
178
|
-
readonly fix: "Install it next to devframe (e.g. `npm install @modelcontextprotocol/
|
|
178
|
+
readonly fix: "Install it next to devframe (e.g. `npm install @modelcontextprotocol/client`) and run `devframe connect` again.";
|
|
179
179
|
};
|
|
180
180
|
readonly DF0047: {
|
|
181
181
|
readonly why: (p: {
|
|
@@ -350,7 +350,7 @@ declare const diagnostics: import("nostics").Diagnostics<{
|
|
|
350
350
|
readonly why: (p: {
|
|
351
351
|
runtime: string;
|
|
352
352
|
}) => string;
|
|
353
|
-
readonly fix: "On Bun/Deno, serve the advertised `__ws` route from `Bun.serve` / `Deno.serve` with `attachBunWsTransport` / `attachDenoWsTransport` (see the hub-deno
|
|
353
|
+
readonly fix: "On Bun/Deno, serve the advertised `__ws` route from `Bun.serve` / `Deno.serve` with `attachBunWsTransport` / `attachDenoWsTransport` (see the hub-deno example), or connect over the SSE endpoint instead.";
|
|
354
354
|
};
|
|
355
355
|
}, readonly [(d: import("nostics").Diagnostic, { method }?: {
|
|
356
356
|
method?: "log" | "warn" | "error";
|
|
@@ -377,6 +377,7 @@ declare class DevframeAgentHost implements DevframeAgentHost$1 {
|
|
|
377
377
|
registerResource(input: AgentResourceInput): AgentHandle;
|
|
378
378
|
unregisterResource(id: string): boolean;
|
|
379
379
|
list(): AgentManifest;
|
|
380
|
+
hasSurface(): boolean;
|
|
380
381
|
getTool(id: string): AgentTool | undefined;
|
|
381
382
|
getResource(id: string): AgentResource | undefined;
|
|
382
383
|
invoke(id: string, args: unknown): Promise<unknown>;
|
|
@@ -431,8 +432,9 @@ declare function createH3DevframeHost(options: CreateH3DevframeHostOptions): Dev
|
|
|
431
432
|
//#region src/node/import-runtime-module.d.ts
|
|
432
433
|
/**
|
|
433
434
|
* Resolve and import a package at runtime without adding it to a consumer's
|
|
434
|
-
* bundle graph. First-party adapters use this for
|
|
435
|
-
*
|
|
435
|
+
* bundle graph. First-party adapters use this for modules whose code is
|
|
436
|
+
* needed only when the matching feature is enabled (optional peers, and the
|
|
437
|
+
* MCP adapter with the SDK behind it).
|
|
436
438
|
*
|
|
437
439
|
* @internal
|
|
438
440
|
*/
|
|
@@ -476,4 +478,4 @@ declare function peekRpcWireFrame(raw: string): {
|
|
|
476
478
|
i?: string;
|
|
477
479
|
};
|
|
478
480
|
//#endregion
|
|
479
|
-
export { type AgentArgsFallback, type ContextRpcServer, type CreateContextRpcServerOptions, CreateH3DevframeHostOptions, type CreateInstanceShellOptions, DevframeAgentHost, type DevframeInstanceRecord, type DevframeInstanceRegistration, type InstanceRegisterConfig, type InstanceShell, type InstanceShellApi, type InstanceShellInit, type InstanceShellInternals, type InstanceWsTier, type ResolvedMcpConfig, type RpcWireCodec, type StartedServer, coerceAgentPositionalArgs, createContextRpcServer, createH3DevframeHost, createInstanceShell, createRpcWireCodec, diagnostics, importRuntimeModule, listLiveDevframeInstances, normalizeBasePath, normalizeHttpServerUrl, peekRpcWireFrame, registerDevframeInstance, resolveBasePath, resolveClientAssets, resolveInstanceRegister, resolveMcpConfig, samePath };
|
|
481
|
+
export { type AgentArgsFallback, type ContextRpcServer, type CreateContextRpcServerOptions, CreateH3DevframeHostOptions, type CreateInstanceShellOptions, DevframeAgentHost, type DevframeInstanceRecord, type DevframeInstanceRegistration, type InstanceRegisterConfig, type InstanceShell, type InstanceShellApi, type InstanceShellInit, type InstanceShellInternals, type InstanceWsTier, type ResolvedMcpConfig, type RpcWireCodec, type StartedServer, coerceAgentPositionalArgs, createContextRpcServer, createH3DevframeHost, createInstanceShell, createRpcWireCodec, diagnostics, importRuntimeModule, listLiveDevframeInstances, loadAutoMcpAdapter, normalizeBasePath, normalizeHttpServerUrl, peekRpcWireFrame, registerDevframeInstance, resolveBasePath, resolveClientAssets, resolveInstanceRegister, resolveMcpConfig, samePath };
|