devframe 0.7.14 → 0.7.16

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 (54) hide show
  1. package/dist/adapters/build.d.mts +8 -1
  2. package/dist/adapters/build.mjs +4 -2
  3. package/dist/adapters/cac.d.mts +1 -1
  4. package/dist/adapters/cac.mjs +1 -1
  5. package/dist/adapters/cli.d.mts +1 -1
  6. package/dist/adapters/cli.mjs +1 -1
  7. package/dist/adapters/dev.d.mts +18 -3
  8. package/dist/adapters/dev.mjs +2 -2
  9. package/dist/adapters/embedded.d.mts +1 -1
  10. package/dist/adapters/mcp.d.mts +5 -3
  11. package/dist/adapters/mcp.mjs +1 -1
  12. package/dist/{build-server-CBAxmnC8.mjs → build-server-C7vTKjiQ.mjs} +16 -5
  13. package/dist/{cac-Drj5sjnU.mjs → cac-CPaOy3LD.mjs} +2 -2
  14. package/dist/client/index.d.mts +42 -6
  15. package/dist/client/index.mjs +179 -92
  16. package/dist/constants.d.mts +7 -1
  17. package/dist/constants.mjs +7 -1
  18. package/dist/{context-FonV8enL.d.mts → context-CzqPrJSz.d.mts} +1 -1
  19. package/dist/{context-C1Gr2BGB.mjs → context-DY72brRI.mjs} +1 -1
  20. package/dist/{dev-BdegDQKt.mjs → dev-BCeaQuGE.mjs} +28 -5
  21. package/dist/{devframe-DfzYvlKI.d.mts → devframe-Ckhf3kFw.d.mts} +16 -1
  22. package/dist/helpers/vite.d.mts +14 -1
  23. package/dist/helpers/vite.mjs +7 -4
  24. package/dist/{host-h3-SjwRTwkE.mjs → host-h3-CgOetlNE.mjs} +1 -1
  25. package/dist/{http-BaCZYhIR.mjs → http-_pPbryTQ.mjs} +1 -1
  26. package/dist/{index-CxpC1ItQ.d.mts → index-8dndvIxR.d.mts} +2 -2
  27. package/dist/index.d.mts +1 -1
  28. package/dist/node/auth.d.mts +2 -2
  29. package/dist/node/hub-internals.d.mts +2 -2
  30. package/dist/node/hub-internals.mjs +1 -1
  31. package/dist/node/index.d.mts +2 -2
  32. package/dist/node/index.mjs +3 -3
  33. package/dist/recipes/common-rpc-functions.d.mts +118 -0
  34. package/dist/recipes/common-rpc-functions.mjs +105 -0
  35. package/dist/recipes/interactive-auth.d.mts +2 -2
  36. package/dist/recipes/interactive-auth.mjs +1 -1
  37. package/dist/recipes/open-helpers.d.mts +3 -101
  38. package/dist/recipes/open-helpers.mjs +3 -63
  39. package/dist/rpc/transports/ws-client.mjs +1 -1
  40. package/dist/rpc/transports/ws-server.mjs +1 -1
  41. package/dist/{server-Bf27EWpv.d.mts → server-B0wiP_Oi.d.mts} +2 -2
  42. package/dist/{server-BFsuZI9e.mjs → server-DykHCza_.mjs} +2 -2
  43. package/dist/{storage-D_Xy9v1l.mjs → storage-gEnj9ASQ.mjs} +4 -0
  44. package/dist/{structured-clone-XpHLZ8nr.mjs → structured-clone-CbAV5rFI.mjs} +32 -3
  45. package/dist/{structured-clone-CeZOHvkd.mjs → structured-clone-CgtQ61SA.mjs} +32 -3
  46. package/dist/types/index.d.mts +1 -1
  47. package/dist/utils/events.d.mts +1 -1
  48. package/dist/utils/launch-editor.mjs +745 -1
  49. package/dist/utils/shared-state.d.mts +1 -1
  50. package/dist/utils/streaming-channel.d.mts +1 -1
  51. package/dist/utils/structured-clone.mjs +1 -1
  52. package/package.json +5 -31
  53. package/skills/devframe/SKILL.md +1 -1
  54. package/dist/launch-editor-C_xuzLnF.mjs +0 -746
@@ -4,6 +4,12 @@ const DEVFRAME_MOUNT_PATH_NO_TRAILING_SLASH = "/__devframe";
4
4
  const DEVFRAME_DIRNAME = "__devframe";
5
5
  const DEVFRAME_CONNECTION_META_FILENAME = "__connection.json";
