devframe 0.9.20 → 0.10.1

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 (102) hide show
  1. package/dist/_shared-B2PZsp-J.mjs +191 -0
  2. package/dist/{_shared-BIUet_Jh.d.mts → _shared-D1ebaX_J.d.mts} +13 -14
  3. package/dist/adapters/build.d.mts +3 -4
  4. package/dist/adapters/build.mjs +4 -5
  5. package/dist/adapters/cac.d.mts +3 -4
  6. package/dist/adapters/cac.mjs +3 -3
  7. package/dist/adapters/dev.d.mts +8 -8
  8. package/dist/adapters/dev.mjs +2 -2
  9. package/dist/adapters/embedded.d.mts +1 -1
  10. package/dist/adapters/initiate.d.mts +8 -8
  11. package/dist/adapters/initiate.mjs +1 -1
  12. package/dist/adapters/mcp.d.mts +4 -142
  13. package/dist/adapters/mcp.mjs +1 -597
  14. package/dist/agentic-DLqHMOyN.d.mts +30 -0
  15. package/dist/browser-agent-Pu-FLk6I.mjs +26 -0
  16. package/dist/browser-agent-rpc-BXhoSh1z.mjs +70 -0
  17. package/dist/cli/main.mjs +12 -260
  18. package/dist/client/index.d.mts +6 -6
  19. package/dist/client/index.mjs +12 -87
  20. package/dist/constants.d.mts +2 -1
  21. package/dist/constants.mjs +2 -1
  22. package/dist/{context-BLHBDQcZ.d.mts → context--tVkJw3W.d.mts} +127 -47
  23. package/dist/{context-BLXXjoBW.mjs → context-BqpgC5tq.mjs} +55 -5
  24. package/dist/{context-jXO5vzjH.mjs → context-CHpyLX8W.mjs} +1 -1
  25. package/dist/{context-BA5FPz7K.d.mts → context-D3qBv0IX.d.mts} +1 -1
  26. package/dist/{dev-BdKKOH8S.mjs → dev-BTbLJekh.mjs} +16 -24
  27. package/dist/{diagnostics-DZA6KQ_Z.mjs → diagnostics-Cx4_VjlG.mjs} +11 -3
  28. package/dist/dist-CO98PBnQ.mjs +265 -0
  29. package/dist/{host-agent-C3MBpNCd.mjs → host-agent-mIbQ6Qi5.mjs} +14 -13
  30. package/dist/import-runtime-module-BzlEQ9PI.mjs +24 -0
  31. package/dist/in-page-channel/index.d.mts +16 -12
  32. package/dist/in-page-channel/index.mjs +42 -14
  33. package/dist/index-Bia1vKjL.d.mts +218 -0
  34. package/dist/index-CeEtxDmK.d.mts +78 -0
  35. package/dist/{index-r6NstVmM.d.mts → index-D-2IdY1I.d.mts} +2 -2
  36. package/dist/{index-CiA6C705.d.mts → index-DuEm0sDH.d.mts} +1 -1
  37. package/dist/index.d.mts +4 -11
  38. package/dist/index.mjs +1 -10
  39. package/dist/{instance-registry-DCq762YJ.mjs → instance-registry-DtvYxc0Y.mjs} +1 -1
  40. package/dist/{instance-shell-C6Vg97lg.d.mts → instance-shell-CXnpSuK7.d.mts} +31 -5
  41. package/dist/{instance-shell-yfrM3_vK.mjs → instance-shell-wC2sfEU_.mjs} +7 -7
  42. package/dist/interactive-auth-BCa_iamv.mjs +384 -0
  43. package/dist/internal/index.d.mts +66 -22
  44. package/dist/internal/index.mjs +143 -8
  45. package/dist/mrmime-40h5OOIp.mjs +448 -0
  46. package/dist/node/auth.d.mts +2 -2
  47. package/dist/node/hub-internals.d.mts +2 -2
  48. package/dist/node/hub-internals.mjs +2 -2
  49. package/dist/node/index.d.mts +2 -4
  50. package/dist/node/index.mjs +2 -2
  51. package/dist/{nostics-0sKe5HIj.d.mts → nostics-DWvukRwa.d.mts} +11 -2
  52. package/dist/{origin-D_eBKEzr.mjs → origin-DZit9g29.mjs} +1 -21
  53. package/dist/recipes/interactive-auth.d.mts +2 -2
  54. package/dist/recipes/interactive-auth.mjs +1 -231
  55. package/dist/{remote-assets-D0StJVLp.mjs → remote-assets-B9MeWmW6.mjs} +2 -2
  56. package/dist/rpc/client.d.mts +1 -1
  57. package/dist/rpc/client.mjs +1 -1
  58. package/dist/rpc/dump.d.mts +2 -1
  59. package/dist/rpc/index.d.mts +3 -2
  60. package/dist/rpc/server.d.mts +1 -1
  61. package/dist/rpc/server.mjs +1 -1
  62. package/dist/rpc/transports/sse-client.d.mts +1 -1
  63. package/dist/rpc/transports/sse-server.d.mts +3 -3
  64. package/dist/rpc/transports/sse-server.mjs +1 -1
  65. package/dist/rpc/transports/ws-bun.d.mts +2 -2
  66. package/dist/rpc/transports/ws-bun.mjs +1 -1
  67. package/dist/rpc/transports/ws-client.d.mts +1 -1
  68. package/dist/rpc/transports/ws-deno.d.mts +2 -2
  69. package/dist/rpc/transports/ws-deno.mjs +1 -1
  70. package/dist/rpc/transports/ws-server.d.mts +1 -1
  71. package/dist/rpc/transports/ws-server.mjs +1 -1
  72. package/dist/{rpc-core-BlL-Ip8n.d.mts → rpc-core-B6n9MQsc.d.mts} +4 -4
  73. package/dist/{rpc-core-CvkU23bQ.mjs → rpc-core-BXyMjbKG.mjs} +1 -1
  74. package/dist/{services-install-Ben4yh52.mjs → services-install-D5YUwFXW.mjs} +17 -1
  75. package/dist/{sse-client-BcbYwXdD.d.mts → sse-client-DNdscfu_.d.mts} +2 -2
  76. package/dist/{storage-B70AXK64.mjs → storage-CHD1IkqU.mjs} +1 -1
  77. package/dist/tool-input-BAQXvvqL.mjs +393 -0
  78. package/dist/types/index.d.mts +4 -4
  79. package/dist/{types-D2vGd7-2.d.mts → types-BmDbfHCx.d.mts} +2 -3
  80. package/dist/utils/debounce.d.mts +50 -0
  81. package/dist/utils/debounce.mjs +88 -0
  82. package/dist/utils/events.d.mts +1 -1
  83. package/dist/utils/launch-editor.d.mts +8 -0
  84. package/dist/utils/launch-editor.mjs +36 -1
  85. package/dist/utils/nostics.d.mts +2 -2
  86. package/dist/utils/remote-assets.mjs +1 -1
  87. package/dist/utils/serve-static.mjs +1 -1
  88. package/dist/utils/shared-state.d.mts +1 -1
  89. package/dist/utils/simple-schema.d.mts +3 -2
  90. package/dist/utils/streaming-channel.d.mts +1 -1
  91. package/dist/utils/url.d.mts +31 -0
  92. package/dist/utils/url.mjs +58 -0
  93. package/dist/{ws-client-CNpP6Ium.d.mts → ws-client-6Mrz6eC4.d.mts} +2 -2
  94. package/dist/{ws-server-BB8jhxeT.d.mts → ws-server-y2R76aSW.d.mts} +2 -2
  95. package/package.json +10 -11
  96. package/dist/_shared-U8D-xzrp.mjs +0 -115
  97. package/dist/agent-tool-name-DGzeuWcO.mjs +0 -31
  98. package/dist/client-assets-DNdhagGm.mjs +0 -16
  99. package/dist/nostics-DD6gsDZA.mjs +0 -108
  100. package/dist/recipes/common-rpc-functions.d.mts +0 -70
  101. package/dist/recipes/common-rpc-functions.mjs +0 -115
  102. package/dist/simple-schema-Bi40l-P6.mjs +0 -154
