devframe 1.3.1 → 1.3.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.
- package/dist/{_shared-Cm4iD0L3.d.mts → _shared-BxeuukaL.d.mts} +2 -4
- package/dist/{_shared-C61zPwIz.mjs → _shared-CtXCQFTV.mjs} +6 -9
- package/dist/adapters/build.d.mts +3 -5
- package/dist/adapters/build.mjs +7 -8
- package/dist/adapters/cac.d.mts +1 -3
- package/dist/adapters/cac.mjs +5 -7
- package/dist/adapters/dev.d.mts +6 -8
- package/dist/adapters/dev.mjs +2 -2
- package/dist/adapters/embedded.d.mts +2 -4
- package/dist/adapters/embedded.mjs +1 -2
- package/dist/adapters/initiate.d.mts +10 -10
- package/dist/adapters/initiate.mjs +1 -2
- package/dist/adapters/mcp.d.mts +2 -2
- package/dist/adapters/mcp.mjs +1 -2
- package/dist/{agentic-C6SCkdtj.d.mts → agentic-DVgUzwhV.d.mts} +1 -3
- package/dist/{browser-agent-Pu-FLk6I.mjs → browser-agent-DmAotroz.mjs} +1 -2
- package/dist/{browser-agent-rpc-KH4HHvHf.mjs → browser-agent-rpc-CS80Sphv.mjs} +3 -5
- package/dist/cli/main.d.mts +1 -3
- package/dist/cli/main.mjs +3 -4
- package/dist/client/index.d.mts +6 -30
- package/dist/client/index.mjs +47 -72
- package/dist/{client-agent-iBkMYxqn.mjs → client-agent-qNMgDUev.mjs} +7 -12
- package/dist/constants.d.mts +1 -5
- package/dist/constants.mjs +2 -3
- package/dist/{context-BGJi0ITA.d.mts → context-B-AARy_U.d.mts} +1 -3
- package/dist/{context-D_jSSdME.mjs → context-BTxC4QrJ.mjs} +4 -5
- package/dist/{context-CAJ5V017.mjs → context-C5FcbWQi.mjs} +25 -41
- package/dist/{crypto-token-TVbGGFuj.mjs → crypto-token-CUhPE_ei.mjs} +1 -2
- package/dist/{define-BLWPsH6y.mjs → define-C8h-fyD3.mjs} +1 -2
- package/dist/{dev-BKBjIpX3.mjs → dev-Cu_iwSCy.mjs} +9 -11
- package/dist/{diagnostics-E_PvUPsA.mjs → diagnostics-DC1-WcvN.mjs} +2 -3
- package/dist/{dist-CO98PBnQ.mjs → dist-BWGpvt-z.mjs} +1 -2
- package/dist/{dist-CZXfGEkd.mjs → dist-CZ-TySHD.mjs} +3 -11
- package/dist/{events-0wDwalmL.mjs → events-qWCKwD8-.mjs} +1 -2
- package/dist/{handler-DmaAfpGq.mjs → handler-DkLlj3-B.mjs} +3 -5
- package/dist/{hash-DdPnc4k3.mjs → hash-DHqpWeMO.mjs} +4 -8
- package/dist/{host-h3-BROI6SQ4.mjs → host-h3-D1uj5EM8.mjs} +1 -2
- package/dist/{import-runtime-module-BzlEQ9PI.mjs → import-runtime-module-DsdqJ1gK.mjs} +2 -3
- package/dist/in-page-channel/index.d.mts +3 -12
- package/dist/in-page-channel/index.mjs +10 -16
- package/dist/{index-CeEtxDmK.d.mts → index-BIRF0E5l.d.mts} +0 -2
- package/dist/{index-Bia1vKjL.d.mts → index-BKu9BxcT.d.mts} +0 -2
- package/dist/{context-BNxFOPbX.d.mts → index-BhUqJUHG.d.mts} +1408 -1442
- package/dist/index.d.mts +7 -8
- package/dist/index.mjs +3 -4
- package/dist/{instance-registry-C_4PpB6N.mjs → instance-registry-DwmnWyCK.mjs} +4 -10
- package/dist/{instance-shell-m4sY2oTG.mjs → instance-shell-Coid7CP6.mjs} +38 -17
- package/dist/{instance-shell-GihbmXoF.d.mts → instance-shell-DTk514M9.d.mts} +6 -10
- package/dist/{interactive-auth-DdDxs3WF.mjs → interactive-auth-BURwIAvE.mjs} +6 -8
- package/dist/internal/index.d.mts +9 -29
- package/dist/internal/index.mjs +13 -15
- package/dist/{mcp-content-QImBQO8e.d.mts → mcp-content-0a0mpCL5.d.mts} +1 -3
- package/dist/{mcp-content-DN3O212x.mjs → mcp-content-CqU8yaF7.mjs} +1 -2
- package/dist/{mrmime-40h5OOIp.mjs → mrmime-y_XyiVcd.mjs} +1 -2
- package/dist/node/auth.d.mts +84 -3
- package/dist/node/auth.mjs +2 -2
- package/dist/node/hub-internals.d.mts +11 -2
- package/dist/node/hub-internals.mjs +2 -2
- package/dist/node/index.d.mts +4 -6
- package/dist/node/index.mjs +2 -2
- package/dist/{nostics-D0PvLZsn.mjs → nostics-InlX4tmd.mjs} +2 -4
- package/dist/{origin-DZit9g29.mjs → origin-Ck7mLbKU.mjs} +1 -2
- package/dist/recipes/interactive-auth.d.mts +3 -5
- package/dist/recipes/interactive-auth.mjs +1 -2
- package/dist/{remote-assets-eBvSKZMS.d.mts → remote-assets-5AQMHZnV.d.mts} +0 -2
- package/dist/{remote-assets-B-n83kUY.mjs → remote-assets-DhonNeo_.mjs} +5 -8
- package/dist/{revoke-CeQUo6KI.mjs → revoke-D6KA3vwr.mjs} +2 -3
- package/dist/{rolldown-runtime-B4iAMlE-.mjs → rolldown-runtime-BVN1G_yT.mjs} +6 -7
- package/dist/rpc/client.d.mts +2 -4
- package/dist/rpc/client.mjs +2 -3
- package/dist/rpc/dump.d.mts +3 -11
- package/dist/rpc/dump.mjs +1 -2
- package/dist/rpc/index.d.mts +122 -4
- package/dist/rpc/index.mjs +6 -8
- package/dist/rpc/server.d.mts +2 -4
- package/dist/rpc/server.mjs +2 -3
- package/dist/rpc/transports/sse-client.d.mts +34 -2
- package/dist/rpc/transports/sse-client.mjs +2 -3
- package/dist/rpc/transports/sse-server.d.mts +5 -7
- package/dist/rpc/transports/sse-server.mjs +4 -5
- package/dist/rpc/transports/ws-bun.d.mts +3 -5
- package/dist/rpc/transports/ws-bun.mjs +2 -3
- package/dist/rpc/transports/ws-client.d.mts +27 -2
- package/dist/rpc/transports/ws-client.mjs +2 -3
- package/dist/rpc/transports/ws-deno.d.mts +3 -5
- package/dist/rpc/transports/ws-deno.mjs +2 -3
- package/dist/rpc/transports/ws-server.d.mts +151 -4
- package/dist/rpc/transports/ws-server.mjs +5 -6
- package/dist/{rpc-core-BLc5hm9X.mjs → rpc-core-BmDHiDR6.mjs} +4 -5
- package/dist/{rpc-core-CGTCla-R.d.mts → rpc-core-CblgPYJ_.d.mts} +5 -7
- package/dist/{serialization-BhuOoL80.mjs → serialization-iiTQ7n21.mjs} +3 -5
- package/dist/{services-install-D5YUwFXW.mjs → services-install-DCuDzMJ-.mjs} +1 -2
- package/dist/{session-DPfj6zQG.mjs → session-BjvoLH3r.mjs} +1 -2
- package/dist/{session-r6PDixP6.d.mts → session-Y9R6tqg4.d.mts} +0 -2
- package/dist/{shared-state-Cc-Jrhma.mjs → shared-state-COV7NCbd.mjs} +4 -6
- package/dist/{state-W4wI6X5X.mjs → state-B_yjfeqo.mjs} +3 -5
- package/dist/{storage-CWI9PZ-5.mjs → storage-DpJ52UB_.mjs} +3 -5
- package/dist/{structured-clone-CbAV5rFI.mjs → structured-clone-B1N_XQvA.mjs} +2 -4
- package/dist/{structured-clone-CgtQ61SA.mjs → structured-clone-D1dOCZvc.mjs} +2 -4
- package/dist/{tool-input-CES3Pc4y.mjs → tool-input-CcCgJ8jq.mjs} +6 -12
- package/dist/types/index.d.mts +5 -5
- package/dist/{types-BmDbfHCx.d.mts → types-KZOyhez5.d.mts} +2 -5
- package/dist/utils/agent-tool-name.d.mts +1 -3
- package/dist/utils/agent-tool-name.mjs +1 -2
- package/dist/utils/colors.d.mts +1 -3
- package/dist/utils/colors.mjs +1 -2
- package/dist/utils/crypto-token.d.mts +1 -3
- package/dist/utils/crypto-token.mjs +1 -2
- package/dist/utils/debounce.d.mts +6 -2
- package/dist/utils/debounce.mjs +1 -2
- package/dist/utils/events.d.mts +2 -4
- package/dist/utils/events.mjs +1 -2
- package/dist/utils/get-port.d.mts +0 -2
- package/dist/utils/get-port.mjs +1 -2
- package/dist/utils/hash.d.mts +1 -3
- package/dist/utils/hash.mjs +1 -2
- package/dist/utils/launch-editor.d.mts +1 -3
- package/dist/utils/launch-editor.mjs +25 -37
- package/dist/utils/nanoid.d.mts +1 -3
- package/dist/utils/nanoid.mjs +1 -2
- package/dist/utils/nostics.d.mts +40 -2
- package/dist/utils/nostics.mjs +1 -2
- package/dist/utils/open.d.mts +1 -3
- package/dist/utils/open.mjs +1 -2
- package/dist/utils/origin.d.mts +55 -2
- package/dist/utils/origin.mjs +1 -2
- package/dist/utils/remote-assets.d.mts +2 -4
- package/dist/utils/remote-assets.mjs +1 -2
- package/dist/utils/serve-static.d.mts +3 -5
- package/dist/utils/serve-static.mjs +3 -4
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -2
- package/dist/utils/simple-schema.d.mts +1 -3
- package/dist/utils/simple-schema.mjs +1 -2
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/streaming-channel.mjs +1 -2
- package/dist/utils/structured-clone.d.mts +1 -3
- package/dist/utils/structured-clone.mjs +1 -2
- package/dist/utils/url.d.mts +1 -3
- package/dist/utils/url.mjs +1 -2
- package/dist/utils/when.d.mts +1 -3
- package/dist/utils/when.mjs +2 -4
- package/dist/{validation-CMfDAti3.mjs → validation-Cjy1P58H.mjs} +7 -13
- package/dist/{wire-codec-B1W3zH3L.mjs → wire-codec-BdngvzfH.mjs} +3 -4
- package/dist/{write-DK7rBUN3.mjs → write-3miSvPaD.mjs} +10 -16
- package/package.json +8 -8
- package/dist/index-CxJatyA1.d.mts +0 -88
- package/dist/index-DuEm0sDH.d.mts +0 -135
- package/dist/nostics-DWvukRwa.d.mts +0 -42
- package/dist/origin-CY6BBHOy.d.mts +0 -58
- package/dist/sse-client-DNdscfu_.d.mts +0 -37
- package/dist/ws-client-6Mrz6eC4.d.mts +0 -30
- package/dist/ws-server-y2R76aSW.d.mts +0 -152
|
@@ -1,4 +1,151 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
|
|
1
|
+
import { a as ChannelOptions, n as BirpcGroup } from "../../index-BKu9BxcT.mjs";
|
|
2
|
+
import { g as RpcFunctionDefinitionAny } from "../../types-KZOyhez5.mjs";
|
|
3
|
+
import { a as DevframeWsPeer, i as DevframeRpcTransportKind, n as DevframeRpcConnection, r as DevframeRpcConnectionRequest, t as DevframeNodeRpcSessionMeta } from "../../session-Y9R6tqg4.mjs";
|
|
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,12 +1,12 @@
|
|
|
1
1
|
import "../../constants.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { n as isLoopbackHostname, t as isAllowedOrigin } from "../../origin-
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
2
|
+
import { n as randomToken, r as timingSafeEqual } from "../../crypto-token-CUhPE_ei.mjs";
|
|
3
|
+
import { n as isLoopbackHostname, t as isAllowedOrigin } from "../../origin-Ck7mLbKU.mjs";
|
|
4
|
+
import { t as createRpcWireCodec } from "../../wire-codec-BdngvzfH.mjs";
|
|
5
|
+
import { t as createRpcSessionMeta } from "../../session-BjvoLH3r.mjs";
|
|
6
6
|
import { createServer } from "node:http";
|
|
7
7
|
import { createServer as createServer$1 } from "node:https";
|
|
8
8
|
import crossws from "crossws/adapters/node";
|
|
9
|
-
|
|
9
|
+
// src/rpc/transports/ws-server.ts
|
|
10
10
|
/**
|
|
11
11
|
* Create a live, token-protected origin allowlist for external browser
|
|
12
12
|
* viewers. Pass it to {@link WsRpcTransportOptions.allowedOrigins}, then use
|
|
@@ -229,5 +229,4 @@ function attachWsRpcTransport(rpcGroup, options = {}) {
|
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
//#endregion
|
|
233
232
|
export { attachWsRpcTransport, createWsOriginRegistry, createWsRpcPeerHooks, isAllowedOrigin, isLoopbackHostname };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { n as getRpcResolvedSetupResult, t as getRpcHandler } from "./handler-DmaAfpGq.mjs";
|
|
1
|
+
import { n as __exportAll } from "./rolldown-runtime-BVN1G_yT.mjs";
|
|
3
2
|
import { createRpcServer } from "./rpc/server.mjs";
|
|
4
|
-
import { t as
|
|
3
|
+
import { n as getRpcResolvedSetupResult, t as getRpcHandler } from "./handler-DkLlj3-B.mjs";
|
|
4
|
+
import { t as diagnostics } from "./diagnostics-DC1-WcvN.mjs";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
|
-
|
|
6
|
+
// src/node/rpc-core.ts
|
|
7
7
|
var rpc_core_exports = /* @__PURE__ */ __exportAll({ createContextRpcServer: () => createContextRpcServer });
|
|
8
8
|
/**
|
|
9
9
|
* Bind a devframe context's registered RPC functions to a birpc group,
|
|
@@ -93,5 +93,4 @@ function createContextRpcServer(options) {
|
|
|
93
93
|
onDisconnected
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
//#endregion
|
|
97
96
|
export { rpc_core_exports as n, createContextRpcServer as t };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { n as BirpcGroup, o as EventOptions } from "./index-
|
|
2
|
-
import
|
|
3
|
-
import { n as DevframeRpcConnection, t as DevframeNodeRpcSessionMeta } from "./session-
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
//#region src/node/rpc-core.d.ts
|
|
1
|
+
import { n as BirpcGroup, o as EventOptions } from "./index-BKu9BxcT.mjs";
|
|
2
|
+
import "./rpc/transports/ws-server.mjs";
|
|
3
|
+
import { n as DevframeRpcConnection, t as DevframeNodeRpcSessionMeta } from "./session-Y9R6tqg4.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";
|
|
7
6
|
interface CreateContextRpcServerOptions {
|
|
8
7
|
context: DevframeNodeContext;
|
|
9
8
|
/**
|
|
@@ -45,5 +44,4 @@ interface ContextRpcServer {
|
|
|
45
44
|
* `authorize` gate, and the `auth: false` auto-trust handshake shim.
|
|
46
45
|
*/
|
|
47
46
|
declare function createContextRpcServer(options: CreateContextRpcServerOptions): ContextRpcServer;
|
|
48
|
-
//#endregion
|
|
49
47
|
export { CreateContextRpcServerOptions as n, createContextRpcServer as r, ContextRpcServer as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as defineDiagnostics } from "./nostics-
|
|
2
|
-
|
|
1
|
+
import { i as defineDiagnostics } from "./nostics-InlX4tmd.mjs";
|
|
2
|
+
// src/rpc/diagnostics.ts
|
|
3
3
|
const diagnostics = defineDiagnostics({
|
|
4
4
|
docsBase: "https://devfra.me/errors",
|
|
5
5
|
codes: {
|
|
@@ -35,8 +35,7 @@ const diagnostics = defineDiagnostics({
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
|
|
39
|
-
//#region src/rpc/serialization.ts
|
|
38
|
+
// src/rpc/serialization.ts
|
|
40
39
|
/**
|
|
41
40
|
* Wire format used by the live RPC transports (WebSocket and SSE).
|
|
42
41
|
*
|
|
@@ -112,5 +111,4 @@ function formatPath(parent, key) {
|
|
|
112
111
|
if (key === "") return "<root>";
|
|
113
112
|
return key;
|
|
114
113
|
}
|
|
115
|
-
//#endregion
|
|
116
114
|
export { strictJsonStringify as n, diagnostics as r, STRUCTURED_CLONE_PREFIX as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { isAbsolute, join } from "pathe";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
|
-
|
|
4
|
+
// src/node/services-install.ts
|
|
5
5
|
/**
|
|
6
6
|
* Turn a `resolveFrom` value (a file path, a file URL like `import.meta.url`,
|
|
7
7
|
* or a directory) into something `createRequire` accepts; a directory gets a
|
|
@@ -166,5 +166,4 @@ function deepMergeTwo(a, b) {
|
|
|
166
166
|
function deepMergeOptionSets(sets) {
|
|
167
167
|
return sets.reduce((merged, set) => deepMergeTwo(merged, set));
|
|
168
168
|
}
|
|
169
|
-
//#endregion
|
|
170
169
|
export { satisfiesVersionRange as a, resolveServicePackage as i, expandResolveFrom as n, importServicePackage as r, deepMergeOptionSets as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/rpc/transports/session.ts
|
|
2
2
|
let sessionId = 0;
|
|
3
3
|
/**
|
|
4
4
|
* Mint the per-connection session meta every transport binding shares:
|
|
@@ -12,5 +12,4 @@ function createRpcSessionMeta() {
|
|
|
12
12
|
subscribedStates: /* @__PURE__ */ new Set()
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { createRpcSessionMeta as t };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/rpc/transports/session.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Structural view of the crossws `Peer` backing a WebSocket RPC connection:
|
|
4
3
|
* the transport-independent slice of its API (identity, send, pub/sub,
|
|
@@ -107,5 +106,4 @@ interface DevframeNodeRpcSessionMeta {
|
|
|
107
106
|
*/
|
|
108
107
|
uploadingStreams?: Set<string>;
|
|
109
108
|
}
|
|
110
|
-
//#endregion
|
|
111
109
|
export { DevframeWsPeer as a, DevframeRpcTransportKind as i, DevframeRpcConnection as n, DevframeRpcConnectionRequest as r, DevframeNodeRpcSessionMeta as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createEventEmitter } from "./utils/events.mjs";
|
|
2
2
|
import { nanoid } from "./utils/nanoid.mjs";
|
|
3
|
-
|
|
3
|
+
// ../../node_modules/.pnpm/immer@11.2.9/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");
|
|
@@ -449,7 +449,7 @@ function peek(draft, prop) {
|
|
|
449
449
|
return (state ? latest(state) : draft)[prop];
|
|
450
450
|
}
|
|
451
451
|
function isRelocatedBaseRef(state, prop, value) {
|
|
452
|
-
if (state.type_ !== 1 || !state.allIndicesReassigned_ ||
|
|
452
|
+
if (state.type_ !== 1 || !state.allIndicesReassigned_ || !isDraftable(value) || value[DRAFT_STATE]) return false;
|
|
453
453
|
return state.baseRefs_.has(value);
|
|
454
454
|
}
|
|
455
455
|
function readPropFromProto(state, source, prop) {
|
|
@@ -667,7 +667,7 @@ function enablePatches() {
|
|
|
667
667
|
const proxyDraft = getProxyDraft(get(parentCopy, state.key_));
|
|
668
668
|
const valueAtKey = get(parentCopy, state.key_);
|
|
669
669
|
if (valueAtKey === void 0) return null;
|
|
670
|
-
if (valueAtKey !== state.draft_ && valueAtKey !== state.
|
|
670
|
+
if (valueAtKey !== state.draft_ && valueAtKey !== state.copy_) return null;
|
|
671
671
|
if (proxyDraft != null && proxyDraft.base_ !== state.base_) return null;
|
|
672
672
|
const isSet2 = state.parent_.type_ === 3;
|
|
673
673
|
let key;
|
|
@@ -899,8 +899,7 @@ var immer = new Immer2();
|
|
|
899
899
|
var produce = immer.produce;
|
|
900
900
|
var produceWithPatches = /* @__PURE__ */ immer.produceWithPatches.bind(immer);
|
|
901
901
|
var applyPatches = /* @__PURE__ */ immer.applyPatches.bind(immer);
|
|
902
|
-
|
|
903
|
-
//#region src/utils/shared-state.ts
|
|
902
|
+
// src/utils/shared-state.ts
|
|
904
903
|
/**
|
|
905
904
|
* Upper bound on retained syncIds. Loop echoes arrive near-immediately, so a
|
|
906
905
|
* generous window preserves de-dup while capping memory on long-lived,
|
|
@@ -948,5 +947,4 @@ function createSharedState(options) {
|
|
|
948
947
|
syncIds
|
|
949
948
|
};
|
|
950
949
|
}
|
|
951
|
-
//#endregion
|
|
952
950
|
export { createSharedState as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEVFRAME_OTP_URL_PARAM } from "./constants.mjs";
|
|
2
|
-
import { n as randomToken, r as timingSafeEqual, t as randomDigits } from "./crypto-token-
|
|
3
|
-
|
|
2
|
+
import { n as randomToken, r as timingSafeEqual, t as randomDigits } from "./crypto-token-CUhPE_ei.mjs";
|
|
3
|
+
// ../../node_modules/.pnpm/ua-parser-modern@0.1.1/node_modules/ua-parser-modern/dist/index.mjs
|
|
4
4
|
const EMPTY = "";
|
|
5
5
|
const UNKNOWN = "?";
|
|
6
6
|
const MAJOR = "major";
|
|
@@ -1161,8 +1161,7 @@ function parseUA(uastringOrExtensions, extensions) {
|
|
|
1161
1161
|
}
|
|
1162
1162
|
};
|
|
1163
1163
|
}
|
|
1164
|
-
|
|
1165
|
-
//#region src/node/auth/state.ts
|
|
1164
|
+
// src/node/auth/state.ts
|
|
1166
1165
|
/**
|
|
1167
1166
|
* Format a raw `navigator.userAgent` string into the short display label
|
|
1168
1167
|
* shown for a trusted device (e.g. "Chrome 120 | macOS 14 desktop").
|
|
@@ -1308,5 +1307,4 @@ function exchangeTempAuthCode(code, session, info, storage) {
|
|
|
1308
1307
|
refreshTempAuthCode();
|
|
1309
1308
|
return authToken;
|
|
1310
1309
|
}
|
|
1311
|
-
//#endregion
|
|
1312
1310
|
export { getTempAuthCodeInfo as a, getTempAuthCode as i, describeUA as n, refreshTempAuthCode as o, exchangeTempAuthCode as r, verifyAuthToken as s, buildOtpAuthUrl as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as diagnostics } from "./diagnostics-
|
|
1
|
+
import { t as diagnostics } from "./diagnostics-DC1-WcvN.mjs";
|
|
2
2
|
import { dirname } from "pathe";
|
|
3
3
|
import { createSharedState } from "devframe/utils/shared-state";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import process from "node:process";
|
|
6
|
-
|
|
6
|
+
// ../../node_modules/.pnpm/perfect-debounce@2.1.0/node_modules/perfect-debounce/dist/index.mjs
|
|
7
7
|
const DEBOUNCE_DEFAULTS = { trailing: true };
|
|
8
8
|
/**
|
|
9
9
|
Debounce functions
|
|
@@ -89,8 +89,7 @@ function debounce(fn, wait = 25, options = {}) {
|
|
|
89
89
|
async function _applyPromised(fn, _this, args) {
|
|
90
90
|
return await fn.apply(_this, args);
|
|
91
91
|
}
|
|
92
|
-
|
|
93
|
-
//#region src/node/storage.ts
|
|
92
|
+
// src/node/storage.ts
|
|
94
93
|
function safeJsonParse(text) {
|
|
95
94
|
return JSON.parse(text, (key, value) => {
|
|
96
95
|
if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) return void 0;
|
|
@@ -133,5 +132,4 @@ function createStorage(options) {
|
|
|
133
132
|
}, debounceTime));
|
|
134
133
|
return state;
|
|
135
134
|
}
|
|
136
|
-
//#endregion
|
|
137
135
|
export { createStorage as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../node_modules/.pnpm/structured-clone-es@2.0.1/node_modules/structured-clone-es/dist/index.mjs
|
|
2
2
|
const env = typeof self === "object" ? self : globalThis;
|
|
3
3
|
const SAFE_ERROR_NAMES = /* @__PURE__ */ new Set([
|
|
4
4
|
"Error",
|
|
@@ -218,8 +218,7 @@ function parse(str) {
|
|
|
218
218
|
function stringify(any) {
|
|
219
219
|
return $stringify(serialize(any, options));
|
|
220
220
|
}
|
|
221
|
-
|
|
222
|
-
//#region src/utils/structured-clone.ts
|
|
221
|
+
// src/utils/structured-clone.ts
|
|
223
222
|
/**
|
|
224
223
|
* Serialize a structured-cloneable value to a single string. Equivalent
|
|
225
224
|
* to `JSON.stringify(structuredCloneSerialize(value))`.
|
|
@@ -233,5 +232,4 @@ function structuredCloneStringify(value) {
|
|
|
233
232
|
function structuredCloneParse(value) {
|
|
234
233
|
return parse(value);
|
|
235
234
|
}
|
|
236
|
-
//#endregion
|
|
237
235
|
export { structuredCloneStringify as n, structuredCloneParse as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../node_modules/.pnpm/structured-clone-es@2.0.1/node_modules/structured-clone-es/dist/index.mjs
|
|
2
2
|
const env = typeof self === "object" ? self : globalThis;
|
|
3
3
|
const SAFE_ERROR_NAMES = /* @__PURE__ */ new Set([
|
|
4
4
|
"Error",
|
|
@@ -218,8 +218,7 @@ function parse(str) {
|
|
|
218
218
|
function stringify(any) {
|
|
219
219
|
return $stringify(serialize(any, options));
|
|
220
220
|
}
|
|
221
|
-
|
|
222
|
-
//#region src/utils/structured-clone.ts
|
|
221
|
+
// src/utils/structured-clone.ts
|
|
223
222
|
/**
|
|
224
223
|
* Serialize a structured-cloneable value (`Map`, `Set`, `Date`, `BigInt`,
|
|
225
224
|
* cycles, class instances, …) into a JSON-safe records array.
|
|
@@ -246,5 +245,4 @@ function structuredCloneStringify(value) {
|
|
|
246
245
|
function structuredCloneParse(value) {
|
|
247
246
|
return parse(value);
|
|
248
247
|
}
|
|
249
|
-
//#endregion
|
|
250
248
|
export { structuredCloneStringify as i, structuredCloneParse as n, structuredCloneSerialize as r, structuredCloneDeserialize as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { colors } from "./utils/colors.mjs";
|
|
2
2
|
import { defineDiagnostics } from "nostics";
|
|
3
3
|
import { ansiFormatter } from "nostics/formatters/ansi";
|
|
4
|
-
|
|
4
|
+
// src/events.ts
|
|
5
5
|
/**
|
|
6
6
|
* Centralized registry of the core devframe event names: the node-side host
|
|
7
7
|
* bus events, the client RPC connection events, and the server→client
|
|
@@ -79,8 +79,7 @@ const DEVFRAME_EVENTS = {
|
|
|
79
79
|
inPageChannel: "devframe:in-page-channel"
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
|
|
83
|
-
//#region src/utils/nostics.ts
|
|
82
|
+
// src/utils/nostics.ts
|
|
84
83
|
const formatAnsi = ansiFormatter(colors);
|
|
85
84
|
/**
|
|
86
85
|
* The reporter every {@link defineDiagnostics} call below wires in ahead of
|
|
@@ -105,8 +104,7 @@ function defineDiagnostics$1(options) {
|
|
|
105
104
|
reporters: [devframeReporter, ...options.reporters ?? []]
|
|
106
105
|
});
|
|
107
106
|
}
|
|
108
|
-
|
|
109
|
-
//#region ../../node_modules/.pnpm/birpc@4.2.0/node_modules/birpc/dist/index.mjs
|
|
107
|
+
// ../../node_modules/.pnpm/birpc@4.2.0/node_modules/birpc/dist/index.mjs
|
|
110
108
|
function createPromiseWithResolvers() {
|
|
111
109
|
let resolve;
|
|
112
110
|
let reject;
|
|
@@ -302,8 +300,7 @@ function createBirpc($functions, options) {
|
|
|
302
300
|
_promiseInit = on(onMessage);
|
|
303
301
|
return rpc;
|
|
304
302
|
}
|
|
305
|
-
|
|
306
|
-
//#region src/agent/safety.ts
|
|
303
|
+
// src/agent/safety.ts
|
|
307
304
|
/**
|
|
308
305
|
* An agent tool's safety classification: the explicit `agent.safety`, else
|
|
309
306
|
* inferred from the function `type` (`static`/`query` are read-only, the rest
|
|
@@ -313,8 +310,7 @@ function resolveAgentSafety(type, agent) {
|
|
|
313
310
|
if (agent.safety) return agent.safety;
|
|
314
311
|
return type === "static" || type === "query" || type == null ? "read" : "action";
|
|
315
312
|
}
|
|
316
|
-
|
|
317
|
-
//#region src/agent/to-json-schema.ts
|
|
313
|
+
// src/agent/to-json-schema.ts
|
|
318
314
|
const FALLBACK_OBJECT_SCHEMA = Object.freeze({
|
|
319
315
|
type: "object",
|
|
320
316
|
additionalProperties: true
|
|
@@ -365,8 +361,7 @@ function argsToJsonSchema(args) {
|
|
|
365
361
|
additionalProperties: false
|
|
366
362
|
};
|
|
367
363
|
}
|
|
368
|
-
|
|
369
|
-
//#region src/tool-input.ts
|
|
364
|
+
// src/tool-input.ts
|
|
370
365
|
/**
|
|
371
366
|
* Convert an object-shaped tool input into positional arguments.
|
|
372
367
|
*
|
|
@@ -390,5 +385,4 @@ function collectPositionalArgs(input, argumentCount) {
|
|
|
390
385
|
function toolInputToRpcArgs(input, argumentCount) {
|
|
391
386
|
return collectPositionalArgs(input, argumentCount) ?? [input];
|
|
392
387
|
}
|
|
393
|
-
//#endregion
|
|
394
388
|
export { defineDiagnostics$1 as a, createBirpc as i, argsToJsonSchema as n, DEVFRAME_EVENTS as o, resolveAgentSafety as r, toolInputToRpcArgs as t };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as RpcFunctionAgentOptions } from "../types-
|
|
2
|
-
import { $ as
|
|
3
|
-
import { a as DevframeWsPeer, i as DevframeRpcTransportKind, n as DevframeRpcConnection, r as DevframeRpcConnectionRequest, t as DevframeNodeRpcSessionMeta } from "../session-
|
|
4
|
-
import {
|
|
5
|
-
import { i as
|
|
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
|
+
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";
|
|
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";
|
|
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,11 +1,9 @@
|
|
|
1
|
-
import { t as StandardSchemaV1 } from "./index-
|
|
2
|
-
|
|
1
|
+
import { t as StandardSchemaV1 } from "./index-BIRF0E5l.mjs";
|
|
2
|
+
import "./index-BKu9BxcT.mjs";
|
|
3
3
|
/** Infers a TypeScript argument tuple from a Standard Schema array */
|
|
4
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;
|
|
5
5
|
/** Infers a TypeScript return type from a Standard Schema */
|
|
6
6
|
type InferReturnType<S extends RpcReturnSchema | undefined> = S extends StandardSchemaV1 ? StandardSchemaV1.InferInput<S> : void;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/rpc/types.d.ts
|
|
9
7
|
type Thenable<T> = T | Promise<T>;
|
|
10
8
|
type EntriesToObject<T extends readonly [string, any][]> = { [K in T[number] as K[0]]: K[1]; };
|
|
11
9
|
/**
|
|
@@ -257,5 +255,4 @@ type RpcDefinitionsToFunctionsWithNamespace<NS extends string, T extends readonl
|
|
|
257
255
|
type RpcDefinitionsFilter<T extends readonly RpcFunctionDefinitionAny[], Type extends RpcFunctionType> = { [K in keyof T]: T[K] extends {
|
|
258
256
|
type: Type;
|
|
259
257
|
} ? T[K] : never; };
|
|
260
|
-
//#endregion
|
|
261
258
|
export { RpcFunctionType as C, InferArgsType as D, Thenable as E, InferReturnType as O, RpcFunctionSetupResult as S, RpcReturnSchema as T, RpcFunctionDefinitionAnyWithContext as _, RpcDefinitionsToFunctionsWithNamespace as a, RpcFunctionDefinitionWithSchemas as b, RpcDumpCollectionOptions as c, RpcDumpRecord as d, RpcDumpRecordError as f, RpcFunctionDefinitionAny as g, RpcFunctionDefinition as h, RpcDefinitionsToFunctions as i, RpcDumpDefinition as l, RpcFunctionAgentOptions as m, RpcArgsSchema as n, RpcDump as o, RpcDumpStore as p, RpcDefinitionsFilter as r, RpcDumpClientOptions as s, EntriesToObject as t, RpcDumpGetter as u, RpcFunctionDefinitionBase as v, RpcFunctionsCollector as w, RpcFunctionDefinitionWithoutSchemas as x, RpcFunctionDefinitionToFunction as y };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/agent-tool-name.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Derive the wire-safe agent tool name for an internal tool id.
|
|
4
3
|
*
|
|
@@ -19,5 +18,4 @@
|
|
|
19
18
|
* that display a tool's id (e.g. the inspect plugin's agent view) can
|
|
20
19
|
* import it too and show the name a client actually calls.
|
|
21
20
|
*/
|
|
22
|
-
export declare function toAgentToolName(id: string): string;
|
|
23
|
-
//#endregion
|
|
21
|
+
export declare function toAgentToolName(id: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/agent-tool-name.ts
|
|
2
2
|
/**
|
|
3
3
|
* Maximum tool-name length several MCP clients enforce (the Anthropic API
|
|
4
4
|
* pattern is `^[a-zA-Z0-9_-]{1,128}$`).
|
|
@@ -27,5 +27,4 @@ const MAX_TOOL_NAME_LENGTH = 128;
|
|
|
27
27
|
function toAgentToolName(id) {
|
|
28
28
|
return id.replace(/[^\w-]+/g, "_").slice(0, MAX_TOOL_NAME_LENGTH);
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { toAgentToolName };
|
package/dist/utils/colors.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/colors.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* A colorizer, callable as a function (`colors.red('foo')`) or as a
|
|
4
3
|
* tagged template (``colors.red`foo ${bar}` ``).
|
|
@@ -23,5 +22,4 @@ export interface Colors {
|
|
|
23
22
|
reset: ColorFn;
|
|
24
23
|
underline: ColorFn;
|
|
25
24
|
}
|
|
26
|
-
export declare const colors: Colors;
|
|
27
|
-
//#endregion
|
|
25
|
+
export declare const colors: Colors;
|
package/dist/utils/colors.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/colors.ts
|
|
2
2
|
function makeColor(open, close) {
|
|
3
3
|
const o = `\x1B[${open}m`;
|
|
4
4
|
const c = `\x1B[${close}m`;
|
|
@@ -27,5 +27,4 @@ const colors = {
|
|
|
27
27
|
reset: makeColor(0, 0),
|
|
28
28
|
underline: makeColor(4, 24)
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { colors };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/crypto-token.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Generate a high-entropy, URL-safe (hex) random token suitable for use as a
|
|
4
3
|
* bearer credential, e.g. the persistent client auth token or an ephemeral
|
|
@@ -19,5 +18,4 @@ export declare function randomDigits(length: number): string;
|
|
|
19
18
|
* Length is treated as public (it short-circuits on differing lengths), which
|
|
20
19
|
* is appropriate for fixed-length codes and tokens.
|
|
21
20
|
*/
|
|
22
|
-
export declare function timingSafeEqual(a: string, b: string): boolean;
|
|
23
|
-
//#endregion
|
|
21
|
+
export declare function timingSafeEqual(a: string, b: string): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/crypto-token.ts
|
|
2
2
|
const HEX = "0123456789abcdef";
|
|
3
3
|
/**
|
|
4
4
|
* Generate a high-entropy, URL-safe (hex) random token suitable for use as a
|
|
@@ -41,5 +41,4 @@ function timingSafeEqual(a, b) {
|
|
|
41
41
|
for (let i = 0; i < a.length; i++) mismatch |= a.charCodeAt(i) ^ b.charCodeAt(i);
|
|
42
42
|
return mismatch === 0;
|
|
43
43
|
}
|
|
44
|
-
//#endregion
|
|
45
44
|
export { randomDigits, randomToken, timingSafeEqual };
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
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
|
+
*/
|
|
2
7
|
//#region src/index.d.ts
|
|
3
8
|
interface DebounceOptions {
|
|
4
9
|
/**
|
|
@@ -46,5 +51,4 @@ for (const number of [1, 2, 3]) {
|
|
|
46
51
|
```
|
|
47
52
|
*/
|
|
48
53
|
declare function debounce<ArgumentsT extends unknown[], ReturnT>(fn: (...args: ArgumentsT) => PromiseLike<ReturnT> | ReturnT, wait?: number, options?: DebounceOptions): DebouncedReturn<ArgumentsT, ReturnT>;
|
|
49
|
-
//#endregion
|
|
50
54
|
export { type DebounceOptions, type DebouncedReturn, debounce };
|