6
6
  /**
7
+ * Global key holding the serializable connection prepared by
8
+ * `setupDevframeConnection()`. External viewers can use this key to read the
9
+ * connection from another JavaScript realm.
10
+ */
11
+ const DEVFRAME_CONNECTION_KEY = "__DEVFRAME_CONNECTION__";
12
+ /**
7
13
  * Route the WebSocket RPC endpoint is bound to, relative to a devframe's
8
14
  * base path. Sits next to `__connection.json` so the deployed SPA can reach
9
15
  * it on the same origin it loaded from — the dev server shares one port for
@@ -62,4 +68,4 @@ function isAnonymousRpcMethod(name) {
62
68
  return name.startsWith(ANONYMOUS_RPC_PREFIX);
63
69
  }
64
70
  //#endregion
65
- export { ANONYMOUS_RPC_PREFIX, DEVFRAME_AUTH_TOKEN_QUERY_PARAM, DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_DIRNAME, DEVFRAME_DOCK_IMPORTS_FILENAME, DEVFRAME_DOCK_IMPORTS_VIRTUAL_ID, DEVFRAME_MCP_ROUTE, DEVFRAME_MOUNT_PATH, DEVFRAME_MOUNT_PATH_NO_TRAILING_SLASH, DEVFRAME_OTP_URL_PARAM, DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME, DEVFRAME_WS_ROUTE, REMOTE_CONNECTION_KEY, isAnonymousRpcMethod };
71
+ export { ANONYMOUS_RPC_PREFIX, DEVFRAME_AUTH_TOKEN_QUERY_PARAM, DEVFRAME_CONNECTION_KEY, DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_DIRNAME, DEVFRAME_DOCK_IMPORTS_FILENAME, DEVFRAME_DOCK_IMPORTS_VIRTUAL_ID, DEVFRAME_MCP_ROUTE, DEVFRAME_MOUNT_PATH, DEVFRAME_MOUNT_PATH_NO_TRAILING_SLASH, DEVFRAME_OTP_URL_PARAM, DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME, DEVFRAME_WS_ROUTE, REMOTE_CONNECTION_KEY, isAnonymousRpcMethod };
@@ -1,4 +1,4 @@
1
- import { b as DevframeNodeContext, ht as SharedState } from "./devframe-DfzYvlKI.mjs";
1
+ import { b as DevframeNodeContext, ht as SharedState } from "./devframe-Ckhf3kFw.mjs";
2
2
  //#region src/node/hub-internals/context.d.ts
3
3
  interface InternalAnonymousAuthStorage {
4
4
  trusted: Record<string, {
@@ -1,4 +1,4 @@
1
- import { t as createStorage } from "./storage-D_Xy9v1l.mjs";
1
+ import { t as createStorage } from "./storage-gEnj9ASQ.mjs";
2
2
  import { i as randomToken, n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "./revoke-BtQDKTp7.mjs";
3
3
  import { join } from "pathe";
4
4
  //#region src/node/hub-internals/context.ts
@@ -1,7 +1,7 @@
1
1
  import { DEVFRAME_CONNECTION_META_FILENAME } from "./constants.mjs";
2
- import { a as diagnostics } from "./storage-D_Xy9v1l.mjs";
3
- import { n as createHostContext, t as createH3DevframeHost } from "./host-h3-SjwRTwkE.mjs";
4
- import { i as normalizeHttpServerUrl, t as startHttpAndWs } from "./server-BFsuZI9e.mjs";
2
+ import { a as diagnostics } from "./storage-gEnj9ASQ.mjs";
3
+ import { n as createHostContext, t as createH3DevframeHost } from "./host-h3-CgOetlNE.mjs";
4
+ import { i as normalizeHttpServerUrl, t as startHttpAndWs } from "./server-DykHCza_.mjs";
5
5
  import { n as resolveBasePath, t as normalizeBasePath } from "./_shared-bWRzeSa0.mjs";
6
6
  import { t as open } from "./open-Deb5xmIT.mjs";
7
7
  import { mountStaticHandler } from "./utils/serve-static.mjs";
@@ -294,7 +294,7 @@ async function createDevServer(def, options = {}) {
294
294
  const mcpPath = joinURL(basePath, mcpRoute);
295
295
  let mountMcpHttp;
296
296
  try {
297
- ({mountMcpHttp} = await import("./http-BaCZYhIR.mjs"));
297
+ ({mountMcpHttp} = await import("./http-_pPbryTQ.mjs"));
298
298
  } catch (error) {
299
299
  const reason = error instanceof Error ? error.message : String(error);
300
300
  throw diagnostics.DF0017({
@@ -362,6 +362,29 @@ function resolveMcpConfig(mcp) {
362
362
  return mcp === true ? {} : mcp;
363
363
  }
364
364
  /**
365
+ * Resolve the `mcp` entry a `__connection.json` should advertise for a dev
366
+ * server started with the given `mcp` option (falling back to `def.cli?.mcp`,
367
+ * exactly like {@link createDevServer}), or `undefined` when the route is
368
+ * disabled.
369
+ *
370
+ * Hosted bridges that hand-roll their connection meta (`viteDevBridge`,
371
+ * `@devframes/next`'s handler) pass the side-car `port`: the advertised path
372
+ * becomes absolute (the side-car mounts at `/`) and the client dials
373
+ * `<page-host>:<port><path>`. Without `port` the path stays relative, resolved
374
+ * against `__connection.json`'s own location (the same-server default).
375
+ *
376
+ * @experimental
377
+ */
378
+ function resolveMcpConnectionMeta(def, mcp, port) {
379
+ const config = resolveMcpConfig(mcp ?? def.cli?.mcp);
380
+ if (!config) return void 0;
381
+ const route = withoutLeadingSlash(config.path ?? "__mcp");
382
+ return port != null ? {
383
+ path: withLeadingSlash(route),
384
+ port
385
+ } : { path: route };
386
+ }
387
+ /**
365
388
  * Resolve the three WS connection scenarios from the definition / call-site
366
389
  * config into a concrete server bind path, optional dedicated port, and the
367
390
  * `__connection.json` descriptor the browser resolves.
@@ -400,4 +423,4 @@ async function maybeOpenBrowser(def, flags, origin, override, authHandler) {
400
423
  } catch {}
401
424
  }
402
425
  //#endregion
403
- export { resolveDevServerPort as n, createDevServer as t };
426
+ export { resolveDevServerPort as n, resolveMcpConnectionMeta as r, createDevServer as t };
@@ -1319,10 +1319,15 @@ interface ConnectionMeta {
1319
1319
  * (`cli.mcp`). Advertises the MCP Streamable-HTTP route so in-browser
1320
1320
  * tooling (e.g. an MCP inspector) can discover it without guessing the
1321
1321
  * path. `path` is relative to `__connection.json`'s location, like the
1322
- * WebSocket `path`.
1322
+ * WebSocket `path`. `port` is set when the endpoint lives on a side-car
1323
+ * server on its own port (bridge mode — `viteDevBridge`,
1324
+ * `@devframes/next`): the client combines the page hostname with `port`
1325
+ * and resolves `path` against that origin, mirroring
1326
+ * {@link ConnectionMetaWebsocket.port}.
1323
1327
  */
