devframe 0.9.0-beta.4 → 0.9.0-beta.6

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 (65) hide show
  1. package/dist/{_shared-CGPVmXUM.mjs → _shared-CKZPvSrN.mjs} +2 -1
  2. package/dist/{_shared-Bm8p4-fD.d.mts → _shared-QkI6ljJS.d.mts} +2 -2
  3. package/dist/adapters/build.d.mts +10 -12
  4. package/dist/adapters/build.mjs +23 -27
  5. package/dist/adapters/cac.d.mts +1 -1
  6. package/dist/adapters/cac.mjs +3 -4
  7. package/dist/adapters/dev.d.mts +19 -5
  8. package/dist/adapters/dev.mjs +2 -2
  9. package/dist/adapters/embedded.d.mts +1 -1
  10. package/dist/adapters/initiate.d.mts +4 -3
  11. package/dist/adapters/initiate.mjs +1 -1
  12. package/dist/adapters/mcp.d.mts +1 -1
  13. package/dist/adapters/mcp.mjs +1 -1
  14. package/dist/cli/main.mjs +2 -2
  15. package/dist/client/index.d.mts +1 -1
  16. package/dist/client/index.mjs +2 -1175
  17. package/dist/constants.d.mts +1 -2
  18. package/dist/constants.mjs +1 -2
  19. package/dist/{context-DV4uWieM.d.mts → context-CQkRTbAc.d.mts} +1 -1
  20. package/dist/{context-b6iSomtv.mjs → context-D0HD0F7C.mjs} +19 -7
  21. package/dist/{context-CMSryXs-.mjs → context-D0jErmlx.mjs} +1 -1
  22. package/dist/{dev-4xjiynUD.mjs → dev-QEuT8SOF.mjs} +15 -9
  23. package/dist/{devframe-5oblos7I.d.mts → devframe-Cfx6doi4.d.mts} +41 -64
  24. package/dist/{diagnostics-C7IGWppM.mjs → diagnostics-DEuH3P5O.mjs} +32 -0
  25. package/dist/{host-agent-BBkKT27Q.mjs → host-agent-C5HjzfBz.mjs} +41 -3
  26. package/dist/{host-h3-CzCZwtuV.mjs → host-h3-Crkzm42q.mjs} +2 -2
  27. package/dist/{http-Z0w9baEe.mjs → http-CVwj7b4g.mjs} +2 -2
  28. package/dist/{index-BzDl02lt.d.mts → index-MYi1SZVL.d.mts} +2 -2
  29. package/dist/index.d.mts +3 -2
  30. package/dist/{instance-registry-Du_hbx-j.mjs → instance-registry-M2p-z6xE.mjs} +1 -1
  31. package/dist/{instance-shell-B0TwOxCl.mjs → instance-shell-DJ8s-MFw.mjs} +5 -5
  32. package/dist/{instance-shell-B-BSVp37.d.mts → instance-shell-D_UA0Idz.d.mts} +2 -2
  33. package/dist/internal/index.d.mts +72 -10
  34. package/dist/internal/index.mjs +7 -7
  35. package/dist/node/auth.d.mts +2 -2
  36. package/dist/node/auth.mjs +1 -1
  37. package/dist/node/hub-internals.d.mts +2 -2
  38. package/dist/node/hub-internals.mjs +2 -2
  39. package/dist/node/index.d.mts +1 -1
  40. package/dist/node/index.mjs +2 -2
  41. package/dist/recipes/common-rpc-functions.d.mts +1 -1
  42. package/dist/recipes/interactive-auth.d.mts +2 -2
  43. package/dist/recipes/interactive-auth.mjs +2 -2
  44. package/dist/remote-assets-DclsYyoL.d.mts +106 -0
  45. package/dist/rpc/transports/ws-bun.d.mts +1 -1
  46. package/dist/{rpc-core-B4Qm66Qt.d.mts → rpc-core-C8JQ3p7A.d.mts} +2 -2
  47. package/dist/{rpc-core-Cva-0pw0.mjs → rpc-core-IhcWl_xn.mjs} +1 -1
  48. package/dist/state-Cc1IeSmQ.mjs +1291 -0
  49. package/dist/storage-BVuipbGS.mjs +137 -0
  50. package/dist/types/index.d.mts +3 -2
  51. package/dist/utils/events.d.mts +1 -1
  52. package/dist/utils/open.d.mts +2 -10
  53. package/dist/utils/open.mjs +56 -1
  54. package/dist/utils/remote-assets.d.mts +15 -0
  55. package/dist/utils/remote-assets.mjs +309 -0
  56. package/dist/utils/serve-static.d.mts +13 -5
  57. package/dist/utils/serve-static.mjs +103 -9
  58. package/dist/utils/shared-state.d.mts +1 -1
  59. package/dist/utils/streaming-channel.d.mts +1 -1
  60. package/package.json +2 -3
  61. package/skills/devframe/SKILL.md +4 -5
  62. package/dist/open-Dz4V4irZ.mjs +0 -547
  63. package/dist/state-BeUHDDjk.mjs +0 -108
  64. package/dist/storage-CaUVrBrG.mjs +0 -1122
  65. package/skills/devframe/templates/spa-devframe.ts +0 -38
@@ -39,7 +39,6 @@ declare const DEVFRAME_SSE_SESSION_HEADER = "x-birpc-session";
39
39
  declare const DEVFRAME_MCP_ROUTE = "__mcp";
40
40
  declare const DEVFRAME_RPC_DUMP_MANIFEST_FILENAME = "__rpc-dump/index.json";
41
41
  declare const DEVFRAME_DOCK_IMPORTS_FILENAME = "__client-imports.js";
42
- declare const DEVFRAME_DOCK_IMPORTS_VIRTUAL_ID = "/__devframe-client-imports.js";
43
42
  declare const DEVFRAME_RPC_DUMP_DIRNAME = "__rpc-dump";
44
43
  /**
45
44
  * URL fragment / query parameter name carrying the remote dock
@@ -86,4 +85,4 @@ declare const ANONYMOUS_RPC_PREFIX = "anonymous:";
86
85
  */
87
86
  declare function isAnonymousRpcMethod(name: string): boolean;
88
87
  //#endregion
