devframe 0.9.2 → 0.9.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.
Files changed (60) hide show
  1. package/dist/{_shared-BAGBgTUO.d.mts → _shared-BPovvJW8.d.mts} +1 -1
  2. package/dist/adapters/build.d.mts +11 -2
  3. package/dist/adapters/build.mjs +40 -4
  4. package/dist/adapters/cac.d.mts +1 -1
  5. package/dist/adapters/cac.mjs +1 -1
  6. package/dist/adapters/dev.d.mts +4 -4
  7. package/dist/adapters/dev.mjs +1 -1
  8. package/dist/adapters/embedded.d.mts +1 -1
  9. package/dist/adapters/initiate.d.mts +3 -3
  10. package/dist/adapters/initiate.mjs +1 -1
  11. package/dist/adapters/mcp.d.mts +1 -1
  12. package/dist/adapters/mcp.mjs +1 -1
  13. package/dist/cli/main.mjs +2 -2
  14. package/dist/client/index.d.mts +5 -5
  15. package/dist/{context-af2w_F0_.mjs → context-BUJGvlje.mjs} +1 -1
  16. package/dist/{context-al99DDJ8.d.mts → context-CO7eZHJy.d.mts} +1 -1
  17. package/dist/{context-riPPHGiu.mjs → context-CQW0lSw8.mjs} +10 -5
  18. package/dist/{devframe-mbfgpQQC.d.mts → context-_i51nYOs.d.mts} +1199 -1170
  19. package/dist/{dev-BKm_HisC.mjs → dev-lpIvwagf.mjs} +5 -5
  20. package/dist/{diagnostics-DI1HGj2I.mjs → diagnostics-BXWW3VK-.mjs} +4 -0
  21. package/dist/{host-agent-DVDLqjvj.mjs → host-agent-B84av916.mjs} +1 -1
  22. package/dist/{http-POepPnaQ.mjs → http-BKiqHcXX.mjs} +2 -2
  23. package/dist/{index-Dipgo9ji.d.mts → index-CEvd-YXD.d.mts} +2 -2
  24. package/dist/{index-tdrk1bzV.d.mts → index-DOg4S5wk.d.mts} +1 -1
  25. package/dist/index.d.mts +6 -6
  26. package/dist/{instance-registry-Dy28drtm.mjs → instance-registry-BjlMQbFB.mjs} +1 -1
  27. package/dist/{instance-shell-GqTY93gC.mjs → instance-shell-B-uevnK-.mjs} +4 -4
  28. package/dist/{instance-shell-mU5j5xWn.d.mts → instance-shell-BHvBIGP4.d.mts} +3 -3
  29. package/dist/internal/index.d.mts +11 -5
  30. package/dist/internal/index.mjs +5 -5
  31. package/dist/node/auth.d.mts +2 -2
  32. package/dist/node/hub-internals.d.mts +2 -2
  33. package/dist/node/hub-internals.mjs +1 -1
  34. package/dist/node/index.d.mts +3 -3
  35. package/dist/node/index.mjs +2 -2
  36. package/dist/recipes/common-rpc-functions.d.mts +3 -3
  37. package/dist/recipes/interactive-auth.d.mts +2 -2
  38. package/dist/recipes/interactive-auth.mjs +1 -1
  39. package/dist/{remote-assets-CqxiyltC.mjs → remote-assets-DezQmPQU.mjs} +1 -1
  40. package/dist/rpc/dump.d.mts +1 -1
  41. package/dist/rpc/index.d.mts +2 -2
  42. package/dist/rpc/transports/sse-client.d.mts +1 -1
  43. package/dist/rpc/transports/sse-server.d.mts +2 -2
  44. package/dist/rpc/transports/ws-bun.d.mts +2 -2
  45. package/dist/rpc/transports/ws-client.d.mts +1 -1
  46. package/dist/rpc/transports/ws-deno.d.mts +2 -2
  47. package/dist/rpc/transports/ws-server.d.mts +1 -1
  48. package/dist/{rpc-core-dV69u4lY.d.mts → rpc-core-CDZoGYiD.d.mts} +3 -3
  49. package/dist/{rpc-core-DRYnbxdD.mjs → rpc-core-DlHd276T.mjs} +1 -1
  50. package/dist/{sse-client-CFBOIaUi.d.mts → sse-client-CdGD_B8_.d.mts} +1 -1
  51. package/dist/{storage-BNqSAOxA.mjs → storage-BXNVhKyR.mjs} +1 -1
  52. package/dist/types/index.d.mts +5 -5
  53. package/dist/{types-Djq7CBXh.d.mts → types-BBLeGfpt.d.mts} +1 -1
  54. package/dist/utils/events.d.mts +1 -1
  55. package/dist/utils/remote-assets.mjs +1 -1
  56. package/dist/utils/shared-state.d.mts +1 -1
  57. package/dist/utils/streaming-channel.d.mts +1 -1
  58. package/dist/{ws-client-DhjNyQo3.d.mts → ws-client-Bo2t6hES.d.mts} +1 -1
  59. package/dist/{ws-server-D1d3QM9f.d.mts → ws-server-DLtEoLdR.d.mts} +1 -1
  60. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { d as ConnectionMeta, l as McpRouteOptions, n as DevframeDefinition, r as DevframeDeploymentKind } from "./devframe-mbfgpQQC.mjs";
