devframe 1.3.2 → 1.3.5

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 (68) hide show
  1. package/dist/{_shared-CnKu5myY.d.mts → _shared-BxeuukaL.d.mts} +2 -2
  2. package/dist/{_shared-BGb9aDxr.mjs → _shared-CtXCQFTV.mjs} +1 -1
  3. package/dist/adapters/build.d.mts +1 -1
  4. package/dist/adapters/cac.d.mts +1 -1
  5. package/dist/adapters/cac.mjs +2 -2
  6. package/dist/adapters/dev.d.mts +4 -4
  7. package/dist/adapters/dev.mjs +2 -2
  8. package/dist/adapters/embedded.d.mts +1 -1
  9. package/dist/adapters/initiate.d.mts +4 -4
  10. package/dist/adapters/initiate.mjs +1 -1
  11. package/dist/adapters/mcp.d.mts +2 -2
  12. package/dist/{agentic-CCstJ5yv.d.mts → agentic-DVgUzwhV.d.mts} +1 -1
  13. package/dist/client/index.d.mts +5 -5
  14. package/dist/client/index.mjs +1 -1
  15. package/dist/{context-CsdPs3po.d.mts → context-B-AARy_U.d.mts} +1 -1
  16. package/dist/{dev-DaHYh5YK.mjs → dev-DF1pEq0n.mjs} +2 -2
  17. package/dist/{dist-DJydMELP.mjs → dist-CZ-TySHD.mjs} +1 -2
  18. package/dist/in-page-channel/index.d.mts +3 -2
  19. package/dist/in-page-channel/index.mjs +1 -1
  20. package/dist/{context-WxTq6kqb.d.mts → index-BhUqJUHG.d.mts} +1404 -1404
  21. package/dist/index.d.mts +5 -4
  22. package/dist/{instance-registry-CmZfF5u3.mjs → instance-registry-DwmnWyCK.mjs} +1 -1
  23. package/dist/{instance-shell-Dk2SejFT.mjs → instance-shell-C0yMifrP.mjs} +5 -5
  24. package/dist/{instance-shell-Bujp0BhE.d.mts → instance-shell-DTk514M9.d.mts} +4 -4
  25. package/dist/{interactive-auth-BURwIAvE.mjs → interactive-auth-CZ3CPfEs.mjs} +1 -1
  26. package/dist/internal/index.d.mts +7 -7
  27. package/dist/internal/index.mjs +4 -4
  28. package/dist/{mcp-content-CQQBt2An.d.mts → mcp-content-0a0mpCL5.d.mts} +1 -1
  29. package/dist/node/auth.d.mts +84 -3
  30. package/dist/node/auth.mjs +1 -1
  31. package/dist/node/hub-internals.d.mts +11 -2
  32. package/dist/node/hub-internals.mjs +1 -1
  33. package/dist/node/index.d.mts +4 -2
  34. package/dist/recipes/interactive-auth.d.mts +2 -2
  35. package/dist/recipes/interactive-auth.mjs +1 -1
  36. package/dist/{rolldown-runtime-DYf_mQCB.mjs → rolldown-runtime-BVN1G_yT.mjs} +4 -4
  37. package/dist/rpc/dump.d.mts +1 -1
  38. package/dist/rpc/index.d.mts +121 -3
  39. package/dist/rpc/transports/sse-client.d.mts +34 -2
  40. package/dist/rpc/transports/sse-server.d.mts +2 -2
  41. package/dist/rpc/transports/ws-bun.d.mts +2 -2
  42. package/dist/rpc/transports/ws-client.d.mts +27 -2
  43. package/dist/rpc/transports/ws-deno.d.mts +2 -2
  44. package/dist/rpc/transports/ws-server.d.mts +150 -3
  45. package/dist/{rpc-core-CDUizUQB.mjs → rpc-core-BmDHiDR6.mjs} +1 -1
  46. package/dist/{rpc-core-CFwyV10r.d.mts → rpc-core-CblgPYJ_.d.mts} +3 -3
  47. package/dist/{shared-state-COV7NCbd.mjs → shared-state-DiAsLHP8.mjs} +3 -2
  48. package/dist/{state-B_yjfeqo.mjs → state-TdDWqiG-.mjs} +2 -1
  49. package/dist/types/index.d.mts +3 -3
  50. package/dist/{types-844OBepb.d.mts → types-KZOyhez5.d.mts} +1 -0
  51. package/dist/utils/debounce.d.mts +6 -0
  52. package/dist/utils/events.d.mts +1 -1
  53. package/dist/utils/get-port.mjs +1 -1
  54. package/dist/utils/launch-editor.mjs +1 -1
  55. package/dist/utils/nostics.d.mts +40 -2
  56. package/dist/utils/origin.d.mts +55 -2
  57. package/dist/utils/serve-static.d.mts +1 -1
  58. package/dist/utils/shared-state.d.mts +1 -1
  59. package/dist/utils/shared-state.mjs +1 -1
  60. package/dist/utils/streaming-channel.d.mts +1 -1
  61. package/package.json +6 -6
  62. package/dist/index-D0qrBkhO.d.mts +0 -121
  63. package/dist/index-HMJPlexc.d.mts +0 -84
  64. package/dist/nostics-Dgwh7ytT.d.mts +0 -40
  65. package/dist/origin-D5i7K_Zb.d.mts +0 -56
  66. package/dist/sse-client-B2PrSz-H.d.mts +0 -35
  67. package/dist/ws-client-lqOeANcn.d.mts +0 -28
  68. package/dist/ws-server-CYHkeyA-.d.mts +0 -150
@@ -1,4 +1,151 @@
1
+ import { a as ChannelOptions, n as BirpcGroup } from "../../index-BKu9BxcT.mjs";
2
+ import { g as RpcFunctionDefinitionAny } from "../../types-KZOyhez5.mjs";
1
3
  import { a as DevframeWsPeer, i as DevframeRpcTransportKind, n as DevframeRpcConnection, r as DevframeRpcConnectionRequest, t as DevframeNodeRpcSessionMeta } from "../../session-Y9R6tqg4.mjs";
