devframe 0.2.1 → 0.2.3

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.
Files changed (76) hide show
  1. package/dist/adapters/build.d.mts +1 -1
  2. package/dist/adapters/build.mjs +6 -6
  3. package/dist/adapters/cli.d.mts +1 -1
  4. package/dist/adapters/cli.mjs +2 -2
  5. package/dist/adapters/dev.d.mts +2 -2
  6. package/dist/adapters/dev.mjs +1 -1
  7. package/dist/adapters/embedded.d.mts +1 -1
  8. package/dist/adapters/mcp.d.mts +1 -1
  9. package/dist/adapters/mcp.mjs +3 -3
  10. package/dist/client/index.d.mts +18 -4
  11. package/dist/client/index.mjs +314 -8
  12. package/dist/{context-BaX-SZti.d.mts → context-GUzIxrEK.d.mts} +1 -1
  13. package/dist/{dev-CA0-8Amw.mjs → dev-BVtS7qBK.mjs} +4 -4
  14. package/dist/{devframe-BXZUBuy6.d.mts → devframe-C4DNeFuG.d.mts} +3 -52
  15. package/dist/diagnostics-D7miaTpL.mjs +36 -0
  16. package/dist/{rpc-BlVCyk9W.mjs → dump-C5LPsKJC.mjs} +139 -126
  17. package/dist/helpers/vite.d.mts +1 -1
  18. package/dist/helpers/vite.mjs +3 -3
  19. package/dist/{host-h3-CpYkiCIU.mjs → host-h3-DYFKJxAV.mjs} +255 -7
  20. package/dist/human-id-CiBWzVcg.mjs +803 -0
  21. package/dist/{index-BO4daMzR.d.mts → index-CSi2Y5JU.d.mts} +31 -78
  22. package/dist/index-DWczSqdd.d.mts +79 -0
  23. package/dist/index-aNunf5Za.d.mts +639 -0
  24. package/dist/index.d.mts +3 -3
  25. package/dist/index.mjs +1 -1
  26. package/dist/{launch-editor-1dAC7Uk5.mjs → launch-editor-BbNhtg7b.mjs} +25 -1
  27. package/dist/node/auth.d.mts +2 -2
  28. package/dist/node/auth.mjs +1 -2
  29. package/dist/node/index.d.mts +5 -5
  30. package/dist/node/index.mjs +3 -3
  31. package/dist/node/internal.d.mts +2 -2
  32. package/dist/node/internal.mjs +3 -4
  33. package/dist/recipes/open-helpers.d.mts +1 -1
  34. package/dist/recipes/open-helpers.mjs +3 -3
  35. package/dist/rpc/dump.d.mts +2 -0
  36. package/dist/rpc/dump.mjs +2 -0
  37. package/dist/rpc/index.d.mts +2 -2
  38. package/dist/rpc/index.mjs +129 -3
  39. package/dist/rpc/transports/ws-client.d.mts +25 -1
  40. package/dist/rpc/transports/ws-client.mjs +2 -2
  41. package/dist/rpc/transports/ws-server.d.mts +1 -1
  42. package/dist/rpc/transports/ws-server.mjs +2 -2
  43. package/dist/{serialization-CwO31axa.mjs → serialization-lBLV02kQ.mjs} +2 -36
  44. package/dist/{server-CgqyJG9m.d.mts → server-DjMtJQhO.d.mts} +1 -1
  45. package/dist/shared-state-SzgfilJP.mjs +1058 -0
  46. package/dist/{shared-state-q9-1EOSX.mjs → shared-state-u0y123fi.mjs} +6 -6
  47. package/dist/{storage-BaLJK6e_.mjs → storage-CTlHUtXI.mjs} +1 -2
  48. package/dist/structured-clone-qP1sPovr.mjs +208 -0
  49. package/dist/types/index.d.mts +3 -3
  50. package/dist/utils/colors.mjs +30 -1
  51. package/dist/utils/events.d.mts +1 -1
  52. package/dist/utils/hash.mjs +1 -1
  53. package/dist/utils/human-id.d.mts +1 -1
  54. package/dist/utils/human-id.mjs +768 -1
  55. package/dist/utils/launch-editor.mjs +1 -1
  56. package/dist/utils/open.mjs +1 -1
  57. package/dist/utils/shared-state.d.mts +1 -1
  58. package/dist/utils/shared-state.mjs +1 -1
  59. package/dist/utils/streaming-channel.d.mts +1 -1
  60. package/dist/utils/structured-clone.mjs +1 -1
  61. package/dist/{ws-server-kW8RZXTw.d.mts → ws-server-lHQaafrS.d.mts} +1 -1
  62. package/package.json +2 -5
  63. package/dist/chunk-e9Ob2GDo.mjs +0 -26
  64. package/dist/colors-DS7k8ljB.mjs +0 -123
  65. package/dist/diagnostics-Cg9ycFIM.mjs +0 -56
  66. package/dist/human-id-mPh1HcFO.mjs +0 -852
  67. package/dist/revoke-CWSPBbJH.mjs +0 -35
  68. package/dist/ws-client-DFUf-xgm.d.mts +0 -26
  69. /package/dist/{_shared-C_yZKUmx.mjs → _shared-BNoPn1NG.mjs} +0 -0
  70. /package/dist/{define-CW9gLnyG.mjs → define-Bb4zh-Dc.mjs} +0 -0
  71. /package/dist/{hash-CIBte1yS.mjs → hash-bwOD8RgU.mjs} +0 -0
  72. /package/dist/{open-CWL4Zasd.mjs → open-CX4CiMyw.mjs} +0 -0
  73. /package/dist/{server-G1ymmN3_.mjs → server-DxiOFSpu.mjs} +0 -0
  74. /package/dist/{structured-clone-CD2l4fI3.mjs → structured-clone-PdCZwt7F.mjs} +0 -0
  75. /package/dist/{transports-BLwT342H.mjs → transports-Bl1zuYhZ.mjs} +0 -0
  76. /package/dist/{types-ip8THGH1.d.mts → types-kKDaD2NT.d.mts} +0 -0