@@ -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 };
@@ -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,5 +1,5 @@
1
- import { k as SharedState, o as DevframeNodeContext, s as DevframeNodeRpcSession } from "./context-BLHBDQcZ.mjs";
2
- import { n as InternalAnonymousAuthStorage } from "./context-BA5FPz7K.mjs";
1
+ import { k as SharedState, o as DevframeNodeContext, s as DevframeNodeRpcSession } from "./context--tVkJw3W.mjs";
2
+ import { n as InternalAnonymousAuthStorage } from "./context-D3qBv0IX.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`
@@ -1,4 +1,4 @@
1
- import { D as RpcReturnSchema, E as RpcFunctionsCollector, T as RpcFunctionType, _ as RpcFunctionDefinition, i as RpcArgsSchema, v as RpcFunctionDefinitionAny, w as RpcFunctionSetupResult } from "./types-D2vGd7-2.mjs";
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 "./index-CiA6C705.mjs";
2
- import { D as RpcReturnSchema, T as RpcFunctionType, _ as RpcFunctionDefinition, g as RpcFunctionAgentOptions, i as RpcArgsSchema } from "./types-D2vGd7-2.mjs";
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--tVkJw3W.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-0sKe5HIj.mjs";
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, resolveClientAssets };
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-DZA6KQ_Z.mjs";
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 { Tt as DevframeAuthHandler, U as DevframeSseOptions, W as DevframeWsOptions, o as DevframeNodeContext, s as DevframeNodeRpcSession, t as ConnectionMeta, vt as DevframeRpcClientFunctions, yt as DevframeRpcServerFunctions } from "./context-BLHBDQcZ.mjs";
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--tVkJw3W.mjs";
2
3
  import { n as DevframeRpcConnection, t as DevframeNodeRpcSessionMeta } from "./session-r6PDixP6.mjs";
3
- import { n as WsOriginRegistry } from "./ws-server-BB8jhxeT.mjs";
4
- import "./index-r6NstVmM.mjs";
5
- import { BirpcGroup } from "birpc";
4
+ import { n as WsOriginRegistry } from "./ws-server-y2R76aSW.mjs";
5
+ import "./index-D-2IdY1I.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 { i as validateOriginCandidate } from "./origin-D_eBKEzr.mjs";
3
- import { t as diagnostics } from "./diagnostics-DZA6KQ_Z.mjs";
4
- import { t as getInternalContext } from "./context-jXO5vzjH.mjs";
5
- import { createInteractiveAuth } from "./recipes/interactive-auth.mjs";
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-DCq762YJ.mjs").then((n) => n.t).then(({ registerDevframeInstance }) => {
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-CvkU23bQ.mjs").then((n) => n.n).then(({ createContextRpcServer }) => createContextRpcServer({
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,