devframe 0.1.20 → 0.1.22
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/README.md +41 -18
- package/dist/{_shared-S-Ujqz_L.mjs → _shared-DcJX9-Az.mjs} +4 -4
- package/dist/adapters/build.d.mts +7 -7
- package/dist/adapters/build.mjs +15 -14
- package/dist/adapters/cli.d.mts +2 -2
- package/dist/adapters/cli.mjs +5 -5
- package/dist/adapters/dev.d.mts +18 -9
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +6 -6
- package/dist/adapters/embedded.mjs +3 -3
- package/dist/adapters/mcp.d.mts +3 -3
- package/dist/adapters/mcp.mjs +6 -5
- package/dist/adapters/vite.d.mts +46 -12
- package/dist/adapters/vite.mjs +81 -17
- package/dist/chunk-e9Ob2GDo.mjs +26 -0
- package/dist/client/index.d.mts +19 -144
- package/dist/client/index.mjs +20 -20
- package/dist/colors-Bl4W18Mh.mjs +123 -0
- package/dist/constants.d.mts +12 -15
- package/dist/constants.mjs +12 -29
- package/dist/context-DBd794Rn.d.mts +51 -0
- package/dist/context-DUibxhrR.mjs +1034 -0
- package/dist/{dev-B8i_CBlQ.mjs → dev-BGpTpYiR.mjs} +20 -21
- package/dist/{devtool-Bm6zZAw5.d.mts → devframe-DulcIxwu.d.mts} +59 -569
- package/dist/diagnostics-BFhNNmST.mjs +56 -0
- package/dist/hash-BHZbo80D.mjs +126 -0
- package/dist/{human-id-CHS0s28X.mjs → human-id-adtUWQLr.mjs} +12 -4
- package/dist/{index-BCo03GEF.d.mts → index-DB2Ie0Or.d.mts} +2 -3
- package/dist/index.d.mts +4 -6
- package/dist/index.mjs +2 -8
- package/dist/launch-editor-KA_21J1T.mjs +581 -0
- package/dist/node/auth.d.mts +44 -0
- package/dist/node/auth.mjs +55 -0
- package/dist/node/index.d.mts +14 -187
- package/dist/node/index.mjs +6 -61
- package/dist/node/internal.d.mts +16 -0
- package/dist/node/internal.mjs +50 -0
- package/dist/{open-BtOOEldu.mjs → open-DmFp0qZA.mjs} +15 -6
- package/dist/recipes/open-helpers.d.mts +4 -9
- package/dist/recipes/open-helpers.mjs +7 -12
- package/dist/revoke-DIMz1r7-.mjs +35 -0
- package/dist/rpc/index.d.mts +3 -3
- package/dist/rpc/index.mjs +4 -4
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +2 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +2 -1
- package/dist/{rpc-INbWfHoX.mjs → rpc-CkZuoz-m.mjs} +3 -2
- package/dist/{serialization-DwKi05Pn.mjs → serialization-CwO31axa.mjs} +1 -2
- package/dist/{server-qRRM8t3v.mjs → server-ma8-ZVyX.mjs} +1 -1
- package/dist/{server-DksyT-um.d.mts → server-zKEDxgqD.d.mts} +4 -3
- package/dist/shared-state-DCDs0e7y.mjs +928 -0
- package/dist/{static-dump-C1aVSwxY.mjs → static-dump-D7AvjrgL.mjs} +1 -1
- package/dist/storage-CNC38eU-.mjs +117 -0
- package/dist/structured-clone-DcDc2Dds.mjs +221 -0
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.mjs +11 -2
- package/dist/utils/colors.d.mts +28 -0
- package/dist/utils/colors.mjs +2 -0
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/hash.d.mts +7 -0
- package/dist/utils/hash.mjs +2 -0
- package/dist/utils/human-id.d.mts +6 -8
- package/dist/utils/human-id.mjs +1 -2
- package/dist/utils/launch-editor.d.mts +13 -0
- package/dist/utils/launch-editor.mjs +2 -0
- package/dist/utils/open.d.mts +16 -0
- package/dist/utils/open.mjs +2 -0
- package/dist/utils/serve-static.d.mts +30 -0
- package/dist/utils/serve-static.mjs +152 -0
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -35
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/structured-clone.d.mts +21 -0
- package/dist/utils/structured-clone.mjs +2 -0
- package/dist/utils/when.d.mts +384 -2
- package/dist/utils/when.mjs +20 -2
- package/dist/{ws-client-DQySVfF_.d.mts → ws-client-Bavoya6-.d.mts} +1 -1
- package/dist/{ws-server-VQqESKAs.d.mts → ws-server-DjvlwLuM.d.mts} +1 -1
- package/package.json +23 -13
- package/skills/devframe/SKILL.md +93 -117
- package/skills/devframe/templates/{counter-devtool.ts → counter-devframe.ts} +5 -10
- package/skills/devframe/templates/{spa-devtool.ts → spa-devframe.ts} +5 -10
- package/skills/devframe/templates/vite-client.ts +2 -2
- package/dist/adapters/kit.d.mts +0 -23
- package/dist/adapters/kit.mjs +0 -16
- package/dist/context-BfvbAyGk.mjs +0 -7215
- package/dist/main-DpINGndA.mjs +0 -601
- package/dist/utils/state.d.mts +0 -50
- package/dist/utils/state.mjs +0 -26
- package/dist/when-aBBXAEh5.d.mts +0 -401
- package/dist/{define-Bb4zh-Dc.mjs → define-CW9gLnyG.mjs} +0 -0
- package/dist/{host-h3-BMvrFzIJ.mjs → host-h3-Dz8YnFgu.mjs} +2 -2
- /package/dist/{transports-BPUzHhI2.mjs → transports-BnCs4rj9.mjs} +0 -0
- /package/dist/{types-ag029cAe.d.mts → types-4rdUEi2R.d.mts} +0 -0
package/dist/node/index.d.mts
CHANGED
|
@@ -1,100 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { g as RpcFunctionDefinitionAny } from "../types-
|
|
4
|
-
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-
|
|
5
|
-
import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-
|
|
1
|
+
import { D as RpcStreamingHost, H as SharedState, Q as DevToolsRpcServerFunctions, S as RpcFunctionsHost$1, Z as DevToolsRpcClientFunctions, at as AgentManifest, b as DevToolsNodeRpcSession, ct as AgentResourceInput, dt as DevToolsAgentHost$1, et as DevToolsHost, ft as DevToolsAgentHostEvents, it as AgentHandle, lt as AgentTool, nt as DevToolsDiagnosticsHost$1, ot as AgentResource, pt as EventEmitter, q as DevToolsViewHost$1, rt as DevToolsDiagnosticsLogger, st as AgentResourceContent, ut as AgentToolInput, w as RpcSharedStateHost, x as RpcBroadcastOptions, y as DevToolsNodeContext } from "../devframe-DulcIxwu.mjs";
|
|
2
|
+
import { f as RpcFunctionsCollectorBase } from "../index-DB2Ie0Or.mjs";
|
|
3
|
+
import { g as RpcFunctionDefinitionAny } from "../types-4rdUEi2R.mjs";
|
|
4
|
+
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-DjvlwLuM.mjs";
|
|
5
|
+
import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-zKEDxgqD.mjs";
|
|
6
6
|
import { createLogger, defineDiagnostics } from "logs-sdk";
|
|
7
7
|
import { BirpcGroup } from "birpc";
|
|
8
8
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
9
9
|
|
|
10
|
-
//#region src/node/context-internal.d.ts
|
|
11
|
-
interface InternalAnonymousAuthStorage {
|
|
12
|
-
trusted: Record<string, {
|
|
13
|
-
authToken: string;
|
|
14
|
-
ua: string;
|
|
15
|
-
origin: string;
|
|
16
|
-
timestamp: number;
|
|
17
|
-
} | undefined>;
|
|
18
|
-
}
|
|
19
|
-
interface RemoteTokenRecord {
|
|
20
|
-
dockId: string;
|
|
21
|
-
/** Dock URL origin — matched against WS handshake `Origin` header when `originLock` is on. */
|
|
22
|
-
origin: string;
|
|
23
|
-
originLock: boolean;
|
|
24
|
-
}
|
|
25
|
-
interface DevToolsInternalContext {
|
|
26
|
-
storage: {
|
|
27
|
-
auth: SharedState<InternalAnonymousAuthStorage>;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Revoke an auth token: remove from storage and notify all connected clients
|
|
31
|
-
* using this token that they are no longer trusted.
|
|
32
|
-
*/
|
|
33
|
-
revokeAuthToken: (token: string) => Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Session-only tokens issued to remote-UI iframe docks. Not persisted —
|
|
36
|
-
* regenerated on every dev-server restart.
|
|
37
|
-
*/
|
|
38
|
-
remoteTokens: Map<string, RemoteTokenRecord>;
|
|
39
|
-
allocateRemoteToken: (dockId: string, origin: string, originLock: boolean) => string;
|
|
40
|
-
revokeRemoteToken: (token: string) => void;
|
|
41
|
-
revokeRemoteTokensForDock: (dockId: string) => void;
|
|
42
|
-
/**
|
|
43
|
-
* Returns true if `token` is a valid remote token and, when `originLock` is
|
|
44
|
-
* on, `requestOrigin` matches the recorded dock origin.
|
|
45
|
-
*/
|
|
46
|
-
isRemoteTokenTrusted: (token: string, requestOrigin?: string) => boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Populated by `createWsServer` once the WS port is bound. Consumed by the
|
|
49
|
-
* docks host when enriching remote iframe URLs with a connection descriptor.
|
|
50
|
-
*/
|
|
51
|
-
wsEndpoint?: {
|
|
52
|
-
/** Full `ws://` or `wss://` URL with host and port. */url: string;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
declare const internalContextMap: WeakMap<DevToolsNodeContext, DevToolsInternalContext>;
|
|
56
|
-
declare function getInternalContext(context: DevToolsNodeContext): DevToolsInternalContext;
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region src/node/auth-revoke.d.ts
|
|
59
|
-
/**
|
|
60
|
-
* Flip `isTrusted` to false on any live WS clients connected with `token`
|
|
61
|
-
* and broadcast the `auth:revoked` event so they can react.
|
|
62
|
-
*
|
|
63
|
-
* Shared between persisted-auth revocation and remote-dock token revocation.
|
|
64
|
-
*/
|
|
65
|
-
declare function revokeActiveConnectionsForToken(context: DevToolsNodeContext, token: string): Promise<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Revoke an auth token: remove from storage and notify all connected clients
|
|
68
|
-
* using this token that they are no longer trusted.
|
|
69
|
-
*/
|
|
70
|
-
declare function revokeAuthToken(context: DevToolsNodeContext, storage: SharedState<InternalAnonymousAuthStorage>, token: string): Promise<void>;
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/node/auth-state.d.ts
|
|
73
|
-
interface PendingAuthRequest {
|
|
74
|
-
clientAuthToken: string;
|
|
75
|
-
session: DevToolsNodeRpcSession;
|
|
76
|
-
ua: string;
|
|
77
|
-
origin: string;
|
|
78
|
-
resolve: (result: {
|
|
79
|
-
isTrusted: boolean;
|
|
80
|
-
}) => void;
|
|
81
|
-
abortController: AbortController;
|
|
82
|
-
timeout: ReturnType<typeof setTimeout>;
|
|
83
|
-
}
|
|
84
|
-
declare function getTempAuthToken(): string;
|
|
85
|
-
declare function refreshTempAuthToken(): string;
|
|
86
|
-
declare function getPendingAuth(): PendingAuthRequest | null;
|
|
87
|
-
declare function setPendingAuth(request: PendingAuthRequest | null): void;
|
|
88
|
-
/**
|
|
89
|
-
* Abort and clean up any existing pending auth request.
|
|
90
|
-
*/
|
|
91
|
-
declare function abortPendingAuth(): void;
|
|
92
|
-
/**
|
|
93
|
-
* Consume the temp auth ID: verify it matches, trust the pending client, and clean up.
|
|
94
|
-
* Returns the client's authToken if successful, null otherwise.
|
|
95
|
-
*/
|
|
96
|
-
declare function consumeTempAuthToken(id: string, storage: SharedState<InternalAnonymousAuthStorage>): string | null;
|
|
97
|
-
//#endregion
|
|
98
10
|
//#region src/node/context.d.ts
|
|
99
11
|
interface CreateHostContextOptions {
|
|
100
12
|
cwd: string;
|
|
@@ -109,23 +21,20 @@ interface CreateHostContextOptions {
|
|
|
109
21
|
builtinRpcDeclarations?: readonly RpcFunctionDefinitionAny[];
|
|
110
22
|
}
|
|
111
23
|
/**
|
|
112
|
-
* Framework-neutral core of the DevTools node context. Wires the
|
|
113
|
-
* host
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
24
|
+
* Framework-neutral core of the DevTools node context. Wires the RPC
|
|
25
|
+
* host, view (HTTP file-serving) host, diagnostics, and agent
|
|
26
|
+
* subsystems. Hub-level subsystems (`docks`, `terminals`, `messages`,
|
|
27
|
+
* `commands`, `createJsonRenderer`) are owned by
|
|
28
|
+
* `@vitejs/devtools-kit` — its `createKitContext` wraps this and
|
|
29
|
+
* attaches them when the devframe is mounted into a multi-integration
|
|
30
|
+
* hub.
|
|
117
31
|
*/
|
|
118
32
|
declare function createHostContext(options: CreateHostContextOptions): Promise<DevToolsNodeContext>;
|
|
119
33
|
//#endregion
|
|
120
|
-
//#region src/node/context-utils.d.ts
|
|
121
|
-
declare const ContextUtils: {
|
|
122
|
-
createSimpleClientScript(fn: string | ((ctx: any) => void)): ClientScriptEntry;
|
|
123
|
-
};
|
|
124
|
-
//#endregion
|
|
125
34
|
//#region src/node/host-agent.d.ts
|
|
126
35
|
/**
|
|
127
36
|
* Framework-neutral host aggregating the agent-exposed surface of a
|
|
128
|
-
*
|
|
37
|
+
* devframe. Auto-discovers RPC functions with an `agent` field from
|
|
129
38
|
* `ctx.rpc.definitions`, and accepts plugin-registered tools /
|
|
130
39
|
* resources via `registerTool` / `registerResource`.
|
|
131
40
|
*
|
|
@@ -156,20 +65,6 @@ declare class DevToolsAgentHost implements DevToolsAgentHost$1 {
|
|
|
156
65
|
private _coercePositionalArgs;
|
|
157
66
|
}
|
|
158
67
|
//#endregion
|
|
159
|
-
//#region src/node/host-commands.d.ts
|
|
160
|
-
declare class DevToolsCommandsHost implements DevToolsCommandsHost$1 {
|
|
161
|
-
readonly context: DevToolsNodeContext;
|
|
162
|
-
readonly commands: DevToolsCommandsHost$1['commands'];
|
|
163
|
-
readonly events: DevToolsCommandsHost$1['events'];
|
|
164
|
-
constructor(context: DevToolsNodeContext);
|
|
165
|
-
register(command: DevToolsServerCommandInput): DevToolsCommandHandle;
|
|
166
|
-
unregister(id: string): boolean;
|
|
167
|
-
execute(id: string, ...args: any[]): Promise<unknown>;
|
|
168
|
-
list(): DevToolsServerCommandEntry[];
|
|
169
|
-
private findCommand;
|
|
170
|
-
private toSerializable;
|
|
171
|
-
}
|
|
172
|
-
//#endregion
|
|
173
68
|
//#region src/node/host-diagnostics.d.ts
|
|
174
69
|
declare class DevToolsDiagnosticsHost implements DevToolsDiagnosticsHost$1 {
|
|
175
70
|
readonly context: DevToolsNodeContext;
|
|
@@ -183,30 +78,6 @@ declare class DevToolsDiagnosticsHost implements DevToolsDiagnosticsHost$1 {
|
|
|
183
78
|
private _rebuild;
|
|
184
79
|
}
|
|
185
80
|
//#endregion
|
|
186
|
-
//#region src/node/host-docks.d.ts
|
|
187
|
-
declare class DevToolsDockHost implements DevToolsDockHost$1 {
|
|
188
|
-
readonly context: DevToolsNodeContext;
|
|
189
|
-
readonly views: DevToolsDockHost$1['views'];
|
|
190
|
-
readonly events: DevToolsDockHost$1['events'];
|
|
191
|
-
userSettings: SharedState<DevToolsDocksUserSettings>;
|
|
192
|
-
/** Dock-id → allocated remote token + resolved options. */
|
|
193
|
-
private readonly remoteDocks;
|
|
194
|
-
constructor(context: DevToolsNodeContext);
|
|
195
|
-
init(): Promise<void>;
|
|
196
|
-
values({
|
|
197
|
-
includeBuiltin
|
|
198
|
-
}?: {
|
|
199
|
-
includeBuiltin?: boolean;
|
|
200
|
-
}): DevToolsDockEntry[];
|
|
201
|
-
private projectView;
|
|
202
|
-
private resolveDevServerOrigin;
|
|
203
|
-
register<T extends DevToolsDockUserEntry>(view: T, force?: boolean): {
|
|
204
|
-
update: (patch: Partial<T>) => void;
|
|
205
|
-
};
|
|
206
|
-
update(view: DevToolsDockUserEntry): void;
|
|
207
|
-
private prepareRemoteRegistration;
|
|
208
|
-
}
|
|
209
|
-
//#endregion
|
|
210
81
|
//#region src/node/host-functions.d.ts
|
|
211
82
|
declare class RpcFunctionsHost extends RpcFunctionsCollectorBase<DevToolsRpcServerFunctions, DevToolsNodeContext> implements RpcFunctionsHost$1 {
|
|
212
83
|
/**
|
|
@@ -264,50 +135,6 @@ interface CreateH3DevToolsHostOptions {
|
|
|
264
135
|
*/
|
|
265
136
|
declare function createH3DevToolsHost(options: CreateH3DevToolsHostOptions): DevToolsHost;
|
|
266
137
|
//#endregion
|
|
267
|
-
//#region src/node/host-messages.d.ts
|
|
268
|
-
declare class DevToolsMessagesHost implements DevToolsMessagesHost$1 {
|
|
269
|
-
readonly context: DevToolsNodeContext;
|
|
270
|
-
readonly entries: DevToolsMessagesHost$1['entries'];
|
|
271
|
-
readonly events: DevToolsMessagesHost$1['events'];
|
|
272
|
-
/** Tracks when each entry was last added or updated (monotonic) */
|
|
273
|
-
readonly lastModified: Map<string, number>;
|
|
274
|
-
/** Tracks recently removed entry IDs with their removal time */
|
|
275
|
-
readonly removals: Array<{
|
|
276
|
-
id: string;
|
|
277
|
-
time: number;
|
|
278
|
-
}>;
|
|
279
|
-
private _autoDeleteTimers;
|
|
280
|
-
private _clock;
|
|
281
|
-
private _tick;
|
|
282
|
-
constructor(context: DevToolsNodeContext);
|
|
283
|
-
add(input: DevToolsMessageEntryInput): Promise<DevToolsMessageHandle>;
|
|
284
|
-
update(id: string, patch: Partial<DevToolsMessageEntryInput>): Promise<DevToolsMessageEntry | undefined>;
|
|
285
|
-
remove(id: string): Promise<void>;
|
|
286
|
-
clear(): Promise<void>;
|
|
287
|
-
private _createHandle;
|
|
288
|
-
}
|
|
289
|
-
//#endregion
|
|
290
|
-
//#region src/node/host-terminals.d.ts
|
|
291
|
-
declare class DevToolsTerminalHost implements DevToolsTerminalHost$1 {
|
|
292
|
-
readonly context: DevToolsNodeContext;
|
|
293
|
-
readonly sessions: DevToolsTerminalHost$1['sessions'];
|
|
294
|
-
readonly events: DevToolsTerminalHost$1['events'];
|
|
295
|
-
private _boundStreams;
|
|
296
|
-
private _channel?;
|
|
297
|
-
constructor(context: DevToolsNodeContext);
|
|
298
|
-
/**
|
|
299
|
-
* Lazily acquire the streaming channel — `context.rpc` isn't assigned
|
|
300
|
-
* until after every host is constructed, so we can't grab it in the
|
|
301
|
-
* constructor.
|
|
302
|
-
*/
|
|
303
|
-
private getStreamingChannel;
|
|
304
|
-
register(session: DevToolsTerminalSession): DevToolsTerminalSession;
|
|
305
|
-
update(patch: PartialWithoutId<DevToolsTerminalSession>): void;
|
|
306
|
-
remove(session: DevToolsTerminalSession): void;
|
|
307
|
-
private bindStream;
|
|
308
|
-
startChildProcess(executeOptions: DevToolsChildProcessExecuteOptions, terminal: Omit<DevToolsTerminalSessionBase, 'status'>): Promise<DevToolsChildProcessTerminalSession>;
|
|
309
|
-
}
|
|
310
|
-
//#endregion
|
|
311
138
|
//#region src/node/host-views.d.ts
|
|
312
139
|
declare class DevToolsViewHost implements DevToolsViewHost$1 {
|
|
313
140
|
readonly context: DevToolsNodeContext;
|
|
@@ -378,4 +205,4 @@ declare function createStorage<T extends object>(options: CreateStorageOptions<T
|
|
|
378
205
|
declare function isObject(value: unknown): value is Record<string, any>;
|
|
379
206
|
declare function normalizeHttpServerUrl(host: string, port: number | string): string;
|
|
380
207
|
//#endregion
|
|
381
|
-
export {
|
|
208
|
+
export { CreateH3DevToolsHostOptions, CreateHostContextOptions, CreateStorageOptions, DevToolsAgentHost, DevToolsDiagnosticsHost, DevToolsViewHost, RpcFunctionsHost, StartHttpAndWsOptions, StartedServer, StaticRpcDumpCollection, StaticRpcDumpFile, StaticRpcDumpManifest, StaticRpcDumpManifestQueryEntry, StaticRpcDumpManifestStaticEntry, StaticRpcDumpManifestValue, StaticRpcDumpSerialization, collectStaticRpcDump, createH3DevToolsHost, createHostContext, createRpcSharedStateServerHost, createRpcStreamingServerHost, createStorage, isObject, normalizeHttpServerUrl, startHttpAndWs };
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,64 +1,9 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
1
|
+
import { a as createRpcSharedStateServerHost, i as createRpcStreamingServerHost, n as DevToolsViewHost, o as DevToolsDiagnosticsHost, r as RpcFunctionsHost, s as DevToolsAgentHost, t as createHostContext } from "../context-DUibxhrR.mjs";
|
|
2
|
+
import { t as createH3DevToolsHost } from "../host-h3-Dz8YnFgu.mjs";
|
|
3
|
+
import { t as startHttpAndWs } from "../server-ma8-ZVyX.mjs";
|
|
4
|
+
import { t as collectStaticRpcDump } from "../static-dump-D7AvjrgL.mjs";
|
|
5
|
+
import { t as createStorage } from "../storage-CNC38eU-.mjs";
|
|
6
6
|
import { isIP } from "node:net";
|
|
7
|
-
//#region src/node/auth-state.ts
|
|
8
|
-
let pendingAuth = null;
|
|
9
|
-
let tempAuthToken = generateTempId();
|
|
10
|
-
function generateTempId() {
|
|
11
|
-
return (0, import_dist.humanId)({
|
|
12
|
-
separator: "-",
|
|
13
|
-
capitalize: false
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function getTempAuthToken() {
|
|
17
|
-
return tempAuthToken;
|
|
18
|
-
}
|
|
19
|
-
function refreshTempAuthToken() {
|
|
20
|
-
tempAuthToken = generateTempId();
|
|
21
|
-
return tempAuthToken;
|
|
22
|
-
}
|
|
23
|
-
function getPendingAuth() {
|
|
24
|
-
return pendingAuth;
|
|
25
|
-
}
|
|
26
|
-
function setPendingAuth(request) {
|
|
27
|
-
pendingAuth = request;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Abort and clean up any existing pending auth request.
|
|
31
|
-
*/
|
|
32
|
-
function abortPendingAuth() {
|
|
33
|
-
if (pendingAuth) {
|
|
34
|
-
pendingAuth.abortController.abort();
|
|
35
|
-
clearTimeout(pendingAuth.timeout);
|
|
36
|
-
pendingAuth = null;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Consume the temp auth ID: verify it matches, trust the pending client, and clean up.
|
|
41
|
-
* Returns the client's authToken if successful, null otherwise.
|
|
42
|
-
*/
|
|
43
|
-
function consumeTempAuthToken(id, storage) {
|
|
44
|
-
if (id !== tempAuthToken || !pendingAuth) return null;
|
|
45
|
-
const { clientAuthToken, session, ua, origin, resolve } = pendingAuth;
|
|
46
|
-
storage.mutate((state) => {
|
|
47
|
-
state.trusted[clientAuthToken] = {
|
|
48
|
-
authToken: clientAuthToken,
|
|
49
|
-
ua,
|
|
50
|
-
origin,
|
|
51
|
-
timestamp: Date.now()
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
session.meta.clientAuthToken = clientAuthToken;
|
|
55
|
-
session.meta.isTrusted = true;
|
|
56
|
-
resolve({ isTrusted: true });
|
|
57
|
-
abortPendingAuth();
|
|
58
|
-
refreshTempAuthToken();
|
|
59
|
-
return clientAuthToken;
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
62
7
|
//#region src/node/utils.ts
|
|
63
8
|
function isObject(value) {
|
|
64
9
|
return Object.prototype.toString.call(value) === "[object Object]";
|
|
@@ -67,4 +12,4 @@ function normalizeHttpServerUrl(host, port) {
|
|
|
67
12
|
return `http://${host === "127.0.0.1" ? "localhost" : isIP(host) === 6 ? `[${host}]` : host}:${port}`;
|
|
68
13
|
}
|
|
69
14
|
//#endregion
|
|
70
|
-
export {
|
|
15
|
+
export { DevToolsAgentHost, DevToolsDiagnosticsHost, DevToolsViewHost, RpcFunctionsHost, collectStaticRpcDump, createH3DevToolsHost, createHostContext, createRpcSharedStateServerHost, createRpcStreamingServerHost, createStorage, isObject, normalizeHttpServerUrl, startHttpAndWs };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { i as DevframeDeploymentKind, r as DevframeDefinition } from "../devframe-DulcIxwu.mjs";
|
|
2
|
+
import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevToolsInternalContext } from "../context-DBd794Rn.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/adapters/_shared.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolve the mount base path for a devframe's SPA. Hosted adapters
|
|
7
|
+
* (`vite`, `kit`, `embedded`) default to `/__<id>/` so they don't
|
|
8
|
+
* collide with the host app; standalone adapters (`cli`, `spa`,
|
|
9
|
+
* `build`) default to `/` because they own the origin.
|
|
10
|
+
*
|
|
11
|
+
* The devframe author can override with `basePath` on the definition.
|
|
12
|
+
*/
|
|
13
|
+
declare function resolveBasePath(def: DevframeDefinition, kind: DevframeDeploymentKind): string;
|
|
14
|
+
declare function normalizeBasePath(base: string): string;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { type DevToolsInternalContext, type InternalAnonymousAuthStorage, type RemoteTokenRecord, getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { t as createStorage } from "../storage-CNC38eU-.mjs";
|
|
2
|
+
import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "../revoke-DIMz1r7-.mjs";
|
|
3
|
+
import { t as humanId } from "../human-id-adtUWQLr.mjs";
|
|
4
|
+
import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-DcJX9-Az.mjs";
|
|
5
|
+
import { join } from "pathe";
|
|
6
|
+
//#region src/node/internal/context.ts
|
|
7
|
+
const internalContextMap = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
function getInternalContext(context) {
|
|
9
|
+
if (!internalContextMap.has(context)) {
|
|
10
|
+
const storage = createStorage({
|
|
11
|
+
filepath: join(context.host.getStorageDir("global"), "auth.json"),
|
|
12
|
+
initialValue: { trusted: {} }
|
|
13
|
+
});
|
|
14
|
+
const remoteTokens = /* @__PURE__ */ new Map();
|
|
15
|
+
function revokeRemoteToken(token) {
|
|
16
|
+
if (!remoteTokens.delete(token)) return;
|
|
17
|
+
revokeActiveConnectionsForToken(context, token);
|
|
18
|
+
}
|
|
19
|
+
const internalContext = {
|
|
20
|
+
storage: { auth: storage },
|
|
21
|
+
revokeAuthToken: (token) => revokeAuthToken(context, storage, token),
|
|
22
|
+
remoteTokens,
|
|
23
|
+
allocateRemoteToken(dockId, origin, originLock) {
|
|
24
|
+
const token = humanId();
|
|
25
|
+
remoteTokens.set(token, {
|
|
26
|
+
dockId,
|
|
27
|
+
origin,
|
|
28
|
+
originLock
|
|
29
|
+
});
|
|
30
|
+
return token;
|
|
31
|
+
},
|
|
32
|
+
revokeRemoteToken,
|
|
33
|
+
revokeRemoteTokensForDock(dockId) {
|
|
34
|
+
const tokensToRevoke = [];
|
|
35
|
+
for (const [token, record] of remoteTokens) if (record.dockId === dockId) tokensToRevoke.push(token);
|
|
36
|
+
for (const token of tokensToRevoke) revokeRemoteToken(token);
|
|
37
|
+
},
|
|
38
|
+
isRemoteTokenTrusted(token, requestOrigin) {
|
|
39
|
+
const record = remoteTokens.get(token);
|
|
40
|
+
if (!record) return false;
|
|
41
|
+
if (!record.originLock) return true;
|
|
42
|
+
return !!requestOrigin && record.origin === requestOrigin;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
internalContextMap.set(context, internalContext);
|
|
46
|
+
}
|
|
47
|
+
return internalContextMap.get(context);
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { promisify } from "node:util";
|
|
1
2
|
import fs from "node:fs";
|
|
2
|
-
import
|
|
3
|
+
import os from "node:os";
|
|
3
4
|
import process from "node:process";
|
|
4
5
|
import path from "node:path";
|
|
5
|
-
import {
|
|
6
|
-
import os from "node:os";
|
|
7
|
-
import fs$1, { constants } from "node:fs/promises";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
8
7
|
import childProcess, { execFile } from "node:child_process";
|
|
8
|
+
import fs$1, { constants } from "node:fs/promises";
|
|
9
9
|
import { Buffer } from "node:buffer";
|
|
10
10
|
//#region ../../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
|
|
11
11
|
let isDockerCached;
|
|
@@ -475,7 +475,7 @@ const baseOpen = async (options) => {
|
|
|
475
475
|
});
|
|
476
476
|
});
|
|
477
477
|
};
|
|
478
|
-
const open = (target, options) => {
|
|
478
|
+
const open$1 = (target, options) => {
|
|
479
479
|
if (typeof target !== "string") throw new TypeError("Expected a `target`");
|
|
480
480
|
return baseOpen({
|
|
481
481
|
...options,
|
|
@@ -530,4 +530,13 @@ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
|
530
530
|
}, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
|
|
531
531
|
defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari" }));
|
|
532
532
|
//#endregion
|
|
533
|
-
|
|
533
|
+
//#region src/utils/open.ts
|
|
534
|
+
/**
|
|
535
|
+
* Open a URL, file, or other target in its default OS handler
|
|
536
|
+
* (browser for URLs, Finder/Explorer for paths, etc.).
|
|
537
|
+
*/
|
|
538
|
+
async function open(target, options) {
|
|
539
|
+
await open$1(target, options);
|
|
540
|
+
}
|
|
541
|
+
//#endregion
|
|
542
|
+
export { open as t };
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { b as RpcFunctionSetupResult, m as RpcFunctionAgentOptions, s as RpcDump, w as Thenable } from "../types-
|
|
1
|
+
import { b as RpcFunctionSetupResult, m as RpcFunctionAgentOptions, s as RpcDump, w as Thenable } from "../types-4rdUEi2R.mjs";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
|
|
4
4
|
//#region src/recipes/open-helpers.d.ts
|
|
5
5
|
/**
|
|
6
|
-
* Prebuilt RPC action that opens a file in the user's configured editor
|
|
7
|
-
* via [`launch-editor`](https://www.npmjs.com/package/launch-editor).
|
|
6
|
+
* Prebuilt RPC action that opens a file in the user's configured editor.
|
|
8
7
|
*
|
|
9
8
|
* Registered name: `devframe:open-in-editor`.
|
|
10
9
|
*
|
|
11
10
|
* ```ts
|
|
12
11
|
* import { openInEditor } from 'devframe/recipes/open-helpers'
|
|
13
12
|
*
|
|
14
|
-
*
|
|
13
|
+
* defineDevframe({
|
|
15
14
|
* id: 'my-tool',
|
|
16
15
|
* name: 'My Tool',
|
|
17
16
|
* setup(ctx) {
|
|
@@ -19,9 +18,6 @@ import * as v from "valibot";
|
|
|
19
18
|
* },
|
|
20
19
|
* })
|
|
21
20
|
* ```
|
|
22
|
-
*
|
|
23
|
-
* Requires `launch-editor` to be installed by the consumer (declared as
|
|
24
|
-
* an optional peer dependency on devframe).
|
|
25
21
|
*/
|
|
26
22
|
declare const openInEditor: {
|
|
27
23
|
name: "devframe:open-in-editor";
|
|
@@ -39,8 +35,7 @@ declare const openInEditor: {
|
|
|
39
35
|
__promise?: Thenable<RpcFunctionSetupResult<[string], void>> | undefined;
|
|
40
36
|
};
|
|
41
37
|
/**
|
|
42
|
-
* Prebuilt RPC action that reveals a path in the OS file explorer
|
|
43
|
-
* [`open`](https://www.npmjs.com/package/open).
|
|
38
|
+
* Prebuilt RPC action that reveals a path in the OS file explorer.
|
|
44
39
|
*
|
|
45
40
|
* Registered name: `devframe:open-in-finder`.
|
|
46
41
|
*
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { n as defineRpcFunction } from "../define-
|
|
1
|
+
import { n as defineRpcFunction } from "../define-CW9gLnyG.mjs";
|
|
2
|
+
import { t as launchEditor } from "../launch-editor-KA_21J1T.mjs";
|
|
3
|
+
import { t as open } from "../open-DmFp0qZA.mjs";
|
|
2
4
|
import * as v from "valibot";
|
|
3
5
|
//#region src/recipes/open-helpers.ts
|
|
4
6
|
/**
|
|
5
|
-
* Prebuilt RPC action that opens a file in the user's configured editor
|
|
6
|
-
* via [`launch-editor`](https://www.npmjs.com/package/launch-editor).
|
|
7
|
+
* Prebuilt RPC action that opens a file in the user's configured editor.
|
|
7
8
|
*
|
|
8
9
|
* Registered name: `devframe:open-in-editor`.
|
|
9
10
|
*
|
|
10
11
|
* ```ts
|
|
11
12
|
* import { openInEditor } from 'devframe/recipes/open-helpers'
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
+
* defineDevframe({
|
|
14
15
|
* id: 'my-tool',
|
|
15
16
|
* name: 'My Tool',
|
|
16
17
|
* setup(ctx) {
|
|
@@ -18,9 +19,6 @@ import * as v from "valibot";
|
|
|
18
19
|
* },
|
|
19
20
|
* })
|
|
20
21
|
* ```
|
|
21
|
-
*
|
|
22
|
-
* Requires `launch-editor` to be installed by the consumer (declared as
|
|
23
|
-
* an optional peer dependency on devframe).
|
|
24
22
|
*/
|
|
25
23
|
const openInEditor = defineRpcFunction({
|
|
26
24
|
name: "devframe:open-in-editor",
|
|
@@ -29,13 +27,11 @@ const openInEditor = defineRpcFunction({
|
|
|
29
27
|
args: [v.string()],
|
|
30
28
|
returns: v.void(),
|
|
31
29
|
async handler(filename) {
|
|
32
|
-
|
|
33
|
-
(mod.default ?? mod)(filename);
|
|
30
|
+
launchEditor(filename);
|
|
34
31
|
}
|
|
35
32
|
});
|
|
36
33
|
/**
|
|
37
|
-
* Prebuilt RPC action that reveals a path in the OS file explorer
|
|
38
|
-
* [`open`](https://www.npmjs.com/package/open).
|
|
34
|
+
* Prebuilt RPC action that reveals a path in the OS file explorer.
|
|
39
35
|
*
|
|
40
36
|
* Registered name: `devframe:open-in-finder`.
|
|
41
37
|
*
|
|
@@ -52,7 +48,6 @@ const openInFinder = defineRpcFunction({
|
|
|
52
48
|
args: [v.string()],
|
|
53
49
|
returns: v.void(),
|
|
54
50
|
async handler(path) {
|
|
55
|
-
const { default: open } = await import("../open-BtOOEldu.mjs");
|
|
56
51
|
await open(path);
|
|
57
52
|
}
|
|
58
53
|
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/node/auth/revoke.ts
|
|
2
|
+
/**
|
|
3
|
+
* Flip `isTrusted` to false on any live WS clients connected with `token`
|
|
4
|
+
* and broadcast the `auth:revoked` event so they can react.
|
|
5
|
+
*
|
|
6
|
+
* Shared between persisted-auth revocation and remote-dock token revocation.
|
|
7
|
+
*/
|
|
8
|
+
async function revokeActiveConnectionsForToken(context, token) {
|
|
9
|
+
const rpcHost = context.rpc;
|
|
10
|
+
if (!rpcHost?._rpcGroup) return;
|
|
11
|
+
const affectedSessionIds = /* @__PURE__ */ new Set();
|
|
12
|
+
for (const client of rpcHost._rpcGroup.clients) if (client.$meta.clientAuthToken === token) {
|
|
13
|
+
affectedSessionIds.add(client.$meta.id);
|
|
14
|
+
client.$meta.isTrusted = false;
|
|
15
|
+
client.$meta.clientAuthToken = void 0;
|
|
16
|
+
}
|
|
17
|
+
if (affectedSessionIds.size === 0) return;
|
|
18
|
+
await rpcHost.broadcast({
|
|
19
|
+
method: "devframe:auth:revoked",
|
|
20
|
+
args: [],
|
|
21
|
+
filter: (client) => affectedSessionIds.has(client.$meta.id)
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Revoke an auth token: remove from storage and notify all connected clients
|
|
26
|
+
* using this token that they are no longer trusted.
|
|
27
|
+
*/
|
|
28
|
+
async function revokeAuthToken(context, storage, token) {
|
|
29
|
+
storage.mutate((state) => {
|
|
30
|
+
delete state.trusted[token];
|
|
31
|
+
});
|
|
32
|
+
await revokeActiveConnectionsForToken(context, token);
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { revokeAuthToken as n, revokeActiveConnectionsForToken as t };
|
package/dist/rpc/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as RpcReturnSchema, S as RpcFunctionsCollector, _ as RpcFunctionDefinitionAnyWithContext, a as RpcDefinitionsFilter, b as RpcFunctionSetupResult, c as RpcDumpClientOptions, d as RpcDumpGetter, f as RpcDumpRecord, g as RpcFunctionDefinitionAny, h as RpcFunctionDefinition, i as RpcArgsSchema, l as RpcDumpCollectionOptions, m as RpcFunctionAgentOptions, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpStore, r as EntriesToObject, s as RpcDump, t as BirpcFn, u as RpcDumpDefinition, v as RpcFunctionDefinitionBase, w as Thenable, x as RpcFunctionType, y as RpcFunctionDefinitionToFunction } from "../types-
|
|
3
|
-
export { BirpcFn, BirpcReturn, EntriesToObject, RpcArgsSchema, RpcCacheManager, RpcCacheOptions, RpcDefinitionsFilter, RpcDefinitionsToFunctions, RpcDump, RpcDumpClientOptions, RpcDumpCollectionOptions, RpcDumpDefinition, RpcDumpGetter, RpcDumpRecord, RpcDumpStore, RpcFunctionAgentOptions, RpcFunctionDefinition, RpcFunctionDefinitionAny, RpcFunctionDefinitionAnyWithContext, RpcFunctionDefinitionBase, RpcFunctionDefinitionToFunction, RpcFunctionSetupResult, RpcFunctionType, RpcFunctionsCollector, RpcFunctionsCollectorBase, RpcReturnSchema, STRUCTURED_CLONE_PREFIX, Thenable, createClientFromDump, createDefineWrapperWithContext, defineRpcFunction, dumpFunctions, getDefinitionsWithDumps, getRpcHandler, getRpcResolvedSetupResult, strictJsonStringify,
|
|
1
|
+
import { a as getRpcHandler, c as dumpFunctions, d as defineRpcFunction, f as RpcFunctionsCollectorBase, i as strictJsonStringify, l as getDefinitionsWithDumps, m as RpcCacheOptions, n as validateDefinitions, o as getRpcResolvedSetupResult, p as RpcCacheManager, r as STRUCTURED_CLONE_PREFIX, s as createClientFromDump, t as validateDefinition, u as createDefineWrapperWithContext } from "../index-DB2Ie0Or.mjs";
|
|
2
|
+
import { C as RpcReturnSchema, S as RpcFunctionsCollector, _ as RpcFunctionDefinitionAnyWithContext, a as RpcDefinitionsFilter, b as RpcFunctionSetupResult, c as RpcDumpClientOptions, d as RpcDumpGetter, f as RpcDumpRecord, g as RpcFunctionDefinitionAny, h as RpcFunctionDefinition, i as RpcArgsSchema, l as RpcDumpCollectionOptions, m as RpcFunctionAgentOptions, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpStore, r as EntriesToObject, s as RpcDump, t as BirpcFn, u as RpcDumpDefinition, v as RpcFunctionDefinitionBase, w as Thenable, x as RpcFunctionType, y as RpcFunctionDefinitionToFunction } from "../types-4rdUEi2R.mjs";
|
|
3
|
+
export { BirpcFn, BirpcReturn, EntriesToObject, RpcArgsSchema, RpcCacheManager, RpcCacheOptions, RpcDefinitionsFilter, RpcDefinitionsToFunctions, RpcDump, RpcDumpClientOptions, RpcDumpCollectionOptions, RpcDumpDefinition, RpcDumpGetter, RpcDumpRecord, RpcDumpStore, RpcFunctionAgentOptions, RpcFunctionDefinition, RpcFunctionDefinitionAny, RpcFunctionDefinitionAnyWithContext, RpcFunctionDefinitionBase, RpcFunctionDefinitionToFunction, RpcFunctionSetupResult, RpcFunctionType, RpcFunctionsCollector, RpcFunctionsCollectorBase, RpcReturnSchema, STRUCTURED_CLONE_PREFIX, Thenable, createClientFromDump, createDefineWrapperWithContext, defineRpcFunction, dumpFunctions, getDefinitionsWithDumps, getRpcHandler, getRpcResolvedSetupResult, strictJsonStringify, validateDefinition, validateDefinitions };
|
package/dist/rpc/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as validateDefinitions, c as getRpcResolvedSetupResult, i as validateDefinition, l as RpcCacheManager, n as dumpFunctions, o as RpcFunctionsCollectorBase, r as getDefinitionsWithDumps, s as getRpcHandler, t as createClientFromDump } from "../rpc-
|
|
2
|
-
import {
|
|
3
|
-
import { n as defineRpcFunction, t as createDefineWrapperWithContext } from "../define-
|
|
4
|
-
export { RpcCacheManager, RpcFunctionsCollectorBase, STRUCTURED_CLONE_PREFIX, createClientFromDump, createDefineWrapperWithContext, defineRpcFunction, dumpFunctions, getDefinitionsWithDumps, getRpcHandler, getRpcResolvedSetupResult, strictJsonStringify,
|
|
1
|
+
import { a as validateDefinitions, c as getRpcResolvedSetupResult, i as validateDefinition, l as RpcCacheManager, n as dumpFunctions, o as RpcFunctionsCollectorBase, r as getDefinitionsWithDumps, s as getRpcHandler, t as createClientFromDump } from "../rpc-CkZuoz-m.mjs";
|
|
2
|
+
import { n as strictJsonStringify, t as STRUCTURED_CLONE_PREFIX } from "../serialization-CwO31axa.mjs";
|
|
3
|
+
import { n as defineRpcFunction, t as createDefineWrapperWithContext } from "../define-CW9gLnyG.mjs";
|
|
4
|
+
export { RpcCacheManager, RpcFunctionsCollectorBase, STRUCTURED_CLONE_PREFIX, createClientFromDump, createDefineWrapperWithContext, defineRpcFunction, dumpFunctions, getDefinitionsWithDumps, getRpcHandler, getRpcResolvedSetupResult, strictJsonStringify, validateDefinition, validateDefinitions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createWsRpcChannel, t as WsRpcChannelOptions } from "../../ws-client-
|
|
1
|
+
import { n as createWsRpcChannel, t as WsRpcChannelOptions } from "../../ws-client-Bavoya6-.mjs";
|
|
2
2
|
export { WsRpcChannelOptions, createWsRpcChannel };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as strictJsonStringify } from "../../serialization-CwO31axa.mjs";
|
|
2
|
+
import { i as structuredCloneStringify, n as structuredCloneParse } from "../../structured-clone-DcDc2Dds.mjs";
|
|
2
3
|
//#region src/rpc/transports/ws-client.ts
|
|
3
4
|
function NOOP() {}
|
|
4
5
|
const EMPTY_DEFS = /* @__PURE__ */ new Map();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as WsRpcTransportOptions, r as attachWsRpcTransport, t as DevToolsNodeRpcSessionMeta } from "../../ws-server-
|
|
1
|
+
import { n as WsRpcTransportOptions, r as attachWsRpcTransport, t as DevToolsNodeRpcSessionMeta } from "../../ws-server-DjvlwLuM.mjs";
|
|
2
2
|
export { DevToolsNodeRpcSessionMeta, WsRpcTransportOptions, attachWsRpcTransport };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as strictJsonStringify } from "../../serialization-CwO31axa.mjs";
|
|
2
|
+
import { i as structuredCloneStringify, n as structuredCloneParse } from "../../structured-clone-DcDc2Dds.mjs";
|
|
2
3
|
import { createServer } from "node:https";
|
|
3
4
|
import { WebSocketServer } from "ws";
|
|
4
5
|
//#region src/rpc/transports/ws-server.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as hash } from "./hash-BHZbo80D.mjs";
|
|
2
|
+
import { i as logger } from "./serialization-CwO31axa.mjs";
|
|
3
3
|
//#region src/rpc/cache.ts
|
|
4
4
|
/**
|
|
5
5
|
* @experimental API is expected to change.
|
|
@@ -56,6 +56,7 @@ async function getRpcHandler(definition, context) {
|
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region src/rpc/collector.ts
|
|
58
58
|
var RpcFunctionsCollectorBase = class {
|
|
59
|
+
context;
|
|
59
60
|
definitions = /* @__PURE__ */ new Map();
|
|
60
61
|
functions;
|
|
61
62
|
_onChanged = [];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { consoleReporter, createLogger, defineDiagnostics, plainFormatter } from "logs-sdk";
|
|
2
|
-
import { deserialize as structuredCloneDeserialize, parse as structuredCloneParse, serialize as structuredCloneSerialize, stringify as structuredCloneStringify } from "structured-clone-es";
|
|
3
2
|
//#region src/rpc/diagnostics.ts
|
|
4
3
|
const diagnostics = defineDiagnostics({
|
|
5
4
|
docsBase: "https://devfra.me/errors",
|
|
@@ -109,4 +108,4 @@ function formatPath(parent, key) {
|
|
|
109
108
|
return key;
|
|
110
109
|
}
|
|
111
110
|
//#endregion
|
|
112
|
-
export {
|
|
111
|
+
export { logger as i, strictJsonStringify as n, diagnostics as r, STRUCTURED_CLONE_PREFIX as t };
|