devframe 0.9.20 → 0.10.0
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-B2PZsp-J.mjs +191 -0
- package/dist/{_shared-BIUet_Jh.d.mts → _shared-Dy1UBMUN.d.mts} +13 -14
- package/dist/adapters/build.d.mts +3 -4
- package/dist/adapters/build.mjs +4 -5
- package/dist/adapters/cac.d.mts +3 -4
- package/dist/adapters/cac.mjs +3 -3
- package/dist/adapters/dev.d.mts +8 -8
- package/dist/adapters/dev.mjs +2 -2
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/initiate.d.mts +8 -8
- package/dist/adapters/initiate.mjs +1 -1
- package/dist/adapters/mcp.d.mts +4 -142
- package/dist/adapters/mcp.mjs +1 -597
- package/dist/agentic-D4QQQUjE.d.mts +30 -0
- package/dist/cli/main.mjs +12 -260
- package/dist/client/index.d.mts +6 -6
- package/dist/client/index.mjs +3 -4
- package/dist/constants.d.mts +2 -1
- package/dist/constants.mjs +2 -1
- package/dist/{context-BA5FPz7K.d.mts → context-B4BKPuaa.d.mts} +1 -1
- package/dist/{context-BLXXjoBW.mjs → context-C141q8H4.mjs} +5 -5
- package/dist/{context-jXO5vzjH.mjs → context-CHpyLX8W.mjs} +1 -1
- package/dist/{context-BLHBDQcZ.d.mts → context-CTAxz9ec.d.mts} +108 -47
- package/dist/{dev-BdKKOH8S.mjs → dev-DM1mIlgi.mjs} +16 -24
- package/dist/{diagnostics-DZA6KQ_Z.mjs → diagnostics-Cx4_VjlG.mjs} +11 -3
- package/dist/dist-Bw3EbMj4.mjs +305 -0
- package/dist/dist-CO98PBnQ.mjs +265 -0
- package/dist/{host-agent-C3MBpNCd.mjs → host-agent-ZSKgzMVu.mjs} +2 -7
- package/dist/import-runtime-module-BzlEQ9PI.mjs +24 -0
- package/dist/in-page-channel/index.d.mts +2 -7
- package/dist/in-page-channel/index.mjs +1 -4
- package/dist/index-Bia1vKjL.d.mts +218 -0
- package/dist/{index-r6NstVmM.d.mts → index-CcPSKbxb.d.mts} +2 -2
- package/dist/index-CeEtxDmK.d.mts +78 -0
- package/dist/{index-CiA6C705.d.mts → index-DuEm0sDH.d.mts} +1 -1
- package/dist/index.d.mts +4 -11
- package/dist/index.mjs +1 -10
- package/dist/{instance-registry-DCq762YJ.mjs → instance-registry-DtvYxc0Y.mjs} +1 -1
- package/dist/{instance-shell-C6Vg97lg.d.mts → instance-shell-DOZSxst6.d.mts} +31 -5
- package/dist/{instance-shell-yfrM3_vK.mjs → instance-shell-wC2sfEU_.mjs} +7 -7
- package/dist/interactive-auth-BCa_iamv.mjs +384 -0
- package/dist/internal/index.d.mts +66 -22
- package/dist/internal/index.mjs +143 -8
- package/dist/mrmime-40h5OOIp.mjs +448 -0
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/hub-internals.d.mts +2 -2
- package/dist/node/hub-internals.mjs +2 -2
- package/dist/node/index.d.mts +2 -4
- package/dist/node/index.mjs +2 -2
- package/dist/{nostics-0sKe5HIj.d.mts → nostics-DWvukRwa.d.mts} +11 -2
- package/dist/{origin-D_eBKEzr.mjs → origin-DZit9g29.mjs} +1 -21
- package/dist/recipes/interactive-auth.d.mts +2 -2
- package/dist/recipes/interactive-auth.mjs +1 -231
- package/dist/{remote-assets-D0StJVLp.mjs → remote-assets-B9MeWmW6.mjs} +2 -2
- package/dist/rpc/client.d.mts +1 -1
- package/dist/rpc/client.mjs +1 -1
- package/dist/rpc/dump.d.mts +2 -1
- package/dist/rpc/index.d.mts +3 -2
- package/dist/rpc/server.d.mts +1 -1
- package/dist/rpc/server.mjs +1 -1
- package/dist/rpc/transports/sse-client.d.mts +1 -1
- package/dist/rpc/transports/sse-server.d.mts +3 -3
- package/dist/rpc/transports/sse-server.mjs +1 -1
- package/dist/rpc/transports/ws-bun.d.mts +2 -2
- package/dist/rpc/transports/ws-bun.mjs +1 -1
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-deno.d.mts +2 -2
- package/dist/rpc/transports/ws-deno.mjs +1 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +1 -1
- package/dist/{rpc-core-CvkU23bQ.mjs → rpc-core-BXyMjbKG.mjs} +1 -1
- package/dist/{rpc-core-BlL-Ip8n.d.mts → rpc-core-rLrwFEcw.d.mts} +4 -4
- package/dist/{services-install-Ben4yh52.mjs → services-install-D5YUwFXW.mjs} +17 -1
- package/dist/{sse-client-BcbYwXdD.d.mts → sse-client-DNdscfu_.d.mts} +2 -2
- package/dist/{storage-B70AXK64.mjs → storage-CHD1IkqU.mjs} +1 -1
- package/dist/types/index.d.mts +4 -4
- package/dist/{types-D2vGd7-2.d.mts → types-BmDbfHCx.d.mts} +2 -3
- package/dist/utils/debounce.d.mts +50 -0
- package/dist/utils/debounce.mjs +88 -0
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/launch-editor.d.mts +8 -0
- package/dist/utils/launch-editor.mjs +36 -1
- package/dist/utils/nostics.d.mts +2 -2
- package/dist/utils/remote-assets.mjs +1 -1
- package/dist/utils/serve-static.mjs +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/simple-schema.d.mts +3 -2
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/url.d.mts +31 -0
- package/dist/utils/url.mjs +58 -0
- package/dist/{ws-client-CNpP6Ium.d.mts → ws-client-6Mrz6eC4.d.mts} +2 -2
- package/dist/{ws-server-BB8jhxeT.d.mts → ws-server-y2R76aSW.d.mts} +2 -2
- package/package.json +10 -11
- package/dist/_shared-U8D-xzrp.mjs +0 -115
- package/dist/agent-tool-name-DGzeuWcO.mjs +0 -31
- package/dist/client-assets-DNdhagGm.mjs +0 -16
- package/dist/nostics-DD6gsDZA.mjs +0 -108
- package/dist/recipes/common-rpc-functions.d.mts +0 -70
- package/dist/recipes/common-rpc-functions.mjs +0 -115
- package/dist/simple-schema-Bi40l-P6.mjs +0 -154
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as DEVFRAME_EVENTS } from "./events-BV4Dj59a.mjs";
|
|
2
|
-
import { t as diagnostics } from "./diagnostics-
|
|
2
|
+
import { t as diagnostics } from "./diagnostics-Cx4_VjlG.mjs";
|
|
3
3
|
//#region src/utils/events.ts
|
|
4
4
|
/**
|
|
5
5
|
* Create event emitter.
|
|
@@ -67,11 +67,6 @@ function toolInputToRpcArgs(input, argumentCount) {
|
|
|
67
67
|
function toolInputToCommandArgs(input, argumentCount) {
|
|
68
68
|
return collectPositionalArgs(input, argumentCount) ?? [];
|
|
69
69
|
}
|
|
70
|
-
/** @deprecated Use {@link toolInputToRpcArgs} or {@link toolInputToCommandArgs}. */
|
|
71
|
-
function coerceAgentPositionalArgs(input, schemas, fallback = "wrap") {
|
|
72
|
-
const argumentCount = schemas?.length;
|
|
73
|
-
return fallback === "drop" ? toolInputToCommandArgs(input, argumentCount) : toolInputToRpcArgs(input, argumentCount);
|
|
74
|
-
}
|
|
75
70
|
//#endregion
|
|
76
71
|
//#region src/node/host-agent.ts
|
|
77
72
|
/**
|
|
@@ -273,4 +268,4 @@ function inferSafety(type) {
|
|
|
273
268
|
return "action";
|
|
274
269
|
}
|
|
275
270
|
//#endregion
|
|
276
|
-
export {
|
|
271
|
+
export { toolInputToCommandArgs as n, createEventEmitter as r, DevframeAgentHost as t };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { i as resolveServicePackage, r as importServicePackage } from "./services-install-D5YUwFXW.mjs";
|
|
2
|
+
//#region src/node/import-runtime-module.ts
|
|
3
|
+
/**
|
|
4
|
+
* Resolve and import a package at runtime without adding it to a consumer's
|
|
5
|
+
* bundle graph. First-party adapters use this for modules whose code is
|
|
6
|
+
* needed only when the matching feature is enabled (optional peers, and the
|
|
7
|
+
* MCP adapter with the SDK behind it).
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
async function importRuntimeModule(specifier) {
|
|
12
|
+
return await importServicePackage(specifier, [import.meta.url]);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Whether {@link importRuntimeModule} would resolve `specifier`, without
|
|
16
|
+
* importing anything. The zero-cost probe behind optional-peer decisions.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
function isRuntimeModuleResolvable(specifier) {
|
|
21
|
+
return resolveServicePackage(specifier, [import.meta.url]) !== void 0;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { isRuntimeModuleResolvable as n, importRuntimeModule as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { BirpcReturn } from "birpc";
|
|
1
|
+
import { D as InferArgsType, E as Thenable, O as InferReturnType, T as RpcReturnSchema, n as RpcArgsSchema } from "../types-BmDbfHCx.mjs";
|
|
2
|
+
import { Kt as EventEmitter, k as SharedState } from "../context-CTAxz9ec.mjs";
|
|
4
3
|
//#region src/in-page-channel/types.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The shared contract of one in-page channel, declared once (usually in a
|
|
@@ -269,8 +268,6 @@ interface PageScriptChannel<P extends InPageChannelProtocol> {
|
|
|
269
268
|
readonly events: Pick<EventEmitter<PageScriptChannelEvents<P>>, 'on' | 'once'>;
|
|
270
269
|
/** Fan an event out to every connected panel. */
|
|
271
270
|
emit: <K extends keyof PanelEvents<P> & string>(name: K, ...args: FnArgs<PanelEvents<P>[K]>) => void;
|
|
272
|
-
/** @deprecated Use `emit()` instead. */
|
|
273
|
-
callEvent: <K extends keyof PanelEvents<P> & string>(name: K, ...args: FnArgs<PanelEvents<P>[K]>) => void;
|
|
274
271
|
/** Subscribe to an event emitted by a panel. Returns an unsubscribe function. */
|
|
275
272
|
on: <K extends keyof PageScriptEvents<P> & string>(name: K, listener: (...args: FnArgs<PageScriptEvents<P>[K]>) => void) => () => void;
|
|
276
273
|
/** Page-script-authoritative shared states, replayed to joining panels. */
|
|
@@ -314,8 +311,6 @@ interface PanelChannel<P extends InPageChannelProtocol> {
|
|
|
314
311
|
* (up to `eventBufferLimit`) and flushed on connect.
|
|
315
312
|
*/
|
|
316
313
|
emit: <K extends keyof PageScriptEvents<P> & string>(name: K, ...args: FnArgs<PageScriptEvents<P>[K]>) => void;
|
|
317
|
-
/** @deprecated Use `emit()` instead. */
|
|
318
|
-
callEvent: <K extends keyof PageScriptEvents<P> & string>(name: K, ...args: FnArgs<PageScriptEvents<P>[K]>) => void;
|
|
319
314
|
/** Subscribe to an event emitted by the page script. Returns an unsubscribe function. */
|
|
320
315
|
on: <K extends keyof PanelEvents<P> & string>(name: K, listener: (...args: FnArgs<PanelEvents<P>[K]>) => void) => () => void;
|
|
321
316
|
/** Shared states mirrored from the page-script authority. */
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { n as DEVFRAME_EVENTS, t as
|
|
1
|
+
import { n as defineDiagnostics, r as DEVFRAME_EVENTS, t as createBirpc } from "../dist-Bw3EbMj4.mjs";
|
|
2
2
|
import { createEventEmitter } from "../utils/events.mjs";
|
|
3
3
|
import { t as createSharedState } from "../shared-state-eQVYHNqA.mjs";
|
|
4
4
|
import { nanoid } from "../utils/nanoid.mjs";
|
|
5
|
-
import { createBirpc } from "birpc";
|
|
6
5
|
//#region src/in-page-channel/diagnostics.ts
|
|
7
6
|
const diagnostics = /* #__PURE__ */ defineDiagnostics({
|
|
8
7
|
docsBase: "https://devfra.me/errors",
|
|
@@ -632,7 +631,6 @@ function createPageScriptChannel(options) {
|
|
|
632
631
|
once: events.once
|
|
633
632
|
},
|
|
634
633
|
emit,
|
|
635
|
-
callEvent: emit,
|
|
636
634
|
on: (fnName, listener) => registry.on(fnName, listener),
|
|
637
635
|
sharedState: stateHost,
|
|
638
636
|
addPanelPort: (port) => addPeer(port, `transport:${nanoid(8)}`),
|
|
@@ -867,7 +865,6 @@ function connectPanelChannel(options) {
|
|
|
867
865
|
},
|
|
868
866
|
call: (fnName, ...args) => enqueueCall(channelMethod("function", fnName), serializeArgs(codec, args)),
|
|
869
867
|
emit: (fnName, ...args) => sendEvent(channelMethod("event", fnName), serializeArgs(codec, args)),
|
|
870
|
-
callEvent: (fnName, ...args) => sendEvent(channelMethod("event", fnName), serializeArgs(codec, args)),
|
|
871
868
|
on: (fnName, listener) => registry.on(fnName, listener),
|
|
872
869
|
sharedState: stateHost,
|
|
873
870
|
close: () => {
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/birpc@4.2.0/node_modules/birpc/dist/index.d.mts
|
|
2
|
+
//#region src/messages.d.ts
|
|
3
|
+
declare const TYPE_REQUEST: "q";
|
|
4
|
+
interface RpcRequest {
|
|
5
|
+
/**
|
|
6
|
+
* Type
|
|
7
|
+
*/
|
|
8
|
+
t: typeof TYPE_REQUEST;
|
|
9
|
+
/**
|
|
10
|
+
* ID
|
|
11
|
+
*/
|
|
12
|
+
i?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Method
|
|
15
|
+
*/
|
|
16
|
+
m: string;
|
|
17
|
+
/**
|
|
18
|
+
* Arguments
|
|
19
|
+
*/
|
|
20
|
+
a: any[];
|
|
21
|
+
/**
|
|
22
|
+
* Optional
|
|
23
|
+
*/
|
|
24
|
+
o?: boolean;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/utils.d.ts
|
|
28
|
+
type ArgumentsType<T> = T extends ((...args: infer A) => any) ? A : never;
|
|
29
|
+
type ReturnType<T> = T extends ((...args: any) => infer R) ? R : never;
|
|
30
|
+
type Thenable<T> = T | PromiseLike<T>;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/main.d.ts
|
|
33
|
+
type PromisifyFn<T> = ReturnType<T> extends Promise<any> ? T : (...args: ArgumentsType<T>) => Promise<Awaited<ReturnType<T>>>;
|
|
34
|
+
type BirpcResolver<This> = (this: This, name: string, resolved: (...args: unknown[]) => unknown) => Thenable<((...args: any[]) => any) | undefined>;
|
|
35
|
+
interface ChannelOptions {
|
|
36
|
+
/**
|
|
37
|
+
* Function to post raw message
|
|
38
|
+
*/
|
|
39
|
+
post: (data: any, ...extras: any[]) => Thenable<any>;
|
|
40
|
+
/**
|
|
41
|
+
* Listener to receive raw message
|
|
42
|
+
*/
|
|
43
|
+
on: (fn: (data: any, ...extras: any[]) => void) => Thenable<any>;
|
|
44
|
+
/**
|
|
45
|
+
* Clear the listener when `$close` is called
|
|
46
|
+
*/
|
|
47
|
+
off?: (fn: (data: any, ...extras: any[]) => void) => Thenable<any>;
|
|
48
|
+
/**
|
|
49
|
+
* Custom function to serialize data
|
|
50
|
+
*
|
|
51
|
+
* by default it passes the data as-is
|
|
52
|
+
*/
|
|
53
|
+
serialize?: (data: any) => any;
|
|
54
|
+
/**
|
|
55
|
+
* Custom function to deserialize data
|
|
56
|
+
*
|
|
57
|
+
* by default it passes the data as-is
|
|
58
|
+
*/
|
|
59
|
+
deserialize?: (data: any) => any;
|
|
60
|
+
/**
|
|
61
|
+
* Call the methods with the RPC context or the original functions object
|
|
62
|
+
*/
|
|
63
|
+
bind?: 'rpc' | 'functions';
|
|
64
|
+
/**
|
|
65
|
+
* Custom meta data to attached to the RPC instance's `$meta` property
|
|
66
|
+
*/
|
|
67
|
+
meta?: any;
|
|
68
|
+
}
|
|
69
|
+
interface EventOptions<RemoteFunctions extends object = Record<string, unknown>, LocalFunctions extends object = Record<string, unknown>, Proxify extends boolean = true> {
|
|
70
|
+
/**
|
|
71
|
+
* Names of remote functions that do not need response.
|
|
72
|
+
*/
|
|
73
|
+
eventNames?: (keyof RemoteFunctions)[];
|
|
74
|
+
/**
|
|
75
|
+
* Maximum timeout for waiting for response, in milliseconds.
|
|
76
|
+
*
|
|
77
|
+
* @default 60_000
|
|
78
|
+
*/
|
|
79
|
+
timeout?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Whether to proxy the remote functions.
|
|
82
|
+
*
|
|
83
|
+
* When `proxify` is false, calling the remote function
|
|
84
|
+
* with `rpc.$call('method', ...args)` instead of `rpc.method(...args)`
|
|
85
|
+
* explicitly is required.
|
|
86
|
+
*
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
proxify?: Proxify;
|
|
90
|
+
/**
|
|
91
|
+
* Custom resolver to resolve function to be called
|
|
92
|
+
*
|
|
93
|
+
* For advanced use cases only
|
|
94
|
+
*/
|
|
95
|
+
resolver?: BirpcResolver<BirpcReturn<RemoteFunctions, LocalFunctions, Proxify>>;
|
|
96
|
+
/**
|
|
97
|
+
* Hook triggered before an event is sent to the remote
|
|
98
|
+
*
|
|
99
|
+
* @param req - Request parameters
|
|
100
|
+
* @param next - Function to continue the request
|
|
101
|
+
* @param resolve - Function to resolve the response directly
|
|
102
|
+
*/
|
|
103
|
+
onRequest?: (this: BirpcReturn<RemoteFunctions, LocalFunctions, Proxify>, req: RpcRequest, next: (req?: RpcRequest) => Promise<any>, resolve: (res: any) => void) => void | Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Custom error handler for errors occurred in local functions being called
|
|
106
|
+
*
|
|
107
|
+
* @returns `true` to prevent the error from being thrown
|
|
108
|
+
*/
|
|
109
|
+
onFunctionError?: (this: BirpcReturn<RemoteFunctions, LocalFunctions, Proxify>, error: Error, functionName: string, args: any[]) => boolean | void;
|
|
110
|
+
/**
|
|
111
|
+
* Custom error handler for errors occurred during serialization or messsaging
|
|
112
|
+
*
|
|
113
|
+
* @returns `true` to prevent the error from being thrown
|
|
114
|
+
*/
|
|
115
|
+
onGeneralError?: (this: BirpcReturn<RemoteFunctions, LocalFunctions, Proxify>, error: Error, functionName?: string, args?: any[]) => boolean | void;
|
|
116
|
+
/**
|
|
117
|
+
* Custom error handler for timeouts
|
|
118
|
+
*
|
|
119
|
+
* @returns `true` to prevent the error from being thrown
|
|
120
|
+
*/
|
|
121
|
+
onTimeoutError?: (this: BirpcReturn<RemoteFunctions, LocalFunctions, Proxify>, functionName: string, args: any[]) => boolean | void;
|
|
122
|
+
}
|
|
123
|
+
type BirpcOptions<RemoteFunctions extends object = Record<string, unknown>, LocalFunctions extends object = Record<string, unknown>, Proxify extends boolean = true> = EventOptions<RemoteFunctions, LocalFunctions, Proxify> & ChannelOptions;
|
|
124
|
+
type BirpcFn<T> = PromisifyFn<T> & {
|
|
125
|
+
/**
|
|
126
|
+
* Send event without asking for response
|
|
127
|
+
*/
|
|
128
|
+
asEvent: (...args: ArgumentsType<T>) => Promise<void>;
|
|
129
|
+
};
|
|
130
|
+
interface BirpcReturnBuiltin<RemoteFunctions, LocalFunctions = Record<string, unknown>> {
|
|
131
|
+
/**
|
|
132
|
+
* Raw functions object
|
|
133
|
+
*/
|
|
134
|
+
$functions: LocalFunctions;
|
|
135
|
+
/**
|
|
136
|
+
* Whether the RPC is closed
|
|
137
|
+
*/
|
|
138
|
+
readonly $closed: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Custom meta data attached to the RPC instance
|
|
141
|
+
*/
|
|
142
|
+
readonly $meta: any;
|
|
143
|
+
/**
|
|
144
|
+
* Close the RPC connection
|
|
145
|
+
*/
|
|
146
|
+
$close: (error?: Error) => void;
|
|
147
|
+
/**
|
|
148
|
+
* Reject pending calls
|
|
149
|
+
*/
|
|
150
|
+
$rejectPendingCalls: (handler?: PendingCallHandler) => Promise<void>[];
|
|
151
|
+
/**
|
|
152
|
+
* Call the remote function and wait for the result.
|
|
153
|
+
* An alternative to directly calling the function
|
|
154
|
+
*/
|
|
155
|
+
$call: <K extends keyof RemoteFunctions>(method: K, ...args: ArgumentsType<RemoteFunctions[K]>) => Promise<Awaited<ReturnType<RemoteFunctions[K]>>>;
|
|
156
|
+
/**
|
|
157
|
+
* Same as `$call`, but returns `undefined` if the function is not defined on the remote side.
|
|
158
|
+
*/
|
|
159
|
+
$callOptional: <K extends keyof RemoteFunctions>(method: K, ...args: ArgumentsType<RemoteFunctions[K]>) => Promise<Awaited<ReturnType<RemoteFunctions[K]> | undefined>>;
|
|
160
|
+
/**
|
|
161
|
+
* Send event without asking for response
|
|
162
|
+
*/
|
|
163
|
+
$callEvent: <K extends keyof RemoteFunctions>(method: K, ...args: ArgumentsType<RemoteFunctions[K]>) => Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Call the remote function with the raw options.
|
|
166
|
+
*/
|
|
167
|
+
$callRaw: (options: {
|
|
168
|
+
method: string;
|
|
169
|
+
args: unknown[];
|
|
170
|
+
event?: boolean;
|
|
171
|
+
optional?: boolean;
|
|
172
|
+
}) => Promise<Awaited<ReturnType<any>>[]>;
|
|
173
|
+
}
|
|
174
|
+
type ProxifiedRemoteFunctions<RemoteFunctions extends object = Record<string, unknown>> = { [K in keyof RemoteFunctions]: BirpcFn<RemoteFunctions[K]>; };
|
|
175
|
+
type BirpcReturn<RemoteFunctions extends object = Record<string, unknown>, LocalFunctions extends object = Record<string, unknown>, Proxify extends boolean = true> = Proxify extends true ? ProxifiedRemoteFunctions<RemoteFunctions> & BirpcReturnBuiltin<RemoteFunctions, LocalFunctions> : BirpcReturnBuiltin<RemoteFunctions, LocalFunctions>;
|
|
176
|
+
type PendingCallHandler = (options: Pick<PromiseEntry, 'method' | 'reject'>) => void | Promise<void>;
|
|
177
|
+
interface PromiseEntry {
|
|
178
|
+
resolve: (arg: any) => void;
|
|
179
|
+
reject: (error: any) => void;
|
|
180
|
+
method: string;
|
|
181
|
+
timeoutId?: ReturnType<typeof setTimeout>;
|
|
182
|
+
}
|
|
183
|
+
declare const setTimeout: any;
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/group.d.ts
|
|
186
|
+
interface BirpcGroupReturnBuiltin<RemoteFunctions> {
|
|
187
|
+
/**
|
|
188
|
+
* Call the remote function and wait for the result.
|
|
189
|
+
* An alternative to directly calling the function
|
|
190
|
+
*/
|
|
191
|
+
$call: <K extends keyof RemoteFunctions>(method: K, ...args: ArgumentsType<RemoteFunctions[K]>) => Promise<Awaited<ReturnType<RemoteFunctions[K]>>[]>;
|
|
192
|
+
/**
|
|
193
|
+
* Same as `$call`, but returns `undefined` if the function is not defined on the remote side.
|
|
194
|
+
*/
|
|
195
|
+
$callOptional: <K extends keyof RemoteFunctions>(method: K, ...args: ArgumentsType<RemoteFunctions[K]>) => Promise<(Awaited<ReturnType<RemoteFunctions[K]>> | undefined)[]>;
|
|
196
|
+
/**
|
|
197
|
+
* Send event without asking for response
|
|
198
|
+
*/
|
|
199
|
+
$callEvent: <K extends keyof RemoteFunctions>(method: K, ...args: ArgumentsType<RemoteFunctions[K]>) => Promise<void>;
|
|
200
|
+
/**
|
|
201
|
+
* Call the remote function with the raw options.
|
|
202
|
+
*/
|
|
203
|
+
$callRaw: (options: {
|
|
204
|
+
method: string;
|
|
205
|
+
args: unknown[];
|
|
206
|
+
event?: boolean;
|
|
207
|
+
optional?: boolean;
|
|
208
|
+
}) => Promise<Awaited<ReturnType<any>>[]>;
|
|
209
|
+
}
|
|
210
|
+
type BirpcGroupReturn<RemoteFunctions extends object = Record<string, unknown>, Proxify extends boolean = true> = Proxify extends true ? ProxifiedRemoteFunctions<RemoteFunctions> & BirpcGroupReturnBuiltin<RemoteFunctions> : BirpcGroupReturnBuiltin<RemoteFunctions>;
|
|
211
|
+
interface BirpcGroup<RemoteFunctions extends object = Record<string, unknown>, LocalFunctions extends object = Record<string, unknown>, Proxify extends boolean = true> {
|
|
212
|
+
readonly clients: BirpcReturn<RemoteFunctions, LocalFunctions, Proxify>[];
|
|
213
|
+
readonly functions: LocalFunctions;
|
|
214
|
+
readonly broadcast: BirpcGroupReturn<RemoteFunctions, Proxify>;
|
|
215
|
+
updateChannels: (fn?: ((channels: ChannelOptions[]) => void)) => BirpcReturn<RemoteFunctions, LocalFunctions, Proxify>[];
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
export { ChannelOptions as a, BirpcReturn as i, BirpcGroup as n, EventOptions as o, BirpcOptions as r, BirpcFn as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as SharedState, o as DevframeNodeContext, s as DevframeNodeRpcSession } from "./context-
|
|
2
|
-
import { n as InternalAnonymousAuthStorage } from "./context-
|
|
1
|
+
import { k as SharedState, o as DevframeNodeContext, s as DevframeNodeRpcSession } from "./context-CTAxz9ec.mjs";
|
|
2
|
+
import { n as InternalAnonymousAuthStorage } from "./context-B4BKPuaa.mjs";
|
|
3
3
|
//#region src/node/auth/revoke.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Flip `isTrusted` to false on any live WS clients connected with `token`
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
|
|
2
|
+
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
3
|
+
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
4
|
+
/** The Standard properties. */
|
|
5
|
+
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
6
|
+
}
|
|
7
|
+
declare namespace StandardTypedV1 {
|
|
8
|
+
/** The Standard Typed properties interface. */
|
|
9
|
+
interface Props<Input = unknown, Output = Input> {
|
|
10
|
+
/** The version number of the standard. */
|
|
11
|
+
readonly version: 1;
|
|
12
|
+
/** The vendor name of the schema library. */
|
|
13
|
+
readonly vendor: string;
|
|
14
|
+
/** Inferred types associated with the schema. */
|
|
15
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** The Standard Typed types interface. */
|
|
18
|
+
interface Types<Input = unknown, Output = Input> {
|
|
19
|
+
/** The input type of the schema. */
|
|
20
|
+
readonly input: Input;
|
|
21
|
+
/** The output type of the schema. */
|
|
22
|
+
readonly output: Output;
|
|
23
|
+
}
|
|
24
|
+
/** Infers the input type of a Standard Typed. */
|
|
25
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
26
|
+
/** Infers the output type of a Standard Typed. */
|
|
27
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
28
|
+
}
|
|
29
|
+
/** The Standard Schema interface. */
|
|
30
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
31
|
+
/** The Standard Schema properties. */
|
|
32
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
33
|
+
}
|
|
34
|
+
declare namespace StandardSchemaV1 {
|
|
35
|
+
/** The Standard Schema properties interface. */
|
|
36
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
37
|
+
/** Validates unknown input values. */
|
|
38
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
39
|
+
}
|
|
40
|
+
/** The result interface of the validate function. */
|
|
41
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
42
|
+
/** The result interface if validation succeeds. */
|
|
43
|
+
interface SuccessResult<Output> {
|
|
44
|
+
/** The typed output value. */
|
|
45
|
+
readonly value: Output;
|
|
46
|
+
/** A falsy value for `issues` indicates success. */
|
|
47
|
+
readonly issues?: undefined;
|
|
48
|
+
}
|
|
49
|
+
interface Options {
|
|
50
|
+
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
51
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
52
|
+
}
|
|
53
|
+
/** The result interface if validation fails. */
|
|
54
|
+
interface FailureResult {
|
|
55
|
+
/** The issues of failed validation. */
|
|
56
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
57
|
+
}
|
|
58
|
+
/** The issue interface of the failure output. */
|
|
59
|
+
interface Issue {
|
|
60
|
+
/** The error message of the issue. */
|
|
61
|
+
readonly message: string;
|
|
62
|
+
/** The path of the issue, if any. */
|
|
63
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
64
|
+
}
|
|
65
|
+
/** The path segment interface of the issue. */
|
|
66
|
+
interface PathSegment {
|
|
67
|
+
/** The key representing a path segment. */
|
|
68
|
+
readonly key: PropertyKey;
|
|
69
|
+
}
|
|
70
|
+
/** The Standard types interface. */
|
|
71
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
72
|
+
/** Infers the input type of a Standard. */
|
|
73
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
74
|
+
/** Infers the output type of a Standard. */
|
|
75
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { StandardSchemaV1 as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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-BmDbfHCx.mjs";
|
|
2
2
|
//#region src/rpc/cache.d.ts
|
|
3
3
|
interface RpcCacheOptions {
|
|
4
4
|
functions: string[];
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
import { $ as DevframeServiceOf, At as AgentHandle, B as DevframeSetupInfo, Bt as DevframeAgentHostEvents, Ct as DevframeDiagnosticsHost, F as DevframeDefinition, Ft as AgentTool, G as McpAuthorization, H as DevframeSnapshotRpcInputs, Ht as EventUnsubscribe, I as DevframeDeploymentKind, It as AgentToolInput, J as DevframeServiceDefinition, K as McpRouteOptions, L as DevframeDockDefaults, Lt as AgentToolProvider, Mt as AgentResource, Nt as AgentResourceContent, P as DevframeCliOptions, Pt as AgentResourceInput, Q as DevframeServiceMeta, R as DevframeDuplicationStrategy, Rt as AgentToolProviderHandle, St as DevframeStorageScope, U as DevframeSseOptions, Ut as EventsMap, V as DevframeSnapshotRpcEntry, Vt as EventEmitter, W as DevframeWsOptions, X as DevframeServiceId, Y as DevframeServiceDescriptor, Z as DevframeServiceInput, _t as DevframeViewHost, a as DevframeConnectionConfigsRegistry, at as DevframeScopedNodeContext, bt as DevframeRpcSharedStates, c as RpcBroadcastOptions, ct as DevframeSettings, d as RpcSharedStateHost, dt as ScopedBroadcastOptions, et as DevframeServiceScopeOf, f as RpcStreamingChannel, ft as ScopedClientFunctions, gt as SettingsForNamespace, ht as ScopedSharedStates, i as DevframeCapabilities, it as DevframeServicesState, jt as AgentManifest, l as RpcFunctionsHost, lt as DevframeSettingsRegistry, m as RpcStreamingHost, mt as ScopedServerFunctions, n as ConnectionMetaSse, nt as DevframeServicesRegistry, o as DevframeNodeContext, ot as DevframeScopedNodeRpc, p as RpcStreamingChannelOptions, pt as ScopedRpcFn, q as McpSetting, r as ConnectionMetaWebsocket, rt as DevframeServicesScopeRegistry, s as DevframeNodeRpcSession, st as DevframeScopedStreamingHost, t as ConnectionMeta, tt as DevframeServicesHost, u as RpcSharedStateGetOptions, ut as DevframeSettingsStore, vt as DevframeRpcClientFunctions, wt as DevframeDiagnosticsLogger, xt as DevframeHost, yt as DevframeRpcServerFunctions, z as DevframeRpcOptions, zt as DevframeAgentHost } from "./context-BLHBDQcZ.mjs";
|
|
1
|
+
import { C as RpcFunctionType, T as RpcReturnSchema, h as RpcFunctionDefinition, m as RpcFunctionAgentOptions, n as RpcArgsSchema } from "./types-BmDbfHCx.mjs";
|
|
2
|
+
import { $ as DevframeServiceDefinition, B as DevframeDefinition, Bt as AgentTool, Ct as DevframeRpcClientFunctions, Dt as DevframeStorageScope, Et as DevframeHost, F as CreateMcpServerOptions, Ft as AgentHandle, G as DevframeSetupInfo, Gt as DevframeAgentHostEvents, H as DevframeDockDefaults, Ht as AgentToolProvider, I as McpConnectionInfo, It as AgentManifest, J as DevframeSseOptions, Jt as EventsMap, K as DevframeSnapshotRpcEntry, Kt as EventEmitter, L as McpFetchHandler, Lt as AgentResource, Ot as DevframeDiagnosticsHost, P as CreateMcpFetchHandlerOptions, Q as McpSetting, R as McpServerHandle, Rt as AgentResourceContent, St as DevframeViewHost, Tt as DevframeRpcSharedStates, U as DevframeDuplicationStrategy, Ut as AgentToolProviderHandle, V as DevframeDeploymentKind, Vt as AgentToolInput, W as DevframeRpcOptions, Wt as DevframeAgentHost, X as McpAuthorization, Y as DevframeWsOptions, Z as McpRouteOptions, _t as ScopedClientFunctions, a as DevframeConnectionConfigsRegistry, at as DevframeServiceScopeOf, bt as ScopedSharedStates, c as RpcBroadcastOptions, ct as DevframeServicesScopeRegistry, d as RpcSharedStateHost, dt as DevframeScopedNodeRpc, et as DevframeServiceDescriptor, f as RpcStreamingChannel, ft as DevframeScopedStreamingHost, gt as ScopedBroadcastOptions, ht as DevframeSettingsStore, i as DevframeCapabilities, it as DevframeServiceOf, kt as DevframeDiagnosticsLogger, l as RpcFunctionsHost, lt as DevframeServicesState, m as RpcStreamingHost, mt as DevframeSettingsRegistry, n as ConnectionMetaSse, nt as DevframeServiceInput, o as DevframeNodeContext, ot as DevframeServicesHost, p as RpcStreamingChannelOptions, pt as DevframeSettings, q as DevframeSnapshotRpcInputs, qt as EventUnsubscribe, r as ConnectionMetaWebsocket, rt as DevframeServiceMeta, s as DevframeNodeRpcSession, st as DevframeServicesRegistry, t as ConnectionMeta, tt as DevframeServiceId, u as RpcSharedStateGetOptions, ut as DevframeScopedNodeContext, vt as ScopedRpcFn, wt as DevframeRpcServerFunctions, xt as SettingsForNamespace, yt as ScopedServerFunctions, z as DevframeCliOptions, zt as AgentResourceInput } from "./context-CTAxz9ec.mjs";
|
|
4
3
|
import { a as DevframeWsPeer, i as DevframeRpcTransportKind, n as DevframeRpcConnection, r as DevframeRpcConnectionRequest, t as DevframeNodeRpcSessionMeta } from "./session-r6PDixP6.mjs";
|
|
5
4
|
import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "./remote-assets-eBvSKZMS.mjs";
|
|
6
|
-
import { i as DevframeDefineDiagnosticsOptions } from "./nostics-
|
|
5
|
+
import { i as DevframeDefineDiagnosticsOptions } from "./nostics-DWvukRwa.mjs";
|
|
7
6
|
//#region src/define.d.ts
|
|
8
7
|
export declare const defineRpcFunction: <NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends RpcArgsSchema | undefined = undefined, const RS extends RpcReturnSchema | undefined = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeNodeContext>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeNodeContext>;
|
|
9
8
|
/**
|
|
@@ -11,11 +10,5 @@ export declare const defineRpcFunction: <NAME extends string, TYPE extends RpcFu
|
|
|
11
10
|
* entry point. Import it from the package root: `import { defineDevframe } from 'devframe'`.
|
|
12
11
|
*/
|
|
13
12
|
export declare function defineDevframe(d: DevframeDefinition): DevframeDefinition;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Read {@link DevframeDefinition.clientAssets} from the definition
|
|
16
|
-
* directly. This helper is internal machinery that was never meant to be part
|
|
17
|
-
* of the public API and is scheduled for removal.
|
|
18
|
-
*/
|
|
19
|
-
export declare function resolveClientAssets(d: DevframeDefinition): StaticAssetsSource | undefined;
|
|
20
13
|
//#endregion
|
|
21
|
-
export type { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, AgentToolProvider, AgentToolProviderHandle, ConnectionMeta, ConnectionMetaSse, ConnectionMetaWebsocket, DevframeAgentHost, DevframeAgentHostEvents, DevframeCapabilities, DevframeCliOptions, DevframeConnectionConfigsRegistry, DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockDefaults, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, DevframeRpcConnection, DevframeRpcConnectionRequest, DevframeRpcOptions, DevframeRpcServerFunctions, DevframeRpcSharedStates, 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, DevframeWsPeer, EventEmitter, EventUnsubscribe, EventsMap, McpAuthorization, McpRouteOptions, McpSetting, RemoteAssets, RemoteAssetsErrorMessage, RemoteAssetsProvider, RemoteAssetsProviderCustom, RemoteAssetsStore, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedRpcFn, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, StaticAssetsSource };
|
|
14
|
+
export type { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, AgentToolProvider, AgentToolProviderHandle, ConnectionMeta, ConnectionMetaSse, ConnectionMetaWebsocket, CreateMcpFetchHandlerOptions, CreateMcpServerOptions, DevframeAgentHost, DevframeAgentHostEvents, DevframeCapabilities, DevframeCliOptions, DevframeConnectionConfigsRegistry, DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockDefaults, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, DevframeRpcConnection, DevframeRpcConnectionRequest, DevframeRpcOptions, DevframeRpcServerFunctions, DevframeRpcSharedStates, 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, DevframeWsPeer, EventEmitter, EventUnsubscribe, EventsMap, McpAuthorization, McpConnectionInfo, McpFetchHandler, McpRouteOptions, McpServerHandle, McpSetting, RemoteAssets, RemoteAssetsErrorMessage, RemoteAssetsProvider, RemoteAssetsProviderCustom, RemoteAssetsStore, RpcBroadcastOptions, RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedRpcFn, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, StaticAssetsSource };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { t as createDefineWrapperWithContext } from "./define-BLWPsH6y.mjs";
|
|
2
|
-
import { t as resolveClientAssets$1 } from "./client-assets-DNdhagGm.mjs";
|
|
3
2
|
//#region src/define.ts
|
|
4
3
|
const defineRpcFunction = createDefineWrapperWithContext();
|
|
5
4
|
/**
|
|
@@ -9,13 +8,5 @@ const defineRpcFunction = createDefineWrapperWithContext();
|
|
|
9
8
|
function defineDevframe(d) {
|
|
10
9
|
return d;
|
|
11
10
|
}
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Read {@link DevframeDefinition.clientAssets} from the definition
|
|
14
|
-
* directly. This helper is internal machinery that was never meant to be part
|
|
15
|
-
* of the public API and is scheduled for removal.
|
|
16
|
-
*/
|
|
17
|
-
function resolveClientAssets(d) {
|
|
18
|
-
return resolveClientAssets$1(d);
|
|
19
|
-
}
|
|
20
11
|
//#endregion
|
|
21
|
-
export { defineDevframe, defineRpcFunction
|
|
12
|
+
export { defineDevframe, defineRpcFunction };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as __exportAll } from "./rolldown-runtime-B4iAMlE-.mjs";
|
|
2
|
-
import { t as diagnostics } from "./diagnostics-
|
|
2
|
+
import { t as diagnostics } from "./diagnostics-Cx4_VjlG.mjs";
|
|
3
3
|
import { join } from "pathe";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import { mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as BirpcGroup } from "./index-Bia1vKjL.mjs";
|
|
2
|
+
import { At as DevframeAuthHandler, Ct as DevframeRpcClientFunctions, J as DevframeSseOptions, Y as DevframeWsOptions, o as DevframeNodeContext, s as DevframeNodeRpcSession, t as ConnectionMeta, wt as DevframeRpcServerFunctions } from "./context-CTAxz9ec.mjs";
|
|
2
3
|
import { n as DevframeRpcConnection, t as DevframeNodeRpcSessionMeta } from "./session-r6PDixP6.mjs";
|
|
3
|
-
import { n as WsOriginRegistry } from "./ws-server-
|
|
4
|
-
import "./index-
|
|
5
|
-
import { BirpcGroup } from "birpc";
|
|
4
|
+
import { n as WsOriginRegistry } from "./ws-server-y2R76aSW.mjs";
|
|
5
|
+
import "./index-CcPSKbxb.mjs";
|
|
6
6
|
import { H3 } from "h3";
|
|
7
7
|
import { NodeAdapter } from "crossws/adapters/node";
|
|
8
8
|
import { Buffer } from "node:buffer";
|
|
@@ -65,6 +65,32 @@ interface DevframeInstanceRegistration {
|
|
|
65
65
|
declare function registerDevframeInstance(record: DevframeInstanceRecord, options?: {
|
|
66
66
|
instancesDir?: string;
|
|
67
67
|
}): DevframeInstanceRegistration;
|
|
68
|
+
/**
|
|
69
|
+
* A successful `__connection.json` probe: the dialable origin that
|
|
70
|
+
* answered plus the parsed connection meta it served.
|
|
71
|
+
*
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
interface ProbedDevframeOrigin {
|
|
75
|
+
/** The origin that answered (may be an explicit address family for a `localhost` bind). */
|
|
76
|
+
origin: string;
|
|
77
|
+
/** The parsed `__connection.json` payload (`{}` when unparseable). */
|
|
78
|
+
meta: {
|
|
79
|
+
mcp?: {
|
|
80
|
+
path: string;
|
|
81
|
+
port?: number;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Probe `<origin><basePath>__connection.json`, trying each dialable
|
|
87
|
+
* candidate for the origin (see {@link originCandidates}). The single
|
|
88
|
+
* probe primitive behind both registry liveness checks and the
|
|
89
|
+
* connector's explicit `--port` probes.
|
|
90
|
+
*
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
declare function probeDevframeOrigin(origin: string, basePath: string, timeoutMs?: number): Promise<ProbedDevframeOrigin | null>;
|
|
68
94
|
/**
|
|
69
95
|
* Read the registry and split records into live and dead by probing each
|
|
70
96
|
* one's `__connection.json`, deleting dead records (prune-on-read). Live
|
|
@@ -260,4 +286,4 @@ declare function samePath(a: string, b: string): boolean;
|
|
|
260
286
|
*/
|
|
261
287
|
declare function createInstanceShell<TContext extends DevframeNodeContext>(options: CreateInstanceShellOptions<TContext>): InstanceShell<TContext>;
|
|
262
288
|
//#endregion
|
|
263
|
-
export { InstanceShellInit as a, StartedServer as c, samePath as d, DevframeInstanceRecord as f, registerDevframeInstance as h, InstanceShellApi as i, createInstanceShell as l, listLiveDevframeInstances as m, InstanceRegisterConfig as n, InstanceShellInternals as o, DevframeInstanceRegistration as p, InstanceShell as r, InstanceWsTier as s, CreateInstanceShellOptions as t, resolveInstanceRegister as u };
|
|
289
|
+
export { InstanceShellInit as a, StartedServer as c, samePath as d, DevframeInstanceRecord as f, registerDevframeInstance as g, probeDevframeOrigin as h, InstanceShellApi as i, createInstanceShell as l, listLiveDevframeInstances as m, InstanceRegisterConfig as n, InstanceShellInternals as o, DevframeInstanceRegistration as p, InstanceShell as r, InstanceWsTier as s, CreateInstanceShellOptions as t, resolveInstanceRegister as u };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./constants.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as diagnostics } from "./diagnostics-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { r as validateOriginCandidate } from "./origin-DZit9g29.mjs";
|
|
3
|
+
import { t as diagnostics } from "./diagnostics-Cx4_VjlG.mjs";
|
|
4
|
+
import { c as joinURL, d as withoutLeadingSlash, f as withoutTrailingSlash, u as withLeadingSlash } from "./_shared-B2PZsp-J.mjs";
|
|
5
|
+
import { t as getInternalContext } from "./context-CHpyLX8W.mjs";
|
|
6
|
+
import { n as createInteractiveAuth } from "./interactive-auth-BCa_iamv.mjs";
|
|
6
7
|
import { createServer } from "node:http";
|
|
7
8
|
import process from "node:process";
|
|
8
9
|
import { isIP } from "node:net";
|
|
9
|
-
import { joinURL, withLeadingSlash, withoutLeadingSlash, withoutTrailingSlash } from "ufo";
|
|
10
10
|
import { H3, defineHandler, toNodeHandler } from "h3";
|
|
11
11
|
//#region src/node/runtime.ts
|
|
12
12
|
/**
|
|
@@ -311,7 +311,7 @@ function createInstanceShell(options) {
|
|
|
311
311
|
const origin = currentOrigin();
|
|
312
312
|
if (!cfg || registerPromise || !origin || !meta) return;
|
|
313
313
|
const resolvedMeta = meta;
|
|
314
|
-
registerPromise = import("./instance-registry-
|
|
314
|
+
registerPromise = import("./instance-registry-DtvYxc0Y.mjs").then((n) => n.t).then(({ registerDevframeInstance }) => {
|
|
315
315
|
let port = 0;
|
|
316
316
|
try {
|
|
317
317
|
const url = new URL(origin);
|
|
@@ -387,7 +387,7 @@ function createInstanceShell(options) {
|
|
|
387
387
|
let resolvedAuth = false;
|
|
388
388
|
let corePromise;
|
|
389
389
|
function ensureCore() {
|
|
390
|
-
corePromise ??= import("./rpc-core-
|
|
390
|
+
corePromise ??= import("./rpc-core-BXyMjbKG.mjs").then((n) => n.n).then(({ createContextRpcServer }) => createContextRpcServer({
|
|
391
391
|
context: ctx,
|
|
392
392
|
auth: resolvedAuth,
|
|
393
393
|
onPeerConnect: options.onPeerConnect,
|