devframe 0.6.0-beta.3 → 0.6.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/adapters/build.d.mts +1 -1
- package/dist/adapters/cli.d.mts +1 -1
- package/dist/adapters/cli.mjs +9 -6
- package/dist/adapters/dev.d.mts +9 -2
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +1 -337
- package/dist/build-server-0jWgMrz-.mjs +338 -0
- package/dist/client/index.d.mts +1 -1
- package/dist/constants.d.mts +8 -1
- package/dist/constants.mjs +8 -1
- package/dist/{context-B_I9fMBc.d.mts → context-UX9qUDK7.d.mts} +1 -1
- package/dist/{dev-DSxKFn-v.mjs → dev-zC5542OV.mjs} +46 -3
- package/dist/{devframe-DgvncQy2.d.mts → devframe-BtVHhmwM.d.mts} +57 -1
- package/dist/helpers/vite.d.mts +1 -1
- package/dist/helpers/vite.mjs +1 -1
- package/dist/http-COX960WK.mjs +114 -0
- package/dist/{index-B4lNDq5v.d.mts → index-ByaMT1Xp.d.mts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/node/auth.d.mts +1 -1
- package/dist/node/hub-internals.d.mts +2 -2
- package/dist/node/index.d.mts +2 -2
- package/dist/node/index.mjs +1 -1
- package/dist/recipes/interactive-auth.d.mts +2 -2
- package/dist/{server-BdN41ckC.mjs → server-CAsvfJNK.mjs} +21 -17
- package/dist/{server-DXPq8q0K.d.mts → server-Cfr1NrGQ.d.mts} +14 -3
- package/dist/types/index.d.mts +2 -2
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { isAllowedOrigin } from "./rpc/transports/ws-server.mjs";
|
|
2
|
+
import { t as buildMcpServerFromContext } from "./build-server-0jWgMrz-.mjs";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { defineHandler } from "h3";
|
|
5
|
+
import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
|
|
6
|
+
import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
7
|
+
//#region src/adapters/mcp/http.ts
|
|
8
|
+
/**
|
|
9
|
+
* Mount an MCP Streamable-HTTP endpoint on an h3 app at `path`.
|
|
10
|
+
*
|
|
11
|
+
* Each MCP session gets its own {@link WebStandardStreamableHTTPServerTransport}
|
|
12
|
+
* and MCP server (built from the shared, live `ctx` via
|
|
13
|
+
* `buildMcpServerFromContext`), correlated by the `Mcp-Session-Id` header:
|
|
14
|
+
* an `initialize` POST spins up a session; later requests route to it; a
|
|
15
|
+
* `DELETE` (or client disconnect) tears it down.
|
|
16
|
+
*
|
|
17
|
+
* The transport is web-standard — its `handleRequest` takes the h3 event's
|
|
18
|
+
* web `Request` and returns a web `Response` (an SSE `ReadableStream` body
|
|
19
|
+
* for the server→client stream). We copy that response onto `event.res` and
|
|
20
|
+
* return its body rather than returning the `Response` object directly, so a
|
|
21
|
+
* legitimate MCP 404 (unknown session) isn't swallowed by h3's
|
|
22
|
+
* "Response-with-404 falls through to the next handler" rule (which would
|
|
23
|
+
* otherwise hand the request to the SPA static catch-all).
|
|
24
|
+
*
|
|
25
|
+
* @experimental
|
|
26
|
+
*/
|
|
27
|
+
function mountMcpHttp(app, ctx, path, options) {
|
|
28
|
+
const sessions = /* @__PURE__ */ new Map();
|
|
29
|
+
const allowedOrigins = options.allowedOrigins;
|
|
30
|
+
function drop(sessionId) {
|
|
31
|
+
const session = sessions.get(sessionId);
|
|
32
|
+
if (!session) return;
|
|
33
|
+
sessions.delete(sessionId);
|
|
34
|
+
session.dispose();
|
|
35
|
+
}
|
|
36
|
+
async function createSession() {
|
|
37
|
+
let session;
|
|
38
|
+
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
39
|
+
sessionIdGenerator: () => randomUUID(),
|
|
40
|
+
onsessioninitialized: (id) => {
|
|
41
|
+
sessions.set(id, session);
|
|
42
|
+
},
|
|
43
|
+
onsessionclosed: (id) => {
|
|
44
|
+
drop(id);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const { server, dispose } = buildMcpServerFromContext(ctx, {
|
|
48
|
+
serverName: options.serverName,
|
|
49
|
+
serverVersion: options.serverVersion,
|
|
50
|
+
exposeSharedState: options.exposeSharedState
|
|
51
|
+
});
|
|
52
|
+
session = {
|
|
53
|
+
transport,
|
|
54
|
+
dispose: async () => {
|
|
55
|
+
dispose();
|
|
56
|
+
await server.close();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
transport.onclose = () => {
|
|
60
|
+
if (transport.sessionId) drop(transport.sessionId);
|
|
61
|
+
};
|
|
62
|
+
await server.connect(transport);
|
|
63
|
+
return session;
|
|
64
|
+
}
|
|
65
|
+
app.use(path, defineHandler(async (event) => {
|
|
66
|
+
const req = event.req;
|
|
67
|
+
const origin = req.headers.get("origin") ?? void 0;
|
|
68
|
+
if (allowedOrigins !== false && !isAllowedOrigin(origin, allowedOrigins ?? [])) {
|
|
69
|
+
event.res.status = 403;
|
|
70
|
+
return "Forbidden: origin not allowed";
|
|
71
|
+
}
|
|
72
|
+
const sessionId = req.headers.get("mcp-session-id") ?? void 0;
|
|
73
|
+
let session = sessionId ? sessions.get(sessionId) : void 0;
|
|
74
|
+
if (!session && req.method === "POST") {
|
|
75
|
+
let body;
|
|
76
|
+
try {
|
|
77
|
+
body = await req.json();
|
|
78
|
+
} catch {
|
|
79
|
+
body = void 0;
|
|
80
|
+
}
|
|
81
|
+
if (!sessionId && isInitializeRequest(body)) session = await createSession();
|
|
82
|
+
else {
|
|
83
|
+
event.res.status = sessionId ? 404 : 400;
|
|
84
|
+
return sessionId ? "Not Found: unknown MCP session" : "Bad Request: no valid session ID and not an initialize request";
|
|
85
|
+
}
|
|
86
|
+
return respond(event, await session.transport.handleRequest(req, { parsedBody: body }));
|
|
87
|
+
}
|
|
88
|
+
if (!session) {
|
|
89
|
+
event.res.status = sessionId ? 404 : 400;
|
|
90
|
+
return sessionId ? "Not Found: unknown MCP session" : "Bad Request: missing MCP session ID";
|
|
91
|
+
}
|
|
92
|
+
return respond(event, await session.transport.handleRequest(req));
|
|
93
|
+
}));
|
|
94
|
+
return { dispose: async () => {
|
|
95
|
+
const live = [...sessions.values()];
|
|
96
|
+
sessions.clear();
|
|
97
|
+
await Promise.all(live.map((session) => session.dispose()));
|
|
98
|
+
} };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Copy a web `Response` from the MCP transport onto the h3 event's response
|
|
102
|
+
* and return its body. Returning the body (a `ReadableStream` or `null`)
|
|
103
|
+
* rather than the `Response` object avoids h3's 404-fall-through behavior.
|
|
104
|
+
*/
|
|
105
|
+
function respond(event, response) {
|
|
106
|
+
event.res.status = response.status;
|
|
107
|
+
event.res.statusText = response.statusText;
|
|
108
|
+
response.headers.forEach((value, key) => {
|
|
109
|
+
event.res.headers.set(key, value);
|
|
110
|
+
});
|
|
111
|
+
return response.body ?? "";
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { mountMcpHttp };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as SharedState, g as DevframeNodeRpcSession, h as DevframeNodeContext } from "./devframe-BtVHhmwM.mjs";
|
|
2
2
|
import { v as RpcFunctionDefinitionAny } from "./types-DZEx4ffs.mjs";
|
|
3
|
-
import { n as InternalAnonymousAuthStorage } from "./context-
|
|
3
|
+
import { n as InternalAnonymousAuthStorage } from "./context-UX9qUDK7.mjs";
|
|
4
4
|
import { Peer } from "crossws";
|
|
5
5
|
|
|
6
6
|
//#region src/node/auth/handler.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ScopedClientFunctions, C as RpcStreamingHost, Ct as EventsMap, G as Thenable, J as DevframeScopedStreamingHost, K as DevframeScopedNodeContext, Q as ScopedBroadcastOptions, S as RpcStreamingChannelOptions, St as EventUnsubscribe, U as EntriesToObject, W as PartialWithoutId, X as DevframeSettingsRegistry, Y as DevframeSettings, Z as DevframeSettingsStore, _ as RpcBroadcastOptions, _t as AgentTool, a as DevframeDuplicationStrategy, at as DevframeRpcServerFunctions, b as RpcSharedStateHost, bt as DevframeAgentHostEvents, c as DevframeSpaOptions, ct as DevframeDefineDiagnosticsOptions, d as defineDevframe, dt as DevframeDiagnosticsLogger, et as ScopedServerFunctions, f as ConnectionMeta, ft as AgentHandle, g as DevframeNodeRpcSession, gt as AgentResourceInput, h as DevframeNodeContext, ht as AgentResourceContent, i as DevframeDeploymentKind, it as DevframeRpcClientFunctions, l as DevframeWsOptions, lt as DevframeDiagnosticsDefinition, m as DevframeCapabilities, mt as AgentResource, n as DevframeCliOptions, nt as SettingsForNamespace, o as DevframeRuntime, ot as DevframeRpcSharedStates, p as ConnectionMetaWebsocket, pt as AgentManifest, q as DevframeScopedNodeRpc, r as DevframeDefinition, rt as DevframeViewHost, s as DevframeSetupInfo, st as DevframeHost, t as DevframeBrowserContext, tt as ScopedSharedStates, u as McpRouteOptions, ut as DevframeDiagnosticsHost, v as RpcFunctionsHost, vt as AgentToolInput, x as RpcStreamingChannel, xt as EventEmitter, y as RpcSharedStateGetOptions, yt as DevframeAgentHost } from "./devframe-BtVHhmwM.mjs";
|
|
2
2
|
import { C as RpcFunctionType, T as RpcReturnSchema, _ as RpcFunctionDefinition, g as RpcFunctionAgentOptions, i as RpcArgsSchema } from "./types-DZEx4ffs.mjs";
|
|
3
3
|
import { t as DevframeNodeRpcSessionMeta } from "./ws-server-Bc2wBHl-.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define.d.ts
|
|
6
6
|
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>;
|
|
7
7
|
//#endregion
|
|
8
|
-
export { type AgentHandle, type AgentManifest, type AgentResource, type AgentResourceContent, type AgentResourceInput, type AgentTool, type AgentToolInput, type ConnectionMeta, type ConnectionMetaWebsocket, type DevframeAgentHost, type DevframeAgentHostEvents, type DevframeBrowserContext, type DevframeCapabilities, type DevframeCliOptions, type DevframeDefineDiagnosticsOptions, type DevframeDefinition, type DevframeDeploymentKind, type DevframeDiagnosticsDefinition, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDuplicationStrategy, type DevframeHost, type DevframeNodeContext, type DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, type DevframeRpcClientFunctions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeRuntime, type DevframeScopedNodeContext, type DevframeScopedNodeRpc, type DevframeScopedStreamingHost, type DevframeSettings, type DevframeSettingsRegistry, type DevframeSettingsStore, type DevframeSetupInfo, type DevframeSpaOptions, type DevframeViewHost, type DevframeWsOptions, type EntriesToObject, type EventEmitter, type EventUnsubscribe, type EventsMap, type PartialWithoutId, type RpcBroadcastOptions, type RpcFunctionAgentOptions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type ScopedBroadcastOptions, type ScopedClientFunctions, type ScopedServerFunctions, type ScopedSharedStates, type SettingsForNamespace, type Thenable, type defineDevframe, defineRpcFunction };
|
|
8
|
+
export { type AgentHandle, type AgentManifest, type AgentResource, type AgentResourceContent, type AgentResourceInput, type AgentTool, type AgentToolInput, type ConnectionMeta, type ConnectionMetaWebsocket, type DevframeAgentHost, type DevframeAgentHostEvents, type DevframeBrowserContext, type DevframeCapabilities, type DevframeCliOptions, type DevframeDefineDiagnosticsOptions, type DevframeDefinition, type DevframeDeploymentKind, type DevframeDiagnosticsDefinition, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDuplicationStrategy, type DevframeHost, type DevframeNodeContext, type DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, type DevframeRpcClientFunctions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeRuntime, type DevframeScopedNodeContext, type DevframeScopedNodeRpc, type DevframeScopedStreamingHost, type DevframeSettings, type DevframeSettingsRegistry, type DevframeSettingsStore, type DevframeSetupInfo, type DevframeSpaOptions, type DevframeViewHost, type DevframeWsOptions, type EntriesToObject, type EventEmitter, type EventUnsubscribe, type EventsMap, type McpRouteOptions, type PartialWithoutId, type RpcBroadcastOptions, type RpcFunctionAgentOptions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type ScopedBroadcastOptions, type ScopedClientFunctions, type ScopedServerFunctions, type ScopedSharedStates, type SettingsForNamespace, type Thenable, type defineDevframe, defineRpcFunction };
|
package/dist/node/auth.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as verifyAuthToken, c as DevframeAuthHandler, i as refreshTempAuthCode, n as exchangeTempAuthCode, o as revokeActiveConnectionsForToken, r as getTempAuthCode, s as revokeAuthToken, t as buildOtpAuthUrl } from "../index-
|
|
1
|
+
import { a as verifyAuthToken, c as DevframeAuthHandler, i as refreshTempAuthCode, n as exchangeTempAuthCode, o as revokeActiveConnectionsForToken, r as getTempAuthCode, s as revokeAuthToken, t as buildOtpAuthUrl } from "../index-ByaMT1Xp.mjs";
|
|
2
2
|
export { DevframeAuthHandler, buildOtpAuthUrl, exchangeTempAuthCode, getTempAuthCode, refreshTempAuthCode, revokeActiveConnectionsForToken, revokeAuthToken, verifyAuthToken };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as DevframeDeploymentKind, r as DevframeDefinition } from "../devframe-
|
|
2
|
-
import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-
|
|
1
|
+
import { i as DevframeDeploymentKind, r as DevframeDefinition } from "../devframe-BtVHhmwM.mjs";
|
|
2
|
+
import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-UX9qUDK7.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/adapters/_shared.d.ts
|
|
5
5
|
/**
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as RpcStreamingHost, K as DevframeScopedNodeContext, R as SharedState, Y as DevframeSettings, _ as RpcBroadcastOptions, _t as AgentTool, at as DevframeRpcServerFunctions, b as RpcSharedStateHost, bt as DevframeAgentHostEvents, dt as DevframeDiagnosticsLogger, ft as AgentHandle, g as DevframeNodeRpcSession, gt as AgentResourceInput, h as DevframeNodeContext, ht as AgentResourceContent, it as DevframeRpcClientFunctions, mt as AgentResource, pt as AgentManifest, rt as DevframeViewHost$1, st as DevframeHost, ut as DevframeDiagnosticsHost$1, v as RpcFunctionsHost$1, vt as AgentToolInput, xt as EventEmitter, yt as DevframeAgentHost$1 } from "../devframe-BtVHhmwM.mjs";
|
|
2
2
|
import { v as RpcFunctionDefinitionAny } from "../types-DZEx4ffs.mjs";
|
|
3
3
|
import { S as RpcFunctionsCollectorBase } from "../index-Dy6GFDRf.mjs";
|
|
4
4
|
import { t as DevframeNodeRpcSessionMeta } from "../ws-server-Bc2wBHl-.mjs";
|
|
5
|
-
import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-
|
|
5
|
+
import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-Cfr1NrGQ.mjs";
|
|
6
6
|
import { BirpcGroup } from "birpc";
|
|
7
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8
8
|
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as createStorage } from "../storage-yrUZaiib.mjs";
|
|
2
2
|
import { a as DevframeViewHost, c as createRpcSharedStateServerHost, i as createNodeSettings, l as DevframeDiagnosticsHost, n as createHostContext, o as RpcFunctionsHost, r as createScopedNodeContext, s as createRpcStreamingServerHost, t as createH3DevframeHost, u as DevframeAgentHost } from "../host-h3-Dsf-Tgwx.mjs";
|
|
3
|
-
import { t as startHttpAndWs } from "../server-
|
|
3
|
+
import { t as startHttpAndWs } from "../server-CAsvfJNK.mjs";
|
|
4
4
|
import { isIP } from "node:net";
|
|
5
5
|
//#region src/node/utils.ts
|
|
6
6
|
function isObject(value) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as DevframeAuthHandler } from "../index-
|
|
1
|
+
import { h as DevframeNodeContext } from "../devframe-BtVHhmwM.mjs";
|
|
2
|
+
import { c as DevframeAuthHandler } from "../index-ByaMT1Xp.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/recipes/interactive-auth.d.ts
|
|
5
5
|
interface CreateInteractiveAuthOptions {
|
|
@@ -24,23 +24,27 @@ async function startHttpAndWs(options) {
|
|
|
24
24
|
if (authHandler) {
|
|
25
25
|
for (const fn of authHandler.rpcFunctions) if (!rpcHost.definitions.has(fn.name)) rpcHost.register(fn);
|
|
26
26
|
}
|
|
27
|
-
const rpcGroup = createRpcServer(rpcHost.functions, { rpcOptions: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
rpc
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
const rpcGroup = createRpcServer(rpcHost.functions, { rpcOptions: {
|
|
28
|
+
onFunctionError: options.rpcOptions?.onFunctionError,
|
|
29
|
+
onGeneralError: options.rpcOptions?.onGeneralError,
|
|
30
|
+
resolver(name, fn) {
|
|
31
|
+
const rpc = this;
|
|
32
|
+
if (!fn) return void 0;
|
|
33
|
+
return async function(...args) {
|
|
34
|
+
const meta = rpc.$meta;
|
|
35
|
+
if (effectiveAuthorize && !effectiveAuthorize(name, {
|
|
36
|
+
meta,
|
|
37
|
+
rpc
|
|
38
|
+
})) throw diagnostics.DF0036({ name });
|
|
39
|
+
return await asyncStorage.run({
|
|
40
|
+
rpc,
|
|
41
|
+
meta
|
|
42
|
+
}, async () => {
|
|
43
|
+
return (await fn).apply(this, args);
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
} });
|
|
44
48
|
const separateWsPort = ownsHttpServer && options.wsPort != null && options.wsPort !== port ? options.wsPort : void 0;
|
|
45
49
|
const { ws, close: closeWs } = attachWsRpcTransport(rpcGroup, {
|
|
46
50
|
...separateWsPort != null ? {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as DevframeAuthHandler } from "./index-
|
|
3
|
-
import { BirpcGroup } from "birpc";
|
|
1
|
+
import { at as DevframeRpcServerFunctions, f as ConnectionMeta, g as DevframeNodeRpcSession, h as DevframeNodeContext, it as DevframeRpcClientFunctions } from "./devframe-BtVHhmwM.mjs";
|
|
2
|
+
import { c as DevframeAuthHandler } from "./index-ByaMT1Xp.mjs";
|
|
3
|
+
import { BirpcGroup, EventOptions } from "birpc";
|
|
4
4
|
import { Peer } from "crossws";
|
|
5
5
|
import { NodeAdapter } from "crossws/adapters/node";
|
|
6
6
|
import { Server } from "node:http";
|
|
@@ -74,6 +74,17 @@ interface StartHttpAndWsOptions {
|
|
|
74
74
|
* observe — but not override — the connect-time trust decision.
|
|
75
75
|
*/
|
|
76
76
|
onPeerConnect?: (peer: Peer, session: DevframeNodeRpcSession) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Forwarded verbatim to the internal `createRpcServer`'s birpc
|
|
79
|
+
* `rpcOptions`, alongside the resolver `startHttpAndWs` installs for
|
|
80
|
+
* auth/session wiring. Use this so a host that owns its own structured
|
|
81
|
+
* diagnostics (e.g. a coded error reporter) keeps seeing RPC failures
|
|
82
|
+
* instead of them being silently absorbed by delegating to
|
|
83
|
+
* `startHttpAndWs`. Returning `true` from either callback suppresses
|
|
84
|
+
* birpc's own error response to the caller — see birpc's
|
|
85
|
+
* `EventOptions` for the full contract.
|
|
86
|
+
*/
|
|
87
|
+
rpcOptions?: Pick<EventOptions<DevframeRpcClientFunctions, DevframeRpcServerFunctions, false>, 'onFunctionError' | 'onGeneralError'>;
|
|
77
88
|
/**
|
|
78
89
|
* Extra origins to accept on the WS upgrade beyond the loopback default
|
|
79
90
|
* (`localhost`/`127.0.0.1`/`::1` and any `Origin`-less request from a
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ScopedClientFunctions, C as RpcStreamingHost, Ct as EventsMap, G as Thenable, J as DevframeScopedStreamingHost, K as DevframeScopedNodeContext, Q as ScopedBroadcastOptions, S as RpcStreamingChannelOptions, St as EventUnsubscribe, U as EntriesToObject, W as PartialWithoutId, X as DevframeSettingsRegistry, Y as DevframeSettings, Z as DevframeSettingsStore, _ as RpcBroadcastOptions, _t as AgentTool, a as DevframeDuplicationStrategy, at as DevframeRpcServerFunctions, b as RpcSharedStateHost, bt as DevframeAgentHostEvents, c as DevframeSpaOptions, ct as DevframeDefineDiagnosticsOptions, d as defineDevframe, dt as DevframeDiagnosticsLogger, et as ScopedServerFunctions, f as ConnectionMeta, ft as AgentHandle, g as DevframeNodeRpcSession, gt as AgentResourceInput, h as DevframeNodeContext, ht as AgentResourceContent, i as DevframeDeploymentKind, it as DevframeRpcClientFunctions, l as DevframeWsOptions, lt as DevframeDiagnosticsDefinition, m as DevframeCapabilities, mt as AgentResource, n as DevframeCliOptions, nt as SettingsForNamespace, o as DevframeRuntime, ot as DevframeRpcSharedStates, p as ConnectionMetaWebsocket, pt as AgentManifest, q as DevframeScopedNodeRpc, r as DevframeDefinition, rt as DevframeViewHost, s as DevframeSetupInfo, st as DevframeHost, t as DevframeBrowserContext, tt as ScopedSharedStates, u as McpRouteOptions, ut as DevframeDiagnosticsHost, v as RpcFunctionsHost, vt as AgentToolInput, x as RpcStreamingChannel, xt as EventEmitter, y as RpcSharedStateGetOptions, yt as DevframeAgentHost } from "../devframe-BtVHhmwM.mjs";
|
|
2
2
|
import { g as RpcFunctionAgentOptions } from "../types-DZEx4ffs.mjs";
|
|
3
3
|
import { t as DevframeNodeRpcSessionMeta } from "../ws-server-Bc2wBHl-.mjs";
|
|
4
|
-
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, ConnectionMetaWebsocket, DevframeAgentHost, DevframeAgentHostEvents, DevframeBrowserContext, DevframeCapabilities, DevframeCliOptions, DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsDefinition, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, DevframeRpcServerFunctions, DevframeRpcSharedStates, DevframeRuntime, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, DevframeSpaOptions, DevframeViewHost, DevframeWsOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, PartialWithoutId, RpcBroadcastOptions, type RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, Thenable, defineDevframe };
|
|
4
|
+
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, ConnectionMetaWebsocket, DevframeAgentHost, DevframeAgentHostEvents, DevframeBrowserContext, DevframeCapabilities, DevframeCliOptions, DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsDefinition, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, DevframeRpcServerFunctions, DevframeRpcSharedStates, DevframeRuntime, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, DevframeSpaOptions, DevframeViewHost, DevframeWsOptions, EntriesToObject, EventEmitter, EventUnsubscribe, EventsMap, McpRouteOptions, PartialWithoutId, RpcBroadcastOptions, type RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, Thenable, defineDevframe };
|
package/dist/utils/events.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as
|
|
1
|
+
import { B as SharedStateOptions, F as ImmutableMap, H as createSharedState, I as ImmutableObject, L as ImmutableSet, N as Immutable, P as ImmutableArray, R as SharedState, V as SharedStatePatch, z as SharedStateEvents } from "../devframe-BtVHhmwM.mjs";
|
|
2
2
|
export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as StreamSinkEvents, D as StreamErrorPayload, E as CreateStreamSinkOptions, M as createStreamSink, O as StreamReader, T as CreateStreamReaderOptions, j as createStreamReader, k as StreamSink, w as BufferedChunk } from "../devframe-BtVHhmwM.mjs";
|
|
2
2
|
export { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink };
|