devframe 0.7.0 → 0.7.3
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 -2
- package/dist/adapters/build.mjs +1 -1
- package/dist/adapters/cac.d.mts +1 -2
- package/dist/adapters/cac.mjs +1 -1
- package/dist/adapters/cli.d.mts +1 -2
- package/dist/adapters/cli.mjs +1 -1
- package/dist/adapters/dev.d.mts +2 -3
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +1 -2
- package/dist/adapters/mcp.d.mts +2 -1
- package/dist/adapters/mcp.mjs +1 -1
- package/dist/{build-server-0jWgMrz-.mjs → build-server-Bo0G5XcS.mjs} +10 -4
- package/dist/{cac-DCBSjlzl.mjs → cac-BFCgKymz.mjs} +1 -1
- package/dist/client/index.d.mts +4 -5
- package/dist/client/index.mjs +7 -2
- package/dist/{context-BsiCAEC4.d.mts → context-B1sekkgB.d.mts} +3 -3
- package/dist/{dev-YeAm6GL0.mjs → dev-Bs4oRVnI.mjs} +1 -1
- package/dist/{devframe-Dma0XG3U.d.mts → devframe-CnTVuGw9.d.mts} +26 -13
- package/dist/{dump-D09PZb7T.mjs → dump-CocOVBVz.mjs} +3 -1
- package/dist/{hash-PAfnyu2k.mjs → hash-KtDZYXDN.mjs} +5 -2
- package/dist/helpers/vite.d.mts +6 -4
- package/dist/helpers/vite.mjs +1 -1
- package/dist/{http-COX960WK.mjs → http-BirzlyE9.mjs} +1 -1
- package/dist/{index-DI_TMGjv.d.mts → index-DgsLFhZg.d.mts} +2 -3
- package/dist/{index-d40ZLcYw.d.mts → index-Dpsr-8dD.d.mts} +4 -4
- package/dist/{index-BAZpbgHu.d.mts → index-YDSJgsyG.d.mts} +1 -2
- package/dist/index.d.mts +4 -4
- package/dist/{launch-editor-DIzaS5EG.mjs → launch-editor-C_xuzLnF.mjs} +67 -16
- package/dist/node/auth.d.mts +1 -1
- package/dist/node/hub-internals.d.mts +2 -3
- package/dist/node/index.d.mts +5 -6
- package/dist/recipes/interactive-auth.d.mts +2 -3
- package/dist/recipes/interactive-auth.mjs +1 -0
- package/dist/recipes/open-helpers.d.mts +3 -2
- package/dist/recipes/open-helpers.mjs +1 -1
- package/dist/rpc/client.d.mts +0 -1
- package/dist/rpc/dump.d.mts +1 -1
- package/dist/rpc/dump.mjs +1 -1
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/index.mjs +1 -1
- package/dist/rpc/server.d.mts +0 -1
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/{server-BD-tKDVf.d.mts → server-4QH37sb-.d.mts} +2 -3
- package/dist/types/index.d.mts +3 -3
- package/dist/{types-oEqKqUC9.d.mts → types-CrzNxXKq.d.mts} +42 -23
- package/dist/utils/events.d.mts +1 -2
- package/dist/utils/hash.mjs +1 -1
- package/dist/utils/launch-editor.mjs +1 -1
- package/dist/utils/serve-static.d.mts +0 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/when.d.mts +1 -330
- package/dist/{ws-client-nBjpin71.d.mts → ws-client-DSXiI2h7.d.mts} +1 -2
- package/dist/{ws-server-BUgJpdX4.d.mts → ws-server-CceOy6He.d.mts} +1 -2
- package/package.json +4 -4
package/dist/node/index.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { St as EventEmitter, X as DevframeSettings, _ as DevframeNodeRpcSession, _t as AgentResourceInput, at as DevframeRpcClientFunctions, bt as DevframeAgentHost$1, ct as DevframeHost, dt as DevframeDiagnosticsHost$1, ft as DevframeDiagnosticsLogger, g as DevframeNodeContext, gt as AgentResourceContent, ht as AgentResource, it as DevframeViewHost$1, mt as AgentManifest, ot as DevframeRpcServerFunctions, pt as AgentHandle, q as DevframeScopedNodeContext, v as RpcBroadcastOptions, vt as AgentTool, w as RpcStreamingHost, x as RpcSharedStateHost, xt as DevframeAgentHostEvents, y as RpcFunctionsHost$1, yt as AgentToolInput, z as SharedState } from "../devframe-
|
|
2
|
-
import { v as RpcFunctionDefinitionAny } from "../types-
|
|
3
|
-
import { S as RpcFunctionsCollectorBase } from "../index-
|
|
4
|
-
import { t as DevframeNodeRpcSessionMeta } from "../ws-server-
|
|
5
|
-
import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-
|
|
1
|
+
import { St as EventEmitter, X as DevframeSettings, _ as DevframeNodeRpcSession, _t as AgentResourceInput, at as DevframeRpcClientFunctions, bt as DevframeAgentHost$1, ct as DevframeHost, dt as DevframeDiagnosticsHost$1, ft as DevframeDiagnosticsLogger, g as DevframeNodeContext, gt as AgentResourceContent, ht as AgentResource, it as DevframeViewHost$1, mt as AgentManifest, ot as DevframeRpcServerFunctions, pt as AgentHandle, q as DevframeScopedNodeContext, v as RpcBroadcastOptions, vt as AgentTool, w as RpcStreamingHost, x as RpcSharedStateHost, xt as DevframeAgentHostEvents, y as RpcFunctionsHost$1, yt as AgentToolInput, z as SharedState } from "../devframe-CnTVuGw9.mjs";
|
|
2
|
+
import { v as RpcFunctionDefinitionAny } from "../types-CrzNxXKq.mjs";
|
|
3
|
+
import { S as RpcFunctionsCollectorBase } from "../index-DgsLFhZg.mjs";
|
|
4
|
+
import { t as DevframeNodeRpcSessionMeta } from "../ws-server-CceOy6He.mjs";
|
|
5
|
+
import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-4QH37sb-.mjs";
|
|
6
6
|
import { BirpcGroup } from "birpc";
|
|
7
7
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8
|
-
|
|
9
8
|
//#region src/node/context.d.ts
|
|
10
9
|
interface CreateHostContextOptions {
|
|
11
10
|
cwd: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { g as DevframeNodeContext } from "../devframe-
|
|
2
|
-
import { c as DevframeAuthHandler } from "../index-
|
|
3
|
-
|
|
1
|
+
import { g as DevframeNodeContext } from "../devframe-CnTVuGw9.mjs";
|
|
2
|
+
import { c as DevframeAuthHandler } from "../index-Dpsr-8dD.mjs";
|
|
4
3
|
//#region src/recipes/interactive-auth.d.ts
|
|
5
4
|
interface CreateInteractiveAuthOptions {
|
|
6
5
|
/**
|
|
@@ -63,6 +63,7 @@ function createInteractiveAuth(context, options = {}) {
|
|
|
63
63
|
handler(params) {
|
|
64
64
|
const session = context.rpc.getCurrentRpcSession();
|
|
65
65
|
if (!session) return { isTrusted: false };
|
|
66
|
+
if (session.meta.isTrusted) return { isTrusted: true };
|
|
66
67
|
if (isStaticToken(params.authToken)) {
|
|
67
68
|
session.meta.clientAuthToken = params.authToken;
|
|
68
69
|
session.meta.isTrusted = true;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../devframe-CnTVuGw9.mjs";
|
|
2
|
+
import { E as Thenable, S as RpcFunctionSetupResult, c as RpcDump, g as RpcFunctionAgentOptions } from "../types-CrzNxXKq.mjs";
|
|
3
|
+
import "../index-DgsLFhZg.mjs";
|
|
2
4
|
import * as v from "valibot";
|
|
3
|
-
|
|
4
5
|
//#region src/recipes/open-helpers.d.ts
|
|
5
6
|
/**
|
|
6
7
|
* Prebuilt RPC action that opens a file in the user's configured editor.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as launchEditor } from "../launch-editor-
|
|
1
|
+
import { t as launchEditor } from "../launch-editor-C_xuzLnF.mjs";
|
|
2
2
|
import { n as defineRpcFunction } from "../define-BLWPsH6y.mjs";
|
|
3
3
|
import { t as open } from "../open-Deb5xmIT.mjs";
|
|
4
4
|
import * as v from "valibot";
|
package/dist/rpc/client.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BirpcOptions, BirpcReturn, ChannelOptions } from "birpc";
|
|
2
|
-
|
|
3
2
|
//#region src/rpc/client.d.ts
|
|
4
3
|
declare function createRpcClient<ServerFunctions extends object = Record<string, never>, ClientFunctions extends object = Record<string, never>>(functions: ClientFunctions, options: {
|
|
5
4
|
channel: ChannelOptions;
|
package/dist/rpc/dump.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getDefinitionsWithDumps, c as StaticRpcDumpManifest, d as StaticRpcDumpManifestValue, f as StaticRpcDumpSerialization, i as dumpFunctions, l as StaticRpcDumpManifestQueryEntry, n as serializeDumpError, o as StaticRpcDumpCollection, p as collectStaticRpcDump, r as createClientFromDump, s as StaticRpcDumpFile, t as reviveDumpError, u as StaticRpcDumpManifestStaticEntry } from "../index-
|
|
1
|
+
import { a as getDefinitionsWithDumps, c as StaticRpcDumpManifest, d as StaticRpcDumpManifestValue, f as StaticRpcDumpSerialization, i as dumpFunctions, l as StaticRpcDumpManifestQueryEntry, n as serializeDumpError, o as StaticRpcDumpCollection, p as collectStaticRpcDump, r as createClientFromDump, s as StaticRpcDumpFile, t as reviveDumpError, u as StaticRpcDumpManifestStaticEntry } from "../index-YDSJgsyG.mjs";
|
|
2
2
|
export { StaticRpcDumpCollection, StaticRpcDumpFile, StaticRpcDumpManifest, StaticRpcDumpManifestQueryEntry, StaticRpcDumpManifestStaticEntry, StaticRpcDumpManifestValue, StaticRpcDumpSerialization, collectStaticRpcDump, createClientFromDump, dumpFunctions, getDefinitionsWithDumps, reviveDumpError, serializeDumpError };
|
package/dist/rpc/dump.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as dumpFunctions, c as serializeDumpError, i as createClientFromDump, o as getDefinitionsWithDumps, s as reviveDumpError, t as collectStaticRpcDump } from "../dump-
|
|
1
|
+
import { a as dumpFunctions, c as serializeDumpError, i as createClientFromDump, o as getDefinitionsWithDumps, s as reviveDumpError, t as collectStaticRpcDump } from "../dump-CocOVBVz.mjs";
|
|
2
2
|
export { collectStaticRpcDump, createClientFromDump, dumpFunctions, getDefinitionsWithDumps, reviveDumpError, serializeDumpError };
|
package/dist/rpc/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as RpcFunctionType, E as Thenable, S as RpcFunctionSetupResult, T as RpcReturnSchema, _ as RpcFunctionDefinition, a as RpcDefinitionsFilter, b as RpcFunctionDefinitionBase, c as RpcDump, d as RpcDumpDefinition, f as RpcDumpGetter, g as RpcFunctionAgentOptions, h as RpcDumpStore, i as RpcArgsSchema, l as RpcDumpClientOptions, m as RpcDumpRecordError, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecord, r as EntriesToObject, s as RpcDefinitionsToFunctionsWithNamespace, t as BirpcFn, u as RpcDumpCollectionOptions, v as RpcFunctionDefinitionAny, w as RpcFunctionsCollector, x as RpcFunctionDefinitionToFunction, y as RpcFunctionDefinitionAnyWithContext } from "../types-
|
|
2
|
-
import { C as RpcCacheManager, S as RpcFunctionsCollectorBase, _ as strictJsonStringify, a as StaticRpcDumpManifestStaticEntry, b as createDefineWrapperWithContext, c as collectStaticRpcDump, d as getDefinitionsWithDumps, f as reviveDumpError, g as STRUCTURED_CLONE_PREFIX, h as validateDefinitions, i as StaticRpcDumpManifestQueryEntry, l as createClientFromDump, m as validateDefinition, n as StaticRpcDumpFile, o as StaticRpcDumpManifestValue, p as serializeDumpError, r as StaticRpcDumpManifest, s as StaticRpcDumpSerialization, t as StaticRpcDumpCollection, u as dumpFunctions, v as getRpcHandler, w as RpcCacheOptions, x as defineRpcFunction, y as getRpcResolvedSetupResult } from "../index-
|
|
1
|
+
import { C as RpcFunctionType, E as Thenable, S as RpcFunctionSetupResult, T as RpcReturnSchema, _ as RpcFunctionDefinition, a as RpcDefinitionsFilter, b as RpcFunctionDefinitionBase, c as RpcDump, d as RpcDumpDefinition, f as RpcDumpGetter, g as RpcFunctionAgentOptions, h as RpcDumpStore, i as RpcArgsSchema, l as RpcDumpClientOptions, m as RpcDumpRecordError, n as BirpcReturn, o as RpcDefinitionsToFunctions, p as RpcDumpRecord, r as EntriesToObject, s as RpcDefinitionsToFunctionsWithNamespace, t as BirpcFn, u as RpcDumpCollectionOptions, v as RpcFunctionDefinitionAny, w as RpcFunctionsCollector, x as RpcFunctionDefinitionToFunction, y as RpcFunctionDefinitionAnyWithContext } from "../types-CrzNxXKq.mjs";
|
|
2
|
+
import { C as RpcCacheManager, S as RpcFunctionsCollectorBase, _ as strictJsonStringify, a as StaticRpcDumpManifestStaticEntry, b as createDefineWrapperWithContext, c as collectStaticRpcDump, d as getDefinitionsWithDumps, f as reviveDumpError, g as STRUCTURED_CLONE_PREFIX, h as validateDefinitions, i as StaticRpcDumpManifestQueryEntry, l as createClientFromDump, m as validateDefinition, n as StaticRpcDumpFile, o as StaticRpcDumpManifestValue, p as serializeDumpError, r as StaticRpcDumpManifest, s as StaticRpcDumpSerialization, t as StaticRpcDumpCollection, u as dumpFunctions, v as getRpcHandler, w as RpcCacheOptions, x as defineRpcFunction, y as getRpcResolvedSetupResult } from "../index-DgsLFhZg.mjs";
|
|
3
3
|
export { type BirpcFn, type BirpcReturn, EntriesToObject, RpcArgsSchema, RpcCacheManager, RpcCacheOptions, RpcDefinitionsFilter, RpcDefinitionsToFunctions, RpcDefinitionsToFunctionsWithNamespace, RpcDump, RpcDumpClientOptions, RpcDumpCollectionOptions, RpcDumpDefinition, RpcDumpGetter, RpcDumpRecord, RpcDumpRecordError, RpcDumpStore, RpcFunctionAgentOptions, RpcFunctionDefinition, RpcFunctionDefinitionAny, RpcFunctionDefinitionAnyWithContext, RpcFunctionDefinitionBase, RpcFunctionDefinitionToFunction, RpcFunctionSetupResult, RpcFunctionType, RpcFunctionsCollector, RpcFunctionsCollectorBase, RpcReturnSchema, STRUCTURED_CLONE_PREFIX, StaticRpcDumpCollection, StaticRpcDumpFile, StaticRpcDumpManifest, StaticRpcDumpManifestQueryEntry, StaticRpcDumpManifestStaticEntry, StaticRpcDumpManifestValue, StaticRpcDumpSerialization, Thenable, collectStaticRpcDump, createClientFromDump, createDefineWrapperWithContext, defineRpcFunction, dumpFunctions, getDefinitionsWithDumps, getRpcHandler, getRpcResolvedSetupResult, reviveDumpError, serializeDumpError, strictJsonStringify, validateDefinition, validateDefinitions };
|
package/dist/rpc/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as dumpFunctions$1, c as serializeDumpError$1, d as hash, i as createClientFromDump$1, l as validateDefinition, n as getRpcHandler, o as getDefinitionsWithDumps$1, r as getRpcResolvedSetupResult, s as reviveDumpError$1, t as collectStaticRpcDump$1, u as validateDefinitions } from "../dump-
|
|
1
|
+
import { a as dumpFunctions$1, c as serializeDumpError$1, d as hash, i as createClientFromDump$1, l as validateDefinition, n as getRpcHandler, o as getDefinitionsWithDumps$1, r as getRpcResolvedSetupResult, s as reviveDumpError$1, t as collectStaticRpcDump$1, u as validateDefinitions } from "../dump-CocOVBVz.mjs";
|
|
2
2
|
import { t as diagnostics } from "../diagnostics-BXwBQmoN.mjs";
|
|
3
3
|
import { n as defineRpcFunction, t as createDefineWrapperWithContext } from "../define-BLWPsH6y.mjs";
|
|
4
4
|
import { n as strictJsonStringify, t as STRUCTURED_CLONE_PREFIX } from "../serialization-DpLXCy13.mjs";
|
package/dist/rpc/server.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BirpcGroup, EventOptions } from "birpc";
|
|
2
|
-
|
|
3
2
|
//#region src/rpc/server.d.ts
|
|
4
3
|
declare function createRpcServer<ClientFunctions extends object = Record<string, never>, ServerFunctions extends object = Record<string, never>>(functions: ServerFunctions, options?: {
|
|
5
4
|
rpcOptions?: EventOptions<ClientFunctions, ServerFunctions, false>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createWsRpcChannel, t as WsRpcChannelOptions } from "../../ws-client-
|
|
1
|
+
import { n as createWsRpcChannel, t as WsRpcChannelOptions } from "../../ws-client-DSXiI2h7.mjs";
|
|
2
2
|
export { WsRpcChannelOptions, createWsRpcChannel };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as isAllowedOrigin, i as attachWsRpcTransport, n as WsRpcTransport, o as isLoopbackHostname, r as WsRpcTransportOptions, t as DevframeNodeRpcSessionMeta } from "../../ws-server-
|
|
1
|
+
import { a as isAllowedOrigin, i as attachWsRpcTransport, n as WsRpcTransport, o as isLoopbackHostname, r as WsRpcTransportOptions, t as DevframeNodeRpcSessionMeta } from "../../ws-server-CceOy6He.mjs";
|
|
2
2
|
export { DevframeNodeRpcSessionMeta, WsRpcTransport, WsRpcTransportOptions, attachWsRpcTransport, isAllowedOrigin, isLoopbackHostname };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { _ as DevframeNodeRpcSession, at as DevframeRpcClientFunctions, g as DevframeNodeContext, ot as DevframeRpcServerFunctions, p as ConnectionMeta } from "./devframe-
|
|
2
|
-
import { c as DevframeAuthHandler } from "./index-
|
|
1
|
+
import { _ as DevframeNodeRpcSession, at as DevframeRpcClientFunctions, g as DevframeNodeContext, ot as DevframeRpcServerFunctions, p as ConnectionMeta } from "./devframe-CnTVuGw9.mjs";
|
|
2
|
+
import { c as DevframeAuthHandler } from "./index-Dpsr-8dD.mjs";
|
|
3
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";
|
|
7
7
|
import { H3 } from "h3";
|
|
8
|
-
|
|
9
8
|
//#region src/node/server.d.ts
|
|
10
9
|
interface StartHttpAndWsOptions {
|
|
11
10
|
context: DevframeNodeContext;
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as ScopedBroadcastOptions, C as RpcStreamingChannelOptions, Ct as EventUnsubscribe, G as PartialWithoutId, J as DevframeScopedNodeRpc, K as Thenable, Q as DevframeSettingsStore, S as RpcStreamingChannel, St as EventEmitter, W as EntriesToObject, X as DevframeSettings, Y as DevframeScopedStreamingHost, Z as DevframeSettingsRegistry, _ as DevframeNodeRpcSession, _t as AgentResourceInput, a as DevframeDockDefaults, at as DevframeRpcClientFunctions, b as RpcSharedStateGetOptions, bt as DevframeAgentHost, c as DevframeSetupInfo, ct as DevframeHost, d as McpRouteOptions, dt as DevframeDiagnosticsHost, et as ScopedClientFunctions, f as defineDevframe, ft as DevframeDiagnosticsLogger, g as DevframeNodeContext, gt as AgentResourceContent, h as DevframeCapabilities, ht as AgentResource, i as DevframeDeploymentKind, it as DevframeViewHost, l as DevframeSpaOptions, lt as DevframeDefineDiagnosticsOptions, m as ConnectionMetaWebsocket, mt as AgentManifest, n as DevframeCliOptions, nt as ScopedSharedStates, o as DevframeDuplicationStrategy, ot as DevframeRpcServerFunctions, p as ConnectionMeta, pt as AgentHandle, q as DevframeScopedNodeContext, r as DevframeDefinition, rt as SettingsForNamespace, s as DevframeRuntime, st as DevframeRpcSharedStates, t as DevframeBrowserContext, tt as ScopedServerFunctions, u as DevframeWsOptions, ut as DevframeDiagnosticsDefinition, v as RpcBroadcastOptions, vt as AgentTool, w as RpcStreamingHost, wt as EventsMap, x as RpcSharedStateHost, xt as DevframeAgentHostEvents, y as RpcFunctionsHost, yt as AgentToolInput } from "../devframe-
|
|
2
|
-
import { g as RpcFunctionAgentOptions } from "../types-
|
|
3
|
-
import { t as DevframeNodeRpcSessionMeta } from "../ws-server-
|
|
1
|
+
import { $ as ScopedBroadcastOptions, C as RpcStreamingChannelOptions, Ct as EventUnsubscribe, G as PartialWithoutId, J as DevframeScopedNodeRpc, K as Thenable, Q as DevframeSettingsStore, S as RpcStreamingChannel, St as EventEmitter, W as EntriesToObject, X as DevframeSettings, Y as DevframeScopedStreamingHost, Z as DevframeSettingsRegistry, _ as DevframeNodeRpcSession, _t as AgentResourceInput, a as DevframeDockDefaults, at as DevframeRpcClientFunctions, b as RpcSharedStateGetOptions, bt as DevframeAgentHost, c as DevframeSetupInfo, ct as DevframeHost, d as McpRouteOptions, dt as DevframeDiagnosticsHost, et as ScopedClientFunctions, f as defineDevframe, ft as DevframeDiagnosticsLogger, g as DevframeNodeContext, gt as AgentResourceContent, h as DevframeCapabilities, ht as AgentResource, i as DevframeDeploymentKind, it as DevframeViewHost, l as DevframeSpaOptions, lt as DevframeDefineDiagnosticsOptions, m as ConnectionMetaWebsocket, mt as AgentManifest, n as DevframeCliOptions, nt as ScopedSharedStates, o as DevframeDuplicationStrategy, ot as DevframeRpcServerFunctions, p as ConnectionMeta, pt as AgentHandle, q as DevframeScopedNodeContext, r as DevframeDefinition, rt as SettingsForNamespace, s as DevframeRuntime, st as DevframeRpcSharedStates, t as DevframeBrowserContext, tt as ScopedServerFunctions, u as DevframeWsOptions, ut as DevframeDiagnosticsDefinition, v as RpcBroadcastOptions, vt as AgentTool, w as RpcStreamingHost, wt as EventsMap, x as RpcSharedStateHost, xt as DevframeAgentHostEvents, y as RpcFunctionsHost, yt as AgentToolInput } from "../devframe-CnTVuGw9.mjs";
|
|
2
|
+
import { g as RpcFunctionAgentOptions } from "../types-CrzNxXKq.mjs";
|
|
3
|
+
import { t as DevframeNodeRpcSessionMeta } from "../ws-server-CceOy6He.mjs";
|
|
4
4
|
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, ConnectionMeta, ConnectionMetaWebsocket, DevframeAgentHost, DevframeAgentHostEvents, DevframeBrowserContext, DevframeCapabilities, DevframeCliOptions, DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsDefinition, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockDefaults, 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 };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GenericSchema, InferInput } from "valibot";
|
|
2
2
|
import { BirpcFn, BirpcReturn as BirpcReturn$1 } from "birpc";
|
|
3
|
-
|
|
4
3
|
//#region src/rpc/utils.d.ts
|
|
5
4
|
/** Infers TypeScript tuple type from Valibot schema array */
|
|
6
5
|
type InferArgsType<S extends RpcArgsSchema | undefined> = S extends readonly [] ? [] : S extends readonly [infer H, ...infer T] ? H extends GenericSchema ? T extends readonly GenericSchema[] ? [InferInput<H>, ...InferArgsType<T>] : never : never : never;
|
|
@@ -9,7 +8,7 @@ type InferReturnType<S extends RpcReturnSchema | undefined> = S extends RpcRetur
|
|
|
9
8
|
//#endregion
|
|
10
9
|
//#region src/rpc/types.d.ts
|
|
11
10
|
type Thenable<T> = T | Promise<T>;
|
|
12
|
-
type EntriesToObject<T extends readonly [string, any][]> = { [K in T[number] as K[0]]: K[1] };
|
|
11
|
+
type EntriesToObject<T extends readonly [string, any][]> = { [K in T[number] as K[0]]: K[1]; };
|
|
13
12
|
/**
|
|
14
13
|
* Type of the RPC function,
|
|
15
14
|
* - static: A function that returns a static data, no arguments (can be cached and dumped)
|
|
@@ -201,10 +200,15 @@ interface RpcDumpCollectionOptions {
|
|
|
201
200
|
* RPC function definition with optional dump support.
|
|
202
201
|
*/
|
|
203
202
|
type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = 'query', ARGS extends any[] = [], RETURN = void, AS extends RpcArgsSchema | undefined = undefined, RS extends RpcReturnSchema | undefined = undefined, CONTEXT = undefined> = [AS, RS] extends [undefined, undefined] ? {
|
|
204
|
-
/** Function name (unique identifier) */
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
203
|
+
/** Function name (unique identifier) */
|
|
204
|
+
name: NAME;
|
|
205
|
+
/** Function type (static, action, event, or query) */
|
|
206
|
+
type?: TYPE;
|
|
207
|
+
/** Whether the function results should be cached */
|
|
208
|
+
cacheable?: boolean;
|
|
209
|
+
/** Valibot schema array for validating function arguments */
|
|
210
|
+
args?: AS;
|
|
211
|
+
/** Valibot schema for validating function return value */
|
|
208
212
|
returns?: RS;
|
|
209
213
|
/**
|
|
210
214
|
* Declares whether this function's args/return are JSON-serializable
|
|
@@ -222,9 +226,12 @@ type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = '
|
|
|
222
226
|
*
|
|
223
227
|
* @experimental
|
|
224
228
|
*/
|
|
225
|
-
agent?: RpcFunctionAgentOptions;
|
|
226
|
-
|
|
227
|
-
|
|
229
|
+
agent?: RpcFunctionAgentOptions;
|
|
230
|
+
/** Setup function called with context to initialize handler and dump */
|
|
231
|
+
setup?: (context: CONTEXT) => Thenable<RpcFunctionSetupResult<ARGS, RETURN>>;
|
|
232
|
+
/** Function implementation (required if setup doesn't provide one) */
|
|
233
|
+
handler?: (...args: ARGS) => RETURN;
|
|
234
|
+
/** Dump definition (setup dump takes priority) */
|
|
228
235
|
dump?: RpcDump<ARGS, RETURN, CONTEXT>;
|
|
229
236
|
/**
|
|
230
237
|
* Sugar for "query in dev, single baked snapshot in build": when
|
|
@@ -234,14 +241,21 @@ type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = '
|
|
|
234
241
|
* to the same snapshot. Only valid on `query` (or untyped)
|
|
235
242
|
* functions — `static` already has equivalent default behavior.
|
|
236
243
|
*/
|
|
237
|
-
snapshot?: boolean;
|
|
238
|
-
|
|
244
|
+
snapshot?: boolean;
|
|
245
|
+
/** Per-context setup-result cache, populated by `getRpcResolvedSetupResult`. @internal */
|
|
246
|
+
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<ARGS, RETURN>>>;
|
|
247
|
+
/** Single-slot fallback for primitive contexts. @internal */
|
|
239
248
|
__promise?: Thenable<RpcFunctionSetupResult<ARGS, RETURN>>;
|
|
240
249
|
} : {
|
|
241
|
-
/** Function name (unique identifier) */
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
250
|
+
/** Function name (unique identifier) */
|
|
251
|
+
name: NAME;
|
|
252
|
+
/** Function type (static, action, event, or query) */
|
|
253
|
+
type?: TYPE;
|
|
254
|
+
/** Whether the function results should be cached */
|
|
255
|
+
cacheable?: boolean;
|
|
256
|
+
/** Valibot schema array for validating function arguments */
|
|
257
|
+
args: AS;
|
|
258
|
+
/** Valibot schema for validating function return value */
|
|
245
259
|
returns: RS;
|
|
246
260
|
/**
|
|
247
261
|
* Declares whether this function's args/return are JSON-serializable
|
|
@@ -259,9 +273,12 @@ type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = '
|
|
|
259
273
|
*
|
|
260
274
|
* @experimental
|
|
261
275
|
*/
|
|
262
|
-
agent?: RpcFunctionAgentOptions;
|
|
263
|
-
|
|
264
|
-
|
|
276
|
+
agent?: RpcFunctionAgentOptions;
|
|
277
|
+
/** Setup function called with context to initialize handler and dump */
|
|
278
|
+
setup?: (context: CONTEXT) => Thenable<RpcFunctionSetupResult<InferArgsType<AS>, InferReturnType<RS>>>;
|
|
279
|
+
/** Function implementation (required if setup doesn't provide one) */
|
|
280
|
+
handler?: (...args: InferArgsType<AS>) => InferReturnType<RS>;
|
|
281
|
+
/** Dump definition (setup dump takes priority) */
|
|
265
282
|
dump?: RpcDump<InferArgsType<AS>, InferReturnType<RS>, CONTEXT>;
|
|
266
283
|
/**
|
|
267
284
|
* Sugar for "query in dev, single baked snapshot in build": when
|
|
@@ -271,8 +288,10 @@ type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = '
|
|
|
271
288
|
* to the same snapshot. Only valid on `query` (or untyped)
|
|
272
289
|
* functions — `static` already has equivalent default behavior.
|
|
273
290
|
*/
|
|
274
|
-
snapshot?: boolean;
|
|
275
|
-
|
|
291
|
+
snapshot?: boolean;
|
|
292
|
+
/** Per-context setup-result cache, populated by `getRpcResolvedSetupResult`. @internal */
|
|
293
|
+
__cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<InferArgsType<AS>, InferReturnType<RS>>>>;
|
|
294
|
+
/** Single-slot fallback for primitive contexts. @internal */
|
|
276
295
|
__promise?: Thenable<RpcFunctionSetupResult<InferArgsType<AS>, InferReturnType<RS>>>;
|
|
277
296
|
};
|
|
278
297
|
type RpcFunctionDefinitionToFunction<T extends RpcFunctionDefinitionAny> = T extends {
|
|
@@ -281,7 +300,7 @@ type RpcFunctionDefinitionToFunction<T extends RpcFunctionDefinitionAny> = T ext
|
|
|
281
300
|
} ? AS extends RpcArgsSchema ? RS extends RpcReturnSchema ? (...args: InferArgsType<AS>) => InferReturnType<RS> : never : never : T extends RpcFunctionDefinition<string, any, infer ARGS, infer RETURN, any, any, any> ? (...args: ARGS) => RETURN : never;
|
|
282
301
|
type RpcFunctionDefinitionAny = RpcFunctionDefinition<string, any, any, any, any, any, any>;
|
|
283
302
|
type RpcFunctionDefinitionAnyWithContext<CONTEXT = undefined> = RpcFunctionDefinition<string, any, any, any, any, any, CONTEXT>;
|
|
284
|
-
type RpcDefinitionsToFunctions<T extends readonly RpcFunctionDefinitionAny[]> = EntriesToObject<{ [K in keyof T]: [T[K]['name'], RpcFunctionDefinitionToFunction<T[K]>] }>;
|
|
303
|
+
type RpcDefinitionsToFunctions<T extends readonly RpcFunctionDefinitionAny[]> = EntriesToObject<{ [K in keyof T]: [T[K]['name'], RpcFunctionDefinitionToFunction<T[K]>]; }>;
|
|
285
304
|
/**
|
|
286
305
|
* Like {@link RpcDefinitionsToFunctions}, but prefixes every (bare)
|
|
287
306
|
* definition name with `<NS>:`. Use this when functions are defined with
|
|
@@ -289,9 +308,9 @@ type RpcDefinitionsToFunctions<T extends readonly RpcFunctionDefinitionAny[]> =
|
|
|
289
308
|
* (`ctx.scope(NS).rpc.register(...)`), so the augmented registry keys
|
|
290
309
|
* match the namespaced ids stored at runtime.
|
|
291
310
|
*/
|
|
292
|
-
type RpcDefinitionsToFunctionsWithNamespace<NS extends string, T extends readonly RpcFunctionDefinitionAny[]> = EntriesToObject<{ [K in keyof T]: [`${NS}:${T[K]['name'] & string}`, RpcFunctionDefinitionToFunction<T[K]>] }>;
|
|
311
|
+
type RpcDefinitionsToFunctionsWithNamespace<NS extends string, T extends readonly RpcFunctionDefinitionAny[]> = EntriesToObject<{ [K in keyof T]: [`${NS}:${T[K]['name'] & string}`, RpcFunctionDefinitionToFunction<T[K]>]; }>;
|
|
293
312
|
type RpcDefinitionsFilter<T extends readonly RpcFunctionDefinitionAny[], Type extends RpcFunctionType> = { [K in keyof T]: T[K] extends {
|
|
294
313
|
type: Type;
|
|
295
|
-
} ? T[K] : never };
|
|
314
|
+
} ? T[K] : never; };
|
|
296
315
|
//#endregion
|
|
297
316
|
export { RpcFunctionType as C, Thenable as E, RpcFunctionSetupResult as S, RpcReturnSchema as T, RpcFunctionDefinition as _, RpcDefinitionsFilter as a, RpcFunctionDefinitionBase as b, RpcDump as c, RpcDumpDefinition as d, RpcDumpGetter as f, RpcFunctionAgentOptions as g, RpcDumpStore as h, RpcArgsSchema as i, RpcDumpClientOptions as l, RpcDumpRecordError as m, BirpcReturn$1 as n, RpcDefinitionsToFunctions as o, RpcDumpRecord as p, EntriesToObject as r, RpcDefinitionsToFunctionsWithNamespace as s, BirpcFn as t, RpcDumpCollectionOptions as u, RpcFunctionDefinitionAny as v, RpcFunctionsCollector as w, RpcFunctionDefinitionToFunction as x, RpcFunctionDefinitionAnyWithContext as y };
|
package/dist/utils/events.d.mts
CHANGED
package/dist/utils/hash.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as hash } from "../hash-
|
|
1
|
+
import { t as hash } from "../hash-KtDZYXDN.mjs";
|
|
2
2
|
export { hash };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as launchEditor } from "../launch-editor-
|
|
1
|
+
import { t as launchEditor } from "../launch-editor-C_xuzLnF.mjs";
|
|
2
2
|
export { launchEditor };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as SharedStateEvents, F as ImmutableArray, H as SharedStatePatch, I as ImmutableMap, L as ImmutableObject, P as Immutable, R as ImmutableSet, U as createSharedState, V as SharedStateOptions, z as SharedState } from "../devframe-
|
|
1
|
+
import { B as SharedStateEvents, F as ImmutableArray, H as SharedStatePatch, I as ImmutableMap, L as ImmutableObject, P as Immutable, R as ImmutableSet, U as createSharedState, V as SharedStateOptions, z as SharedState } from "../devframe-CnTVuGw9.mjs";
|
|
2
2
|
export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as StreamSink, D as CreateStreamSinkOptions, E as CreateStreamReaderOptions, M as createStreamReader, N as createStreamSink, O as StreamErrorPayload, T as BufferedChunk, j as StreamSinkEvents, k as StreamReader } from "../devframe-
|
|
1
|
+
import { A as StreamSink, D as CreateStreamSinkOptions, E as CreateStreamReaderOptions, M as createStreamReader, N as createStreamSink, O as StreamErrorPayload, T as BufferedChunk, j as StreamSinkEvents, k as StreamReader } from "../devframe-CnTVuGw9.mjs";
|
|
2
2
|
export { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink };
|