@@ -1,5 +1,5 @@
1
- import { P as SharedState, d as DevToolsNodeContext, f as DevToolsNodeRpcSession } from "../devframe-BXZUBuy6.mjs";
2
- import { n as InternalAnonymousAuthStorage } from "../context-BaX-SZti.mjs";
1
+ import { b as SharedState, d as DevToolsNodeContext, f as DevToolsNodeRpcSession } from "../devframe-C4DNeFuG.mjs";
2
+ import { n as InternalAnonymousAuthStorage } from "../context-GUzIxrEK.mjs";
3
3
 
4
4
  //#region src/node/auth/revoke.d.ts
5
5
  /**
@@ -1,5 +1,4 @@
1
- import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "../revoke-CWSPBbJH.mjs";
2
- import { t as humanId } from "../human-id-mPh1HcFO.mjs";
1
+ import { n as revokeActiveConnectionsForToken, r as revokeAuthToken, t as humanId } from "../human-id-CiBWzVcg.mjs";
3
2
  //#region src/node/auth/state.ts
4
3
  let pendingAuth = null;
5
4
  let tempAuthToken = generateTempId();
@@ -1,8 +1,8 @@
1
- import { $ as AgentResourceContent, J as DevToolsDiagnosticsHost$1, K as DevToolsHost, P as SharedState, Q as AgentResource, U as DevToolsRpcClientFunctions, W as DevToolsRpcServerFunctions, X as AgentHandle, Y as DevToolsDiagnosticsLogger, Z as AgentManifest, at as EventEmitter, d as DevToolsNodeContext, et as AgentResourceInput, f as DevToolsNodeRpcSession, g as RpcSharedStateHost, it as DevToolsAgentHostEvents, m as RpcFunctionsHost$1, nt as AgentToolInput, p as RpcBroadcastOptions, rt as DevToolsAgentHost$1, tt as AgentTool, y as RpcStreamingHost, z as DevToolsViewHost$1 } from "../devframe-BXZUBuy6.mjs";
2
- import { S as RpcFunctionsCollectorBase } from "../index-BO4daMzR.mjs";
3
- import { _ as RpcFunctionDefinitionAny } from "../types-ip8THGH1.mjs";
4
- import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-kW8RZXTw.mjs";
5
- import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-CgqyJG9m.mjs";
1
+ import { A as DevToolsDiagnosticsHost$1, B as DevToolsAgentHostEvents, E as DevToolsRpcServerFunctions, F as AgentResourceContent, I as AgentResourceInput, L as AgentTool, M as AgentHandle, N as AgentManifest, O as DevToolsHost, P as AgentResource, R as AgentToolInput, T as DevToolsRpcClientFunctions, V as EventEmitter, b as SharedState, d as DevToolsNodeContext, f as DevToolsNodeRpcSession, g as RpcSharedStateHost, j as DevToolsDiagnosticsLogger, m as RpcFunctionsHost$1, p as RpcBroadcastOptions, x as DevToolsViewHost$1, y as RpcStreamingHost, z as DevToolsAgentHost$1 } from "../devframe-C4DNeFuG.mjs";
2
+ import { _ as RpcFunctionDefinitionAny } from "../types-kKDaD2NT.mjs";
3
+ import { S as RpcFunctionsCollectorBase } from "../index-CSi2Y5JU.mjs";
4
+ import { t as DevToolsNodeRpcSessionMeta } from "../ws-server-lHQaafrS.mjs";
5
+ import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-DjMtJQhO.mjs";
6
6
  import { createLogger, defineDiagnostics } from "logs-sdk";
7
7
  import { BirpcGroup } from "birpc";
8
8
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -1,6 +1,6 @@
1
- import { a as createRpcStreamingServerHost, c as DevToolsAgentHost, i as RpcFunctionsHost, n as createHostContext, o as createRpcSharedStateServerHost, r as DevToolsViewHost, s as DevToolsDiagnosticsHost, t as createH3DevToolsHost } from "../host-h3-CpYkiCIU.mjs";
2
- import { t as startHttpAndWs } from "../server-G1ymmN3_.mjs";
3
- import { t as createStorage } from "../storage-BaLJK6e_.mjs";
1
+ import { a as createRpcStreamingServerHost, c as DevToolsAgentHost, i as RpcFunctionsHost, n as createHostContext, o as createRpcSharedStateServerHost, r as DevToolsViewHost, s as DevToolsDiagnosticsHost, t as createH3DevToolsHost } from "../host-h3-DYFKJxAV.mjs";
2
+ import { t as startHttpAndWs } from "../server-DxiOFSpu.mjs";
3
+ import { t as createStorage } from "../storage-CTlHUtXI.mjs";
4
4
  import { isIP } from "node:net";
5
5
  //#region src/node/utils.ts
6
6
  function isObject(value) {
@@ -1,5 +1,5 @@
1
- import { i as DevframeDeploymentKind, r as DevframeDefinition } from "../devframe-BXZUBuy6.mjs";
2
- import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevToolsInternalContext } from "../context-BaX-SZti.mjs";
1
+ import { i as DevframeDeploymentKind, r as DevframeDefinition } from "../devframe-C4DNeFuG.mjs";
2
+ import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevToolsInternalContext } from "../context-GUzIxrEK.mjs";
3
3
 
4
4
  //#region src/adapters/_shared.d.ts
5
5
  /**
@@ -1,7 +1,6 @@
1
- import { t as createStorage } from "../storage-BaLJK6e_.mjs";
2
- import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "../revoke-CWSPBbJH.mjs";
3
- import { t as humanId } from "../human-id-mPh1HcFO.mjs";
4
- import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-C_yZKUmx.mjs";
1
+ import { t as createStorage } from "../storage-CTlHUtXI.mjs";
2
+ import { n as revokeActiveConnectionsForToken, r as revokeAuthToken, t as humanId } from "../human-id-CiBWzVcg.mjs";
3
+ import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-BNoPn1NG.mjs";
5
4
  import { join } from "pathe";
6
5
  //#region src/node/internal/context.ts
7
6
  const internalContextMap = /* @__PURE__ */ new WeakMap();
