devframe 0.9.9 → 0.9.11
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-CK3czkH4.d.mts → _shared-DEAMiPfH.d.mts} +26 -7
- package/dist/{_shared-C08SdQRl.mjs → _shared-U8D-xzrp.mjs} +41 -5
- package/dist/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +13 -26
- package/dist/adapters/cac.d.mts +6 -10
- package/dist/adapters/cac.mjs +3 -4
- package/dist/adapters/dev.d.mts +7 -7
- package/dist/adapters/dev.mjs +2 -2
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/initiate.d.mts +5 -4
- package/dist/adapters/initiate.mjs +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +3 -3
- package/dist/cli/main.mjs +2 -2
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.mjs +7 -1
- package/dist/{context-4AIVRLYF.d.mts → context-BBWPLDHh.d.mts} +57 -18
- package/dist/{context-CwPUinjn.mjs → context-Bq27SDK-.mjs} +49 -13
- package/dist/{context-rgBSPFHS.d.mts → context-_temOGDB.d.mts} +1 -1
- package/dist/{context-DIUvJW4D.mjs → context-jXO5vzjH.mjs} +1 -1
- package/dist/{dev-Eqq5PX0k.mjs → dev-B32EVw5w.mjs} +49 -35
- package/dist/{diagnostics-BMfN8mb1.mjs → diagnostics-DZA6KQ_Z.mjs} +3 -3
- package/dist/{services-install-P_DV7VYL.mjs → host-agent-CKqSTEX9.mjs} +8 -155
- package/dist/in-page-channel/index.d.mts +1 -1
- package/dist/{index-pKl67H6w.d.mts → index-1ezCLThh.d.mts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/{instance-registry-C7-41RSp.mjs → instance-registry-DCq762YJ.mjs} +2 -2
- package/dist/{instance-shell-7Z52PE4_.d.mts → instance-shell-BWh0JQuo.d.mts} +2 -2
- package/dist/{instance-shell-cdVETpfz.mjs → instance-shell-DvYCwrDy.mjs} +5 -18
- package/dist/internal/index.d.mts +11 -9
- package/dist/internal/index.mjs +9 -9
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/auth.mjs +1 -1
- package/dist/node/hub-internals.d.mts +2 -2
- package/dist/node/hub-internals.mjs +2 -2
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.mjs +2 -2
- package/dist/recipes/common-rpc-functions.d.mts +1 -1
- package/dist/recipes/interactive-auth.d.mts +2 -2
- package/dist/recipes/interactive-auth.mjs +2 -2
- package/dist/{remote-assets-BIFWOlBW.mjs → remote-assets-DMFzLSoH.mjs} +3 -3
- package/dist/rpc/dump.d.mts +17 -1
- package/dist/rpc/dump.mjs +2 -2
- package/dist/rpc/index.mjs +2 -3
- package/dist/rpc/transports/sse-client.mjs +1 -1
- package/dist/rpc/transports/sse-server.mjs +1 -1
- package/dist/rpc/transports/ws-bun.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +1 -1
- package/dist/rpc/transports/ws-deno.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +1 -1
- package/dist/{rpc-core-DVQ7xi89.mjs → rpc-core-CvkU23bQ.mjs} +1 -1
- package/dist/{rpc-core-Ceu6AUz8.d.mts → rpc-core-DiCr5etS.d.mts} +2 -2
- package/dist/{serialization-DTZnPQ1-.mjs → serialization-DFg5sUt6.mjs} +39 -2
- package/dist/services-install-Ben4yh52.mjs +154 -0
- package/dist/{state-CeQQWzM-.mjs → state-Mwt6--el.mjs} +13 -5
- package/dist/{storage-Dccf_IyD.mjs → storage-B70AXK64.mjs} +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/remote-assets.mjs +1 -1
- package/dist/utils/serve-static.mjs +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/{validation-BOy8IoFZ.mjs → validation-CfV1s0SF.mjs} +1 -1
- package/dist/{wire-codec-dcCeXcSo.mjs → wire-codec-BHGt0sSs.mjs} +1 -1
- package/dist/{static-DZ8P2Kn7.mjs → write-BuLCrn9h.mjs} +25 -4
- package/package.json +2 -6
- package/skills/devframe/SKILL.md +5 -3
- package/dist/diagnostics-D0EVm5M6.mjs +0 -39
- package/dist/{host-h3-BJ4siyz7.mjs → host-h3-BROI6SQ4.mjs} +1 -1
package/dist/internal/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as resolveClientAssets } from "../client-assets-DNdhagGm.mjs";
|
|
2
|
-
import { n as peekRpcWireFrame, t as createRpcWireCodec } from "../wire-codec-
|
|
3
|
-
import { t as diagnostics } from "../diagnostics-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as createH3DevframeHost } from "../host-h3-
|
|
7
|
-
import {
|
|
8
|
-
import { i as
|
|
9
|
-
import { t as createContextRpcServer } from "../rpc-core-
|
|
10
|
-
export { DevframeAgentHost, coerceAgentPositionalArgs, createContextRpcServer, createH3DevframeHost, createInstanceShell, createRpcWireCodec, diagnostics, importRuntimeModule, listLiveDevframeInstances, normalizeBasePath, normalizeHttpServerUrl, peekRpcWireFrame, registerDevframeInstance, resolveBasePath, resolveClientAssets, resolveInstanceRegister, resolveMcpConfig, samePath };
|
|
2
|
+
import { n as peekRpcWireFrame, t as createRpcWireCodec } from "../wire-codec-BHGt0sSs.mjs";
|
|
3
|
+
import { t as diagnostics } from "../diagnostics-DZA6KQ_Z.mjs";
|
|
4
|
+
import { n as coerceAgentPositionalArgs, t as DevframeAgentHost } from "../host-agent-CKqSTEX9.mjs";
|
|
5
|
+
import { a as resolveMcpConfig, n as normalizeBasePath, r as resolveBasePath, s as importRuntimeModule, t as loadAutoMcpAdapter } from "../_shared-U8D-xzrp.mjs";
|
|
6
|
+
import { t as createH3DevframeHost } from "../host-h3-BROI6SQ4.mjs";
|
|
7
|
+
import { i as registerDevframeInstance, n as listLiveDevframeInstances } from "../instance-registry-DCq762YJ.mjs";
|
|
8
|
+
import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, r as samePath, t as createInstanceShell } from "../instance-shell-DvYCwrDy.mjs";
|
|
9
|
+
import { t as createContextRpcServer } from "../rpc-core-CvkU23bQ.mjs";
|
|
10
|
+
export { DevframeAgentHost, coerceAgentPositionalArgs, createContextRpcServer, createH3DevframeHost, createInstanceShell, createRpcWireCodec, diagnostics, importRuntimeModule, listLiveDevframeInstances, loadAutoMcpAdapter, normalizeBasePath, normalizeHttpServerUrl, peekRpcWireFrame, registerDevframeInstance, resolveBasePath, resolveClientAssets, resolveInstanceRegister, resolveMcpConfig, samePath };
|
package/dist/node/auth.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as verifyAuthToken, i as refreshTempAuthCode, n as exchangeTempAuthCode, o as revokeActiveConnectionsForToken, r as getTempAuthCode, s as revokeAuthToken, t as buildOtpAuthUrl } from "../index-
|
|
1
|
+
import { Tt as DevframeAuthHandler } from "../context-BBWPLDHh.mjs";
|
|
2
|
+
import { a as verifyAuthToken, i as refreshTempAuthCode, n as exchangeTempAuthCode, o as revokeActiveConnectionsForToken, r as getTempAuthCode, s as revokeAuthToken, t as buildOtpAuthUrl } from "../index-1ezCLThh.mjs";
|
|
3
3
|
export { DevframeAuthHandler, buildOtpAuthUrl, exchangeTempAuthCode, getTempAuthCode, refreshTempAuthCode, revokeActiveConnectionsForToken, revokeAuthToken, verifyAuthToken };
|
package/dist/node/auth.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "../revoke-cqztiCX4.mjs";
|
|
2
|
-
import { a as verifyAuthToken, i as refreshTempAuthCode, n as exchangeTempAuthCode, r as getTempAuthCode, t as buildOtpAuthUrl } from "../state-
|
|
2
|
+
import { a as verifyAuthToken, i as refreshTempAuthCode, n as exchangeTempAuthCode, r as getTempAuthCode, t as buildOtpAuthUrl } from "../state-Mwt6--el.mjs";
|
|
3
3
|
export { buildOtpAuthUrl, exchangeTempAuthCode, getTempAuthCode, refreshTempAuthCode, revokeActiveConnectionsForToken, revokeAuthToken, verifyAuthToken };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-
|
|
2
|
-
import {
|
|
1
|
+
import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-_temOGDB.mjs";
|
|
2
|
+
import { a as resolveBasePath, i as normalizeBasePath } from "../_shared-DEAMiPfH.mjs";
|
|
3
3
|
export { type DevframeInternalContext, type InternalAnonymousAuthStorage, type RemoteTokenRecord, getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { n as internalContextMap, t as getInternalContext } from "../context-
|
|
1
|
+
import { n as normalizeBasePath, r as resolveBasePath } from "../_shared-U8D-xzrp.mjs";
|
|
2
|
+
import { n as internalContextMap, t as getInternalContext } from "../context-jXO5vzjH.mjs";
|
|
3
3
|
export { getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../index-pIVt92jP.mjs";
|
|
2
2
|
import { v as RpcFunctionDefinitionAny } from "../types-Dq4i156u.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { k as SharedState, l as RpcFunctionsHost, o as DevframeNodeContext, xt as DevframeHost } from "../context-BBWPLDHh.mjs";
|
|
4
4
|
import { BirpcGroup } from "birpc";
|
|
5
5
|
//#region src/node/context.d.ts
|
|
6
6
|
interface CreateHostContextOptions {
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as createHostContext } from "../context-
|
|
2
|
-
import { t as createStorage } from "../storage-
|
|
1
|
+
import { t as createHostContext } from "../context-Bq27SDK-.mjs";
|
|
2
|
+
import { t as createStorage } from "../storage-B70AXK64.mjs";
|
|
3
3
|
export { createHostContext, createStorage };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../index-pIVt92jP.mjs";
|
|
2
2
|
import { E as Thenable, S as RpcFunctionSetupResult, c as RpcDump, g as RpcFunctionAgentOptions } from "../types-Dq4i156u.mjs";
|
|
3
|
-
import "../context-
|
|
3
|
+
import "../context-BBWPLDHh.mjs";
|
|
4
4
|
import { SimpleSchema } from "../utils/simple-schema.mjs";
|
|
5
5
|
//#region src/recipes/common-rpc-functions.d.ts
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../index-
|
|
1
|
+
import { Tt as DevframeAuthHandler, o as DevframeNodeContext, s as DevframeNodeRpcSession } from "../context-BBWPLDHh.mjs";
|
|
2
|
+
import "../index-1ezCLThh.mjs";
|
|
3
3
|
//#region src/recipes/interactive-auth.d.ts
|
|
4
4
|
interface CreateInteractiveAuthOptions {
|
|
5
5
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { s as colors } from "../nostics-D0PvLZsn.mjs";
|
|
2
2
|
import { n as defineRpcFunction } from "../define-BLWPsH6y.mjs";
|
|
3
3
|
import { isAnonymousRpcMethod } from "../constants.mjs";
|
|
4
|
-
import { a as verifyAuthToken, n as exchangeTempAuthCode, r as getTempAuthCode, t as buildOtpAuthUrl } from "../state-
|
|
5
|
-
import { t as getInternalContext } from "../context-
|
|
4
|
+
import { a as verifyAuthToken, n as exchangeTempAuthCode, r as getTempAuthCode, t as buildOtpAuthUrl } from "../state-Mwt6--el.mjs";
|
|
5
|
+
import { t as getInternalContext } from "../context-jXO5vzjH.mjs";
|
|
6
6
|
import { t as s } from "../simple-schema-Bi40l-P6.mjs";
|
|
7
7
|
//#region src/recipes/interactive-auth.ts
|
|
8
8
|
function defaultBanner(info) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as diagnostics } from "./diagnostics-
|
|
1
|
+
import { t as diagnostics } from "./diagnostics-DZA6KQ_Z.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
+
import { mkdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
4
|
+
import { dirname, extname, isAbsolute, join, normalize, resolve, sep } from "pathe";
|
|
3
5
|
import { isatty } from "node:tty";
|
|
4
6
|
import { formatWithOptions, inspect } from "node:util";
|
|
5
|
-
import { dirname, extname, isAbsolute, join, normalize, resolve, sep } from "pathe";
|
|
6
7
|
import { createReadStream, existsSync } from "node:fs";
|
|
7
8
|
import { Buffer } from "node:buffer";
|
|
8
|
-
import { mkdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
9
9
|
import { Readable } from "node:stream";
|
|
10
10
|
import { lookup } from "mrmime";
|
|
11
11
|
//#region ../../node_modules/.pnpm/obug@2.1.4/node_modules/obug/dist/core.js
|
package/dist/rpc/dump.d.mts
CHANGED
|
@@ -66,4 +66,20 @@ interface StaticRpcDumpCollection {
|
|
|
66
66
|
}
|
|
67
67
|
declare function collectStaticRpcDump(definitions: Iterable<RpcFunctionDefinitionAny>, context: any): Promise<StaticRpcDumpCollection>;
|
|
68
68
|
//#endregion
|
|
69
|
-
|
|
69
|
+
//#region src/rpc/dump/write.d.ts
|
|
70
|
+
interface WriteStaticRpcDumpOptions {
|
|
71
|
+
/**
|
|
72
|
+
* Pretty-print RPC dump JSON files. Defaults to `false` so payload
|
|
73
|
+
* shards (which can be multiple MB for graph-heavy tools) ship
|
|
74
|
+
* minified. Set `true` when you need to diff / read the dumps by hand.
|
|
75
|
+
*/
|
|
76
|
+
pretty?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Write a collected static RPC dump to disk: every sharded record file plus
|
|
80
|
+
* the `__rpc-dump/index.json` manifest, under `outDir`. Shared by the build
|
|
81
|
+
* adapter (`createBuild`) and `@devframes/hub`'s `buildHub`.
|
|
82
|
+
*/
|
|
83
|
+
declare function writeStaticRpcDump(dump: StaticRpcDumpCollection, outDir: string, options?: WriteStaticRpcDumpOptions): Promise<void>;
|
|
84
|
+
//#endregion
|
|
85
|
+
export { StaticRpcDumpCollection, StaticRpcDumpFile, StaticRpcDumpManifest, StaticRpcDumpManifestQueryEntry, StaticRpcDumpManifestStaticEntry, StaticRpcDumpManifestValue, StaticRpcDumpSerialization, WriteStaticRpcDumpOptions, collectStaticRpcDump, createClientFromDump, dumpFunctions, getDefinitionsWithDumps, reviveDumpError, serializeDumpError, writeStaticRpcDump };
|
package/dist/rpc/dump.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { collectStaticRpcDump, createClientFromDump, dumpFunctions, getDefinitionsWithDumps, reviveDumpError, serializeDumpError };
|
|
1
|
+
import { a as getDefinitionsWithDumps, i as dumpFunctions, n as collectStaticRpcDump, o as reviveDumpError, r as createClientFromDump, s as serializeDumpError, t as writeStaticRpcDump } from "../write-BuLCrn9h.mjs";
|
|
2
|
+
export { collectStaticRpcDump, createClientFromDump, dumpFunctions, getDefinitionsWithDumps, reviveDumpError, serializeDumpError, writeStaticRpcDump };
|
package/dist/rpc/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { a as validateRpcArgs, i as getRpcResolvedSetupResult, n as validateDefinitions, o as validateRpcReturn, r as getRpcHandler, s as hash, t as validateDefinition } from "../validation-
|
|
2
|
-
import {
|
|
1
|
+
import { a as validateRpcArgs, i as getRpcResolvedSetupResult, n as validateDefinitions, o as validateRpcReturn, r as getRpcHandler, s as hash, t as validateDefinition } from "../validation-CfV1s0SF.mjs";
|
|
2
|
+
import { n as strictJsonStringify, r as diagnostics, t as STRUCTURED_CLONE_PREFIX } from "../serialization-DFg5sUt6.mjs";
|
|
3
3
|
import { n as defineRpcFunction, t as createDefineWrapperWithContext } from "../define-BLWPsH6y.mjs";
|
|
4
|
-
import { n as strictJsonStringify, t as STRUCTURED_CLONE_PREFIX } from "../serialization-DTZnPQ1-.mjs";
|
|
5
4
|
//#region src/rpc/cache.ts
|
|
6
5
|
/**
|
|
7
6
|
* @experimental API is expected to change.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEVFRAME_AUTH_TOKEN_QUERY_PARAM, DEVFRAME_SSE_SESSION_HEADER } from "../../constants.mjs";
|
|
2
|
-
import { t as createRpcWireCodec } from "../../wire-codec-
|
|
2
|
+
import { t as createRpcWireCodec } from "../../wire-codec-BHGt0sSs.mjs";
|
|
3
3
|
//#region src/rpc/transports/sse-client.ts
|
|
4
4
|
function NOOP() {}
|
|
5
5
|
/** Split the next complete SSE frame (up to a blank line) off the buffer. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEVFRAME_SSE_SESSION_HEADER } from "../../constants.mjs";
|
|
2
|
-
import { n as peekRpcWireFrame, t as createRpcWireCodec } from "../../wire-codec-
|
|
2
|
+
import { n as peekRpcWireFrame, t as createRpcWireCodec } from "../../wire-codec-BHGt0sSs.mjs";
|
|
3
3
|
import { t as isAllowedOrigin } from "../../origin-DZit9g29.mjs";
|
|
4
4
|
import { t as createRpcSessionMeta } from "../../session-DPfj6zQG.mjs";
|
|
5
5
|
//#region src/rpc/transports/sse-server.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as WsOriginRegistry } from "../../ws-server-D2nv68Hg.mjs";
|
|
2
|
-
import { t as ContextRpcServer } from "../../rpc-core-
|
|
2
|
+
import { t as ContextRpcServer } from "../../rpc-core-DiCr5etS.mjs";
|
|
3
3
|
//#region src/rpc/transports/ws-bun.d.ts
|
|
4
4
|
interface AttachBunWsTransportOptions {
|
|
5
5
|
/** Same contract as `WsRpcTransportOptions.allowedOrigins`. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEVFRAME_AUTH_TOKEN_QUERY_PARAM } from "../../constants.mjs";
|
|
2
|
-
import { t as createRpcWireCodec } from "../../wire-codec-
|
|
2
|
+
import { t as createRpcWireCodec } from "../../wire-codec-BHGt0sSs.mjs";
|
|
3
3
|
//#region src/rpc/transports/ws-client.ts
|
|
4
4
|
function NOOP() {}
|
|
5
5
|
const EMPTY_DEFS = /* @__PURE__ */ new Map();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as WsOriginRegistry } from "../../ws-server-D2nv68Hg.mjs";
|
|
2
|
-
import { t as ContextRpcServer } from "../../rpc-core-
|
|
2
|
+
import { t as ContextRpcServer } from "../../rpc-core-DiCr5etS.mjs";
|
|
3
3
|
//#region src/rpc/transports/ws-deno.d.ts
|
|
4
4
|
interface AttachDenoWsTransportOptions {
|
|
5
5
|
/** Same contract as `WsRpcTransportOptions.allowedOrigins`. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../constants.mjs";
|
|
2
|
-
import { t as createRpcWireCodec } from "../../wire-codec-
|
|
2
|
+
import { t as createRpcWireCodec } from "../../wire-codec-BHGt0sSs.mjs";
|
|
3
3
|
import { n as isLoopbackHostname, t as isAllowedOrigin } from "../../origin-DZit9g29.mjs";
|
|
4
4
|
import { t as createRpcSessionMeta } from "../../session-DPfj6zQG.mjs";
|
|
5
5
|
import { n as randomToken, r as timingSafeEqual } from "../../crypto-token-TVbGGFuj.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __exportAll } from "./rolldown-runtime-B4iAMlE-.mjs";
|
|
2
2
|
import { createRpcServer } from "./rpc/server.mjs";
|
|
3
|
-
import { t as diagnostics } from "./diagnostics-
|
|
3
|
+
import { t as diagnostics } from "./diagnostics-DZA6KQ_Z.mjs";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
//#region src/node/rpc-core.ts
|
|
6
6
|
var rpc_core_exports = /* @__PURE__ */ __exportAll({ createContextRpcServer: () => createContextRpcServer });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as DevframeNodeRpcSessionMeta, l as DevframeRpcConnection } from "./ws-server-D2nv68Hg.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import "./index-
|
|
2
|
+
import { Tt as DevframeAuthHandler, o as DevframeNodeContext, s as DevframeNodeRpcSession, vt as DevframeRpcClientFunctions, yt as DevframeRpcServerFunctions } from "./context-BBWPLDHh.mjs";
|
|
3
|
+
import "./index-1ezCLThh.mjs";
|
|
4
4
|
import { BirpcGroup, EventOptions } from "birpc";
|
|
5
5
|
//#region src/node/rpc-core.d.ts
|
|
6
6
|
interface CreateContextRpcServerOptions {
|
|
@@ -1,4 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as defineDiagnostics } from "./nostics-D0PvLZsn.mjs";
|
|
2
|
+
//#region src/rpc/diagnostics.ts
|
|
3
|
+
const diagnostics = defineDiagnostics({
|
|
4
|
+
docsBase: "https://devfra.me/errors",
|
|
5
|
+
codes: {
|
|
6
|
+
DF0019: {
|
|
7
|
+
why: (p) => `RPC function "${p.name}" has \`agent\` set but \`jsonSerializable\` is not \`true\`; MCP requires JSON-serializable data.`,
|
|
8
|
+
fix: "Set `jsonSerializable: true` if the payload is JSON-safe, or remove `agent` to keep it RPC-only."
|
|
9
|
+
},
|
|
10
|
+
DF0020: {
|
|
11
|
+
why: (p) => `RPC function "${p.name}" declares \`jsonSerializable: true\` but the value at "${p.path}" is a ${p.type}.`,
|
|
12
|
+
fix: "Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."
|
|
13
|
+
},
|
|
14
|
+
DF0021: {
|
|
15
|
+
why: (p) => `RPC function "${p.name}" is already registered`,
|
|
16
|
+
fix: "Use the `force` parameter to overwrite an existing registration."
|
|
17
|
+
},
|
|
18
|
+
DF0022: { why: (p) => `RPC function "${p.name}" is not registered. Use register() to add new functions.` },
|
|
19
|
+
DF0023: { why: (p) => `RPC function "${p.name}" is not registered` },
|
|
20
|
+
DF0024: { why: (p) => `Either handler or setup function must be provided for RPC function "${p.name}"` },
|
|
21
|
+
DF0025: { why: (p) => `Function "${p.name}" not found in dump store` },
|
|
22
|
+
DF0026: { why: (p) => `No dump match for "${p.name}" with args: ${p.args}` },
|
|
23
|
+
DF0027: { why: (p) => `Function "${p.name}" with type "${p.type}" cannot have dump configuration. Only "static" and "query" types support dumps.` },
|
|
24
|
+
DF0028: {
|
|
25
|
+
why: (p) => `Function "${p.name}" with type "${p.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,
|
|
26
|
+
fix: "Remove `snapshot: true`, or change the function type to `query`."
|
|
27
|
+
},
|
|
28
|
+
DF0043: {
|
|
29
|
+
why: (p) => `RPC function "${p.name}" received an invalid argument at position ${p.index}: ${p.issues}`,
|
|
30
|
+
fix: "Pass a value that satisfies the `args` schema declared for this function."
|
|
31
|
+
},
|
|
32
|
+
DF0044: {
|
|
33
|
+
why: (p) => `RPC function "${p.name}" returned a value that failed its \`returns\` schema: ${p.issues}`,
|
|
34
|
+
fix: "Make the handler return a value that satisfies the `returns` schema, or relax the schema."
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
//#endregion
|
|
2
39
|
//#region src/rpc/serialization.ts
|
|
3
40
|
/**
|
|
4
41
|
* Wire format used by the live RPC transports (WebSocket and SSE).
|
|
@@ -76,4 +113,4 @@ function formatPath(parent, key) {
|
|
|
76
113
|
return key;
|
|
77
114
|
}
|
|
78
115
|
//#endregion
|
|
79
|
-
export { strictJsonStringify as n, STRUCTURED_CLONE_PREFIX as t };
|
|
116
|
+
export { strictJsonStringify as n, diagnostics as r, STRUCTURED_CLONE_PREFIX as t };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { isAbsolute, join } from "pathe";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
//#region src/node/services-install.ts
|
|
5
|
+
/**
|
|
6
|
+
* Turn a `resolveFrom` value (a file path, a file URL like `import.meta.url`,
|
|
7
|
+
* or a directory) into something `createRequire` accepts; a directory gets a
|
|
8
|
+
* synthetic filename appended so resolution starts inside it.
|
|
9
|
+
*/
|
|
10
|
+
function toRequireBase(resolveFrom) {
|
|
11
|
+
if (resolveFrom.startsWith("file://")) return resolveFrom;
|
|
12
|
+
if ((resolveFrom.split(/[/\\]/).pop() ?? "").includes(".")) return resolveFrom;
|
|
13
|
+
return join(resolveFrom, "_devframe_resolve.js");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Normalize an `install()` `resolveFrom` into a resolution base. Paths and
|
|
17
|
+
* file URLs pass through (the common case: the declaring plugin's
|
|
18
|
+
* `importMetaUrl`, so a service it declares resolves against the plugin's own
|
|
19
|
+
* dependencies); a bare npm package name resolves to that package's location
|
|
20
|
+
* from `cwd`. An unresolvable package name reads as no base (the caller's
|
|
21
|
+
* workspace fallbacks apply).
|
|
22
|
+
*/
|
|
23
|
+
function expandResolveFrom(resolveFrom, cwd) {
|
|
24
|
+
if (resolveFrom.startsWith("file://") || resolveFrom.startsWith(".") || isAbsolute(resolveFrom)) return resolveFrom;
|
|
25
|
+
const require = createRequire(join(cwd, "_devframe_resolve.js"));
|
|
26
|
+
try {
|
|
27
|
+
return require.resolve(`${resolveFrom}/package.json`);
|
|
28
|
+
} catch {}
|
|
29
|
+
try {
|
|
30
|
+
return require.resolve(resolveFrom);
|
|
31
|
+
} catch {}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Import a service package's module, trying each `resolveFrom` candidate in
|
|
35
|
+
* order (so a plugin-declared service resolves against the plugin's own
|
|
36
|
+
* dependency tree first, then the workspace fallback). Throws the last
|
|
37
|
+
* resolution error when no candidate succeeds.
|
|
38
|
+
*/
|
|
39
|
+
async function importServicePackage(pkg, resolveFroms) {
|
|
40
|
+
const candidates = [...new Set(resolveFroms.filter((x) => typeof x === "string" && x.length > 0))];
|
|
41
|
+
let lastError = /* @__PURE__ */ new Error(`no resolution base available for "${pkg}"`);
|
|
42
|
+
for (const from of candidates) {
|
|
43
|
+
let resolved;
|
|
44
|
+
try {
|
|
45
|
+
resolved = createRequire(toRequireBase(from)).resolve(pkg);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
lastError = error;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
return await import(
|
|
51
|
+
/* webpackIgnore: true */
|
|
52
|
+
/* @vite-ignore */
|
|
53
|
+
/* turbopackIgnore: true */
|
|
54
|
+
pathToFileURL(resolved).href
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
throw lastError;
|
|
58
|
+
}
|
|
59
|
+
function parseVersion(input) {
|
|
60
|
+
const [core, ...prerelease] = input.trim().replace(/^v/, "").split("-");
|
|
61
|
+
if (!core) return void 0;
|
|
62
|
+
const parts = core.split(".").map((part) => Number.parseInt(part, 10));
|
|
63
|
+
if (parts.length === 0 || parts.some((part) => Number.isNaN(part) || part < 0)) return void 0;
|
|
64
|
+
while (parts.length < 3) parts.push(0);
|
|
65
|
+
return {
|
|
66
|
+
parts,
|
|
67
|
+
...prerelease.length ? { prerelease: prerelease.join("-") } : {}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function compareVersions(a, b) {
|
|
71
|
+
for (let i = 0; i < 3; i++) {
|
|
72
|
+
const diff = (a.parts[i] ?? 0) - (b.parts[i] ?? 0);
|
|
73
|
+
if (diff !== 0) return diff;
|
|
74
|
+
}
|
|
75
|
+
if (a.prerelease && !b.prerelease) return -1;
|
|
76
|
+
if (!a.prerelease && b.prerelease) return 1;
|
|
77
|
+
if (a.prerelease && b.prerelease) return a.prerelease < b.prerelease ? -1 : a.prerelease > b.prerelease ? 1 : 0;
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
/** Whether `version` and `base` share their first `lockUpTo + 1` parts. */
|
|
81
|
+
function partsMatchUpTo(version, base, lockUpTo) {
|
|
82
|
+
for (let i = 0; i <= lockUpTo; i++) if ((version.parts[i] ?? 0) !== (base.parts[i] ?? 0)) return false;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
function satisfiesCaret(version, base) {
|
|
86
|
+
if (compareVersions(version, base) < 0) return false;
|
|
87
|
+
const fixedIndex = base.parts.findIndex((part) => part !== 0);
|
|
88
|
+
return partsMatchUpTo(version, base, fixedIndex === -1 ? base.parts.length - 1 : fixedIndex);
|
|
89
|
+
}
|
|
90
|
+
function satisfiesTilde(version, base, segments) {
|
|
91
|
+
if (compareVersions(version, base) < 0) return false;
|
|
92
|
+
return partsMatchUpTo(version, base, segments.length >= 2 ? 1 : 0);
|
|
93
|
+
}
|
|
94
|
+
function satisfiesExactOrPrefix(version, base, segments) {
|
|
95
|
+
for (let i = 0; i < Math.max(segments.length, 3); i++) if (i < segments.length && (version.parts[i] ?? 0) !== (base.parts[i] ?? 0)) return false;
|
|
96
|
+
return segments.length >= 3 ? compareVersions(version, base) === 0 : true;
|
|
97
|
+
}
|
|
98
|
+
function satisfiesComparator(version, comparator) {
|
|
99
|
+
const raw = comparator.trim();
|
|
100
|
+
if (!raw || raw === "*" || raw === "x") return true;
|
|
101
|
+
const operatorMatch = raw.match(/^([\^~]|>=|<=|[><=])?(.+)$/);
|
|
102
|
+
if (!operatorMatch) return false;
|
|
103
|
+
const operator = operatorMatch[1];
|
|
104
|
+
const rest = operatorMatch[2].trim();
|
|
105
|
+
const segments = rest.replace(/\.[x*]/gi, "").split(".").filter(Boolean);
|
|
106
|
+
const base = parseVersion(rest.replace(/[x*]/gi, "0"));
|
|
107
|
+
if (!base) return false;
|
|
108
|
+
switch (operator) {
|
|
109
|
+
case ">": return compareVersions(version, base) > 0;
|
|
110
|
+
case ">=": return compareVersions(version, base) >= 0;
|
|
111
|
+
case "<": return compareVersions(version, base) < 0;
|
|
112
|
+
case "<=": return compareVersions(version, base) <= 0;
|
|
113
|
+
case "^": return satisfiesCaret(version, base);
|
|
114
|
+
case "~": return satisfiesTilde(version, base, segments);
|
|
115
|
+
default: return satisfiesExactOrPrefix(version, base, segments);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Pragmatic semver range check for service version declarations; supports
|
|
120
|
+
* the common forms (`1.2.3`, `^1.2.3`, `~1.2`, `>=1 <3`, `1.x`, `*`, and
|
|
121
|
+
* `||`-joined alternatives) without pulling in a semver dependency. An
|
|
122
|
+
* unparseable version or range reads as **not satisfied**.
|
|
123
|
+
*/
|
|
124
|
+
function satisfiesVersionRange(version, range) {
|
|
125
|
+
const parsed = parseVersion(version);
|
|
126
|
+
if (!parsed) return false;
|
|
127
|
+
const alternatives = range.split("||").map((alt) => alt.trim()).filter(Boolean);
|
|
128
|
+
if (alternatives.length === 0) return true;
|
|
129
|
+
return alternatives.some((alternative) => alternative.split(/\s+/).every((comparator) => satisfiesComparator(parsed, comparator)));
|
|
130
|
+
}
|
|
131
|
+
function isPlainObject(value) {
|
|
132
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
133
|
+
}
|
|
134
|
+
/** Deep-merge two values with the service option-set rules (see below). */
|
|
135
|
+
function deepMergeTwo(a, b) {
|
|
136
|
+
if (Array.isArray(a) && Array.isArray(b)) return [.../* @__PURE__ */ new Set([...a, ...b])];
|
|
137
|
+
if (isPlainObject(a) && isPlainObject(b)) {
|
|
138
|
+
const out = { ...a };
|
|
139
|
+
for (const key of Object.keys(b)) out[key] = key in a ? deepMergeTwo(a[key], b[key]) : b[key];
|
|
140
|
+
return out;
|
|
141
|
+
}
|
|
142
|
+
return b;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Default option-set merge when a service declares no `mergeOptions`:
|
|
146
|
+
* deep-merge in declaration order: objects recurse, arrays union-dedupe,
|
|
147
|
+
* scalars take the later value. Covers the built-in services (`roots` /
|
|
148
|
+
* `langs` union, `themes` per-key last-wins) without a custom hook.
|
|
149
|
+
*/
|
|
150
|
+
function deepMergeOptionSets(sets) {
|
|
151
|
+
return sets.reduce((merged, set) => deepMergeTwo(merged, set));
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
export { satisfiesVersionRange as i, expandResolveFrom as n, importServicePackage as r, deepMergeOptionSets as t };
|
|
@@ -1194,18 +1194,25 @@ const TEMP_AUTH_CODE_LENGTH = 6;
|
|
|
1194
1194
|
const TEMP_AUTH_CODE_TTL = 3e5;
|
|
1195
1195
|
/** Failed attempts allowed against a single code before it is rotated. */
|
|
1196
1196
|
const TEMP_AUTH_MAX_ATTEMPTS = 5;
|
|
1197
|
-
let tempAuthCode
|
|
1198
|
-
let tempAuthCodeExpiresAt =
|
|
1197
|
+
let tempAuthCode;
|
|
1198
|
+
let tempAuthCodeExpiresAt = 0;
|
|
1199
1199
|
let tempAuthFailedAttempts = 0;
|
|
1200
1200
|
function generateTempCode() {
|
|
1201
1201
|
return randomDigits(TEMP_AUTH_CODE_LENGTH);
|
|
1202
1202
|
}
|
|
1203
|
+
function ensureTempAuthCode() {
|
|
1204
|
+
if (tempAuthCode === void 0) {
|
|
1205
|
+
tempAuthCode = generateTempCode();
|
|
1206
|
+
tempAuthCodeExpiresAt = Date.now() + TEMP_AUTH_CODE_TTL;
|
|
1207
|
+
}
|
|
1208
|
+
return tempAuthCode;
|
|
1209
|
+
}
|
|
1203
1210
|
/**
|
|
1204
1211
|
* The current one-time authentication code. Display this to the user (e.g. in
|
|
1205
1212
|
* the dev-server terminal) so they can type it into the browser to authenticate.
|
|
1206
1213
|
*/
|
|
1207
1214
|
function getTempAuthCode() {
|
|
1208
|
-
return
|
|
1215
|
+
return ensureTempAuthCode();
|
|
1209
1216
|
}
|
|
1210
1217
|
/**
|
|
1211
1218
|
* Rotate the authentication code, resetting its expiry window and failed-attempt
|
|
@@ -1230,7 +1237,7 @@ function refreshTempAuthCode() {
|
|
|
1230
1237
|
* `Referer` header; the browser client reads it locally (see
|
|
1231
1238
|
* `consumeOtpFromUrl`). Any existing fragment parameters are preserved.
|
|
1232
1239
|
*/
|
|
1233
|
-
function buildOtpAuthUrl(baseUrl, code =
|
|
1240
|
+
function buildOtpAuthUrl(baseUrl, code = getTempAuthCode()) {
|
|
1234
1241
|
const url = new URL(baseUrl);
|
|
1235
1242
|
const fragment = new URLSearchParams(url.hash.replace(/^#/, ""));
|
|
1236
1243
|
fragment.set(DEVFRAME_OTP_URL_PARAM, code);
|
|
@@ -1264,11 +1271,12 @@ function verifyAuthToken(token, session, storage) {
|
|
|
1264
1271
|
* attacker cannot keep guessing against the same code.
|
|
1265
1272
|
*/
|
|
1266
1273
|
function exchangeTempAuthCode(code, session, info, storage) {
|
|
1274
|
+
const currentTempAuthCode = ensureTempAuthCode();
|
|
1267
1275
|
if (Date.now() > tempAuthCodeExpiresAt) {
|
|
1268
1276
|
refreshTempAuthCode();
|
|
1269
1277
|
return null;
|
|
1270
1278
|
}
|
|
1271
|
-
if (!timingSafeEqual(code,
|
|
1279
|
+
if (!timingSafeEqual(code, currentTempAuthCode)) {
|
|
1272
1280
|
tempAuthFailedAttempts += 1;
|
|
1273
1281
|
if (tempAuthFailedAttempts >= TEMP_AUTH_MAX_ATTEMPTS) refreshTempAuthCode();
|
|
1274
1282
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as diagnostics } from "./diagnostics-
|
|
1
|
+
import { t as diagnostics } from "./diagnostics-DZA6KQ_Z.mjs";
|
|
2
|
+
import { dirname } from "pathe";
|
|
2
3
|
import { createSharedState } from "devframe/utils/shared-state";
|
|
3
4
|
import process from "node:process";
|
|
4
|
-
import { dirname } from "pathe";
|
|
5
5
|
import fs from "node:fs";
|
|
6
6
|
//#region ../../node_modules/.pnpm/perfect-debounce@2.1.0/node_modules/perfect-debounce/dist/index.mjs
|
|
7
7
|
const DEBOUNCE_DEFAULTS = { trailing: true };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as RpcFunctionAgentOptions } from "../types-Dq4i156u.mjs";
|
|
2
2
|
import { c as DevframeNodeRpcSessionMeta, d as DevframeRpcTransportKind, l as DevframeRpcConnection, u as DevframeRpcConnectionRequest } from "../ws-server-D2nv68Hg.mjs";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as DevframeServiceOf, At as AgentHandle, B as DevframeSetupInfo, Bt as DevframeAgentHostEvents, Ct as DevframeDiagnosticsHost, F as DevframeDefinition, Ft as AgentTool, G as McpAuthorization, H as DevframeSnapshotRpcInputs, Ht as EventUnsubscribe, I as DevframeDeploymentKind, It as AgentToolInput, J as DevframeServiceDefinition, K as McpRouteOptions, L as DevframeDockDefaults, Lt as AgentToolProvider, Mt as AgentResource, Nt as AgentResourceContent, P as DevframeCliOptions, Pt as AgentResourceInput, Q as DevframeServiceMeta, R as DevframeDuplicationStrategy, Rt as AgentToolProviderHandle, St as DevframeStorageScope, U as DevframeSseOptions, Ut as EventsMap, V as DevframeSnapshotRpcEntry, Vt as EventEmitter, W as DevframeWsOptions, X as DevframeServiceId, Y as DevframeServiceDescriptor, Z as DevframeServiceInput, _t as DevframeViewHost, a as DevframeConnectionConfigsRegistry, at as DevframeScopedNodeContext, bt as DevframeRpcSharedStates, c as RpcBroadcastOptions, ct as DevframeSettings, d as RpcSharedStateHost, dt as ScopedBroadcastOptions, et as DevframeServiceScopeOf, f as RpcStreamingChannel, ft as ScopedClientFunctions, gt as SettingsForNamespace, ht as ScopedSharedStates, i as DevframeCapabilities, it as DevframeServicesState, jt as AgentManifest, l as RpcFunctionsHost, lt as DevframeSettingsRegistry, m as RpcStreamingHost, mt as ScopedServerFunctions, n as ConnectionMetaSse, nt as DevframeServicesRegistry, o as DevframeNodeContext, ot as DevframeScopedNodeRpc, p as RpcStreamingChannelOptions, pt as ScopedRpcFn, q as McpSetting, r as ConnectionMetaWebsocket, rt as DevframeServicesScopeRegistry, s as DevframeNodeRpcSession, st as DevframeScopedStreamingHost, t as ConnectionMeta, tt as DevframeServicesHost, u as RpcSharedStateGetOptions, ut as DevframeSettingsStore, vt as DevframeRpcClientFunctions, wt as DevframeDiagnosticsLogger, xt as DevframeHost, yt as DevframeRpcServerFunctions, z as DevframeRpcOptions, zt as DevframeAgentHost } from "../context-BBWPLDHh.mjs";
|
|
4
4
|
import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "../remote-assets-eBvSKZMS.mjs";
|
|
5
5
|
import { i as DevframeDefineDiagnosticsOptions } from "../nostics-0sKe5HIj.mjs";
|
|
6
|
-
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, AgentToolProvider, AgentToolProviderHandle, ConnectionMeta, ConnectionMetaSse, ConnectionMetaWebsocket, DevframeAgentHost, DevframeAgentHostEvents, DevframeCapabilities, DevframeCliOptions, DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockDefaults, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, DevframeRpcOptions, DevframeRpcServerFunctions, DevframeRpcSharedStates, type DevframeRpcTransportKind, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeServiceDefinition, DevframeServiceDescriptor, DevframeServiceId, DevframeServiceInput, DevframeServiceMeta, DevframeServiceOf, DevframeServiceScopeOf, DevframeServicesHost, DevframeServicesRegistry, DevframeServicesScopeRegistry, DevframeServicesState, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, DevframeSnapshotRpcEntry, DevframeSnapshotRpcInputs, DevframeSseOptions, DevframeStorageScope, DevframeViewHost, DevframeWsOptions, EventEmitter, EventUnsubscribe, EventsMap, McpAuthorization, McpRouteOptions, RemoteAssets, RemoteAssetsErrorMessage, RemoteAssetsProvider, RemoteAssetsProviderCustom, RemoteAssetsStore, RpcBroadcastOptions, type RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedRpcFn, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, StaticAssetsSource };
|
|
6
|
+
export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, AgentToolProvider, AgentToolProviderHandle, ConnectionMeta, ConnectionMetaSse, ConnectionMetaWebsocket, DevframeAgentHost, DevframeAgentHostEvents, DevframeCapabilities, DevframeCliOptions, DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockDefaults, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, DevframeRpcOptions, DevframeRpcServerFunctions, DevframeRpcSharedStates, type DevframeRpcTransportKind, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeServiceDefinition, DevframeServiceDescriptor, DevframeServiceId, DevframeServiceInput, DevframeServiceMeta, DevframeServiceOf, DevframeServiceScopeOf, DevframeServicesHost, DevframeServicesRegistry, DevframeServicesScopeRegistry, DevframeServicesState, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, DevframeSnapshotRpcEntry, DevframeSnapshotRpcInputs, DevframeSseOptions, DevframeStorageScope, DevframeViewHost, DevframeWsOptions, EventEmitter, EventUnsubscribe, EventsMap, McpAuthorization, McpRouteOptions, McpSetting, RemoteAssets, RemoteAssetsErrorMessage, RemoteAssetsProvider, RemoteAssetsProviderCustom, RemoteAssetsStore, RpcBroadcastOptions, type RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedRpcFn, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, StaticAssetsSource };
|
package/dist/utils/events.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as resolveStaticAssetsSource } from "../remote-assets-
|
|
1
|
+
import { t as resolveStaticAssetsSource } from "../remote-assets-DMFzLSoH.mjs";
|
|
2
2
|
export { resolveStaticAssetsSource };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as DEVFRAME_EVENTS } from "../events-BV4Dj59a.mjs";
|
|
2
|
+
import { realpath, stat } from "node:fs/promises";
|
|
2
3
|
import { extname, join, normalize, resolve, sep } from "pathe";
|
|
3
4
|
import { createReadStream } from "node:fs";
|
|
4
|
-
import { realpath, stat } from "node:fs/promises";
|
|
5
5
|
import { Readable } from "node:stream";
|
|
6
6
|
import { lookup } from "mrmime";
|
|
7
7
|
import { H3, defineHandler } from "h3";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as SharedStateEvents, D as ImmutableObject, E as ImmutableMap, M as SharedStatePatch, N as createSharedState, O as ImmutableSet, T as ImmutableArray, j as SharedStateOptions, k as SharedState, w as Immutable } from "../context-
|
|
1
|
+
import { A as SharedStateEvents, D as ImmutableObject, E as ImmutableMap, M as SharedStatePatch, N as createSharedState, O as ImmutableSet, T as ImmutableArray, j as SharedStateOptions, k as SharedState, w as Immutable } from "../context-BBWPLDHh.mjs";
|
|
2
2
|
export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as createStreamSink, S as createStreamReader, _ as CreateStreamSinkOptions, b as StreamSink, g as CreateStreamReaderOptions, h as BufferedChunk, v as StreamErrorPayload, x as StreamSinkEvents, y as StreamReader } from "../context-
|
|
1
|
+
import { C as createStreamSink, S as createStreamReader, _ as CreateStreamSinkOptions, b as StreamSink, g as CreateStreamReaderOptions, h as BufferedChunk, v as StreamErrorPayload, x as StreamSinkEvents, y as StreamReader } from "../context-BBWPLDHh.mjs";
|
|
2
2
|
export { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as diagnostics } from "./serialization-DFg5sUt6.mjs";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
//#region ../../node_modules/.pnpm/ohash@2.0.12/node_modules/ohash/dist/_chunks/is-equal.mjs
|
|
4
4
|
function serialize(input) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as strictJsonStringify } from "./serialization-
|
|
1
|
+
import { n as strictJsonStringify } from "./serialization-DFg5sUt6.mjs";
|
|
2
2
|
import { n as structuredCloneStringify, t as structuredCloneParse } from "./structured-clone-CbAV5rFI.mjs";
|
|
3
3
|
//#region src/rpc/wire-codec.ts
|
|
4
4
|
const EMPTY_WIRE_DEFS = /* @__PURE__ */ new Map();
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { n as validateDefinitions, r as getRpcHandler, s as hash } from "./validation-
|
|
2
|
-
import {
|
|
3
|
-
import { DEVFRAME_RPC_DUMP_DIRNAME } from "./constants.mjs";
|
|
1
|
+
import { n as validateDefinitions, r as getRpcHandler, s as hash } from "./validation-CfV1s0SF.mjs";
|
|
2
|
+
import { n as strictJsonStringify, r as diagnostics } from "./serialization-DFg5sUt6.mjs";
|
|
3
|
+
import { DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME } from "./constants.mjs";
|
|
4
|
+
import { n as structuredCloneStringify } from "./structured-clone-CbAV5rFI.mjs";
|
|
5
|
+
import fs from "node:fs/promises";
|
|
6
|
+
import { dirname, resolve } from "pathe";
|
|
4
7
|
//#region ../../node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.js
|
|
5
8
|
var Node = class {
|
|
6
9
|
value;
|
|
@@ -415,4 +418,22 @@ async function collectStaticRpcDump(definitions, context) {
|
|
|
415
418
|
};
|
|
416
419
|
}
|
|
417
420
|
//#endregion
|
|
418
|
-
|
|
421
|
+
//#region src/rpc/dump/write.ts
|
|
422
|
+
/**
|
|
423
|
+
* Write a collected static RPC dump to disk: every sharded record file plus
|
|
424
|
+
* the `__rpc-dump/index.json` manifest, under `outDir`. Shared by the build
|
|
425
|
+
* adapter (`createBuild`) and `@devframes/hub`'s `buildHub`.
|
|
426
|
+
*/
|
|
427
|
+
async function writeStaticRpcDump(dump, outDir, options = {}) {
|
|
428
|
+
const indent = options.pretty ? 2 : void 0;
|
|
429
|
+
await fs.mkdir(resolve(outDir, DEVFRAME_RPC_DUMP_DIRNAME), { recursive: true });
|
|
430
|
+
for (const [filepath, file] of Object.entries(dump.files)) {
|
|
431
|
+
const fullpath = resolve(outDir, filepath);
|
|
432
|
+
await fs.mkdir(dirname(fullpath), { recursive: true });
|
|
433
|
+
const text = file.serialization === "structured-clone" ? structuredCloneStringify(file.data) : strictJsonStringify(file.data, file.fnName);
|
|
434
|
+
await fs.writeFile(fullpath, file.serialization === "json" && indent != null ? JSON.stringify(JSON.parse(text), null, indent) : text, "utf-8");
|
|
435
|
+
}
|
|
436
|
+
await fs.writeFile(resolve(outDir, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME), JSON.stringify(dump.manifest, null, 2), "utf-8");
|
|
437
|
+
}
|
|
438
|
+
//#endregion
|
|
439
|
+
export { getDefinitionsWithDumps as a, dumpFunctions as i, collectStaticRpcDump as n, reviveDumpError as o, createClientFromDump as r, serializeDumpError as s, writeStaticRpcDump as t };
|