devframe 0.1.20 → 0.1.21
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-S-Ujqz_L.mjs → _shared-iZy45oG3.mjs} +2 -2
- package/dist/adapters/build.d.mts +3 -3
- package/dist/adapters/build.mjs +7 -7
- package/dist/adapters/cli.d.mts +1 -1
- package/dist/adapters/cli.mjs +2 -2
- package/dist/adapters/dev.d.mts +2 -2
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +2 -2
- package/dist/adapters/embedded.mjs +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +4 -3
- package/dist/adapters/vite.d.mts +5 -4
- package/dist/adapters/vite.mjs +4 -3
- package/dist/client/index.d.mts +15 -145
- package/dist/client/index.mjs +3 -12
- package/dist/constants.d.mts +12 -15
- package/dist/constants.mjs +12 -29
- package/dist/context-BJ4r2SmR.mjs +1051 -0
- package/dist/context-internal-Dx_NoSv1.mjs +199 -0
- package/dist/context-internal-saIAfNVw.d.mts +51 -0
- package/dist/{dev-B8i_CBlQ.mjs → dev-CdAy400a.mjs} +6 -6
- package/dist/{devtool-Bm6zZAw5.d.mts → devtool-CNvLs2_Y.d.mts} +37 -538
- package/dist/diagnostics-DxPnRoXO.mjs +51 -0
- package/dist/{human-id-CHS0s28X.mjs → human-id-BLoGo_e5.mjs} +0 -1
- package/dist/{index-BCo03GEF.d.mts → index-CuLRIMto.d.mts} +1 -1
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +1 -4
- package/dist/internal/index.d.mts +16 -0
- package/dist/internal/index.mjs +3 -0
- package/dist/node/index.d.mts +14 -146
- package/dist/node/index.mjs +7 -6
- package/dist/recipes/open-helpers.d.mts +1 -1
- package/dist/recipes/open-helpers.mjs +1 -1
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/{server-DksyT-um.d.mts → server-BAqOajx_.d.mts} +1 -1
- package/dist/types/index.d.mts +4 -4
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/human-id.mjs +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/when.d.mts +401 -2
- package/dist/{ws-client-DQySVfF_.d.mts → ws-client-CjPuPFbA.d.mts} +1 -1
- package/dist/{ws-server-VQqESKAs.d.mts → ws-server-C7LnhOHi.d.mts} +1 -1
- package/package.json +2 -5
- package/skills/devframe/SKILL.md +54 -100
- package/skills/devframe/templates/counter-devtool.ts +3 -8
- package/skills/devframe/templates/spa-devtool.ts +2 -7
- 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/when-aBBXAEh5.d.mts +0 -401
- package/dist/{host-h3-BMvrFzIJ.mjs → host-h3-9jeHcltx.mjs} +1 -1
- package/dist/{open-BtOOEldu.mjs → open-Dede_w9r.mjs} +4 -4
- /package/dist/{server-qRRM8t3v.mjs → server-CBsxXIH5.mjs} +0 -0
- /package/dist/{static-dump-C1aVSwxY.mjs → static-dump-D5VH8Iqk.mjs} +0 -0
- /package/dist/{transports-BPUzHhI2.mjs → transports-DSV5_5QM.mjs} +0 -0
- /package/dist/{types-ag029cAe.d.mts → types-C5OVe4AC.d.mts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/adapters/_shared.ts
|
|
2
2
|
/**
|
|
3
3
|
* Resolve the mount base path for a devtool's SPA. Hosted adapters
|
|
4
|
-
* (`vite`, `kit`, `embedded`) default to
|
|
4
|
+
* (`vite`, `kit`, `embedded`) default to `/__<id>/` so they don't
|
|
5
5
|
* collide with the host app; standalone adapters (`cli`, `spa`,
|
|
6
6
|
* `build`) default to `/` because they own the origin.
|
|
7
7
|
*
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
function resolveBasePath(def, kind) {
|
|
11
11
|
if (def.basePath) return normalizeBasePath(def.basePath);
|
|
12
|
-
return kind === "standalone" ? "/" :
|
|
12
|
+
return kind === "standalone" ? "/" : `/__${def.id}/`;
|
|
13
13
|
}
|
|
14
14
|
function normalizeBasePath(base) {
|
|
15
15
|
let out = base.startsWith("/") ? base : `/${base}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as DevtoolDefinition } from "../devtool-
|
|
1
|
+
import { r as DevtoolDefinition } from "../devtool-CNvLs2_Y.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/adapters/build.d.ts
|
|
4
4
|
interface CreateBuildOptions {
|
|
@@ -24,8 +24,8 @@ interface CreateBuildOptions {
|
|
|
24
24
|
*
|
|
25
25
|
* - Build a `mode: 'build'` context and run `devtool.setup(ctx)`.
|
|
26
26
|
* - Copy the author's SPA dist into `<outDir>/`.
|
|
27
|
-
* - Write `<outDir
|
|
28
|
-
* sharded RPC dump under `<outDir
|
|
27
|
+
* - Write `<outDir>/__connection.json` (`{ backend: 'static' }`) and the
|
|
28
|
+
* sharded RPC dump under `<outDir>/__rpc-dump/` so the deployed SPA
|
|
29
29
|
* discovers both via relative paths from `document.baseURI`.
|
|
30
30
|
* - When `def.spa` is configured, also write `<outDir>/spa-loader.json`
|
|
31
31
|
* describing the SPA's data-loader mode (`'query'` / `'upload'` /
|
package/dist/adapters/build.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { n as strictJsonStringify, o as structuredCloneStringify } from "../serialization-DwKi05Pn.mjs";
|
|
2
|
-
import { t as createHostContext } from "../context-
|
|
2
|
+
import { t as createHostContext } from "../context-BJ4r2SmR.mjs";
|
|
3
|
+
import { t as createH3DevToolsHost } from "../host-h3-9jeHcltx.mjs";
|
|
3
4
|
import { DEVTOOLS_CONNECTION_META_FILENAME, DEVTOOLS_RPC_DUMP_DIRNAME, DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME } from "../constants.mjs";
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { t as collectStaticRpcDump } from "../static-dump-D5VH8Iqk.mjs";
|
|
6
|
+
import { n as resolveBasePath } from "../_shared-iZy45oG3.mjs";
|
|
7
|
+
import c from "ansis";
|
|
7
8
|
import { existsSync } from "node:fs";
|
|
8
9
|
import { dirname, resolve } from "pathe";
|
|
9
10
|
import process from "node:process";
|
|
10
|
-
import c from "ansis";
|
|
11
11
|
import fs$1 from "node:fs/promises";
|
|
12
12
|
//#region src/adapters/build.ts
|
|
13
13
|
/**
|
|
@@ -15,8 +15,8 @@ import fs$1 from "node:fs/promises";
|
|
|
15
15
|
*
|
|
16
16
|
* - Build a `mode: 'build'` context and run `devtool.setup(ctx)`.
|
|
17
17
|
* - Copy the author's SPA dist into `<outDir>/`.
|
|
18
|
-
* - Write `<outDir
|
|
19
|
-
* sharded RPC dump under `<outDir
|
|
18
|
+
* - Write `<outDir>/__connection.json` (`{ backend: 'static' }`) and the
|
|
19
|
+
* sharded RPC dump under `<outDir>/__rpc-dump/` so the deployed SPA
|
|
20
20
|
* discovers both via relative paths from `document.baseURI`.
|
|
21
21
|
* - When `def.spa` is configured, also write `<outDir>/spa-loader.json`
|
|
22
22
|
* describing the SPA's data-loader mode (`'query'` / `'upload'` /
|
package/dist/adapters/cli.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dt as CliFlagsSchema, ft as InferCliFlags, mt as parseCliFlags, pt as defineCliFlags, r as DevtoolDefinition } from "../devtool-CNvLs2_Y.mjs";
|
|
2
2
|
import { App } from "h3";
|
|
3
3
|
import { CAC } from "cac";
|
|
4
4
|
|
package/dist/adapters/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createBuild } from "./build.mjs";
|
|
2
|
-
import { n as resolveDevServerPort, t as createDevServer } from "../dev-
|
|
3
|
-
import process from "node:process";
|
|
2
|
+
import { n as resolveDevServerPort, t as createDevServer } from "../dev-CdAy400a.mjs";
|
|
4
3
|
import c from "ansis";
|
|
4
|
+
import process from "node:process";
|
|
5
5
|
import cac from "cac";
|
|
6
6
|
import { safeParse } from "valibot";
|
|
7
7
|
//#region src/adapters/flags.ts
|
package/dist/adapters/dev.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as DevtoolDefinition } from "../devtool-
|
|
2
|
-
import { n as StartedServer } from "../server-
|
|
1
|
+
import { r as DevtoolDefinition } from "../devtool-CNvLs2_Y.mjs";
|
|
2
|
+
import { n as StartedServer } from "../server-BAqOajx_.mjs";
|
|
3
3
|
import { App } from "h3";
|
|
4
4
|
|
|
5
5
|
//#region src/adapters/dev.d.ts
|
package/dist/adapters/dev.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as resolveDevServerPort, t as createDevServer } from "../dev-
|
|
1
|
+
import { n as resolveDevServerPort, t as createDevServer } from "../dev-CdAy400a.mjs";
|
|
2
2
|
export { createDevServer, resolveDevServerPort };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as DevToolsNodeContext, r as DevtoolDefinition } from "../devtool-
|
|
1
|
+
import { d as DevToolsNodeContext, r as DevtoolDefinition } from "../devtool-CNvLs2_Y.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/adapters/embedded.d.ts
|
|
4
4
|
interface CreateEmbeddedOptions {
|
|
@@ -12,7 +12,7 @@ interface CreateEmbeddedOptions {
|
|
|
12
12
|
* dynamic, post-startup registration.
|
|
13
13
|
*
|
|
14
14
|
* The host owns the mount path; when a hosted mount is needed the
|
|
15
|
-
* effective default follows the hosted rule of `def.basePath ?? '
|
|
15
|
+
* effective default follows the hosted rule of `def.basePath ?? '/__<id>/'`.
|
|
16
16
|
*/
|
|
17
17
|
declare function createEmbedded(d: DevtoolDefinition, options: CreateEmbeddedOptions): Promise<void>;
|
|
18
18
|
//#endregion
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* dynamic, post-startup registration.
|
|
7
7
|
*
|
|
8
8
|
* The host owns the mount path; when a hosted mount is needed the
|
|
9
|
-
* effective default follows the hosted rule of `def.basePath ?? '
|
|
9
|
+
* effective default follows the hosted rule of `def.basePath ?? '/__<id>/'`.
|
|
10
10
|
*/
|
|
11
11
|
async function createEmbedded(d, options) {
|
|
12
12
|
await d.setup(options.ctx);
|
package/dist/adapters/mcp.d.mts
CHANGED
package/dist/adapters/mcp.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as logger } from "../diagnostics-DxPnRoXO.mjs";
|
|
2
|
+
import { t as createHostContext } from "../context-BJ4r2SmR.mjs";
|
|
2
3
|
import { join } from "pathe";
|
|
3
|
-
import process from "node:process";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
|
+
import process from "node:process";
|
|
5
6
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
6
7
|
import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
7
8
|
import { toJsonSchema } from "@valibot/to-json-schema";
|
|
@@ -139,7 +140,7 @@ async function createMcpServer(definition, options = {}) {
|
|
|
139
140
|
serverVersion: options.serverVersion ?? definition.version ?? "0.0.0",
|
|
140
141
|
exposeSharedState: options.exposeSharedState ?? true
|
|
141
142
|
});
|
|
142
|
-
const { startStdioTransport } = await import("../transports-
|
|
143
|
+
const { startStdioTransport } = await import("../transports-DSV5_5QM.mjs");
|
|
143
144
|
let stop;
|
|
144
145
|
try {
|
|
145
146
|
stop = await startStdioTransport(server);
|
package/dist/adapters/vite.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as DevtoolDefinition } from "../devtool-
|
|
1
|
+
import { r as DevtoolDefinition } from "../devtool-CNvLs2_Y.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/adapters/vite.d.ts
|
|
4
4
|
interface CreateVitePluginOptions {
|
|
5
5
|
/**
|
|
6
|
-
* Mount base. Defaults to `def.basePath ?? '
|
|
6
|
+
* Mount base. Defaults to `def.basePath ?? '/__<id>/'` for this hosted
|
|
7
7
|
* adapter — the devtool shares the origin with the host Vite app.
|
|
8
8
|
*/
|
|
9
9
|
base?: string;
|
|
@@ -19,12 +19,13 @@ interface DevframeVitePlugin {
|
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Plain Vite plugin — mounts a devframe devtool's SPA into a user's
|
|
22
|
-
* Vite dev server at `options.base` (default: `def.basePath ?? '
|
|
22
|
+
* Vite dev server at `options.base` (default: `def.basePath ?? '/__<id>/'`).
|
|
23
23
|
* Use this for tools that want the Vite dev experience without
|
|
24
24
|
* pulling the full Vite DevTools Kit.
|
|
25
25
|
*
|
|
26
26
|
* Note: this does not yet spin up the RPC WS server — for the full
|
|
27
|
-
* RPC path, use `
|
|
27
|
+
* RPC path, use `createPluginFromDevframe` from
|
|
28
|
+
* `@vitejs/devtools-kit/node` alongside `@vitejs/devtools`, or the
|
|
28
29
|
* standalone `createCli`.
|
|
29
30
|
*/
|
|
30
31
|
declare function createVitePlugin(d: DevtoolDefinition, options?: CreateVitePluginOptions): DevframeVitePlugin;
|
package/dist/adapters/vite.mjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { n as resolveBasePath } from "../_shared-
|
|
1
|
+
import { n as resolveBasePath } from "../_shared-iZy45oG3.mjs";
|
|
2
2
|
import { resolve } from "pathe";
|
|
3
3
|
import sirv from "sirv";
|
|
4
4
|
//#region src/adapters/vite.ts
|
|
5
5
|
/**
|
|
6
6
|
* Plain Vite plugin — mounts a devframe devtool's SPA into a user's
|
|
7
|
-
* Vite dev server at `options.base` (default: `def.basePath ?? '
|
|
7
|
+
* Vite dev server at `options.base` (default: `def.basePath ?? '/__<id>/'`).
|
|
8
8
|
* Use this for tools that want the Vite dev experience without
|
|
9
9
|
* pulling the full Vite DevTools Kit.
|
|
10
10
|
*
|
|
11
11
|
* Note: this does not yet spin up the RPC WS server — for the full
|
|
12
|
-
* RPC path, use `
|
|
12
|
+
* RPC path, use `createPluginFromDevframe` from
|
|
13
|
+
* `@vitejs/devtools-kit/node` alongside `@vitejs/devtools`, or the
|
|
13
14
|
* standalone `createCli`.
|
|
14
15
|
*/
|
|
15
16
|
function createVitePlugin(d, options = {}) {
|
package/dist/client/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as RpcCacheManager, v as RpcCacheOptions } from "../index-
|
|
3
|
-
import { S as RpcFunctionsCollector } from "../types-
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as WsRpcChannelOptions } from "../ws-client-DQySVfF_.mjs";
|
|
1
|
+
import { T as StreamSink, U as DevToolsRpcClientFunctions, W as DevToolsRpcServerFunctions, ct as EventEmitter, g as RpcSharedStateHost, l as ConnectionMeta, w as StreamReader } from "../devtool-CNvLs2_Y.mjs";
|
|
2
|
+
import { _ as RpcCacheManager, v as RpcCacheOptions } from "../index-CuLRIMto.mjs";
|
|
3
|
+
import { S as RpcFunctionsCollector } from "../types-C5OVe4AC.mjs";
|
|
4
|
+
import { t as WsRpcChannelOptions } from "../ws-client-CjPuPFbA.mjs";
|
|
6
5
|
import { BirpcOptions, BirpcReturn } from "birpc";
|
|
7
6
|
|
|
8
7
|
//#region src/client/rpc-streaming.d.ts
|
|
@@ -36,6 +35,16 @@ interface RpcStreamingClientHost {
|
|
|
36
35
|
declare function createRpcStreamingClientHost(rpc: DevToolsRpcClient): RpcStreamingClientHost;
|
|
37
36
|
//#endregion
|
|
38
37
|
//#region src/client/rpc.d.ts
|
|
38
|
+
interface DevToolsRpcContext {
|
|
39
|
+
/**
|
|
40
|
+
* The RPC client to interact with the server
|
|
41
|
+
*/
|
|
42
|
+
readonly rpc: DevToolsRpcClient;
|
|
43
|
+
}
|
|
44
|
+
type DevToolsClientRpcHost = RpcFunctionsCollector<DevToolsRpcClientFunctions, DevToolsRpcContext>;
|
|
45
|
+
interface RpcClientEvents {
|
|
46
|
+
'rpc:is-trusted:updated': (isTrusted: boolean) => void;
|
|
47
|
+
}
|
|
39
48
|
interface DevToolsRpcClientOptions {
|
|
40
49
|
connectionMeta?: ConnectionMeta;
|
|
41
50
|
baseURL?: string | string[];
|
|
@@ -122,143 +131,4 @@ interface DevToolsRpcClientMode {
|
|
|
122
131
|
}
|
|
123
132
|
declare function getDevToolsRpcClient(options?: DevToolsRpcClientOptions): Promise<DevToolsRpcClient>;
|
|
124
133
|
//#endregion
|
|
125
|
-
|
|
126
|
-
interface DockPanelStorage {
|
|
127
|
-
mode: 'float' | 'edge';
|
|
128
|
-
width: number;
|
|
129
|
-
height: number;
|
|
130
|
-
top: number;
|
|
131
|
-
left: number;
|
|
132
|
-
position: 'left' | 'right' | 'bottom' | 'top';
|
|
133
|
-
open: boolean;
|
|
134
|
-
inactiveTimeout: number;
|
|
135
|
-
}
|
|
136
|
-
type DockClientType = 'embedded' | 'standalone';
|
|
137
|
-
interface DevToolsRpcContext {
|
|
138
|
-
/**
|
|
139
|
-
* The RPC client to interact with the server
|
|
140
|
-
*/
|
|
141
|
-
readonly rpc: DevToolsRpcClient;
|
|
142
|
-
}
|
|
143
|
-
interface DocksContext extends DevToolsRpcContext {
|
|
144
|
-
/**
|
|
145
|
-
* Type of the client environment
|
|
146
|
-
*
|
|
147
|
-
* 'embedded' - running inside an embedded floating panel
|
|
148
|
-
* 'standalone' - running inside a standalone window (no user app)
|
|
149
|
-
*/
|
|
150
|
-
readonly clientType: 'embedded' | 'standalone';
|
|
151
|
-
/**
|
|
152
|
-
* The panel context
|
|
153
|
-
*/
|
|
154
|
-
readonly panel: DocksPanelContext;
|
|
155
|
-
/**
|
|
156
|
-
* The docks entries context
|
|
157
|
-
*/
|
|
158
|
-
readonly docks: DocksEntriesContext;
|
|
159
|
-
/**
|
|
160
|
-
* The commands context for command palette and shortcuts
|
|
161
|
-
*/
|
|
162
|
-
readonly commands: CommandsContext;
|
|
163
|
-
/**
|
|
164
|
-
* The when-clause context for conditional visibility
|
|
165
|
-
*/
|
|
166
|
-
readonly when: WhenClauseContext;
|
|
167
|
-
}
|
|
168
|
-
interface WhenClauseContext {
|
|
169
|
-
/**
|
|
170
|
-
* Get the current when-clause context snapshot.
|
|
171
|
-
* Returns a reactive object with built-in variables and any custom plugin variables.
|
|
172
|
-
*/
|
|
173
|
-
readonly context: WhenContext;
|
|
174
|
-
}
|
|
175
|
-
type DevToolsClientRpcHost = RpcFunctionsCollector<DevToolsRpcClientFunctions, DevToolsRpcContext>;
|
|
176
|
-
type DevToolsClientContext = DocksContext;
|
|
177
|
-
interface DocksPanelContext {
|
|
178
|
-
store: DockPanelStorage;
|
|
179
|
-
isDragging: boolean;
|
|
180
|
-
isResizing: boolean;
|
|
181
|
-
readonly isVertical: boolean;
|
|
182
|
-
}
|
|
183
|
-
interface DocksEntriesContext {
|
|
184
|
-
selectedId: string | null;
|
|
185
|
-
readonly selected: DevToolsDockEntry | null;
|
|
186
|
-
entries: DevToolsDockEntry[];
|
|
187
|
-
entryToStateMap: Map<string, DockEntryState>;
|
|
188
|
-
groupedEntries: DevToolsDockEntriesGrouped;
|
|
189
|
-
settings: SharedState<DevToolsDocksUserSettings>;
|
|
190
|
-
/**
|
|
191
|
-
* Get the state of a dock entry by its ID
|
|
192
|
-
*/
|
|
193
|
-
getStateById: (id: string) => DockEntryState | undefined;
|
|
194
|
-
/**
|
|
195
|
-
* Switch to the selected dock entry, pass `null` to clear the selection
|
|
196
|
-
*
|
|
197
|
-
* @returns Whether the selection was changed successfully
|
|
198
|
-
*/
|
|
199
|
-
switchEntry: (id?: string | null) => Promise<boolean>;
|
|
200
|
-
/**
|
|
201
|
-
* Toggle the selected dock entry
|
|
202
|
-
*
|
|
203
|
-
* @returns Whether the selection was changed successfully
|
|
204
|
-
*/
|
|
205
|
-
toggleEntry: (id: string) => Promise<boolean>;
|
|
206
|
-
}
|
|
207
|
-
interface DockEntryState {
|
|
208
|
-
entryMeta: DevToolsDockEntry;
|
|
209
|
-
readonly isActive: boolean;
|
|
210
|
-
domElements: {
|
|
211
|
-
iframe?: HTMLIFrameElement | null;
|
|
212
|
-
panel?: HTMLDivElement | null;
|
|
213
|
-
};
|
|
214
|
-
events: EventEmitter<DockEntryStateEvents>;
|
|
215
|
-
}
|
|
216
|
-
interface DockEntryStateEvents {
|
|
217
|
-
'entry:activated': () => void;
|
|
218
|
-
'entry:deactivated': () => void;
|
|
219
|
-
'entry:updated': (newMeta: DevToolsDockUserEntry) => void;
|
|
220
|
-
'dom:panel:mounted': (panel: HTMLDivElement) => void;
|
|
221
|
-
'dom:iframe:mounted': (iframe: HTMLIFrameElement) => void;
|
|
222
|
-
}
|
|
223
|
-
interface RpcClientEvents {
|
|
224
|
-
'rpc:is-trusted:updated': (isTrusted: boolean) => void;
|
|
225
|
-
}
|
|
226
|
-
interface CommandsContext {
|
|
227
|
-
/**
|
|
228
|
-
* All commands (server + client)
|
|
229
|
-
*/
|
|
230
|
-
readonly commands: DevToolsCommandEntry[];
|
|
231
|
-
/**
|
|
232
|
-
* Palette-visible commands only (filtered by `showInPalette !== false`)
|
|
233
|
-
*/
|
|
234
|
-
readonly paletteCommands: DevToolsCommandEntry[];
|
|
235
|
-
/**
|
|
236
|
-
* Register client-side command(s). Returns cleanup function.
|
|
237
|
-
*/
|
|
238
|
-
register: (cmd: DevToolsClientCommand | DevToolsClientCommand[]) => () => void;
|
|
239
|
-
/**
|
|
240
|
-
* Execute a command by ID. Delegates to RPC for server commands.
|
|
241
|
-
*/
|
|
242
|
-
execute: (id: string, ...args: any[]) => Promise<unknown>;
|
|
243
|
-
/**
|
|
244
|
-
* Get effective keybindings for a command (defaults merged with overrides)
|
|
245
|
-
*/
|
|
246
|
-
getKeybindings: (id: string) => DevToolsCommandKeybinding[];
|
|
247
|
-
/**
|
|
248
|
-
* User settings store (persisted, includes command shortcuts)
|
|
249
|
-
*/
|
|
250
|
-
settings: SharedState<DevToolsDocksUserSettings>;
|
|
251
|
-
/**
|
|
252
|
-
* Whether the command palette is open
|
|
253
|
-
*/
|
|
254
|
-
paletteOpen: boolean;
|
|
255
|
-
}
|
|
256
|
-
//#endregion
|
|
257
|
-
//#region src/client/context.d.ts
|
|
258
|
-
declare const CLIENT_CONTEXT_KEY = "__VITE_DEVTOOLS_CLIENT_CONTEXT__";
|
|
259
|
-
/**
|
|
260
|
-
* Get the global DevTools client context, or `undefined` if not yet initialized.
|
|
261
|
-
*/
|
|
262
|
-
declare function getDevToolsClientContext(): DevToolsClientContext | undefined;
|
|
263
|
-
//#endregion
|
|
264
|
-
export { CLIENT_CONTEXT_KEY, CommandsContext, DevToolsClientContext, DevToolsClientRpcHost, DevToolsRpcClient, DevToolsRpcClientCall, DevToolsRpcClientCallEvent, DevToolsRpcClientCallOptional, DevToolsRpcClientMode, DevToolsRpcClientOptions, DevToolsRpcContext, DockClientType, DockEntryState, DockEntryStateEvents, DockPanelStorage, DocksContext, DocksEntriesContext, DocksPanelContext, RpcClientEvents, RpcStreamingClientHost, StreamingSubscribeOptions, WhenClauseContext, getDevToolsRpcClient as connectDevtool, getDevToolsRpcClient, createRpcStreamingClientHost, getDevToolsClientContext };
|
|
134
|
+
export { DevToolsClientRpcHost, DevToolsRpcClient, DevToolsRpcClientCall, DevToolsRpcClientCallEvent, DevToolsRpcClientCallOptional, DevToolsRpcClientMode, DevToolsRpcClientOptions, DevToolsRpcContext, RpcClientEvents, RpcStreamingClientHost, StreamingSubscribeOptions, getDevToolsRpcClient as connectDevtool, getDevToolsRpcClient, createRpcStreamingClientHost };
|
package/dist/client/index.mjs
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
import { t as import_dist } from "../human-id-
|
|
1
|
+
import { t as import_dist } from "../human-id-BLoGo_e5.mjs";
|
|
2
2
|
import { l as RpcCacheManager, o as RpcFunctionsCollectorBase } from "../rpc-INbWfHoX.mjs";
|
|
3
3
|
import { r as structuredCloneDeserialize } from "../serialization-DwKi05Pn.mjs";
|
|
4
4
|
import { createRpcClient } from "../rpc/client.mjs";
|
|
5
5
|
import { createWsRpcChannel } from "../rpc/transports/ws-client.mjs";
|
|
6
6
|
import { createEventEmitter } from "../utils/events.mjs";
|
|
7
|
-
import { DEVTOOLS_CONNECTION_META_FILENAME, DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME } from "../constants.mjs";
|
|
8
7
|
import { createSharedState } from "../utils/shared-state.mjs";
|
|
9
8
|
import { createStreamReader, createStreamSink } from "../utils/streaming-channel.mjs";
|
|
9
|
+
import { DEVTOOLS_CONNECTION_META_FILENAME, DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME } from "../constants.mjs";
|
|
10
10
|
import { promiseWithResolver } from "../utils/promise.mjs";
|
|
11
11
|
import { hash } from "ohash";
|
|
12
|
-
//#region src/client/context.ts
|
|
13
|
-
const CLIENT_CONTEXT_KEY = "__VITE_DEVTOOLS_CLIENT_CONTEXT__";
|
|
14
|
-
/**
|
|
15
|
-
* Get the global DevTools client context, or `undefined` if not yet initialized.
|
|
16
|
-
*/
|
|
17
|
-
function getDevToolsClientContext() {
|
|
18
|
-
return globalThis[CLIENT_CONTEXT_KEY];
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
12
|
//#region src/client/rpc-shared-state.ts
|
|
22
13
|
function createRpcSharedStateClientHost(rpc) {
|
|
23
14
|
const sharedState = /* @__PURE__ */ new Map();
|
|
@@ -1670,4 +1661,4 @@ async function getDevToolsRpcClient(options = {}) {
|
|
|
1670
1661
|
return rpc;
|
|
1671
1662
|
}
|
|
1672
1663
|
//#endregion
|
|
1673
|
-
export {
|
|
1664
|
+
export { getDevToolsRpcClient as connectDevtool, getDevToolsRpcClient, createRpcStreamingClientHost };
|
package/dist/constants.d.mts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { Z as DevToolsDocksUserSettings } from "./devtool-Bm6zZAw5.mjs";
|
|
2
|
-
|
|
3
1
|
//#region src/constants.d.ts
|
|
4
|
-
declare const DEVTOOLS_MOUNT_PATH = "
|
|
5
|
-
declare const DEVTOOLS_MOUNT_PATH_NO_TRAILING_SLASH = "
|
|
6
|
-
declare const DEVTOOLS_DIRNAME = "
|
|
7
|
-
declare const DEVTOOLS_CONNECTION_META_FILENAME = ".
|
|
8
|
-
declare const DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME = "
|
|
9
|
-
declare const DEVTOOLS_DOCK_IMPORTS_FILENAME = "
|
|
10
|
-
declare const DEVTOOLS_DOCK_IMPORTS_VIRTUAL_ID = "
|
|
11
|
-
declare const DEVTOOLS_RPC_DUMP_DIRNAME = "
|
|
2
|
+
declare const DEVTOOLS_MOUNT_PATH = "/__devtools/";
|
|
3
|
+
declare const DEVTOOLS_MOUNT_PATH_NO_TRAILING_SLASH = "/__devtools";
|
|
4
|
+
declare const DEVTOOLS_DIRNAME = "__devtools";
|
|
5
|
+
declare const DEVTOOLS_CONNECTION_META_FILENAME = "__connection.json";
|
|
6
|
+
declare const DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME = "__rpc-dump/index.json";
|
|
7
|
+
declare const DEVTOOLS_DOCK_IMPORTS_FILENAME = "__client-imports.js";
|
|
8
|
+
declare const DEVTOOLS_DOCK_IMPORTS_VIRTUAL_ID = "/__devtools-client-imports.js";
|
|
9
|
+
declare const DEVTOOLS_RPC_DUMP_DIRNAME = "__rpc-dump";
|
|
12
10
|
/**
|
|
13
|
-
* URL fragment / query parameter name carrying the
|
|
14
|
-
* descriptor
|
|
11
|
+
* URL fragment / query parameter name carrying the remote dock
|
|
12
|
+
* connection descriptor (defined as `RemoteConnectionInfo` in
|
|
13
|
+
* `@vitejs/devtools-kit`) injected into remote-UI iframe dock URLs.
|
|
15
14
|
*/
|
|
16
15
|
declare const REMOTE_CONNECTION_KEY = "vite-devtools-kit-connection";
|
|
17
|
-
declare const DEFAULT_CATEGORIES_ORDER: Record<string, number>;
|
|
18
|
-
declare const DEFAULT_STATE_USER_SETTINGS: () => DevToolsDocksUserSettings;
|
|
19
16
|
//#endregion
|
|
20
|
-
export {
|
|
17
|
+
export { DEVTOOLS_CONNECTION_META_FILENAME, DEVTOOLS_DIRNAME, DEVTOOLS_DOCK_IMPORTS_FILENAME, DEVTOOLS_DOCK_IMPORTS_VIRTUAL_ID, DEVTOOLS_MOUNT_PATH, DEVTOOLS_MOUNT_PATH_NO_TRAILING_SLASH, DEVTOOLS_RPC_DUMP_DIRNAME, DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME, REMOTE_CONNECTION_KEY };
|
package/dist/constants.mjs
CHANGED
|
@@ -1,34 +1,17 @@
|
|
|
1
1
|
//#region src/constants.ts
|
|
2
|
-
const DEVTOOLS_MOUNT_PATH = "
|
|
3
|
-
const DEVTOOLS_MOUNT_PATH_NO_TRAILING_SLASH = "
|
|
4
|
-
const DEVTOOLS_DIRNAME = "
|
|
5
|
-
const DEVTOOLS_CONNECTION_META_FILENAME = ".
|
|
6
|
-
const DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME = "
|
|
7
|
-
const DEVTOOLS_DOCK_IMPORTS_FILENAME = "
|
|
8
|
-
const DEVTOOLS_DOCK_IMPORTS_VIRTUAL_ID = "
|
|
9
|
-
const DEVTOOLS_RPC_DUMP_DIRNAME = "
|
|
2
|
+
const DEVTOOLS_MOUNT_PATH = "/__devtools/";
|
|
3
|
+
const DEVTOOLS_MOUNT_PATH_NO_TRAILING_SLASH = "/__devtools";
|
|
4
|
+
const DEVTOOLS_DIRNAME = "__devtools";
|
|
5
|
+
const DEVTOOLS_CONNECTION_META_FILENAME = "__connection.json";
|
|
6
|
+
const DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME = "__rpc-dump/index.json";
|
|
7
|
+
const DEVTOOLS_DOCK_IMPORTS_FILENAME = "__client-imports.js";
|
|
8
|
+
const DEVTOOLS_DOCK_IMPORTS_VIRTUAL_ID = "/__devtools-client-imports.js";
|
|
9
|
+
const DEVTOOLS_RPC_DUMP_DIRNAME = "__rpc-dump";
|
|
10
10
|
/**
|
|
11
|
-
* URL fragment / query parameter name carrying the
|
|
12
|
-
* descriptor
|
|
11
|
+
* URL fragment / query parameter name carrying the remote dock
|
|
12
|
+
* connection descriptor (defined as `RemoteConnectionInfo` in
|
|
13
|
+
* `@vitejs/devtools-kit`) injected into remote-UI iframe dock URLs.
|
|
13
14
|
*/
|
|
14
15
|
const REMOTE_CONNECTION_KEY = "vite-devtools-kit-connection";
|
|
15
|
-
const DEFAULT_CATEGORIES_ORDER = {
|
|
16
|
-
"~viteplus": -1e3,
|
|
17
|
-
"default": 0,
|
|
18
|
-
"app": 100,
|
|
19
|
-
"framework": 200,
|
|
20
|
-
"web": 300,
|
|
21
|
-
"advanced": 400,
|
|
22
|
-
"~builtin": 1e3
|
|
23
|
-
};
|
|
24
|
-
const DEFAULT_STATE_USER_SETTINGS = () => ({
|
|
25
|
-
docksHidden: [],
|
|
26
|
-
docksCategoriesHidden: [],
|
|
27
|
-
docksPinned: [],
|
|
28
|
-
docksCustomOrder: {},
|
|
29
|
-
showIframeAddressBar: false,
|
|
30
|
-
closeOnOutsideClick: false,
|
|
31
|
-
commandShortcuts: {}
|
|
32
|
-
});
|
|
33
16
|
//#endregion
|
|
34
|
-
export {
|
|
17
|
+
export { DEVTOOLS_CONNECTION_META_FILENAME, DEVTOOLS_DIRNAME, DEVTOOLS_DOCK_IMPORTS_FILENAME, DEVTOOLS_DOCK_IMPORTS_VIRTUAL_ID, DEVTOOLS_MOUNT_PATH, DEVTOOLS_MOUNT_PATH_NO_TRAILING_SLASH, DEVTOOLS_RPC_DUMP_DIRNAME, DEVTOOLS_RPC_DUMP_MANIFEST_FILENAME, REMOTE_CONNECTION_KEY };
|