2
- import { r as isLoopbackHostname, t as isAllowedOrigin } from "../../origin-D5i7K_Zb.mjs";
3
- import { a as attachWsRpcTransport, i as WsRpcTransportOptions, n as WsOriginRegistry, o as createWsOriginRegistry, r as WsRpcTransport, s as createWsRpcPeerHooks, t as CreateWsOriginRegistryOptions } from "../../ws-server-CYHkeyA-.mjs";
4
- export { CreateWsOriginRegistryOptions, type DevframeNodeRpcSessionMeta, type DevframeRpcConnection, type DevframeRpcConnectionRequest, type DevframeRpcTransportKind, type DevframeWsPeer, WsOriginRegistry, WsRpcTransport, WsRpcTransportOptions, attachWsRpcTransport, createWsOriginRegistry, createWsRpcPeerHooks, isAllowedOrigin, isLoopbackHostname };
4
+ import { isAllowedOrigin, isLoopbackHostname } from "../../utils/origin.mjs";
5
+ import { Hooks } from "crossws";
6
+ import { NodeAdapter } from "crossws/adapters/node";
7
+ import { Buffer } from "node:buffer";
8
+ import { IncomingMessage, Server } from "node:http";
9
+ import { Server as Server$1, ServerOptions } from "node:https";
10
+ import { AddressInfo } from "node:net";
11
+ import { Duplex } from "node:stream";
12
+ export interface WsRpcTransportOptions {
13
+ /**
14
+ * Attach to an existing HTTP(S) server, sharing its port. Combine with
15
+ * `path` to bind the WS endpoint to a single route so it coexists with
16
+ * other upgrade handlers on the same server (e.g. a Vite dev server's HMR
17
+ * socket). The shared server's lifecycle is owned by the caller; closing
18
+ * this transport detaches the upgrade listener without closing the server.
19
+ */
20
+ server?: Server | Server$1;
21
+ /**
22
+ * Port for the standalone WebSocket server. Defaults to `0`, which lets the
23
+ * operating system assign an available port.
24
+ */
25
+ port?: number;
26
+ /** Host for the standalone WebSocket server. Defaults to `localhost`. */
27
+ host?: string;
28
+ /**
29
+ * Restrict the WS endpoint to a single upgrade route (e.g. `/__ws`). When
30
+ * sharing a `server`, non-matching upgrade requests are left untouched for
31
+ * other listeners to handle, so devframe's socket can sit alongside
32
+ * framework sockets (Vite HMR, etc.).
33
+ */
34
+ path?: string;
35
+ /**
36
+ * Create the adapter without binding it to anything: no server is created,
37
+ * no port is bound, no `upgrade` listener is installed. The caller drives
38
+ * the socket itself through {@link WsRpcTransport.handleUpgrade} (from its
39
+ * own `upgrade` listener) or {@link WsRpcTransport.attach} (to bind a
40
+ * server later). Takes precedence over `server` / `port` / `https`.
41
+ */
42
+ unbound?: boolean;
43
+ /**
44
+ * Destroy upgrade requests that don't match `path` instead of leaving them
45
+ * for other listeners. Enable this when devframe owns the shared server
46
+ * outright (nothing else handles its upgrades), so an off-route client is
47
+ * rejected promptly rather than left hanging. Default: `false`
48
+ * (coexist-friendly); servers this transport creates itself always
49
+ * destroy unmatched upgrades.
50
+ */
51
+ destroyUnmatched?: boolean;
52
+ /** When set, a new https.Server is created and the WS endpoint is attached to it. */
53
+ https?: ServerOptions;
54
+ /**
55
+ * Extra origins to accept on the WS upgrade beyond the loopback default.
56
+ * Add your LAN/tunnel origin here when reaching the tool from another host.
57
+ * Pass `false` to disable origin checking entirely (not recommended).
58
+ * Default: loopback-only.
59
+ */
60
+ allowedOrigins?: readonly string[] | WsOriginRegistry | false;
61
+ /**
62
+ * RPC function definitions, used by the per-call wire serializer to
63
+ * dispatch between strict-JSON and structured-clone encoding based
64
+ * on each function's `jsonSerializable` flag.
65
+ *
66
+ * When omitted, all messages fall back to structured-clone: safe but
67
+ * loses dev-time validation for `jsonSerializable: true` declarations.
68
+ */
69
+ definitions?: ReadonlyMap<string, Pick<RpcFunctionDefinitionAny, 'jsonSerializable'>>;
70
+ onConnected?: (connection: DevframeRpcConnection, meta: DevframeNodeRpcSessionMeta) => void;
71
+ onDisconnected?: (connection: DevframeRpcConnection, meta: DevframeNodeRpcSessionMeta) => void;
72
+ /** Override the default per-call serializer. Most callers should leave this unset. */
73
+ serialize?: ChannelOptions['serialize'];
74
+ /** Override the default per-call deserializer. Most callers should leave this unset. */
75
+ deserialize?: ChannelOptions['deserialize'];
76
+ }
77
+ export interface CreateWsOriginRegistryOptions {
78
+ /** Origins allowed before any external viewers are registered. */
79
+ allowedOrigins?: readonly string[];
80
+ /** Additional validation to run after the registration token is verified. */
81
+ validateOrigin?: (origin: string) => boolean;
82
+ }
83
+ export interface WsOriginRegistry {
84
+ /** Registration token to include in connection metadata. */
85
+ readonly token: string;
86
+ /** Read and register an origin from a connection bootstrap URL. */
87
+ registerFromUrl: (url: string) => string | undefined;
88
+ /** Check whether an origin is currently allowed. */
89
+ isAllowed: (origin: string | undefined) => boolean;
90
+ }
91
+ /**
92
+ * Create a live, token-protected origin allowlist for external browser
93
+ * viewers. Pass it to {@link WsRpcTransportOptions.allowedOrigins}, then use
94
+ * `registerFromUrl()` in the connection metadata handler to authorize a
95
+ * viewer without sharing a mutable array or disabling DNS-rebinding protection.
96
+ */
97
+ export declare function createWsOriginRegistry(options?: CreateWsOriginRegistryOptions): WsOriginRegistry;
98
+ export interface WsRpcTransport {
99
+ /**
100
+ * The crossws node adapter driving the socket; exposes the connected
101
+ * `peers` and pub/sub. See https://crossws.h3.dev.
102
+ */
103
+ ws: NodeAdapter;
104
+ /** Resolves when the transport-owned server is listening. */
105
+ ready: Promise<void>;
106
+ /** Returns the bound address, or `null` when the server is not listening. */
107
+ address: () => AddressInfo | string | null;
108
+ /**
109
+ * Complete a `node:http` `upgrade` event on this transport, applying the
110
+ * same `path` filter and origin gate the transport's own listener uses.
111
+ * Wire it into a host server directly (`server.on('upgrade',
112
+ * transport.handleUpgrade)`) or call it from an existing listener.
113
+ */
114
+ handleUpgrade: (req: IncomingMessage, socket: Duplex, head: Buffer) => void;
115
+ /**
116
+ * Route a server's `upgrade` events to this transport, returning a detach
117
+ * function. Use it to bind an `unbound` transport once the host server
118
+ * exists; {@link WsRpcTransport.close} detaches every server attached this
119
+ * way (without closing them, since the caller owns their lifecycle).
120
+ */
121
+ attach: (server: Server | Server$1) => () => void;
122
+ /** Remove the upgrade listener from a shared `server` (a no-op otherwise). */
123
+ detach: () => void;
124
+ /**
125
+ * Tear the transport down deterministically: detach from a shared server,
126
+ * force-terminate every connected peer, and close any server this
127
+ * transport created itself (`port` / `https` modes).
128
+ */
129
+ close: () => Promise<void>;
130
+ }
131
+ /**
132
+ * The per-peer lifecycle hooks driving a devframe RPC WebSocket, shaped for
133
+ * any [crossws](https://crossws.h3.dev) adapter. {@link attachWsRpcTransport}
134
+ * feeds them to the Node adapter; runtime-specific attachments (e.g. Bun's
135
+ * fetch-upgrade adapter) reuse the same hooks so every transport speaks the
136
+ * identical wire protocol: one birpc channel per peer, per-method
137
+ * `jsonSerializable` dispatch between strict JSON and structured-clone.
138
+ */
139
+ export declare function createWsRpcPeerHooks<ClientFunctions extends object, ServerFunctions extends object>(rpcGroup: BirpcGroup<ClientFunctions, ServerFunctions, false>, options?: Pick<WsRpcTransportOptions, 'onConnected' | 'onDisconnected' | 'definitions' | 'serialize' | 'deserialize'>): Partial<Hooks>;
140
+ /**
141
+ * Attach a WebSocket transport to an existing RPC group, powered by
142
+ * [crossws](https://crossws.h3.dev). Either attach to an existing HTTP(S)
143
+ * `server` (sharing its port, optionally scoped to a `path`), or let this
144
+ * helper create a standalone server from `port` / `host` / `https`.
145
+ *
146
+ * Returns the crossws node adapter, standalone-server readiness/address
147
+ * accessors, `detach` (remove the upgrade listener from a shared `server`),
148
+ * and `close` (full deterministic teardown).
149
+ */
150
+ export declare function attachWsRpcTransport<ClientFunctions extends object, ServerFunctions extends object>(rpcGroup: BirpcGroup<ClientFunctions, ServerFunctions, false>, options?: WsRpcTransportOptions): WsRpcTransport;
151
+ export { type DevframeNodeRpcSessionMeta, type DevframeRpcConnection, type DevframeRpcConnectionRequest, type DevframeRpcTransportKind, type DevframeWsPeer, isAllowedOrigin, isLoopbackHostname };
@@ -1,4 +1,4 @@
1
- import { n as __exportAll } from "./rolldown-runtime-DYf_mQCB.mjs";
1
+ import { n as __exportAll } from "./rolldown-runtime-BVN1G_yT.mjs";
2
2
  import { createRpcServer } from "./rpc/server.mjs";
