devframe 0.1.18 → 0.1.20
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 +2 -2
- package/dist/{_shared-Bxa2_kq7.mjs → _shared-S-Ujqz_L.mjs} +1 -1
- package/dist/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +9 -5
- package/dist/adapters/cli.d.mts +2 -2
- package/dist/adapters/cli.mjs +78 -292
- package/dist/adapters/dev.d.mts +83 -0
- package/dist/adapters/dev.mjs +2 -0
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/kit.d.mts +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +6 -3
- package/dist/adapters/vite.d.mts +1 -1
- package/dist/adapters/vite.mjs +1 -1
- package/dist/client/index.d.mts +41 -5
- package/dist/client/index.mjs +1673 -2
- package/dist/constants.d.mts +1 -1
- package/dist/{context-xQo1FcxX.mjs → context-BfvbAyGk.mjs} +429 -41
- package/dist/dev-B8i_CBlQ.mjs +325 -0
- package/dist/{devtool-CHT-4_OU.d.mts → devtool-Bm6zZAw5.d.mts} +371 -28
- package/dist/host-h3-BMvrFzIJ.mjs +24 -0
- package/dist/{index-Cei8vVcd.d.mts → index-BCo03GEF.d.mts} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +11 -2
- package/dist/node/index.d.mts +41 -53
- package/dist/node/index.mjs +5 -4
- package/dist/recipes/open-helpers.d.mts +1 -1
- package/dist/recipes/open-helpers.mjs +4 -2
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/index.mjs +3 -3
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +1 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +1 -1
- package/dist/{rpc-hbRk8qtt.mjs → rpc-INbWfHoX.mjs} +1 -1
- package/dist/{serialization-CWcWE7x7.mjs → serialization-DwKi05Pn.mjs} +1 -1
- package/dist/server-DksyT-um.d.mts +54 -0
- package/dist/{server-DkJ2-s0Y.mjs → server-qRRM8t3v.mjs} +27 -2
- package/dist/{static-dump-DwFfj4U_.mjs → static-dump-C1aVSwxY.mjs} +2 -19
- package/dist/types/index.d.mts +4 -4
- package/dist/{types-BkyzI9r4.d.mts → types-ag029cAe.d.mts} +1 -1
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/shared-state.d.mts +2 -2
- package/dist/utils/shared-state.mjs +1 -1
- package/dist/utils/state.d.mts +2 -1
- package/dist/utils/state.mjs +1 -1
- package/dist/utils/streaming-channel.d.mts +2 -0
- package/dist/utils/streaming-channel.mjs +255 -0
- package/dist/{ws-client-CDGmViwt.d.mts → ws-client-DQySVfF_.d.mts} +1 -1
- package/dist/{ws-server-Cu8tmZcF.d.mts → ws-server-VQqESKAs.d.mts} +13 -1
- package/package.json +10 -17
- package/skills/devframe/README.md +13 -0
- package/skills/devframe/SKILL.md +452 -0
- package/skills/devframe/templates/counter-devtool.ts +29 -0
- package/skills/devframe/templates/spa-devtool.ts +33 -0
- package/skills/devframe/templates/vite-client.ts +11 -0
- package/dist/client-CsR1_h3o.mjs +0 -1569
- package/dist/helpers/nuxt/index.d.mts +0 -46
- package/dist/helpers/nuxt/index.mjs +0 -58
- package/dist/helpers/nuxt/runtime/plugin.client.d.mts +0 -8
- package/dist/helpers/nuxt/runtime/plugin.client.mjs +0 -12
- package/dist/immer-DEqg5kOd.mjs +0 -894
- package/dist/src-DIKqQIjp.mjs +0 -85
- /package/dist/{define-CW9gLnyG.mjs → define-Bb4zh-Dc.mjs} +0 -0
- /package/dist/{main-BJD9t8dk.mjs → main-DpINGndA.mjs} +0 -0
- /package/dist/{open-BMO2_-wC.mjs → open-BtOOEldu.mjs} +0 -0
- /package/dist/{transports-4bqw6Fqg.mjs → transports-BPUzHhI2.mjs} +0 -0
package/dist/node/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { g as RpcFunctionsCollectorBase } from "../index-
|
|
3
|
-
import { g as RpcFunctionDefinitionAny } from "../types-
|
|
1
|
+
import { $ as DevToolsRpcServerFunctions, $t as AgentManifest, Bt as DevToolsDiagnosticsHost$1, Dt as DevToolsDockUserEntry, Et as DevToolsDockHost$1, G as DevToolsChildProcessExecuteOptions, Gt as DevToolsCommandHandle, I as SharedState, J as DevToolsTerminalSession, Jt as DevToolsCommandsHost$1, K as DevToolsChildProcessTerminalSession, Q as DevToolsRpcClientFunctions, Qt as AgentHandle, St as DevToolsDockEntry, U as PartialWithoutId, V as DevToolsViewHost$1, Vt as DevToolsDiagnosticsLogger, Xt as DevToolsServerCommandEntry, Y as DevToolsTerminalSessionBase, Z as DevToolsDocksUserSettings, Zt as DevToolsServerCommandInput, an as DevToolsAgentHost$1, bt as ClientScriptEntry, d as DevToolsNodeContext, dt as DevToolsMessageEntry, en as AgentResource, g as RpcFunctionsHost$1, h as RpcBroadcastOptions, ht as DevToolsMessageHandle, in as AgentToolInput, m as DevToolsNodeRpcSession, nn as AgentResourceInput, on as DevToolsAgentHostEvents, pt as DevToolsMessageEntryInput, q as DevToolsTerminalHost$1, rn as AgentTool, sn as EventEmitter, tn as AgentResourceContent, v as RpcSharedStateHost, vt as DevToolsMessagesHost$1, x as RpcStreamingHost, yt as DevToolsHost } from "../devtool-Bm6zZAw5.mjs";
|
|
2
|
+
import { g as RpcFunctionsCollectorBase } from "../index-BCo03GEF.mjs";
|
|
3
|
+
import { g as RpcFunctionDefinitionAny } from "../types-ag029cAe.mjs";
|
|
4
|
+
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-VQqESKAs.mjs";
|
|
5
|
+
import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-DksyT-um.mjs";
|
|
4
6
|
import { createLogger, defineDiagnostics } from "logs-sdk";
|
|
5
7
|
import { BirpcGroup } from "birpc";
|
|
6
|
-
import { WebSocketServer } from "ws";
|
|
7
8
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8
|
-
import { App } from "h3";
|
|
9
9
|
|
|
10
10
|
//#region src/node/context-internal.d.ts
|
|
11
11
|
interface InternalAnonymousAuthStorage {
|
|
@@ -216,6 +216,15 @@ declare class RpcFunctionsHost extends RpcFunctionsCollectorBase<DevToolsRpcServ
|
|
|
216
216
|
_asyncStorage: AsyncLocalStorage<DevToolsNodeRpcSession>;
|
|
217
217
|
constructor(context: DevToolsNodeContext);
|
|
218
218
|
sharedState: RpcSharedStateHost;
|
|
219
|
+
streaming: RpcStreamingHost;
|
|
220
|
+
/**
|
|
221
|
+
* Adapters call this from their WS `onDisconnected` hook so downstream
|
|
222
|
+
* hosts (streaming, …) can free per-session state. Public-ish because
|
|
223
|
+
* tests / custom adapters may want to mirror it.
|
|
224
|
+
*
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
227
|
+
_emitSessionDisconnected(meta: DevToolsNodeRpcSessionMeta): void;
|
|
219
228
|
invokeLocal<T extends keyof DevToolsRpcServerFunctions, Args extends Parameters<DevToolsRpcServerFunctions[T]>>(method: T, ...args: Args): Promise<Awaited<ReturnType<DevToolsRpcServerFunctions[T]>>>;
|
|
220
229
|
broadcast<T extends keyof DevToolsRpcClientFunctions, Args extends Parameters<DevToolsRpcClientFunctions[T]>>(options: RpcBroadcastOptions<T, Args>): Promise<void>;
|
|
221
230
|
getCurrentRpcSession(): DevToolsNodeRpcSession | undefined;
|
|
@@ -236,11 +245,22 @@ interface CreateH3DevToolsHostOptions {
|
|
|
236
245
|
* the CLI isn't running, so the default is a no-op.
|
|
237
246
|
*/
|
|
238
247
|
mount?: (base: string, distDir: string) => void | Promise<void>;
|
|
248
|
+
/**
|
|
249
|
+
* Namespace for storage paths returned by `getStorageDir`. Workspace
|
|
250
|
+
* state lives under `${workspaceRoot}/node_modules/.<appName>/devtools/`
|
|
251
|
+
* and global state under `${homedir()}/.<appName>/devtools/`. Pick the
|
|
252
|
+
* devtool's id (or another stable, filesystem-safe identifier) so the
|
|
253
|
+
* standalone host doesn't collide with other tools' storage.
|
|
254
|
+
*/
|
|
255
|
+
appName: string;
|
|
256
|
+
/**
|
|
257
|
+
* Workspace root used as the parent of the per-project storage
|
|
258
|
+
* directory. Defaults to `process.cwd()`.
|
|
259
|
+
*/
|
|
260
|
+
workspaceRoot?: string;
|
|
239
261
|
}
|
|
240
262
|
/**
|
|
241
263
|
* h3-backed {@link DevToolsHost} — used by the standalone CLI adapter.
|
|
242
|
-
* This commit adds the shell; the CLI adapter in commit 5 wires it up
|
|
243
|
-
* with a real h3 app and sirv handler.
|
|
244
264
|
*/
|
|
245
265
|
declare function createH3DevToolsHost(options: CreateH3DevToolsHostOptions): DevToolsHost;
|
|
246
266
|
//#endregion
|
|
@@ -273,7 +293,14 @@ declare class DevToolsTerminalHost implements DevToolsTerminalHost$1 {
|
|
|
273
293
|
readonly sessions: DevToolsTerminalHost$1['sessions'];
|
|
274
294
|
readonly events: DevToolsTerminalHost$1['events'];
|
|
275
295
|
private _boundStreams;
|
|
296
|
+
private _channel?;
|
|
276
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;
|
|
277
304
|
register(session: DevToolsTerminalSession): DevToolsTerminalSession;
|
|
278
305
|
update(patch: PartialWithoutId<DevToolsTerminalSession>): void;
|
|
279
306
|
remove(session: DevToolsTerminalSession): void;
|
|
@@ -298,53 +325,14 @@ declare class DevToolsViewHost implements DevToolsViewHost$1 {
|
|
|
298
325
|
//#region src/node/rpc-shared-state.d.ts
|
|
299
326
|
declare function createRpcSharedStateServerHost(rpc: RpcFunctionsHost$1): RpcSharedStateHost;
|
|
300
327
|
//#endregion
|
|
301
|
-
//#region src/node/
|
|
302
|
-
interface StartHttpAndWsOptions {
|
|
303
|
-
context: DevToolsNodeContext;
|
|
304
|
-
host?: string;
|
|
305
|
-
port: number;
|
|
306
|
-
/**
|
|
307
|
-
* Optional h3 app to mount on. When omitted a fresh one is created;
|
|
308
|
-
* when provided, callers can add their own routes (sirv etc.) first.
|
|
309
|
-
*/
|
|
310
|
-
app?: App;
|
|
311
|
-
/**
|
|
312
|
-
* When `false`, the RPC server is started without a trust handshake.
|
|
313
|
-
* Intended for single-user localhost tools where an auth round-trip
|
|
314
|
-
* would only get in the way. The Vite-flavoured auth layer in
|
|
315
|
-
* `@vitejs/devtools` already honors the equivalent
|
|
316
|
-
* `devtools.clientAuth` setting; devframe records the intent here so
|
|
317
|
-
* future auth plumbing can consult it without another API change.
|
|
318
|
-
*
|
|
319
|
-
* Default: `true`.
|
|
320
|
-
*/
|
|
321
|
-
auth?: boolean;
|
|
322
|
-
/**
|
|
323
|
-
* Called once the WS server is bound so callers can mount static
|
|
324
|
-
* handlers whose origin depends on the resolved port, or print their
|
|
325
|
-
* own startup banner. Devframe does not print one itself.
|
|
326
|
-
*/
|
|
327
|
-
onReady?: (info: {
|
|
328
|
-
origin: string;
|
|
329
|
-
port: number;
|
|
330
|
-
app: App;
|
|
331
|
-
}) => void | Promise<void>;
|
|
332
|
-
}
|
|
333
|
-
interface StartedServer {
|
|
334
|
-
/** Listening origin, e.g. `http://localhost:9999`. */
|
|
335
|
-
origin: string;
|
|
336
|
-
port: number;
|
|
337
|
-
app: App;
|
|
338
|
-
wss: WebSocketServer;
|
|
339
|
-
rpcGroup: BirpcGroup<DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, false>;
|
|
340
|
-
close: () => Promise<void>;
|
|
341
|
-
}
|
|
328
|
+
//#region src/node/rpc-streaming.d.ts
|
|
342
329
|
/**
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
330
|
+
* Build the server-side streaming host. Mirrors the layout of
|
|
331
|
+
* `createRpcSharedStateServerHost` — registers a fixed set of internal
|
|
332
|
+
* RPC methods (`subscribe` / `unsubscribe` / `cancel`) once, then per-channel
|
|
333
|
+
* state lives in a `Map<channelName, ChannelState>`.
|
|
346
334
|
*/
|
|
347
|
-
declare function
|
|
335
|
+
declare function createRpcStreamingServerHost(rpc: RpcFunctionsHost$1): RpcStreamingHost;
|
|
348
336
|
//#endregion
|
|
349
337
|
//#region src/node/static-dump.d.ts
|
|
350
338
|
type StaticRpcDumpSerialization = 'json' | 'structured-clone';
|
|
@@ -390,4 +378,4 @@ declare function createStorage<T extends object>(options: CreateStorageOptions<T
|
|
|
390
378
|
declare function isObject(value: unknown): value is Record<string, any>;
|
|
391
379
|
declare function normalizeHttpServerUrl(host: string, port: number | string): string;
|
|
392
380
|
//#endregion
|
|
393
|
-
export { ContextUtils, CreateH3DevToolsHostOptions, CreateHostContextOptions, CreateStorageOptions, DevToolsAgentHost, DevToolsCommandsHost, DevToolsDiagnosticsHost, DevToolsDockHost, DevToolsInternalContext, DevToolsMessagesHost, DevToolsTerminalHost, DevToolsViewHost, InternalAnonymousAuthStorage, PendingAuthRequest, RemoteTokenRecord, RpcFunctionsHost, StartHttpAndWsOptions, StartedServer, StaticRpcDumpCollection, StaticRpcDumpFile, StaticRpcDumpManifest, StaticRpcDumpManifestQueryEntry, StaticRpcDumpManifestStaticEntry, StaticRpcDumpManifestValue, StaticRpcDumpSerialization, abortPendingAuth, collectStaticRpcDump, consumeTempAuthToken, createH3DevToolsHost, createHostContext, createRpcSharedStateServerHost, createStorage, getInternalContext, getPendingAuth, getTempAuthToken, internalContextMap, isObject, normalizeHttpServerUrl, refreshTempAuthToken, revokeActiveConnectionsForToken, revokeAuthToken, setPendingAuth, startHttpAndWs };
|
|
381
|
+
export { ContextUtils, CreateH3DevToolsHostOptions, CreateHostContextOptions, CreateStorageOptions, DevToolsAgentHost, DevToolsCommandsHost, DevToolsDiagnosticsHost, DevToolsDockHost, DevToolsInternalContext, DevToolsMessagesHost, DevToolsTerminalHost, 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,7 +1,8 @@
|
|
|
1
1
|
import { t as import_dist } from "../human-id-CHS0s28X.mjs";
|
|
2
|
-
import { _ as
|
|
3
|
-
import {
|
|
4
|
-
import { t as startHttpAndWs } from "../server-
|
|
2
|
+
import { _ as revokeActiveConnectionsForToken, a as RpcFunctionsHost, c as DevToolsDockHost, d as createStorage, f as DevToolsDiagnosticsHost, g as ContextUtils, i as DevToolsMessagesHost, l as getInternalContext, m as DevToolsAgentHost, n as DevToolsViewHost, o as createRpcStreamingServerHost, p as DevToolsCommandsHost, r as DevToolsTerminalHost, s as createRpcSharedStateServerHost, t as createHostContext, u as internalContextMap, v as revokeAuthToken } from "../context-BfvbAyGk.mjs";
|
|
3
|
+
import { t as createH3DevToolsHost } from "../host-h3-BMvrFzIJ.mjs";
|
|
4
|
+
import { t as startHttpAndWs } from "../server-qRRM8t3v.mjs";
|
|
5
|
+
import { t as collectStaticRpcDump } from "../static-dump-C1aVSwxY.mjs";
|
|
5
6
|
import { isIP } from "node:net";
|
|
6
7
|
//#region src/node/auth-state.ts
|
|
7
8
|
let pendingAuth = null;
|
|
@@ -66,4 +67,4 @@ function normalizeHttpServerUrl(host, port) {
|
|
|
66
67
|
return `http://${host === "127.0.0.1" ? "localhost" : isIP(host) === 6 ? `[${host}]` : host}:${port}`;
|
|
67
68
|
}
|
|
68
69
|
//#endregion
|
|
69
|
-
export { ContextUtils, DevToolsAgentHost, DevToolsCommandsHost, DevToolsDiagnosticsHost, DevToolsDockHost, DevToolsMessagesHost, DevToolsTerminalHost, DevToolsViewHost, RpcFunctionsHost, abortPendingAuth, collectStaticRpcDump, consumeTempAuthToken, createH3DevToolsHost, createHostContext, createRpcSharedStateServerHost, createStorage, getInternalContext, getPendingAuth, getTempAuthToken, internalContextMap, isObject, normalizeHttpServerUrl, refreshTempAuthToken, revokeActiveConnectionsForToken, revokeAuthToken, setPendingAuth, startHttpAndWs };
|
|
70
|
+
export { ContextUtils, DevToolsAgentHost, DevToolsCommandsHost, DevToolsDiagnosticsHost, DevToolsDockHost, DevToolsMessagesHost, DevToolsTerminalHost, 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-ag029cAe.mjs";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
|
|
4
4
|
//#region src/recipes/open-helpers.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as defineRpcFunction } from "../define-
|
|
1
|
+
import { n as defineRpcFunction } from "../define-Bb4zh-Dc.mjs";
|
|
2
2
|
import * as v from "valibot";
|
|
3
3
|
//#region src/recipes/open-helpers.ts
|
|
4
4
|
/**
|
|
@@ -25,6 +25,7 @@ import * as v from "valibot";
|
|
|
25
25
|
const openInEditor = defineRpcFunction({
|
|
26
26
|
name: "devframe:open-in-editor",
|
|
27
27
|
type: "action",
|
|
28
|
+
jsonSerializable: true,
|
|
28
29
|
args: [v.string()],
|
|
29
30
|
returns: v.void(),
|
|
30
31
|
async handler(filename) {
|
|
@@ -47,10 +48,11 @@ const openInEditor = defineRpcFunction({
|
|
|
47
48
|
const openInFinder = defineRpcFunction({
|
|
48
49
|
name: "devframe:open-in-finder",
|
|
49
50
|
type: "action",
|
|
51
|
+
jsonSerializable: true,
|
|
50
52
|
args: [v.string()],
|
|
51
53
|
returns: v.void(),
|
|
52
54
|
async handler(path) {
|
|
53
|
-
const { default: open } = await import("../open-
|
|
55
|
+
const { default: open } = await import("../open-BtOOEldu.mjs");
|
|
54
56
|
await open(path);
|
|
55
57
|
}
|
|
56
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-BCo03GEF.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-ag029cAe.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 };
|
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 { a as structuredCloneSerialize, i as structuredCloneParse, n as strictJsonStringify, o as structuredCloneStringify, r as structuredCloneDeserialize, t as STRUCTURED_CLONE_PREFIX } from "../serialization-
|
|
3
|
-
import { n as defineRpcFunction, t as createDefineWrapperWithContext } from "../define-
|
|
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-INbWfHoX.mjs";
|
|
2
|
+
import { a as structuredCloneSerialize, i as structuredCloneParse, n as strictJsonStringify, o as structuredCloneStringify, r as structuredCloneDeserialize, t as STRUCTURED_CLONE_PREFIX } from "../serialization-DwKi05Pn.mjs";
|
|
3
|
+
import { n as defineRpcFunction, t as createDefineWrapperWithContext } from "../define-Bb4zh-Dc.mjs";
|
|
4
4
|
export { RpcCacheManager, RpcFunctionsCollectorBase, STRUCTURED_CLONE_PREFIX, 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-DQySVfF_.mjs";
|
|
2
2
|
export { WsRpcChannelOptions, createWsRpcChannel };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as structuredCloneParse, n as strictJsonStringify, o as structuredCloneStringify } from "../../serialization-
|
|
1
|
+
import { i as structuredCloneParse, n as strictJsonStringify, o as structuredCloneStringify } from "../../serialization-DwKi05Pn.mjs";
|
|
2
2
|
//#region src/rpc/transports/ws-client.ts
|
|
3
3
|
function NOOP() {}
|
|
4
4
|
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-VQqESKAs.mjs";
|
|
2
2
|
export { DevToolsNodeRpcSessionMeta, WsRpcTransportOptions, attachWsRpcTransport };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as structuredCloneParse, n as strictJsonStringify, o as structuredCloneStringify } from "../../serialization-
|
|
1
|
+
import { i as structuredCloneParse, n as strictJsonStringify, o as structuredCloneStringify } from "../../serialization-DwKi05Pn.mjs";
|
|
2
2
|
import { createServer } from "node:https";
|
|
3
3
|
import { WebSocketServer } from "ws";
|
|
4
4
|
//#region src/rpc/transports/ws-server.ts
|
|
@@ -2,7 +2,7 @@ import { consoleReporter, createLogger, defineDiagnostics, plainFormatter } from
|
|
|
2
2
|
import { deserialize as structuredCloneDeserialize, parse as structuredCloneParse, serialize as structuredCloneSerialize, stringify as structuredCloneStringify } from "structured-clone-es";
|
|
3
3
|
//#region src/rpc/diagnostics.ts
|
|
4
4
|
const diagnostics = defineDiagnostics({
|
|
5
|
-
docsBase: "https://
|
|
5
|
+
docsBase: "https://devfra.me/errors",
|
|
6
6
|
codes: {
|
|
7
7
|
DF0019: {
|
|
8
8
|
message: (p) => `RPC function "${p.name}" has \`agent\` set but \`jsonSerializable\` is not \`true\` — MCP requires JSON-serializable data.`,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { $ as DevToolsRpcServerFunctions, Q as DevToolsRpcClientFunctions, d as DevToolsNodeContext } from "./devtool-Bm6zZAw5.mjs";
|
|
2
|
+
import { BirpcGroup } from "birpc";
|
|
3
|
+
import { WebSocketServer } from "ws";
|
|
4
|
+
import { App } from "h3";
|
|
5
|
+
|
|
6
|
+
//#region src/node/server.d.ts
|
|
7
|
+
interface StartHttpAndWsOptions {
|
|
8
|
+
context: DevToolsNodeContext;
|
|
9
|
+
host?: string;
|
|
10
|
+
port: number;
|
|
11
|
+
/**
|
|
12
|
+
* Optional h3 app to mount on. When omitted a fresh one is created;
|
|
13
|
+
* when provided, callers can add their own routes (sirv etc.) first.
|
|
14
|
+
*/
|
|
15
|
+
app?: App;
|
|
16
|
+
/**
|
|
17
|
+
* When `false`, the RPC server is started without a trust handshake.
|
|
18
|
+
* Intended for single-user localhost tools where an auth round-trip
|
|
19
|
+
* would only get in the way. The Vite-flavoured auth layer in
|
|
20
|
+
* `@vitejs/devtools` already honors the equivalent
|
|
21
|
+
* `devtools.clientAuth` setting; devframe records the intent here so
|
|
22
|
+
* future auth plumbing can consult it without another API change.
|
|
23
|
+
*
|
|
24
|
+
* Default: `true`.
|
|
25
|
+
*/
|
|
26
|
+
auth?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Called once the WS server is bound so callers can mount static
|
|
29
|
+
* handlers whose origin depends on the resolved port, or print their
|
|
30
|
+
* own startup banner. Devframe does not print one itself.
|
|
31
|
+
*/
|
|
32
|
+
onReady?: (info: {
|
|
33
|
+
origin: string;
|
|
34
|
+
port: number;
|
|
35
|
+
app: App;
|
|
36
|
+
}) => void | Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
interface StartedServer {
|
|
39
|
+
/** Listening origin, e.g. `http://localhost:9999`. */
|
|
40
|
+
origin: string;
|
|
41
|
+
port: number;
|
|
42
|
+
app: App;
|
|
43
|
+
wss: WebSocketServer;
|
|
44
|
+
rpcGroup: BirpcGroup<DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, false>;
|
|
45
|
+
close: () => Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Compose an h3 + WebSocket server for a devtool context. The RPC
|
|
49
|
+
* group is bound to `context.rpc.functions`; the WS endpoint lives on
|
|
50
|
+
* the same port as the HTTP server.
|
|
51
|
+
*/
|
|
52
|
+
declare function startHttpAndWs(options: StartHttpAndWsOptions): Promise<StartedServer>;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { StartedServer as n, startHttpAndWs as r, StartHttpAndWsOptions as t };
|
|
@@ -18,11 +18,36 @@ async function startHttpAndWs(options) {
|
|
|
18
18
|
const wss = new WebSocketServer({ server: httpServer });
|
|
19
19
|
const rpcHost = context.rpc;
|
|
20
20
|
const asyncStorage = new AsyncLocalStorage();
|
|
21
|
-
const rpcGroup = createRpcServer(rpcHost.functions)
|
|
22
|
-
|
|
21
|
+
const rpcGroup = createRpcServer(rpcHost.functions, { rpcOptions: { resolver(name, fn) {
|
|
22
|
+
const rpc = this;
|
|
23
|
+
if (!fn) return void 0;
|
|
24
|
+
return async function(...args) {
|
|
25
|
+
return await asyncStorage.run({
|
|
26
|
+
rpc,
|
|
27
|
+
meta: rpc.$meta
|
|
28
|
+
}, async () => {
|
|
29
|
+
return (await fn).apply(this, args);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
} } });
|
|
33
|
+
attachWsRpcTransport(rpcGroup, {
|
|
34
|
+
wss,
|
|
35
|
+
onDisconnected: (_ws, meta) => {
|
|
36
|
+
rpcHost._emitSessionDisconnected(meta);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
23
39
|
rpcHost._rpcGroup = rpcGroup;
|
|
24
40
|
rpcHost._asyncStorage = asyncStorage;
|
|
25
41
|
rpcHost._authDisabled = options.auth === false;
|
|
42
|
+
if (options.auth === false && !rpcHost.definitions.has("vite:anonymous:auth")) rpcHost.register({
|
|
43
|
+
name: "vite:anonymous:auth",
|
|
44
|
+
type: "action",
|
|
45
|
+
handler: () => {
|
|
46
|
+
const session = rpcHost.getCurrentRpcSession();
|
|
47
|
+
if (session) session.meta.isTrusted = true;
|
|
48
|
+
return { isTrusted: true };
|
|
49
|
+
}
|
|
50
|
+
});
|
|
26
51
|
await new Promise((resolveListen) => {
|
|
27
52
|
httpServer.listen(port, bindHost, () => resolveListen());
|
|
28
53
|
});
|
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
import { n as dumpFunctions, s as getRpcHandler } from "./rpc-
|
|
1
|
+
import { n as dumpFunctions, s as getRpcHandler } from "./rpc-INbWfHoX.mjs";
|
|
2
2
|
import { DEVTOOLS_RPC_DUMP_DIRNAME } from "./constants.mjs";
|
|
3
|
-
//#region src/node/host-h3.ts
|
|
4
|
-
/**
|
|
5
|
-
* h3-backed {@link DevToolsHost} — used by the standalone CLI adapter.
|
|
6
|
-
* This commit adds the shell; the CLI adapter in commit 5 wires it up
|
|
7
|
-
* with a real h3 app and sirv handler.
|
|
8
|
-
*/
|
|
9
|
-
function createH3DevToolsHost(options) {
|
|
10
|
-
return {
|
|
11
|
-
mountStatic(base, distDir) {
|
|
12
|
-
return options.mount?.(base, distDir);
|
|
13
|
-
},
|
|
14
|
-
resolveOrigin() {
|
|
15
|
-
return options.origin;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
3
|
//#region src/node/static-dump.ts
|
|
21
4
|
function makeDumpKey(name) {
|
|
22
5
|
return encodeURIComponent(name.replaceAll(":", "~"));
|
|
@@ -94,4 +77,4 @@ async function collectStaticRpcDump(definitions, context) {
|
|
|
94
77
|
};
|
|
95
78
|
}
|
|
96
79
|
//#endregion
|
|
97
|
-
export {
|
|
80
|
+
export { collectStaticRpcDump as t };
|
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, ClientScriptEntry, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsChildProcessExecuteOptions, DevToolsChildProcessTerminalSession, DevToolsClientCommand, DevToolsCommandBase, DevToolsCommandEntry, DevToolsCommandHandle, DevToolsCommandKeybinding, DevToolsCommandShortcutOverrides, DevToolsCommandsHost, DevToolsCommandsHostEvents, DevToolsDiagnosticsDefinition, DevToolsDiagnosticsHost, DevToolsDiagnosticsLogger, DevToolsDockEntriesGrouped, DevToolsDockEntry, DevToolsDockEntryBase, DevToolsDockEntryCategory, DevToolsDockEntryIcon, DevToolsDockHost, DevToolsDockUserEntry, DevToolsDocksUserSettings, DevToolsHost, DevToolsLogElementPosition, DevToolsLogEntry, DevToolsLogEntryFrom, DevToolsLogEntryInput, DevToolsLogFilePosition, DevToolsLogHandle, DevToolsLogLevel, DevToolsLogsClient, DevToolsLogsHost, DevToolsMessageElementPosition, DevToolsMessageEntry, DevToolsMessageEntryFrom, DevToolsMessageEntryInput, DevToolsMessageFilePosition, DevToolsMessageHandle, DevToolsMessageLevel, DevToolsMessagesClient, DevToolsMessagesHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsNodeUtils, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsServerCommandEntry, DevToolsServerCommandInput, DevToolsTerminalHost, DevToolsTerminalSession, DevToolsTerminalSessionBase,
|
|
1
|
+
import { $ as DevToolsRpcServerFunctions, $t as AgentManifest, At as DevToolsViewCustomRender, Bt as DevToolsDiagnosticsHost, Ct as DevToolsDockEntryBase, Dt as DevToolsDockUserEntry, Et as DevToolsDockHost, Ft as JsonRenderElement, G as DevToolsChildProcessExecuteOptions, Gt as DevToolsCommandHandle, H as EntriesToObject, Ht as DevToolsClientCommand, It as JsonRenderSpec, J as DevToolsTerminalSession, Jt as DevToolsCommandsHost, K as DevToolsChildProcessTerminalSession, Kt as DevToolsCommandKeybinding, Lt as JsonRenderer, Mt as DevToolsViewJsonRender, Nt as DevToolsViewLauncher, Ot as DevToolsViewAction, Pt as DevToolsViewLauncherStatus, Q as DevToolsRpcClientFunctions, Qt as AgentHandle, Rt as RemoteDockOptions, St as DevToolsDockEntry, Tt as DevToolsDockEntryIcon, U as PartialWithoutId, Ut as DevToolsCommandBase, V as DevToolsViewHost, Vt as DevToolsDiagnosticsLogger, W as Thenable, Wt as DevToolsCommandEntry, X as DevToolsTerminalStatus, Xt as DevToolsServerCommandEntry, Y as DevToolsTerminalSessionBase, Yt as DevToolsCommandsHostEvents, Z as DevToolsDocksUserSettings, Zt as DevToolsServerCommandInput, _ as RpcSharedStateGetOptions, _t as DevToolsMessagesClient, a as DevtoolRuntime, an as DevToolsAgentHost, at as DevToolsLogFilePosition, b as RpcStreamingChannelOptions, bt as ClientScriptEntry, c as defineDevtool, cn as EventUnsubscribe, ct as DevToolsLogsClient, d as DevToolsNodeContext, dt as DevToolsMessageEntry, en as AgentResource, et as DevToolsRpcSharedStates, f as DevToolsNodeUtils, ft as DevToolsMessageEntryFrom, g as RpcFunctionsHost, gt as DevToolsMessageLevel, h as RpcBroadcastOptions, ht as DevToolsMessageHandle, i as DevtoolDeploymentKind, in as AgentToolInput, it as DevToolsLogEntryInput, jt as DevToolsViewIframe, kt as DevToolsViewBuiltin, l as ConnectionMeta, ln as EventsMap, lt as DevToolsLogsHost, m as DevToolsNodeRpcSession, mt as DevToolsMessageFilePosition, n as DevtoolCliOptions, nn as AgentResourceInput, nt as DevToolsLogEntry, o as DevtoolSetupInfo, on as DevToolsAgentHostEvents, ot as DevToolsLogHandle, p as RemoteConnectionInfo, pt as DevToolsMessageEntryInput, q as DevToolsTerminalHost, qt as DevToolsCommandShortcutOverrides, r as DevtoolDefinition, rn as AgentTool, rt as DevToolsLogEntryFrom, s as DevtoolSpaOptions, sn as EventEmitter, st as DevToolsLogLevel, t as DevtoolBrowserContext, tn as AgentResourceContent, tt as DevToolsLogElementPosition, u as DevToolsCapabilities, ut as DevToolsMessageElementPosition, v as RpcSharedStateHost, vt as DevToolsMessagesHost, wt as DevToolsDockEntryCategory, x as RpcStreamingHost, xt as DevToolsDockEntriesGrouped, y as RpcStreamingChannel, yt as DevToolsHost, zt as DevToolsDiagnosticsDefinition } from "../devtool-Bm6zZAw5.mjs";
|
|
2
|
+
import { m as RpcFunctionAgentOptions } from "../types-ag029cAe.mjs";
|
|
3
|
+
import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-VQqESKAs.mjs";
|
|
4
|
+
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ClientScriptEntry, ConnectionMeta, DevToolsAgentHost, DevToolsAgentHostEvents, DevToolsCapabilities, DevToolsChildProcessExecuteOptions, DevToolsChildProcessTerminalSession, DevToolsClientCommand, DevToolsCommandBase, DevToolsCommandEntry, DevToolsCommandHandle, DevToolsCommandKeybinding, DevToolsCommandShortcutOverrides, DevToolsCommandsHost, DevToolsCommandsHostEvents, DevToolsDiagnosticsDefinition, DevToolsDiagnosticsHost, DevToolsDiagnosticsLogger, DevToolsDockEntriesGrouped, DevToolsDockEntry, DevToolsDockEntryBase, DevToolsDockEntryCategory, DevToolsDockEntryIcon, DevToolsDockHost, DevToolsDockUserEntry, DevToolsDocksUserSettings, DevToolsHost, DevToolsLogElementPosition, DevToolsLogEntry, DevToolsLogEntryFrom, DevToolsLogEntryInput, DevToolsLogFilePosition, DevToolsLogHandle, DevToolsLogLevel, DevToolsLogsClient, DevToolsLogsHost, DevToolsMessageElementPosition, DevToolsMessageEntry, DevToolsMessageEntryFrom, DevToolsMessageEntryInput, DevToolsMessageFilePosition, DevToolsMessageHandle, DevToolsMessageLevel, DevToolsMessagesClient, DevToolsMessagesHost, DevToolsNodeContext, DevToolsNodeRpcSession, DevToolsNodeRpcSessionMeta, DevToolsNodeUtils, DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, DevToolsRpcSharedStates, DevToolsServerCommandEntry, DevToolsServerCommandInput, DevToolsTerminalHost, DevToolsTerminalSession, DevToolsTerminalSessionBase, DevToolsTerminalStatus, DevToolsViewAction, DevToolsViewBuiltin, DevToolsViewCustomRender, DevToolsViewHost, DevToolsViewIframe, DevToolsViewJsonRender, DevToolsViewLauncher, DevToolsViewLauncherStatus, DevtoolBrowserContext, DevtoolCliOptions, DevtoolDefinition, DevtoolDeploymentKind, DevtoolRuntime, DevtoolSetupInfo, DevtoolSpaOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, JsonRenderElement, JsonRenderSpec, JsonRenderer, PartialWithoutId, RemoteConnectionInfo, RemoteDockOptions, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, Thenable, defineDevtool };
|
package/dist/utils/events.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions,
|
|
1
|
+
import { B as createSharedState, F as ImmutableSet, I as SharedState, L as SharedStateEvents, M as ImmutableArray, N as ImmutableMap, P as ImmutableObject, R as SharedStateOptions, j as Immutable, z as SharedStatePatch } from "../devtool-Bm6zZAw5.mjs";
|
|
2
|
+
export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createEventEmitter } from "./events.mjs";
|
|
2
|
-
import { i as produceWithPatches, n as enablePatches, r as produce, t as applyPatches } from "../immer-DEqg5kOd.mjs";
|
|
3
2
|
import { nanoid } from "./nanoid.mjs";
|
|
3
|
+
import { applyPatches, enablePatches, produce, produceWithPatches } from "immer";
|
|
4
4
|
//#region src/utils/shared-state.ts
|
|
5
5
|
function createSharedState(options) {
|
|
6
6
|
const { enablePatches: enablePatches$1 = false } = options;
|
package/dist/utils/state.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sn as EventEmitter } from "../devtool-Bm6zZAw5.mjs";
|
|
2
|
+
import { Objectish, Patch } from "immer";
|
|
2
3
|
|
|
3
4
|
//#region src/utils/state.d.ts
|
|
4
5
|
type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
|
package/dist/utils/state.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEventEmitter } from "./events.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { applyPatches, produce, produceWithPatches } from "immer";
|
|
3
3
|
//#region src/utils/state.ts
|
|
4
4
|
function createSharedState(options) {
|
|
5
5
|
const { enablePatches = false } = options;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as createStreamSink, C as CreateStreamReaderOptions, D as StreamSink, E as StreamReader, O as StreamSinkEvents, S as BufferedChunk, T as StreamErrorPayload, k as createStreamReader, w as CreateStreamSinkOptions } from "../devtool-Bm6zZAw5.mjs";
|
|
2
|
+
export { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink };
|