1
+ import { F as DevframeDefinition, G as McpRouteOptions, I as DevframeDeploymentKind, t as ConnectionMeta } from "./context-_i51nYOs.mjs";
2
2
  //#region src/adapters/_shared.d.ts
3
3
  /**
4
4
  * Resolve the mount base path for a devframe's SPA. Hosted adapters
@@ -1,4 +1,4 @@
1
- import { n as DevframeDefinition } from "../devframe-mbfgpQQC.mjs";
1
+ import { F as DevframeDefinition, V as DevframeSnapshotRpcEntry, o as DevframeNodeContext } from "../context-_i51nYOs.mjs";
2
2
  import { o as StaticAssetsSource } from "../remote-assets-Bg4gCUZ_.mjs";
3
3
  //#region src/adapters/build.d.ts
4
4
  interface CreateBuildOptions {
@@ -37,5 +37,14 @@ interface CreateBuildOptions {
37
37
  * `/devframe/`, or any base, no rewriting required.
38
38
  */
39
39
  declare function createBuild(d: DevframeDefinition, options?: CreateBuildOptions): Promise<void>;
40
+ /**
41
+ * Attach a `dump` to each {@link DevframeRpcOptions.snapshot} target so the
42
+ * static collector bakes it, even though the (service-owned) definition
43
+ * declares no dump of its own. A bare method id becomes `snapshot: true`
44
+ * (bakes the no-arg call); `{ method, inputs }` bakes one record per resolved
45
+ * argument-tuple by running the target's own handler, with the first tuple's
46
+ * output as the fallback.
47
+ */
48
+ declare function applySnapshotRpc(ctx: DevframeNodeContext, entries: readonly DevframeSnapshotRpcEntry[] | undefined): void;
40
49
  //#endregion
41
- export { CreateBuildOptions, createBuild };
50
+ export { CreateBuildOptions, applySnapshotRpc, createBuild };
@@ -3,9 +3,9 @@ import { n as strictJsonStringify } from "../serialization-BGzEwAdr.mjs";
3
3
  import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME } from "../constants.mjs";
4
4
  import { t as collectStaticRpcDump } from "../static-DV_qUSRS.mjs";
5
5
  import { n as structuredCloneStringify } from "../structured-clone-CbAV5rFI.mjs";
6
- import { t as diagnostics } from "../diagnostics-DI1HGj2I.mjs";
7
- import { t as createHostContext } from "../context-riPPHGiu.mjs";
8
- import { t as resolveStaticAssetsSource } from "../remote-assets-CqxiyltC.mjs";
6
+ import { t as diagnostics } from "../diagnostics-BXWW3VK-.mjs";
7
+ import { t as createHostContext } from "../context-CQW0lSw8.mjs";
8
+ import { t as resolveStaticAssetsSource } from "../remote-assets-DezQmPQU.mjs";
9
9
  import { t as createH3DevframeHost } from "../host-h3-fRbF9yor.mjs";
10
10
  import process from "node:process";
11
11
  import { dirname, resolve } from "pathe";