@@ -1,4 +1,4 @@
1
- import { T as Thenable, h as RpcFunctionAgentOptions, s as RpcDump, x as RpcFunctionSetupResult } from "../types-ip8THGH1.mjs";
1
+ import { T as Thenable, h as RpcFunctionAgentOptions, s as RpcDump, x as RpcFunctionSetupResult } from "../types-kKDaD2NT.mjs";
2
2
  import * as v from "valibot";
3
3
 
4
4
  //#region src/recipes/open-helpers.d.ts
@@ -1,6 +1,6 @@
1
- import { n as defineRpcFunction } from "../define-CW9gLnyG.mjs";
2
- import { t as launchEditor } from "../launch-editor-1dAC7Uk5.mjs";
3
- import { t as open } from "../open-CWL4Zasd.mjs";
1
+ import { t as launchEditor } from "../launch-editor-BbNhtg7b.mjs";
2
+ import { n as defineRpcFunction } from "../define-Bb4zh-Dc.mjs";
3
+ import { t as open } from "../open-CX4CiMyw.mjs";
4
4
  import * as v from "valibot";
5
5
  //#region src/recipes/open-helpers.ts
6
6
  /**
@@ -0,0 +1,2 @@
1
+ import { a as getDefinitionsWithDumps, c as StaticRpcDumpManifest, d as StaticRpcDumpManifestValue, f as StaticRpcDumpSerialization, i as dumpFunctions, l as StaticRpcDumpManifestQueryEntry, n as serializeDumpError, o as StaticRpcDumpCollection, p as collectStaticRpcDump, r as createClientFromDump, s as StaticRpcDumpFile, t as reviveDumpError, u as StaticRpcDumpManifestStaticEntry } from "../index-DWczSqdd.mjs";
2
+ export { StaticRpcDumpCollection, StaticRpcDumpFile, StaticRpcDumpManifest, StaticRpcDumpManifestQueryEntry, StaticRpcDumpManifestStaticEntry, StaticRpcDumpManifestValue, StaticRpcDumpSerialization, collectStaticRpcDump, createClientFromDump, dumpFunctions, getDefinitionsWithDumps, reviveDumpError, serializeDumpError };
@@ -0,0 +1,2 @@
1
+ import { a as dumpFunctions, c as serializeDumpError, i as createClientFromDump, o as getDefinitionsWithDumps, s as reviveDumpError, t as collectStaticRpcDump } from "../dump-C5LPsKJC.mjs";
2
+ export { collectStaticRpcDump, createClientFromDump, dumpFunctions, getDefinitionsWithDumps, reviveDumpError, serializeDumpError };
@@ -1,3 +1,3 @@
1
- import { C as RpcCacheManager, S as RpcFunctionsCollectorBase, _ as createClientFromDump, a as getRpcHandler, b as createDefineWrapperWithContext, c as StaticRpcDumpFile, d as StaticRpcDumpManifestStaticEntry, f as StaticRpcDumpManifestValue, g as serializeDumpError, h as reviveDumpError, i as strictJsonStringify, l as StaticRpcDumpManifest, m as collectStaticRpcDump, n as validateDefinitions, o as getRpcResolvedSetupResult, p as StaticRpcDumpSerialization, r as STRUCTURED_CLONE_PREFIX, s as StaticRpcDumpCollection, t as validateDefinition, u as StaticRpcDumpManifestQueryEntry, v as dumpFunctions, w as RpcCacheOptions, x as defineRpcFunction, y as getDefinitionsWithDumps } from "../index-BO4daMzR.mjs";
2
- import { C as RpcFunctionsCollector, S as RpcFunctionType, T as Thenable, _ as RpcFunctionDefinitionAny, a as RpcDefinitionsFilter, b as RpcFunctionDefinitionToFunction, c as RpcDumpClientOptions, d as RpcDumpGetter, f as RpcDumpRecord, g as RpcFunctionDefinition, h as RpcFunctionAgentOptions, i as RpcArgsSchema, l as RpcDumpCollectionOptions, m as RpcDumpStore, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecordError, r as EntriesToObject, s as RpcDump, t as BirpcFn, u as RpcDumpDefinition, v as RpcFunctionDefinitionAnyWithContext, w as RpcReturnSchema, x as RpcFunctionSetupResult, y as RpcFunctionDefinitionBase } from "../types-ip8THGH1.mjs";
1
+ import { C as RpcFunctionsCollector, S as RpcFunctionType, T as Thenable, _ as RpcFunctionDefinitionAny, a as RpcDefinitionsFilter, b as RpcFunctionDefinitionToFunction, c as RpcDumpClientOptions, d as RpcDumpGetter, f as RpcDumpRecord, g as RpcFunctionDefinition, h as RpcFunctionAgentOptions, i as RpcArgsSchema, l as RpcDumpCollectionOptions, m as RpcDumpStore, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecordError, r as EntriesToObject, s as RpcDump, t as BirpcFn, u as RpcDumpDefinition, v as RpcFunctionDefinitionAnyWithContext, w as RpcReturnSchema, x as RpcFunctionSetupResult, y as RpcFunctionDefinitionBase } from "../types-kKDaD2NT.mjs";
2
+ import { C as RpcCacheManager, S as RpcFunctionsCollectorBase, _ as strictJsonStringify, a as StaticRpcDumpManifestStaticEntry, b as createDefineWrapperWithContext, c as collectStaticRpcDump, d as getDefinitionsWithDumps, f as reviveDumpError, g as STRUCTURED_CLONE_PREFIX, h as validateDefinitions, i as StaticRpcDumpManifestQueryEntry, l as createClientFromDump, m as validateDefinition, n as StaticRpcDumpFile, o as StaticRpcDumpManifestValue, p as serializeDumpError, r as StaticRpcDumpManifest, s as StaticRpcDumpSerialization, t as StaticRpcDumpCollection, u as dumpFunctions, v as getRpcHandler, w as RpcCacheOptions, x as defineRpcFunction, y as getRpcResolvedSetupResult } from "../index-CSi2Y5JU.mjs";
3
3
  export { BirpcFn, BirpcReturn, EntriesToObject, RpcArgsSchema, RpcCacheManager, RpcCacheOptions, RpcDefinitionsFilter, RpcDefinitionsToFunctions, RpcDump, RpcDumpClientOptions, RpcDumpCollectionOptions, RpcDumpDefinition, RpcDumpGetter, RpcDumpRecord, RpcDumpRecordError, RpcDumpStore, RpcFunctionAgentOptions, RpcFunctionDefinition, RpcFunctionDefinitionAny, RpcFunctionDefinitionAnyWithContext, RpcFunctionDefinitionBase, RpcFunctionDefinitionToFunction, RpcFunctionSetupResult, RpcFunctionType, RpcFunctionsCollector, RpcFunctionsCollectorBase, RpcReturnSchema, STRUCTURED_CLONE_PREFIX, StaticRpcDumpCollection, StaticRpcDumpFile, StaticRpcDumpManifest, StaticRpcDumpManifestQueryEntry, StaticRpcDumpManifestStaticEntry, StaticRpcDumpManifestValue, StaticRpcDumpSerialization, Thenable, collectStaticRpcDump, createClientFromDump, createDefineWrapperWithContext, defineRpcFunction, dumpFunctions, getDefinitionsWithDumps, getRpcHandler, getRpcResolvedSetupResult, reviveDumpError, serializeDumpError, strictJsonStringify, validateDefinition, validateDefinitions };
@@ -1,4 +1,130 @@
1
- import { a as reviveDumpError, c as validateDefinitions, d as getRpcResolvedSetupResult, f as RpcCacheManager, i as getDefinitionsWithDumps, l as RpcFunctionsCollectorBase, n as createClientFromDump, o as serializeDumpError, r as dumpFunctions, s as validateDefinition, t as collectStaticRpcDump, u as getRpcHandler } from "../rpc-BlVCyk9W.mjs";
2
- import { n as strictJsonStringify, t as STRUCTURED_CLONE_PREFIX } from "../serialization-CwO31axa.mjs";
3
- import { n as defineRpcFunction, t as createDefineWrapperWithContext } from "../define-CW9gLnyG.mjs";
1
+ import { a as dumpFunctions$1, c as serializeDumpError$1, d as hash, i as createClientFromDump$1, l as validateDefinition, n as getRpcHandler, o as getDefinitionsWithDumps$1, r as getRpcResolvedSetupResult, s as reviveDumpError$1, t as collectStaticRpcDump$1, u as validateDefinitions } from "../dump-C5LPsKJC.mjs";
2
+ import { n as logger } from "../diagnostics-D7miaTpL.mjs";
3
+ import { n as defineRpcFunction, t as createDefineWrapperWithContext } from "../define-Bb4zh-Dc.mjs";
4
+ import { n as strictJsonStringify, t as STRUCTURED_CLONE_PREFIX } from "../serialization-lBLV02kQ.mjs";
5
+ //#region src/rpc/cache.ts
6
+ /**
7
+ * @experimental API is expected to change.
8
+ */
9
+ var RpcCacheManager = class {
10
+ cacheMap = /* @__PURE__ */ new Map();
11
+ options;
12
+ keySerializer;
13
+ constructor(options) {
14
+ this.options = options;
15
+ this.keySerializer = options.keySerializer || ((args) => hash(args));
16
+ }
17
+ updateOptions(options) {
18
+ this.options = {
19
+ ...this.options,
20
+ ...options
21
+ };
22
+ }
23
+ cached(m, a) {
24
+ const methodCache = this.cacheMap.get(m);
25
+ if (methodCache) return methodCache.get(this.keySerializer(a));
26
+ }
27
+ apply(req, res) {
28
+ const methodCache = this.cacheMap.get(req.m) || /* @__PURE__ */ new Map();
29
+ methodCache.set(this.keySerializer(req.a), res);
30
+ this.cacheMap.set(req.m, methodCache);
31
+ }
32
+ validate(m) {
33
+ return this.options.functions.includes(m);
34
+ }
35
+ clear(fn) {
36
+ if (fn) this.cacheMap.delete(fn);
37
+ else this.cacheMap.clear();
38
+ }
39
+ };
40
+ //#endregion
41
+ //#region src/rpc/collector.ts
42
+ var RpcFunctionsCollectorBase = class {
43
+ context;
44
+ definitions = /* @__PURE__ */ new Map();
45
+ functions;
46
+ _onChanged = [];
47
+ constructor(context) {
48
+ this.context = context;
49
+ const definitions = this.definitions;
50
+ const self = this;
51
+ this.functions = new Proxy({}, {
52
+ get(_, prop) {
53
+ const definition = definitions.get(prop);
54
+ if (!definition) return void 0;
55
+ return getRpcHandler(definition, self.context);
56
+ },
57
+ has(_, prop) {
58
+ return definitions.has(prop);
59
+ },
60
+ getOwnPropertyDescriptor(_, prop) {
61
+ return {
62
+ value: definitions.get(prop)?.handler,
63
+ configurable: true,
64
+ enumerable: true
65
+ };
66
+ },
67
+ ownKeys() {
68
+ return Array.from(definitions.keys());
69
+ }
70
+ });
71
+ }
72
+ register(fn, force = false) {
73
+ if (this.definitions.has(fn.name) && !force) throw logger.DF0021({ name: fn.name }).throw();
74
+ assertAgentJsonSerializable(fn);
75
+ this.definitions.set(fn.name, fn);
76
+ this._onChanged.forEach((cb) => cb(fn.name));
77
+ }
78
+ update(fn, force = false) {
79
+ if (!this.definitions.has(fn.name) && !force) throw logger.DF0022({ name: fn.name }).throw();
80
+ assertAgentJsonSerializable(fn);
81
+ this.definitions.set(fn.name, fn);
82
+ this._onChanged.forEach((cb) => cb(fn.name));
83
+ }
84
+ onChanged(fn) {
85
+ this._onChanged.push(fn);
86
+ return () => {
87
+ const index = this._onChanged.indexOf(fn);
88
+ if (index !== -1) this._onChanged.splice(index, 1);
89
+ };
90
+ }
91
+ async getHandler(name) {
92
+ return await getRpcHandler(this.definitions.get(name), this.context);
93
+ }
94
+ getSchema(name) {
95
+ const definition = this.definitions.get(name);
96
+ if (!definition) throw logger.DF0023({ name: String(name) }).throw();
97
+ return {
98
+ args: definition.args,
99
+ returns: definition.returns
100
+ };
101
+ }
102
+ has(name) {
103
+ return this.definitions.has(name);
104
+ }
105
+ get(name) {
106
+ return this.definitions.get(name);
107
+ }
108
+ list() {
109
+ return Array.from(this.definitions.keys());
110
+ }
111
+ };
112
+ function assertAgentJsonSerializable(fn) {
113
+ if (fn.agent && fn.jsonSerializable !== true) throw logger.DF0019({ name: fn.name }).throw();
114
+ }
115
+ //#endregion
116
+ //#region src/rpc/index.ts
117
+ /** @deprecated Import from `devframe/rpc/dump` instead. */
118
+ const collectStaticRpcDump = collectStaticRpcDump$1;
119
+ /** @deprecated Import from `devframe/rpc/dump` instead. */
120
+ const createClientFromDump = createClientFromDump$1;
121
+ /** @deprecated Import from `devframe/rpc/dump` instead. */
122
+ const dumpFunctions = dumpFunctions$1;
123
+ /** @deprecated Import from `devframe/rpc/dump` instead. */
124
+ const getDefinitionsWithDumps = getDefinitionsWithDumps$1;
125
+ /** @deprecated Import from `devframe/rpc/dump` instead. */
126
+ const reviveDumpError = reviveDumpError$1;
127
+ /** @deprecated Import from `devframe/rpc/dump` instead. */
128
+ const serializeDumpError = serializeDumpError$1;
129
+ //#endregion
4
130
  export { RpcCacheManager, RpcFunctionsCollectorBase, STRUCTURED_CLONE_PREFIX, collectStaticRpcDump, createClientFromDump, createDefineWrapperWithContext, defineRpcFunction, dumpFunctions, getDefinitionsWithDumps, getRpcHandler, getRpcResolvedSetupResult, reviveDumpError, serializeDumpError, strictJsonStringify, validateDefinition, validateDefinitions };