1324
1328
  mcp?: {
1325
1329
  path: string;
1330
+ port?: number;
1326
1331
  };
1327
1332
  /**
1328
1333
  * Names of RPC functions that have declared `jsonSerializable: true`.
@@ -1708,6 +1713,16 @@ interface DevframeDefinition {
1708
1713
  * @default 'warn'
1709
1714
  */
1710
1715
  duplicationStrategy?: DevframeDuplicationStrategy;
1716
+ /**
1717
+ * Declares which runtimes meaningfully support this devframe. Consulted
1718
+ * by adapters that can act on a plain `false` before doing any work:
1719
+ * `createCac` skips registering the `build` subcommand entirely when
1720
+ * `capabilities.build` is `false` — useful for a devframe whose value is
1721
+ * inherently live (e.g. it manages real files on disk), so a static
1722
+ * export would only ever produce a broken, write-less shell of the tool.
1723
+ * The `Record<string, boolean>` shape is reserved for finer-grained
1724
+ * sub-capabilities and currently unconsumed by any adapter.
1725
+ */
1711
1726
  capabilities?: {
1712
1727
  dev?: boolean | Record<string, boolean>;
1713
1728
  build?: boolean | Record<string, boolean>;
@@ -1,4 +1,4 @@
1
- import { p as DevframeAuthHandler, r as DevframeDefinition } from "../devframe-DfzYvlKI.mjs";
1
+ import { d as McpRouteOptions, p as DevframeAuthHandler, r as DevframeDefinition } from "../devframe-Ckhf3kFw.mjs";
2
2
  //#region src/helpers/vite.d.ts
3
3
  interface ViteDevBridgeOptions {
4
4
  /**
@@ -43,6 +43,19 @@ interface ViteDevBridgeOptions {
43
43
  * @default false
44
44
  */
45
45
  auth?: boolean | DevframeAuthHandler;
46
+ /**
47
+ * Expose the side-car's route-based MCP server (Streamable-HTTP) and
48
+ * advertise it in the bridge's `__connection.json`. Forwarded to
49
+ * {@link createDevServer}: overrides `def.cli?.mcp`, `undefined` falls
50
+ * through to it, `false` disables the route regardless. Only applies in
51
+ * bridge mode (`devMiddleware`); the static-mount mode starts no server.
52
+ *
53
+ * The endpoint lives on the side-car's own port, so the advertised meta
54
+ * carries `{ port, path }` — see `ConnectionMeta['mcp']`.
55
+ *
56
+ * @experimental
57
+ */
58
+ mcp?: boolean | McpRouteOptions;
46
59
  }
47
60
  interface DevframeVitePlugin {
48
61
  name: string;
@@ -1,8 +1,8 @@
1
1
  import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_WS_ROUTE } from "../constants.mjs";
2
- import { a as diagnostics } from "../storage-D_Xy9v1l.mjs";
2
+ import { a as diagnostics } from "../storage-gEnj9ASQ.mjs";
3
3
  import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-bWRzeSa0.mjs";
4
4
  import { serveStaticNodeMiddleware } from "../utils/serve-static.mjs";
5
- import { n as resolveDevServerPort, t as createDevServer } from "../dev-BdegDQKt.mjs";
5
+ import { n as resolveDevServerPort, r as resolveMcpConnectionMeta, t as createDevServer } from "../dev-BCeaQuGE.mjs";
6
6
  import { resolve } from "pathe";
7
7
  //#region src/helpers/vite.ts
8
8
  /**
@@ -58,7 +58,8 @@ function viteDevBridge(d, options = {}) {
58
58
  port,
59
59
  flags: mw.flags,
60
60
  openBrowser: false,
61
- auth: options.auth ?? false
61
+ auth: options.auth ?? false,
62
+ mcp: options.mcp
62
63
  });
63
64
  } catch (e) {
64
65
  diagnostics.DF0033({
@@ -68,6 +69,7 @@ function viteDevBridge(d, options = {}) {
68
69
  }, { method: "warn" });
69
70
  return;
70
71
  }
72
+ const mcpMeta = resolveMcpConnectionMeta(d, options.mcp, port);
71
73
  const metaPath = `${base}${DEVFRAME_CONNECTION_META_FILENAME}`;
72
74
  server.middlewares.use(metaPath, (_req, res) => {
73
75
  res.setHeader("Content-Type", "application/json");
@@ -76,7 +78,8 @@ function viteDevBridge(d, options = {}) {
76
78
  websocket: {
77
79
  port,
78
80
  path: `/${DEVFRAME_WS_ROUTE}`
79
- }
81
+ },
82
+ ...mcpMeta ? { mcp: mcpMeta } : {}
80
83
  }));
81
84
  });
82
85
  server.httpServer?.once("close", () => {
@@ -2,7 +2,7 @@ import { t as devframeReporter } from "./diagnostics-reporter-CsIG85Q5.mjs";
2
2
  import { t as diagnostics } from "./diagnostics-BXwBQmoN.mjs";
3
3
  import { RpcFunctionsCollectorBase } from "./rpc/index.mjs";
4
4
  import { defineRpcFunction } from "./index.mjs";
5
- import { a as diagnostics$1, i as createEventEmitter, n as createSharedState, r as nanoid, t as createStorage } from "./storage-D_Xy9v1l.mjs";
5
+ import { a as diagnostics$1, i as createEventEmitter, n as createSharedState, r as nanoid, t as createStorage } from "./storage-gEnj9ASQ.mjs";
6
6
  import { defineDiagnostics } from "nostics";
7
7
  import { isatty } from "node:tty";
8
8
  import { formatWithOptions, inspect } from "node:util";
@@ -1,5 +1,5 @@
1
1
  import { isAllowedOrigin } from "./rpc/transports/ws-server.mjs";
2
- import { t as buildMcpServerFromContext } from "./build-server-CBAxmnC8.mjs";
2
+ import { t as buildMcpServerFromContext } from "./build-server-C7vTKjiQ.mjs";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { defineHandler } from "h3";
5
5
  import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
@@ -1,5 +1,5 @@
1
- import { W as DevframeNodeRpcSession, b as DevframeNodeContext, ht as SharedState } from "./devframe-DfzYvlKI.mjs";
2
- import { n as InternalAnonymousAuthStorage } from "./context-FonV8enL.mjs";
1
+ import { W as DevframeNodeRpcSession, b as DevframeNodeContext, ht as SharedState } from "./devframe-Ckhf3kFw.mjs";
2
+ import { n as InternalAnonymousAuthStorage } from "./context-CzqPrJSz.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,4 +1,4 @@
1
- import { $ as DevframeRpcServerFunctions, A as DevframeSettingsStore, At as EventUnsubscribe, B as DevframeDefineDiagnosticsOptions, C as DevframeServicesHost, Ct as AgentResourceContent, D as DevframeScopedStreamingHost, Dt as DevframeAgentHost, E as DevframeScopedNodeRpc, Et as AgentToolInput, F as ScopedSharedStates, G as RpcBroadcastOptions, H as DevframeDiagnosticsHost, I as SettingsForNamespace, J as RpcSharedStateHost, K as RpcFunctionsHost, L as DevframeViewHost, M as ScopedClientFunctions, N as ScopedRpcFn, O as DevframeSettings, Ot as DevframeAgentHostEvents, P as ScopedServerFunctions, Q as DevframeRpcClientFunctions, R as DevframeHost, S as DevframeServiceOf, St as AgentResource, T as DevframeScopedNodeContext, Tt as AgentTool, U as DevframeDiagnosticsLogger, V as DevframeDiagnosticsDefinition, W as DevframeNodeRpcSession, X as RpcStreamingChannelOptions, Y as RpcStreamingChannel, Z as RpcStreamingHost, _ as ConnectionMeta, a as DevframeDockDefaults, b as DevframeNodeContext, bt as AgentHandle, c as DevframeSetupInfo, d as McpRouteOptions, et as DevframeRpcSharedStates, f as defineDevframe, g as Thenable, h as PartialWithoutId, i as DevframeDeploymentKind, j as ScopedBroadcastOptions, jt as EventsMap, k as DevframeSettingsRegistry, kt as EventEmitter, l as DevframeSpaOptions, m as EntriesToObject, n as DevframeCliOptions, o as DevframeDuplicationStrategy, q as RpcSharedStateGetOptions, r as DevframeDefinition, s as DevframeRuntime, t as DevframeBrowserContext, u as DevframeWsOptions, v as ConnectionMetaWebsocket, w as DevframeServicesRegistry, wt as AgentResourceInput, x as DevframeServiceId, xt as AgentManifest, y as DevframeCapabilities, z as DevframeStorageScope } from "./devframe-DfzYvlKI.mjs";
1
+ import { $ as DevframeRpcServerFunctions, A as DevframeSettingsStore, At as EventUnsubscribe, B as DevframeDefineDiagnosticsOptions, C as DevframeServicesHost, Ct as AgentResourceContent, D as DevframeScopedStreamingHost, Dt as DevframeAgentHost, E as DevframeScopedNodeRpc, Et as AgentToolInput, F as ScopedSharedStates, G as RpcBroadcastOptions, H as DevframeDiagnosticsHost, I as SettingsForNamespace, J as RpcSharedStateHost, K as RpcFunctionsHost, L as DevframeViewHost, M as ScopedClientFunctions, N as ScopedRpcFn, O as DevframeSettings, Ot as DevframeAgentHostEvents, P as ScopedServerFunctions, Q as DevframeRpcClientFunctions, R as DevframeHost, S as DevframeServiceOf, St as AgentResource, T as DevframeScopedNodeContext, Tt as AgentTool, U as DevframeDiagnosticsLogger, V as DevframeDiagnosticsDefinition, W as DevframeNodeRpcSession, X as RpcStreamingChannelOptions, Y as RpcStreamingChannel, Z as RpcStreamingHost, _ as ConnectionMeta, a as DevframeDockDefaults, b as DevframeNodeContext, bt as AgentHandle, c as DevframeSetupInfo, d as McpRouteOptions, et as DevframeRpcSharedStates, f as defineDevframe, g as Thenable, h as PartialWithoutId, i as DevframeDeploymentKind, j as ScopedBroadcastOptions, jt as EventsMap, k as DevframeSettingsRegistry, kt as EventEmitter, l as DevframeSpaOptions, m as EntriesToObject, n as DevframeCliOptions, o as DevframeDuplicationStrategy, q as RpcSharedStateGetOptions, r as DevframeDefinition, s as DevframeRuntime, t as DevframeBrowserContext, u as DevframeWsOptions, v as ConnectionMetaWebsocket, w as DevframeServicesRegistry, wt as AgentResourceInput, x as DevframeServiceId, xt as AgentManifest, y as DevframeCapabilities, z as DevframeStorageScope } from "./devframe-Ckhf3kFw.mjs";
2
2
  import { C as RpcFunctionType, T as RpcReturnSchema, _ as RpcFunctionDefinition, g as RpcFunctionAgentOptions, i as RpcArgsSchema } from "./types-CrzNxXKq.mjs";
3
3
  import "./index-DgsLFhZg.mjs";
4
4
  import { t as DevframeNodeRpcSessionMeta } from "./ws-server-9-wn7MNQ.mjs";
@@ -1,3 +1,3 @@
1
- import { p as DevframeAuthHandler } from "../devframe-DfzYvlKI.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-CxpC1ItQ.mjs";
1
+ import { p as DevframeAuthHandler } from "../devframe-Ckhf3kFw.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-8dndvIxR.mjs";
3
3
  export { DevframeAuthHandler, buildOtpAuthUrl, exchangeTempAuthCode, getTempAuthCode, refreshTempAuthCode, revokeActiveConnectionsForToken, revokeAuthToken, verifyAuthToken };
@@ -1,5 +1,5 @@
1
- import { i as DevframeDeploymentKind, r as DevframeDefinition } from "../devframe-DfzYvlKI.mjs";
2
- import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-FonV8enL.mjs";
1
+ import { i as DevframeDeploymentKind, r as DevframeDefinition } from "../devframe-Ckhf3kFw.mjs";
2
+ import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-CzqPrJSz.mjs";
3
3
  //#region src/adapters/_shared.d.ts
4
4
  /**
5
5
  * Resolve the mount base path for a devframe's SPA. Hosted adapters
@@ -1,3 +1,3 @@
1
- import { n as internalContextMap, t as getInternalContext } from "../context-C1Gr2BGB.mjs";
1
+ import { n as internalContextMap, t as getInternalContext } from "../context-DY72brRI.mjs";
2
2
  import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-bWRzeSa0.mjs";
3
3
  export { getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
@@ -1,7 +1,7 @@
1
- import { C as DevframeServicesHost, Ct as AgentResourceContent, Dt as DevframeAgentHost$1, Et as AgentToolInput, H as DevframeDiagnosticsHost$1, J as RpcSharedStateHost, K as RpcFunctionsHost, L as DevframeViewHost$1, O as DevframeSettings, Ot as DevframeAgentHostEvents, R as DevframeHost, S as DevframeServiceOf, St as AgentResource, T as DevframeScopedNodeContext, Tt as AgentTool, U as DevframeDiagnosticsLogger, Z as RpcStreamingHost, b as DevframeNodeContext, bt as AgentHandle, ht as SharedState, kt as EventEmitter, wt as AgentResourceInput, x as DevframeServiceId, xt as AgentManifest } from "../devframe-DfzYvlKI.mjs";
1
+ import { C as DevframeServicesHost, Ct as AgentResourceContent, Dt as DevframeAgentHost$1, Et as AgentToolInput, H as DevframeDiagnosticsHost$1, J as RpcSharedStateHost, K as RpcFunctionsHost, L as DevframeViewHost$1, O as DevframeSettings, Ot as DevframeAgentHostEvents, R as DevframeHost, S as DevframeServiceOf, St as AgentResource, T as DevframeScopedNodeContext, Tt as AgentTool, U as DevframeDiagnosticsLogger, Z as RpcStreamingHost, b as DevframeNodeContext, bt as AgentHandle, ht as SharedState, kt as EventEmitter, wt as AgentResourceInput, x as DevframeServiceId, xt as AgentManifest } from "../devframe-Ckhf3kFw.mjs";
2
2
  import { v as RpcFunctionDefinitionAny } from "../types-CrzNxXKq.mjs";
3
3
  import "../index-DgsLFhZg.mjs";
4
- import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-Bf27EWpv.mjs";
4
+ import { n as StartedServer, r as startHttpAndWs, t as StartHttpAndWsOptions } from "../server-B0wiP_Oi.mjs";
5
5
  import { BirpcGroup } from "birpc";
6
6
  //#region src/node/context.d.ts
7
7
  interface CreateHostContextOptions {
@@ -1,4 +1,4 @@
1
- import { t as createStorage } from "../storage-D_Xy9v1l.mjs";
2
- import { a as DevframeViewHost, c as createRpcSharedStateServerHost, i as createNodeSettings, l as DevframeDiagnosticsHost, n as createHostContext, o as DevframeServicesHostImpl, r as createScopedNodeContext, s as createRpcStreamingServerHost, t as createH3DevframeHost, u as DevframeAgentHost } from "../host-h3-SjwRTwkE.mjs";
3
- import { a as toDialableHost, i as normalizeHttpServerUrl, n as formatHostForUrl, r as isObject, t as startHttpAndWs } from "../server-BFsuZI9e.mjs";
1
+ import { t as createStorage } from "../storage-gEnj9ASQ.mjs";
2
+ import { a as DevframeViewHost, c as createRpcSharedStateServerHost, i as createNodeSettings, l as DevframeDiagnosticsHost, n as createHostContext, o as DevframeServicesHostImpl, r as createScopedNodeContext, s as createRpcStreamingServerHost, t as createH3DevframeHost, u as DevframeAgentHost } from "../host-h3-CgOetlNE.mjs";
3
+ import { a as toDialableHost, i as normalizeHttpServerUrl, n as formatHostForUrl, r as isObject, t as startHttpAndWs } from "../server-DykHCza_.mjs";
4
4
  export { DevframeAgentHost, DevframeDiagnosticsHost, DevframeServicesHostImpl, DevframeViewHost, createH3DevframeHost, createHostContext, createNodeSettings, createRpcSharedStateServerHost, createRpcStreamingServerHost, createScopedNodeContext, createStorage, formatHostForUrl, isObject, normalizeHttpServerUrl, startHttpAndWs, toDialableHost };
@@ -0,0 +1,118 @@
1
+ import "../devframe-Ckhf3kFw.mjs";
2
+ import { E as Thenable, S as RpcFunctionSetupResult, c as RpcDump, g as RpcFunctionAgentOptions } from "../types-CrzNxXKq.mjs";
3
+ import "../index-DgsLFhZg.mjs";
4
+ import * as v from "valibot";
5
+ //#region src/recipes/common-rpc-functions.d.ts
6
+ /**
7
+ * Editor commands that `launch-editor` (the library behind
8
+ * `devframe/utils/launch-editor`) recognizes with a tailored
9
+ * `file:line:column` invocation. `openInEditor`'s optional second argument
10
+ * is restricted to this union, so the RPC surface can't be used to spawn an
11
+ * arbitrary command.
12
+ */
13
+ type KnownEditor = 'atom' | 'subl' | 'sublime' | 'sublime_text' | 'wstorm' | 'charm' | 'zed' | 'notepad++' | 'vim' | 'mvim' | 'joe' | 'gvim' | 'emacs' | 'emacsclient' | 'rmate' | 'mate' | 'code' | 'code-insiders' | 'codium' | 'vscodium' | 'trae' | 'antigravity' | 'cursor' | 'appcode' | 'clion' | 'idea' | 'phpstorm' | 'pycharm' | 'rubymine' | 'webstorm' | 'goland' | 'rider';
14
+ /** Runtime list of every {@link KnownEditor}, in the order `v.picklist` reports them. */
15
+ declare const KNOWN_EDITORS: KnownEditor[];
16
+ /**
17
+ * Prebuilt RPC action that opens a file in the user's configured editor.
18
+ *
19
+ * Registered name: `devframe:open-in-editor`.
20
+ *
21
+ * The optional second argument picks the editor command explicitly (must be
22
+ * one of {@link KNOWN_EDITORS}); otherwise it's auto-detected per
23
+ * `devframe/utils/launch-editor`.
24
+ *
25
+ * ```ts
26
+ * import { openInEditor } from 'devframe/recipes/common-rpc-functions'
27
+ *
28
+ * defineDevframe({
29
+ * id: 'my-tool',
30
+ * name: 'My Tool',
31
+ * setup(ctx) {
32
+ * ctx.rpc.register(openInEditor)
33
+ * },
34
+ * })
35
+ * ```
36
+ */
37
+ declare const openInEditor: {
38
+ name: "devframe:open-in-editor";
39
+ type?: "action" | undefined;
40
+ cacheable?: boolean;
41
+ args: readonly [v.StringSchema<undefined>, v.OptionalSchema<v.PicklistSchema<KnownEditor[], undefined>, undefined>];
42
+ returns: v.VoidSchema<undefined>;
43
+ jsonSerializable?: boolean;
44
+ agent?: RpcFunctionAgentOptions;
45
+ setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>>) | undefined;
46
+ handler?: ((args_0: string, args_1: KnownEditor | undefined) => void) | undefined;
47
+ dump?: RpcDump<[string, KnownEditor | undefined], void, undefined> | undefined;
48
+ snapshot?: boolean;
49
+ __cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>>> | undefined;
50
+ __promise?: Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>> | undefined;
51
+ };
52
+ /**
53
+ * Prebuilt RPC action that reveals a path in the OS file explorer.
54
+ *
55
+ * Registered name: `devframe:open-in-finder`.
56
+ *
57
+ * ```ts
58
+ * import { openInFinder } from 'devframe/recipes/common-rpc-functions'
59
+ *
60
+ * ctx.rpc.register(openInFinder)
61
+ * ```
62
+ */
63
+ declare const openInFinder: {
64
+ name: "devframe:open-in-finder";
65
+ type?: "action" | undefined;
66
+ cacheable?: boolean;
67
+ args: readonly [v.StringSchema<undefined>];
68
+ returns: v.VoidSchema<undefined>;
69
+ jsonSerializable?: boolean;
70
+ agent?: RpcFunctionAgentOptions;
71
+ setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], void>>) | undefined;
72
+ handler?: ((args_0: string) => void) | undefined;
73
+ dump?: RpcDump<[string], void, undefined> | undefined;
74
+ snapshot?: boolean;
75
+ __cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], void>>> | undefined;
76
+ __promise?: Thenable<RpcFunctionSetupResult<[string], void>> | undefined;
77
+ };
78
+ /**
79
+ * Convenience array bundling both helpers so callers can register them
80
+ * in a single `forEach`.
81
+ *
82
+ * ```ts
83
+ * import { commonRpcFunctions } from 'devframe/recipes/common-rpc-functions'
84
+ *
85
+ * commonRpcFunctions.forEach(fn => ctx.rpc.register(fn))
86
+ * ```
87
+ */
88
+ declare const commonRpcFunctions: readonly [{
89
+ name: "devframe:open-in-editor";
90
+ type?: "action" | undefined;
91
+ cacheable?: boolean;
92
+ args: readonly [v.StringSchema<undefined>, v.OptionalSchema<v.PicklistSchema<KnownEditor[], undefined>, undefined>];
93
+ returns: v.VoidSchema<undefined>;
94
+ jsonSerializable?: boolean;
95
+ agent?: RpcFunctionAgentOptions;
96
+ setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>>) | undefined;
97
+ handler?: ((args_0: string, args_1: KnownEditor | undefined) => void) | undefined;
98
+ dump?: RpcDump<[string, KnownEditor | undefined], void, undefined> | undefined;
99
+ snapshot?: boolean;
100
+ __cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>>> | undefined;
101
+ __promise?: Thenable<RpcFunctionSetupResult<[string, KnownEditor | undefined], void>> | undefined;
102
+ }, {
103
+ name: "devframe:open-in-finder";
104
+ type?: "action" | undefined;
105
+ cacheable?: boolean;
106
+ args: readonly [v.StringSchema<undefined>];
107
+ returns: v.VoidSchema<undefined>;
108
+ jsonSerializable?: boolean;
109
+ agent?: RpcFunctionAgentOptions;
110
+ setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], void>>) | undefined;
111
+ handler?: ((args_0: string) => void) | undefined;
112
+ dump?: RpcDump<[string], void, undefined> | undefined;
113
+ snapshot?: boolean;
114
+ __cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], void>>> | undefined;
115
+ __promise?: Thenable<RpcFunctionSetupResult<[string], void>> | undefined;
116
+ }];
117
+ //#endregion
118
+ export { KNOWN_EDITORS, KnownEditor, commonRpcFunctions, openInEditor, openInFinder };
@@ -0,0 +1,105 @@
1
+ import { n as defineRpcFunction } from "../define-BLWPsH6y.mjs";
2
+ import * as v from "valibot";
3
+ //#region src/recipes/common-rpc-functions.ts
4
+ /** Runtime list of every {@link KnownEditor}, in the order `v.picklist` reports them. */
5
+ const KNOWN_EDITORS = [
6
+ "atom",
7
+ "subl",
8
+ "sublime",
9
+ "sublime_text",
10
+ "wstorm",
11
+ "charm",
12
+ "zed",
13
+ "notepad++",
14
+ "vim",
15
+ "mvim",
16
+ "joe",
17
+ "gvim",
18
+ "emacs",
19
+ "emacsclient",
20
+ "rmate",
21
+ "mate",
22
+ "code",
23
+ "code-insiders",
24
+ "codium",
25
+ "vscodium",
26
+ "trae",
27
+ "antigravity",
28
+ "cursor",
29
+ "appcode",
30
+ "clion",
31
+ "idea",
32
+ "phpstorm",
33
+ "pycharm",
34
+ "rubymine",
35
+ "webstorm",
36
+ "goland",
37
+ "rider"
38
+ ];
39
+ /**
40
+ * Prebuilt RPC action that opens a file in the user's configured editor.
41
+ *
42
+ * Registered name: `devframe:open-in-editor`.
43
+ *
44
+ * The optional second argument picks the editor command explicitly (must be
45
+ * one of {@link KNOWN_EDITORS}); otherwise it's auto-detected per
46
+ * `devframe/utils/launch-editor`.
47
+ *
48
+ * ```ts
49
+ * import { openInEditor } from 'devframe/recipes/common-rpc-functions'
50
+ *
51
+ * defineDevframe({
52
+ * id: 'my-tool',
53
+ * name: 'My Tool',
54
+ * setup(ctx) {
55
+ * ctx.rpc.register(openInEditor)
56
+ * },
57
+ * })
58
+ * ```
59
+ */
60
+ const openInEditor = defineRpcFunction({
61
+ name: "devframe:open-in-editor",
62
+ type: "action",
63
+ jsonSerializable: true,
64
+ args: [v.string(), v.optional(v.picklist(KNOWN_EDITORS))],
65
+ returns: v.void(),
66
+ async handler(filename, editor) {
67
+ const { launchEditor } = await import("../utils/launch-editor.mjs");
68
+ launchEditor(filename, editor);
69
+ }
70
+ });
71
+ /**
72
+ * Prebuilt RPC action that reveals a path in the OS file explorer.
73
+ *
74
+ * Registered name: `devframe:open-in-finder`.
75
+ *
76
+ * ```ts
77
+ * import { openInFinder } from 'devframe/recipes/common-rpc-functions'
78
+ *
79
+ * ctx.rpc.register(openInFinder)
80
+ * ```
81
+ */
82
+ const openInFinder = defineRpcFunction({
83
+ name: "devframe:open-in-finder",
84
+ type: "action",
85
+ jsonSerializable: true,
86
+ args: [v.string()],
87
+ returns: v.void(),
88
+ async handler(path) {
89
+ const { open } = await import("../utils/open.mjs");
90
+ await open(path);
91
+ }
92
+ });
93
+ /**
94
+ * Convenience array bundling both helpers so callers can register them
95
+ * in a single `forEach`.
96
+ *
97
+ * ```ts
98
+ * import { commonRpcFunctions } from 'devframe/recipes/common-rpc-functions'
99
+ *
100
+ * commonRpcFunctions.forEach(fn => ctx.rpc.register(fn))
101
+ * ```
102
+ */
103
+ const commonRpcFunctions = [openInEditor, openInFinder];
104
+ //#endregion
105
+ export { KNOWN_EDITORS, commonRpcFunctions, openInEditor, openInFinder };
@@ -1,5 +1,5 @@
1
- import { b as DevframeNodeContext, p as DevframeAuthHandler } from "../devframe-DfzYvlKI.mjs";
2
- import "../index-CxpC1ItQ.mjs";
1
+ import { b as DevframeNodeContext, p as DevframeAuthHandler } from "../devframe-Ckhf3kFw.mjs";
2
+ import "../index-8dndvIxR.mjs";
3
3
  //#region src/recipes/interactive-auth.d.ts
