devframe 0.7.0 → 0.7.2

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 (56) hide show
  1. package/dist/adapters/build.d.mts +1 -2
  2. package/dist/adapters/build.mjs +1 -1
  3. package/dist/adapters/cac.d.mts +1 -2
  4. package/dist/adapters/cac.mjs +1 -1
  5. package/dist/adapters/cli.d.mts +1 -2
  6. package/dist/adapters/cli.mjs +1 -1
  7. package/dist/adapters/dev.d.mts +2 -3
  8. package/dist/adapters/dev.mjs +1 -1
  9. package/dist/adapters/embedded.d.mts +1 -2
  10. package/dist/adapters/mcp.d.mts +2 -1
  11. package/dist/adapters/mcp.mjs +1 -1
  12. package/dist/{build-server-0jWgMrz-.mjs → build-server-Bo0G5XcS.mjs} +10 -4
  13. package/dist/{cac-DCBSjlzl.mjs → cac-BFCgKymz.mjs} +1 -1
  14. package/dist/client/index.d.mts +4 -5
  15. package/dist/client/index.mjs +7 -2
  16. package/dist/{context-BsiCAEC4.d.mts → context-B1sekkgB.d.mts} +3 -3
  17. package/dist/{dev-YeAm6GL0.mjs → dev-Bs4oRVnI.mjs} +1 -1
  18. package/dist/{devframe-Dma0XG3U.d.mts → devframe-CnTVuGw9.d.mts} +26 -13
  19. package/dist/{dump-D09PZb7T.mjs → dump-CocOVBVz.mjs} +3 -1
  20. package/dist/{hash-PAfnyu2k.mjs → hash-KtDZYXDN.mjs} +5 -2
  21. package/dist/helpers/vite.d.mts +6 -4
  22. package/dist/helpers/vite.mjs +1 -1
  23. package/dist/{http-COX960WK.mjs → http-BirzlyE9.mjs} +1 -1
  24. package/dist/{index-DI_TMGjv.d.mts → index-DgsLFhZg.d.mts} +2 -3
  25. package/dist/{index-d40ZLcYw.d.mts → index-Dpsr-8dD.d.mts} +4 -4
  26. package/dist/{index-BAZpbgHu.d.mts → index-YDSJgsyG.d.mts} +1 -2
  27. package/dist/index.d.mts +4 -4
  28. package/dist/{launch-editor-DIzaS5EG.mjs → launch-editor-C_xuzLnF.mjs} +67 -16
  29. package/dist/node/auth.d.mts +1 -1
  30. package/dist/node/hub-internals.d.mts +2 -3
  31. package/dist/node/index.d.mts +5 -6
  32. package/dist/recipes/interactive-auth.d.mts +2 -3
  33. package/dist/recipes/interactive-auth.mjs +1 -0
  34. package/dist/recipes/open-helpers.d.mts +3 -2
  35. package/dist/recipes/open-helpers.mjs +1 -1
  36. package/dist/rpc/client.d.mts +0 -1
  37. package/dist/rpc/dump.d.mts +1 -1
  38. package/dist/rpc/dump.mjs +1 -1
  39. package/dist/rpc/index.d.mts +2 -2
  40. package/dist/rpc/index.mjs +1 -1
  41. package/dist/rpc/server.d.mts +0 -1
  42. package/dist/rpc/transports/ws-client.d.mts +1 -1
  43. package/dist/rpc/transports/ws-server.d.mts +1 -1
  44. package/dist/{server-BD-tKDVf.d.mts → server-4QH37sb-.d.mts} +2 -3
  45. package/dist/types/index.d.mts +3 -3
  46. package/dist/{types-oEqKqUC9.d.mts → types-CrzNxXKq.d.mts} +42 -23
  47. package/dist/utils/events.d.mts +1 -2
  48. package/dist/utils/hash.mjs +1 -1
  49. package/dist/utils/launch-editor.mjs +1 -1
  50. package/dist/utils/serve-static.d.mts +0 -1
  51. package/dist/utils/shared-state.d.mts +1 -1
  52. package/dist/utils/streaming-channel.d.mts +1 -1
  53. package/dist/utils/when.d.mts +1 -330
  54. package/dist/{ws-client-nBjpin71.d.mts → ws-client-DSXiI2h7.d.mts} +1 -2
  55. package/dist/{ws-server-BUgJpdX4.d.mts → ws-server-CceOy6He.d.mts} +1 -2
  56. package/package.json +4 -4
@@ -1,5 +1,4 @@
1
- import { r as DevframeDefinition } from "../devframe-Dma0XG3U.mjs";
2
-
1
+ import { r as DevframeDefinition } from "../devframe-CnTVuGw9.mjs";
3
2
  //#region src/adapters/build.d.ts
4
3
  interface CreateBuildOptions {
5
4
  /** Output directory. Defaults to `dist-static`. */
@@ -1,4 +1,4 @@
1
- import { t as collectStaticRpcDump } from "../dump-D09PZb7T.mjs";
1
+ import { t as collectStaticRpcDump } from "../dump-CocOVBVz.mjs";
2
2
  import { n as colors } from "../diagnostics-reporter-CsIG85Q5.mjs";
3
3
  import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_RPC_DUMP_DIRNAME, DEVFRAME_RPC_DUMP_MANIFEST_FILENAME } from "../constants.mjs";
4
4
  import { n as strictJsonStringify } from "../serialization-DpLXCy13.mjs";
@@ -1,7 +1,6 @@
1
- import { Dt as defineCliFlags, Et as InferCliFlags, Ot as parseCliFlags, Tt as CliFlagsSchema, r as DevframeDefinition } from "../devframe-Dma0XG3U.mjs";
1
+ import { Dt as defineCliFlags, Et as InferCliFlags, Ot as parseCliFlags, Tt as CliFlagsSchema, r as DevframeDefinition } from "../devframe-CnTVuGw9.mjs";
2
2
  import { CAC } from "cac";