@@ -1,2 +1,26 @@
1
- import { n as createWsRpcChannel, t as WsRpcChannelOptions } from "../../ws-client-DFUf-xgm.mjs";
1
+ import { _ as RpcFunctionDefinitionAny } from "../../types-kKDaD2NT.mjs";
2
+ import { ChannelOptions } from "birpc";
3
+
4
+ //#region src/rpc/transports/ws-client.d.ts
5
+ interface WsRpcChannelOptions {
6
+ url: string;
7
+ onConnected?: (e: Event) => void;
8
+ onError?: (e: Error) => void;
9
+ onDisconnected?: (e: CloseEvent) => void;
10
+ authToken?: string;
11
+ /**
12
+ * RPC function definitions (or just the `jsonSerializable` flag per
13
+ * method) used to dispatch the per-call wire serializer. Pass an
14
+ * empty / partial map on clients that don't have the full registry —
15
+ * encoding falls back to structured-clone (the safer superset) and
16
+ * decoding still routes correctly via the wire prefix.
17
+ */
18
+ definitions?: ReadonlyMap<string, Pick<RpcFunctionDefinitionAny, 'jsonSerializable'>>;
19
+ }
20
+ /**
21
+ * Build a birpc `ChannelOptions` object backed by a browser `WebSocket`.
22
+ * Pass the result straight to `createRpcClient`'s `channel` option.
23
+ */
24
+ declare function createWsRpcChannel(options: WsRpcChannelOptions): ChannelOptions;
25
+ //#endregion
2
26
  export { WsRpcChannelOptions, createWsRpcChannel };