4
4
  interface CreateInteractiveAuthOptions {
5
5
  /**
@@ -1,7 +1,7 @@
1
1
  import { n as colors } from "../diagnostics-reporter-CsIG85Q5.mjs";
2
2
  import { isAnonymousRpcMethod } from "../constants.mjs";
3
3
  import { n as defineRpcFunction } from "../define-BLWPsH6y.mjs";
4
- import { t as getInternalContext } from "../context-C1Gr2BGB.mjs";
4
+ import { t as getInternalContext } from "../context-DY72brRI.mjs";
5
5
  import { a as verifyAuthToken, n as exchangeTempAuthCode, r as getTempAuthCode, t as buildOtpAuthUrl } from "../state-WX3HT5a3.mjs";
6
6
  import * as v from "valibot";
7
7
  //#region src/recipes/interactive-auth.ts
@@ -1,104 +1,6 @@
1
- import "../devframe-DfzYvlKI.mjs";
2
- import { E as Thenable, S as RpcFunctionSetupResult, c as RpcDump, g as RpcFunctionAgentOptions } from "../types-CrzNxXKq.mjs";
3
- import "../index-DgsLFhZg.mjs";
4
- import * as v from "valibot";
1
+ import { commonRpcFunctions, openInEditor, openInFinder } from "./common-rpc-functions.mjs";
5
2
  //#region src/recipes/open-helpers.d.ts
6
- /**
7
- * Prebuilt RPC action that opens a file in the user's configured editor.
8
- *
9
- * Registered name: `devframe:open-in-editor`.
10
- *
11
- * ```ts
12
- * import { openInEditor } from 'devframe/recipes/open-helpers'
13
- *
14
- * defineDevframe({
15
- * id: 'my-tool',
16
- * name: 'My Tool',
17
- * setup(ctx) {
18
- * ctx.rpc.register(openInEditor)
19
- * },
20
- * })
21
- * ```
22
- */
23
- declare const openInEditor: {
24
- name: "devframe:open-in-editor";
25
- type?: "action" | undefined;
26
- cacheable?: boolean;
27
- args: readonly [v.StringSchema<undefined>];
28
- returns: v.VoidSchema<undefined>;
29
- jsonSerializable?: boolean;
30
- agent?: RpcFunctionAgentOptions;
31
- setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], void>>) | undefined;
32
- handler?: ((args_0: string) => void) | undefined;
33
- dump?: RpcDump<[string], void, undefined> | undefined;
34
- snapshot?: boolean;
35
- __cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], void>>> | undefined;
36
- __promise?: Thenable<RpcFunctionSetupResult<[string], void>> | undefined;
37
- };
38
- /**
39
- * Prebuilt RPC action that reveals a path in the OS file explorer.
40
- *
41
- * Registered name: `devframe:open-in-finder`.
42
- *
43
- * ```ts
44
- * import { openInFinder } from 'devframe/recipes/open-helpers'
45
- *
46
- * ctx.rpc.register(openInFinder)
47
- * ```
48
- */
49
- declare const openInFinder: {
50
- name: "devframe:open-in-finder";
51
- type?: "action" | undefined;
52
- cacheable?: boolean;
53
- args: readonly [v.StringSchema<undefined>];
54
- returns: v.VoidSchema<undefined>;
55
- jsonSerializable?: boolean;
56
- agent?: RpcFunctionAgentOptions;
57
- setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], void>>) | undefined;
58
- handler?: ((args_0: string) => void) | undefined;
59
- dump?: RpcDump<[string], void, undefined> | undefined;
60
- snapshot?: boolean;
61
- __cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], void>>> | undefined;
62
- __promise?: Thenable<RpcFunctionSetupResult<[string], void>> | undefined;
63
- };
64
- /**
65
- * Convenience array bundling both helpers so callers can register them
66
- * in a single `forEach`.
67
- *
68
- * ```ts
69
- * import { openHelpers } from 'devframe/recipes/open-helpers'
70
- *
71
- * openHelpers.forEach(fn => ctx.rpc.register(fn))
72
- * ```
73
- */
74
- declare const openHelpers: readonly [{
75
- name: "devframe:open-in-editor";
76
- type?: "action" | undefined;
77
- cacheable?: boolean;
78
- args: readonly [v.StringSchema<undefined>];
79
- returns: v.VoidSchema<undefined>;
80
- jsonSerializable?: boolean;
81
- agent?: RpcFunctionAgentOptions;
82
- setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], void>>) | undefined;
83
- handler?: ((args_0: string) => void) | undefined;
84
- dump?: RpcDump<[string], void, undefined> | undefined;
85
- snapshot?: boolean;
86
- __cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], void>>> | undefined;
87
- __promise?: Thenable<RpcFunctionSetupResult<[string], void>> | undefined;
88
- }, {
89
- name: "devframe:open-in-finder";
90
- type?: "action" | undefined;
91
- cacheable?: boolean;
92
- args: readonly [v.StringSchema<undefined>];
93
- returns: v.VoidSchema<undefined>;
94
- jsonSerializable?: boolean;
95
- agent?: RpcFunctionAgentOptions;
96
- setup?: ((context: undefined) => Thenable<RpcFunctionSetupResult<[string], void>>) | undefined;
97
- handler?: ((args_0: string) => void) | undefined;
98
- dump?: RpcDump<[string], void, undefined> | undefined;
99
- snapshot?: boolean;
100
- __cache?: WeakMap<object, Thenable<RpcFunctionSetupResult<[string], void>>> | undefined;
101
- __promise?: Thenable<RpcFunctionSetupResult<[string], void>> | undefined;
102
- }];
3
+ /** @deprecated Use `commonRpcFunctions` from `devframe/recipes/common-rpc-functions` instead. */
4
+ declare const openHelpers: typeof commonRpcFunctions;
103
5
  //#endregion
104
6
  export { openHelpers, openInEditor, openInFinder };