@@ -51,6 +51,7 @@ async function createBuild(d, options = {}) {
51
51
  for (const input of d.services ?? []) ctx.services.install(input, { resolveFrom: d.importMetaUrl });
52
52
  await ctx.services.ready();
53
53
  await d.setup(ctx);
54
+ applySnapshotRpc(ctx, d.rpc?.snapshot);
54
55
  await fs$1.mkdir(resolve(outDir, DEVFRAME_RPC_DUMP_DIRNAME), { recursive: true });
55
56
  const jsonSerializableMethods = [];
56
57
  for (const def of ctx.rpc.definitions.values()) if (def.jsonSerializable === true) jsonSerializableMethods.push(def.name);
@@ -70,5 +71,40 @@ async function createBuild(d, options = {}) {
70
71
  await fs$1.writeFile(resolve(outDir, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME), JSON.stringify(dump.manifest, null, 2), "utf-8");
71
72
  console.log(colors.green`[devframe] built "${d.id}" -> ${outDir}`);
72
73
  }
74
+ /**
75
+ * Attach a `dump` to each {@link DevframeRpcOptions.snapshot} target so the
76
+ * static collector bakes it, even though the (service-owned) definition
77
+ * declares no dump of its own. A bare method id becomes `snapshot: true`
78
+ * (bakes the no-arg call); `{ method, inputs }` bakes one record per resolved
79
+ * argument-tuple by running the target's own handler, with the first tuple's
80
+ * output as the fallback.
81
+ */
82
+ function applySnapshotRpc(ctx, entries) {
83
+ for (const entry of entries ?? []) {
84
+ const method = typeof entry === "string" ? entry : entry.method;
85
+ const def = ctx.rpc.definitions.get(method);
86
+ if (!def) {
87
+ diagnostics.DF0072({ method });
88
+ continue;
89
+ }
90
+ if (typeof entry === "string") {
91
+ def.snapshot = true;
92
+ continue;
93
+ }
94
+ const inputsSpec = entry.inputs;
95
+ def.dump = async (dumpCtx, handler) => {
96
+ const tuples = typeof inputsSpec === "function" ? await inputsSpec(dumpCtx) : inputsSpec;
97
+ const records = [];
98
+ for (const input of tuples) records.push({
99
+ inputs: [...input],
100
+ output: await handler(...input)
101
+ });
102
+ return {
103
+ records,
104
+ fallback: records[0]?.output
105
+ };
106
+ };
107
+ }
108
+ }
73
109
  //#endregion
74
- export { createBuild };
110
+ export { applySnapshotRpc, createBuild };
@@ -1,4 +1,4 @@
1
- import { Ft as CliFlagsSchema, It as InferCliFlags, Lt as defineCliFlags, Rt as parseCliFlags, n as DevframeDefinition } from "../devframe-mbfgpQQC.mjs";
1
+ import { Dt as parseCliFlags, Et as defineCliFlags, F as DevframeDefinition, Tt as InferCliFlags, wt as CliFlagsSchema } from "../context-_i51nYOs.mjs";
2
2
  import { CAC } from "cac";
3
3
  import { H3 } from "h3";
4
4
  //#region src/adapters/cac.d.ts
@@ -1,7 +1,7 @@
1
1
  import { s as colors } from "../nostics-CzECRXpE.mjs";
2
2
  import { r as resolveDevServerPort } from "../_shared-BM3PdYli.mjs";
3
3
  import { createBuild } from "./build.mjs";
4
- import { t as createDevServer } from "../dev-BKm_HisC.mjs";
4
+ import { t as createDevServer } from "../dev-lpIvwagf.mjs";
5
5
  import process from "node:process";
6
6
  import cac$1 from "cac";
7
7
  //#region src/adapters/flags.ts
@@ -1,8 +1,8 @@
1
- import { _ as DevframeNodeRpcSession, c as DevframeWsOptions, l as McpRouteOptions, n as DevframeDefinition, s as DevframeSseOptions, u as DevframeAuthHandler } from "../devframe-mbfgpQQC.mjs";
2
- import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-D1d3QM9f.mjs";
1
+ import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-DLtEoLdR.mjs";
2
+ import { Ct as DevframeAuthHandler, F as DevframeDefinition, G as McpRouteOptions, U as DevframeSseOptions, W as DevframeWsOptions, s as DevframeNodeRpcSession } from "../context-_i51nYOs.mjs";
3
3
  import { o as StaticAssetsSource } from "../remote-assets-Bg4gCUZ_.mjs";
4
- import { c as StartedServer } from "../instance-shell-mU5j5xWn.mjs";
5
- import { a as resolveMcpConnectionMeta, i as resolveDevServerPort, t as ResolveDevServerPortOptions } from "../_shared-BAGBgTUO.mjs";
4
+ import { c as StartedServer } from "../instance-shell-BHvBIGP4.mjs";
5
+ import { a as resolveMcpConnectionMeta, i as resolveDevServerPort, t as ResolveDevServerPortOptions } from "../_shared-BPovvJW8.mjs";
6
6
  import { H3 } from "h3";
7
7
  //#region src/adapters/dev.d.ts
8
8
  interface CreateDevServerOptions {
@@ -1,3 +1,3 @@
1
1
  import { i as resolveMcpConnectionMeta, r as resolveDevServerPort } from "../_shared-BM3PdYli.mjs";
2
- import { t as createDevServer } from "../dev-BKm_HisC.mjs";
2
+ import { t as createDevServer } from "../dev-lpIvwagf.mjs";
3
3
  export { createDevServer, resolveDevServerPort, resolveMcpConnectionMeta };
@@ -1,4 +1,4 @@
1
- import { g as DevframeNodeContext, n as DevframeDefinition } from "../devframe-mbfgpQQC.mjs";
1
+ import { F as DevframeDefinition, o as DevframeNodeContext } from "../context-_i51nYOs.mjs";
2
2
  //#region src/adapters/embedded.d.ts
3
3
  interface CreateEmbeddedOptions {
4
4
  /** Target context the devframe is registered into. Required. */
@@ -1,7 +1,7 @@
1
- import { $ as DevframeStorageScope, _ as DevframeNodeRpcSession, c as DevframeWsOptions, d as ConnectionMeta, g as DevframeNodeContext, l as McpRouteOptions, n as DevframeDefinition, s as DevframeSseOptions, u as DevframeAuthHandler } from "../devframe-mbfgpQQC.mjs";
2
- import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-D1d3QM9f.mjs";
1
+ import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "../ws-server-DLtEoLdR.mjs";
2
+ import { Ct as DevframeAuthHandler, F as DevframeDefinition, G as McpRouteOptions, U as DevframeSseOptions, W as DevframeWsOptions, bt as DevframeStorageScope, o as DevframeNodeContext, s as DevframeNodeRpcSession, t as ConnectionMeta } from "../context-_i51nYOs.mjs";
3
3
  import { o as StaticAssetsSource } from "../remote-assets-Bg4gCUZ_.mjs";
4
- import { c as StartedServer, f as DevframeInstanceRecord } from "../instance-shell-mU5j5xWn.mjs";
4
+ import { c as StartedServer, f as DevframeInstanceRecord } from "../instance-shell-BHvBIGP4.mjs";
5
5
  import { Buffer } from "node:buffer";
6
6
  import { IncomingMessage, Server, ServerResponse } from "node:http";
7
7
  import { Duplex } from "node:stream";
@@ -1,2 +1,2 @@
1
- import { n as getInstanceInternals, r as initDevframe } from "../dev-BKm_HisC.mjs";
1
+ import { n as getInstanceInternals, r as initDevframe } from "../dev-lpIvwagf.mjs";
2
2
  export { getInstanceInternals, initDevframe };
@@ -1,4 +1,4 @@
1
- import { g as DevframeNodeContext, n as DevframeDefinition } from "../devframe-mbfgpQQC.mjs";
1
+ import { F as DevframeDefinition, o as DevframeNodeContext } from "../context-_i51nYOs.mjs";
2
2
  import { H3 } from "h3";
3
3
  import "@modelcontextprotocol/server";
4
4
  //#region src/adapters/mcp/build-server.d.ts
@@ -1,2 +1,2 @@
1
- import { i as createMcpServer, n as mountMcpHttp, r as createMcpFetchHandler } from "../http-POepPnaQ.mjs";
1
+ import { i as createMcpServer, n as mountMcpHttp, r as createMcpFetchHandler } from "../http-BKiqHcXX.mjs";
2
2
  export { createMcpFetchHandler, createMcpServer, mountMcpHttp };
package/dist/cli/main.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as Diagnostic } from "../nostics-CzECRXpE.mjs";
2
- import { t as diagnostics } from "../diagnostics-DI1HGj2I.mjs";
3
- import { n as listLiveDevframeInstances, r as probeDevframeOrigin } from "../instance-registry-Dy28drtm.mjs";
2
+ import { t as diagnostics } from "../diagnostics-BXWW3VK-.mjs";
3
+ import { n as listLiveDevframeInstances, r as probeDevframeOrigin } from "../instance-registry-BjlMQbFB.mjs";
4
4
  import { t as toAgentToolName } from "../agent-tool-name-EgfoFO8C.mjs";
5
5
  import process from "node:process";
6
6
  import { joinURL } from "ufo";
@@ -1,8 +1,8 @@
1
- import { E as DevframeRpcServerFunctions, H as DevframeSettings, J as ScopedServerFunctions, M as DevframeServiceMeta, Mt as EventEmitter, P as DevframeServiceScopeOf, R as DevframeServicesState, T as DevframeRpcClientFunctions, X as SettingsForNamespace, Y as ScopedSharedStates, b as RpcSharedStateGetOptions, d as ConnectionMeta, gt as SharedState, ot as StreamReader, q as ScopedRpcFn, st as StreamSink, x as RpcSharedStateHost } from "../devframe-mbfgpQQC.mjs";
2
- import { f as RpcCacheManager, p as RpcCacheOptions } from "../index-tdrk1bzV.mjs";
3
- import { _ as RpcFunctionDefinition, w as RpcFunctionsCollector } from "../types-Djq7CBXh.mjs";
4
- import { t as SseRpcChannelOptions } from "../sse-client-CFBOIaUi.mjs";
5
- import { t as WsRpcChannelOptions } from "../ws-client-DhjNyQo3.mjs";
1
+ import { f as RpcCacheManager, p as RpcCacheOptions } from "../index-DOg4S5wk.mjs";
2
+ import { _ as RpcFunctionDefinition, w as RpcFunctionsCollector } from "../types-BBLeGfpt.mjs";
3
+ import { Q as DevframeServiceScopeOf, X as DevframeServiceMeta, _t as DevframeRpcServerFunctions, b as StreamSink, d as RpcSharedStateHost, dt as ScopedRpcFn, ft as ScopedServerFunctions, gt as DevframeRpcClientFunctions, k as SharedState, mt as SettingsForNamespace, nt as DevframeServicesState, ot as DevframeSettings, pt as ScopedSharedStates, t as ConnectionMeta, u as RpcSharedStateGetOptions, y as StreamReader, zt as EventEmitter } from "../context-_i51nYOs.mjs";
4
+ import { t as SseRpcChannelOptions } from "../sse-client-CdGD_B8_.mjs";
5
+ import { t as WsRpcChannelOptions } from "../ws-client-Bo2t6hES.mjs";
6
6
  import { BirpcOptions, BirpcReturn } from "birpc";
7
7
  //#region src/client/connection.d.ts
8
8
  interface DevframeConnection {
@@ -1,5 +1,5 @@
1
1
  import { n as randomToken } from "./crypto-token-XCqTSMg9.mjs";
2
- import { t as createStorage } from "./storage-BNqSAOxA.mjs";
2
+ import { t as createStorage } from "./storage-BXNVhKyR.mjs";
3
3
  import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "./revoke-3Q6aDKWk.mjs";
4
4
  import { join } from "pathe";
5
5
  //#region src/node/hub-internals/context.ts
@@ -1,4 +1,4 @@
1
- import { g as DevframeNodeContext, gt as SharedState } from "./devframe-mbfgpQQC.mjs";
1
+ import { k as SharedState, o as DevframeNodeContext } from "./context-_i51nYOs.mjs";
2
2
  //#region src/node/hub-internals/context.d.ts
3
3
  interface InternalAnonymousAuthStorage {
4
4
  trusted: Record<string, {
@@ -4,10 +4,10 @@ import { RpcFunctionsCollectorBase } from "./rpc/index.mjs";
4
4
  import { defineRpcFunction } from "./index.mjs";
5
5
  import { t as DEVFRAME_EVENTS } from "./events-DKfSmoTj.mjs";
6
6
  import { DEVFRAME_SERVICES_STATE_KEY } from "./constants.mjs";
7
- import { t as diagnostics$1 } from "./diagnostics-DI1HGj2I.mjs";
8
- import { r as createEventEmitter, t as DevframeAgentHost } from "./host-agent-DVDLqjvj.mjs";
9
- import { n as createDebug, t as resolveStaticAssetsSource } from "./remote-assets-CqxiyltC.mjs";
10
- import { t as createStorage } from "./storage-BNqSAOxA.mjs";
7
+ import { t as diagnostics$1 } from "./diagnostics-BXWW3VK-.mjs";
8
+ import { r as createEventEmitter, t as DevframeAgentHost } from "./host-agent-B84av916.mjs";
9
+ import { n as createDebug, t as resolveStaticAssetsSource } from "./remote-assets-DezQmPQU.mjs";
10
+ import { t as createStorage } from "./storage-BXNVhKyR.mjs";
11
11
  import { createRequire } from "node:module";
12
12
  import { createSharedState } from "devframe/utils/shared-state";
13
13
  import process from "node:process";
@@ -809,7 +809,12 @@ async function importServicePackage(pkg, resolveFroms) {
809
809
  lastError = error;
810
810
  continue;
811
811
  }
812
- return await import(pathToFileURL(resolved).href);
812
+ return await import(
813
+ /* webpackIgnore: true */
814
+ /* @vite-ignore */
815
+ /* turbopackIgnore: true */
816
+ pathToFileURL(resolved).href
817
+ );
813
818
  }
814
819
  throw lastError;
815
820
  }