devframe 0.9.0-beta.1 → 0.9.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{_shared-DmpWW-HH.d.mts → _shared-BPmX9fqK.d.mts} +2 -4
- package/dist/{_shared-CttmCMBi.mjs → _shared-CbZ_yhbz.mjs} +2 -4
- package/dist/adapters/build.d.mts +10 -12
- package/dist/adapters/build.mjs +26 -30
- package/dist/adapters/cac.d.mts +1 -1
- package/dist/adapters/cac.mjs +6 -7
- package/dist/adapters/dev.d.mts +22 -8
- package/dist/adapters/dev.mjs +2 -2
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/initiate.d.mts +5 -4
- package/dist/adapters/initiate.mjs +1 -1
- package/dist/adapters/mcp.d.mts +1 -8
- package/dist/adapters/mcp.mjs +1 -1
- package/dist/{agent-tool-name-C3b5vEwJ.mjs → agent-tool-name-EgfoFO8C.mjs} +0 -3
- package/dist/cli/main.d.mts +0 -2
- package/dist/cli/main.mjs +4 -8
- package/dist/client/index.d.mts +5 -5
- package/dist/client/index.mjs +24 -1179
- package/dist/constants.d.mts +10 -2
- package/dist/constants.mjs +10 -2
- package/dist/{context-CSCwoABx.d.mts → context-B3YUu_95.d.mts} +19 -1
- package/dist/{context-Du11TLcO.mjs → context-CEe4PBz1.mjs} +23 -305
- package/dist/{context-C33rR7n0.mjs → context-xdynGSLP.mjs} +10 -1
- package/dist/{dev-BEveeA5H.mjs → dev--rAPzbvO.mjs} +16 -10
- package/dist/{devframe-Bdd9YXTy.d.mts → devframe-DJMg0WLe.d.mts} +97 -113
- package/dist/{diagnostics-hwjXp_UV.mjs → diagnostics-CD8nlgll.mjs} +1 -3
- package/dist/{diagnostics-DLYH5oD3.mjs → diagnostics-DOQPnQmX.mjs} +35 -5
- package/dist/{dist-D8jAMwxU.mjs → dist-eNI9qM_I.mjs} +1 -0
- package/dist/{host-agent-CpbAoqBx.mjs → host-agent-xLCSe65D.mjs} +41 -7
- package/dist/{host-h3-CzCZwtuV.mjs → host-h3-Crkzm42q.mjs} +2 -2
- package/dist/{http-DLr_cJZ7.mjs → http-DYpK0cUi.mjs} +5 -12
- package/dist/{index-CZRd2K1C.d.mts → index-CB-fSUyn.d.mts} +2 -2
- package/dist/{index-DSCq4M4q.d.mts → index-tdrk1bzV.d.mts} +1 -1
- package/dist/index.d.mts +7 -5
- package/dist/{instance-registry-BQqGoDO9.mjs → instance-registry-WvQkt42E.mjs} +1 -7
- package/dist/{instance-shell-KRdee1QF.mjs → instance-shell-CMFyszWJ.mjs} +9 -8
- package/dist/{instance-shell-DBTXTSjN.d.mts → instance-shell-CljiKq1c.d.mts} +3 -12
- package/dist/internal/index.d.mts +265 -18
- package/dist/internal/index.mjs +9 -7
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/auth.mjs +1 -1
- package/dist/node/hub-internals.d.mts +2 -2
- package/dist/node/hub-internals.mjs +2 -2
- package/dist/node/index.d.mts +3 -3
- package/dist/node/index.mjs +2 -2
- package/dist/nostics-CzECRXpE.mjs +59 -0
- package/dist/nostics-SPGDgHEP.d.mts +33 -0
- package/dist/recipes/common-rpc-functions.d.mts +3 -3
- package/dist/recipes/interactive-auth.d.mts +2 -2
- package/dist/recipes/interactive-auth.mjs +3 -3
- package/dist/remote-assets-Bg4gCUZ_.d.mts +123 -0
- package/dist/remote-assets-nTTxY2MU.mjs +636 -0
- package/dist/rpc/dump.d.mts +1 -1
- package/dist/rpc/dump.mjs +1 -1
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/index.mjs +3 -3
- package/dist/rpc/transports/sse-client.d.mts +1 -1
- package/dist/rpc/transports/sse-client.mjs +1 -1
- package/dist/rpc/transports/sse-server.d.mts +2 -2
- package/dist/rpc/transports/sse-server.mjs +2 -2
- package/dist/rpc/transports/ws-bun.d.mts +2 -2
- package/dist/rpc/transports/ws-bun.mjs +1 -1
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +1 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +1 -1
- package/dist/{rpc-core-CGctXToO.d.mts → rpc-core-Cc4lucI0.d.mts} +3 -3
- package/dist/{rpc-core-CqcJkAu9.mjs → rpc-core-DMTe-hLo.mjs} +1 -1
- package/dist/{serialization-BHY8M5NQ.mjs → serialization-BGzEwAdr.mjs} +1 -1
- package/dist/{sse-client-BsIK3hMD.d.mts → sse-client-CFBOIaUi.d.mts} +1 -1
- package/dist/state-Cc1IeSmQ.mjs +1291 -0
- package/dist/{static-CvjkO8QE.mjs → static-BPZ1_OPA.mjs} +2 -2
- package/dist/storage-CYye7P7L.mjs +137 -0
- package/dist/types/index.d.mts +6 -4
- package/dist/{types-CnJSgRVa.d.mts → types-Djq7CBXh.d.mts} +0 -7
- package/dist/utils/agent-tool-name.d.mts +0 -3
- package/dist/utils/agent-tool-name.mjs +0 -3
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/get-port.d.mts +17 -0
- package/dist/utils/get-port.mjs +2 -0
- package/dist/utils/nostics.d.mts +2 -0
- package/dist/utils/nostics.mjs +2 -0
- package/dist/utils/open.d.mts +2 -10
- package/dist/utils/open.mjs +56 -1
- package/dist/utils/remote-assets.d.mts +15 -0
- package/dist/utils/remote-assets.mjs +2 -0
- package/dist/utils/serve-static.d.mts +13 -5
- package/dist/utils/serve-static.mjs +119 -9
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/{validation-BiuDXTKW.mjs → validation-CpXFB6Dz.mjs} +1 -1
- package/dist/{wire-codec-9VhIKnyp.mjs → wire-codec-0K-o5MYW.mjs} +1 -3
- package/dist/{ws-client-CdNuATYa.d.mts → ws-client-DhjNyQo3.d.mts} +1 -1
- package/dist/{ws-server-Bk1hOG3X.mjs → ws-server-BdSLrhxE.mjs} +1 -1
- package/dist/{ws-server-Ces08fjP.d.mts → ws-server-D1d3QM9f.d.mts} +1 -1
- package/package.json +4 -4
- package/skills/devframe/SKILL.md +10 -11
- package/dist/diagnostics-reporter-CsIG85Q5.mjs +0 -38
- package/dist/helpers/vite.d.mts +0 -104
- package/dist/helpers/vite.mjs +0 -93
- package/dist/open-Dz4V4irZ.mjs +0 -547
- package/dist/state-BeUHDDjk.mjs +0 -108
- package/dist/storage-BcmVEJRc.mjs +0 -1122
- package/skills/devframe/templates/spa-devframe.ts +0 -38
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as validateDefinitions, r as getRpcHandler, s as hash } from "./validation-
|
|
2
|
-
import { t as diagnostics } from "./diagnostics-
|
|
1
|
+
import { n as validateDefinitions, r as getRpcHandler, s as hash } from "./validation-CpXFB6Dz.mjs";
|
|
2
|
+
import { t as diagnostics } from "./diagnostics-CD8nlgll.mjs";
|
|
3
3
|
import { DEVFRAME_RPC_DUMP_DIRNAME } from "./constants.mjs";
|
|
4
4
|
//#region ../../node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.js
|
|
5
5
|
var Node = class {
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { t as diagnostics } from "./diagnostics-DOQPnQmX.mjs";
|
|
2
|
+
import { createSharedState } from "devframe/utils/shared-state";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import { dirname } from "pathe";
|
|
5
|
+
import process from "node:process";
|
|
6
|
+
//#region ../../node_modules/.pnpm/perfect-debounce@2.1.0/node_modules/perfect-debounce/dist/index.mjs
|
|
7
|
+
const DEBOUNCE_DEFAULTS = { trailing: true };
|
|
8
|
+
/**
|
|
9
|
+
Debounce functions
|
|
10
|
+
@param fn - Promise-returning/async function to debounce.
|
|
11
|
+
@param wait - Milliseconds to wait before calling `fn`. Default value is 25ms
|
|
12
|
+
@returns A function that delays calling `fn` until after `wait` milliseconds have elapsed since the last time it was called.
|
|
13
|
+
@example
|
|
14
|
+
```
|
|
15
|
+
import { debounce } from 'perfect-debounce';
|
|
16
|
+
const expensiveCall = async input => input;
|
|
17
|
+
const debouncedFn = debounce(expensiveCall, 200);
|
|
18
|
+
for (const number of [1, 2, 3]) {
|
|
19
|
+
console.log(await debouncedFn(number));
|
|
20
|
+
}
|
|
21
|
+
//=> 1
|
|
22
|
+
//=> 2
|
|
23
|
+
//=> 3
|
|
24
|
+
```
|
|
25
|
+
*/
|
|
26
|
+
function debounce(fn, wait = 25, options = {}) {
|
|
27
|
+
options = {
|
|
28
|
+
...DEBOUNCE_DEFAULTS,
|
|
29
|
+
...options
|
|
30
|
+
};
|
|
31
|
+
if (!Number.isFinite(wait)) throw new TypeError("Expected `wait` to be a finite number");
|
|
32
|
+
let leadingValue;
|
|
33
|
+
let timeout;
|
|
34
|
+
let resolveList = [];
|
|
35
|
+
let currentPromise;
|
|
36
|
+
let trailingArgs;
|
|
37
|
+
const applyFn = (_this, args) => {
|
|
38
|
+
currentPromise = _applyPromised(fn, _this, args);
|
|
39
|
+
currentPromise.finally(() => {
|
|
40
|
+
currentPromise = null;
|
|
41
|
+
if (options.trailing && trailingArgs && !timeout) {
|
|
42
|
+
const promise = applyFn(_this, trailingArgs);
|
|
43
|
+
trailingArgs = null;
|
|
44
|
+
return promise;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return currentPromise;
|
|
48
|
+
};
|
|
49
|
+
const debounced = function(...args) {
|
|
50
|
+
if (options.trailing) trailingArgs = args;
|
|
51
|
+
if (currentPromise) return currentPromise;
|
|
52
|
+
return new Promise((resolve) => {
|
|
53
|
+
const shouldCallNow = !timeout && options.leading;
|
|
54
|
+
clearTimeout(timeout);
|
|
55
|
+
timeout = setTimeout(() => {
|
|
56
|
+
timeout = null;
|
|
57
|
+
const promise = options.leading ? leadingValue : applyFn(this, args);
|
|
58
|
+
trailingArgs = null;
|
|
59
|
+
for (const _resolve of resolveList) _resolve(promise);
|
|
60
|
+
resolveList = [];
|
|
61
|
+
}, wait);
|
|
62
|
+
if (shouldCallNow) {
|
|
63
|
+
leadingValue = applyFn(this, args);
|
|
64
|
+
resolve(leadingValue);
|
|
65
|
+
} else resolveList.push(resolve);
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const _clearTimeout = (timer) => {
|
|
69
|
+
if (timer) {
|
|
70
|
+
clearTimeout(timer);
|
|
71
|
+
timeout = null;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
debounced.isPending = () => !!timeout;
|
|
75
|
+
debounced.cancel = () => {
|
|
76
|
+
_clearTimeout(timeout);
|
|
77
|
+
resolveList = [];
|
|
78
|
+
trailingArgs = null;
|
|
79
|
+
};
|
|
80
|
+
debounced.flush = () => {
|
|
81
|
+
_clearTimeout(timeout);
|
|
82
|
+
if (!trailingArgs || currentPromise) return;
|
|
83
|
+
const args = trailingArgs;
|
|
84
|
+
trailingArgs = null;
|
|
85
|
+
return applyFn(this, args);
|
|
86
|
+
};
|
|
87
|
+
return debounced;
|
|
88
|
+
}
|
|
89
|
+
async function _applyPromised(fn, _this, args) {
|
|
90
|
+
return await fn.apply(_this, args);
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/node/storage.ts
|
|
94
|
+
function safeJsonParse(text) {
|
|
95
|
+
return JSON.parse(text, (key, value) => {
|
|
96
|
+
if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) return void 0;
|
|
97
|
+
return value;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function createStorage(options) {
|
|
101
|
+
const { mergeInitialValue = (initialValue, savedValue) => ({
|
|
102
|
+
...initialValue,
|
|
103
|
+
...savedValue
|
|
104
|
+
}), debounce: debounceTime = 100 } = options;
|
|
105
|
+
let initialValue = options.initialValue;
|
|
106
|
+
if (fs.existsSync(options.filepath)) try {
|
|
107
|
+
const savedValue = safeJsonParse(fs.readFileSync(options.filepath, "utf-8"));
|
|
108
|
+
initialValue = mergeInitialValue ? mergeInitialValue(options.initialValue, savedValue) : savedValue;
|
|
109
|
+
} catch (error) {
|
|
110
|
+
diagnostics.DF0012({
|
|
111
|
+
filepath: options.filepath,
|
|
112
|
+
cause: error
|
|
113
|
+
}, { method: "warn" });
|
|
114
|
+
initialValue = options.initialValue;
|
|
115
|
+
}
|
|
116
|
+
const state = createSharedState({
|
|
117
|
+
initialValue,
|
|
118
|
+
enablePatches: false
|
|
119
|
+
});
|
|
120
|
+
state.on("updated", debounce((newState) => {
|
|
121
|
+
try {
|
|
122
|
+
const dir = dirname(options.filepath);
|
|
123
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
124
|
+
const tmp = `${options.filepath}.${process.pid}.tmp`;
|
|
125
|
+
fs.writeFileSync(tmp, `${JSON.stringify(newState, null, 2)}\n`);
|
|
126
|
+
fs.renameSync(tmp, options.filepath);
|
|
127
|
+
} catch (error) {
|
|
128
|
+
diagnostics.DF0035({
|
|
129
|
+
filepath: options.filepath,
|
|
130
|
+
cause: error
|
|
131
|
+
}, { method: "error" });
|
|
132
|
+
}
|
|
133
|
+
}, debounceTime));
|
|
134
|
+
return state;
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
export { createStorage as t };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { g as RpcFunctionAgentOptions } from "../types-
|
|
3
|
-
import { d as DevframeRpcConnection, f as DevframeRpcConnectionRequest, p as DevframeRpcTransportKind, u as DevframeNodeRpcSessionMeta } from "../ws-server-
|
|
4
|
-
|
|
1
|
+
import { A as ScopedServerFunctions, B as RpcFunctionsHost, C as DevframeScopedStreamingHost, Ct as DevframeAgentHost, D as ScopedBroadcastOptions, Dt as EventsMap, E as DevframeSettingsStore, Et as EventUnsubscribe, F as DevframeStorageScope, G as RpcStreamingHost, H as RpcSharedStateHost, I as DevframeDiagnosticsHost, J as DevframeRpcSharedStates, K as DevframeRpcClientFunctions, L as DevframeDiagnosticsLogger, M as SettingsForNamespace, N as DevframeViewHost, O as ScopedClientFunctions, P as DevframeHost, R as DevframeNodeRpcSession, S as DevframeScopedNodeRpc, St as AgentToolProviderHandle, T as DevframeSettingsRegistry, Tt as EventEmitter, U as RpcStreamingChannel, V as RpcSharedStateGetOptions, W as RpcStreamingChannelOptions, _ as DevframeServiceId, _t as AgentResourceContent, a as DevframeDuplicationStrategy, b as DevframeServicesRegistry, bt as AgentToolInput, c as DevframeWsOptions, d as ConnectionMeta, f as ConnectionMetaSse, g as DevframeNodeContext, gt as AgentResource, h as DevframeConnectionConfigsRegistry, ht as AgentManifest, i as DevframeDockDefaults, j as ScopedSharedStates, k as ScopedRpcFn, l as McpRouteOptions, m as DevframeCapabilities, mt as AgentHandle, n as DevframeDefinition, o as DevframeSetupInfo, p as ConnectionMetaWebsocket, q as DevframeRpcServerFunctions, r as DevframeDeploymentKind, s as DevframeSseOptions, t as DevframeCliOptions, v as DevframeServiceOf, vt as AgentResourceInput, w as DevframeSettings, wt as DevframeAgentHostEvents, x as DevframeScopedNodeContext, xt as AgentToolProvider, y as DevframeServicesHost, yt as AgentTool, z as RpcBroadcastOptions } from "../devframe-DJMg0WLe.mjs";
|
|
2
|
+
import { g as RpcFunctionAgentOptions } from "../types-Djq7CBXh.mjs";
|
|
3
|
+
import { d as DevframeRpcConnection, f as DevframeRpcConnectionRequest, p as DevframeRpcTransportKind, u as DevframeNodeRpcSessionMeta } from "../ws-server-D1d3QM9f.mjs";
|
|
4
|
+
import { i as DevframeDefineDiagnosticsOptions } from "../nostics-SPGDgHEP.mjs";
|
|
5
|
+
import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "../remote-assets-Bg4gCUZ_.mjs";
|
|
6
|
+
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, AgentToolProvider, AgentToolProviderHandle, ConnectionMeta, ConnectionMetaSse, ConnectionMetaWebsocket, DevframeAgentHost, DevframeAgentHostEvents, DevframeCapabilities, DevframeCliOptions, DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockDefaults, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, DevframeRpcServerFunctions, DevframeRpcSharedStates, type DevframeRpcTransportKind, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeServiceId, DevframeServiceOf, DevframeServicesHost, DevframeServicesRegistry, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, DevframeSseOptions, DevframeStorageScope, DevframeViewHost, DevframeWsOptions, EventEmitter, EventUnsubscribe, EventsMap, McpRouteOptions, RemoteAssets, RemoteAssetsErrorMessage, RemoteAssetsProvider, RemoteAssetsProviderCustom, RemoteAssetsStore, RpcBroadcastOptions, type RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedRpcFn, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, StaticAssetsSource };
|
|
@@ -24,9 +24,6 @@ type RpcFunctionType = 'static' | 'action' | 'event' | 'query';
|
|
|
24
24
|
* the function is surfaced to agents (e.g. via the devframe MCP adapter)
|
|
25
25
|
* as a callable tool. Functions without an `agent` field are not exposed —
|
|
26
26
|
* default-deny.
|
|
27
|
-
*
|
|
28
|
-
* @experimental The agent-native surface is experimental and may change
|
|
29
|
-
* without a major version bump until it stabilizes.
|
|
30
27
|
*/
|
|
31
28
|
interface RpcFunctionAgentOptions {
|
|
32
29
|
/**
|
|
@@ -233,8 +230,6 @@ type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = '
|
|
|
233
230
|
/**
|
|
234
231
|
* Expose this function to agents (e.g. via the MCP adapter).
|
|
235
232
|
* When omitted, the function is not agent-exposed (default-deny).
|
|
236
|
-
*
|
|
237
|
-
* @experimental
|
|
238
233
|
*/
|
|
239
234
|
agent?: RpcFunctionAgentOptions;
|
|
240
235
|
/** Setup function called with context to initialize handler and dump */
|
|
@@ -280,8 +275,6 @@ type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = '
|
|
|
280
275
|
/**
|
|
281
276
|
* Expose this function to agents (e.g. via the MCP adapter).
|
|
282
277
|
* When omitted, the function is not agent-exposed (default-deny).
|
|
283
|
-
*
|
|
284
|
-
* @experimental
|
|
285
278
|
*/
|
|
286
279
|
agent?: RpcFunctionAgentOptions;
|
|
287
280
|
/** Setup function called with context to initialize handler and dump */
|
|
@@ -18,9 +18,6 @@
|
|
|
18
18
|
* A plain string transform with no node dependency, so browser-side UIs
|
|
19
19
|
* that display a tool's id (e.g. the inspect plugin's agent view) can
|
|
20
20
|
* import it too and show the name a client actually calls.
|
|
21
|
-
*
|
|
22
|
-
* @experimental The agent-native surface is experimental and may change
|
|
23
|
-
* without a major version bump until it stabilizes.
|
|
24
21
|
*/
|
|
25
22
|
declare function toAgentToolName(id: string): string;
|
|
26
23
|
//#endregion
|
|
@@ -23,9 +23,6 @@ const MAX_TOOL_NAME_LENGTH = 128;
|
|
|
23
23
|
* A plain string transform with no node dependency, so browser-side UIs
|
|
24
24
|
* that display a tool's id (e.g. the inspect plugin's agent view) can
|
|
25
25
|
* import it too and show the name a client actually calls.
|
|
26
|
-
*
|
|
27
|
-
* @experimental The agent-native surface is experimental and may change
|
|
28
|
-
* without a major version bump until it stabilizes.
|
|
29
26
|
*/
|
|
30
27
|
function toAgentToolName(id) {
|
|
31
28
|
return id.replace(/[^\w-]+/g, "_").slice(0, MAX_TOOL_NAME_LENGTH);
|
package/dist/utils/events.d.mts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.d.mts
|
|
2
|
+
interface GetPortOptions {
|
|
3
|
+
name: string;
|
|
4
|
+
random: boolean;
|
|
5
|
+
port: number;
|
|
6
|
+
ports: number[];
|
|
7
|
+
portRange: [fromInclusive: number, toInclusive: number];
|
|
8
|
+
alternativePortRange: [fromInclusive: number, toInclusive: number];
|
|
9
|
+
host: string;
|
|
10
|
+
verbose?: boolean;
|
|
11
|
+
public?: boolean;
|
|
12
|
+
}
|
|
13
|
+
type GetPortInput = Partial<GetPortOptions> | number | string;
|
|
14
|
+
type PortNumber = number;
|
|
15
|
+
declare function getPort(_userOptions?: GetPortInput): Promise<PortNumber>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { type GetPortInput, type GetPortOptions, getPort };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as Diagnostic, c as DiagnosticHandle, d as Diagnostics, f as ansiFormatter, g as formatDiagnostic, h as defineProdDiagnostics, i as DevframeDefineDiagnosticsOptions, l as DiagnosticInit, m as defineDiagnostics, n as ConsoleMethod, o as DiagnosticCallParams, p as createConsoleReporter, r as ConsoleReporterOptions, s as DiagnosticDefinition, t as AnyDiagnosticReporter, u as DiagnosticReporter } from "../nostics-SPGDgHEP.mjs";
|
|
2
|
+
export { type AnyDiagnosticReporter, type ConsoleMethod, type ConsoleReporterOptions, DevframeDefineDiagnosticsOptions, type Diagnostic, type DiagnosticCallParams, type DiagnosticDefinition, type DiagnosticHandle, type DiagnosticInit, type DiagnosticReporter, type Diagnostics, ansiFormatter, createConsoleReporter, defineDiagnostics, defineProdDiagnostics, formatDiagnostic };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as defineProdDiagnostics, i as defineDiagnostics, n as ansiFormatter, o as formatDiagnostic, r as createConsoleReporter, t as Diagnostic } from "../nostics-CzECRXpE.mjs";
|
|
2
|
+
export { Diagnostic, ansiFormatter, createConsoleReporter, defineDiagnostics, defineProdDiagnostics, formatDiagnostic };
|
package/dist/utils/open.d.mts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
//#region src/utils/open.d.ts
|
|
2
|
-
interface OpenOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Resolve only after the launched app exits.
|
|
5
|
-
*
|
|
6
|
-
* @default false
|
|
7
|
-
*/
|
|
8
|
-
wait?: boolean;
|
|
9
|
-
}
|
|
10
2
|
/**
|
|
11
3
|
* Open a URL, file, or other target in its default OS handler
|
|
12
4
|
* (browser for URLs, Finder/Explorer for paths, etc.).
|
|
13
5
|
*/
|
|
14
|
-
declare function open(target: string
|
|
6
|
+
declare function open(target: string): Promise<void>;
|
|
15
7
|
//#endregion
|
|
16
|
-
export {
|
|
8
|
+
export { open };
|
package/dist/utils/open.mjs
CHANGED
|
@@ -1,2 +1,57 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import process from "node:process";
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
//#region src/utils/open.ts
|
|
5
|
+
/**
|
|
6
|
+
* Launches `command` detached from the current process and resolves once
|
|
7
|
+
* the OS has accepted the spawn (not once the launched app exits) — the
|
|
8
|
+
* same "fire and forget" behavior `open`'s default (`wait: false`) gave us.
|
|
9
|
+
*/
|
|
10
|
+
function spawnDetached(command, args) {
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
const child = spawn(command, args, {
|
|
13
|
+
detached: true,
|
|
14
|
+
stdio: "ignore",
|
|
15
|
+
windowsHide: true
|
|
16
|
+
});
|
|
17
|
+
child.once("error", reject);
|
|
18
|
+
child.once("spawn", () => {
|
|
19
|
+
child.unref();
|
|
20
|
+
resolve();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function isWsl() {
|
|
25
|
+
if (process.platform !== "linux") return false;
|
|
26
|
+
try {
|
|
27
|
+
return fs.readFileSync("/proc/version", "utf-8").toLowerCase().includes("microsoft");
|
|
28
|
+
} catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Open a URL, file, or other target in its default OS handler
|
|
34
|
+
* (browser for URLs, Finder/Explorer for paths, etc.).
|
|
35
|
+
*/
|
|
36
|
+
async function open(target) {
|
|
37
|
+
if (process.platform === "darwin") return spawnDetached("open", [target]);
|
|
38
|
+
if (process.platform === "win32") return spawnDetached("cmd", [
|
|
39
|
+
"/c",
|
|
40
|
+
"start",
|
|
41
|
+
"\"\"",
|
|
42
|
+
target
|
|
43
|
+
]);
|
|
44
|
+
if (isWsl()) try {
|
|
45
|
+
return await spawnDetached("wslview", [target]);
|
|
46
|
+
} catch {
|
|
47
|
+
return spawnDetached("cmd.exe", [
|
|
48
|
+
"/c",
|
|
49
|
+
"start",
|
|
50
|
+
"\"\"",
|
|
51
|
+
target
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
return spawnDetached("xdg-open", [target]);
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
2
57
|
export { open };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { a as RemoteAssetsStore, o as StaticAssetsSource } from "../remote-assets-Bg4gCUZ_.mjs";
|
|
2
|
+
//#region src/utils/remote-assets.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Normalize a {@link StaticAssetsSource} into something servable: a local
|
|
5
|
+
* directory (strings pass through; a remote source short-circuits to a
|
|
6
|
+
* locally installed copy of its package when present) or a caching
|
|
7
|
+
* {@link RemoteAssetsStore} back-proxy. Remote caches live under
|
|
8
|
+
* `<projectStorageDir>/.remote-assets/<package>@<version>/`.
|
|
9
|
+
*
|
|
10
|
+
* A remote source's `package`/`version` are validated first (`DF0065`) — both
|
|
11
|
+
* are interpolated into CDN URLs and the cache path.
|
|
12
|
+
*/
|
|
13
|
+
declare function resolveStaticAssetsSource(source: StaticAssetsSource, projectStorageDir: string): string | RemoteAssetsStore;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { resolveStaticAssetsSource };
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { a as RemoteAssetsStore } from "../remote-assets-Bg4gCUZ_.mjs";
|
|
1
2
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
2
3
|
import { EventHandler, H3 } from "h3";
|
|
3
4
|
//#region src/utils/serve-static.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* What the static-serving engine accepts: a local directory, or a resolved
|
|
7
|
+
* {@link RemoteAssetsStore} back-proxy (from `devframe/utils/remote-assets`).
|
|
8
|
+
*/
|
|
9
|
+
type ServableAssets = string | RemoteAssetsStore;
|
|
4
10
|
interface ServeStaticOptions {
|
|
5
11
|
/** Default: `['index.html']`. */
|
|
6
12
|
indexNames?: string[];
|
|
@@ -8,7 +14,9 @@ interface ServeStaticOptions {
|
|
|
8
14
|
single?: boolean;
|
|
9
15
|
}
|
|
10
16
|
/**
|
|
11
|
-
* h3 event handler that serves files from `
|
|
17
|
+
* h3 event handler that serves files from `source` with SPA fallback — a
|
|
18
|
+
* local directory, or a {@link RemoteAssetsStore} whose files stream through
|
|
19
|
+
* the CDN back-proxy into the local cache.
|
|
12
20
|
*
|
|
13
21
|
* Drop-in replacement for `fromNodeMiddleware(sirv(dir, { dev: true, single: true }))`
|
|
14
22
|
* when the surrounding server is an h3 app — no `Cache-Control` beyond
|
|
@@ -16,7 +24,7 @@ interface ServeStaticOptions {
|
|
|
16
24
|
* file extension falls back to `<dir>/index.html` so client-side routing
|
|
17
25
|
* works.
|
|
18
26
|
*/
|
|
19
|
-
declare function serveStaticHandler(
|
|
27
|
+
declare function serveStaticHandler(source: ServableAssets, options?: ServeStaticOptions): EventHandler;
|
|
20
28
|
/**
|
|
21
29
|
* Mount {@link serveStaticHandler} on an h3 app at `base`.
|
|
22
30
|
*
|
|
@@ -24,7 +32,7 @@ declare function serveStaticHandler(dir: string, options?: ServeStaticOptions):
|
|
|
24
32
|
* from `event.url.pathname`, so the file resolver sees paths relative to
|
|
25
33
|
* `dir`.
|
|
26
34
|
*/
|
|
27
|
-
declare function mountStaticHandler(app: H3, base: string,
|
|
35
|
+
declare function mountStaticHandler(app: H3, base: string, source: ServableAssets, options?: ServeStaticOptions): void;
|
|
28
36
|
/**
|
|
29
37
|
* Connect/Express-style Node middleware variant of {@link serveStaticHandler}.
|
|
30
38
|
*
|
|
@@ -32,6 +40,6 @@ declare function mountStaticHandler(app: H3, base: string, dir: string, options?
|
|
|
32
40
|
* Connect stack — avoids forcing the host package to depend on h3 just to
|
|
33
41
|
* adapt an event handler back into Node middleware.
|
|
34
42
|
*/
|
|
35
|
-
declare function serveStaticNodeMiddleware(
|
|
43
|
+
declare function serveStaticNodeMiddleware(source: ServableAssets, options?: ServeStaticOptions): (req: IncomingMessage, res: ServerResponse, next?: (err?: Error) => void) => void;
|
|
36
44
|
//#endregion
|
|
37
|
-
export { ServeStaticOptions, mountStaticHandler, serveStaticHandler, serveStaticNodeMiddleware };
|
|
45
|
+
export { ServableAssets, ServeStaticOptions, mountStaticHandler, serveStaticHandler, serveStaticNodeMiddleware };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { DEVFRAME_REMOTE_ASSETS_ERROR_MESSAGE_TYPE } from "../constants.mjs";
|
|
1
2
|
import { createReadStream } from "node:fs";
|
|
2
|
-
import { extname, join, normalize, resolve, sep } from "pathe";
|
|
3
3
|
import { stat } from "node:fs/promises";
|
|
4
|
-
import { H3, defineHandler } from "h3";
|
|
5
4
|
import { Readable } from "node:stream";
|
|
6
5
|
import { lookup } from "mrmime";
|
|
6
|
+
import { extname, join, normalize, resolve, sep } from "pathe";
|
|
7
|
+
import { H3, defineHandler } from "h3";
|
|
7
8
|
//#region src/utils/serve-static.ts
|
|
8
9
|
const HTML_EXTENSIONS = [".html", ".htm"];
|
|
9
10
|
async function statFile(abs) {
|
|
@@ -74,7 +75,43 @@ function normalizeOptions(options) {
|
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
77
|
-
*
|
|
78
|
+
* Drive one request through a {@link RemoteAssetsStore}: the store's
|
|
79
|
+
* `Response` on a hit, a 404 on a miss, or a 502 (styled error page for HTML
|
|
80
|
+
* navigations) on provider failure — shared between the h3 and connect flavors.
|
|
81
|
+
*/
|
|
82
|
+
async function remoteResponse(store, urlPath, accept) {
|
|
83
|
+
try {
|
|
84
|
+
return await store.serve(urlPath) ?? new Response(null, { status: 404 });
|
|
85
|
+
} catch (error) {
|
|
86
|
+
if (typeof accept === "string" && accept.includes("text/html")) return new Response(remoteErrorPage(store.assets.package, store.assets.version, error instanceof Error ? error.message : String(error)), {
|
|
87
|
+
status: 502,
|
|
88
|
+
headers: { "Content-Type": "text/html; charset=utf-8" }
|
|
89
|
+
});
|
|
90
|
+
return new Response(null, { status: 502 });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function serveRemoteAssetsHandler(store) {
|
|
94
|
+
return defineHandler(async (event) => {
|
|
95
|
+
const method = event.req.method;
|
|
96
|
+
if (method !== "GET" && method !== "HEAD") {
|
|
97
|
+
event.res.status = 405;
|
|
98
|
+
event.res.headers.set("Allow", "GET, HEAD");
|
|
99
|
+
return "";
|
|
100
|
+
}
|
|
101
|
+
const res = await remoteResponse(store, event.url.pathname, event.req.headers.get("accept"));
|
|
102
|
+
event.res.status = res.status;
|
|
103
|
+
res.headers.forEach((v, k) => event.res.headers.set(k, v));
|
|
104
|
+
if (method === "HEAD") {
|
|
105
|
+
await res.body?.cancel().catch(() => {});
|
|
106
|
+
return "";
|
|
107
|
+
}
|
|
108
|
+
return res.body ?? "";
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* h3 event handler that serves files from `source` with SPA fallback — a
|
|
113
|
+
* local directory, or a {@link RemoteAssetsStore} whose files stream through
|
|
114
|
+
* the CDN back-proxy into the local cache.
|
|
78
115
|
*
|
|
79
116
|
* Drop-in replacement for `fromNodeMiddleware(sirv(dir, { dev: true, single: true }))`
|
|
80
117
|
* when the surrounding server is an h3 app — no `Cache-Control` beyond
|
|
@@ -82,8 +119,9 @@ function normalizeOptions(options) {
|
|
|
82
119
|
* file extension falls back to `<dir>/index.html` so client-side routing
|
|
83
120
|
* works.
|
|
84
121
|
*/
|
|
85
|
-
function serveStaticHandler(
|
|
86
|
-
|
|
122
|
+
function serveStaticHandler(source, options) {
|
|
123
|
+
if (typeof source !== "string") return serveRemoteAssetsHandler(source);
|
|
124
|
+
const absDir = resolve(source);
|
|
87
125
|
const opts = normalizeOptions(options);
|
|
88
126
|
return defineHandler(async (event) => {
|
|
89
127
|
const method = event.req.method;
|
|
@@ -109,9 +147,9 @@ function serveStaticHandler(dir, options) {
|
|
|
109
147
|
* from `event.url.pathname`, so the file resolver sees paths relative to
|
|
110
148
|
* `dir`.
|
|
111
149
|
*/
|
|
112
|
-
function mountStaticHandler(app, base,
|
|
150
|
+
function mountStaticHandler(app, base, source, options) {
|
|
113
151
|
const staticApp = new H3();
|
|
114
|
-
staticApp.use(serveStaticHandler(
|
|
152
|
+
staticApp.use(serveStaticHandler(source, options));
|
|
115
153
|
app.mount(base.replace(/\/$/, ""), staticApp);
|
|
116
154
|
}
|
|
117
155
|
/**
|
|
@@ -121,8 +159,8 @@ function mountStaticHandler(app, base, dir, options) {
|
|
|
121
159
|
* Connect stack — avoids forcing the host package to depend on h3 just to
|
|
122
160
|
* adapt an event handler back into Node middleware.
|
|
123
161
|
*/
|
|
124
|
-
function serveStaticNodeMiddleware(
|
|
125
|
-
const absDir = resolve(
|
|
162
|
+
function serveStaticNodeMiddleware(source, options) {
|
|
163
|
+
const absDir = typeof source === "string" ? resolve(source) : void 0;
|
|
126
164
|
const opts = normalizeOptions(options);
|
|
127
165
|
return (req, res, next) => {
|
|
128
166
|
(async () => {
|
|
@@ -138,6 +176,22 @@ function serveStaticNodeMiddleware(dir, options) {
|
|
|
138
176
|
return;
|
|
139
177
|
}
|
|
140
178
|
const url = req.url ?? "/";
|
|
179
|
+
if (absDir === void 0) {
|
|
180
|
+
const response = await remoteResponse(source, url, req.headers.accept);
|
|
181
|
+
if (response.status === 404 && next) {
|
|
182
|
+
next();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
res.statusCode = response.status;
|
|
186
|
+
response.headers.forEach((v, k) => res.setHeader(k, v));
|
|
187
|
+
if (method === "HEAD" || !response.body) {
|
|
188
|
+
await response.body?.cancel().catch(() => {});
|
|
189
|
+
res.end();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
Readable.fromWeb(response.body).pipe(res);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
141
195
|
const file = await resolveTarget(absDir, url, opts.indexNames, opts.single);
|
|
142
196
|
if (!file) {
|
|
143
197
|
if (next) {
|
|
@@ -164,5 +218,61 @@ function serveStaticNodeMiddleware(dir, options) {
|
|
|
164
218
|
});
|
|
165
219
|
};
|
|
166
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* Minimal, dependency-free HTML shown when a remote-assets request cannot
|
|
223
|
+
* be satisfied (no installed package, no cache, provider unreachable).
|
|
224
|
+
*
|
|
225
|
+
* The page stands on its own when a devframe is opened directly, and
|
|
226
|
+
* announces itself over `postMessage` when it loads inside a viewer's iframe
|
|
227
|
+
* ({@link DEVFRAME_REMOTE_ASSETS_ERROR_MESSAGE_TYPE}) so the viewer can show
|
|
228
|
+
* the same failure in its own UI instead.
|
|
229
|
+
*/
|
|
230
|
+
function remoteErrorPage(pkg, version, reason) {
|
|
231
|
+
const esc = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
232
|
+
const name = esc(pkg);
|
|
233
|
+
const ver = esc(version);
|
|
234
|
+
const payload = JSON.stringify({
|
|
235
|
+
type: DEVFRAME_REMOTE_ASSETS_ERROR_MESSAGE_TYPE,
|
|
236
|
+
package: pkg,
|
|
237
|
+
version,
|
|
238
|
+
reason
|
|
239
|
+
}).replace(/</g, "\\u003c");
|
|
240
|
+
return `<!doctype html>
|
|
241
|
+
<html lang="en">
|
|
242
|
+
<head>
|
|
243
|
+
<meta charset="utf-8">
|
|
244
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
245
|
+
<title>Client assets unavailable</title>
|
|
246
|
+
<style>
|
|
247
|
+
:root { color-scheme: light dark; }
|
|
248
|
+
body { margin: 0; min-height: 100vh; display: grid; place-items: center; font: 14px/1.6 ui-sans-serif, system-ui, sans-serif; background: #fafafa; color: #27272a; }
|
|
249
|
+
main { max-width: 32rem; padding: 2rem; }
|
|
250
|
+
h1 { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; }
|
|
251
|
+
p { margin: .5rem 0; opacity: .8; }
|
|
252
|
+
pre { font: 12px/1.6 ui-monospace, monospace; background: rgb(125 125 125 / .12); border-radius: 6px; padding: .75rem 1rem; overflow-x: auto; }
|
|
253
|
+
button { font: inherit; padding: .35rem 1rem; border-radius: 6px; border: 1px solid rgb(125 125 125 / .3); background: transparent; color: inherit; cursor: pointer; }
|
|
254
|
+
button:hover { background: rgb(125 125 125 / .08); }
|
|
255
|
+
.muted { opacity: .55; font-size: 12px; }
|
|
256
|
+
@media (prefers-color-scheme: dark) { body { background: #111; color: #d4d4d8; } }
|
|
257
|
+
</style>
|
|
258
|
+
</head>
|
|
259
|
+
<body>
|
|
260
|
+
<main>
|
|
261
|
+
<h1>Client assets unavailable</h1>
|
|
262
|
+
<p>The UI for this tool is served from <code>${name}@${ver}</code>, which could not be reached.</p>
|
|
263
|
+
<pre>${esc(reason)}</pre>
|
|
264
|
+
<p>To use it without network access, install the assets package locally:</p>
|
|
265
|
+
<pre>npm install ${name}@${ver}</pre>
|
|
266
|
+
<button onclick="location.reload()">Retry</button>
|
|
267
|
+
<p class="muted">devframe remote assets</p>
|
|
268
|
+
</main>
|
|
269
|
+
<script>
|
|
270
|
+
if (window.parent !== window)
|
|
271
|
+
window.parent.postMessage(${payload}, '*')
|
|
272
|
+
<\/script>
|
|
273
|
+
</body>
|
|
274
|
+
</html>
|
|
275
|
+
`;
|
|
276
|
+
}
|
|
167
277
|
//#endregion
|
|
168
278
|
export { mountStaticHandler, serveStaticHandler, serveStaticNodeMiddleware };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as ImmutableArray, ct as ImmutableSet, dt as SharedStateOptions, ft as SharedStatePatch, it as Immutable, lt as SharedState, ot as ImmutableMap, pt as createSharedState, st as ImmutableObject, ut as SharedStateEvents } from "../devframe-DJMg0WLe.mjs";
|
|
2
2
|
export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as StreamReader, Q as StreamErrorPayload, X as CreateStreamReaderOptions, Y as BufferedChunk, Z as CreateStreamSinkOptions, et as StreamSink, nt as createStreamReader, rt as createStreamSink, tt as StreamSinkEvents } from "../devframe-DJMg0WLe.mjs";
|
|
2
2
|
export { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as diagnostics } from "./diagnostics-
|
|
1
|
+
import { t as diagnostics } from "./diagnostics-CD8nlgll.mjs";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
//#region ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/shared/ohash.D__AXeF1.mjs
|
|
4
4
|
function serialize(o) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as strictJsonStringify } from "./serialization-
|
|
1
|
+
import { n as strictJsonStringify } from "./serialization-BGzEwAdr.mjs";
|
|
2
2
|
import { n as structuredCloneStringify, t as structuredCloneParse } from "./structured-clone-CbAV5rFI.mjs";
|
|
3
3
|
//#region src/rpc/wire-codec.ts
|
|
4
4
|
const EMPTY_WIRE_DEFS = /* @__PURE__ */ new Map();
|
|
@@ -12,7 +12,6 @@ const EMPTY_WIRE_DEFS = /* @__PURE__ */ new Map();
|
|
|
12
12
|
* don't collide across connections.
|
|
13
13
|
*
|
|
14
14
|
* @internal
|
|
15
|
-
* implementations; not part of the stable public API.
|
|
16
15
|
*/
|
|
17
16
|
function createRpcWireCodec(definitions = EMPTY_WIRE_DEFS) {
|
|
18
17
|
const pendingRequestMethods = /* @__PURE__ */ new Map();
|
|
@@ -41,7 +40,6 @@ function createRpcWireCodec(definitions = EMPTY_WIRE_DEFS) {
|
|
|
41
40
|
* handed to birpc proper.
|
|
42
41
|
*
|
|
43
42
|
* @internal
|
|
44
|
-
* implementations; not part of the stable public API.
|
|
45
43
|
*/
|
|
46
44
|
function peekRpcWireFrame(raw) {
|
|
47
45
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./constants.mjs";
|
|
2
|
-
import { t as createRpcWireCodec } from "./wire-codec-
|
|
2
|
+
import { t as createRpcWireCodec } from "./wire-codec-0K-o5MYW.mjs";
|
|
3
3
|
import { n as randomToken, r as timingSafeEqual } from "./crypto-token-XCqTSMg9.mjs";
|
|
4
4
|
import { createServer } from "node:http";
|
|
5
5
|
import { createServer as createServer$1 } from "node:https";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as RpcFunctionDefinitionAny } from "./types-
|
|
1
|
+
import { v as RpcFunctionDefinitionAny } from "./types-Djq7CBXh.mjs";
|
|
2
2
|
import { BirpcGroup, ChannelOptions } from "birpc";
|
|
3
3
|
import { Hooks, Peer } from "crossws";
|
|
4
4
|
import { NodeAdapter } from "crossws/adapters/node";
|