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
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { consoleReporter, createLogger, defineDiagnostics } from "logs-sdk";
|
|
2
|
+
import c from "ansis";
|
|
3
|
+
import { ansiFormatter } from "logs-sdk/formatters/ansi";
|
|
4
|
+
//#region src/node/diagnostics.ts
|
|
5
|
+
const diagnostics = defineDiagnostics({
|
|
6
|
+
docsBase: "https://devfra.me/errors",
|
|
7
|
+
codes: {
|
|
8
|
+
DF0006: { message: (p) => `RPC function "${p.name}" is not registered` },
|
|
9
|
+
DF0007: { message: "AsyncLocalStorage is not set, it likely to be an internal bug of the DevTools foundation" },
|
|
10
|
+
DF0008: { message: (p) => `distDir ${p.distDir} does not exist` },
|
|
11
|
+
DF0012: {
|
|
12
|
+
message: (p) => `Failed to parse storage file: ${p.filepath}, falling back to defaults.`,
|
|
13
|
+
level: "warn"
|
|
14
|
+
},
|
|
15
|
+
DF0013: { message: (p) => `Shared state of "${p.key}" is not found, please provide an initial value for the first time` },
|
|
16
|
+
DF0014: {
|
|
17
|
+
message: (p) => `RPC function "${p.name}" has an invalid \`agent\` field — \`description\` must be a non-empty string.`,
|
|
18
|
+
hint: "Provide a short description (~1–3 sentences) explaining what the tool does and when agents should invoke it."
|
|
19
|
+
},
|
|
20
|
+
DF0015: {
|
|
21
|
+
message: (p) => `Agent tool "${p.id}" is already registered.`,
|
|
22
|
+
hint: "Tool ids must be unique across RPC functions with an `agent` field and tools registered via `ctx.agent.registerTool()`."
|
|
23
|
+
},
|
|
24
|
+
DF0016: { message: (p) => `Agent resource "${p.id}" is already registered.` },
|
|
25
|
+
DF0017: { message: (p) => `Failed to start MCP server (${p.transport}): ${p.reason}` },
|
|
26
|
+
DF0029: {
|
|
27
|
+
message: (p) => `Stream "${p.channel}#${p.id}" dropped ${p.dropped} chunk(s) after exceeding the client high-water mark.`,
|
|
28
|
+
hint: "The consumer is too slow for the producer. Raise `highWaterMark` on the subscription, slow the producer, or batch chunks.",
|
|
29
|
+
level: "warn"
|
|
30
|
+
},
|
|
31
|
+
DF0030: {
|
|
32
|
+
message: (p) => `Stream "${p.channel}#${p.id}" is unknown — no producer has called \`channel.start({ id: "${p.id}" })\`.`,
|
|
33
|
+
hint: "Ensure the server-side producer is running before clients subscribe, or check for typos in the stream id."
|
|
34
|
+
},
|
|
35
|
+
DF0031: {
|
|
36
|
+
message: (p) => `Cannot write to closed stream "${p.channel}#${p.id}".`,
|
|
37
|
+
hint: "Track the producer lifecycle — guard writes with the `stream.signal.aborted` flag."
|
|
38
|
+
},
|
|
39
|
+
DF0032: {
|
|
40
|
+
message: (p) => `Streaming channel "${p.channel}" is already registered.`,
|
|
41
|
+
hint: "Each channel name must be unique within a context. Pick a different name or reuse the existing channel handle."
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const logger = createLogger({
|
|
46
|
+
diagnostics: [diagnostics],
|
|
47
|
+
formatter: ansiFormatter(c),
|
|
48
|
+
reporters: consoleReporter
|
|
49
|
+
});
|
|
50
|
+
//#endregion
|
|
51
|
+
export { logger as n, diagnostics as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as RpcReturnSchema, S as RpcFunctionsCollector, b as RpcFunctionSetupResult, c as RpcDumpClientOptions, g as RpcFunctionDefinitionAny, h as RpcFunctionDefinition, i as RpcArgsSchema, l as RpcDumpCollectionOptions, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpStore, x as RpcFunctionType } from "./types-
|
|
1
|
+
import { C as RpcReturnSchema, S as RpcFunctionsCollector, b as RpcFunctionSetupResult, c as RpcDumpClientOptions, g as RpcFunctionDefinitionAny, h as RpcFunctionDefinition, i as RpcArgsSchema, l as RpcDumpCollectionOptions, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpStore, x as RpcFunctionType } from "./types-C5OVe4AC.mjs";
|
|
2
2
|
import { deserialize as structuredCloneDeserialize, parse as structuredCloneParse, serialize as structuredCloneSerialize, stringify as structuredCloneStringify } from "structured-clone-es";
|
|
3
3
|
|
|
4
4
|
//#region src/rpc/cache.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { C as RpcReturnSchema, h as RpcFunctionDefinition, i as RpcArgsSchema, m as RpcFunctionAgentOptions, x as RpcFunctionType } from "./types-
|
|
3
|
-
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-
|
|
1
|
+
import { $ as AgentHandle, B as EntriesToObject, G as DevToolsRpcSharedStates, H as Thenable, J as JsonRenderer, K as JsonRenderElement, Q as DevToolsDiagnosticsLogger, U as DevToolsRpcClientFunctions, V as PartialWithoutId, W as DevToolsRpcServerFunctions, X as DevToolsDiagnosticsDefinition, Y as DevToolsHost, Z as DevToolsDiagnosticsHost, _ as RpcStreamingChannel, a as DevtoolRuntime, at as AgentToolInput, c as defineDevtool, ct as EventEmitter, d as DevToolsNodeContext, et as AgentManifest, f as DevToolsNodeRpcSession, g as RpcSharedStateHost, h as RpcSharedStateGetOptions, i as DevtoolDeploymentKind, it as AgentTool, l as ConnectionMeta, lt as EventUnsubscribe, m as RpcFunctionsHost, n as DevtoolCliOptions, nt as AgentResourceContent, o as DevtoolSetupInfo, ot as DevToolsAgentHost, p as RpcBroadcastOptions, q as JsonRenderSpec, r as DevtoolDefinition, rt as AgentResourceInput, s as DevtoolSpaOptions, st as DevToolsAgentHostEvents, t as DevtoolBrowserContext, tt as AgentResource, u as DevToolsCapabilities, ut as EventsMap, v as RpcStreamingChannelOptions, y as RpcStreamingHost, z as DevToolsViewHost } from "./devtool-CNvLs2_Y.mjs";
|
|
2
|
+
import { C as RpcReturnSchema, h as RpcFunctionDefinition, i as RpcArgsSchema, m as RpcFunctionAgentOptions, x as RpcFunctionType } from "./types-C5OVe4AC.mjs";
|
|
3
|
+
import { t as DevToolsNodeRpcSessionMeta } from "./ws-server-C7LnhOHi.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define.d.ts
|
|
6
6
|
declare const defineRpcFunction: <NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends RpcArgsSchema | undefined = undefined, const RS extends RpcReturnSchema | undefined = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevToolsNodeContext>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevToolsNodeContext>;
|
|
7
|
-
declare function defineCommand(command: DevToolsServerCommandInput): DevToolsServerCommandInput;
|
|
8
7
|
declare function defineJsonRenderSpec(spec: JsonRenderSpec): JsonRenderSpec;
|
|
9
8
|
//#endregion
|
|
10
|
-
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput,
|
|
9
|
+
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsDiagnosticsDefinition, DevToolsDiagnosticsHost, DevToolsDiagnosticsLogger, DevToolsHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsViewHost, DevtoolBrowserContext, DevtoolCliOptions, DevtoolDefinition, DevtoolDeploymentKind, DevtoolRuntime, DevtoolSetupInfo, DevtoolSpaOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, JsonRenderElement, JsonRenderSpec, JsonRenderer, PartialWithoutId, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineDevtool, defineJsonRenderSpec, defineRpcFunction };
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { t as createDefineWrapperWithContext } from "./define-Bb4zh-Dc.mjs";
|
|
2
2
|
//#region src/define.ts
|
|
3
3
|
const defineRpcFunction = createDefineWrapperWithContext();
|
|
4
|
-
function defineCommand(command) {
|
|
5
|
-
return command;
|
|
6
|
-
}
|
|
7
4
|
function defineJsonRenderSpec(spec) {
|
|
8
5
|
return spec;
|
|
9
6
|
}
|
|
10
7
|
//#endregion
|
|
11
|
-
export {
|
|
8
|
+
export { defineJsonRenderSpec, defineRpcFunction };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { i as DevtoolDeploymentKind, r as DevtoolDefinition } from "../devtool-CNvLs2_Y.mjs";
|
|
2
|
+
import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevToolsInternalContext } from "../context-internal-saIAfNVw.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/adapters/_shared.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolve the mount base path for a devtool'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 devtool author can override with `basePath` on the definition.
|
|
12
|
+
*/
|
|
13
|
+
declare function resolveBasePath(def: DevtoolDefinition, kind: DevtoolDeploymentKind): 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,3 @@
|
|
|
1
|
+
import { n as internalContextMap, t as getInternalContext } from "../context-internal-Dx_NoSv1.mjs";
|
|
2
|
+
import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-iZy45oG3.mjs";
|
|
3
|
+
export { getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,60 +1,13 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { g as RpcFunctionsCollectorBase } from "../index-
|
|
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 { $ as AgentHandle, P as SharedState, Q as DevToolsDiagnosticsLogger, U as DevToolsRpcClientFunctions, W as DevToolsRpcServerFunctions, Y as DevToolsHost, Z as DevToolsDiagnosticsHost$1, at as AgentToolInput, ct as EventEmitter, d as DevToolsNodeContext, et as AgentManifest, f as DevToolsNodeRpcSession, g as RpcSharedStateHost, it as AgentTool, m as RpcFunctionsHost$1, nt as AgentResourceContent, ot as DevToolsAgentHost$1, p as RpcBroadcastOptions, rt as AgentResourceInput, st as DevToolsAgentHostEvents, tt as AgentResource, y as RpcStreamingHost, z as DevToolsViewHost$1 } from "../devtool-CNvLs2_Y.mjs";
|
|
2
|
+
import { g as RpcFunctionsCollectorBase } from "../index-CuLRIMto.mjs";
|
|
3
|
+
import { g as RpcFunctionDefinitionAny } from "../types-C5OVe4AC.mjs";
|
|
4
|
+
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-C7LnhOHi.mjs";
|
|
5
|
+
import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-BAqOajx_.mjs";
|
|
6
|
+
import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevToolsInternalContext } from "../context-internal-saIAfNVw.mjs";
|
|
6
7
|
import { createLogger, defineDiagnostics } from "logs-sdk";
|
|
7
8
|
import { BirpcGroup } from "birpc";
|
|
8
9
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
9
10
|
|
|
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
11
|
//#region src/node/auth-revoke.d.ts
|
|
59
12
|
/**
|
|
60
13
|
* Flip `isTrusted` to false on any live WS clients connected with `token`
|
|
@@ -109,19 +62,16 @@ interface CreateHostContextOptions {
|
|
|
109
62
|
builtinRpcDeclarations?: readonly RpcFunctionDefinitionAny[];
|
|
110
63
|
}
|
|
111
64
|
/**
|
|
112
|
-
* Framework-neutral core of the DevTools node context. Wires the
|
|
113
|
-
* host
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
65
|
+
* Framework-neutral core of the DevTools node context. Wires the RPC
|
|
66
|
+
* host, view (HTTP file-serving) host, diagnostics, and agent
|
|
67
|
+
* subsystems plus the JSON-render factory. Hub-level subsystems
|
|
68
|
+
* (`docks`, `terminals`, `messages`, `commands`) are owned by
|
|
69
|
+
* `@vitejs/devtools-kit` — its `createKitContext` wraps this and
|
|
70
|
+
* attaches them when the devtool is mounted into a multi-integration
|
|
71
|
+
* hub.
|
|
117
72
|
*/
|
|
118
73
|
declare function createHostContext(options: CreateHostContextOptions): Promise<DevToolsNodeContext>;
|
|
119
74
|
//#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
75
|
//#region src/node/host-agent.d.ts
|
|
126
76
|
/**
|
|
127
77
|
* Framework-neutral host aggregating the agent-exposed surface of a
|
|
@@ -156,20 +106,6 @@ declare class DevToolsAgentHost implements DevToolsAgentHost$1 {
|
|
|
156
106
|
private _coercePositionalArgs;
|
|
157
107
|
}
|
|
158
108
|
//#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
109
|
//#region src/node/host-diagnostics.d.ts
|
|
174
110
|
declare class DevToolsDiagnosticsHost implements DevToolsDiagnosticsHost$1 {
|
|
175
111
|
readonly context: DevToolsNodeContext;
|
|
@@ -183,30 +119,6 @@ declare class DevToolsDiagnosticsHost implements DevToolsDiagnosticsHost$1 {
|
|
|
183
119
|
private _rebuild;
|
|
184
120
|
}
|
|
185
121
|
//#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
122
|
//#region src/node/host-functions.d.ts
|
|
211
123
|
declare class RpcFunctionsHost extends RpcFunctionsCollectorBase<DevToolsRpcServerFunctions, DevToolsNodeContext> implements RpcFunctionsHost$1 {
|
|
212
124
|
/**
|
|
@@ -264,50 +176,6 @@ interface CreateH3DevToolsHostOptions {
|
|
|
264
176
|
*/
|
|
265
177
|
declare function createH3DevToolsHost(options: CreateH3DevToolsHostOptions): DevToolsHost;
|
|
266
178
|
//#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
179
|
//#region src/node/host-views.d.ts
|
|
312
180
|
declare class DevToolsViewHost implements DevToolsViewHost$1 {
|
|
313
181
|
readonly context: DevToolsNodeContext;
|
|
@@ -378,4 +246,4 @@ declare function createStorage<T extends object>(options: CreateStorageOptions<T
|
|
|
378
246
|
declare function isObject(value: unknown): value is Record<string, any>;
|
|
379
247
|
declare function normalizeHttpServerUrl(host: string, port: number | string): string;
|
|
380
248
|
//#endregion
|
|
381
|
-
export {
|
|
249
|
+
export { CreateH3DevToolsHostOptions, CreateHostContextOptions, CreateStorageOptions, DevToolsAgentHost, DevToolsDiagnosticsHost, DevToolsInternalContext, DevToolsViewHost, InternalAnonymousAuthStorage, PendingAuthRequest, RemoteTokenRecord, RpcFunctionsHost, StartHttpAndWsOptions, StartedServer, StaticRpcDumpCollection, StaticRpcDumpFile, StaticRpcDumpManifest, StaticRpcDumpManifestQueryEntry, StaticRpcDumpManifestStaticEntry, StaticRpcDumpManifestValue, StaticRpcDumpSerialization, abortPendingAuth, collectStaticRpcDump, consumeTempAuthToken, createH3DevToolsHost, createHostContext, createRpcSharedStateServerHost, createRpcStreamingServerHost, createStorage, getInternalContext, getPendingAuth, getTempAuthToken, internalContextMap, isObject, normalizeHttpServerUrl, refreshTempAuthToken, revokeActiveConnectionsForToken, revokeAuthToken, setPendingAuth, startHttpAndWs };
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { t as import_dist } from "../human-id-
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
1
|
+
import { t as import_dist } from "../human-id-BLoGo_e5.mjs";
|
|
2
|
+
import { a as revokeAuthToken, i as revokeActiveConnectionsForToken, n as internalContextMap, r as createStorage, t as getInternalContext } from "../context-internal-Dx_NoSv1.mjs";
|
|
3
|
+
import { a as createRpcSharedStateServerHost, i as createRpcStreamingServerHost, n as DevToolsViewHost, o as DevToolsDiagnosticsHost, r as RpcFunctionsHost, s as DevToolsAgentHost, t as createHostContext } from "../context-BJ4r2SmR.mjs";
|
|
4
|
+
import { t as createH3DevToolsHost } from "../host-h3-9jeHcltx.mjs";
|
|
5
|
+
import { t as startHttpAndWs } from "../server-CBsxXIH5.mjs";
|
|
6
|
+
import { t as collectStaticRpcDump } from "../static-dump-D5VH8Iqk.mjs";
|
|
6
7
|
import { isIP } from "node:net";
|
|
7
8
|
//#region src/node/auth-state.ts
|
|
8
9
|
let pendingAuth = null;
|
|
@@ -67,4 +68,4 @@ function normalizeHttpServerUrl(host, port) {
|
|
|
67
68
|
return `http://${host === "127.0.0.1" ? "localhost" : isIP(host) === 6 ? `[${host}]` : host}:${port}`;
|
|
68
69
|
}
|
|
69
70
|
//#endregion
|
|
70
|
-
export {
|
|
71
|
+
export { DevToolsAgentHost, DevToolsDiagnosticsHost, DevToolsViewHost, RpcFunctionsHost, abortPendingAuth, collectStaticRpcDump, consumeTempAuthToken, createH3DevToolsHost, createHostContext, createRpcSharedStateServerHost, createRpcStreamingServerHost, createStorage, getInternalContext, getPendingAuth, getTempAuthToken, internalContextMap, isObject, normalizeHttpServerUrl, refreshTempAuthToken, revokeActiveConnectionsForToken, revokeAuthToken, setPendingAuth, startHttpAndWs };
|
|
@@ -1,4 +1,4 @@
|
|
|
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-C5OVe4AC.mjs";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
|
|
4
4
|
//#region src/recipes/open-helpers.d.ts
|
|
@@ -52,7 +52,7 @@ const openInFinder = defineRpcFunction({
|
|
|
52
52
|
args: [v.string()],
|
|
53
53
|
returns: v.void(),
|
|
54
54
|
async handler(path) {
|
|
55
|
-
const { default: open } = await import("../open-
|
|
55
|
+
const { default: open } = await import("../open-Dede_w9r.mjs");
|
|
56
56
|
await open(path);
|
|
57
57
|
}
|
|
58
58
|
});
|
package/dist/rpc/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as RpcCacheManager, a as structuredCloneDeserialize, c as structuredCloneStringify, d as createClientFromDump, f as dumpFunctions, g as RpcFunctionsCollectorBase, h as defineRpcFunction, i as strictJsonStringify, l as getRpcHandler, m as createDefineWrapperWithContext, n as validateDefinitions, o as structuredCloneParse, p as getDefinitionsWithDumps, r as STRUCTURED_CLONE_PREFIX, s as structuredCloneSerialize, t as validateDefinition, u as getRpcResolvedSetupResult, v as RpcCacheOptions } from "../index-
|
|
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-
|
|
1
|
+
import { _ as RpcCacheManager, a as structuredCloneDeserialize, c as structuredCloneStringify, d as createClientFromDump, f as dumpFunctions, g as RpcFunctionsCollectorBase, h as defineRpcFunction, i as strictJsonStringify, l as getRpcHandler, m as createDefineWrapperWithContext, n as validateDefinitions, o as structuredCloneParse, p as getDefinitionsWithDumps, r as STRUCTURED_CLONE_PREFIX, s as structuredCloneSerialize, t as validateDefinition, u as getRpcResolvedSetupResult, v as RpcCacheOptions } from "../index-CuLRIMto.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-C5OVe4AC.mjs";
|
|
3
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, structuredCloneDeserialize, structuredCloneParse, structuredCloneSerialize, structuredCloneStringify, 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-CjPuPFbA.mjs";
|
|
2
2
|
export { WsRpcChannelOptions, createWsRpcChannel };
|
|
@@ -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-C7LnhOHi.mjs";
|
|
2
2
|
export { DevToolsNodeRpcSessionMeta, WsRpcTransportOptions, attachWsRpcTransport };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { U as DevToolsRpcClientFunctions, W as DevToolsRpcServerFunctions, d as DevToolsNodeContext } from "./devtool-CNvLs2_Y.mjs";
|
|
2
2
|
import { BirpcGroup } from "birpc";
|
|
3
3
|
import { WebSocketServer } from "ws";
|
|
4
4
|
import { App } from "h3";
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { m as RpcFunctionAgentOptions } from "../types-
|
|
3
|
-
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-
|
|
4
|
-
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput,
|
|
1
|
+
import { $ as AgentHandle, B as EntriesToObject, G as DevToolsRpcSharedStates, H as Thenable, J as JsonRenderer, K as JsonRenderElement, Q as DevToolsDiagnosticsLogger, U as DevToolsRpcClientFunctions, V as PartialWithoutId, W as DevToolsRpcServerFunctions, X as DevToolsDiagnosticsDefinition, Y as DevToolsHost, Z as DevToolsDiagnosticsHost, _ as RpcStreamingChannel, a as DevtoolRuntime, at as AgentToolInput, c as defineDevtool, ct as EventEmitter, d as DevToolsNodeContext, et as AgentManifest, f as DevToolsNodeRpcSession, g as RpcSharedStateHost, h as RpcSharedStateGetOptions, i as DevtoolDeploymentKind, it as AgentTool, l as ConnectionMeta, lt as EventUnsubscribe, m as RpcFunctionsHost, n as DevtoolCliOptions, nt as AgentResourceContent, o as DevtoolSetupInfo, ot as DevToolsAgentHost, p as RpcBroadcastOptions, q as JsonRenderSpec, r as DevtoolDefinition, rt as AgentResourceInput, s as DevtoolSpaOptions, st as DevToolsAgentHostEvents, t as DevtoolBrowserContext, tt as AgentResource, u as DevToolsCapabilities, ut as EventsMap, v as RpcStreamingChannelOptions, y as RpcStreamingHost, z as DevToolsViewHost } from "../devtool-CNvLs2_Y.mjs";
|
|
2
|
+
import { m as RpcFunctionAgentOptions } from "../types-C5OVe4AC.mjs";
|
|
3
|
+
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-C7LnhOHi.mjs";
|
|
4
|
+
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsDiagnosticsDefinition, DevToolsDiagnosticsHost, DevToolsDiagnosticsLogger, DevToolsHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsViewHost, DevtoolBrowserContext, DevtoolCliOptions, DevtoolDefinition, DevtoolDeploymentKind, DevtoolRuntime, DevtoolSetupInfo, DevtoolSpaOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, JsonRenderElement, JsonRenderSpec, JsonRenderer, PartialWithoutId, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineDevtool };
|
package/dist/utils/events.d.mts
CHANGED
package/dist/utils/human-id.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as ImmutableArray, F as SharedStateEvents, I as SharedStateOptions, L as SharedStatePatch, M as ImmutableObject, N as ImmutableSet, P as SharedState, R as createSharedState, j as ImmutableMap, k as Immutable } from "../devtool-CNvLs2_Y.mjs";
|
|
2
2
|
export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
|
package/dist/utils/state.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as StreamErrorPayload, D as createStreamReader, E as StreamSinkEvents, O as createStreamSink, S as CreateStreamSinkOptions, T as StreamSink, b as BufferedChunk, w as StreamReader, x as CreateStreamReaderOptions } from "../devtool-CNvLs2_Y.mjs";
|
|
2
2
|
export { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink };
|