@@ -1,5 +1,5 @@
1
- import { n as strictJsonStringify } from "../../serialization-CwO31axa.mjs";
2
- import { i as structuredCloneStringify, n as structuredCloneParse } from "../../structured-clone-CD2l4fI3.mjs";
1
+ import { n as strictJsonStringify } from "../../serialization-lBLV02kQ.mjs";
2
+ import { n as structuredCloneStringify, t as structuredCloneParse } from "../../structured-clone-qP1sPovr.mjs";
3
3
  //#region src/rpc/transports/ws-client.ts
4
4
  function NOOP() {}
5
5
  const EMPTY_DEFS = /* @__PURE__ */ new Map();
@@ -1,2 +1,2 @@
1
- import { n as WsRpcTransportOptions, r as attachWsRpcTransport, t as DevToolsNodeRpcSessionMeta } from "../../ws-server-kW8RZXTw.mjs";
1
+ import { n as WsRpcTransportOptions, r as attachWsRpcTransport, t as DevToolsNodeRpcSessionMeta } from "../../ws-server-lHQaafrS.mjs";
2
2
  export { DevToolsNodeRpcSessionMeta, WsRpcTransportOptions, attachWsRpcTransport };
@@ -1,5 +1,5 @@
1
- import { n as strictJsonStringify } from "../../serialization-CwO31axa.mjs";
2
- import { i as structuredCloneStringify, n as structuredCloneParse } from "../../structured-clone-CD2l4fI3.mjs";
1
+ import { n as strictJsonStringify } from "../../serialization-lBLV02kQ.mjs";
2
+ import { n as structuredCloneStringify, t as structuredCloneParse } from "../../structured-clone-qP1sPovr.mjs";
3
3
  import { createServer } from "node:https";