3
3
  import { n as getRpcResolvedSetupResult, t as getRpcHandler } from "./handler-DkLlj3-B.mjs";
4
4
  import { t as diagnostics } from "./diagnostics-DC1-WcvN.mjs";
@@ -1,8 +1,8 @@
1
1
  import { n as BirpcGroup, o as EventOptions } from "./index-BKu9BxcT.mjs";
2
- import "./ws-server-CYHkeyA-.mjs";
2
+ import "./rpc/transports/ws-server.mjs";
3
3
  import { n as DevframeRpcConnection, t as DevframeNodeRpcSessionMeta } from "./session-Y9R6tqg4.mjs";
4
- import { Bt as DevframeAuthHandler, o as DevframeNodeContext, s as DevframeNodeRpcSession, vt as DevframeRpcClientFunctions, yt as DevframeRpcServerFunctions } from "./context-WxTq6kqb.mjs";
5
- import "./index-HMJPlexc.mjs";
4
+ import { B as DevframeNodeRpcSession, J as DevframeRpcClientFunctions, Y as DevframeRpcServerFunctions, k as DevframeAuthHandler, z as DevframeNodeContext } from "./index-BhUqJUHG.mjs";
5
+ import "./node/auth.mjs";
6
6
  interface CreateContextRpcServerOptions {
7
7
  context: DevframeNodeContext;
8
8
  /**
@@ -1,6 +1,6 @@
1
1
  import { createEventEmitter } from "./utils/events.mjs";
2
2
  import { nanoid } from "./utils/nanoid.mjs";
3
- // ../../node_modules/.pnpm/immer@11.2.9/node_modules/immer/dist/immer.mjs
3
+ // ../../node_modules/.pnpm/immer@11.2.10/node_modules/immer/dist/immer.mjs
4
4
  var NOTHING = Symbol.for("immer-nothing");
5
5
  var DRAFTABLE = Symbol.for("immer-draftable");
6
6
  var DRAFT_STATE = Symbol.for("immer-state");
@@ -556,7 +556,8 @@ var Immer2 = class {
556
556
  ];
557
557
  };
558
558
  if (isBoolean(config?.autoFreeze)) this.setAutoFreeze(config.autoFreeze);
559
- if (isBoolean(config?.useStrictShallowCopy)) this.setUseStrictShallowCopy(config.useStrictShallowCopy);
559
+ const strictShallowCopy = config?.useStrictShallowCopy;
560
+ if (isBoolean(strictShallowCopy) || strictShallowCopy === "class_only") this.setUseStrictShallowCopy(strictShallowCopy);
560
561
  if (isBoolean(config?.useStrictIteration)) this.setUseStrictIteration(config.useStrictIteration);
561
562
  }
562
563
  createDraft(base) {
@@ -1265,7 +1265,8 @@ function buildOtpAuthUrl(baseUrl, code = getTempAuthCode()) {
1265
1265
  * without entering the code again.
1266
1266
  */
1267
1267
  function verifyAuthToken(token, session, storage) {
1268
- if (!token || !storage.value().trusted[token]) return false;
1268
+ const trusted = storage.value().trusted;
1269
+ if (!token || !Object.hasOwn(trusted, token) || !trusted[token]) return false;
1269
1270
  session.meta.clientAuthToken = token;
1270
1271
  session.meta.isTrusted = true;
1271
1272
  return true;
@@ -1,6 +1,6 @@
1
- import { m as RpcFunctionAgentOptions } from "../types-844OBepb.mjs";
2
- import { $ as DevframeServiceOf, $t as AgentToolProviderHandle, At as McpFetchHandler, B as DevframeSetupInfo, Ct as DevframeStorageScope, Dt as CreateMcpServerOptions, Et as CreateMcpFetchHandlerOptions, F as DevframeDefinition, Ft as McpResourceTemplate, G as McpAuthorization, Gt as AgentHandle, H as DevframeSnapshotRpcInputs, I as DevframeDeploymentKind, It as McpResourceTemplateContent, J as DevframeServiceDefinition, Jt as AgentResourceContent, K as McpRouteOptions, Kt as AgentManifest, L as DevframeDockDefaults, Lt as McpResourceTemplateEntry, Mt as McpPromptArgument, Nt as McpPromptMessage, Ot as McpConnectionInfo, P as DevframeCliOptions, Pt as McpPromptResult, Q as DevframeServiceMeta, Qt as AgentToolProvider, R as DevframeDuplicationStrategy, Rt as McpResourcesChangedHook, St as DevframeHost, Tt as DevframeDiagnosticsLogger, U as DevframeSseOptions, V as DevframeSnapshotRpcEntry, W as DevframeWsOptions, X as DevframeServiceId, Xt as AgentTool, Y as DevframeServiceDescriptor, Yt as AgentResourceInput, Z as DevframeServiceInput, Zt as AgentToolInput, _t as DevframeViewHost, a as DevframeConnectionConfigsRegistry, at as DevframeScopedNodeContext, bt as DevframeRpcSharedStates, c as RpcBroadcastOptions, ct as DevframeSettings, d as RpcSharedStateHost, dt as ScopedBroadcastOptions, en as DevframeAgentHost, et as DevframeServiceScopeOf, f as RpcStreamingChannel, ft as ScopedClientFunctions, gt as SettingsForNamespace, ht as ScopedSharedStates, i as DevframeCapabilities, in as EventsMap, it as DevframeServicesState, jt as McpPrompt, kt as McpContentBlock, l as RpcFunctionsHost, lt as DevframeSettingsRegistry, m as RpcStreamingHost, mt as ScopedServerFunctions, n as ConnectionMetaSse, nn as EventEmitter, nt as DevframeServicesRegistry, o as DevframeNodeContext, ot as DevframeScopedNodeRpc, p as RpcStreamingChannelOptions, pt as ScopedRpcFn, q as McpSetting, qt as AgentResource, r as ConnectionMetaWebsocket, rn as EventUnsubscribe, rt as DevframeServicesScopeRegistry, s as DevframeNodeRpcSession, st as DevframeScopedStreamingHost, t as ConnectionMeta, tn as DevframeAgentHostEvents, tt as DevframeServicesHost, u as RpcSharedStateGetOptions, ut as DevframeSettingsStore, vt as DevframeRpcClientFunctions, wt as DevframeDiagnosticsHost, yt as DevframeRpcServerFunctions, z as DevframeRpcOptions, zt as McpServerHandle } from "../context-WxTq6kqb.mjs";
1
+ import { m as RpcFunctionAgentOptions } from "../types-KZOyhez5.mjs";
2
+ import { $ as DevframeServiceId, $t as AgentToolProviderHandle, B as DevframeNodeRpcSession, C as McpPromptResult, Ct as DevframeDiagnosticsHost, D as McpResourcesChangedHook, E as McpResourceTemplateEntry, F as ConnectionMetaSse, G as RpcStreamingChannel, Gt as AgentHandle, H as RpcFunctionsHost, I as ConnectionMetaWebsocket, J as DevframeRpcClientFunctions, Jt as AgentResourceContent, K as RpcStreamingChannelOptions, Kt as AgentManifest, L as DevframeCapabilities, O as McpServerHandle, P as ConnectionMeta, Q as DevframeServiceDescriptor, Qt as AgentToolProvider, R as DevframeConnectionConfigsRegistry, S as McpPromptMessage, St as DevframeStorageScope, T as McpResourceTemplateContent, U as RpcSharedStateGetOptions, V as RpcBroadcastOptions, W as RpcSharedStateHost, X as DevframeRpcSharedStates, Xt as AgentTool, Y as DevframeRpcServerFunctions, Yt as AgentResourceInput, Z as DevframeServiceDefinition, Zt as AgentToolInput, _ as McpConnectionInfo, _t as ScopedServerFunctions, a as DevframeDuplicationStrategy, at as DevframeServicesRegistry, b as McpPrompt, bt as DevframeViewHost, c as DevframeSnapshotRpcEntry, ct as DevframeScopedNodeContext, d as DevframeWsOptions, dt as DevframeSettings, en as DevframeAgentHost, et as DevframeServiceInput, f as McpAuthorization, ft as DevframeSettingsRegistry, g as CreateMcpServerOptions, gt as ScopedRpcFn, h as CreateMcpFetchHandlerOptions, ht as ScopedClientFunctions, i as DevframeDockDefaults, in as EventsMap, it as DevframeServicesHost, l as DevframeSnapshotRpcInputs, lt as DevframeScopedNodeRpc, m as McpSetting, mt as ScopedBroadcastOptions, n as DevframeDefinition, nn as EventEmitter, nt as DevframeServiceOf, o as DevframeRpcOptions, ot as DevframeServicesScopeRegistry, p as McpRouteOptions, pt as DevframeSettingsStore, q as RpcStreamingHost, qt as AgentResource, r as DevframeDeploymentKind, rn as EventUnsubscribe, rt as DevframeServiceScopeOf, s as DevframeSetupInfo, st as DevframeServicesState, t as DevframeCliOptions, tn as DevframeAgentHostEvents, tt as DevframeServiceMeta, u as DevframeSseOptions, ut as DevframeScopedStreamingHost, v as McpContentBlock, vt as ScopedSharedStates, w as McpResourceTemplate, wt as DevframeDiagnosticsLogger, x as McpPromptArgument, xt as DevframeHost, y as McpFetchHandler, yt as SettingsForNamespace, z as DevframeNodeContext } from "../index-BhUqJUHG.mjs";
3
3
  import { a as DevframeWsPeer, i as DevframeRpcTransportKind, n as DevframeRpcConnection, r as DevframeRpcConnectionRequest, t as DevframeNodeRpcSessionMeta } from "../session-Y9R6tqg4.mjs";
4
+ import { DevframeDefineDiagnosticsOptions } from "../utils/nostics.mjs";
4
5
  import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "../remote-assets-5AQMHZnV.mjs";
5
- import { i as DevframeDefineDiagnosticsOptions } from "../nostics-Dgwh7ytT.mjs";
6
6
  export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, AgentToolProvider, AgentToolProviderHandle, ConnectionMeta, ConnectionMetaSse, ConnectionMetaWebsocket, CreateMcpFetchHandlerOptions, CreateMcpServerOptions, DevframeAgentHost, DevframeAgentHostEvents, DevframeCapabilities, DevframeCliOptions, DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockDefaults, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, DevframeRpcOptions, DevframeRpcServerFunctions, DevframeRpcSharedStates, type DevframeRpcTransportKind, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeServiceDefinition, DevframeServiceDescriptor, DevframeServiceId, DevframeServiceInput, DevframeServiceMeta, DevframeServiceOf, DevframeServiceScopeOf, DevframeServicesHost, DevframeServicesRegistry, DevframeServicesScopeRegistry, DevframeServicesState, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, DevframeSnapshotRpcEntry, DevframeSnapshotRpcInputs, DevframeSseOptions, DevframeStorageScope, DevframeViewHost, DevframeWsOptions, type DevframeWsPeer, EventEmitter, EventUnsubscribe, EventsMap, McpAuthorization, McpConnectionInfo, McpContentBlock, McpFetchHandler, McpPrompt, McpPromptArgument, McpPromptMessage, McpPromptResult, McpResourceTemplate, McpResourceTemplateContent, McpResourceTemplateEntry, McpResourcesChangedHook, McpRouteOptions, McpServerHandle, McpSetting, RemoteAssets, RemoteAssetsErrorMessage, RemoteAssetsProvider, RemoteAssetsProviderCustom, RemoteAssetsStore, RpcBroadcastOptions, type RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedRpcFn, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, StaticAssetsSource };
@@ -1,4 +1,5 @@
1
1
  import { t as StandardSchemaV1 } from "./index-BIRF0E5l.mjs";
2
+ import "./index-BKu9BxcT.mjs";
2
3
  /** Infers a TypeScript argument tuple from a Standard Schema array */
3
4
  type InferArgsType<S extends RpcArgsSchema | undefined> = S extends readonly [] ? [] : S extends readonly [infer H, ...infer T] ? H extends StandardSchemaV1 ? T extends readonly StandardSchemaV1[] ? [StandardSchemaV1.InferInput<H>, ...InferArgsType<T>] : never : never : never;
4
5
  /** Infers a TypeScript return type from a Standard Schema */
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Promise-aware debounce, bundled in so any integration can reuse it through
3
+ * `devframe/utils/debounce` without adding its own `perfect-debounce`
4
+ * dependency. Thin re-export of `perfect-debounce`'s `debounce`; the bytes
5
+ * live once in devframe's dist.
6
+ */
1
7
  //#region src/index.d.ts
2
8
  interface DebounceOptions {
3
9
  /**
@@ -1,4 +1,4 @@
1
- import { in as EventsMap, nn as EventEmitter } from "../context-WxTq6kqb.mjs";
1
+ import { in as EventsMap, nn as EventEmitter } from "../index-BhUqJUHG.mjs";
2
2
  /**
3
3
  * Create event emitter.
4
4
  */
@@ -1 +1 @@
1
- export { n as getPort } from "../dist-DJydMELP.mjs";
1
+ export { n as getPort } from "../dist-CZ-TySHD.mjs";
@@ -1,4 +1,4 @@
1
- import { i as __toESM, r as __require, t as __commonJSMin } from "../rolldown-runtime-DYf_mQCB.mjs";
1
+ import { i as __toESM, r as __require, t as __commonJSMin } from "../rolldown-runtime-BVN1G_yT.mjs";
2
2
  // ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
3
3
  var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4
4
  let p = process || {};
@@ -1,2 +1,40 @@
1
- import { _ as formatDiagnostic, a as DevframeDiagnostics, c as DiagnosticDefinition, d as DiagnosticReporter, f as Diagnostics, g as defineProdDiagnostics, h as defineDiagnostics, i as DevframeDefineDiagnosticsOptions, l as DiagnosticHandle, m as createConsoleReporter, n as ConsoleMethod, o as Diagnostic, p as ansiFormatter, r as ConsoleReporterOptions, s as DiagnosticCallParams, t as AnyDiagnosticReporter, u as DiagnosticInit } from "../nostics-Dgwh7ytT.mjs";
2
- export { type AnyDiagnosticReporter, type ConsoleMethod, type ConsoleReporterOptions, DevframeDefineDiagnosticsOptions, DevframeDiagnostics, type Diagnostic, type DiagnosticCallParams, type DiagnosticDefinition, type DiagnosticHandle, type DiagnosticInit, type DiagnosticReporter, type Diagnostics, ansiFormatter, createConsoleReporter, defineDiagnostics, defineProdDiagnostics, formatDiagnostic };
1
+ import { AnyDiagnosticReporter, AnyDiagnosticReporter as AnyDiagnosticReporter$1, ConsoleMethod, ConsoleReporterOptions, Diagnostic, Diagnostic as Diagnostic$1, DiagnosticCallParams, DiagnosticDefinition, DiagnosticDefinition as DiagnosticDefinition$1, DiagnosticHandle, DiagnosticInit, DiagnosticReporter, Diagnostics, Diagnostics as Diagnostics$1, createConsoleReporter, defineProdDiagnostics, formatDiagnostic } from "nostics";
2
+ import { ansiFormatter } from "nostics/formatters/ansi";
3
+ /**
4
+ * The reporter every {@link defineDiagnostics} call below wires in ahead of
5
+ * any caller-supplied ones: prints the diagnostic through devframe's own
6
+ * ANSI colors via `console[method]` (default `'warn'`).
7
+ */
8
+ declare function devframeReporter(d: Diagnostic$1, { method }?: {
9
+ method?: 'log' | 'warn' | 'error';
10
+ }): void;
11
+ /**
12
+ * Options accepted by {@link defineDiagnostics}, identical to `nostics`'s
13
+ * own `DefineDiagnosticsOptions`, minus the reporter devframe already
14
+ * prepends.
15
+ */
16
+ export type DevframeDefineDiagnosticsOptions<Codes extends Record<string, DiagnosticDefinition$1>, Reporters extends readonly AnyDiagnosticReporter$1[] = []> = Parameters<typeof defineDiagnostics<Codes, Reporters>>[0];
17
+ /**
18
+ * Drop-in replacement for `nostics`'s `defineDiagnostics()` with devframe's
19
+ * ANSI console reporter pre-wired ahead of any `reporters` passed in. Every
20
+ * `diagnostics.ts` in devframe core, `@devframes/hub`, `@devframes/json-render`,
21
+ * and the built-in plugins defines its codes through this instead of
22
+ * `nostics`'s own `defineDiagnostics`; the reporter registration lives
23
+ * here, once, so none of them need to build their own reporter (`colors`,
24
+ * `ansiFormatter`) or take a direct dependency on `nostics` themselves.
25
+ */
26
+ export declare function defineDiagnostics<const Codes extends Record<string, DiagnosticDefinition$1>, const Reporters extends readonly AnyDiagnosticReporter$1[] = []>(options: {
27
+ docsBase?: string | ((code: keyof Codes) => string | undefined);
28
+ codes: Codes;
29
+ reporters?: Reporters;
30
+ }): DevframeDiagnostics<Codes, Reporters>;
31
+ /**
32
+ * The `Diagnostics` object returned by devframe's {@link defineDiagnostics}
33
+ * (devframe's ANSI console reporter is always prepended). Integrations that
34
+ * export their own `defineDiagnostics(...)` result as public API annotate it
35
+ * with this type, so the reference resolves through `devframe/utils/nostics`
36
+ * rather than inlining `nostics`'s types or taking a direct `nostics`
37
+ * dependency.
38
+ */
39
+ export type DevframeDiagnostics<Codes extends Record<string, DiagnosticDefinition$1>, Reporters extends readonly AnyDiagnosticReporter$1[] = []> = Diagnostics$1<Codes, readonly [typeof devframeReporter, ...Reporters]>;
40
+ export { type AnyDiagnosticReporter, type ConsoleMethod, type ConsoleReporterOptions, type Diagnostic, type DiagnosticCallParams, type DiagnosticDefinition, type DiagnosticHandle, type DiagnosticInit, type DiagnosticReporter, type Diagnostics, ansiFormatter, createConsoleReporter, defineProdDiagnostics, formatDiagnostic };
@@ -1,2 +1,55 @@
1
- import { i as validateOriginCandidate, n as isLoopbackAddress, r as isLoopbackHostname, t as isAllowedOrigin } from "../origin-D5i7K_Zb.mjs";
2
- export { isAllowedOrigin, isLoopbackAddress, isLoopbackHostname, validateOriginCandidate };
1
+ /**
2
+ * Origin and hostname predicates shared by the RPC transports (the WS upgrade,
3
+ * SSE, and MCP origin gates) and the instance shell's authentication-link
4
+ * origin validation. Kept dependency-free and runtime-agnostic so any consumer
5
+ * can pull in a single check without dragging in a transport's `crossws`
6
+ * import.
7
+ */
8
+ /**
9
+ * Whether `hostname` names a loopback host: `localhost` (or any `*.localhost`
10
+ * subdomain), the IPv6 loopback `::1`, or an IPv4 literal inside the
11
+ * `127.0.0.0/8` loopback block.
12
+ *
13
+ * The IPv4 case is matched **structurally**: the whole hostname must be a
14
+ * canonical dotted-decimal IPv4 literal whose first octet is `127`. A bare
15
+ * `startsWith('127.')` prefix check would also accept an attacker-controlled
16
+ * DNS name that merely *begins* with `127.` (`127.attacker.example`,
17
+ * `127.0.0.1.attacker.example`), letting a cross-origin browser page defeat
18
+ * the loopback origin gate that guards the RPC/MCP surface (a DNS-rebinding /
19
+ * cross-site WebSocket-hijacking bypass). Requiring a real IPv4 literal keeps
20
+ * genuine loopback addresses (`127.0.0.1`, `127.5.5.5`) allowed while rejecting
21
+ * those DNS names.
22
+ */
23
+ export declare function isLoopbackHostname(hostname: string): boolean;
24
+ /**
25
+ * Whether `address` is a loopback peer address as reported by a socket
26
+ * (`net.Socket.remoteAddress`): the IPv6 loopback `::1`, an IPv4 literal in
27
+ * `127.0.0.0/8`, or an IPv4-mapped IPv6 form of one (`::ffff:127.0.0.1`).
28
+ *
29
+ * Unlike {@link isLoopbackHostname} this takes a raw address, not a hostname:
30
+ * it never accepts a `localhost`-style name (a socket peer is always a literal
31
+ * address) and understands the IPv4-mapped IPv6 form the OS hands back on a
32
+ * dual-stack listener. Used to prove a same-machine caller from the connected
33
+ * peer, which a client cannot forge, rather than from the `Origin` header,
34
+ * which it can.
35
+ */
36
+ export declare function isLoopbackAddress(address: string): boolean;
37
+ /**
38
+ * Default origin policy for a localhost dev tool: allow requests with no
39
+ * `Origin` header (native, non-browser clients), allow any loopback origin
40
+ * (so cross-port localhost dev setups keep working), and allow explicitly
41
+ * configured origins. Everything else, such as a real remote page in the dev's
42
+ * browser, is rejected.
43
+ */
44
+ export declare function isAllowedOrigin(origin: string | undefined, allowedOrigins: readonly string[]): boolean;
45
+ /**
46
+ * Decide whether a request-derived origin candidate may back a devframe's
47
+ * advertised public origin, the destination of the OTP magic link. Stricter
48
+ * than {@link isAllowedOrigin}: it rejects credentials, a path, a query, a
49
+ * fragment, a malformed port, and non-HTTP(S) schemes, and adopts a candidate
50
+ * only when its hostname is loopback or its canonical origin exactly matches
51
+ * an `allowedOrigins` entry (a caller with no static list passes none, so only
52
+ * loopback qualifies). Returns the canonical origin to adopt, or `undefined`
53
+ * to reject. Forwarded headers are never consulted.
54
+ */
55
+ export declare function validateOriginCandidate(candidate: string, allowedOrigins?: readonly string[]): string | undefined;
@@ -1,6 +1,6 @@
1
1
  import { a as RemoteAssetsStore } from "../remote-assets-5AQMHZnV.mjs";
2
- import { EventHandler, H3 } from "h3";
3
2
  import { IncomingMessage, ServerResponse } from "node:http";
3
+ import { EventHandler, H3 } from "h3";
4
4
  /**
5
5
  * What the static-serving engine accepts: a local directory, or a resolved
6
6
  * {@link RemoteAssetsStore} back-proxy (from `devframe/utils/remote-assets`).
@@ -1,2 +1,2 @@
1
- import { A as SharedStateEvents, D as ImmutableObject, E as ImmutableMap, M as SharedStatePatch, N as createSharedState, O as ImmutableSet, T as ImmutableArray, j as SharedStateOptions, k as SharedState, w as Immutable } from "../context-WxTq6kqb.mjs";
1
+ import { Bt as SharedState, Ft as Immutable, Ht as SharedStateOptions, It as ImmutableArray, Lt as ImmutableMap, Rt as ImmutableObject, Ut as SharedStatePatch, Vt as SharedStateEvents, Wt as createSharedState, zt as ImmutableSet } from "../index-BhUqJUHG.mjs";
2
2
  export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
@@ -1 +1 @@
1
- export { t as createSharedState } from "../shared-state-COV7NCbd.mjs";
1
+ export { t as createSharedState } from "../shared-state-DiAsLHP8.mjs";
@@ -1,2 +1,2 @@
1
- import { C as createStreamSink, S as createStreamReader, _ as CreateStreamSinkOptions, b as StreamSink, g as CreateStreamReaderOptions, h as BufferedChunk, v as StreamErrorPayload, x as StreamSinkEvents, y as StreamReader } from "../context-WxTq6kqb.mjs";
1
+ import { At as StreamReader, Dt as CreateStreamReaderOptions, Et as BufferedChunk, Mt as StreamSinkEvents, Nt as createStreamReader, Ot as CreateStreamSinkOptions, Pt as createStreamSink, jt as StreamSink, kt as StreamErrorPayload } from "../index-BhUqJUHG.mjs";
2
2
  export { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "devframe",
3
3
  "type": "module",
4
- "version": "1.3.2",
4
+ "version": "1.3.5",
5
5
  "description": "Framework for building one portable devtool integration that runs in any viewer.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -77,7 +77,7 @@
77
77
  "skills"
78
78
  ],
79
79
  "peerDependencies": {
80
- "@devframes/agentic": "1.3.2",
80
+ "@devframes/agentic": "1.3.5",
81
81
  "cac": "^7.0.0"
82
82
  },
83
83
  "peerDependenciesMeta": {
@@ -95,12 +95,12 @@
95
95
  "pathe": "^2.0.3"
96
96
  },
97
97
  "devDependencies": {
98
- "@devframes/agentic": "1.3.2",
98
+ "@devframes/agentic": "1.3.5",
99
99
  "@standard-schema/spec": "^1.1.0",
100
100
  "birpc": "^4.2.0",
101
101
  "cac": "^7.1.0",
102
102
  "get-port-please": "^3.2.0",
103
- "immer": "^11.2.9",
103
+ "immer": "^11.2.10",
104
104
  "launch-editor": "^2.14.2",
105
105
  "mlly": "^1.8.2",
106
106
  "mrmime": "^2.0.1",
@@ -110,12 +110,12 @@
110
110
  "perfect-debounce": "^2.1.0",
111
111
  "structured-clone-es": "^2.0.1",
112
112
  "tinyglobby": "^0.2.17",
113
- "tsdown": "^0.23.4",
113
+ "tsdown": "^0.23.7",
114
114
  "typescript": "^6.0.3",
115
115
  "ua-parser-modern": "^0.1.1",
116
116
  "valibot": "^1.5.0",
117
117
  "whenexpr": "^0.1.2",
118
- "ws": "^8.22.1"
118
+ "ws": "^8.23.0"
119
119
  },
120
120
  "scripts": {
121
121
  "build": "tsdown",
@@ -1,121 +0,0 @@
1
- import { C as RpcFunctionType, S as RpcFunctionSetupResult, T as RpcReturnSchema, g as RpcFunctionDefinitionAny, h as RpcFunctionDefinition, n as RpcArgsSchema, w as RpcFunctionsCollector } from "./types-844OBepb.mjs";
2
- interface RpcCacheOptions {
3
- functions: string[];
4
- keySerializer?: (args: unknown[]) => string;
5
- }
6
- /**
7
- * @experimental API is expected to change.
8
- */
9
- declare class RpcCacheManager {
10
- private cacheMap;
11
- private options;
12
- private keySerializer;
13
- constructor(options: RpcCacheOptions);
14
- updateOptions(options: Partial<RpcCacheOptions>): void;
15
- cached<T>(m: string, a: unknown[]): T | undefined;
16
- has(m: string, a: unknown[]): boolean;
17
- apply(req: {
18
- m: string;
19
- a: unknown[];
20
- }, res: unknown): void;
21
- validate(m: string): boolean;
22
- clear(fn?: string): void;
23
- }
24
- declare class RpcFunctionsCollectorBase<LocalFunctions extends Record<string, any>, SetupContext> implements RpcFunctionsCollector<LocalFunctions, SetupContext> {
25
- readonly context: SetupContext;
26
- readonly definitions: Map<string, RpcFunctionDefinition<string, any, any, any, any, any, SetupContext>>;
27
- readonly functions: LocalFunctions;
28
- private readonly _onChanged;
29
- constructor(context: SetupContext);
30
- register(fnDef: RpcFunctionDefinition<string, any, any, any, any, any, SetupContext>, force?: boolean): void;
31
- update(fn: RpcFunctionDefinition<string, any, any, any, any, any, SetupContext>, force?: boolean): void;
32
- onChanged(fn: (id?: string) => void): () => void;
33
- getHandler<T extends keyof LocalFunctions>(name: T): Promise<LocalFunctions[T]>;
34
- getSchema<T extends keyof LocalFunctions>(name: T): {
35
- args: RpcArgsSchema | undefined;
36
- returns: RpcReturnSchema | undefined;
37
- };
38
- has(name: string): boolean;
39
- get(name: string): RpcFunctionDefinition<string, any, any, any, any, any, SetupContext> | undefined;
40
- list(): string[];
41
- }
42
- declare function 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>): RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS>;
43
- declare function createDefineWrapperWithContext<CONTEXT>(): <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, CONTEXT>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, CONTEXT>;
44
- declare function getRpcResolvedSetupResult<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, CONTEXT = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, any, any, CONTEXT>, context: CONTEXT): Promise<RpcFunctionSetupResult<ARGS, RETURN>>;
45
- declare function getRpcHandler<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, CONTEXT = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, any, any, CONTEXT>, context: CONTEXT): Promise<(...args: ARGS) => RETURN>;
46
- /**
47
- * Wire format used by the live RPC transports (WebSocket and SSE).
48
- *
49
- * - **JSON (default, unprefixed):** payload is plain JSON text. Used when
50
- * the dispatched method is declared `jsonSerializable: true`. Encoded
51
- * via {@link strictJsonStringify} (rejects non-JSON values), decoded
52
- * via `JSON.parse`.
53
- * - **Structured-clone (`s:` prefix):** payload is `s:` followed by
54
- * `structured-clone-es` text. Used when the method is declared
55
- * `jsonSerializable: false` (or omitted, the default). Round-trips
56
- * `Map`, `Set`, `Date`, `BigInt`, cycles, and class instances.
57
- *
58
- * birpc envelopes always start with `{`, so a leading byte that is not
59
- * `s` is unambiguously JSON. Each direction independently chooses its
60
- * encoding from local definitions; request and response are not
61
- * coupled by a mirror rule.
62
- */
63
- declare const STRUCTURED_CLONE_PREFIX = "s:";
64
- /**
65
- * `JSON.stringify` with a single-pass strict replacer.
66
- *
67
- * Throws `DF0020` synchronously when the value contains a type JSON
68
- * cannot round-trip losslessly: `Map`, `Set`, `Date`, `BigInt`, class
69
- * instances, or `undefined` inside an array (silently becomes `null`).
70
- *
71
- * Native pass-throughs (no extra work needed):
72
- * - circular references: `JSON.stringify` raises `TypeError`.
73
- * - `BigInt` at top level: caught here for a friendlier error path.
74
- *
75
- * Lenient cases (allowed without throwing):
76
- * - `undefined` as an object property: legitimate optional field;
77
- * JSON.stringify just omits it.
78
- * - `undefined` at the root: legitimate "action returned nothing".
79
- * - `Symbol` / `Function` values: semantically "drop me" in JSON.
80
- *
81
- * `fnName` is used only for the diagnostic message; pass the RPC
82
- * function name when calling from a wire serializer / dump writer so
83
- * the error points at the offending function.
84
- */
85
- declare function strictJsonStringify(value: unknown, fnName?: string): string;
86
- /**
87
- * Validate positional arguments against their declared schemas. Only
88
- * indices with a schema are checked; extra arguments pass through
89
- * untouched. Throws `DF0038` on the first failing argument.
90
- *
91
- * Validation guards the payload without rewriting it: the original values
92
- * are handed to the handler unchanged, so a schema that describes a subset
93
- * of an object never silently strips the sender's extra fields (and any
94
- * declared transforms stay a purely type-level concern).
95
- *
96
- * @internal
97
- */
98
- declare function validateRpcArgs(name: string, argsSchema: RpcArgsSchema | undefined, args: readonly unknown[]): Promise<unknown[]>;
99
- /**
100
- * Validate a handler's resolved return value against its declared schema.
101
- * Throws `DF0039` when the value fails the schema, otherwise returns the
102
- * original value unchanged (guard-only, never rewriting the payload; see
103
- * {@link validateRpcArgs}). Passes through when no return schema is set.
104
- *
105
- * @internal
106
- */
107
- declare function validateRpcReturn(name: string, returnSchema: RpcReturnSchema | undefined, value: unknown): Promise<unknown>;
108
- /**
109
- * Validates RPC function definitions.
110
- * Action and event functions cannot have dumps (side effects should not be cached).
111
- *
112
- * @throws {Error} If an action or event function has a dump configuration
113
- */
114
- declare function validateDefinitions(definitions: readonly RpcFunctionDefinitionAny[]): void;
115
- /**
116
- * Validates a single RPC function definition.
117
- *
118
- * @throws {Error} If an action or event function has a dump configuration
119
- */
120
- declare function validateDefinition(definition: RpcFunctionDefinitionAny): void;
121
- export { STRUCTURED_CLONE_PREFIX as a, getRpcResolvedSetupResult as c, RpcFunctionsCollectorBase as d, RpcCacheManager as f, validateRpcReturn as i, createDefineWrapperWithContext as l, validateDefinitions as n, strictJsonStringify as o, RpcCacheOptions as p, validateRpcArgs as r, getRpcHandler as s, validateDefinition as t, defineRpcFunction as u };