89
- export { ANONYMOUS_RPC_PREFIX, DEVFRAME_AUTH_TOKEN_QUERY_PARAM, DEVFRAME_CONNECTION_KEY, DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_DOCK_IMPORTS_FILENAME, DEVFRAME_DOCK_IMPORTS_VIRTUAL_ID, DEVFRAME_MCP_ROUTE, DEVFRAME_OTP_URL_PARAM, DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME, DEVFRAME_SSE_ROUTE, DEVFRAME_SSE_SESSION_HEADER, DEVFRAME_VIEWER_ORIGIN_QUERY_PARAM, DEVFRAME_VIEWER_ORIGIN_TOKEN_QUERY_PARAM, DEVFRAME_WS_ROUTE, REMOTE_CONNECTION_KEY, isAnonymousRpcMethod };
88
+ export { ANONYMOUS_RPC_PREFIX, DEVFRAME_AUTH_TOKEN_QUERY_PARAM, DEVFRAME_CONNECTION_KEY, DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_DOCK_IMPORTS_FILENAME, DEVFRAME_MCP_ROUTE, DEVFRAME_OTP_URL_PARAM, DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME, DEVFRAME_SSE_ROUTE, DEVFRAME_SSE_SESSION_HEADER, DEVFRAME_VIEWER_ORIGIN_QUERY_PARAM, DEVFRAME_VIEWER_ORIGIN_TOKEN_QUERY_PARAM, DEVFRAME_WS_ROUTE, REMOTE_CONNECTION_KEY, isAnonymousRpcMethod };
@@ -39,7 +39,6 @@ const DEVFRAME_SSE_SESSION_HEADER = "x-birpc-session";
39
39
  const DEVFRAME_MCP_ROUTE = "__mcp";
40
40
  const DEVFRAME_RPC_DUMP_MANIFEST_FILENAME = "__rpc-dump/index.json";
41
41
  const DEVFRAME_DOCK_IMPORTS_FILENAME = "__client-imports.js";
42
- const DEVFRAME_DOCK_IMPORTS_VIRTUAL_ID = "/__devframe-client-imports.js";
43
42
  const DEVFRAME_RPC_DUMP_DIRNAME = "__rpc-dump";
44
43
  /**
45
44
  * URL fragment / query parameter name carrying the remote dock
@@ -88,4 +87,4 @@ function isAnonymousRpcMethod(name) {
88
87
  return name.startsWith(ANONYMOUS_RPC_PREFIX);
89
88
  }
90
89
  //#endregion
91
- export { ANONYMOUS_RPC_PREFIX, DEVFRAME_AUTH_TOKEN_QUERY_PARAM, DEVFRAME_CONNECTION_KEY, DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_DOCK_IMPORTS_FILENAME, DEVFRAME_DOCK_IMPORTS_VIRTUAL_ID, DEVFRAME_MCP_ROUTE, DEVFRAME_OTP_URL_PARAM, DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME, DEVFRAME_SSE_ROUTE, DEVFRAME_SSE_SESSION_HEADER, DEVFRAME_VIEWER_ORIGIN_QUERY_PARAM, DEVFRAME_VIEWER_ORIGIN_TOKEN_QUERY_PARAM, DEVFRAME_WS_ROUTE, REMOTE_CONNECTION_KEY, isAnonymousRpcMethod };
90
+ export { ANONYMOUS_RPC_PREFIX, DEVFRAME_AUTH_TOKEN_QUERY_PARAM, DEVFRAME_CONNECTION_KEY, DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_DOCK_IMPORTS_FILENAME, DEVFRAME_MCP_ROUTE, DEVFRAME_OTP_URL_PARAM, DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME, DEVFRAME_SSE_ROUTE, DEVFRAME_SSE_SESSION_HEADER, DEVFRAME_VIEWER_ORIGIN_QUERY_PARAM, DEVFRAME_VIEWER_ORIGIN_TOKEN_QUERY_PARAM, DEVFRAME_WS_ROUTE, REMOTE_CONNECTION_KEY, isAnonymousRpcMethod };
@@ -1,4 +1,4 @@
1
- import { S as DevframeNodeContext, _t as SharedState } from "./devframe-5oblos7I.mjs";
1
+ import { g as DevframeNodeContext, ut as SharedState } from "./devframe-Cfx6doi4.mjs";
2
2
  //#region src/node/hub-internals/context.d.ts
3
3
  interface InternalAnonymousAuthStorage {
4
4
  trusted: Record<string, {
@@ -2,12 +2,14 @@ import { t as devframeReporter } from "./diagnostics-reporter-CsIG85Q5.mjs";
2
2
  import { t as diagnostics } from "./diagnostics-hwjXp_UV.mjs";
3
3
  import { RpcFunctionsCollectorBase } from "./rpc/index.mjs";
4
4
  import { defineRpcFunction } from "./index.mjs";
5
- import { t as diagnostics$1 } from "./diagnostics-C7IGWppM.mjs";
6
- import { i as createEventEmitter, n as createSharedState, r as nanoid, t as createStorage } from "./storage-CaUVrBrG.mjs";
7
- import { t as DevframeAgentHost } from "./host-agent-BBkKT27Q.mjs";
5
+ import { t as diagnostics$1 } from "./diagnostics-DEuH3P5O.mjs";
6
+ import { r as createEventEmitter, t as DevframeAgentHost } from "./host-agent-C5HjzfBz.mjs";
7
+ import { resolveStaticAssetsSource } from "./utils/remote-assets.mjs";
8
+ import { t as createStorage } from "./storage-BVuipbGS.mjs";
8
9
  import { defineDiagnostics } from "nostics";
9
10
  import { isatty } from "node:tty";
10
11
  import { formatWithOptions, inspect } from "node:util";
12
+ import { createSharedState } from "devframe/utils/shared-state";
11
13
  import { existsSync } from "node:fs";
12
14
  import { join } from "pathe";
13
15
  //#region src/node/host-diagnostics.ts
@@ -431,6 +433,15 @@ function createRpcSharedStateServerHost(rpc) {
431
433
  return host;
432
434
  }
433
435
  //#endregion
436
+ //#region src/utils/nanoid.ts
437
+ const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
438
+ function nanoid(size = 21) {
439
+ let id = "";
440
+ let i = size;
441
+ while (i--) id += urlAlphabet[Math.random() * 64 | 0];
442
+ return id;
443
+ }
444
+ //#endregion
434
445
  //#region src/utils/streaming-channel.ts
435
446
  const DEFAULT_HIGH_WATER_MARK = 256;
436
447
  var StreamClosedError = class extends Error {
@@ -1093,13 +1104,14 @@ var DevframeViewHost = class {
1093
1104
  constructor(context) {
1094
1105
  this.context = context;
1095
1106
  }
1096
- hostStatic(baseUrl, distDir) {
1097
- if (!existsSync(distDir)) throw diagnostics$1.DF0008({ distDir });
1107
+ hostStatic(baseUrl, source) {
1108
+ const resolved = resolveStaticAssetsSource(source, this.context.host.getStorageDir("project"));
1109
+ if (typeof resolved === "string" && !existsSync(resolved)) throw diagnostics$1.DF0008({ distDir: resolved });
1098
1110
  this.buildStaticDirs.push({
1099
1111
  baseUrl,
1100
- distDir
1112
+ source
1101
1113
  });
1102
- this.context.host.mountStatic(baseUrl, distDir);
1114
+ this.context.host.mountStatic(baseUrl, resolved);
1103
1115
  }
1104
1116
  };
1105
1117
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { n as randomToken } from "./crypto-token-XCqTSMg9.mjs";
2
- import { t as createStorage } from "./storage-CaUVrBrG.mjs";
2
+ import { t as createStorage } from "./storage-BVuipbGS.mjs";
3
3
  import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "./revoke-DZbJ7Cl0.mjs";
4
4
  import { join } from "pathe";
5
5
  //#region src/node/hub-internals/context.ts
@@ -1,10 +1,11 @@
1
1
  import { DEVFRAME_CONNECTION_META_FILENAME } from "./constants.mjs";
2
- import { t as diagnostics } from "./diagnostics-C7IGWppM.mjs";
3
- import { t as createHostContext } from "./context-b6iSomtv.mjs";
4
- import { i as resolveMcpConnectionMeta, n as resolveBasePath, r as resolveDevServerPort, t as normalizeBasePath } from "./_shared-CGPVmXUM.mjs";
5
- import { t as createH3DevframeHost } from "./host-h3-CzCZwtuV.mjs";
6
- import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, t as createInstanceShell } from "./instance-shell-B0TwOxCl.mjs";
7
- import { t as open } from "./open-Dz4V4irZ.mjs";
2
+ import { t as diagnostics } from "./diagnostics-DEuH3P5O.mjs";
3
+ import { t as createHostContext } from "./context-D0HD0F7C.mjs";
4
+ import { resolveStaticAssetsSource } from "./utils/remote-assets.mjs";
5
+ import { i as resolveMcpConnectionMeta, n as resolveBasePath, r as resolveDevServerPort, t as normalizeBasePath } from "./_shared-CKZPvSrN.mjs";
6
+ import { t as createH3DevframeHost } from "./host-h3-Crkzm42q.mjs";
7
+ import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, t as createInstanceShell } from "./instance-shell-DJ8s-MFw.mjs";
8
+ import { open } from "./utils/open.mjs";
8
9
  import { mountStaticHandler } from "./utils/serve-static.mjs";
9
10
  import { createServer } from "node:http";
10
11
  import { resolve } from "pathe";
@@ -86,7 +87,7 @@ function initDevframe(def, options) {
86
87
  const mcpPath = joinURL(base, mcpMeta.path);
87
88
  let mountMcpHttp;
88
89
  try {
89
- ({mountMcpHttp} = await import("./http-Z0w9baEe.mjs").then((n) => n.t));
90
+ ({mountMcpHttp} = await import("./http-CVwj7b4g.mjs").then((n) => n.t));
90
91
  } catch (error) {
91
92
  const reason = error instanceof Error ? error.message : String(error);
92
93
  throw diagnostics.DF0017({
@@ -108,9 +109,12 @@ function initDevframe(def, options) {
108
109
  ...mcpDispose ? { dispose: mcpDispose } : {}
109
110
  };
110
111
  },
111
- mount(_context, meta) {
112
+ mount(context, meta) {
112
113
  app.use(joinURL(base, DEVFRAME_CONNECTION_META_FILENAME), () => meta);
113
- if (distDir) mountStaticHandler(app, base, resolve(distDir));
114
+ if (distDir) {
115
+ const source = resolveStaticAssetsSource(distDir, context.host.getStorageDir("project"));
116
+ mountStaticHandler(app, base, typeof source === "string" ? resolve(source) : source);
117
+ }
114
118
  }
115
119
  });
116
120
  const instance = {
@@ -148,6 +152,7 @@ function initDevframe(def, options) {
148
152
  * `dev` / `build` / `mcp` shell, reach for {@link createCac} instead.
149
153
  */
