devframe 1.3.2 → 1.3.5
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-CnKu5myY.d.mts → _shared-BxeuukaL.d.mts} +2 -2
- package/dist/{_shared-BGb9aDxr.mjs → _shared-CtXCQFTV.mjs} +1 -1
- package/dist/adapters/build.d.mts +1 -1
- package/dist/adapters/cac.d.mts +1 -1
- package/dist/adapters/cac.mjs +2 -2
- package/dist/adapters/dev.d.mts +4 -4
- package/dist/adapters/dev.mjs +2 -2
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/initiate.d.mts +4 -4
- package/dist/adapters/initiate.mjs +1 -1
- package/dist/adapters/mcp.d.mts +2 -2
- package/dist/{agentic-CCstJ5yv.d.mts → agentic-DVgUzwhV.d.mts} +1 -1
- package/dist/client/index.d.mts +5 -5
- package/dist/client/index.mjs +1 -1
- package/dist/{context-CsdPs3po.d.mts → context-B-AARy_U.d.mts} +1 -1
- package/dist/{dev-DaHYh5YK.mjs → dev-DF1pEq0n.mjs} +2 -2
- package/dist/{dist-DJydMELP.mjs → dist-CZ-TySHD.mjs} +1 -2
- package/dist/in-page-channel/index.d.mts +3 -2
- package/dist/in-page-channel/index.mjs +1 -1
- package/dist/{context-WxTq6kqb.d.mts → index-BhUqJUHG.d.mts} +1404 -1404
- package/dist/index.d.mts +5 -4
- package/dist/{instance-registry-CmZfF5u3.mjs → instance-registry-DwmnWyCK.mjs} +1 -1
- package/dist/{instance-shell-Dk2SejFT.mjs → instance-shell-C0yMifrP.mjs} +5 -5
- package/dist/{instance-shell-Bujp0BhE.d.mts → instance-shell-DTk514M9.d.mts} +4 -4
- package/dist/{interactive-auth-BURwIAvE.mjs → interactive-auth-CZ3CPfEs.mjs} +1 -1
- package/dist/internal/index.d.mts +7 -7
- package/dist/internal/index.mjs +4 -4
- package/dist/{mcp-content-CQQBt2An.d.mts → mcp-content-0a0mpCL5.d.mts} +1 -1
- package/dist/node/auth.d.mts +84 -3
- package/dist/node/auth.mjs +1 -1
- package/dist/node/hub-internals.d.mts +11 -2
- package/dist/node/hub-internals.mjs +1 -1
- package/dist/node/index.d.mts +4 -2
- package/dist/recipes/interactive-auth.d.mts +2 -2
- package/dist/recipes/interactive-auth.mjs +1 -1
- package/dist/{rolldown-runtime-DYf_mQCB.mjs → rolldown-runtime-BVN1G_yT.mjs} +4 -4
- package/dist/rpc/dump.d.mts +1 -1
- package/dist/rpc/index.d.mts +121 -3
- package/dist/rpc/transports/sse-client.d.mts +34 -2
- package/dist/rpc/transports/sse-server.d.mts +2 -2
- package/dist/rpc/transports/ws-bun.d.mts +2 -2
- package/dist/rpc/transports/ws-client.d.mts +27 -2
- package/dist/rpc/transports/ws-deno.d.mts +2 -2
- package/dist/rpc/transports/ws-server.d.mts +150 -3
- package/dist/{rpc-core-CDUizUQB.mjs → rpc-core-BmDHiDR6.mjs} +1 -1
- package/dist/{rpc-core-CFwyV10r.d.mts → rpc-core-CblgPYJ_.d.mts} +3 -3
- package/dist/{shared-state-COV7NCbd.mjs → shared-state-DiAsLHP8.mjs} +3 -2
- package/dist/{state-B_yjfeqo.mjs → state-TdDWqiG-.mjs} +2 -1
- package/dist/types/index.d.mts +3 -3
- package/dist/{types-844OBepb.d.mts → types-KZOyhez5.d.mts} +1 -0
- package/dist/utils/debounce.d.mts +6 -0
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/get-port.mjs +1 -1
- package/dist/utils/launch-editor.mjs +1 -1
- package/dist/utils/nostics.d.mts +40 -2
- package/dist/utils/origin.d.mts +55 -2
- package/dist/utils/serve-static.d.mts +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/package.json +6 -6
- package/dist/index-D0qrBkhO.d.mts +0 -121
- package/dist/index-HMJPlexc.d.mts +0 -84
- package/dist/nostics-Dgwh7ytT.d.mts +0 -40
- package/dist/origin-D5i7K_Zb.d.mts +0 -56
- package/dist/sse-client-B2PrSz-H.d.mts +0 -35
- package/dist/ws-client-lqOeANcn.d.mts +0 -28
- package/dist/ws-server-CYHkeyA-.d.mts +0 -150
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { C as RpcFunctionType, T as RpcReturnSchema, h as RpcFunctionDefinition, m as RpcFunctionAgentOptions, n as RpcArgsSchema } from "./types-
|
|
2
|
-
import { n as withMcpContent } from "./mcp-content-
|
|
1
|
+
import { C as RpcFunctionType, T as RpcReturnSchema, h as RpcFunctionDefinition, m as RpcFunctionAgentOptions, n as RpcArgsSchema } from "./types-KZOyhez5.mjs";
|
|
2
|
+
import { n as withMcpContent } from "./mcp-content-0a0mpCL5.mjs";
|
|
3
|
+
import "./rpc/index.mjs";
|
|
3
4
|
import { a as DevframeWsPeer, i as DevframeRpcTransportKind, n as DevframeRpcConnection, r as DevframeRpcConnectionRequest, t as DevframeNodeRpcSessionMeta } from "./session-Y9R6tqg4.mjs";
|
|
5
|
+
import { DevframeDefineDiagnosticsOptions } from "./utils/nostics.mjs";
|
|
4
6
|
import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "./remote-assets-5AQMHZnV.mjs";
|
|
5
|
-
import { i as
|
|
6
|
-
import { $ as DevframeServiceOf, $t as AgentToolProviderHandle, At as McpFetchHandler, B as DevframeSetupInfo, Ct as DevframeStorageScope, Dt as CreateMcpServerOptions, Et as CreateMcpFetchHandlerOptions, F as DevframeDefinition, Ft as McpResourceTemplate, G as McpAuthorization, Gt as AgentHandle, H as DevframeSnapshotRpcInputs, I as DevframeDeploymentKind, It as McpResourceTemplateContent, J as DevframeServiceDefinition, Jt as AgentResourceContent, K as McpRouteOptions, Kt as AgentManifest, L as DevframeDockDefaults, Lt as McpResourceTemplateEntry, Mt as McpPromptArgument, Nt as McpPromptMessage, Ot as McpConnectionInfo, P as DevframeCliOptions, Pt as McpPromptResult, Q as DevframeServiceMeta, Qt as AgentToolProvider, R as DevframeDuplicationStrategy, Rt as McpResourcesChangedHook, St as DevframeHost, Tt as DevframeDiagnosticsLogger, U as DevframeSseOptions, V as DevframeSnapshotRpcEntry, W as DevframeWsOptions, X as DevframeServiceId, Xt as AgentTool, Y as DevframeServiceDescriptor, Yt as AgentResourceInput, Z as DevframeServiceInput, Zt as AgentToolInput, _t as DevframeViewHost, a as DevframeConnectionConfigsRegistry, at as DevframeScopedNodeContext, bt as DevframeRpcSharedStates, c as RpcBroadcastOptions, ct as DevframeSettings, d as RpcSharedStateHost, dt as ScopedBroadcastOptions, en as DevframeAgentHost, et as DevframeServiceScopeOf, f as RpcStreamingChannel, ft as ScopedClientFunctions, gt as SettingsForNamespace, ht as ScopedSharedStates, i as DevframeCapabilities, in as EventsMap, it as DevframeServicesState, jt as McpPrompt, kt as McpContentBlock, l as RpcFunctionsHost, lt as DevframeSettingsRegistry, m as RpcStreamingHost, mt as ScopedServerFunctions, n as ConnectionMetaSse, nn as EventEmitter, nt as DevframeServicesRegistry, o as DevframeNodeContext, ot as DevframeScopedNodeRpc, p as RpcStreamingChannelOptions, pt as ScopedRpcFn, q as McpSetting, qt as AgentResource, r as ConnectionMetaWebsocket, rn as EventUnsubscribe, rt as DevframeServicesScopeRegistry, s as DevframeNodeRpcSession, st as DevframeScopedStreamingHost, t as ConnectionMeta, tn as DevframeAgentHostEvents, tt as DevframeServicesHost, u as RpcSharedStateGetOptions, ut as DevframeSettingsStore, vt as DevframeRpcClientFunctions, wt as DevframeDiagnosticsHost, yt as DevframeRpcServerFunctions, z as DevframeRpcOptions, zt as McpServerHandle } from "./context-WxTq6kqb.mjs";
|
|
7
|
+
import { $ as DevframeServiceId, $t as AgentToolProviderHandle, B as DevframeNodeRpcSession, C as McpPromptResult, Ct as DevframeDiagnosticsHost, D as McpResourcesChangedHook, E as McpResourceTemplateEntry, F as ConnectionMetaSse, G as RpcStreamingChannel, Gt as AgentHandle, H as RpcFunctionsHost, I as ConnectionMetaWebsocket, J as DevframeRpcClientFunctions, Jt as AgentResourceContent, K as RpcStreamingChannelOptions, Kt as AgentManifest, L as DevframeCapabilities, O as McpServerHandle, P as ConnectionMeta, Q as DevframeServiceDescriptor, Qt as AgentToolProvider, R as DevframeConnectionConfigsRegistry, S as McpPromptMessage, St as DevframeStorageScope, T as McpResourceTemplateContent, U as RpcSharedStateGetOptions, V as RpcBroadcastOptions, W as RpcSharedStateHost, X as DevframeRpcSharedStates, Xt as AgentTool, Y as DevframeRpcServerFunctions, Yt as AgentResourceInput, Z as DevframeServiceDefinition, Zt as AgentToolInput, _ as McpConnectionInfo, _t as ScopedServerFunctions, a as DevframeDuplicationStrategy, at as DevframeServicesRegistry, b as McpPrompt, bt as DevframeViewHost, c as DevframeSnapshotRpcEntry, ct as DevframeScopedNodeContext, d as DevframeWsOptions, dt as DevframeSettings, en as DevframeAgentHost, et as DevframeServiceInput, f as McpAuthorization, ft as DevframeSettingsRegistry, g as CreateMcpServerOptions, gt as ScopedRpcFn, h as CreateMcpFetchHandlerOptions, ht as ScopedClientFunctions, i as DevframeDockDefaults, in as EventsMap, it as DevframeServicesHost, l as DevframeSnapshotRpcInputs, lt as DevframeScopedNodeRpc, m as McpSetting, mt as ScopedBroadcastOptions, n as DevframeDefinition, nn as EventEmitter, nt as DevframeServiceOf, o as DevframeRpcOptions, ot as DevframeServicesScopeRegistry, p as McpRouteOptions, pt as DevframeSettingsStore, q as RpcStreamingHost, qt as AgentResource, r as DevframeDeploymentKind, rn as EventUnsubscribe, rt as DevframeServiceScopeOf, s as DevframeSetupInfo, st as DevframeServicesState, t as DevframeCliOptions, tn as DevframeAgentHostEvents, tt as DevframeServiceMeta, u as DevframeSseOptions, ut as DevframeScopedStreamingHost, v as McpContentBlock, vt as ScopedSharedStates, w as McpResourceTemplate, wt as DevframeDiagnosticsLogger, x as McpPromptArgument, xt as DevframeHost, y as McpFetchHandler, yt as SettingsForNamespace, z as DevframeNodeContext } from "./index-BhUqJUHG.mjs";
|
|
7
8
|
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>;
|
|
8
9
|
/**
|
|
9
10
|
* Identity helper that types a devframe definition, the primary authoring
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
import { n as __exportAll } from "./rolldown-runtime-BVN1G_yT.mjs";
|
|
2
2
|
import { t as diagnostics } from "./diagnostics-DC1-WcvN.mjs";
|
|
3
3
|
import { join } from "pathe";
|
|
4
4
|
import { mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as validateOriginCandidate } from "./origin-Ck7mLbKU.mjs";
|
|
2
|
-
import { c as joinURL, d as withoutLeadingSlash, f as withoutTrailingSlash, u as withLeadingSlash } from "./_shared-
|
|
2
|
+
import { c as joinURL, d as withoutLeadingSlash, f as withoutTrailingSlash, u as withLeadingSlash } from "./_shared-CtXCQFTV.mjs";
|
|
3
3
|
import "./constants.mjs";
|
|
4
|
-
import { n as createInteractiveAuth } from "./interactive-auth-
|
|
4
|
+
import { n as createInteractiveAuth } from "./interactive-auth-CZ3CPfEs.mjs";
|
|
5
5
|
import { t as diagnostics } from "./diagnostics-DC1-WcvN.mjs";
|
|
6
6
|
import { t as getInternalContext } from "./context-BTxC4QrJ.mjs";
|
|
7
7
|
import { createServer } from "node:http";
|
|
@@ -359,7 +359,7 @@ function createInstanceShell(options) {
|
|
|
359
359
|
const origin = currentOrigin();
|
|
360
360
|
if (!cfg || registerPromise || !origin || !meta) return;
|
|
361
361
|
const resolvedMeta = meta;
|
|
362
|
-
registerPromise = import("./instance-registry-
|
|
362
|
+
registerPromise = import("./instance-registry-DwmnWyCK.mjs").then((n) => n.t).then(({ registerDevframeInstance }) => {
|
|
363
363
|
let port = 0;
|
|
364
364
|
try {
|
|
365
365
|
const url = new URL(origin);
|
|
@@ -458,7 +458,7 @@ function createInstanceShell(options) {
|
|
|
458
458
|
let resolvedAuth = false;
|
|
459
459
|
let corePromise;
|
|
460
460
|
function ensureCore() {
|
|
461
|
-
corePromise ??= import("./rpc-core-
|
|
461
|
+
corePromise ??= import("./rpc-core-BmDHiDR6.mjs").then((n) => n.n).then(({ createContextRpcServer }) => createContextRpcServer({
|
|
462
462
|
context: ctx,
|
|
463
463
|
auth: resolvedAuth,
|
|
464
464
|
onPeerConnect: options.onPeerConnect,
|
|
@@ -502,7 +502,7 @@ function createInstanceShell(options) {
|
|
|
502
502
|
return nativeRuntime ? bindNativeHttpAndWs(runtime, bindOptions) : bindHttpAndWs(bindOptions);
|
|
503
503
|
};
|
|
504
504
|
if (ws.port != null) return await start(ws.port);
|
|
505
|
-
const { getPort } = await import("./dist-
|
|
505
|
+
const { getPort } = await import("./dist-CZ-TySHD.mjs").then((n) => n.t);
|
|
506
506
|
let lastError;
|
|
507
507
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
508
508
|
const port = attempt === 0 && options.resolveSidecarPort ? await options.resolveSidecarPort(sidecarHost) : await getPort({
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { n as BirpcGroup } from "./index-BKu9BxcT.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { WsOriginRegistry } from "./rpc/transports/ws-server.mjs";
|
|
3
3
|
import { n as DevframeRpcConnection, t as DevframeNodeRpcSessionMeta } from "./session-Y9R6tqg4.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import { H3 } from "h3";
|
|
4
|
+
import { B as DevframeNodeRpcSession, J as DevframeRpcClientFunctions, P as ConnectionMeta, Y as DevframeRpcServerFunctions, d as DevframeWsOptions, k as DevframeAuthHandler, u as DevframeSseOptions, z as DevframeNodeContext } from "./index-BhUqJUHG.mjs";
|
|
5
|
+
import "./node/auth.mjs";
|
|
7
6
|
import { NodeAdapter } from "crossws/adapters/node";
|
|
8
7
|
import { Buffer } from "node:buffer";
|
|
9
8
|
import { IncomingMessage, Server, ServerResponse } from "node:http";
|
|
10
9
|
import { Duplex } from "node:stream";
|
|
10
|
+
import { H3 } from "h3";
|
|
11
11
|
/**
|
|
12
12
|
* One running devframe instance, as recorded in the instance registry.
|
|
13
13
|
* Records are self-describing JSON, so additive fields are safe.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as colors } from "./nostics-InlX4tmd.mjs";
|
|
2
2
|
import { isAnonymousRpcMethod } from "./constants.mjs";
|
|
3
|
-
import { a as getTempAuthCodeInfo, n as describeUA, o as refreshTempAuthCode, r as exchangeTempAuthCode, s as verifyAuthToken, t as buildOtpAuthUrl } from "./state-
|
|
3
|
+
import { a as getTempAuthCodeInfo, n as describeUA, o as refreshTempAuthCode, r as exchangeTempAuthCode, s as verifyAuthToken, t as buildOtpAuthUrl } from "./state-TdDWqiG-.mjs";
|
|
4
4
|
import { t as getInternalContext } from "./context-BTxC4QrJ.mjs";
|
|
5
5
|
import { n as defineRpcFunction } from "./define-C8h-fyD3.mjs";
|
|
6
6
|
// src/utils/simple-schema.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as resolveBasePath, i as normalizeBasePath, n as ResolvedMcpConfig, r as loadAutoMcpAdapter, s as resolveMcpConfig } from "../_shared-
|
|
2
|
-
import { t as getMcpContent } from "../mcp-content-
|
|
1
|
+
import { a as resolveBasePath, i as normalizeBasePath, n as ResolvedMcpConfig, r as loadAutoMcpAdapter, s as resolveMcpConfig } from "../_shared-BxeuukaL.mjs";
|
|
2
|
+
import { t as getMcpContent } from "../mcp-content-0a0mpCL5.mjs";
|
|
3
3
|
import { t as StandardSchemaV1 } from "../index-BIRF0E5l.mjs";
|
|
4
|
-
import { i as importAgenticMcp, n as MountMcpHttpOptions, r as MountedMcpHttp, t as AgenticMcpModule } from "../agentic-
|
|
5
|
-
import { $t as AgentToolProviderHandle, Gt as AgentHandle, Jt as AgentResourceContent, Kt as AgentManifest, Qt as AgentToolProvider,
|
|
4
|
+
import { i as importAgenticMcp, n as MountMcpHttpOptions, r as MountedMcpHttp, t as AgenticMcpModule } from "../agentic-DVgUzwhV.mjs";
|
|
5
|
+
import { $t as AgentToolProviderHandle, Gt as AgentHandle, Jt as AgentResourceContent, Kt as AgentManifest, Qt as AgentToolProvider, Tt as BrowserAgentClientInfo, Xt as AgentTool, Yt as AgentResourceInput, Zt as AgentToolInput, en as DevframeAgentHost$1, nn as EventEmitter, qt as AgentResource, tn as DevframeAgentHostEvents, xt as DevframeHost, z as DevframeNodeContext } from "../index-BhUqJUHG.mjs";
|
|
6
6
|
import { a as RemoteAssetsStore } from "../remote-assets-5AQMHZnV.mjs";
|
|
7
|
-
import { a as InstanceShellInit, c as StartedServer, d as samePath, f as DevframeInstanceRecord, g as registerDevframeInstance, h as probeDevframeOrigin, i as InstanceShellApi, l as createInstanceShell, m as listLiveDevframeInstances, n as InstanceRegisterConfig, o as InstanceShellInternals, p as DevframeInstanceRegistration, r as InstanceShell, s as InstanceWsTier, t as CreateInstanceShellOptions, u as resolveInstanceRegister } from "../instance-shell-
|
|
8
|
-
import { n as CreateContextRpcServerOptions, r as createContextRpcServer, t as ContextRpcServer } from "../rpc-core-
|
|
9
|
-
import { g as RpcFunctionDefinitionAny } from "../types-
|
|
7
|
+
import { a as InstanceShellInit, c as StartedServer, d as samePath, f as DevframeInstanceRecord, g as registerDevframeInstance, h as probeDevframeOrigin, i as InstanceShellApi, l as createInstanceShell, m as listLiveDevframeInstances, n as InstanceRegisterConfig, o as InstanceShellInternals, p as DevframeInstanceRegistration, r as InstanceShell, s as InstanceWsTier, t as CreateInstanceShellOptions, u as resolveInstanceRegister } from "../instance-shell-DTk514M9.mjs";
|
|
8
|
+
import { n as CreateContextRpcServerOptions, r as createContextRpcServer, t as ContextRpcServer } from "../rpc-core-CblgPYJ_.mjs";
|
|
9
|
+
import { g as RpcFunctionDefinitionAny } from "../types-KZOyhez5.mjs";
|
|
10
10
|
/**
|
|
11
11
|
* JSON-coercing serializer for MCP text payloads.
|
|
12
12
|
*
|
package/dist/internal/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as resolveMcpConfig, n as normalizeBasePath, r as resolveBasePath, s as importAgenticMcp, t as loadAutoMcpAdapter } from "../_shared-
|
|
1
|
+
import { a as resolveMcpConfig, n as normalizeBasePath, r as resolveBasePath, s as importAgenticMcp, t as loadAutoMcpAdapter } from "../_shared-CtXCQFTV.mjs";
|
|
2
2
|
import { t as getMcpContent } from "../mcp-content-CqU8yaF7.mjs";
|
|
3
3
|
import { t as Diagnostic } from "../nostics-InlX4tmd.mjs";
|
|
4
4
|
import { a as toolInputToCommandArgs, i as DevframeAgentHost, t as LIST_CLIENTS_TOOL } from "../client-agent-qNMgDUev.mjs";
|
|
5
5
|
import { t as diagnostics } from "../diagnostics-DC1-WcvN.mjs";
|
|
6
6
|
import { t as createH3DevframeHost } from "../host-h3-D1uj5EM8.mjs";
|
|
7
7
|
import { t as importRuntimeModule } from "../import-runtime-module-DsdqJ1gK.mjs";
|
|
8
|
-
import { i as registerDevframeInstance, n as listLiveDevframeInstances, r as probeDevframeOrigin } from "../instance-registry-
|
|
9
|
-
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, r as samePath, t as createInstanceShell } from "../instance-shell-
|
|
10
|
-
import { t as createContextRpcServer } from "../rpc-core-
|
|
8
|
+
import { i as registerDevframeInstance, n as listLiveDevframeInstances, r as probeDevframeOrigin } from "../instance-registry-DwmnWyCK.mjs";
|
|
9
|
+
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, r as samePath, t as createInstanceShell } from "../instance-shell-C0yMifrP.mjs";
|
|
10
|
+
import { t as createContextRpcServer } from "../rpc-core-BmDHiDR6.mjs";
|
|
11
11
|
import { n as peekRpcWireFrame, t as createRpcWireCodec } from "../wire-codec-BdngvzfH.mjs";
|
|
12
12
|
// src/agent/stringify.ts
|
|
13
13
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v as McpContentBlock } from "./index-BhUqJUHG.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* Attach MCP content blocks to a tool result, for example an image next to
|
|
4
4
|
* its text. The MCP adapter sends these blocks as the `content` of the
|
package/dist/node/auth.d.mts
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
-
import { Bt as DevframeAuthHandler } from "../
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { B as DevframeNodeRpcSession, Bt as SharedState, k as DevframeAuthHandler, z as DevframeNodeContext } from "../index-BhUqJUHG.mjs";
|
|
2
|
+
import { n as InternalAnonymousAuthStorage } from "../context-B-AARy_U.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Flip `isTrusted` to false on any live WS clients connected with `token`
|
|
5
|
+
* and broadcast the `auth:revoked` event so they can react.
|
|
6
|
+
*
|
|
7
|
+
* Shared between persisted-auth revocation and remote-dock token revocation.
|
|
8
|
+
*/
|
|
9
|
+
export declare function revokeActiveConnectionsForToken(context: DevframeNodeContext, token: string): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Revoke an auth token: remove from storage and notify all connected clients
|
|
12
|
+
* using this token that they are no longer trusted.
|
|
13
|
+
*/
|
|
14
|
+
export declare function revokeAuthToken(context: DevframeNodeContext, storage: SharedState<InternalAnonymousAuthStorage>, token: string): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Format a raw `navigator.userAgent` string into the short display label
|
|
17
|
+
* shown for a trusted device (e.g. "Chrome 120 | macOS 14 desktop").
|
|
18
|
+
*
|
|
19
|
+
* The client used to parse+format this itself, but that pulled
|
|
20
|
+
* `ua-parser-modern` into the browser bundle for a label nothing else on
|
|
21
|
+
* the client needs; the client now sends the raw string and parsing
|
|
22
|
+
* happens here, at the server ingress, keeping the persisted label format
|
|
23
|
+
* identical.
|
|
24
|
+
*/
|
|
25
|
+
export declare function describeUA(userAgent: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* The current one-time authentication code. Display this to the user (e.g. in
|
|
28
|
+
* the dev-server terminal) so they can type it into the browser to authenticate.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getTempAuthCode(): string;
|
|
31
|
+
/**
|
|
32
|
+
* The current code plus its expiry timestamp, for display (e.g. the auth
|
|
33
|
+
* banner). An already-expired code is rotated first, so the returned code is
|
|
34
|
+
* always redeemable for its remaining lifetime.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getTempAuthCodeInfo(): {
|
|
37
|
+
code: string;
|
|
38
|
+
expireAt: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Rotate the authentication code, resetting its expiry window and failed-attempt
|
|
42
|
+
* counter. Call this when a new authentication flow begins (e.g. when an
|
|
43
|
+
* untrusted client starts authenticating) so the displayed code is freshly
|
|
44
|
+
* valid for its full TTL.
|
|
45
|
+
*/
|
|
46
|
+
export declare function refreshTempAuthCode(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Build a "magic link" authentication URL that embeds a one-time code (OTP) in
|
|
49
|
+
* the URL **fragment**. Opening it authenticates the client without typing;
|
|
50
|
+
* print it on startup (devframe stays headless, so the host prints its own
|
|
51
|
+
* banner). Defaults to the current code; the link is subject to the same TTL.
|
|
52
|
+
*
|
|
53
|
+
* The code rides the fragment (`#devframe_otp=…`), not the query string, so it
|
|
54
|
+
* is never sent to the server, written to an access log, or leaked in a
|
|
55
|
+
* `Referer` header; the browser client reads it locally (see
|
|
56
|
+
* `consumeOtpFromUrl`). Any existing fragment parameters are preserved.
|
|
57
|
+
*/
|
|
58
|
+
export declare function buildOtpAuthUrl(baseUrl: string, code?: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Re-authenticate a connection that presents a previously-issued bearer token.
|
|
61
|
+
* Returns `true` and marks the session trusted when the token is known.
|
|
62
|
+
*
|
|
63
|
+
* Used by the `anonymous:devframe:auth` handler so a client that already
|
|
64
|
+
* authenticated (token persisted in the browser) is trusted on reconnect
|
|
65
|
+
* without entering the code again.
|
|
66
|
+
*/
|
|
67
|
+
export declare function verifyAuthToken(token: string, session: DevframeNodeRpcSession, storage: SharedState<InternalAnonymousAuthStorage>): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Exchange a one-time authentication code for a fresh, node-issued bearer token.
|
|
70
|
+
*
|
|
71
|
+
* On success this mints a high-entropy token, records it in the trusted store,
|
|
72
|
+
* marks the calling session trusted, rotates the code, and returns the token
|
|
73
|
+
* for the client to persist. Returns `null` on any failure.
|
|
74
|
+
*
|
|
75
|
+
* Because the code is short and human-typed, verification is hardened against
|
|
76
|
+
* brute force: it enforces a time-to-live, compares in constant time, and
|
|
77
|
+
* rotates the code after {@link TEMP_AUTH_MAX_ATTEMPTS} failed attempts so an
|
|
78
|
+
* attacker cannot keep guessing against the same code.
|
|
79
|
+
*/
|
|
80
|
+
export declare function exchangeTempAuthCode(code: string, session: DevframeNodeRpcSession, info: {
|
|
81
|
+
ua: string;
|
|
82
|
+
origin: string;
|
|
83
|
+
}, storage: SharedState<InternalAnonymousAuthStorage>): string | null;
|
|
84
|
+
export { DevframeAuthHandler };
|
package/dist/node/auth.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "../revoke-D6KA3vwr.mjs";
|
|
2
|
-
import { a as getTempAuthCodeInfo, i as getTempAuthCode, n as describeUA, o as refreshTempAuthCode, r as exchangeTempAuthCode, s as verifyAuthToken, t as buildOtpAuthUrl } from "../state-
|
|
2
|
+
import { a as getTempAuthCodeInfo, i as getTempAuthCode, n as describeUA, o as refreshTempAuthCode, r as exchangeTempAuthCode, s as verifyAuthToken, t as buildOtpAuthUrl } from "../state-TdDWqiG-.mjs";
|
|
3
3
|
export { buildOtpAuthUrl, describeUA, exchangeTempAuthCode, getTempAuthCode, getTempAuthCodeInfo, refreshTempAuthCode, revokeActiveConnectionsForToken, revokeAuthToken, verifyAuthToken };
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Public surface for first-party hub adapters (`@devframes/hub` and
|
|
3
|
+
* similar). Carries the primitives a hub-kit author needs to bridge a
|
|
4
|
+
* framework dev server into a hub context: base-path resolution and
|
|
5
|
+
* the remote-dock token bridge used by the hub's docks host.
|
|
6
|
+
*
|
|
7
|
+
* Stable across minor versions; treat additions or removals as breaking
|
|
8
|
+
* only across major versions.
|
|
9
|
+
*/
|
|
10
|
+
import { a as resolveBasePath, i as normalizeBasePath } from "../_shared-BxeuukaL.mjs";
|
|
11
|
+
import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-B-AARy_U.mjs";
|
|
3
12
|
export { type DevframeInternalContext, type InternalAnonymousAuthStorage, type RemoteTokenRecord, getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as normalizeBasePath, r as resolveBasePath } from "../_shared-
|
|
1
|
+
import { n as normalizeBasePath, r as resolveBasePath } from "../_shared-CtXCQFTV.mjs";
|
|
2
2
|
import { n as internalContextMap, t as getInternalContext } from "../context-BTxC4QrJ.mjs";
|
|
3
3
|
export { getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "../rpc/index.mjs";
|
|
2
|
+
import { g as RpcFunctionDefinitionAny } from "../types-KZOyhez5.mjs";
|
|
3
|
+
import { Bt as SharedState, H as RpcFunctionsHost, xt as DevframeHost, z as DevframeNodeContext } from "../index-BhUqJUHG.mjs";
|
|
4
|
+
import "../index-BKu9BxcT.mjs";
|
|
3
5
|
export interface CreateHostContextOptions {
|
|
4
6
|
cwd: string;
|
|
5
7
|
workspaceRoot?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as DevframeNodeRpcSession, k as DevframeAuthHandler, z as DevframeNodeContext } from "../index-BhUqJUHG.mjs";
|
|
2
2
|
import { ColorFn } from "../utils/colors.mjs";
|
|
3
|
-
import "../
|
|
3
|
+
import "../node/auth.mjs";
|
|
4
4
|
export interface CreateInteractiveAuthOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Static, pre-shared bearer tokens that are always trusted, for CI runs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as createAuthBanner, n as createInteractiveAuth } from "../interactive-auth-
|
|
1
|
+
export { t as createAuthBanner, n as createInteractiveAuth } from "../interactive-auth-CZ3CPfEs.mjs";
|
|
@@ -7,14 +7,14 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
10
|
-
var __exportAll = (all,
|
|
11
|
-
let target = {};
|
|
10
|
+
var __exportAll = (all, flags) => {
|
|
11
|
+
let target = Object.setPrototypeOf({}, null);
|
|
12
12
|
for (var name in all) __defProp(target, name, {
|
|
13
13
|
get: all[name],
|
|
14
14
|
enumerable: true
|
|
15
15
|
});
|
|
16
|
-
if (!
|
|
17
|
-
return target;
|
|
16
|
+
if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
+
return flags & 2 ? target : Object.preventExtensions(target);
|
|
18
18
|
};
|
|
19
19
|
var __copyProps = (to, from, except, desc) => {
|
|
20
20
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
package/dist/rpc/dump.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as BirpcReturn } from "../index-BKu9BxcT.mjs";
|
|
2
|
-
import { c as RpcDumpCollectionOptions, f as RpcDumpRecordError, g as RpcFunctionDefinitionAny, i as RpcDefinitionsToFunctions, p as RpcDumpStore, s as RpcDumpClientOptions } from "../types-
|
|
2
|
+
import { c as RpcDumpCollectionOptions, f as RpcDumpRecordError, g as RpcFunctionDefinitionAny, i as RpcDefinitionsToFunctions, p as RpcDumpStore, s as RpcDumpClientOptions } from "../types-KZOyhez5.mjs";
|
|
3
3
|
export declare function dumpFunctions<T extends readonly RpcFunctionDefinitionAny[]>(definitions: T, context?: any, options?: RpcDumpCollectionOptions): Promise<RpcDumpStore<RpcDefinitionsToFunctions<T>>>;
|
|
4
4
|
/**
|
|
5
5
|
* Creates a client that serves pre-computed results from a dump store.
|
package/dist/rpc/index.d.mts
CHANGED
|
@@ -1,4 +1,122 @@
|
|
|
1
1
|
import { i as BirpcReturn, t as BirpcFn } from "../index-BKu9BxcT.mjs";
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { C as RpcFunctionType, E as Thenable, S as RpcFunctionSetupResult, T as RpcReturnSchema, _ as RpcFunctionDefinitionAnyWithContext, a as RpcDefinitionsToFunctionsWithNamespace, b as RpcFunctionDefinitionWithSchemas, c as RpcDumpCollectionOptions, d as RpcDumpRecord, f as RpcDumpRecordError, g as RpcFunctionDefinitionAny, h as RpcFunctionDefinition, i as RpcDefinitionsToFunctions, l as RpcDumpDefinition, m as RpcFunctionAgentOptions, n as RpcArgsSchema, o as RpcDump, p as RpcDumpStore, r as RpcDefinitionsFilter, s as RpcDumpClientOptions, t as EntriesToObject, u as RpcDumpGetter, v as RpcFunctionDefinitionBase, w as RpcFunctionsCollector, x as RpcFunctionDefinitionWithoutSchemas, y as RpcFunctionDefinitionToFunction } from "../types-KZOyhez5.mjs";
|
|
3
|
+
export interface RpcCacheOptions {
|
|
4
|
+
functions: string[];
|
|
5
|
+
keySerializer?: (args: unknown[]) => string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @experimental API is expected to change.
|
|
9
|
+
*/
|
|
10
|
+
export declare class RpcCacheManager {
|
|
11
|
+
private cacheMap;
|
|
12
|
+
private options;
|
|
13
|
+
private keySerializer;
|
|
14
|
+
constructor(options: RpcCacheOptions);
|
|
15
|
+
updateOptions(options: Partial<RpcCacheOptions>): void;
|
|
16
|
+
cached<T>(m: string, a: unknown[]): T | undefined;
|
|
17
|
+
has(m: string, a: unknown[]): boolean;
|
|
18
|
+
apply(req: {
|
|
19
|
+
m: string;
|
|
20
|
+
a: unknown[];
|
|
21
|
+
}, res: unknown): void;
|
|
22
|
+
validate(m: string): boolean;
|
|
23
|
+
clear(fn?: string): void;
|
|
24
|
+
}
|
|
25
|
+
export declare class RpcFunctionsCollectorBase<LocalFunctions extends Record<string, any>, SetupContext> implements RpcFunctionsCollector<LocalFunctions, SetupContext> {
|
|
26
|
+
readonly context: SetupContext;
|
|
27
|
+
readonly definitions: Map<string, RpcFunctionDefinition<string, any, any, any, any, any, SetupContext>>;
|
|
28
|
+
readonly functions: LocalFunctions;
|
|
29
|
+
private readonly _onChanged;
|
|
30
|
+
constructor(context: SetupContext);
|
|
31
|
+
register(fnDef: RpcFunctionDefinition<string, any, any, any, any, any, SetupContext>, force?: boolean): void;
|
|
32
|
+
update(fn: RpcFunctionDefinition<string, any, any, any, any, any, SetupContext>, force?: boolean): void;
|
|
33
|
+
onChanged(fn: (id?: string) => void): () => void;
|
|
34
|
+
getHandler<T extends keyof LocalFunctions>(name: T): Promise<LocalFunctions[T]>;
|
|
35
|
+
getSchema<T extends keyof LocalFunctions>(name: T): {
|
|
36
|
+
args: RpcArgsSchema | undefined;
|
|
37
|
+
returns: RpcReturnSchema | undefined;
|
|
38
|
+
};
|
|
39
|
+
has(name: string): boolean;
|
|
40
|
+
get(name: string): RpcFunctionDefinition<string, any, any, any, any, any, SetupContext> | undefined;
|
|
41
|
+
list(): string[];
|
|
42
|
+
}
|
|
43
|
+
export declare function 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>): RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS>;
|
|
44
|
+
export declare function createDefineWrapperWithContext<CONTEXT>(): <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, CONTEXT>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, CONTEXT>;
|
|
45
|
+
export declare function getRpcResolvedSetupResult<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, CONTEXT = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, any, any, CONTEXT>, context: CONTEXT): Promise<RpcFunctionSetupResult<ARGS, RETURN>>;
|
|
46
|
+
export declare function getRpcHandler<NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, CONTEXT = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, any, any, CONTEXT>, context: CONTEXT): Promise<(...args: ARGS) => RETURN>;
|
|
47
|
+
/**
|
|
48
|
+
* Wire format used by the live RPC transports (WebSocket and SSE).
|
|
49
|
+
*
|
|
50
|
+
* - **JSON (default, unprefixed):** payload is plain JSON text. Used when
|
|
51
|
+
* the dispatched method is declared `jsonSerializable: true`. Encoded
|
|
52
|
+
* via {@link strictJsonStringify} (rejects non-JSON values), decoded
|
|
53
|
+
* via `JSON.parse`.
|
|
54
|
+
* - **Structured-clone (`s:` prefix):** payload is `s:` followed by
|
|
55
|
+
* `structured-clone-es` text. Used when the method is declared
|
|
56
|
+
* `jsonSerializable: false` (or omitted, the default). Round-trips
|
|
57
|
+
* `Map`, `Set`, `Date`, `BigInt`, cycles, and class instances.
|
|
58
|
+
*
|
|
59
|
+
* birpc envelopes always start with `{`, so a leading byte that is not
|
|
60
|
+
* `s` is unambiguously JSON. Each direction independently chooses its
|
|
61
|
+
* encoding from local definitions; request and response are not
|
|
62
|
+
* coupled by a mirror rule.
|
|
63
|
+
*/
|
|
64
|
+
export declare const STRUCTURED_CLONE_PREFIX = "s:";
|
|
65
|
+
/**
|
|
66
|
+
* `JSON.stringify` with a single-pass strict replacer.
|
|
67
|
+
*
|
|
68
|
+
* Throws `DF0020` synchronously when the value contains a type JSON
|
|
69
|
+
* cannot round-trip losslessly: `Map`, `Set`, `Date`, `BigInt`, class
|
|
70
|
+
* instances, or `undefined` inside an array (silently becomes `null`).
|
|
71
|
+
*
|
|
72
|
+
* Native pass-throughs (no extra work needed):
|
|
73
|
+
* - circular references: `JSON.stringify` raises `TypeError`.
|
|
74
|
+
* - `BigInt` at top level: caught here for a friendlier error path.
|
|
75
|
+
*
|
|
76
|
+
* Lenient cases (allowed without throwing):
|
|
77
|
+
* - `undefined` as an object property: legitimate optional field;
|
|
78
|
+
* JSON.stringify just omits it.
|
|
79
|
+
* - `undefined` at the root: legitimate "action returned nothing".
|
|
80
|
+
* - `Symbol` / `Function` values: semantically "drop me" in JSON.
|
|
81
|
+
*
|
|
82
|
+
* `fnName` is used only for the diagnostic message; pass the RPC
|
|
83
|
+
* function name when calling from a wire serializer / dump writer so
|
|
84
|
+
* the error points at the offending function.
|
|
85
|
+
*/
|
|
86
|
+
export declare function strictJsonStringify(value: unknown, fnName?: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* Validate positional arguments against their declared schemas. Only
|
|
89
|
+
* indices with a schema are checked; extra arguments pass through
|
|
90
|
+
* untouched. Throws `DF0038` on the first failing argument.
|
|
91
|
+
*
|
|
92
|
+
* Validation guards the payload without rewriting it: the original values
|
|
93
|
+
* are handed to the handler unchanged, so a schema that describes a subset
|
|
94
|
+
* of an object never silently strips the sender's extra fields (and any
|
|
95
|
+
* declared transforms stay a purely type-level concern).
|
|
96
|
+
*
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
export declare function validateRpcArgs(name: string, argsSchema: RpcArgsSchema | undefined, args: readonly unknown[]): Promise<unknown[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Validate a handler's resolved return value against its declared schema.
|
|
102
|
+
* Throws `DF0039` when the value fails the schema, otherwise returns the
|
|
103
|
+
* original value unchanged (guard-only, never rewriting the payload; see
|
|
104
|
+
* {@link validateRpcArgs}). Passes through when no return schema is set.
|
|
105
|
+
*
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
export declare function validateRpcReturn(name: string, returnSchema: RpcReturnSchema | undefined, value: unknown): Promise<unknown>;
|
|
109
|
+
/**
|
|
110
|
+
* Validates RPC function definitions.
|
|
111
|
+
* Action and event functions cannot have dumps (side effects should not be cached).
|
|
112
|
+
*
|
|
113
|
+
* @throws {Error} If an action or event function has a dump configuration
|
|
114
|
+
*/
|
|
115
|
+
export declare function validateDefinitions(definitions: readonly RpcFunctionDefinitionAny[]): void;
|
|
116
|
+
/**
|
|
117
|
+
* Validates a single RPC function definition.
|
|
118
|
+
*
|
|
119
|
+
* @throws {Error} If an action or event function has a dump configuration
|
|
120
|
+
*/
|
|
121
|
+
export declare function validateDefinition(definition: RpcFunctionDefinitionAny): void;
|
|
122
|
+
export { type BirpcFn, type BirpcReturn, EntriesToObject, RpcArgsSchema, RpcDefinitionsFilter, RpcDefinitionsToFunctions, RpcDefinitionsToFunctionsWithNamespace, RpcDump, RpcDumpClientOptions, RpcDumpCollectionOptions, RpcDumpDefinition, RpcDumpGetter, RpcDumpRecord, RpcDumpRecordError, RpcDumpStore, RpcFunctionAgentOptions, RpcFunctionDefinition, RpcFunctionDefinitionAny, RpcFunctionDefinitionAnyWithContext, RpcFunctionDefinitionBase, RpcFunctionDefinitionToFunction, RpcFunctionDefinitionWithSchemas, RpcFunctionDefinitionWithoutSchemas, RpcFunctionSetupResult, RpcFunctionType, RpcFunctionsCollector, RpcReturnSchema, Thenable };
|
|
@@ -1,2 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { a as ChannelOptions } from "../../index-BKu9BxcT.mjs";
|
|
2
|
+
import { g as RpcFunctionDefinitionAny } from "../../types-KZOyhez5.mjs";
|
|
3
|
+
export interface SseRpcChannelOptions {
|
|
4
|
+
/** Resolved `http(s)://` URL of the SSE endpoint. */
|
|
5
|
+
url: string;
|
|
6
|
+
onConnected?: () => void;
|
|
7
|
+
onError?: (e: Error) => void;
|
|
8
|
+
onDisconnected?: () => void;
|
|
9
|
+
authToken?: string;
|
|
10
|
+
/**
|
|
11
|
+
* RPC function definitions (or just the `jsonSerializable` flag per
|
|
12
|
+
* method) used to dispatch the per-call wire serializer, the same contract
|
|
13
|
+
* as the WS channel.
|
|
14
|
+
*/
|
|
15
|
+
definitions?: ReadonlyMap<string, Pick<RpcFunctionDefinitionAny, 'jsonSerializable'>>;
|
|
16
|
+
/** Fetch implementation. Default: `globalThis.fetch`. */
|
|
17
|
+
fetch?: typeof globalThis.fetch;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Build a birpc `ChannelOptions` object backed by an SSE stream (server →
|
|
21
|
+
* client) and HTTP `POST` (client → server): the WebSocket-free counterpart
|
|
22
|
+
* to `createWsRpcChannel`, wire-compatible with `attachSseRpcTransport`.
|
|
23
|
+
*
|
|
24
|
+
* The stream is consumed via `fetch` streaming (not `EventSource`), so it
|
|
25
|
+
* works in browsers and server runtimes alike. The server's first frame
|
|
26
|
+
* (`event: session`) carries the session id; every `POST` echoes it in the
|
|
27
|
+
* `x-birpc-session` header. A response to a client-initiated request comes
|
|
28
|
+
* back in the `POST`'s own body and is re-injected into the channel; a
|
|
29
|
+
* dropped stream terminates the channel; there is no reconnect, matching
|
|
30
|
+
* the WS channel's closed-is-done semantics.
|
|
31
|
+
*/
|
|
32
|
+
export declare function createSseRpcChannel(options: SseRpcChannelOptions): ChannelOptions & {
|
|
33
|
+
close: () => void;
|
|
34
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as BirpcGroup } from "../../index-BKu9BxcT.mjs";
|
|
2
|
-
import { g as RpcFunctionDefinitionAny } from "../../types-
|
|
2
|
+
import { g as RpcFunctionDefinitionAny } from "../../types-KZOyhez5.mjs";
|
|
3
3
|
import { n as DevframeRpcConnection, t as DevframeNodeRpcSessionMeta } from "../../session-Y9R6tqg4.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { WsOriginRegistry } from "./ws-server.mjs";
|
|
5
5
|
export interface SseRpcTransportOptions {
|
|
6
6
|
/**
|
|
7
7
|
* Same contract as `WsRpcTransportOptions.allowedOrigins`: extra origins
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ContextRpcServer } from "../../rpc-core-
|
|
2
|
-
import {
|
|
1
|
+
import { t as ContextRpcServer } from "../../rpc-core-CblgPYJ_.mjs";
|
|
2
|
+
import { WsOriginRegistry } from "./ws-server.mjs";
|
|
3
3
|
export interface AttachBunWsTransportOptions {
|
|
4
4
|
/** Same contract as `WsRpcTransportOptions.allowedOrigins`. */
|
|
5
5
|
allowedOrigins?: readonly string[] | WsOriginRegistry | false;
|
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { a as ChannelOptions } from "../../index-BKu9BxcT.mjs";
|
|
2
|
+
import { g as RpcFunctionDefinitionAny } from "../../types-KZOyhez5.mjs";
|
|
3
|
+
export interface WsRpcChannelOptions {
|
|
4
|
+
url: string;
|
|
5
|
+
onConnected?: (e: Event) => void;
|
|
6
|
+
onError?: (e: Error) => void;
|
|
7
|
+
onDisconnected?: (e: CloseEvent) => void;
|
|
8
|
+
authToken?: string;
|
|
9
|
+
/**
|
|
10
|
+
* RPC function definitions (or just the `jsonSerializable` flag per
|
|
11
|
+
* method) used to dispatch the per-call wire serializer. Pass an
|
|
12
|
+
* empty / partial map on clients that don't have the full registry;
|
|
13
|
+
* encoding falls back to structured-clone (the safer superset) and
|
|
14
|
+
* decoding still routes correctly via the wire prefix.
|
|
15
|
+
*/
|
|
16
|
+
definitions?: ReadonlyMap<string, Pick<RpcFunctionDefinitionAny, 'jsonSerializable'>>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Build a birpc `ChannelOptions` object backed by a browser `WebSocket`.
|
|
20
|
+
* Pass the result straight to `createRpcClient`'s `channel` option.
|
|
21
|
+
*
|
|
22
|
+
* Also returns `close()`, closing the underlying socket, mirroring the server transport's
|
|
23
|
+
* existing `WsRpcTransport.close()`. `birpc`'s own `ChannelOptions` has no teardown of its own.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createWsRpcChannel(options: WsRpcChannelOptions): ChannelOptions & {
|
|
26
|
+
close: () => void;
|
|
27
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ContextRpcServer } from "../../rpc-core-
|
|
2
|
-
import {
|
|
1
|
+
import { t as ContextRpcServer } from "../../rpc-core-CblgPYJ_.mjs";
|
|
2
|
+
import { WsOriginRegistry } from "./ws-server.mjs";
|
|
3
3
|
export interface AttachDenoWsTransportOptions {
|
|
4
4
|
/** Same contract as `WsRpcTransportOptions.allowedOrigins`. */
|
|
5
5
|
allowedOrigins?: readonly string[] | WsOriginRegistry | false;
|