3
3
  import { H3 } from "h3";
4
-
5
4
  //#region src/adapters/cac.d.ts
6
5
  interface CreateCacOptions {
7
6
  /** Default port for `dev` (default: 9999). */
@@ -1,2 +1,2 @@
1
- import { n as defineCliFlags, r as parseCliFlags, t as createCac } from "../cac-DCBSjlzl.mjs";
1
+ import { n as defineCliFlags, r as parseCliFlags, t as createCac } from "../cac-BFCgKymz.mjs";
2
2
  export { createCac, defineCliFlags, parseCliFlags };
@@ -1,6 +1,5 @@
1
- import { Dt as defineCliFlags, Et as InferCliFlags, Ot as parseCliFlags, Tt as CliFlagsSchema } from "../devframe-Dma0XG3U.mjs";
1
+ import { Dt as defineCliFlags, Et as InferCliFlags, Ot as parseCliFlags, Tt as CliFlagsSchema } from "../devframe-CnTVuGw9.mjs";
2
2
  import { CacHandle, CreateCacOptions, createCac } from "./cac.mjs";
3
-
4
3
  //#region src/adapters/cli.d.ts
5
4
  /** @deprecated Use `createCac` from `devframe/adapters/cac` instead. */
6
5
  declare const createCli: typeof createCac;
@@ -1,4 +1,4 @@
1
- import { n as defineCliFlags, r as parseCliFlags, t as createCac } from "../cac-DCBSjlzl.mjs";
1
+ import { n as defineCliFlags, r as parseCliFlags, t as createCac } from "../cac-BFCgKymz.mjs";
2
2
  //#region src/adapters/cli.ts
3
3
  /** @deprecated Use `createCac` from `devframe/adapters/cac` instead. */
4
4
  const createCli = createCac;
@@ -1,7 +1,6 @@
1
- import { d as McpRouteOptions, r as DevframeDefinition, u as DevframeWsOptions } from "../devframe-Dma0XG3U.mjs";
2
- import { n as StartedServer } from "../server-BD-tKDVf.mjs";
1
+ import { d as McpRouteOptions, r as DevframeDefinition, u as DevframeWsOptions } from "../devframe-CnTVuGw9.mjs";
2
+ import { n as StartedServer } from "../server-4QH37sb-.mjs";
3
3
  import { H3 } from "h3";
4
-
5
4
  //#region src/adapters/dev.d.ts
6
5
  interface CreateDevServerOptions {
7
6
  /** Bind host. Default: `def.cli?.host ?? 'localhost'`. */
@@ -1,2 +1,2 @@
1
- import { n as resolveDevServerPort, t as createDevServer } from "../dev-YeAm6GL0.mjs";
1
+ import { n as resolveDevServerPort, t as createDevServer } from "../dev-Bs4oRVnI.mjs";
2
2
  export { createDevServer, resolveDevServerPort };
@@ -1,5 +1,4 @@
1
- import { g as DevframeNodeContext, r as DevframeDefinition } from "../devframe-Dma0XG3U.mjs";
2
-
1
+ import { g as DevframeNodeContext, r as DevframeDefinition } from "../devframe-CnTVuGw9.mjs";
3
2
  //#region src/adapters/embedded.d.ts
4
3
  interface CreateEmbeddedOptions {
5
4
  /** Target context the devframe is registered into. Required. */
@@ -1,4 +1,5 @@
1
- import { r as DevframeDefinition } from "../devframe-Dma0XG3U.mjs";
1
+ import { r as DevframeDefinition } from "../devframe-CnTVuGw9.mjs";
2
+ import "@modelcontextprotocol/sdk/server/index.js";
2
3
  //#region src/adapters/mcp/build-server.d.ts
3
4
  interface CreateMcpServerOptions {
4
5
  /**
@@ -1,2 +1,2 @@
1
- import { n as createMcpServer } from "../build-server-0jWgMrz-.mjs";
1
+ import { n as createMcpServer } from "../build-server-Bo0G5XcS.mjs";
2
2
  export { createMcpServer };
@@ -229,10 +229,16 @@ function registerToolHandlers(server, ctx) {
229
229
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
230
230
  const { name, arguments: args } = request.params;
231
231
  try {
232
- return { content: [{
233
- type: "text",
234
- text: stringifyForMcp(await ctx.agent.invoke(name, args ?? {}))
235
- }] };
232
+ const tool = ctx.agent.getTool(name);
233
+ const outputSchema = tool ? tool.outputSchema ?? computeOutputSchema(tool, ctx) : void 0;
234
+ const result = await ctx.agent.invoke(name, args ?? {});
235
+ return {
236
+ content: [{
237
+ type: "text",
238
+ text: stringifyForMcp(result)
239
+ }],
240
+ ...outputSchema ? { structuredContent: result } : {}
241
+ };
236
242
  } catch (error) {
237
243
  return {
238
244
  isError: true,
@@ -1,6 +1,6 @@
1
1
  import { n as colors } from "./diagnostics-reporter-CsIG85Q5.mjs";
2
2
  import { createBuild } from "./adapters/build.mjs";
3
- import { n as resolveDevServerPort, t as createDevServer } from "./dev-YeAm6GL0.mjs";
3
+ import { n as resolveDevServerPort, t as createDevServer } from "./dev-Bs4oRVnI.mjs";
4
4
  import process from "node:process";
5
5
  import cac from "cac";
6
6
  import { safeParse } from "valibot";
@@ -1,9 +1,8 @@
1
- import { A as StreamSink, St as EventEmitter, X as DevframeSettings, at as DevframeRpcClientFunctions, b as RpcSharedStateGetOptions, k as StreamReader, nt as ScopedSharedStates, ot as DevframeRpcServerFunctions, p as ConnectionMeta, rt as SettingsForNamespace, tt as ScopedServerFunctions, x as RpcSharedStateHost, z as SharedState } from "../devframe-Dma0XG3U.mjs";
2
- import { _ as RpcFunctionDefinition, w as RpcFunctionsCollector } from "../types-oEqKqUC9.mjs";
3
- import { C as RpcCacheManager, w as RpcCacheOptions } from "../index-DI_TMGjv.mjs";
4
- import { t as WsRpcChannelOptions } from "../ws-client-nBjpin71.mjs";
1
+ import { A as StreamSink, St as EventEmitter, X as DevframeSettings, at as DevframeRpcClientFunctions, b as RpcSharedStateGetOptions, k as StreamReader, nt as ScopedSharedStates, ot as DevframeRpcServerFunctions, p as ConnectionMeta, rt as SettingsForNamespace, tt as ScopedServerFunctions, x as RpcSharedStateHost, z as SharedState } from "../devframe-CnTVuGw9.mjs";
2
+ import { _ as RpcFunctionDefinition, w as RpcFunctionsCollector } from "../types-CrzNxXKq.mjs";
3
+ import { C as RpcCacheManager, w as RpcCacheOptions } from "../index-DgsLFhZg.mjs";
4
+ import { t as WsRpcChannelOptions } from "../ws-client-DSXiI2h7.mjs";
5
5
  import { BirpcOptions, BirpcReturn } from "birpc";
6
-
7
6
  //#region src/client/connection.d.ts
8
7
  /**
9
8
  * The connection lifecycle of a devframe client, as a single value a UI can
@@ -1,4 +1,4 @@
1
- import { t as hash } from "../hash-PAfnyu2k.mjs";
1
+ import { t as hash } from "../hash-KtDZYXDN.mjs";
2
2
  import { colors } from "../utils/colors.mjs";
3
3
  import { createEventEmitter } from "../utils/events.mjs";
4
4
  import { t as createSharedState } from "../shared-state-QtMas0NG.mjs";
@@ -2239,7 +2239,9 @@ async function getDevframeRpcClient(options = {}) {
2239
2239
  const bases = Array.isArray(baseURL) ? baseURL : [baseURL];
2240
2240
  let connectionMeta = options.connectionMeta || findConnectionMetaFromWindows();
2241
2241
  let resolvedBaseURL = bases[0] ?? "./";
2242
+ const inheritedMetaBaseUrl = options.connectionMeta ? void 0 : connectionMeta?.baseUrl;
2242
2243
  function resolveMetaBaseUrl() {
2244
+ if (inheritedMetaBaseUrl) return inheritedMetaBaseUrl;
2243
2245
  const metaPath = withBase(DEVFRAME_CONNECTION_META_FILENAME, resolvedBaseURL);
2244
2246
  try {
2245
2247
  return new URL(metaPath, globalThis.location?.href).href;
@@ -2252,7 +2254,10 @@ async function getDevframeRpcClient(options = {}) {
2252
2254
  for (const base of bases) try {
2253
2255
  connectionMeta = await fetch(withBase(DEVFRAME_CONNECTION_META_FILENAME, base)).then((r) => r.json());
2254
2256
  resolvedBaseURL = base;
2255
- globalThis[CONNECTION_META_KEY] = connectionMeta;
2257
+ globalThis[CONNECTION_META_KEY] = {
2258
+ ...connectionMeta,
2259
+ baseUrl: resolveMetaBaseUrl()
2260
+ };
2256
2261
  break;
2257
2262
  } catch (e) {
2258
2263
  errors.push(e);
@@ -1,5 +1,4 @@
1
- import { g as DevframeNodeContext, z as SharedState } from "./devframe-Dma0XG3U.mjs";
2
-
1
+ import { g as DevframeNodeContext, z as SharedState } from "./devframe-CnTVuGw9.mjs";
3
2
  //#region src/node/hub-internals/context.d.ts
4
3
  interface InternalAnonymousAuthStorage {
5
4
  trusted: Record<string, {
@@ -42,7 +41,8 @@ interface DevframeInternalContext {
42
41
  * docks host when enriching remote iframe URLs with a connection descriptor.
43
42
  */
44
43
  wsEndpoint?: {
45
- /** Full `ws://` or `wss://` URL with host and port. */url: string;
44
+ /** Full `ws://` or `wss://` URL with host and port. */
45
+ url: string;
46
46
  };
47
47
  }
48
48
  declare const internalContextMap: WeakMap<DevframeNodeContext, DevframeInternalContext>;
@@ -293,7 +293,7 @@ async function createDevServer(def, options = {}) {
293
293
  const mcpPath = joinURL(basePath, mcpRoute);
294
294
  let mountMcpHttp;
295
295
  try {
296
- ({mountMcpHttp} = await import("./http-COX960WK.mjs"));
296
+ ({mountMcpHttp} = await import("./http-BirzlyE9.mjs"));
297
297
  } catch (error) {
298
298
  const reason = error instanceof Error ? error.message : String(error);
299
299
  throw diagnostics.DF0017({
@@ -1,11 +1,10 @@
1
- import { _ as RpcFunctionDefinition } from "./types-oEqKqUC9.mjs";
2
- import { S as RpcFunctionsCollectorBase } from "./index-DI_TMGjv.mjs";
3
- import { t as DevframeNodeRpcSessionMeta } from "./ws-server-BUgJpdX4.mjs";
1
+ import { _ as RpcFunctionDefinition } from "./types-CrzNxXKq.mjs";
2
+ import { S as RpcFunctionsCollectorBase } from "./index-DgsLFhZg.mjs";
3
+ import { t as DevframeNodeRpcSessionMeta } from "./ws-server-CceOy6He.mjs";
4
4
  import { CAC } from "cac";
5
5
  import { GenericSchema, InferOutput } from "valibot";
6
6
  import { BirpcReturn } from "birpc";
7
7
  import { Diagnostic, DiagnosticDefinition, defineDiagnostics } from "nostics";
8
-
9
8
  //#region src/adapters/flags.d.ts
10
9
  /**
11
10
  * Schema map for typed CLI flags. Keys are flag names in camelCase —
@@ -37,7 +36,7 @@ type CliFlagsSchema = Record<string, GenericSchema>;
37
36
  */
38
37
  declare function defineCliFlags<T extends CliFlagsSchema>(flags: T): T;
39
38
  /** Extract the parsed-output type from a {@link CliFlagsSchema}. */
40
- type InferCliFlags<T extends CliFlagsSchema> = { [K in keyof T]: InferOutput<T[K]> };
39
+ type InferCliFlags<T extends CliFlagsSchema> = { [K in keyof T]: InferOutput<T[K]>; };
41
40
  /** Validate and coerce the raw cac-parsed bag against a {@link CliFlagsSchema}. */
42
41
  declare function parseCliFlags(schema: CliFlagsSchema, raw: Record<string, unknown>): {
43
42
  flags: Record<string, unknown>;
@@ -75,7 +74,7 @@ interface EventEmitter<Events extends EventsMap> {
75
74
  *
76
75
  * @internal
77
76
  */
78
- _listeners: Partial<{ [E in keyof Events]: Events[E][] }>;
77
+ _listeners: Partial<{ [E in keyof Events]: Events[E][]; }>;
79
78
  /**
80
79
  * Add a listener for a given event.
81
80
  *
@@ -378,8 +377,13 @@ interface DevframeHost {
378
377
  * `mountStatic`). Without it, an embedded SPA can only discover the
379
378
  * endpoint by inheriting it from a same-origin parent window — which fails
380
379
  * for cross-origin or sandboxed iframes. Implementations serve the same
381
- * meta they expose at the hub's own base. Optional: hosts that can't serve
382
- * a dynamic route (e.g. static-snapshot builds) may omit it.
380
+ * meta they expose at the hub's own base.
381
+ *
382
+ * Optional in the type, but a host that mounts a devframe with a servable
383
+ * `distDir` yet omits this hook triggers a `DF8106` diagnostic, since the
384
+ * SPA's `./__connection.json` fetch would otherwise fall through and break
385
+ * silently. A static-snapshot host that bakes the meta into its served files
386
+ * can implement it as a no-op to acknowledge this intentionally.
383
387
  */
384
388
  mountConnectionMeta?: (base: string) => void | Promise<void>;
385
389
  /**
@@ -664,18 +668,18 @@ interface DevframeSettings<T extends Record<string, any> = Record<string, any>>
664
668
  * namespace, so a scoped `call('get-cwd')` is typed without the
665
669
  * `my-plugin:` prefix.
666
670
  */
667
- type ScopedServerFunctions<NS extends string> = { [K in keyof DevframeRpcServerFunctions as K extends `${NS}:${infer R}` ? R : never]: DevframeRpcServerFunctions[K] };
671
+ type ScopedServerFunctions<NS extends string> = { [K in keyof DevframeRpcServerFunctions as K extends `${NS}:${infer R}` ? R : never]: DevframeRpcServerFunctions[K]; };
668
672
  /**
669
673
  * Map the client-side RPC registry down to the bare names owned by a
670
674
  * namespace, used by scoped `broadcast`.
671
675
  */
672
- type ScopedClientFunctions<NS extends string> = { [K in keyof DevframeRpcClientFunctions as K extends `${NS}:${infer R}` ? R : never]: DevframeRpcClientFunctions[K] };
676
+ type ScopedClientFunctions<NS extends string> = { [K in keyof DevframeRpcClientFunctions as K extends `${NS}:${infer R}` ? R : never]: DevframeRpcClientFunctions[K]; };
673
677
  /**
674
678
  * Map the shared-state registry down to the bare keys owned by a
675
679
  * namespace, so scoped `sharedState('messages')` is typed without the
676
680
  * `my-plugin:` prefix.
677
681
  */
678
- type ScopedSharedStates<NS extends string> = { [K in keyof DevframeRpcSharedStates as K extends `${NS}:${infer R}` ? R : never]: DevframeRpcSharedStates[K] };
682
+ type ScopedSharedStates<NS extends string> = { [K in keyof DevframeRpcSharedStates as K extends `${NS}:${infer R}` ? R : never]: DevframeRpcSharedStates[K]; };
679
683
  /**
680
684
  * Broadcast options for a scoped client method (bare name).
681
685
  */
@@ -776,7 +780,7 @@ interface DevframeScopedNodeContext<NS extends string = string, Settings extends
776
780
  //#endregion
777
781
  //#region src/types/utils.d.ts
778
782
  type Thenable<T> = T | Promise<T>;
779
- type EntriesToObject<T extends readonly [string, any][]> = { [K in T[number] as K[0]]: K[1] };
783
+ type EntriesToObject<T extends readonly [string, any][]> = { [K in T[number] as K[0]]: K[1]; };
780
784
  type PartialWithoutId<T extends {
781
785
  id: string;
782
786
  }> = Partial<Omit<T, 'id'>> & {
@@ -789,7 +793,7 @@ type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U>
789
793
  type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
790
794
  type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
791
795
  type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
792
- type ImmutableObject<T> = { readonly [K in keyof T]: Immutable<T[K]> };
796
+ type ImmutableObject<T> = { readonly [K in keyof T]: Immutable<T[K]>; };
793
797
  /**
794
798
  * Serializable patch describing a single mutation to a `SharedState`.
795
799
  * Structurally compatible with JSON-Patch and is safe to send over RPC.
@@ -1239,6 +1243,15 @@ interface ConnectionMeta {
1239
1243
  * structured-clone.
1240
1244
  */
1241
1245
  jsonSerializableMethods?: string[];
1246
+ /**
1247
+ * Absolute URL of the `__connection.json` this meta was loaded from.
1248
+ * Annotated by the client (not served) when it publishes the meta on a
1249
+ * shared window for same-origin inheritance: a relative `websocket.path`
1250
+ * resolves against this, so a child SPA mounted at another base (e.g. a hub
1251
+ * mounting several devframes at `/__foo/`, `/__bar/`, …) inherits a dialable
1252
+ * endpoint rather than resolving the path against its own mount.
1253
+ */
1254
+ baseUrl?: string;
1242
1255
  }
1243
1256
  //#endregion
1244
1257
  //#region src/types/devframe.d.ts
@@ -105,7 +105,9 @@ const c = /*@__PURE__*/ function() {
105
105
  }();
106
106
  //#endregion
107
107
  //#region ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs
108
- const e = globalThis.process?.getBuiltinModule?.("crypto")?.hash, r = "sha256", s = "base64url";
108
+ const e = globalThis.process?.getBuiltinModule?.("crypto")?.hash;
109
+ const r = "sha256";
110
+ const s = "base64url";
109
111
  function digest(t) {
110
112
  if (e) return e(r, t, s);
111
113
  const o = createHash(r).update(t);
@@ -111,7 +111,8 @@ const z = [
111
111
  -1694144372,
112
112
  528734635,
113
113
  1541459225
114
- ], R = [
114
+ ];
115
+ const R = [
115
116
  1116352408,
116
117
  1899447441,
117
118
  -1245643825,
@@ -176,7 +177,9 @@ const z = [
176
177
  -1538233109,
177
178
  -1090935817,
178
179
  -965641998
179
- ], S = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", r = [];
180
+ ];
181
+ const S = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
182
+ const r = [];
180
183
  var k = class {
181
184
  _data = new l();
182
185
  _hash = new l([...z]);
@@ -1,5 +1,4 @@
1
- import { r as DevframeDefinition } from "../devframe-Dma0XG3U.mjs";
2
-
1
+ import { r as DevframeDefinition } from "../devframe-CnTVuGw9.mjs";
3
2
  //#region src/helpers/vite.d.ts
4
3
  interface ViteDevBridgeOptions {
5
4
  /**
@@ -24,8 +23,11 @@ interface ViteDevBridgeOptions {
24
23
  * - object — bridge mode with explicit overrides.
25
24
  */
26
25
  devMiddleware?: boolean | {
27
- /** Override the bridge port. Default: {@link resolveDevServerPort}. */port?: number; /** Override the bridge bind host. Default: `def.cli?.host ?? 'localhost'`. */
28
- host?: string; /** Flag bag forwarded to `def.setup(ctx, { flags })`. */
26
+ /** Override the bridge port. Default: {@link resolveDevServerPort}. */
27
+ port?: number;
28
+ /** Override the bridge bind host. Default: `def.cli?.host ?? 'localhost'`. */
29
+ host?: string;
30
+ /** Flag bag forwarded to `def.setup(ctx, { flags })`. */
29
31
  flags?: Record<string, unknown>;
30
32
  };
31
33
  }
@@ -2,7 +2,7 @@ import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_WS_ROUTE } from "../constan
2
2
  import { a as diagnostics } from "../storage-yrUZaiib.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-YeAm6GL0.mjs";
5
+ import { n as resolveDevServerPort, t as createDevServer } from "../dev-Bs4oRVnI.mjs";
6
6
  import { resolve } from "pathe";
7
7
  //#region src/helpers/vite.ts
8
8
  /**
@@ -1,5 +1,5 @@
1
1
  import { isAllowedOrigin } from "./rpc/transports/ws-server.mjs";
2
- import { t as buildMcpServerFromContext } from "./build-server-0jWgMrz-.mjs";
2
+ import { t as buildMcpServerFromContext } from "./build-server-Bo0G5XcS.mjs";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { defineHandler } from "h3";
5
5
  import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
@@ -1,6 +1,5 @@
1
- import { C as RpcFunctionType, S as RpcFunctionSetupResult, T as RpcReturnSchema, _ as RpcFunctionDefinition, i as RpcArgsSchema, v as RpcFunctionDefinitionAny, w as RpcFunctionsCollector } from "./types-oEqKqUC9.mjs";
2
- import { a as getDefinitionsWithDumps$1, c as StaticRpcDumpManifest$1, d as StaticRpcDumpManifestValue$1, f as StaticRpcDumpSerialization$1, i as dumpFunctions$1, l as StaticRpcDumpManifestQueryEntry$1, n as serializeDumpError$1, o as StaticRpcDumpCollection$1, p as collectStaticRpcDump$1, r as createClientFromDump$1, s as StaticRpcDumpFile$1, t as reviveDumpError$1, u as StaticRpcDumpManifestStaticEntry$1 } from "./index-BAZpbgHu.mjs";
3
-
1
+ import { C as RpcFunctionType, S as RpcFunctionSetupResult, T as RpcReturnSchema, _ as RpcFunctionDefinition, i as RpcArgsSchema, v as RpcFunctionDefinitionAny, w as RpcFunctionsCollector } from "./types-CrzNxXKq.mjs";
2
+ import { a as getDefinitionsWithDumps$1, c as StaticRpcDumpManifest$1, d as StaticRpcDumpManifestValue$1, f as StaticRpcDumpSerialization$1, i as dumpFunctions$1, l as StaticRpcDumpManifestQueryEntry$1, n as serializeDumpError$1, o as StaticRpcDumpCollection$1, p as collectStaticRpcDump$1, r as createClientFromDump$1, s as StaticRpcDumpFile$1, t as reviveDumpError$1, u as StaticRpcDumpManifestStaticEntry$1 } from "./index-YDSJgsyG.mjs";
4
3
  //#region src/rpc/cache.d.ts
5
4
  interface RpcCacheOptions {
6
5
  functions: string[];
@@ -1,8 +1,8 @@
1
- import { _ as DevframeNodeRpcSession, g as DevframeNodeContext, z as SharedState } from "./devframe-Dma0XG3U.mjs";
2
- import { v as RpcFunctionDefinitionAny } from "./types-oEqKqUC9.mjs";
3
- import { n as InternalAnonymousAuthStorage } from "./context-BsiCAEC4.mjs";
1
+ import { _ as DevframeNodeRpcSession, g as DevframeNodeContext, z as SharedState } from "./devframe-CnTVuGw9.mjs";
2
+ import { v as RpcFunctionDefinitionAny } from "./types-CrzNxXKq.mjs";
3
+ import "./index-DgsLFhZg.mjs";
4
+ import { n as InternalAnonymousAuthStorage } from "./context-B1sekkgB.mjs";
4
5
  import { Peer } from "crossws";
5
-
6
6
  //#region src/node/auth/handler.d.ts
7
7
  /**
8
8
  * A ready-made pre-auth RPC handler, as produced by
@@ -1,5 +1,4 @@
1
- import { h as RpcDumpStore, l as RpcDumpClientOptions, m as RpcDumpRecordError, n as BirpcReturn, o as RpcDefinitionsToFunctions, u as RpcDumpCollectionOptions, v as RpcFunctionDefinitionAny } from "./types-oEqKqUC9.mjs";
2
-
1
+ import { h as RpcDumpStore, l as RpcDumpClientOptions, m as RpcDumpRecordError, n as BirpcReturn, o as RpcDefinitionsToFunctions, u as RpcDumpCollectionOptions, v as RpcFunctionDefinitionAny } from "./types-CrzNxXKq.mjs";
3
2
  //#region src/rpc/dump/static.d.ts
4
3
  type StaticRpcDumpSerialization = 'json' | 'structured-clone';
5
4
  interface StaticRpcDumpManifestStaticEntry {
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { $ as ScopedBroadcastOptions, C as RpcStreamingChannelOptions, Ct as EventUnsubscribe, G as PartialWithoutId, J as DevframeScopedNodeRpc, K as Thenable, Q as DevframeSettingsStore, S as RpcStreamingChannel, St as EventEmitter, W as EntriesToObject, X as DevframeSettings, Y as DevframeScopedStreamingHost, Z as DevframeSettingsRegistry, _ as DevframeNodeRpcSession, _t as AgentResourceInput, a as DevframeDockDefaults, at as DevframeRpcClientFunctions, b as RpcSharedStateGetOptions, bt as DevframeAgentHost, c as DevframeSetupInfo, ct as DevframeHost, d as McpRouteOptions, dt as DevframeDiagnosticsHost, et as ScopedClientFunctions, f as defineDevframe, ft as DevframeDiagnosticsLogger, g as DevframeNodeContext, gt as AgentResourceContent, h as DevframeCapabilities, ht as AgentResource, i as DevframeDeploymentKind, it as DevframeViewHost, l as DevframeSpaOptions, lt as DevframeDefineDiagnosticsOptions, m as ConnectionMetaWebsocket, mt as AgentManifest, n as DevframeCliOptions, nt as ScopedSharedStates, o as DevframeDuplicationStrategy, ot as DevframeRpcServerFunctions, p as ConnectionMeta, pt as AgentHandle, q as DevframeScopedNodeContext, r as DevframeDefinition, rt as SettingsForNamespace, s as DevframeRuntime, st as DevframeRpcSharedStates, t as DevframeBrowserContext, tt as ScopedServerFunctions, u as DevframeWsOptions, ut as DevframeDiagnosticsDefinition, v as RpcBroadcastOptions, vt as AgentTool, w as RpcStreamingHost, wt as EventsMap, x as RpcSharedStateHost, xt as DevframeAgentHostEvents, y as RpcFunctionsHost, yt as AgentToolInput } from "./devframe-Dma0XG3U.mjs";
2
- import { C as RpcFunctionType, T as RpcReturnSchema, _ as RpcFunctionDefinition, g as RpcFunctionAgentOptions, i as RpcArgsSchema } from "./types-oEqKqUC9.mjs";
3
- import { t as DevframeNodeRpcSessionMeta } from "./ws-server-BUgJpdX4.mjs";
4
-
1
+ import { $ as ScopedBroadcastOptions, C as RpcStreamingChannelOptions, Ct as EventUnsubscribe, G as PartialWithoutId, J as DevframeScopedNodeRpc, K as Thenable, Q as DevframeSettingsStore, S as RpcStreamingChannel, St as EventEmitter, W as EntriesToObject, X as DevframeSettings, Y as DevframeScopedStreamingHost, Z as DevframeSettingsRegistry, _ as DevframeNodeRpcSession, _t as AgentResourceInput, a as DevframeDockDefaults, at as DevframeRpcClientFunctions, b as RpcSharedStateGetOptions, bt as DevframeAgentHost, c as DevframeSetupInfo, ct as DevframeHost, d as McpRouteOptions, dt as DevframeDiagnosticsHost, et as ScopedClientFunctions, f as defineDevframe, ft as DevframeDiagnosticsLogger, g as DevframeNodeContext, gt as AgentResourceContent, h as DevframeCapabilities, ht as AgentResource, i as DevframeDeploymentKind, it as DevframeViewHost, l as DevframeSpaOptions, lt as DevframeDefineDiagnosticsOptions, m as ConnectionMetaWebsocket, mt as AgentManifest, n as DevframeCliOptions, nt as ScopedSharedStates, o as DevframeDuplicationStrategy, ot as DevframeRpcServerFunctions, p as ConnectionMeta, pt as AgentHandle, q as DevframeScopedNodeContext, r as DevframeDefinition, rt as SettingsForNamespace, s as DevframeRuntime, st as DevframeRpcSharedStates, t as DevframeBrowserContext, tt as ScopedServerFunctions, u as DevframeWsOptions, ut as DevframeDiagnosticsDefinition, v as RpcBroadcastOptions, vt as AgentTool, w as RpcStreamingHost, wt as EventsMap, x as RpcSharedStateHost, xt as DevframeAgentHostEvents, y as RpcFunctionsHost, yt as AgentToolInput } from "./devframe-CnTVuGw9.mjs";
2
+ import { C as RpcFunctionType, T as RpcReturnSchema, _ as RpcFunctionDefinition, g as RpcFunctionAgentOptions, i as RpcArgsSchema } from "./types-CrzNxXKq.mjs";
3
+ import "./index-DgsLFhZg.mjs";
4
+ import { t as DevframeNodeRpcSessionMeta } from "./ws-server-CceOy6He.mjs";
5
5
  //#region src/define.d.ts
6
6
  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
7
  //#endregion
@@ -25,7 +25,9 @@ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
25
25
  //#endregion
26
26
  //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
27
27
  var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
28
- let p = process || {}, argv = p.argv || [], env = p.env || {};
28
+ let p = process || {};
29
+ let argv = p.argv || [];
30
+ let env = p.env || {};
29
31
  let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
30
32
  let formatter = (open, close, replace = open) => (input) => {
31
33
  let string = "" + input, index = string.indexOf(close, open.length);
@@ -91,7 +93,7 @@ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
91
93
  module.exports.createColors = createColors;
92
94
  }));
93
95
  //#endregion
94
- //#region ../../node_modules/.pnpm/shell-quote@1.9.0/node_modules/shell-quote/quote.js
96
+ //#region ../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/quote.js
95
97
  var require_quote = /* @__PURE__ */ __commonJSMin(((exports, module) => {
96
98
  /** @import { ControlOperator } from './parse' */
97
99
  /** @type {ControlOperator['op'][]} */
@@ -115,7 +117,7 @@ var require_quote = /* @__PURE__ */ __commonJSMin(((exports, module) => {
115
117
  ];
116
118
  var LINE_TERMINATORS = /[\n\r\u2028\u2029]/;
117
119
  var GLOB_SHELL_SPECIAL = /[\s#!"$&'():;<=>@\\^`|]/g;
118
- /** @type {import('./quote')} */
120
+ /** @type {typeof import('./quote')} */
119
121
  module.exports = function quote(xs) {
120
122
  return xs.map(function(s) {
121
123
  if (s === "") return "''";
@@ -142,7 +144,7 @@ var require_quote = /* @__PURE__ */ __commonJSMin(((exports, module) => {
142
144
  };
143
145
  }));
144
146
  //#endregion
145
- //#region ../../node_modules/.pnpm/shell-quote@1.9.0/node_modules/shell-quote/parse.js
147
+ //#region ../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/parse.js
146
148
  var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
147
149
  /**
148
150
  * @import {
@@ -165,8 +167,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
165
167
  ].join("|") + ")";
166
168
  var controlRE = new RegExp("^" + CONTROL + "$");
167
169
  var META = "|&;()<> \\t";
168
- var SINGLE_QUOTE = "\"((\\\\\"|[^\"])*?)\"";
169
- var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'";
170
+ var SINGLE_QUOTE = "'([^']*?)'";
171
+ var DOUBLE_QUOTE = "\"((\\\\\"|[^\"])*?)\"";
170
172
  var hash = /^#$/;
171
173
  var SQ = "'";
172
174
  var DQ = "\"";
@@ -205,14 +207,15 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
205
207
  /**
206
208
  * @param {string} string
207
209
  * @param {Env} [env]
208
- * @param {{ escape?: string }} [opts]
210
+ * @param {{ escape?: string, splitUnquoted?: boolean | string }} [opts]
209
211
  * @returns {ParseEntry[]}
210
212
  */
211
213
  function parseInternal(string, env, opts) {
212
214
  if (!opts) opts = {};
213
215
  var BS = opts.escape || "\\";
216
+ var ifs = opts.splitUnquoted === true ? " \n" : typeof opts.splitUnquoted === "string" ? opts.splitUnquoted : "";
214
217
  var BAREWORD = "(\\" + BS + "['\"" + META + "]|[^\\s'\"" + META + "])+";
215
- var matches = matchAll(string, new RegExp(["(" + CONTROL + ")", "(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+"].join("|"), "g"));
218
+ var matches = matchAll(string, new RegExp(["(" + CONTROL + ")", "(" + BAREWORD + "|" + DOUBLE_QUOTE + "|" + SINGLE_QUOTE + ")+"].join("|"), "g"));
216
219
  if (matches.length === 0) return [];
217
220
  if (!env) env = {};
218
221
  var commented = false;
@@ -224,6 +227,11 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
224
227
  var quote = false;
225
228
  var esc = false;
226
229
  var out = "";
230
+ /** @type {string[]} */
231
+ var words = [];
232
+ var sawQuote = false;
233
+ /** @type {number | null} */
234
+ var pendingNw = null;
227
235
  var isGlob = false;
228
236
  /** @type {number} */
229
237
  var i;
@@ -237,8 +245,15 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
237
245
  if (char === "{") {
238
246
  i += 1;
239
247
  if (s.charAt(i) === "}") throw new Error("Bad substitution: " + s.slice(i - 2, i + 1));
240
- varend = s.indexOf("}", i);
241
- if (varend < 0) throw new Error("Bad substitution: " + s.slice(i));
248
+ var depth = 1;
249
+ varend = i;
250
+ while (depth > 0 && varend < s.length) {
251
+ if (s.charAt(varend) === "{" && s.charAt(varend - 1) === "$") depth += 1;
252
+ else if (s.charAt(varend) === "}") depth -= 1;
253
+ varend += 1;
254
+ }
255
+ if (depth !== 0) throw new Error("Bad substitution: " + s.slice(i));
256
+ varend -= 1;
242
257
  varname = s.slice(i, varend);
243
258
  i = varend;
244
259
  } else if (/[*@#?$!_-]/.test(char)) {
@@ -257,8 +272,23 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
257
272
  }
258
273
  return getVar(env, "", varname);
259
274
  }
275
+ function flushRun() {
276
+ if (pendingNw === null) return;
277
+ if (pendingNw === 0) {
278
+ if (out !== "") {
279
+ words[words.length] = out;
280
+ out = "";
281
+ }
282
+ } else {
283
+ words[words.length] = out;
284
+ out = "";
285
+ for (var fe = 1; fe < pendingNw; fe += 1) words[words.length] = "";
286
+ }
287
+ pendingNw = null;
288
+ }
260
289
  for (i = 0; i < s.length; i++) {
261
290
  var c = s.charAt(i);
291
+ if (ifs && c !== DS) flushRun();
262
292
  isGlob = isGlob || !quote && (c === "*" || c === "?");
263
293
  if (esc) {
264
294
  out += c;
@@ -272,21 +302,42 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
272
302
  else out += BS + c;
273
303
  } else if (c === DS) out += parseEnvVar();
274
304
  else out += c;
275
- else if (c === DQ || c === SQ) quote = c;
276
- else if (controlRE.test(c)) return { op: s };
305
+ else if (c === DQ || c === SQ) {
306
+ quote = c;
307
+ sawQuote = true;
308
+ } else if (controlRE.test(c)) return { op: s };
277
309
  else if (hash.test(c)) {
278
310
  commented = true;
279
311
  var commentObj = { comment: string.slice(match.index + i + 1) };
280
312
  if (out.length) return [out, commentObj];
281
313
  return [commentObj];
282
314
  } else if (c === BS) esc = true;
283
- else if (c === DS) out += parseEnvVar();
284
- else out += c;
315
+ else if (c === DS) {
316
+ var value = parseEnvVar();
317
+ if (!ifs) out += value;
318
+ else for (var vi = 0; vi < value.length; vi += 1) {
319
+ var vc = value.charAt(vi);
320
+ if (ifs.indexOf(vc) < 0) {
321
+ flushRun();
322
+ out += vc;
323
+ } else if (pendingNw === null) pendingNw = vc === " " || vc === " " || vc === "\n" ? 0 : 1;
324
+ else if (vc !== " " && vc !== " " && vc !== "\n") pendingNw += 1;
325
+ }
326
+ } else out += c;
285
327
  }
286
328
  if (isGlob) return {
287
329
  op: "glob",
288
330
  pattern: out
289
331
  };
332
+ if (ifs) {
333
+ if (pendingNw !== null && pendingNw > 0) {
334
+ words[words.length] = out;
335
+ out = "";
336
+ for (var te = 1; te < pendingNw; te += 1) words[words.length] = "";
337
+ }
338
+ if (out !== "" || sawQuote && words.length === 0) words[words.length] = out;
339
+ return words;
340
+ }
290
341
  return out;
291
342
  }).reduce(function(prev, arg) {
292
343
  if (typeof arg === "undefined") return prev;
@@ -296,7 +347,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
296
347
  return prev;
297
348
  }, []);
298
349
  }
299
- /** @type {import('./parse')} */
350
+ /** @type {typeof import('./parse')} */
300
351
  module.exports = function parse(s, env, opts) {
301
352
  var mapped = parseInternal(s, env, opts);
302
353
  if (typeof env !== "function") return mapped;
@@ -318,7 +369,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
318
369
  };
319
370
  }));
320
371
  //#endregion
321
- //#region ../../node_modules/.pnpm/shell-quote@1.9.0/node_modules/shell-quote/index.js
372
+ //#region ../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/index.js
322
373
  var require_shell_quote = /* @__PURE__ */ __commonJSMin(((exports) => {
323
374
  exports.quote = require_quote();
324
375
  exports.parse = require_parse();
@@ -1,2 +1,2 @@
1
- import { a as verifyAuthToken, c as DevframeAuthHandler, i as refreshTempAuthCode, n as exchangeTempAuthCode, o as revokeActiveConnectionsForToken, r as getTempAuthCode, s as revokeAuthToken, t as buildOtpAuthUrl } from "../index-d40ZLcYw.mjs";
1
+ import { a as verifyAuthToken, c as DevframeAuthHandler, i as refreshTempAuthCode, n as exchangeTempAuthCode, o as revokeActiveConnectionsForToken, r as getTempAuthCode, s as revokeAuthToken, t as buildOtpAuthUrl } from "../index-Dpsr-8dD.mjs";
2
2
  export { DevframeAuthHandler, buildOtpAuthUrl, exchangeTempAuthCode, getTempAuthCode, refreshTempAuthCode, revokeActiveConnectionsForToken, revokeAuthToken, verifyAuthToken };
@@ -1,6 +1,5 @@
1
- import { i as DevframeDeploymentKind, r as DevframeDefinition } from "../devframe-Dma0XG3U.mjs";
2
- import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-BsiCAEC4.mjs";
3
-
1
+ import { i as DevframeDeploymentKind, r as DevframeDefinition } from "../devframe-CnTVuGw9.mjs";
2
+ import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-B1sekkgB.mjs";
4
3
  //#region src/adapters/_shared.d.ts
5
4
  /**
6
5
  * Resolve the mount base path for a devframe's SPA. Hosted adapters