4
4
  import { WebSocketServer } from "ws";
5
5
  //#region src/rpc/transports/ws-server.ts
@@ -1,38 +1,4 @@
1
- import { consoleReporter, createLogger, defineDiagnostics, plainFormatter } from "logs-sdk";
2
- //#region src/rpc/diagnostics.ts
3
- const diagnostics = defineDiagnostics({
4
- docsBase: "https://devfra.me/errors",
5
- codes: {
6
- DF0019: {
7
- message: (p) => `RPC function "${p.name}" has \`agent\` set but \`jsonSerializable\` is not \`true\` — MCP requires JSON-serializable data.`,
8
- hint: "Set `jsonSerializable: true` if the payload is JSON-safe, or remove `agent` to keep it RPC-only."
9
- },
10
- DF0020: {
11
- message: (p) => `RPC function "${p.name}" declares \`jsonSerializable: true\` but the value at "${p.path}" is a ${p.type}.`,
12
- hint: "Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."
13
- },
14
- DF0021: {
15
- message: (p) => `RPC function "${p.name}" is already registered`,
16
- hint: "Use the `force` parameter to overwrite an existing registration."
17
- },
18
- DF0022: { message: (p) => `RPC function "${p.name}" is not registered. Use register() to add new functions.` },
19
- DF0023: { message: (p) => `RPC function "${p.name}" is not registered` },
20
- DF0024: { message: (p) => `Either handler or setup function must be provided for RPC function "${p.name}"` },
21
- DF0025: { message: (p) => `Function "${p.name}" not found in dump store` },
22
- DF0026: { message: (p) => `No dump match for "${p.name}" with args: ${p.args}` },
23
- DF0027: { message: (p) => `Function "${p.name}" with type "${p.type}" cannot have dump configuration. Only "static" and "query" types support dumps.` },
24
- DF0028: {
25
- message: (p) => `Function "${p.name}" with type "${p.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,
26
- hint: "Remove `snapshot: true`, or change the function type to `query`."
27
- }
28
- }
29
- });
30
- const logger = createLogger({
31
- diagnostics: [diagnostics],
32
- formatter: plainFormatter,
33
- reporters: consoleReporter
34
- });
35
- //#endregion
1
+ import { n as logger } from "./diagnostics-D7miaTpL.mjs";
36
2
  //#region src/rpc/serialization.ts
37
3
  /**
38
4
  * Wire format used by the WS RPC transport.
@@ -108,4 +74,4 @@ function formatPath(parent, key) {
108
74
  return key;
109
75
  }
110
76
  //#endregion
111
- export { logger as i, strictJsonStringify as n, diagnostics as r, STRUCTURED_CLONE_PREFIX as t };
77
+ export { strictJsonStringify as n, STRUCTURED_CLONE_PREFIX as t };
@@ -1,4 +1,4 @@
1
- import { U as DevToolsRpcClientFunctions, W as DevToolsRpcServerFunctions, d as DevToolsNodeContext } from "./devframe-BXZUBuy6.mjs";
1
+ import { E as DevToolsRpcServerFunctions, T as DevToolsRpcClientFunctions, d as DevToolsNodeContext } from "./devframe-C4DNeFuG.mjs";
2
2
  import { BirpcGroup } from "birpc";
3
3
  import { WebSocketServer } from "ws";
4
4
  import { H3 } from "h3";