devframe 0.8.2 → 0.9.0-beta.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.
- package/dist/_shared-CttmCMBi.mjs +70 -0
- package/dist/_shared-DmpWW-HH.d.mts +43 -0
- package/dist/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +6 -5
- package/dist/adapters/cac.d.mts +1 -1
- package/dist/adapters/cac.mjs +157 -1
- package/dist/adapters/dev.d.mts +20 -42
- package/dist/adapters/dev.mjs +2 -1
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/initiate.d.mts +223 -0
- package/dist/adapters/initiate.mjs +2 -0
- package/dist/adapters/mcp.d.mts +26 -2
- package/dist/adapters/mcp.mjs +2 -2
- package/dist/cli/main.mjs +2 -2
- package/dist/client/index.d.mts +70 -6
- package/dist/client/index.mjs +743 -408
- package/dist/constants.d.mts +19 -6
- package/dist/constants.mjs +19 -6
- package/dist/{context-CBg8iRbQ.mjs → context-C33rR7n0.mjs} +1 -1
- package/dist/{context-DoSozfvx.d.mts → context-CSCwoABx.d.mts} +1 -1
- package/dist/{host-h3-D2hYZvDK.mjs → context-Du11TLcO.mjs} +5 -255
- package/dist/dev-BEveeA5H.mjs +233 -0
- package/dist/{devframe-mQ4qZAuo.d.mts → devframe-Bdd9YXTy.d.mts} +88 -25
- package/dist/{diagnostics-D7wM2cwM.mjs → diagnostics-DLYH5oD3.mjs} +16 -0
- package/dist/dist-D8jAMwxU.mjs +227 -0
- package/dist/helpers/vite.d.mts +43 -39
- package/dist/helpers/vite.mjs +26 -38
- package/dist/host-agent-CpbAoqBx.mjs +230 -0
- package/dist/host-h3-CzCZwtuV.mjs +26 -0
- package/dist/{fetch-BKaD0Vb3.mjs → http-DLr_cJZ7.mjs} +42 -4
- package/dist/{index-b64Uuhy2.d.mts → index-CZRd2K1C.d.mts} +2 -2
- package/dist/{index-Dbw1p5ch.d.mts → index-DSCq4M4q.d.mts} +2 -31
- package/dist/index.d.mts +9 -4
- package/dist/index.mjs +8 -1
- package/dist/{instance-registry-BnnA2Eoh.mjs → instance-registry-BQqGoDO9.mjs} +9 -2
- package/dist/instance-shell-DBTXTSjN.d.mts +264 -0
- package/dist/instance-shell-KRdee1QF.mjs +485 -0
- package/dist/internal/index.d.mts +150 -0
- package/dist/internal/index.mjs +7 -0
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/hub-internals.d.mts +2 -14
- package/dist/node/hub-internals.mjs +2 -2
- package/dist/node/index.d.mts +3 -267
- package/dist/node/index.mjs +3 -5
- package/dist/recipes/common-rpc-functions.d.mts +3 -3
- package/dist/recipes/interactive-auth.d.mts +3 -3
- package/dist/recipes/interactive-auth.mjs +6 -6
- package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
- package/dist/rpc/dump.d.mts +77 -1
- package/dist/rpc/dump.mjs +1 -1
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/index.mjs +3 -17
- package/dist/rpc/transports/sse-client.d.mts +2 -0
- package/dist/rpc/transports/sse-client.mjs +142 -0
- package/dist/rpc/transports/sse-server.d.mts +61 -0
- package/dist/rpc/transports/sse-server.mjs +209 -0
- package/dist/rpc/transports/ws-bun.d.mts +35 -0
- package/dist/rpc/transports/ws-bun.mjs +31 -0
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +10 -18
- package/dist/rpc/transports/ws-server.d.mts +2 -2
- package/dist/rpc/transports/ws-server.mjs +2 -235
- package/dist/rpc-core-CGctXToO.d.mts +48 -0
- package/dist/rpc-core-CqcJkAu9.mjs +81 -0
- package/dist/{serialization-C8Mnw9hK.mjs → serialization-BHY8M5NQ.mjs} +1 -1
- package/dist/{shared-state-6kHolYZy.mjs → shared-state-fRRbRUtD.mjs} +1 -1
- package/dist/sse-client-BsIK3hMD.d.mts +37 -0
- package/dist/{dump-CgZShDRB.mjs → static-CvjkO8QE.mjs} +2 -265
- package/dist/{storage-CTNVbuFB.mjs → storage-BcmVEJRc.mjs} +2 -2
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.mjs +1 -6
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/launch-editor.mjs +1 -25
- package/dist/utils/open.mjs +1 -1
- package/dist/utils/serve-static.mjs +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -1
- package/dist/utils/simple-schema.d.mts +101 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/validation-BiuDXTKW.mjs +266 -0
- package/dist/wire-codec-9VhIKnyp.mjs +58 -0
- package/dist/{ws-client-B6Tnr0ic.d.mts → ws-client-CdNuATYa.d.mts} +6 -1
- package/dist/ws-server-Bk1hOG3X.mjs +267 -0
- package/dist/{ws-server-uKQcClcJ.d.mts → ws-server-Ces08fjP.d.mts} +89 -8
- package/package.json +10 -9
- package/skills/devframe/SKILL.md +84 -85
- package/dist/_shared-bWRzeSa0.mjs +0 -19
- package/dist/adapters/cli.d.mts +0 -11
- package/dist/adapters/cli.mjs +0 -6
- package/dist/cac-D4_9ok0z.mjs +0 -157
- package/dist/dev-Bc49u3qg.mjs +0 -439
- package/dist/http-C4T68YV6.mjs +0 -38
- package/dist/index-vAX6bYuc.d.mts +0 -78
- package/dist/recipes/open-helpers.d.mts +0 -6
- package/dist/recipes/open-helpers.mjs +0 -6
- package/dist/server-CD8XmBXl.mjs +0 -167
- package/dist/server-UHWae43Q.d.mts +0 -149
- package/dist/simple-schema-BDzLeJDk.d.mts +0 -102
- package/dist/utils/promise.d.mts +0 -8
- package/dist/utils/promise.mjs +0 -15
- package/dist/utils/scope.d.mts +0 -11
- package/dist/utils/scope.mjs +0 -15
- package/dist/{open-Deb5xmIT.mjs → open-Dz4V4irZ.mjs} +1 -1
package/dist/adapters/mcp.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as DevframeDefinition, x as DevframeNodeContext } from "../devframe-Bdd9YXTy.mjs";
|
|
2
|
+
import { H3 } from "h3";
|
|
2
3
|
import "@modelcontextprotocol/server";
|
|
3
4
|
//#region src/adapters/mcp/build-server.d.ts
|
|
4
5
|
interface CreateMcpServerOptions {
|
|
@@ -85,4 +86,27 @@ interface McpFetchHandler {
|
|
|
85
86
|
*/
|
|
86
87
|
declare function createMcpFetchHandler(ctx: DevframeNodeContext, options: CreateMcpFetchHandlerOptions): McpFetchHandler;
|
|
87
88
|
//#endregion
|
|
88
|
-
|
|
89
|
+
//#region src/adapters/mcp/http.d.ts
|
|
90
|
+
interface MountMcpHttpOptions extends CreateMcpFetchHandlerOptions {}
|
|
91
|
+
interface MountedMcpHttp {
|
|
92
|
+
/** Tear down every live MCP session (closes servers, drops subscriptions). */
|
|
93
|
+
dispose: () => Promise<void>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Mount an MCP Streamable-HTTP endpoint on an h3 app at `path` — the h3
|
|
97
|
+
* binding over {@link createMcpFetchHandler}, which owns the sessions, the
|
|
98
|
+
* origin gate, and the transport plumbing.
|
|
99
|
+
*
|
|
100
|
+
* The handler is web-standard — it takes the h3 event's web `Request` and
|
|
101
|
+
* returns a web `Response` (an SSE `ReadableStream` body for the
|
|
102
|
+
* server→client stream). We copy that response onto `event.res` and return
|
|
103
|
+
* its body rather than returning the `Response` object directly, so a
|
|
104
|
+
* legitimate MCP 404 (unknown session) isn't swallowed by h3's
|
|
105
|
+
* "Response-with-404 falls through to the next handler" rule (which would
|
|
106
|
+
* otherwise hand the request to the SPA static catch-all).
|
|
107
|
+
*
|
|
108
|
+
* @experimental
|
|
109
|
+
*/
|
|
110
|
+
declare function mountMcpHttp(app: H3, ctx: DevframeNodeContext, path: string, options: MountMcpHttpOptions): MountedMcpHttp;
|
|
111
|
+
//#endregion
|
|
112
|
+
export { type CreateMcpFetchHandlerOptions, type CreateMcpServerOptions, type McpFetchHandler, type McpServerHandle, type MountMcpHttpOptions, type MountedMcpHttp, createMcpFetchHandler, createMcpServer, mountMcpHttp };
|
package/dist/adapters/mcp.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { createMcpFetchHandler, createMcpServer };
|
|
1
|
+
import { i as createMcpServer, n as mountMcpHttp, r as createMcpFetchHandler } from "../http-DLr_cJZ7.mjs";
|
|
2
|
+
export { createMcpFetchHandler, createMcpServer, mountMcpHttp };
|
package/dist/cli/main.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as diagnostics } from "../diagnostics-
|
|
2
|
-
import { n as
|
|
1
|
+
import { t as diagnostics } from "../diagnostics-DLYH5oD3.mjs";
|
|
2
|
+
import { n as listLiveDevframeInstances, r as probeDevframeOrigin } from "../instance-registry-BQqGoDO9.mjs";
|
|
3
3
|
import { t as toAgentToolName } from "../agent-tool-name-C3b5vEwJ.mjs";
|
|
4
4
|
import { Diagnostic } from "nostics";
|
|
5
5
|
import process from "node:process";
|
package/dist/client/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as DevframeRpcClientFunctions, F as ScopedServerFunctions, I as ScopedSharedStates, J as RpcSharedStateGetOptions, L as SettingsForNamespace, Mt as EventEmitter, P as ScopedRpcFn, Y as RpcSharedStateHost, _ as ConnectionMeta, et as DevframeRpcServerFunctions, gt as SharedState, k as DevframeSettings, ot as StreamReader, st as StreamSink } from "../devframe-Bdd9YXTy.mjs";
|
|
2
|
+
import { f as RpcCacheManager, p as RpcCacheOptions } from "../index-DSCq4M4q.mjs";
|
|
2
3
|
import { _ as RpcFunctionDefinition, w as RpcFunctionsCollector } from "../types-CnJSgRVa.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { t as WsRpcChannelOptions } from "../ws-client-
|
|
4
|
+
import { t as SseRpcChannelOptions } from "../sse-client-BsIK3hMD.mjs";
|
|
5
|
+
import { t as WsRpcChannelOptions } from "../ws-client-CdNuATYa.mjs";
|
|
5
6
|
import { BirpcOptions, BirpcReturn } from "birpc";
|
|
6
7
|
//#region src/client/connection.d.ts
|
|
7
8
|
interface DevframeConnection {
|
|
@@ -251,7 +252,24 @@ interface DevframeRpcClientOptions extends SetupDevframeConnectionOptions {
|
|
|
251
252
|
* @default true
|
|
252
253
|
*/
|
|
253
254
|
simpleAuth?: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Which live transport to connect over:
|
|
257
|
+
*
|
|
258
|
+
* - `'auto'` (default) — trust the server's advertisement: its declared
|
|
259
|
+
* primary (`backend`), preferring the WebSocket when both endpoints are
|
|
260
|
+
* present. A server that couldn't bind a socket advertises SSE as its
|
|
261
|
+
* primary, so no client-side fallback probing is needed.
|
|
262
|
+
* - `'websocket'` / `'sse'` — pin one transport; connecting fails with a
|
|
263
|
+
* clear error when the server doesn't advertise it. Reach for
|
|
264
|
+
* `transport: 'sse'` when an intermediary silently strips WS upgrades —
|
|
265
|
+
* something the server cannot detect.
|
|
266
|
+
*
|
|
267
|
+
* A `static` backend ignores this option (there is no live transport).
|
|
268
|
+
*/
|
|
269
|
+
transport?: 'auto' | 'websocket' | 'sse';
|
|
254
270
|
wsOptions?: Partial<WsRpcChannelOptions>;
|
|
271
|
+
/** Channel overrides for the SSE transport — the `wsOptions` counterpart. */
|
|
272
|
+
sseOptions?: Partial<SseRpcChannelOptions>;
|
|
255
273
|
rpcOptions?: Partial<BirpcOptions<DevframeRpcServerFunctions, DevframeRpcClientFunctions, boolean>>;
|
|
256
274
|
cacheOptions?: boolean | Partial<RpcCacheOptions>;
|
|
257
275
|
/**
|
|
@@ -282,10 +300,16 @@ interface DevframeRpcClient {
|
|
|
282
300
|
*/
|
|
283
301
|
readonly status: DevframeConnectionStatus;
|
|
284
302
|
/**
|
|
285
|
-
* The most recent connection-level error (
|
|
286
|
-
* failed connection-meta load), or `null` when the connection is healthy.
|
|
303
|
+
* The most recent connection-level error (transport error, refused trust,
|
|
304
|
+
* or failed connection-meta load), or `null` when the connection is healthy.
|
|
287
305
|
*/
|
|
288
306
|
readonly connectionError: Error | null;
|
|
307
|
+
/**
|
|
308
|
+
* The transport this client is actually connected over — `'websocket'`,
|
|
309
|
+
* `'sse'`, or `'static'`. Reflects the resolution of the `transport`
|
|
310
|
+
* option against the server's advertisement.
|
|
311
|
+
*/
|
|
312
|
+
readonly transport: 'websocket' | 'sse' | 'static';
|
|
289
313
|
/**
|
|
290
314
|
* The complete connection used by this client, including the metadata source
|
|
291
315
|
* URL external viewers use to resolve relative resources.
|
|
@@ -362,8 +386,27 @@ interface DevframeRpcClient {
|
|
|
362
386
|
<NS extends string>(namespace: NS): DevframeScopedClientContext<NS, SettingsForNamespace<NS>>;
|
|
363
387
|
(namespace?: null | ''): DevframeRpcClient;
|
|
364
388
|
};
|
|
389
|
+
/**
|
|
390
|
+
* Close the connection. A `static` backend is a no-op (there is no live socket to close);
|
|
391
|
+
* a `websocket` backend closes the underlying `WebSocket`, which the server observes as a
|
|
392
|
+
* normal disconnect. Mirrors {@link WsRpcTransport.close} on the server side.
|
|
393
|
+
*
|
|
394
|
+
* There is no corresponding "reconnect" — a closed client is done. Discard it and call
|
|
395
|
+
* {@link getDevframeRpcClient} again to reconnect.
|
|
396
|
+
*
|
|
397
|
+
* Optional so a `DevframeRpcClientMode` implemented before this method existed — a custom
|
|
398
|
+
* transport, a hand-typed mock — still satisfies the interface; an absent `close` is treated
|
|
399
|
+
* as nothing to close.
|
|
400
|
+
*/
|
|
401
|
+
close?: () => void;
|
|
365
402
|
}
|
|
366
403
|
interface DevframeRpcClientMode {
|
|
404
|
+
/**
|
|
405
|
+
* The transport this mode speaks. Optional so a mode implemented before
|
|
406
|
+
* this field existed — a custom transport, a hand-typed mock — still
|
|
407
|
+
* satisfies the interface; an absent value reads as `'websocket'`.
|
|
408
|
+
*/
|
|
409
|
+
readonly transport?: 'websocket' | 'sse' | 'static';
|
|
367
410
|
readonly isTrusted: boolean;
|
|
368
411
|
readonly status: DevframeConnectionStatus;
|
|
369
412
|
readonly connectionError: Error | null;
|
|
@@ -378,7 +421,17 @@ interface DevframeRpcClientMode {
|
|
|
378
421
|
call: DevframeRpcClient['call'];
|
|
379
422
|
callEvent: DevframeRpcClient['callEvent'];
|
|
380
423
|
callOptional: DevframeRpcClient['callOptional'];
|
|
424
|
+
/** See {@link DevframeRpcClient.close}. */
|
|
425
|
+
close?: () => void;
|
|
381
426
|
}
|
|
427
|
+
/**
|
|
428
|
+
* Resolve the requested `transport` option against what the server
|
|
429
|
+
* advertises. `'auto'` trusts the advertisement — the server's declared
|
|
430
|
+
* primary (`backend`), preferring the WebSocket when both endpoints are
|
|
431
|
+
* present; an explicit `'websocket'` / `'sse'` pins that transport and
|
|
432
|
+
* throws when the server doesn't advertise it.
|
|
433
|
+
*/
|
|
434
|
+
declare function resolveClientTransport(requested: 'auto' | 'websocket' | 'sse', meta: ConnectionMeta): 'websocket' | 'sse' | 'static';
|
|
382
435
|
declare function getDevframeRpcClient(options?: DevframeRpcClientOptions): Promise<DevframeRpcClient>;
|
|
383
436
|
//#endregion
|
|
384
437
|
//#region src/client/otp.d.ts
|
|
@@ -431,6 +484,17 @@ interface WsUrlLocation {
|
|
|
431
484
|
*/
|
|
432
485
|
declare function resolveWsUrl(websocket: ConnectionMeta['websocket'], metaBaseUrl: string, loc: WsUrlLocation): string;
|
|
433
486
|
//#endregion
|
|
487
|
+
//#region src/client/rpc-sse.d.ts
|
|
488
|
+
/**
|
|
489
|
+
* Resolve a {@link ConnectionMeta.sse} descriptor into a concrete
|
|
490
|
+
* `http(s)://` URL, with the same proxy-safe rules as `resolveWsUrl`: the
|
|
491
|
+
* object / relative-path forms resolve against where `__connection.json`
|
|
492
|
+
* was loaded (the client trusts its own location, never a server-baked
|
|
493
|
+
* hostname), while an explicit `port`/`host` (or a full `http(s)://` URL
|
|
494
|
+
* string) opts into a cross-origin endpoint.
|
|
495
|
+
*/
|
|
496
|
+
declare function resolveSseUrl(sse: ConnectionMeta['sse'], metaBaseUrl: string, loc: WsUrlLocation): string;
|
|
497
|
+
//#endregion
|
|
434
498
|
//#region src/client/settings.d.ts
|
|
435
499
|
/**
|
|
436
500
|
* Build the client-side `settings` surface for a scope namespace. Mirrors
|
|
@@ -441,4 +505,4 @@ declare function createClientSettings<T extends Record<string, any> = Record<str
|
|
|
441
505
|
//#region src/client/index.d.ts
|
|
442
506
|
declare const connectDevframe: typeof getDevframeRpcClient;
|
|
443
507
|
//#endregion
|
|
444
|
-
export { DevframeClientRpcHost, DevframeConnection, DevframeConnectionError, DevframeConnectionErrorKind, DevframeConnectionStatus, DevframeRpcClient, DevframeRpcClientCall, DevframeRpcClientCallEvent, DevframeRpcClientCallOptional, DevframeRpcClientMode, DevframeRpcClientOptions, DevframeRpcContext, DevframeScopedClientContext, DevframeScopedClientRpc, DevframeScopedClientStreamingHost, RpcClientEvents, RpcStreamingClientHost, SetupDevframeConnectionOptions, StreamingSubscribeOptions, type WsUrlLocation, authenticateWithUrlOtp, connectDevframe, consumeOtpFromUrl, createClientSettings, createRpcStreamingClientHost, createScopedClientContext, getDevframeConnection, getDevframeRpcClient, isCallableStatus, readOtpFromUrl, registerDevframeViewerOrigin, resolveWsUrl, setupDevframeConnection };
|
|
508
|
+
export { DevframeClientRpcHost, DevframeConnection, DevframeConnectionError, DevframeConnectionErrorKind, DevframeConnectionStatus, DevframeRpcClient, DevframeRpcClientCall, DevframeRpcClientCallEvent, DevframeRpcClientCallOptional, DevframeRpcClientMode, DevframeRpcClientOptions, DevframeRpcContext, DevframeScopedClientContext, DevframeScopedClientRpc, DevframeScopedClientStreamingHost, RpcClientEvents, RpcStreamingClientHost, SetupDevframeConnectionOptions, StreamingSubscribeOptions, type WsUrlLocation, authenticateWithUrlOtp, connectDevframe, consumeOtpFromUrl, createClientSettings, createRpcStreamingClientHost, createScopedClientContext, getDevframeConnection, getDevframeRpcClient, isCallableStatus, readOtpFromUrl, registerDevframeViewerOrigin, resolveClientTransport, resolveSseUrl, resolveWsUrl, setupDevframeConnection };
|