devframe 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{_shared-Cm4iD0L3.d.mts → _shared-BxeuukaL.d.mts} +2 -4
- package/dist/{_shared-C61zPwIz.mjs → _shared-CtXCQFTV.mjs} +6 -9
- package/dist/adapters/build.d.mts +3 -5
- package/dist/adapters/build.mjs +7 -8
- package/dist/adapters/cac.d.mts +1 -3
- package/dist/adapters/cac.mjs +5 -7
- package/dist/adapters/dev.d.mts +6 -8
- package/dist/adapters/dev.mjs +2 -2
- package/dist/adapters/embedded.d.mts +2 -4
- package/dist/adapters/embedded.mjs +1 -2
- package/dist/adapters/initiate.d.mts +10 -10
- package/dist/adapters/initiate.mjs +1 -2
- package/dist/adapters/mcp.d.mts +2 -2
- package/dist/adapters/mcp.mjs +1 -2
- package/dist/{agentic-C6SCkdtj.d.mts → agentic-DVgUzwhV.d.mts} +1 -3
- package/dist/{browser-agent-Pu-FLk6I.mjs → browser-agent-DmAotroz.mjs} +1 -2
- package/dist/{browser-agent-rpc-KH4HHvHf.mjs → browser-agent-rpc-CS80Sphv.mjs} +3 -5
- package/dist/cli/main.d.mts +1 -3
- package/dist/cli/main.mjs +3 -4
- package/dist/client/index.d.mts +6 -30
- package/dist/client/index.mjs +47 -72
- package/dist/{client-agent-iBkMYxqn.mjs → client-agent-qNMgDUev.mjs} +7 -12
- package/dist/constants.d.mts +1 -5
- package/dist/constants.mjs +2 -3
- package/dist/{context-BGJi0ITA.d.mts → context-B-AARy_U.d.mts} +1 -3
- package/dist/{context-D_jSSdME.mjs → context-BTxC4QrJ.mjs} +4 -5
- package/dist/{context-CAJ5V017.mjs → context-C5FcbWQi.mjs} +25 -41
- package/dist/{crypto-token-TVbGGFuj.mjs → crypto-token-CUhPE_ei.mjs} +1 -2
- package/dist/{define-BLWPsH6y.mjs → define-C8h-fyD3.mjs} +1 -2
- package/dist/{dev-BKBjIpX3.mjs → dev-Cu_iwSCy.mjs} +9 -11
- package/dist/{diagnostics-E_PvUPsA.mjs → diagnostics-DC1-WcvN.mjs} +2 -3
- package/dist/{dist-CO98PBnQ.mjs → dist-BWGpvt-z.mjs} +1 -2
- package/dist/{dist-CZXfGEkd.mjs → dist-CZ-TySHD.mjs} +3 -11
- package/dist/{events-0wDwalmL.mjs → events-qWCKwD8-.mjs} +1 -2
- package/dist/{handler-DmaAfpGq.mjs → handler-DkLlj3-B.mjs} +3 -5
- package/dist/{hash-DdPnc4k3.mjs → hash-DHqpWeMO.mjs} +4 -8
- package/dist/{host-h3-BROI6SQ4.mjs → host-h3-D1uj5EM8.mjs} +1 -2
- package/dist/{import-runtime-module-BzlEQ9PI.mjs → import-runtime-module-DsdqJ1gK.mjs} +2 -3
- package/dist/in-page-channel/index.d.mts +3 -12
- package/dist/in-page-channel/index.mjs +10 -16
- package/dist/{index-CeEtxDmK.d.mts → index-BIRF0E5l.d.mts} +0 -2
- package/dist/{index-Bia1vKjL.d.mts → index-BKu9BxcT.d.mts} +0 -2
- package/dist/{context-BNxFOPbX.d.mts → index-BhUqJUHG.d.mts} +1408 -1442
- package/dist/index.d.mts +7 -8
- package/dist/index.mjs +3 -4
- package/dist/{instance-registry-C_4PpB6N.mjs → instance-registry-DwmnWyCK.mjs} +4 -10
- package/dist/{instance-shell-m4sY2oTG.mjs → instance-shell-Coid7CP6.mjs} +38 -17
- package/dist/{instance-shell-GihbmXoF.d.mts → instance-shell-DTk514M9.d.mts} +6 -10
- package/dist/{interactive-auth-DdDxs3WF.mjs → interactive-auth-BURwIAvE.mjs} +6 -8
- package/dist/internal/index.d.mts +9 -29
- package/dist/internal/index.mjs +13 -15
- package/dist/{mcp-content-QImBQO8e.d.mts → mcp-content-0a0mpCL5.d.mts} +1 -3
- package/dist/{mcp-content-DN3O212x.mjs → mcp-content-CqU8yaF7.mjs} +1 -2
- package/dist/{mrmime-40h5OOIp.mjs → mrmime-y_XyiVcd.mjs} +1 -2
- package/dist/node/auth.d.mts +84 -3
- package/dist/node/auth.mjs +2 -2
- package/dist/node/hub-internals.d.mts +11 -2
- package/dist/node/hub-internals.mjs +2 -2
- package/dist/node/index.d.mts +4 -6
- package/dist/node/index.mjs +2 -2
- package/dist/{nostics-D0PvLZsn.mjs → nostics-InlX4tmd.mjs} +2 -4
- package/dist/{origin-DZit9g29.mjs → origin-Ck7mLbKU.mjs} +1 -2
- package/dist/recipes/interactive-auth.d.mts +3 -5
- package/dist/recipes/interactive-auth.mjs +1 -2
- package/dist/{remote-assets-eBvSKZMS.d.mts → remote-assets-5AQMHZnV.d.mts} +0 -2
- package/dist/{remote-assets-B-n83kUY.mjs → remote-assets-DhonNeo_.mjs} +5 -8
- package/dist/{revoke-CeQUo6KI.mjs → revoke-D6KA3vwr.mjs} +2 -3
- package/dist/{rolldown-runtime-B4iAMlE-.mjs → rolldown-runtime-BVN1G_yT.mjs} +6 -7
- package/dist/rpc/client.d.mts +2 -4
- package/dist/rpc/client.mjs +2 -3
- package/dist/rpc/dump.d.mts +3 -11
- package/dist/rpc/dump.mjs +1 -2
- package/dist/rpc/index.d.mts +122 -4
- package/dist/rpc/index.mjs +6 -8
- package/dist/rpc/server.d.mts +2 -4
- package/dist/rpc/server.mjs +2 -3
- package/dist/rpc/transports/sse-client.d.mts +34 -2
- package/dist/rpc/transports/sse-client.mjs +2 -3
- package/dist/rpc/transports/sse-server.d.mts +5 -7
- package/dist/rpc/transports/sse-server.mjs +4 -5
- package/dist/rpc/transports/ws-bun.d.mts +3 -5
- package/dist/rpc/transports/ws-bun.mjs +2 -3
- package/dist/rpc/transports/ws-client.d.mts +27 -2
- package/dist/rpc/transports/ws-client.mjs +2 -3
- package/dist/rpc/transports/ws-deno.d.mts +3 -5
- package/dist/rpc/transports/ws-deno.mjs +2 -3
- package/dist/rpc/transports/ws-server.d.mts +151 -4
- package/dist/rpc/transports/ws-server.mjs +5 -6
- package/dist/{rpc-core-BLc5hm9X.mjs → rpc-core-BmDHiDR6.mjs} +4 -5
- package/dist/{rpc-core-CGTCla-R.d.mts → rpc-core-CblgPYJ_.d.mts} +5 -7
- package/dist/{serialization-BhuOoL80.mjs → serialization-iiTQ7n21.mjs} +3 -5
- package/dist/{services-install-D5YUwFXW.mjs → services-install-DCuDzMJ-.mjs} +1 -2
- package/dist/{session-DPfj6zQG.mjs → session-BjvoLH3r.mjs} +1 -2
- package/dist/{session-r6PDixP6.d.mts → session-Y9R6tqg4.d.mts} +0 -2
- package/dist/{shared-state-Cc-Jrhma.mjs → shared-state-COV7NCbd.mjs} +4 -6
- package/dist/{state-W4wI6X5X.mjs → state-B_yjfeqo.mjs} +3 -5
- package/dist/{storage-CWI9PZ-5.mjs → storage-DpJ52UB_.mjs} +3 -5
- package/dist/{structured-clone-CbAV5rFI.mjs → structured-clone-B1N_XQvA.mjs} +2 -4
- package/dist/{structured-clone-CgtQ61SA.mjs → structured-clone-D1dOCZvc.mjs} +2 -4
- package/dist/{tool-input-CES3Pc4y.mjs → tool-input-CcCgJ8jq.mjs} +6 -12
- package/dist/types/index.d.mts +5 -5
- package/dist/{types-BmDbfHCx.d.mts → types-KZOyhez5.d.mts} +2 -5
- package/dist/utils/agent-tool-name.d.mts +1 -3
- package/dist/utils/agent-tool-name.mjs +1 -2
- package/dist/utils/colors.d.mts +1 -3
- package/dist/utils/colors.mjs +1 -2
- package/dist/utils/crypto-token.d.mts +1 -3
- package/dist/utils/crypto-token.mjs +1 -2
- package/dist/utils/debounce.d.mts +6 -2
- package/dist/utils/debounce.mjs +1 -2
- package/dist/utils/events.d.mts +2 -4
- package/dist/utils/events.mjs +1 -2
- package/dist/utils/get-port.d.mts +0 -2
- package/dist/utils/get-port.mjs +1 -2
- package/dist/utils/hash.d.mts +1 -3
- package/dist/utils/hash.mjs +1 -2
- package/dist/utils/launch-editor.d.mts +1 -3
- package/dist/utils/launch-editor.mjs +25 -37
- package/dist/utils/nanoid.d.mts +1 -3
- package/dist/utils/nanoid.mjs +1 -2
- package/dist/utils/nostics.d.mts +40 -2
- package/dist/utils/nostics.mjs +1 -2
- package/dist/utils/open.d.mts +1 -3
- package/dist/utils/open.mjs +1 -2
- package/dist/utils/origin.d.mts +55 -2
- package/dist/utils/origin.mjs +1 -2
- package/dist/utils/remote-assets.d.mts +2 -4
- package/dist/utils/remote-assets.mjs +1 -2
- package/dist/utils/serve-static.d.mts +3 -5
- package/dist/utils/serve-static.mjs +3 -4
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -2
- package/dist/utils/simple-schema.d.mts +1 -3
- package/dist/utils/simple-schema.mjs +1 -2
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/streaming-channel.mjs +1 -2
- package/dist/utils/structured-clone.d.mts +1 -3
- package/dist/utils/structured-clone.mjs +1 -2
- package/dist/utils/url.d.mts +1 -3
- package/dist/utils/url.mjs +1 -2
- package/dist/utils/when.d.mts +1 -3
- package/dist/utils/when.mjs +2 -4
- package/dist/{validation-CMfDAti3.mjs → validation-Cjy1P58H.mjs} +7 -13
- package/dist/{wire-codec-B1W3zH3L.mjs → wire-codec-BdngvzfH.mjs} +3 -4
- package/dist/{write-DK7rBUN3.mjs → write-3miSvPaD.mjs} +10 -16
- package/package.json +8 -8
- package/dist/index-CxJatyA1.d.mts +0 -88
- package/dist/index-DuEm0sDH.d.mts +0 -135
- package/dist/nostics-DWvukRwa.d.mts +0 -42
- package/dist/origin-CY6BBHOy.d.mts +0 -58
- package/dist/sse-client-DNdscfu_.d.mts +0 -37
- package/dist/ws-client-6Mrz6eC4.d.mts +0 -30
- package/dist/ws-server-y2R76aSW.d.mts +0 -152
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { C as RpcFunctionType, T as RpcReturnSchema, h as RpcFunctionDefinition, m as RpcFunctionAgentOptions, n as RpcArgsSchema } from "./types-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { a as
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
|
|
1
|
+
import { C as RpcFunctionType, T as RpcReturnSchema, h as RpcFunctionDefinition, m as RpcFunctionAgentOptions, n as RpcArgsSchema } from "./types-KZOyhez5.mjs";
|
|
2
|
+
import { n as withMcpContent } from "./mcp-content-0a0mpCL5.mjs";
|
|
3
|
+
import "./rpc/index.mjs";
|
|
4
|
+
import { a as DevframeWsPeer, i as DevframeRpcTransportKind, n as DevframeRpcConnection, r as DevframeRpcConnectionRequest, t as DevframeNodeRpcSessionMeta } from "./session-Y9R6tqg4.mjs";
|
|
5
|
+
import { DevframeDefineDiagnosticsOptions } from "./utils/nostics.mjs";
|
|
6
|
+
import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "./remote-assets-5AQMHZnV.mjs";
|
|
7
|
+
import { $ as DevframeServiceId, $t as AgentToolProviderHandle, B as DevframeNodeRpcSession, C as McpPromptResult, Ct as DevframeDiagnosticsHost, D as McpResourcesChangedHook, E as McpResourceTemplateEntry, F as ConnectionMetaSse, G as RpcStreamingChannel, Gt as AgentHandle, H as RpcFunctionsHost, I as ConnectionMetaWebsocket, J as DevframeRpcClientFunctions, Jt as AgentResourceContent, K as RpcStreamingChannelOptions, Kt as AgentManifest, L as DevframeCapabilities, O as McpServerHandle, P as ConnectionMeta, Q as DevframeServiceDescriptor, Qt as AgentToolProvider, R as DevframeConnectionConfigsRegistry, S as McpPromptMessage, St as DevframeStorageScope, T as McpResourceTemplateContent, U as RpcSharedStateGetOptions, V as RpcBroadcastOptions, W as RpcSharedStateHost, X as DevframeRpcSharedStates, Xt as AgentTool, Y as DevframeRpcServerFunctions, Yt as AgentResourceInput, Z as DevframeServiceDefinition, Zt as AgentToolInput, _ as McpConnectionInfo, _t as ScopedServerFunctions, a as DevframeDuplicationStrategy, at as DevframeServicesRegistry, b as McpPrompt, bt as DevframeViewHost, c as DevframeSnapshotRpcEntry, ct as DevframeScopedNodeContext, d as DevframeWsOptions, dt as DevframeSettings, en as DevframeAgentHost, et as DevframeServiceInput, f as McpAuthorization, ft as DevframeSettingsRegistry, g as CreateMcpServerOptions, gt as ScopedRpcFn, h as CreateMcpFetchHandlerOptions, ht as ScopedClientFunctions, i as DevframeDockDefaults, in as EventsMap, it as DevframeServicesHost, l as DevframeSnapshotRpcInputs, lt as DevframeScopedNodeRpc, m as McpSetting, mt as ScopedBroadcastOptions, n as DevframeDefinition, nn as EventEmitter, nt as DevframeServiceOf, o as DevframeRpcOptions, ot as DevframeServicesScopeRegistry, p as McpRouteOptions, pt as DevframeSettingsStore, q as RpcStreamingHost, qt as AgentResource, r as DevframeDeploymentKind, rn as EventUnsubscribe, rt as DevframeServiceScopeOf, s as DevframeSetupInfo, st as DevframeServicesState, t as DevframeCliOptions, tn as DevframeAgentHostEvents, tt as DevframeServiceMeta, u as DevframeSseOptions, ut as DevframeScopedStreamingHost, v as McpContentBlock, vt as ScopedSharedStates, w as McpResourceTemplate, wt as DevframeDiagnosticsLogger, x as McpPromptArgument, xt as DevframeHost, y as McpFetchHandler, yt as SettingsForNamespace, z as DevframeNodeContext } from "./index-BhUqJUHG.mjs";
|
|
8
8
|
export declare const defineRpcFunction: <NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends RpcArgsSchema | undefined = undefined, const RS extends RpcReturnSchema | undefined = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeNodeContext>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeNodeContext>;
|
|
9
9
|
/**
|
|
10
10
|
* Identity helper that types a devframe definition, the primary authoring
|
|
11
11
|
* entry point. Import it from the package root: `import { defineDevframe } from 'devframe'`.
|
|
12
12
|
*/
|
|
13
13
|
export declare function defineDevframe(d: DevframeDefinition): DevframeDefinition;
|
|
14
|
-
//#endregion
|
|
15
14
|
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 CreateMcpFetchHandlerOptions, type CreateMcpServerOptions, 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 DevframeWsPeer, type EventEmitter, type EventUnsubscribe, type EventsMap, type McpAuthorization, type McpConnectionInfo, type McpContentBlock, type McpFetchHandler, type McpPrompt, type McpPromptArgument, type McpPromptMessage, type McpPromptResult, type McpResourceTemplate, type McpResourceTemplateContent, type McpResourceTemplateEntry, type McpResourcesChangedHook, type McpRouteOptions, type McpServerHandle, 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, withMcpContent };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as withMcpContent } from "./mcp-content-
|
|
2
|
-
import { t as createDefineWrapperWithContext } from "./define-
|
|
3
|
-
|
|
1
|
+
import { n as withMcpContent } from "./mcp-content-CqU8yaF7.mjs";
|
|
2
|
+
import { t as createDefineWrapperWithContext } from "./define-C8h-fyD3.mjs";
|
|
3
|
+
// src/define.ts
|
|
4
4
|
const defineRpcFunction = createDefineWrapperWithContext();
|
|
5
5
|
/**
|
|
6
6
|
* Identity helper that types a devframe definition, the primary authoring
|
|
@@ -9,5 +9,4 @@ const defineRpcFunction = createDefineWrapperWithContext();
|
|
|
9
9
|
function defineDevframe(d) {
|
|
10
10
|
return d;
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
export { defineDevframe, defineRpcFunction, withMcpContent };
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { n as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { t as diagnostics } from "./diagnostics-
|
|
1
|
+
import { n as __exportAll } from "./rolldown-runtime-BVN1G_yT.mjs";
|
|
2
|
+
import { t as diagnostics } from "./diagnostics-DC1-WcvN.mjs";
|
|
3
3
|
import { join } from "pathe";
|
|
4
4
|
import { mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
|
-
|
|
8
|
-
var instance_registry_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
-
listLiveDevframeInstances: () => listLiveDevframeInstances,
|
|
10
|
-
probeDevframeOrigin: () => probeDevframeOrigin,
|
|
11
|
-
readDevframeInstances: () => readDevframeInstances,
|
|
12
|
-
registerDevframeInstance: () => registerDevframeInstance
|
|
13
|
-
});
|
|
7
|
+
// src/node/instance-registry.ts
|
|
8
|
+
var instance_registry_exports = /* @__PURE__ */ __exportAll({ registerDevframeInstance: () => registerDevframeInstance });
|
|
14
9
|
/** Environment variable overriding the registry directory (tests, CI). */
|
|
15
10
|
const DEVFRAME_INSTANCES_DIR_ENV = "DEVFRAME_INSTANCES_DIR";
|
|
16
11
|
/** Environment variable disabling instance registration entirely. */
|
|
@@ -191,5 +186,4 @@ async function listLiveDevframeInstances(options = {}) {
|
|
|
191
186
|
pruned
|
|
192
187
|
};
|
|
193
188
|
}
|
|
194
|
-
//#endregion
|
|
195
189
|
export { registerDevframeInstance as i, listLiveDevframeInstances as n, probeDevframeOrigin as r, instance_registry_exports as t };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { r as validateOriginCandidate } from "./origin-Ck7mLbKU.mjs";
|
|
2
|
+
import { c as joinURL, d as withoutLeadingSlash, f as withoutTrailingSlash, u as withLeadingSlash } from "./_shared-CtXCQFTV.mjs";
|
|
1
3
|
import "./constants.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as diagnostics } from "./diagnostics-
|
|
4
|
-
import {
|
|
5
|
-
import { t as getInternalContext } from "./context-D_jSSdME.mjs";
|
|
6
|
-
import { n as createInteractiveAuth } from "./interactive-auth-DdDxs3WF.mjs";
|
|
4
|
+
import { n as createInteractiveAuth } from "./interactive-auth-BURwIAvE.mjs";
|
|
5
|
+
import { t as diagnostics } from "./diagnostics-DC1-WcvN.mjs";
|
|
6
|
+
import { t as getInternalContext } from "./context-BTxC4QrJ.mjs";
|
|
7
7
|
import { createServer } from "node:http";
|
|
8
8
|
import process from "node:process";
|
|
9
9
|
import { isIP } from "node:net";
|
|
10
10
|
import { Server } from "node:tls";
|
|
11
|
-
import { H3, defineHandler, toNodeHandler } from "h3";
|
|
12
|
-
|
|
11
|
+
import { H3, defineHandler, fromNodeHandler, toNodeHandler } from "h3";
|
|
12
|
+
// src/node/listen.ts
|
|
13
13
|
function listen(server, port, host) {
|
|
14
14
|
return new Promise((resolve, reject) => {
|
|
15
15
|
const onError = (error) => reject(error);
|
|
@@ -54,8 +54,7 @@ async function listenWithLoopbackTwin(server, port, host) {
|
|
|
54
54
|
throw error;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
//#region src/node/runtime.ts
|
|
57
|
+
// src/node/runtime.ts
|
|
59
58
|
/**
|
|
60
59
|
* Detect the current server runtime from its runtime-specific global. The
|
|
61
60
|
* WebSocket binding branches on this: Bun and Deno expose their sockets as
|
|
@@ -69,8 +68,7 @@ function detectServerRuntime() {
|
|
|
69
68
|
if (typeof g.Bun !== "undefined") return "bun";
|
|
70
69
|
return "node";
|
|
71
70
|
}
|
|
72
|
-
|
|
73
|
-
//#region src/node/utils.ts
|
|
71
|
+
// src/node/utils.ts
|
|
74
72
|
const NON_DIALABLE_HOSTS = /* @__PURE__ */ new Set([
|
|
75
73
|
"0.0.0.0",
|
|
76
74
|
"127.0.0.1",
|
|
@@ -90,8 +88,7 @@ function formatHostForUrl(host) {
|
|
|
90
88
|
function normalizeHttpServerUrl(host, port) {
|
|
91
89
|
return `http://${formatHostForUrl(host)}:${port}`;
|
|
92
90
|
}
|
|
93
|
-
|
|
94
|
-
//#region src/node/instance-shell.ts
|
|
91
|
+
// src/node/instance-shell.ts
|
|
95
92
|
function websocketConnectionMeta(rpcHost, path) {
|
|
96
93
|
const jsonSerializableMethods = [];
|
|
97
94
|
for (const def of rpcHost.definitions.values()) if (def.jsonSerializable === true) jsonSerializableMethods.push(def.name);
|
|
@@ -362,7 +359,7 @@ function createInstanceShell(options) {
|
|
|
362
359
|
const origin = currentOrigin();
|
|
363
360
|
if (!cfg || registerPromise || !origin || !meta) return;
|
|
364
361
|
const resolvedMeta = meta;
|
|
365
|
-
registerPromise = import("./instance-registry-
|
|
362
|
+
registerPromise = import("./instance-registry-DwmnWyCK.mjs").then((n) => n.t).then(({ registerDevframeInstance }) => {
|
|
366
363
|
let port = 0;
|
|
367
364
|
try {
|
|
368
365
|
const url = new URL(origin);
|
|
@@ -398,6 +395,29 @@ function createInstanceShell(options) {
|
|
|
398
395
|
}
|
|
399
396
|
maybeRegister();
|
|
400
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* The host stack's `next` for each in-flight `nodeMiddleware` request at
|
|
400
|
+
* base `/`, read by the fall-through middleware mounted at the end of
|
|
401
|
+
* `init()`.
|
|
402
|
+
*/
|
|
403
|
+
const hostFallthrough = /* @__PURE__ */ new WeakMap();
|
|
404
|
+
/**
|
|
405
|
+
* A devframe at `/` shares the origin root with its host, so it can't claim
|
|
406
|
+
* every path the way it owns a `/__<id>/` base. A `nodeMiddleware` request
|
|
407
|
+
* that no route answers goes to the host's `next` instead of h3's 404, so
|
|
408
|
+
* the host app (e.g. Vite with the bridge) keeps serving its own pages.
|
|
409
|
+
*/
|
|
410
|
+
function mountHostFallthrough() {
|
|
411
|
+
if (base !== "/") return;
|
|
412
|
+
app.use((event, next) => {
|
|
413
|
+
if (event.context.matchedRoute) return next();
|
|
414
|
+
const nodeReq = event.runtime?.node?.req;
|
|
415
|
+
const hostNext = nodeReq && hostFallthrough.get(nodeReq);
|
|
416
|
+
if (!hostNext) return next();
|
|
417
|
+
hostFallthrough.delete(nodeReq);
|
|
418
|
+
return fromNodeHandler((_req, _res, _next) => hostNext())(event);
|
|
419
|
+
});
|
|
420
|
+
}
|
|
401
421
|
let started;
|
|
402
422
|
let transport;
|
|
403
423
|
let dispose;
|
|
@@ -438,7 +458,7 @@ function createInstanceShell(options) {
|
|
|
438
458
|
let resolvedAuth = false;
|
|
439
459
|
let corePromise;
|
|
440
460
|
function ensureCore() {
|
|
441
|
-
corePromise ??= import("./rpc-core-
|
|
461
|
+
corePromise ??= import("./rpc-core-BmDHiDR6.mjs").then((n) => n.n).then(({ createContextRpcServer }) => createContextRpcServer({
|
|
442
462
|
context: ctx,
|
|
443
463
|
auth: resolvedAuth,
|
|
444
464
|
onPeerConnect: options.onPeerConnect,
|
|
@@ -482,7 +502,7 @@ function createInstanceShell(options) {
|
|
|
482
502
|
return nativeRuntime ? bindNativeHttpAndWs(runtime, bindOptions) : bindHttpAndWs(bindOptions);
|
|
483
503
|
};
|
|
484
504
|
if (ws.port != null) return await start(ws.port);
|
|
485
|
-
const { getPort } = await import("./dist-
|
|
505
|
+
const { getPort } = await import("./dist-CZ-TySHD.mjs").then((n) => n.t);
|
|
486
506
|
let lastError;
|
|
487
507
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
488
508
|
const port = attempt === 0 && options.resolveSidecarPort ? await options.resolveSidecarPort(sidecarHost) : await getPort({
|
|
@@ -566,6 +586,7 @@ function createInstanceShell(options) {
|
|
|
566
586
|
};
|
|
567
587
|
if (Object.keys(ctx.staticConfig).length > 0) meta.configs = ctx.staticConfig;
|
|
568
588
|
await options.mount?.(ctx, meta, api);
|
|
589
|
+
mountHostFallthrough();
|
|
569
590
|
maybeRegister();
|
|
570
591
|
}
|
|
571
592
|
const initPromise = init();
|
|
@@ -625,6 +646,7 @@ function createInstanceShell(options) {
|
|
|
625
646
|
const { toNodeHandler } = await import("h3/node");
|
|
626
647
|
nodeHandler = toNodeHandler(app);
|
|
627
648
|
}
|
|
649
|
+
if (next && base === "/") hostFallthrough.set(req, () => next());
|
|
628
650
|
return nodeHandler(req, res);
|
|
629
651
|
}).catch((err) => {
|
|
630
652
|
if (next) {
|
|
@@ -699,5 +721,4 @@ function createInstanceShell(options) {
|
|
|
699
721
|
}
|
|
700
722
|
};
|
|
701
723
|
}
|
|
702
|
-
//#endregion
|
|
703
724
|
export { isAddressInUse as a, normalizeHttpServerUrl as i, resolveInstanceRegister as n, listenWithLoopbackTwin as o, samePath as r, createInstanceShell as t };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { n as BirpcGroup } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { n as DevframeRpcConnection, t as DevframeNodeRpcSessionMeta } from "./session-
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import { H3 } from "h3";
|
|
1
|
+
import { n as BirpcGroup } from "./index-BKu9BxcT.mjs";
|
|
2
|
+
import { WsOriginRegistry } from "./rpc/transports/ws-server.mjs";
|
|
3
|
+
import { n as DevframeRpcConnection, t as DevframeNodeRpcSessionMeta } from "./session-Y9R6tqg4.mjs";
|
|
4
|
+
import { B as DevframeNodeRpcSession, J as DevframeRpcClientFunctions, P as ConnectionMeta, Y as DevframeRpcServerFunctions, d as DevframeWsOptions, k as DevframeAuthHandler, u as DevframeSseOptions, z as DevframeNodeContext } from "./index-BhUqJUHG.mjs";
|
|
5
|
+
import "./node/auth.mjs";
|
|
7
6
|
import { NodeAdapter } from "crossws/adapters/node";
|
|
8
7
|
import { Buffer } from "node:buffer";
|
|
9
8
|
import { IncomingMessage, Server, ServerResponse } from "node:http";
|
|
10
9
|
import { Duplex } from "node:stream";
|
|
11
|
-
|
|
10
|
+
import { H3 } from "h3";
|
|
12
11
|
/**
|
|
13
12
|
* One running devframe instance, as recorded in the instance registry.
|
|
14
13
|
* Records are self-describing JSON, so additive fields are safe.
|
|
@@ -111,8 +110,6 @@ declare function listLiveDevframeInstances(options?: {
|
|
|
111
110
|
live: DevframeInstanceRecord[];
|
|
112
111
|
pruned: DevframeInstanceRecord[];
|
|
113
112
|
}>;
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region src/node/instance-shell.d.ts
|
|
116
113
|
/**
|
|
117
114
|
* The live handle for a bound HTTP + WebSocket RPC server: what the
|
|
118
115
|
* side-car / shared-server tiers produce and what {@link createDevServer}
|
|
@@ -287,5 +284,4 @@ declare function samePath(a: string, b: string): boolean;
|
|
|
287
284
|
* @internal
|
|
288
285
|
*/
|
|
289
286
|
declare function createInstanceShell<TContext extends DevframeNodeContext>(options: CreateInstanceShellOptions<TContext>): InstanceShell<TContext>;
|
|
290
|
-
//#endregion
|
|
291
287
|
export { InstanceShellInit as a, StartedServer as c, samePath as d, DevframeInstanceRecord as f, registerDevframeInstance as g, probeDevframeOrigin as h, InstanceShellApi as i, createInstanceShell as l, listLiveDevframeInstances as m, InstanceRegisterConfig as n, InstanceShellInternals as o, DevframeInstanceRegistration as p, InstanceShell as r, InstanceWsTier as s, CreateInstanceShellOptions as t, resolveInstanceRegister as u };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { s as colors } from "./nostics-
|
|
2
|
-
import { n as defineRpcFunction } from "./define-BLWPsH6y.mjs";
|
|
1
|
+
import { s as colors } from "./nostics-InlX4tmd.mjs";
|
|
3
2
|
import { isAnonymousRpcMethod } from "./constants.mjs";
|
|
4
|
-
import { a as getTempAuthCodeInfo, n as describeUA, o as refreshTempAuthCode, r as exchangeTempAuthCode, s as verifyAuthToken, t as buildOtpAuthUrl } from "./state-
|
|
5
|
-
import { t as getInternalContext } from "./context-
|
|
6
|
-
|
|
3
|
+
import { a as getTempAuthCodeInfo, n as describeUA, o as refreshTempAuthCode, r as exchangeTempAuthCode, s as verifyAuthToken, t as buildOtpAuthUrl } from "./state-B_yjfeqo.mjs";
|
|
4
|
+
import { t as getInternalContext } from "./context-BTxC4QrJ.mjs";
|
|
5
|
+
import { n as defineRpcFunction } from "./define-C8h-fyD3.mjs";
|
|
6
|
+
// src/utils/simple-schema.ts
|
|
7
7
|
function ok(value) {
|
|
8
8
|
return { value };
|
|
9
9
|
}
|
|
@@ -155,8 +155,7 @@ const s = {
|
|
|
155
155
|
nullable,
|
|
156
156
|
describe
|
|
157
157
|
};
|
|
158
|
-
|
|
159
|
-
//#region src/recipes/interactive-auth.ts
|
|
158
|
+
// src/recipes/interactive-auth.ts
|
|
160
159
|
/**
|
|
161
160
|
* Build a {@link AuthBannerFunction} that renders the auth code + magic-link
|
|
162
161
|
* URL as a small bordered box, its two rows label-aligned. `createInteractiveAuth`
|
|
@@ -380,5 +379,4 @@ function createInteractiveAuth(context, options = {}) {
|
|
|
380
379
|
buildOpenUrl
|
|
381
380
|
};
|
|
382
381
|
}
|
|
383
|
-
//#endregion
|
|
384
382
|
export { createInteractiveAuth as n, createAuthBanner as t };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { a as
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
//#region src/agent/stringify.d.ts
|
|
1
|
+
import { a as resolveBasePath, i as normalizeBasePath, n as ResolvedMcpConfig, r as loadAutoMcpAdapter, s as resolveMcpConfig } from "../_shared-BxeuukaL.mjs";
|
|
2
|
+
import { t as getMcpContent } from "../mcp-content-0a0mpCL5.mjs";
|
|
3
|
+
import { t as StandardSchemaV1 } from "../index-BIRF0E5l.mjs";
|
|
4
|
+
import { i as importAgenticMcp, n as MountMcpHttpOptions, r as MountedMcpHttp, t as AgenticMcpModule } from "../agentic-DVgUzwhV.mjs";
|
|
5
|
+
import { $t as AgentToolProviderHandle, Gt as AgentHandle, Jt as AgentResourceContent, Kt as AgentManifest, Qt as AgentToolProvider, Tt as BrowserAgentClientInfo, Xt as AgentTool, Yt as AgentResourceInput, Zt as AgentToolInput, en as DevframeAgentHost$1, nn as EventEmitter, qt as AgentResource, tn as DevframeAgentHostEvents, xt as DevframeHost, z as DevframeNodeContext } from "../index-BhUqJUHG.mjs";
|
|
6
|
+
import { a as RemoteAssetsStore } from "../remote-assets-5AQMHZnV.mjs";
|
|
7
|
+
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-DTk514M9.mjs";
|
|
8
|
+
import { n as CreateContextRpcServerOptions, r as createContextRpcServer, t as ContextRpcServer } from "../rpc-core-CblgPYJ_.mjs";
|
|
9
|
+
import { g as RpcFunctionDefinitionAny } from "../types-KZOyhez5.mjs";
|
|
11
10
|
/**
|
|
12
11
|
* JSON-coercing serializer for MCP text payloads.
|
|
13
12
|
*
|
|
@@ -38,8 +37,6 @@ export declare function stringifyForMcp(value: unknown): string;
|
|
|
38
37
|
* level of `cause.message` so context isn't dropped silently.
|
|
39
38
|
*/
|
|
40
39
|
export declare function formatMcpError(error: unknown): string;
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/agent/to-json-schema.d.ts
|
|
43
40
|
/**
|
|
44
41
|
* JSON Schema for an RPC return value on the agent/MCP surface.
|
|
45
42
|
*
|
|
@@ -63,8 +60,6 @@ export declare function returnToJsonSchema(schema: StandardSchemaV1 | undefined)
|
|
|
63
60
|
* @internal
|
|
64
61
|
*/
|
|
65
62
|
export declare function argsToJsonSchema(args: readonly StandardSchemaV1[] | undefined): unknown;
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region src/node/client-agent.d.ts
|
|
68
63
|
/** Id of the built-in tool listing connected browser tabs (wire name `devframe_agent_list-clients`). */
|
|
69
64
|
export declare const LIST_CLIENTS_TOOL = "devframe:agent:list-clients";
|
|
70
65
|
/** One connected browser tab as reported by {@link LIST_CLIENTS_TOOL}. */
|
|
@@ -73,8 +68,6 @@ interface ConnectedClient extends BrowserAgentClientInfo {
|
|
|
73
68
|
connectedAt: number;
|
|
74
69
|
tools: string[];
|
|
75
70
|
}
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/node/diagnostics.d.ts
|
|
78
71
|
/**
|
|
79
72
|
* DF00xx codes are allocated across packages (e.g. @devframes/json-render
|
|
80
73
|
* owns DF0037–DF0041), so this file alone doesn't show the next free
|
|
@@ -423,8 +416,6 @@ export declare const diagnostics: import("nostics").Diagnostics<{
|
|
|
423
416
|
}, readonly [(d: import("nostics").Diagnostic, { method }?: {
|
|
424
417
|
method?: "log" | "warn" | "error";
|
|
425
418
|
}) => void], never>;
|
|
426
|
-
//#endregion
|
|
427
|
-
//#region src/node/host-agent.d.ts
|
|
428
419
|
/**
|
|
429
420
|
* Framework-neutral host aggregating the agent-exposed surface of a
|
|
430
421
|
* devframe. Auto-discovers RPC functions with an `agent` field from
|
|
@@ -459,8 +450,6 @@ export declare class DevframeAgentHost implements DevframeAgentHost$1 {
|
|
|
459
450
|
private _collectRpcTools;
|
|
460
451
|
private _findRpcDefinition;
|
|
461
452
|
}
|
|
462
|
-
//#endregion
|
|
463
|
-
//#region src/node/host-h3.d.ts
|
|
464
453
|
export interface CreateH3DevframeHostOptions {
|
|
465
454
|
/**
|
|
466
455
|
* Host the standalone server listens on, e.g. `http://localhost:9999`.
|
|
@@ -496,8 +485,6 @@ export interface CreateH3DevframeHostOptions {
|
|
|
496
485
|
* h3-backed {@link DevframeHost}, used by the standalone CLI adapter.
|
|
497
486
|
*/
|
|
498
487
|
export declare function createH3DevframeHost(options: CreateH3DevframeHostOptions): DevframeHost;
|
|
499
|
-
//#endregion
|
|
500
|
-
//#region src/node/import-runtime-module.d.ts
|
|
501
488
|
/**
|
|
502
489
|
* Resolve and import a package at runtime without adding it to a consumer's
|
|
503
490
|
* bundle graph. First-party adapters use this for modules whose code is
|
|
@@ -507,11 +494,7 @@ export declare function createH3DevframeHost(options: CreateH3DevframeHostOption
|
|
|
507
494
|
* @internal
|
|
508
495
|
*/
|
|
509
496
|
export declare function importRuntimeModule<T = unknown>(specifier: string): Promise<T>;
|
|
510
|
-
//#endregion
|
|
511
|
-
//#region src/node/utils.d.ts
|
|
512
497
|
export declare function normalizeHttpServerUrl(host: string, port: number | string): string;
|
|
513
|
-
//#endregion
|
|
514
|
-
//#region src/rpc/wire-codec.d.ts
|
|
515
498
|
/**
|
|
516
499
|
* The per-connection `serialize`/`deserialize` pair for a live RPC wire.
|
|
517
500
|
*
|
|
@@ -545,9 +528,6 @@ export declare function peekRpcWireFrame(raw: string): {
|
|
|
545
528
|
t?: string;
|
|
546
529
|
i?: string;
|
|
547
530
|
};
|
|
548
|
-
//#endregion
|
|
549
|
-
//#region src/tool-input.d.ts
|
|
550
531
|
/** Convert tool input for a command, whose arguments must be declared. */
|
|
551
532
|
export declare function toolInputToCommandArgs(input: unknown, argumentCount?: number): unknown[];
|
|
552
|
-
//#endregion
|
|
553
533
|
export { type AgenticMcpModule, type ConnectedClient, type ContextRpcServer, type CreateContextRpcServerOptions, type CreateInstanceShellOptions, type DevframeInstanceRecord, type DevframeInstanceRegistration, type InstanceRegisterConfig, type InstanceShell, type InstanceShellApi, type InstanceShellInit, type InstanceShellInternals, type InstanceWsTier, type MountMcpHttpOptions, type MountedMcpHttp, type ResolvedMcpConfig, type RpcWireCodec, type StartedServer, createContextRpcServer, createInstanceShell, getMcpContent, importAgenticMcp, listLiveDevframeInstances, loadAutoMcpAdapter, normalizeBasePath, probeDevframeOrigin, registerDevframeInstance, resolveBasePath, resolveInstanceRegister, resolveMcpConfig, samePath };
|
package/dist/internal/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as importRuntimeModule } from "../import-runtime-module-
|
|
8
|
-
import {
|
|
9
|
-
import { i as
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
|
|
1
|
+
import { a as resolveMcpConfig, n as normalizeBasePath, r as resolveBasePath, s as importAgenticMcp, t as loadAutoMcpAdapter } from "../_shared-CtXCQFTV.mjs";
|
|
2
|
+
import { t as getMcpContent } from "../mcp-content-CqU8yaF7.mjs";
|
|
3
|
+
import { t as Diagnostic } from "../nostics-InlX4tmd.mjs";
|
|
4
|
+
import { a as toolInputToCommandArgs, i as DevframeAgentHost, t as LIST_CLIENTS_TOOL } from "../client-agent-qNMgDUev.mjs";
|
|
5
|
+
import { t as diagnostics } from "../diagnostics-DC1-WcvN.mjs";
|
|
6
|
+
import { t as createH3DevframeHost } from "../host-h3-D1uj5EM8.mjs";
|
|
7
|
+
import { t as importRuntimeModule } from "../import-runtime-module-DsdqJ1gK.mjs";
|
|
8
|
+
import { i as registerDevframeInstance, n as listLiveDevframeInstances, r as probeDevframeOrigin } from "../instance-registry-DwmnWyCK.mjs";
|
|
9
|
+
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, r as samePath, t as createInstanceShell } from "../instance-shell-Coid7CP6.mjs";
|
|
10
|
+
import { t as createContextRpcServer } from "../rpc-core-BmDHiDR6.mjs";
|
|
11
|
+
import { n as peekRpcWireFrame, t as createRpcWireCodec } from "../wire-codec-BdngvzfH.mjs";
|
|
12
|
+
// src/agent/stringify.ts
|
|
13
13
|
/**
|
|
14
14
|
* JSON-coercing serializer for MCP text payloads.
|
|
15
15
|
*
|
|
@@ -82,8 +82,7 @@ function formatMcpError(error) {
|
|
|
82
82
|
const causeText = cause instanceof Error ? ` (cause: ${cause.message})` : cause !== void 0 ? ` (cause: ${String(cause)})` : "";
|
|
83
83
|
return `${error.name}: ${error.message}${causeText}`;
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
//#region src/agent/to-json-schema.ts
|
|
85
|
+
// src/agent/to-json-schema.ts
|
|
87
86
|
const FALLBACK_OBJECT_SCHEMA = Object.freeze({
|
|
88
87
|
type: "object",
|
|
89
88
|
additionalProperties: true
|
|
@@ -156,5 +155,4 @@ function argsToJsonSchema(args) {
|
|
|
156
155
|
additionalProperties: false
|
|
157
156
|
};
|
|
158
157
|
}
|
|
159
|
-
//#endregion
|
|
160
158
|
export { DevframeAgentHost, LIST_CLIENTS_TOOL, argsToJsonSchema, createContextRpcServer, createH3DevframeHost, createInstanceShell, createRpcWireCodec, diagnostics, formatMcpError, getMcpContent, importAgenticMcp, importRuntimeModule, listLiveDevframeInstances, loadAutoMcpAdapter, normalizeBasePath, normalizeHttpServerUrl, peekRpcWireFrame, probeDevframeOrigin, registerDevframeInstance, resolveBasePath, resolveInstanceRegister, resolveMcpConfig, returnToJsonSchema, samePath, stringifyForMcp, toolInputToCommandArgs };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/agent/mcp-content.d.ts
|
|
1
|
+
import { v as McpContentBlock } from "./index-BhUqJUHG.mjs";
|
|
3
2
|
/**
|
|
4
3
|
* Attach MCP content blocks to a tool result, for example an image next to
|
|
5
4
|
* its text. The MCP adapter sends these blocks as the `content` of the
|
|
@@ -21,5 +20,4 @@ declare function withMcpContent<T extends object>(value: T, content: readonly Mc
|
|
|
21
20
|
* @internal
|
|
22
21
|
*/
|
|
23
22
|
declare function getMcpContent(value: unknown): unknown;
|
|
24
|
-
//#endregion
|
|
25
23
|
export { withMcpContent as n, getMcpContent as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/agent/mcp-content.ts
|
|
2
2
|
/**
|
|
3
3
|
* Registry symbol for the content blocks attached by {@link withMcpContent}.
|
|
4
4
|
* `Symbol.for` keeps the key the same across duplicate copies of devframe.
|
|
@@ -36,5 +36,4 @@ function getMcpContent(value) {
|
|
|
36
36
|
if (value === null || typeof value !== "object") return void 0;
|
|
37
37
|
return value[MCP_CONTENT];
|
|
38
38
|
}
|
|
39
|
-
//#endregion
|
|
40
39
|
export { withMcpContent as n, getMcpContent as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../node_modules/.pnpm/mrmime@2.0.1/node_modules/mrmime/index.mjs
|
|
2
2
|
const mimes = {
|
|
3
3
|
"3g2": "video/3gpp2",
|
|
4
4
|
"3gp": "video/3gpp",
|
|
@@ -444,5 +444,4 @@ function lookup(extn) {
|
|
|
444
444
|
let idx = tmp.lastIndexOf(".");
|
|
445
445
|
return mimes[!~idx ? tmp : tmp.substring(++idx)];
|
|
446
446
|
}
|
|
447
|
-
//#endregion
|
|
448
447
|
export { lookup as t };
|
package/dist/node/auth.d.mts
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
-
import { Bt as DevframeAuthHandler } from "../
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { B as DevframeNodeRpcSession, Bt as SharedState, k as DevframeAuthHandler, z as DevframeNodeContext } from "../index-BhUqJUHG.mjs";
|
|
2
|
+
import { n as InternalAnonymousAuthStorage } from "../context-B-AARy_U.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Flip `isTrusted` to false on any live WS clients connected with `token`
|
|
5
|
+
* and broadcast the `auth:revoked` event so they can react.
|
|
6
|
+
*
|
|
7
|
+
* Shared between persisted-auth revocation and remote-dock token revocation.
|
|
8
|
+
*/
|
|
9
|
+
export declare function revokeActiveConnectionsForToken(context: DevframeNodeContext, token: string): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Revoke an auth token: remove from storage and notify all connected clients
|
|
12
|
+
* using this token that they are no longer trusted.
|
|
13
|
+
*/
|
|
14
|
+
export declare function revokeAuthToken(context: DevframeNodeContext, storage: SharedState<InternalAnonymousAuthStorage>, token: string): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Format a raw `navigator.userAgent` string into the short display label
|
|
17
|
+
* shown for a trusted device (e.g. "Chrome 120 | macOS 14 desktop").
|
|
18
|
+
*
|
|
19
|
+
* The client used to parse+format this itself, but that pulled
|
|
20
|
+
* `ua-parser-modern` into the browser bundle for a label nothing else on
|
|
21
|
+
* the client needs; the client now sends the raw string and parsing
|
|
22
|
+
* happens here, at the server ingress, keeping the persisted label format
|
|
23
|
+
* identical.
|
|
24
|
+
*/
|
|
25
|
+
export declare function describeUA(userAgent: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* The current one-time authentication code. Display this to the user (e.g. in
|
|
28
|
+
* the dev-server terminal) so they can type it into the browser to authenticate.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getTempAuthCode(): string;
|
|
31
|
+
/**
|
|
32
|
+
* The current code plus its expiry timestamp, for display (e.g. the auth
|
|
33
|
+
* banner). An already-expired code is rotated first, so the returned code is
|
|
34
|
+
* always redeemable for its remaining lifetime.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getTempAuthCodeInfo(): {
|
|
37
|
+
code: string;
|
|
38
|
+
expireAt: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Rotate the authentication code, resetting its expiry window and failed-attempt
|
|
42
|
+
* counter. Call this when a new authentication flow begins (e.g. when an
|
|
43
|
+
* untrusted client starts authenticating) so the displayed code is freshly
|
|
44
|
+
* valid for its full TTL.
|
|
45
|
+
*/
|
|
46
|
+
export declare function refreshTempAuthCode(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Build a "magic link" authentication URL that embeds a one-time code (OTP) in
|
|
49
|
+
* the URL **fragment**. Opening it authenticates the client without typing;
|
|
50
|
+
* print it on startup (devframe stays headless, so the host prints its own
|
|
51
|
+
* banner). Defaults to the current code; the link is subject to the same TTL.
|
|
52
|
+
*
|
|
53
|
+
* The code rides the fragment (`#devframe_otp=…`), not the query string, so it
|
|
54
|
+
* is never sent to the server, written to an access log, or leaked in a
|
|
55
|
+
* `Referer` header; the browser client reads it locally (see
|
|
56
|
+
* `consumeOtpFromUrl`). Any existing fragment parameters are preserved.
|
|
57
|
+
*/
|
|
58
|
+
export declare function buildOtpAuthUrl(baseUrl: string, code?: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Re-authenticate a connection that presents a previously-issued bearer token.
|
|
61
|
+
* Returns `true` and marks the session trusted when the token is known.
|
|
62
|
+
*
|
|
63
|
+
* Used by the `anonymous:devframe:auth` handler so a client that already
|
|
64
|
+
* authenticated (token persisted in the browser) is trusted on reconnect
|
|
65
|
+
* without entering the code again.
|
|
66
|
+
*/
|
|
67
|
+
export declare function verifyAuthToken(token: string, session: DevframeNodeRpcSession, storage: SharedState<InternalAnonymousAuthStorage>): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Exchange a one-time authentication code for a fresh, node-issued bearer token.
|
|
70
|
+
*
|
|
71
|
+
* On success this mints a high-entropy token, records it in the trusted store,
|
|
72
|
+
* marks the calling session trusted, rotates the code, and returns the token
|
|
73
|
+
* for the client to persist. Returns `null` on any failure.
|
|
74
|
+
*
|
|
75
|
+
* Because the code is short and human-typed, verification is hardened against
|
|
76
|
+
* brute force: it enforces a time-to-live, compares in constant time, and
|
|
77
|
+
* rotates the code after {@link TEMP_AUTH_MAX_ATTEMPTS} failed attempts so an
|
|
78
|
+
* attacker cannot keep guessing against the same code.
|
|
79
|
+
*/
|
|
80
|
+
export declare function exchangeTempAuthCode(code: string, session: DevframeNodeRpcSession, info: {
|
|
81
|
+
ua: string;
|
|
82
|
+
origin: string;
|
|
83
|
+
}, storage: SharedState<InternalAnonymousAuthStorage>): string | null;
|
|
84
|
+
export { DevframeAuthHandler };
|
package/dist/node/auth.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "../revoke-
|
|
2
|
-
import { a as getTempAuthCodeInfo, i as getTempAuthCode, n as describeUA, o as refreshTempAuthCode, r as exchangeTempAuthCode, s as verifyAuthToken, t as buildOtpAuthUrl } from "../state-
|
|
1
|
+
import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "../revoke-D6KA3vwr.mjs";
|
|
2
|
+
import { a as getTempAuthCodeInfo, i as getTempAuthCode, n as describeUA, o as refreshTempAuthCode, r as exchangeTempAuthCode, s as verifyAuthToken, t as buildOtpAuthUrl } from "../state-B_yjfeqo.mjs";
|
|
3
3
|
export { buildOtpAuthUrl, describeUA, exchangeTempAuthCode, getTempAuthCode, getTempAuthCodeInfo, refreshTempAuthCode, revokeActiveConnectionsForToken, revokeAuthToken, verifyAuthToken };
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Public surface for first-party hub adapters (`@devframes/hub` and
|
|
3
|
+
* similar). Carries the primitives a hub-kit author needs to bridge a
|
|
4
|
+
* framework dev server into a hub context: base-path resolution and
|
|
5
|
+
* the remote-dock token bridge used by the hub's docks host.
|
|
6
|
+
*
|
|
7
|
+
* Stable across minor versions; treat additions or removals as breaking
|
|
8
|
+
* only across major versions.
|
|
9
|
+
*/
|
|
10
|
+
import { a as resolveBasePath, i as normalizeBasePath } from "../_shared-BxeuukaL.mjs";
|
|
11
|
+
import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-B-AARy_U.mjs";
|
|
3
12
|
export { type DevframeInternalContext, type InternalAnonymousAuthStorage, type RemoteTokenRecord, getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as normalizeBasePath, r as resolveBasePath } from "../_shared-
|
|
2
|
-
import { n as internalContextMap, t as getInternalContext } from "../context-
|
|
1
|
+
import { n as normalizeBasePath, r as resolveBasePath } from "../_shared-CtXCQFTV.mjs";
|
|
2
|
+
import { n as internalContextMap, t as getInternalContext } from "../context-BTxC4QrJ.mjs";
|
|
3
3
|
export { getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import "../rpc/index.mjs";
|
|
2
|
+
import { g as RpcFunctionDefinitionAny } from "../types-KZOyhez5.mjs";
|
|
3
|
+
import { Bt as SharedState, H as RpcFunctionsHost, xt as DevframeHost, z as DevframeNodeContext } from "../index-BhUqJUHG.mjs";
|
|
4
|
+
import "../index-BKu9BxcT.mjs";
|
|
4
5
|
export interface CreateHostContextOptions {
|
|
5
6
|
cwd: string;
|
|
6
7
|
workspaceRoot?: string;
|
|
@@ -31,8 +32,6 @@ export interface CreateHostContextOptions {
|
|
|
31
32
|
* `commands` when mounted into Vite DevTools.
|
|
32
33
|
*/
|
|
33
34
|
export declare function createHostContext(options: CreateHostContextOptions): Promise<DevframeNodeContext>;
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/node/storage.d.ts
|
|
36
35
|
export interface CreateStorageOptions<T extends object> {
|
|
37
36
|
filepath: string;
|
|
38
37
|
initialValue: T;
|
|
@@ -40,5 +39,4 @@ export interface CreateStorageOptions<T extends object> {
|
|
|
40
39
|
debounce?: number;
|
|
41
40
|
}
|
|
42
41
|
export declare function createStorage<T extends object>(options: CreateStorageOptions<T>): SharedState<T>;
|
|
43
|
-
//#endregion
|
|
44
42
|
export type { RpcFunctionsHost };
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as createHostContext } from "../context-
|
|
2
|
-
import { t as createStorage } from "../storage-
|
|
1
|
+
import { t as createHostContext } from "../context-C5FcbWQi.mjs";
|
|
2
|
+
import { t as createStorage } from "../storage-DpJ52UB_.mjs";
|
|
3
3
|
export { createHostContext, createStorage };
|