150
154
  async function createDevServer(def, options = {}) {
155
+ if (def.capabilities?.dev === false && !options.force) throw diagnostics.DF0058({ id: def.id });
151
156
  const host = options.host ?? def.cli?.host ?? "localhost";
152
157
  const requestedPort = options.port ?? await resolveDevServerPort(def, { host });
153
158
  const flags = options.flags ?? {};
@@ -182,6 +187,7 @@ async function createDevServer(def, options = {}) {
182
187
  host,
183
188
  origin,
184
189
  ws: options.ws,
190
+ allowedOrigins: options.allowedOrigins,
185
191
  sse: options.sse,
186
192
  auth: flags.auth === false ? false : options.auth,
187
193
  mcp: options.mcp,
@@ -1,6 +1,7 @@
1
1
  import { d as RpcFunctionsCollectorBase } from "./index-tdrk1bzV.mjs";
2
2
  import { _ as RpcFunctionDefinition, v as RpcFunctionDefinitionAny } from "./types-Djq7CBXh.mjs";
3
3
  import { d as DevframeRpcConnection, u as DevframeNodeRpcSessionMeta } from "./ws-server-D1d3QM9f.mjs";
4
+ import { a as StaticAssetsSource, i as RemoteAssetsStore } from "./remote-assets-DclsYyoL.mjs";
4
5
  import { CAC } from "cac";
5
6
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
7
  import { BirpcReturn } from "birpc";
@@ -835,14 +836,6 @@ interface RpcStreamingHost {
835
836
  }
836
837
  //#endregion
837
838
  //#region src/types/diagnostics.d.ts
838
- /**
839
- * A diagnostics definition object built with `defineDiagnostics`. Typed as
840
- * `unknown` because each integration's definition has a distinct narrow shape
841
- * (e.g. specific code keys like `DF0001` / `MYP0001`), and TypeScript's mapped
842
- * types don't allow assigning a narrow-keyed result to a generically-keyed
843
- * one. The host stores them in a heterogeneous registry.
844
- */
845
- type DevframeDiagnosticsDefinition = ReturnType<typeof defineDiagnostics<any, any>>;
846
839
  /**
847
840
  * The shared diagnostics lookup exposed by the host. A `Proxy` that resolves
848
841
  * any registered code name to its `nostics` handle (a callable that builds
@@ -912,12 +905,15 @@ interface DevframeDiagnosticsHost {
912
905
  //#region src/types/host.d.ts
913
906
  interface DevframeHost {
914
907
  /**
915
- * Serve a static directory at the given URL base. Called by
916
- * `DevframeViewHost.hostStatic`. Implementations map this to whatever
908
+ * Serve static assets at the given URL base — a local directory, or a
909
+ * resolved {@link RemoteAssetsStore} back-proxy. Called by
910
+ * `DevframeViewHost.hostStatic` (which normalizes `RemoteAssets`
911
+ * declarations into stores first). Implementations map this to whatever
917
912
  * the underlying runtime expects (Vite middleware, h3 handler, no-op
918
- * for build snapshots).
913
+ * for build snapshots) — the shared engine in
914
+ * `devframe/utils/serve-static` accepts either shape.
919
915
  */
920
- mountStatic: (base: string, distDir: string) => void | Promise<void>;
916
+ mountStatic: (base: string, source: string | RemoteAssetsStore) => void | Promise<void>;
921
917
  /**
922
918
  * Serve the host's connection meta (`__connection.json`) at the given URL
923
919
  * base, so a devframe SPA mounted there can discover the RPC/WS endpoint
@@ -982,14 +978,17 @@ interface DevframeViewHost {
982
978
  */
983
979
  buildStaticDirs: {
984
980
  baseUrl: string;
985
- distDir: string;
981
+ source: StaticAssetsSource;
986
982
  }[];
987
983
  /**
988
984
  * Helper to host static files
989
985
  * - In `dev` mode, it will register middleware to `viteServer.middlewares` to host the static files
990
986
  * - In `build` mode, it will copy the static files to the dist directory
987
+ *
988
+ * Accepts a local dist directory, or a {@link StaticAssetsSource} remote
989
+ * declaration served through devframe's caching CDN back-proxy.
991
990
  */
992
- hostStatic: (baseUrl: string, distDir: string) => void;
991
+ hostStatic: (baseUrl: string, source: StaticAssetsSource) => void;
993
992
  }
994
993
  //#endregion
995
994
  //#region src/types/scope.d.ts
@@ -1480,15 +1479,6 @@ interface ConnectionMeta {
1480
1479
  */
1481
1480
  interface DevframeConnectionConfigsRegistry {}
1482
1481
  //#endregion
1483
- //#region src/types/utils.d.ts
1484
- type Thenable<T> = T | Promise<T>;
1485
- type EntriesToObject<T extends readonly [string, any][]> = { [K in T[number] as K[0]]: K[1]; };
1486
- type PartialWithoutId<T extends {
1487
- id: string;
1488
- }> = Partial<Omit<T, 'id'>> & {
1489
- id: string;
1490
- };
1491
- //#endregion
1492
1482
  //#region src/node/auth/handler.d.ts
1493
1483
  /**
1494
1484
  * A ready-made pre-auth RPC handler, as produced by
@@ -1540,12 +1530,11 @@ interface DevframeAuthHandler {
1540
1530
  }
1541
1531
  //#endregion
1542
1532
  //#region src/types/devframe.d.ts
1543
- type DevframeRuntime = 'cli' | 'build' | 'spa' | 'vite' | 'embedded';
1544
1533
  /**
1545
1534
  * Classification of how a devframe is being deployed. Hosted adapters
1546
1535
  * (`vite`, `embedded`) share their origin with a host app and must
1547
1536
  * namespace their mount path under `/__<id>/`. Standalone adapters
1548
- * (`cli`, `spa`, `build`) own the origin and default to `/`.
1537
+ * (`cli`, `build`) own the origin and default to `/`.
1549
1538
  */
1550
1539
  type DevframeDeploymentKind = 'standalone' | 'hosted';
1551
1540
  /**
@@ -1663,7 +1652,7 @@ interface DevframeCliOptions {
1663
1652
  /**
1664
1653
  * Authentication for the standalone dev server.
1665
1654
  *
1666
- * - `undefined` / `true` — the standalone adapters (`cli` / `spa` /
1655
+ * - `undefined` / `true` — the standalone adapters (`cli` /
1667
1656
  * served `build`) auto-wire devframe's interactive OTP auth
1668
1657
  * (`createInteractiveAuth`): an untrusted client can only reach
1669
1658
  * `anonymous:` methods until it exchanges the printed one-time code.
@@ -1696,8 +1685,13 @@ interface DevframeCliOptions {
1696
1685
  * The `--mcp` / `--no-mcp` CLI flags override this per run.
1697
1686
  */
1698
1687
  mcp?: boolean | McpRouteOptions;
1699
- /** Author's SPA dist directory (served as the devframe's UI). */
1700
- distDir?: string;
1688
+ /**
1689
+ * Author's SPA dist — served as the devframe's UI. A local directory, or
1690
+ * a {@link StaticAssetsSource} remote declaration (`{ package, version }`)
1691
+ * served through devframe's caching CDN back-proxy so the assets need not
1692
+ * ship inside the node package.
1693
+ */
1694
+ distDir?: StaticAssetsSource;
1701
1695
  /**
1702
1696
  * How the browser reaches the RPC WebSocket. Defaults to sharing the HTTP
1703
1697
  * port on the `__ws` route. See {@link DevframeWsOptions} for the
@@ -1713,7 +1707,7 @@ interface DevframeCliOptions {
1713
1707
  sse?: boolean | DevframeSseOptions;
1714
1708
  /**
1715
1709
  * Capability-side CAC hook. Called with the CAC instance after the
1716
- * adapter registers its built-in commands (`build` / `spa` / `mcp`)
1710
+ * adapter registers its built-in commands (`build` / `mcp`)
1717
1711
  * but before `createCac`'s own `configureCli` caller. Use this to
1718
1712
  * contribute tool-specific flags and subcommands from the definition
1719
1713
  * itself.
@@ -1754,7 +1748,7 @@ interface DevframeCliOptions {
1754
1748
  *
1755
1749
  * Every field is optional. `title` / `icon` default to the definition's
1756
1750
  * `name` / `icon` when omitted here; the rest are unset by default.
1757
- * Standalone adapters (`cli` / `spa` / `build`) ignore this entirely.
1751
+ * Standalone adapters (`cli` / `build`) ignore this entirely.
1758
1752
  */
1759
1753
  interface DevframeDockDefaults {
1760
1754
  /** Dock entry title. Defaults to the definition's `name`. */
@@ -1791,22 +1785,6 @@ interface DevframeDockDefaults {
1791
1785
  /** Id of the dock group this entry collapses under, if any. */
1792
1786
  groupId?: string;
1793
1787
  }
1794
- interface DevframeSpaOptions {
1795
- base?: string;
1796
- /**
1797
- * How the deployed SPA loads its data.
1798
- * - `'query'` — read from URL search params.
1799
- * - `'upload'` — accept a file drag-drop.
1800
- * - `'none'` — use the baked RPC dump only.
1801
- */
1802
- loader?: 'query' | 'upload' | 'none';
1803
- }
1804
- interface DevframeBrowserContext {
1805
- /**
1806
- * The connected RPC client (may be write-disabled in static/spa modes).
1807
- */
1808
- rpc: unknown;
1809
- }
1810
1788
  /**
1811
1789
  * Runtime information threaded into `setup(ctx, info)`. Adapters
1812
1790
  * populate the fields that make sense for their deployment. In
@@ -1835,47 +1813,46 @@ interface DevframeDefinition {
1835
1813
  * Default dock attributes applied when a hub mounts this devframe as an
1836
1814
  * iframe dock entry. Consulted only by the hub install path (`ctx.install`),
1837
1815
  * which merge these beneath the per-mount `dock` overrides; standalone
1838
- * adapters (`cli` / `spa` / `build`) ignore it.
1816
+ * adapters (`cli` / `build`) ignore it.
1839
1817
  *
1840
1818
  * @see {@link DevframeDockDefaults}
1841
1819
  */
1842
1820
  dock?: DevframeDockDefaults;
1843
1821
  /**
1844
1822
  * Mount path override. Defaults depend on the adapter:
1845
- * `/` for standalone (`cli` / `spa` / `build`), `/__<id>/` for hosted
1823
+ * `/` for standalone (`cli` / `build`), `/__<id>/` for hosted
1846
1824
  * (`vite` / `embedded`).
1847
1825
  */
1848
1826
  basePath?: string;
1849
1827
  /**
1850
1828
  * How a hub reacts when another devframe sharing this one's `id` is
1851
1829
  * mounted onto the same hub. Consulted only by hub adapters
1852
- * (`ctx.install`); standalone adapters (`cli` / `spa` / `build`)
1830
+ * (`ctx.install`); standalone adapters (`cli` / `build`)
1853
1831
  * ignore it.
1854
1832
  *
1855
1833
  * @default 'warn'
1856
1834
  */
1857
1835
  duplicationStrategy?: DevframeDuplicationStrategy;
1858
1836
  /**
1859
- * Declares which runtimes meaningfully support this devframe. Consulted
1860
- * by adapters that can act on a plain `false` before doing any work:
1861
- * `createCac` skips registering the `build` subcommand entirely when
1862
- * `capabilities.build` is `false` — useful for a devframe whose value is
1863
- * inherently live (e.g. it manages real files on disk), so a static
1864
- * export would only ever produce a broken, write-less shell of the tool.
1865
- * The `Record<string, boolean>` shape is reserved for finer-grained
1866
- * sub-capabilities and currently unconsumed by any adapter.
1837
+ * Declares which runtimes meaningfully support this devframe. Adapters
1838
+ * act on a `false` before doing any work:
1839
+ *
1840
+ * - `build: false` — `createCac` skips registering the `build` subcommand,
1841
+ * and `createBuild` refuses (throws `DF0042`) unless `{ force: true }`.
1842
+ * Useful for a devframe whose value is inherently live (e.g. it manages
1843
+ * real files on disk), so a static export would only ever produce a
1844
+ * broken, write-less shell of the tool.
1845
+ * - `dev: false` — `createDevServer` refuses (throws `DF0058`) unless
1846
+ * `{ force: true }`. Useful for a devframe that only makes sense as a
1847
+ * static export (e.g. a report generator with nothing to serve live).
1867
1848
  */
1868
1849
  capabilities?: {
1869
- dev?: boolean | Record<string, boolean>;
1870
- build?: boolean | Record<string, boolean>;
1871
- spa?: boolean | Record<string, boolean>;
1850
+ dev?: boolean;
1851
+ build?: boolean;
1872
1852
  };
1873
1853
  /** Server-side setup — the primary entrypoint. Runs in every runtime. */
1874
1854
  setup: (ctx: DevframeNodeContext, info?: DevframeSetupInfo) => void | Promise<void>;
1875
- /** Browser-only setup for the SPA adapter (bundled into the client). */
1876
- setupBrowser?: (ctx: DevframeBrowserContext) => void | Promise<void>;
1877
1855
  cli?: DevframeCliOptions;
1878
- spa?: DevframeSpaOptions;
1879
1856
  }
1880
1857
  //#endregion
1881
- export { RpcStreamingHost as $, DevframeSettings as A, AgentToolProviderHandle as At, DevframeHost as B, DevframeServiceId as C, AgentManifest as Ct, DevframeScopedNodeContext as D, AgentTool as Dt, DevframeServicesRegistry as E, AgentResourceInput as Et, ScopedRpcFn as F, EventsMap as Ft, DevframeDiagnosticsLogger as G, DevframeDefineDiagnosticsOptions as H, ScopedServerFunctions as I, CliFlagsSchema as It, RpcFunctionsHost as J, DevframeNodeRpcSession as K, ScopedSharedStates as L, InferCliFlags as Lt, DevframeSettingsStore as M, DevframeAgentHostEvents as Mt, ScopedBroadcastOptions as N, EventEmitter as Nt, DevframeScopedNodeRpc as O, AgentToolInput as Ot, ScopedClientFunctions as P, EventUnsubscribe as Pt, RpcStreamingChannelOptions as Q, SettingsForNamespace as R, defineCliFlags as Rt, DevframeNodeContext as S, AgentHandle as St, DevframeServicesHost as T, AgentResourceContent as Tt, DevframeDiagnosticsDefinition as U, DevframeStorageScope as V, DevframeDiagnosticsHost as W, RpcSharedStateHost as X, RpcSharedStateGetOptions as Y, RpcStreamingChannel as Z, ConnectionMeta as _, SharedState as _t, DevframeDockDefaults as a, CreateStreamSinkOptions as at, DevframeCapabilities as b, SharedStatePatch as bt, DevframeSetupInfo as c, StreamSink as ct, DevframeWsOptions as d, createStreamSink as dt, DevframeRpcClientFunctions as et, McpRouteOptions as f, Immutable as ft, Thenable as g, ImmutableSet as gt, PartialWithoutId as h, ImmutableObject as ht, DevframeDeploymentKind as i, CreateStreamReaderOptions as it, DevframeSettingsRegistry as j, DevframeAgentHost as jt, DevframeScopedStreamingHost as k, AgentToolProvider as kt, DevframeSpaOptions as l, StreamSinkEvents as lt, EntriesToObject as m, ImmutableMap as mt, DevframeCliOptions as n, DevframeRpcSharedStates as nt, DevframeDuplicationStrategy as o, StreamErrorPayload as ot, DevframeAuthHandler as p, ImmutableArray as pt, RpcBroadcastOptions as q, DevframeDefinition as r, BufferedChunk as rt, DevframeRuntime as s, StreamReader as st, DevframeBrowserContext as t, DevframeRpcServerFunctions as tt, DevframeSseOptions as u, createStreamReader as ut, ConnectionMetaSse as v, SharedStateEvents as vt, DevframeServiceOf as w, AgentResource as wt, DevframeConnectionConfigsRegistry as x, createSharedState as xt, ConnectionMetaWebsocket as y, SharedStateOptions as yt, DevframeViewHost as z, parseCliFlags as zt };
1858
+ export { StreamErrorPayload as $, ScopedServerFunctions as A, InferCliFlags as At, RpcBroadcastOptions as B, DevframeScopedStreamingHost as C, AgentToolProviderHandle as Ct, ScopedBroadcastOptions as D, EventUnsubscribe as Dt, DevframeSettingsStore as E, EventEmitter as Et, DevframeStorageScope as F, RpcStreamingChannelOptions as G, RpcSharedStateGetOptions as H, DevframeDefineDiagnosticsOptions as I, DevframeRpcServerFunctions as J, RpcStreamingHost as K, DevframeDiagnosticsHost as L, SettingsForNamespace as M, parseCliFlags as Mt, DevframeViewHost as N, ScopedClientFunctions as O, EventsMap as Ot, DevframeHost as P, CreateStreamSinkOptions as Q, DevframeDiagnosticsLogger as R, DevframeScopedNodeRpc as S, AgentToolProvider as St, DevframeSettingsRegistry as T, DevframeAgentHostEvents as Tt, RpcSharedStateHost as U, RpcFunctionsHost as V, RpcStreamingChannel as W, BufferedChunk as X, DevframeRpcSharedStates as Y, CreateStreamReaderOptions as Z, DevframeServiceId as _, AgentResource as _t, DevframeDuplicationStrategy as a, Immutable as at, DevframeServicesRegistry as b, AgentTool as bt, DevframeWsOptions as c, ImmutableObject as ct, ConnectionMeta as d, SharedStateEvents as dt, StreamReader as et, ConnectionMetaSse as f, SharedStateOptions as ft, DevframeNodeContext as g, AgentManifest as gt, DevframeConnectionConfigsRegistry as h, AgentHandle as ht, DevframeDockDefaults as i, createStreamSink as it, ScopedSharedStates as j, defineCliFlags as jt, ScopedRpcFn as k, CliFlagsSchema as kt, McpRouteOptions as l, ImmutableSet as lt, DevframeCapabilities as m, createSharedState as mt, DevframeDefinition as n, StreamSinkEvents as nt, DevframeSetupInfo as o, ImmutableArray as ot, ConnectionMetaWebsocket as p, SharedStatePatch as pt, DevframeRpcClientFunctions as q, DevframeDeploymentKind as r, createStreamReader as rt, DevframeSseOptions as s, ImmutableMap as st, DevframeCliOptions as t, StreamSink as tt, DevframeAuthHandler as u, SharedState as ut, DevframeServiceOf as v, AgentResourceContent as vt, DevframeSettings as w, DevframeAgentHost as wt, DevframeScopedNodeContext as x, AgentToolInput as xt, DevframeServicesHost as y, AgentResourceInput as yt, DevframeNodeRpcSession as z };
@@ -107,6 +107,38 @@ const diagnostics = defineDiagnostics({
107
107
  DF0057: {
108
108
  why: () => "This instance disables its WebSocket transport (`ws: false`), so there is no socket to drive upgrades into.",
109
109
  fix: "Clients connect over the SSE endpoint instead — no upgrade wiring is needed. Remove `ws: false` if the instance should serve a WebSocket after all."
110
+ },
111
+ DF0058: {
112
+ why: (p) => `"${p.id}" declares \`capabilities.dev: false\` — it does not support a live dev server (its value is a static export only).`,
113
+ fix: "Pass `{ force: true }` to `createDevServer()` to run it anyway, or drop `capabilities.dev: false` on the definition."
114
+ },
115
+ DF0059: {
116
+ why: (p) => `Failed to fetch the file listing for "${p.package}@${p.version}" from ${p.provider}: ${p.reason}`,
117
+ fix: "Requests fall back to probing the provider per file. Check network access to the provider, or install the assets package locally so no listing is needed."
118
+ },
119
+ DF0060: {
120
+ why: (p) => `Failed to fetch a remote asset of "${p.package}" (${p.url}): ${p.reason}`,
121
+ fix: "Install the assets package locally (`npm install <package>`) to serve it with zero network, or check network access to the configured provider."
122
+ },
123
+ DF0061: {
124
+ why: (p) => `The locally installed "${p.package}@${p.installed}" is a different major version than the required "${p.required}".`,
125
+ fix: "Align the installed assets package with the version its node package declares — they are published in lockstep."
126
+ },
127
+ DF0062: {
128
+ why: (p) => `The locally installed "${p.package}@${p.installed}" differs from the required "${p.required}" — serving the installed one.`,
129
+ fix: "Install the exact declared version to serve byte-identical assets."
130
+ },
131
+ DF0063: {
132
+ why: (p) => `Failed to persist a remote asset into the cache at "${p.filepath}": ${p.reason}`,
133
+ fix: "The response was still served; only caching failed. Check that the cache directory is writable and has free space."
134
+ },
135
+ DF0064: {
136
+ why: (p) => `Failed to materialize the remote assets of "${p.package}@${p.version}": ${p.reason}`,
137
+ fix: "Static builds need every asset file up front. Install the assets package locally, or ensure the provider (and its file-listing API) is reachable during the build."
138
+ },
139
+ DF0065: {
140
+ why: (p) => `Invalid remote-assets ${p.field} "${p.value}".`,
141
+ fix: "A remote-assets `package` must be a valid npm package name and `version` an exact semver version (e.g. `1.2.3`) — they are interpolated into CDN URLs and the cache path."
110
142
  }
111
143
  }
112
144
  });
@@ -1,5 +1,43 @@
1
- import { t as diagnostics } from "./diagnostics-C7IGWppM.mjs";
2
- import { i as createEventEmitter } from "./storage-CaUVrBrG.mjs";
1
+ import { t as diagnostics } from "./diagnostics-DEuH3P5O.mjs";
2
+ //#region src/utils/events.ts
3
+ /**
4
+ * Create event emitter.
5
+ */
6
+ function createEventEmitter() {
7
+ const _listeners = {};
8
+ function emit(event, ...args) {
9
+ const callbacks = _listeners[event] || [];
10
+ for (let i = 0, length = callbacks.length; i < length; i++) {
11
+ const callback = callbacks[i];
12
+ if (callback) callback(...args);
13
+ }
14
+ }
15
+ function emitOnce(event, ...args) {
16
+ emit(event, ...args);
17
+ delete _listeners[event];
18
+ }
19
+ function on(event, cb) {
20
+ (_listeners[event] ||= []).push(cb);
21
+ return () => {
22
+ _listeners[event] = _listeners[event]?.filter((i) => cb !== i);
23
+ };
24
+ }
25
+ function once(event, cb) {
26
+ const unsubscribe = on(event, ((...args) => {
27
+ unsubscribe();
28
+ return cb(...args);
29
+ }));
30
+ return unsubscribe;
31
+ }
32
+ return {
33
+ _listeners,
34
+ emit,
35
+ emitOnce,
36
+ on,
37
+ once
38
+ };
39
+ }
40
+ //#endregion
3
41
  //#region src/node/agent-args.ts
4
42
  /**
5
43
  * Map the args payload an agent surface receives (MCP sends an object
@@ -223,4 +261,4 @@ function inferSafety(type) {
223
261
  return "action";
224
262
  }
225
263
  //#endregion
226
- export { coerceAgentPositionalArgs as n, DevframeAgentHost as t };
264
+ export { coerceAgentPositionalArgs as n, createEventEmitter as r, DevframeAgentHost as t };
@@ -8,8 +8,8 @@ import { homedir } from "node:os";
8
8
  function createH3DevframeHost(options) {
9
9
  const workspaceRoot = options.workspaceRoot ?? process.cwd();
10
10
  return {
11
- mountStatic(base, distDir) {
12
- return options.mount?.(base, distDir);
11
+ mountStatic(base, source) {
12
+ return options.mount?.(base, source);
13
13
  },
14
14
  resolveOrigin() {
15
15
  return typeof options.origin === "function" ? options.origin() : options.origin;
@@ -1,7 +1,7 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-JspESFgx.mjs";
2
2
  import { i as isAllowedOrigin } from "./ws-server-Bk1hOG3X.mjs";
3
- import { t as diagnostics } from "./diagnostics-C7IGWppM.mjs";
4
- import { t as createHostContext } from "./context-b6iSomtv.mjs";
3
+ import { t as diagnostics } from "./diagnostics-DEuH3P5O.mjs";
4
+ import { t as createHostContext } from "./context-D0HD0F7C.mjs";
5
5
  import { t as toAgentToolName } from "./agent-tool-name-EgfoFO8C.mjs";
6
6
  import { randomUUID } from "node:crypto";
7
7
  import { Diagnostic } from "nostics";
@@ -1,5 +1,5 @@
1
- import { K as DevframeNodeRpcSession, S as DevframeNodeContext, _t as SharedState } from "./devframe-5oblos7I.mjs";
2
- import { n as InternalAnonymousAuthStorage } from "./context-DV4uWieM.mjs";
1
+ import { g as DevframeNodeContext, ut as SharedState, z as DevframeNodeRpcSession } from "./devframe-Cfx6doi4.mjs";
2
+ import { n as InternalAnonymousAuthStorage } from "./context-CQkRTbAc.mjs";
3
3
  //#region src/node/auth/revoke.d.ts
4
4
  /**
5
5
  * Flip `isTrusted` to false on any live WS clients connected with `token`
package/dist/index.d.mts CHANGED
@@ -1,7 +1,8 @@
1
- import { $ as RpcStreamingHost, A as DevframeSettings, At as AgentToolProviderHandle, B as DevframeHost, C as DevframeServiceId, Ct as AgentManifest, D as DevframeScopedNodeContext, Dt as AgentTool, E as DevframeServicesRegistry, Et as AgentResourceInput, F as ScopedRpcFn, Ft as EventsMap, G as DevframeDiagnosticsLogger, H as DevframeDefineDiagnosticsOptions, I as ScopedServerFunctions, J as RpcFunctionsHost, K as DevframeNodeRpcSession, L as ScopedSharedStates, M as DevframeSettingsStore, Mt as DevframeAgentHostEvents, N as ScopedBroadcastOptions, Nt as EventEmitter, O as DevframeScopedNodeRpc, Ot as AgentToolInput, P as ScopedClientFunctions, Pt as EventUnsubscribe, Q as RpcStreamingChannelOptions, R as SettingsForNamespace, S as DevframeNodeContext, St as AgentHandle, T as DevframeServicesHost, Tt as AgentResourceContent, U as DevframeDiagnosticsDefinition, V as DevframeStorageScope, W as DevframeDiagnosticsHost, X as RpcSharedStateHost, Y as RpcSharedStateGetOptions, Z as RpcStreamingChannel, _ as ConnectionMeta, a as DevframeDockDefaults, b as DevframeCapabilities, c as DevframeSetupInfo, d as DevframeWsOptions, et as DevframeRpcClientFunctions, f as McpRouteOptions, g as Thenable, h as PartialWithoutId, i as DevframeDeploymentKind, j as DevframeSettingsRegistry, jt as DevframeAgentHost, k as DevframeScopedStreamingHost, kt as AgentToolProvider, l as DevframeSpaOptions, m as EntriesToObject, n as DevframeCliOptions, nt as DevframeRpcSharedStates, o as DevframeDuplicationStrategy, q as RpcBroadcastOptions, r as DevframeDefinition, s as DevframeRuntime, t as DevframeBrowserContext, tt as DevframeRpcServerFunctions, u as DevframeSseOptions, v as ConnectionMetaSse, w as DevframeServiceOf, wt as AgentResource, x as DevframeConnectionConfigsRegistry, y as ConnectionMetaWebsocket, z as DevframeViewHost } from "./devframe-5oblos7I.mjs";
1
+ import { A as ScopedServerFunctions, B as RpcBroadcastOptions, C as DevframeScopedStreamingHost, Ct as AgentToolProviderHandle, D as ScopedBroadcastOptions, Dt as EventUnsubscribe, E as DevframeSettingsStore, Et as EventEmitter, F as DevframeStorageScope, G as RpcStreamingChannelOptions, H as RpcSharedStateGetOptions, I as DevframeDefineDiagnosticsOptions, J as DevframeRpcServerFunctions, K as RpcStreamingHost, L as DevframeDiagnosticsHost, M as SettingsForNamespace, N as DevframeViewHost, O as ScopedClientFunctions, Ot as EventsMap, P as DevframeHost, R as DevframeDiagnosticsLogger, S as DevframeScopedNodeRpc, St as AgentToolProvider, T as DevframeSettingsRegistry, Tt as DevframeAgentHostEvents, U as RpcSharedStateHost, V as RpcFunctionsHost, W as RpcStreamingChannel, Y as DevframeRpcSharedStates, _ as DevframeServiceId, _t as AgentResource, a as DevframeDuplicationStrategy, b as DevframeServicesRegistry, bt as AgentTool, c as DevframeWsOptions, d as ConnectionMeta, f as ConnectionMetaSse, g as DevframeNodeContext, gt as AgentManifest, h as DevframeConnectionConfigsRegistry, ht as AgentHandle, i as DevframeDockDefaults, j as ScopedSharedStates, k as ScopedRpcFn, l as McpRouteOptions, m as DevframeCapabilities, n as DevframeDefinition, o as DevframeSetupInfo, p as ConnectionMetaWebsocket, q as DevframeRpcClientFunctions, r as DevframeDeploymentKind, s as DevframeSseOptions, t as DevframeCliOptions, v as DevframeServiceOf, vt as AgentResourceContent, w as DevframeSettings, wt as DevframeAgentHost, x as DevframeScopedNodeContext, xt as AgentToolInput, y as DevframeServicesHost, yt as AgentResourceInput, z as DevframeNodeRpcSession } from "./devframe-Cfx6doi4.mjs";
2
2
  import "./index-tdrk1bzV.mjs";
3
3
  import { C as RpcFunctionType, T as RpcReturnSchema, _ as RpcFunctionDefinition, g as RpcFunctionAgentOptions, i as RpcArgsSchema } from "./types-Djq7CBXh.mjs";
4
4
  import { d as DevframeRpcConnection, f as DevframeRpcConnectionRequest, p as DevframeRpcTransportKind, u as DevframeNodeRpcSessionMeta } from "./ws-server-D1d3QM9f.mjs";
5
+ import { a as StaticAssetsSource, i as RemoteAssetsStore, n as RemoteAssetsProvider, r as RemoteAssetsProviderCustom, t as RemoteAssets } from "./remote-assets-DclsYyoL.mjs";
5
6
  //#region src/define.d.ts
6
7
  declare const defineRpcFunction: <NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends RpcArgsSchema | undefined = undefined, const RS extends RpcReturnSchema | undefined = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeNodeContext>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeNodeContext>;
7
8
  /**
@@ -10,4 +11,4 @@ declare const defineRpcFunction: <NAME extends string, TYPE extends RpcFunctionT
10
11
  */
11
12
  declare function defineDevframe(d: DevframeDefinition): DevframeDefinition;
12
13
  //#endregion
13
- export { type AgentHandle, type AgentManifest, type AgentResource, type AgentResourceContent, type AgentResourceInput, type AgentTool, type AgentToolInput, type AgentToolProvider, type AgentToolProviderHandle, type ConnectionMeta, type ConnectionMetaSse, type ConnectionMetaWebsocket, type DevframeAgentHost, type DevframeAgentHostEvents, type DevframeBrowserContext, type DevframeCapabilities, type DevframeCliOptions, type DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, type DevframeDefinition, type DevframeDeploymentKind, type DevframeDiagnosticsDefinition, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDockDefaults, type DevframeDuplicationStrategy, type DevframeHost, type DevframeNodeContext, type DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, type DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeRpcTransportKind, type DevframeRuntime, type DevframeScopedNodeContext, type DevframeScopedNodeRpc, type DevframeScopedStreamingHost, type DevframeServiceId, type DevframeServiceOf, type DevframeServicesHost, type DevframeServicesRegistry, type DevframeSettings, type DevframeSettingsRegistry, type DevframeSettingsStore, type DevframeSetupInfo, type DevframeSpaOptions, type DevframeSseOptions, type DevframeStorageScope, type DevframeViewHost, type DevframeWsOptions, type EntriesToObject, type EventEmitter, type EventUnsubscribe, type EventsMap, type McpRouteOptions, type PartialWithoutId, type RpcBroadcastOptions, type RpcFunctionAgentOptions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type ScopedBroadcastOptions, type ScopedClientFunctions, type ScopedRpcFn, type ScopedServerFunctions, type ScopedSharedStates, type SettingsForNamespace, type Thenable, defineDevframe, defineRpcFunction };
14
+ export { type AgentHandle, type AgentManifest, type AgentResource, type AgentResourceContent, type AgentResourceInput, type AgentTool, type AgentToolInput, type AgentToolProvider, type AgentToolProviderHandle, type ConnectionMeta, type ConnectionMetaSse, type ConnectionMetaWebsocket, type DevframeAgentHost, type DevframeAgentHostEvents, type DevframeCapabilities, type DevframeCliOptions, type DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, type DevframeDefinition, type DevframeDeploymentKind, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDockDefaults, type DevframeDuplicationStrategy, type DevframeHost, type DevframeNodeContext, type DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, type DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeRpcTransportKind, type DevframeScopedNodeContext, type DevframeScopedNodeRpc, type DevframeScopedStreamingHost, type DevframeServiceId, type DevframeServiceOf, type DevframeServicesHost, type DevframeServicesRegistry, type DevframeSettings, type DevframeSettingsRegistry, type DevframeSettingsStore, type DevframeSetupInfo, type DevframeSseOptions, type DevframeStorageScope, type DevframeViewHost, type DevframeWsOptions, type EventEmitter, type EventUnsubscribe, type EventsMap, type McpRouteOptions, type RemoteAssets, type RemoteAssetsProvider, type RemoteAssetsProviderCustom, type RemoteAssetsStore, type RpcBroadcastOptions, type RpcFunctionAgentOptions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type ScopedBroadcastOptions, type ScopedClientFunctions, type ScopedRpcFn, type ScopedServerFunctions, type ScopedSharedStates, type SettingsForNamespace, type StaticAssetsSource, defineDevframe, defineRpcFunction };
@@ -1,5 +1,5 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-JspESFgx.mjs";
2
- import { t as diagnostics } from "./diagnostics-C7IGWppM.mjs";
2
+ import { t as diagnostics } from "./diagnostics-DEuH3P5O.mjs";
3
3
  import { mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
4
4
  import { join } from "pathe";
5
5
  import process from "node:process";
@@ -1,6 +1,6 @@
1
1
  import "./constants.mjs";
2
- import { t as diagnostics } from "./diagnostics-C7IGWppM.mjs";
3
- import { t as getInternalContext } from "./context-CMSryXs-.mjs";
2
+ import { t as diagnostics } from "./diagnostics-DEuH3P5O.mjs";
3
+ import { t as getInternalContext } from "./context-D0jErmlx.mjs";
4
4
  import { createInteractiveAuth } from "./recipes/interactive-auth.mjs";
5
5
  import { createServer } from "node:http";
6
6
  import process from "node:process";
@@ -197,7 +197,7 @@ function createInstanceShell(options) {
197
197
  const origin = currentOrigin();
198
198
  if (!cfg || registerPromise || !origin || !meta) return;
199
199
  const resolvedMeta = meta;
200
- registerPromise = import("./instance-registry-Du_hbx-j.mjs").then((n) => n.t).then(({ registerDevframeInstance }) => {
200
+ registerPromise = import("./instance-registry-M2p-z6xE.mjs").then((n) => n.t).then(({ registerDevframeInstance }) => {
201
201
  let port = 0;
202
202
  try {
203
203
  const url = new URL(origin);
@@ -257,7 +257,7 @@ function createInstanceShell(options) {
257
257
  let resolvedAuth = false;
258
258
  let corePromise;
259
259
  function ensureCore() {
260
- corePromise ??= import("./rpc-core-Cva-0pw0.mjs").then((n) => n.n).then(({ createContextRpcServer }) => createContextRpcServer({
260
+ corePromise ??= import("./rpc-core-IhcWl_xn.mjs").then((n) => n.n).then(({ createContextRpcServer }) => createContextRpcServer({
261
261
  context: ctx,
262
262
  auth: resolvedAuth,
263
263
  onPeerConnect: options.onPeerConnect,
@@ -298,7 +298,7 @@ function createInstanceShell(options) {
298
298
  allowedOrigins: options.allowedOrigins
299
299
  });
300
300
  if (ws.port != null) return await start(ws.port);
301
- const { getPort } = await import("./_shared-CGPVmXUM.mjs").then((n) => n.a);
301
+ const { getPort } = await import("./_shared-CKZPvSrN.mjs").then((n) => n.a);
302
302
  let lastError;
303
303
  for (let attempt = 0; attempt < 3; attempt++) {
304
304
  const port = attempt === 0 && options.resolveSidecarPort ? await options.resolveSidecarPort(sidecarHost) : await getPort({
@@ -1,6 +1,6 @@
1
- import { K as DevframeNodeRpcSession, S as DevframeNodeContext, _ as ConnectionMeta, d as DevframeWsOptions, et as DevframeRpcClientFunctions, p as DevframeAuthHandler, tt as DevframeRpcServerFunctions, u as DevframeSseOptions } from "./devframe-5oblos7I.mjs";
1
+ import { J as DevframeRpcServerFunctions, c as DevframeWsOptions, d as ConnectionMeta, g as DevframeNodeContext, q as DevframeRpcClientFunctions, s as DevframeSseOptions, u as DevframeAuthHandler, z as DevframeNodeRpcSession } from "./devframe-Cfx6doi4.mjs";
2
2
  import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "./ws-server-D1d3QM9f.mjs";
3
- import "./index-BzDl02lt.mjs";
3
+ import "./index-MYi1SZVL.mjs";
4
4
  import { BirpcGroup } from "birpc";
5
5
  import { NodeAdapter } from "crossws/adapters/node";
6
6
  import { Buffer } from "node:buffer";