devframe 0.9.8 → 0.9.9

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 (116) hide show
  1. package/dist/{_shared-BM3PdYli.mjs → _shared-C08SdQRl.mjs} +15 -4
  2. package/dist/{_shared-mtXpcJIv.d.mts → _shared-CK3czkH4.d.mts} +25 -2
  3. package/dist/adapters/build.d.mts +6 -6
  4. package/dist/adapters/build.mjs +32 -22
  5. package/dist/adapters/cac.d.mts +16 -1
  6. package/dist/adapters/cac.mjs +8 -7
  7. package/dist/adapters/dev.d.mts +13 -13
  8. package/dist/adapters/dev.mjs +2 -2
  9. package/dist/adapters/embedded.d.mts +1 -1
  10. package/dist/adapters/initiate.d.mts +28 -26
  11. package/dist/adapters/initiate.mjs +1 -1
  12. package/dist/adapters/mcp.d.mts +28 -14
  13. package/dist/adapters/mcp.mjs +75 -39
  14. package/dist/{agent-tool-name-EgfoFO8C.mjs → agent-tool-name-DGzeuWcO.mjs} +2 -2
  15. package/dist/cli/main.d.mts +1 -1
  16. package/dist/cli/main.mjs +41 -17
  17. package/dist/client/index.d.mts +36 -36
  18. package/dist/client/index.mjs +83 -51
  19. package/dist/{client-assets-C7SXgTWY.mjs → client-assets-DNdhagGm.mjs} +2 -2
  20. package/dist/constants.d.mts +8 -7
  21. package/dist/constants.mjs +7 -6
  22. package/dist/{context-CLF4-8Pp.d.mts → context-4AIVRLYF.d.mts} +158 -122
  23. package/dist/{context-omlma_1n.mjs → context-CwPUinjn.mjs} +126 -88
  24. package/dist/{context-KUqAfawQ.mjs → context-DIUvJW4D.mjs} +3 -3
  25. package/dist/{context-DftYyXaR.d.mts → context-rgBSPFHS.d.mts} +5 -5
  26. package/dist/{crypto-token-XCqTSMg9.mjs → crypto-token-TVbGGFuj.mjs} +1 -1
  27. package/dist/{dev-CzkPCJwi.mjs → dev-Eqq5PX0k.mjs} +37 -18
  28. package/dist/{diagnostics-BXWW3VK-.mjs → diagnostics-BMfN8mb1.mjs} +30 -17
  29. package/dist/{diagnostics-CD8nlgll.mjs → diagnostics-D0EVm5M6.mjs} +2 -2
  30. package/dist/{events-4daw0uK9.mjs → events-BV4Dj59a.mjs} +2 -2
  31. package/dist/{host-h3-fRbF9yor.mjs → host-h3-BJ4siyz7.mjs} +1 -1
  32. package/dist/in-page-channel/index.d.mts +14 -14
  33. package/dist/in-page-channel/index.mjs +63 -54
  34. package/dist/{index-BzyopqxV.d.mts → index-pIVt92jP.d.mts} +9 -9
  35. package/dist/{index-D3k0BIhe.d.mts → index-pKl67H6w.d.mts} +4 -4
  36. package/dist/index.d.mts +8 -8
  37. package/dist/index.mjs +2 -2
  38. package/dist/{instance-registry-BjlMQbFB.mjs → instance-registry-C7-41RSp.mjs} +8 -8
  39. package/dist/{instance-shell-Tcp5hGoq.d.mts → instance-shell-7Z52PE4_.d.mts} +18 -18
  40. package/dist/{instance-shell-CpVW4zG0.mjs → instance-shell-cdVETpfz.mjs} +227 -58
  41. package/dist/internal/index.d.mts +40 -23
  42. package/dist/internal/index.mjs +10 -10
  43. package/dist/node/auth.d.mts +2 -2
  44. package/dist/node/auth.mjs +2 -2
  45. package/dist/node/hub-internals.d.mts +2 -2
  46. package/dist/node/hub-internals.mjs +2 -2
  47. package/dist/node/index.d.mts +5 -5
  48. package/dist/node/index.mjs +2 -2
  49. package/dist/{nostics-SPGDgHEP.d.mts → nostics-0sKe5HIj.d.mts} +2 -2
  50. package/dist/{nostics-CzECRXpE.mjs → nostics-D0PvLZsn.mjs} +1 -1
  51. package/dist/origin-DGDH8BI9.d.mts +45 -0
  52. package/dist/origin-DZit9g29.mjs +80 -0
  53. package/dist/recipes/common-rpc-functions.d.mts +5 -5
  54. package/dist/recipes/common-rpc-functions.mjs +3 -3
  55. package/dist/recipes/interactive-auth.d.mts +6 -6
  56. package/dist/recipes/interactive-auth.mjs +6 -6
  57. package/dist/{remote-assets-DezQmPQU.mjs → remote-assets-BIFWOlBW.mjs} +26 -6
  58. package/dist/{remote-assets-B13_vRkJ.d.mts → remote-assets-eBvSKZMS.d.mts} +7 -7
  59. package/dist/{revoke-COLW0cOi.mjs → revoke-cqztiCX4.mjs} +1 -1
  60. package/dist/rpc/dump.d.mts +2 -11
  61. package/dist/rpc/dump.mjs +1 -1
  62. package/dist/rpc/index.d.mts +2 -2
  63. package/dist/rpc/index.mjs +3 -3
  64. package/dist/rpc/transports/sse-client.d.mts +1 -1
  65. package/dist/rpc/transports/sse-client.mjs +30 -14
  66. package/dist/rpc/transports/sse-server.d.mts +4 -4
  67. package/dist/rpc/transports/sse-server.mjs +7 -7
  68. package/dist/rpc/transports/ws-bun.d.mts +5 -5
  69. package/dist/rpc/transports/ws-bun.mjs +8 -2
  70. package/dist/rpc/transports/ws-client.d.mts +1 -1
  71. package/dist/rpc/transports/ws-client.mjs +2 -2
  72. package/dist/rpc/transports/ws-deno.d.mts +4 -4
  73. package/dist/rpc/transports/ws-deno.mjs +8 -2
  74. package/dist/rpc/transports/ws-server.d.mts +2 -1
  75. package/dist/rpc/transports/ws-server.mjs +232 -1
  76. package/dist/{rpc-core-B3W3z9ff.d.mts → rpc-core-Ceu6AUz8.d.mts} +4 -4
  77. package/dist/{rpc-core-DlHd276T.mjs → rpc-core-DVQ7xi89.mjs} +14 -2
  78. package/dist/{serialization-BGzEwAdr.mjs → serialization-DTZnPQ1-.mjs} +20 -18
  79. package/dist/{services-install-CqqQVls5.mjs → services-install-P_DV7VYL.mjs} +32 -21
  80. package/dist/session-DPfj6zQG.mjs +16 -0
  81. package/dist/{shared-state--sduc6Xi.mjs → shared-state-CaxB1q0h.mjs} +2 -2
  82. package/dist/{simple-schema-DQPZrAaZ.mjs → simple-schema-Bi40l-P6.mjs} +2 -2
  83. package/dist/{sse-client-DwX021ST.d.mts → sse-client-BQ4jS3eO.d.mts} +4 -4
  84. package/dist/{state-CK9LjrnT.mjs → state-CeQQWzM-.mjs} +4 -4
  85. package/dist/{static-DV_qUSRS.mjs → static-DZ8P2Kn7.mjs} +130 -135
  86. package/dist/{storage-BXNVhKyR.mjs → storage-Dccf_IyD.mjs} +1 -1
  87. package/dist/types/index.d.mts +6 -6
  88. package/dist/{types-CMdPYhOx.d.mts → types-Dq4i156u.d.mts} +17 -17
  89. package/dist/utils/agent-tool-name.d.mts +2 -2
  90. package/dist/utils/agent-tool-name.mjs +2 -2
  91. package/dist/utils/colors.d.mts +1 -1
  92. package/dist/utils/crypto-token.d.mts +1 -1
  93. package/dist/utils/crypto-token.mjs +1 -1
  94. package/dist/utils/events.d.mts +1 -1
  95. package/dist/utils/nostics.d.mts +1 -1
  96. package/dist/utils/nostics.mjs +1 -1
  97. package/dist/utils/open.mjs +1 -1
  98. package/dist/utils/origin.d.mts +2 -0
  99. package/dist/utils/origin.mjs +80 -0
  100. package/dist/utils/remote-assets.d.mts +2 -2
  101. package/dist/utils/remote-assets.mjs +1 -1
  102. package/dist/utils/serve-static.d.mts +4 -4
  103. package/dist/utils/serve-static.mjs +56 -19
  104. package/dist/utils/shared-state.d.mts +1 -1
  105. package/dist/utils/shared-state.mjs +1 -1
  106. package/dist/utils/simple-schema.d.mts +5 -5
  107. package/dist/utils/simple-schema.mjs +2 -2
  108. package/dist/utils/streaming-channel.d.mts +1 -1
  109. package/dist/utils/streaming-channel.mjs +2 -2
  110. package/dist/utils/when.d.mts +5 -5
  111. package/dist/{validation-YrZH6atx.mjs → validation-BOy8IoFZ.mjs} +2 -2
  112. package/dist/{wire-codec-0K-o5MYW.mjs → wire-codec-dcCeXcSo.mjs} +3 -3
  113. package/dist/{ws-client-7_lZi-B9.d.mts → ws-client-Xpxt0oPA.d.mts} +3 -3
  114. package/dist/{ws-server-VyHlanzy.d.mts → ws-server-D2nv68Hg.d.mts} +13 -37
  115. package/package.json +2 -1
  116. package/dist/ws-server-Y_AumUQH.mjs +0 -294
@@ -1,6 +1,6 @@
1
- import { g as RpcFunctionAgentOptions } from "../types-CMdPYhOx.mjs";
2
- import { d as DevframeRpcConnection, f as DevframeRpcConnectionRequest, p as DevframeRpcTransportKind, u as DevframeNodeRpcSessionMeta } from "../ws-server-VyHlanzy.mjs";
3
- import { $ as DevframeServicesHost, At as AgentResource, B as DevframeSetupInfo, Bt as EventUnsubscribe, F as DevframeDefinition, Ft as AgentToolProvider, G as McpRouteOptions, H as DevframeSnapshotRpcInputs, I as DevframeDeploymentKind, It as AgentToolProviderHandle, J as DevframeServiceId, K as DevframeServiceDefinition, L as DevframeDockDefaults, Lt as DevframeAgentHost, Mt as AgentResourceInput, Nt as AgentTool, Ot as AgentHandle, P as DevframeCliOptions, Pt as AgentToolInput, Q as DevframeServiceScopeOf, R as DevframeDuplicationStrategy, Rt as DevframeAgentHostEvents, St as DevframeDiagnosticsLogger, U as DevframeSseOptions, V as DevframeSnapshotRpcEntry, Vt as EventsMap, W as DevframeWsOptions, X as DevframeServiceMeta, Y as DevframeServiceInput, Z as DevframeServiceOf, _t as DevframeRpcServerFunctions, a as DevframeConnectionConfigsRegistry, at as DevframeScopedStreamingHost, bt as DevframeStorageScope, c as RpcBroadcastOptions, ct as DevframeSettingsStore, d as RpcSharedStateHost, dt as ScopedRpcFn, et as DevframeServicesRegistry, f as RpcStreamingChannel, ft as ScopedServerFunctions, gt as DevframeRpcClientFunctions, ht as DevframeViewHost, i as DevframeCapabilities, it as DevframeScopedNodeRpc, jt as AgentResourceContent, kt as AgentManifest, l as RpcFunctionsHost, lt as ScopedBroadcastOptions, m as RpcStreamingHost, mt as SettingsForNamespace, n as ConnectionMetaSse, nt as DevframeServicesState, o as DevframeNodeContext, ot as DevframeSettings, p as RpcStreamingChannelOptions, pt as ScopedSharedStates, q as DevframeServiceDescriptor, r as ConnectionMetaWebsocket, rt as DevframeScopedNodeContext, s as DevframeNodeRpcSession, st as DevframeSettingsRegistry, t as ConnectionMeta, tt as DevframeServicesScopeRegistry, u as RpcSharedStateGetOptions, ut as ScopedClientFunctions, vt as DevframeRpcSharedStates, xt as DevframeDiagnosticsHost, yt as DevframeHost, z as DevframeRpcOptions, zt as EventEmitter } from "../context-CLF4-8Pp.mjs";
4
- import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "../remote-assets-B13_vRkJ.mjs";
5
- import { i as DevframeDefineDiagnosticsOptions } from "../nostics-SPGDgHEP.mjs";
6
- export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, AgentToolProvider, AgentToolProviderHandle, ConnectionMeta, ConnectionMetaSse, ConnectionMetaWebsocket, DevframeAgentHost, DevframeAgentHostEvents, DevframeCapabilities, DevframeCliOptions, DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockDefaults, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, DevframeRpcOptions, DevframeRpcServerFunctions, DevframeRpcSharedStates, type DevframeRpcTransportKind, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeServiceDefinition, DevframeServiceDescriptor, DevframeServiceId, DevframeServiceInput, DevframeServiceMeta, DevframeServiceOf, DevframeServiceScopeOf, DevframeServicesHost, DevframeServicesRegistry, DevframeServicesScopeRegistry, DevframeServicesState, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, DevframeSnapshotRpcEntry, DevframeSnapshotRpcInputs, DevframeSseOptions, DevframeStorageScope, DevframeViewHost, DevframeWsOptions, EventEmitter, EventUnsubscribe, EventsMap, McpRouteOptions, RemoteAssets, RemoteAssetsErrorMessage, RemoteAssetsProvider, RemoteAssetsProviderCustom, RemoteAssetsStore, RpcBroadcastOptions, type RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedRpcFn, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, StaticAssetsSource };
1
+ import { g as RpcFunctionAgentOptions } from "../types-Dq4i156u.mjs";
2
+ import { c as DevframeNodeRpcSessionMeta, d as DevframeRpcTransportKind, l as DevframeRpcConnection, u as DevframeRpcConnectionRequest } from "../ws-server-D2nv68Hg.mjs";
3
+ import { $ as DevframeServiceScopeOf, At as AgentManifest, B as DevframeSetupInfo, Bt as EventEmitter, Ct as DevframeDiagnosticsLogger, F as DevframeDefinition, Ft as AgentToolInput, G as McpAuthorization, H as DevframeSnapshotRpcInputs, Ht as EventsMap, I as DevframeDeploymentKind, It as AgentToolProvider, J as DevframeServiceDescriptor, K as McpRouteOptions, L as DevframeDockDefaults, Lt as AgentToolProviderHandle, Mt as AgentResourceContent, Nt as AgentResourceInput, P as DevframeCliOptions, Pt as AgentTool, Q as DevframeServiceOf, R as DevframeDuplicationStrategy, Rt as DevframeAgentHost, St as DevframeDiagnosticsHost, U as DevframeSseOptions, V as DevframeSnapshotRpcEntry, Vt as EventUnsubscribe, W as DevframeWsOptions, X as DevframeServiceInput, Y as DevframeServiceId, Z as DevframeServiceMeta, _t as DevframeRpcClientFunctions, a as DevframeConnectionConfigsRegistry, at as DevframeScopedNodeRpc, bt as DevframeHost, c as RpcBroadcastOptions, ct as DevframeSettingsRegistry, d as RpcSharedStateHost, dt as ScopedClientFunctions, et as DevframeServicesHost, f as RpcStreamingChannel, ft as ScopedRpcFn, gt as DevframeViewHost, ht as SettingsForNamespace, i as DevframeCapabilities, it as DevframeScopedNodeContext, jt as AgentResource, kt as AgentHandle, l as RpcFunctionsHost, lt as DevframeSettingsStore, m as RpcStreamingHost, mt as ScopedSharedStates, n as ConnectionMetaSse, nt as DevframeServicesScopeRegistry, o as DevframeNodeContext, ot as DevframeScopedStreamingHost, p as RpcStreamingChannelOptions, pt as ScopedServerFunctions, q as DevframeServiceDefinition, r as ConnectionMetaWebsocket, rt as DevframeServicesState, s as DevframeNodeRpcSession, st as DevframeSettings, t as ConnectionMeta, tt as DevframeServicesRegistry, u as RpcSharedStateGetOptions, ut as ScopedBroadcastOptions, vt as DevframeRpcServerFunctions, xt as DevframeStorageScope, yt as DevframeRpcSharedStates, z as DevframeRpcOptions, zt as DevframeAgentHostEvents } from "../context-4AIVRLYF.mjs";
4
+ import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "../remote-assets-eBvSKZMS.mjs";
5
+ import { i as DevframeDefineDiagnosticsOptions } from "../nostics-0sKe5HIj.mjs";
6
+ export { AgentHandle, AgentManifest, AgentResource, AgentResourceContent, AgentResourceInput, AgentTool, AgentToolInput, AgentToolProvider, AgentToolProviderHandle, ConnectionMeta, ConnectionMetaSse, ConnectionMetaWebsocket, DevframeAgentHost, DevframeAgentHostEvents, DevframeCapabilities, DevframeCliOptions, DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, DevframeDefinition, DevframeDeploymentKind, DevframeDiagnosticsHost, DevframeDiagnosticsLogger, DevframeDockDefaults, DevframeDuplicationStrategy, DevframeHost, DevframeNodeContext, DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, DevframeRpcOptions, DevframeRpcServerFunctions, DevframeRpcSharedStates, type DevframeRpcTransportKind, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeServiceDefinition, DevframeServiceDescriptor, DevframeServiceId, DevframeServiceInput, DevframeServiceMeta, DevframeServiceOf, DevframeServiceScopeOf, DevframeServicesHost, DevframeServicesRegistry, DevframeServicesScopeRegistry, DevframeServicesState, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, DevframeSnapshotRpcEntry, DevframeSnapshotRpcInputs, DevframeSseOptions, DevframeStorageScope, DevframeViewHost, DevframeWsOptions, EventEmitter, EventUnsubscribe, EventsMap, McpAuthorization, McpRouteOptions, RemoteAssets, RemoteAssetsErrorMessage, RemoteAssetsProvider, RemoteAssetsProviderCustom, RemoteAssetsStore, RpcBroadcastOptions, type RpcFunctionAgentOptions, RpcFunctionsHost, RpcSharedStateGetOptions, RpcSharedStateHost, RpcStreamingChannel, RpcStreamingChannelOptions, RpcStreamingHost, ScopedBroadcastOptions, ScopedClientFunctions, ScopedRpcFn, ScopedServerFunctions, ScopedSharedStates, SettingsForNamespace, StaticAssetsSource };
@@ -22,12 +22,12 @@ type RpcFunctionType = 'static' | 'action' | 'event' | 'query';
22
22
  /**
23
23
  * Agent exposure settings for an RPC function. When this field is set,
24
24
  * the function is surfaced to agents (e.g. via the devframe MCP adapter)
25
- * as a callable tool. Functions without an `agent` field are not exposed —
25
+ * as a callable tool. Functions without an `agent` field are not exposed;
26
26
  * default-deny.
27
27
  */
28
28
  interface RpcFunctionAgentOptions {
29
29
  /**
30
- * Human-readable description shown to the agent. Required — agents
30
+ * Human-readable description shown to the agent. Required, since agents
31
31
  * rely on this to decide when to invoke the tool. Keep it to ~1–3
32
32
  * sentences explaining what the tool does and when to use it.
33
33
  */
@@ -40,9 +40,9 @@ interface RpcFunctionAgentOptions {
40
40
  /**
41
41
  * Safety classification. Drives MCP annotations (`readOnlyHint`,
42
42
  * `destructiveHint`) downstream.
43
- * - `'read'` — no side effects; safe to call freely.
44
- * - `'action'` — mutates state but not destructive.
45
- * - `'destructive'` — may perform destructive updates.
43
+ * - `'read'`: no side effects; safe to call freely.
44
+ * - `'action'`: mutates state but not destructive.
45
+ * - `'destructive'`: may perform destructive updates.
46
46
  *
47
47
  * When omitted it is inferred from the function `type`:
48
48
  * - `'static'` / `'query'` → `'read'`
@@ -158,17 +158,17 @@ interface RpcFunctionDefinitionBase {
158
158
  /** Function type (static, action, event, or query) */
159
159
  type?: RpcFunctionType;
160
160
  /**
161
- * Declares whether this function's args/return are JSON-serializable
162
- * — i.e. no `Map`, `Set`, `Date`, `BigInt`, class instances, circular
161
+ * Declares whether this function's args/return are JSON-serializable,
162
+ * i.e. no `Map`, `Set`, `Date`, `BigInt`, class instances, circular
163
163
  * references, `undefined` leaves, `Symbol`, or `Function` values.
164
164
  *
165
- * - `true` — args and return are encoded with strict `JSON.stringify`
165
+ * - `true`: args and return are encoded with strict `JSON.stringify`
166
166
  * on the wire and on disk. Misshapen values throw `DF0019` at the
167
167
  * sender, surfacing the bug *during the offending call* rather than
168
168
  * silently coercing to `{}` later. Required for `agent` exposure.
169
- * - `false` (default) — payloads use `structured-clone-es`, which
169
+ * - `false` (default): payloads use `structured-clone-es`, which
170
170
  * round-trips Maps/Sets/cycles. Functions in this mode cannot be
171
- * exposed via the `agent` field — registration throws `DF0018`.
171
+ * exposed via the `agent` field; registration throws `DF0018`.
172
172
  */
173
173
  jsonSerializable?: boolean;
174
174
  }
@@ -221,9 +221,9 @@ type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = '
221
221
  * Declares whether this function's args/return are JSON-serializable
222
222
  * (no Map/Set/Date/BigInt/cycles/class instances/undefined/Symbol/Function).
223
223
  *
224
- * - `true` — wire and dump use strict `JSON.stringify`; misshapen
224
+ * - `true`: wire and dump use strict `JSON.stringify`; misshapen
225
225
  * values throw `DF0019` at the call site. Required for `agent`.
226
- * - `false` (default) — `structured-clone-es` round-trips fancy
226
+ * - `false` (default): `structured-clone-es` round-trips fancy
227
227
  * types. Cannot be `agent`-exposed (registration throws `DF0018`).
228
228
  */
229
229
  jsonSerializable?: boolean;
@@ -244,7 +244,7 @@ type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = '
244
244
  * handler once with no arguments and stores the result as both a
245
245
  * no-args record and the fallback so any call variant resolves
246
246
  * to the same snapshot. Only valid on `query` (or untyped)
247
- * functions — `static` already has equivalent default behavior.
247
+ * functions; `static` already has equivalent default behavior.
248
248
  */
249
249
  snapshot?: boolean;
250
250
  /** Per-context setup-result cache, populated by `getRpcResolvedSetupResult`. @internal */
@@ -266,9 +266,9 @@ type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = '
266
266
  * Declares whether this function's args/return are JSON-serializable
267
267
  * (no Map/Set/Date/BigInt/cycles/class instances/undefined/Symbol/Function).
268
268
  *
269
- * - `true` — wire and dump use strict `JSON.stringify`; misshapen
269
+ * - `true`: wire and dump use strict `JSON.stringify`; misshapen
270
270
  * values throw `DF0019` at the call site. Required for `agent`.
271
- * - `false` (default) — `structured-clone-es` round-trips fancy
271
+ * - `false` (default): `structured-clone-es` round-trips fancy
272
272
  * types. Cannot be `agent`-exposed (registration throws `DF0018`).
273
273
  */
274
274
  jsonSerializable?: boolean;
@@ -281,7 +281,7 @@ type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = '
281
281
  setup?: (context: CONTEXT) => Thenable<RpcFunctionSetupResult<InferArgsType<AS>, Thenable<InferReturnType<RS>>>>;
282
282
  /**
283
283
  * Function implementation (required if setup doesn't provide one).
284
- * The declared `returns` schema describes the *resolved* value —
284
+ * The declared `returns` schema describes the *resolved* value:
285
285
  * async handlers return a promise of it (the runtime always awaits).
286
286
  */
287
287
  handler?: (...args: InferArgsType<AS>) => Thenable<InferReturnType<RS>>;
@@ -293,7 +293,7 @@ type RpcFunctionDefinition<NAME extends string, TYPE extends RpcFunctionType = '
293
293
  * handler once with no arguments and stores the result as both a
294
294
  * no-args record and the fallback so any call variant resolves
295
295
  * to the same snapshot. Only valid on `query` (or untyped)
296
- * functions — `static` already has equivalent default behavior.
296
+ * functions; `static` already has equivalent default behavior.
297
297
  */
298
298
  snapshot?: boolean;
299
299
  /** Per-context setup-result cache, populated by `getRpcResolvedSetupResult`. @internal */
@@ -2,13 +2,13 @@
2
2
  /**
3
3
  * Derive the wire-safe agent tool name for an internal tool id.
4
4
  *
5
- * Devframe tool ids are colon-namespaced — `devframe:<area>:<fn>` for
5
+ * Devframe tool ids are colon-namespaced: `devframe:<area>:<fn>` for
6
6
  * built-ins, `devframes:plugin:<slug>:<fn>` for plugin RPCs, and hub
7
7
  * command ids for command-derived tools. MCP clients constrain tool names
8
8
  * to `^[a-zA-Z0-9_-]{1,128}$`, so the agent/MCP boundary derives the wire
9
9
  * name automatically: every run of characters outside `[a-zA-Z0-9_-]`
10
10
  * becomes a single `_`, truncated to 128 characters. Internal ids never
11
- * change — resolution back to the id happens at the boundary.
11
+ * change; resolution back to the id happens at the boundary.
12
12
  *
13
13
  * ```
14
14
  * devframe:state:read → devframe_state_read
@@ -7,13 +7,13 @@ const MAX_TOOL_NAME_LENGTH = 128;
7
7
  /**
8
8
  * Derive the wire-safe agent tool name for an internal tool id.
9
9
  *
10
- * Devframe tool ids are colon-namespaced — `devframe:<area>:<fn>` for
10
+ * Devframe tool ids are colon-namespaced: `devframe:<area>:<fn>` for
11
11
  * built-ins, `devframes:plugin:<slug>:<fn>` for plugin RPCs, and hub
12
12
  * command ids for command-derived tools. MCP clients constrain tool names
13
13
  * to `^[a-zA-Z0-9_-]{1,128}$`, so the agent/MCP boundary derives the wire
14
14
  * name automatically: every run of characters outside `[a-zA-Z0-9_-]`
15
15
  * becomes a single `_`, truncated to 128 characters. Internal ids never
16
- * change — resolution back to the id happens at the boundary.
16
+ * change; resolution back to the id happens at the boundary.
17
17
  *
18
18
  * ```
19
19
  * devframe:state:read → devframe_state_read
@@ -1,6 +1,6 @@
1
1
  //#region src/utils/colors.d.ts
2
2
  /**
3
- * A colorizer — callable as a function (`colors.red('foo')`) or as a
3
+ * A colorizer, callable as a function (`colors.red('foo')`) or as a
4
4
  * tagged template (``colors.red`foo ${bar}` ``).
5
5
  */
6
6
  interface ColorFn {
@@ -1,7 +1,7 @@
1
1
  //#region src/utils/crypto-token.d.ts
2
2
  /**
3
3
  * Generate a high-entropy, URL-safe (hex) random token suitable for use as a
4
- * bearer credential — e.g. the persistent client auth token or an ephemeral
4
+ * bearer credential, e.g. the persistent client auth token or an ephemeral
5
5
  * remote-dock token. Defaults to 16 bytes (128 bits) of entropy.
6
6
  */
7
7
  declare function randomToken(byteLength?: number): string;
@@ -2,7 +2,7 @@
2
2
  const HEX = "0123456789abcdef";
3
3
  /**
4
4
  * Generate a high-entropy, URL-safe (hex) random token suitable for use as a
5
- * bearer credential — e.g. the persistent client auth token or an ephemeral
5
+ * bearer credential, e.g. the persistent client auth token or an ephemeral
6
6
  * remote-dock token. Defaults to 16 bytes (128 bits) of entropy.
7
7
  */
8
8
  function randomToken(byteLength = 16) {
@@ -1,4 +1,4 @@
1
- import { Vt as EventsMap, zt as EventEmitter } from "../context-CLF4-8Pp.mjs";
1
+ import { Bt as EventEmitter, Ht as EventsMap } from "../context-4AIVRLYF.mjs";
2
2
  //#region src/utils/events.d.ts
3
3
  /**
4
4
  * Create event emitter.
@@ -1,2 +1,2 @@
1
- import { a as Diagnostic, c as DiagnosticHandle, d as Diagnostics, f as ansiFormatter, g as formatDiagnostic, h as defineProdDiagnostics, i as DevframeDefineDiagnosticsOptions, l as DiagnosticInit, m as defineDiagnostics, n as ConsoleMethod, o as DiagnosticCallParams, p as createConsoleReporter, r as ConsoleReporterOptions, s as DiagnosticDefinition, t as AnyDiagnosticReporter, u as DiagnosticReporter } from "../nostics-SPGDgHEP.mjs";
1
+ import { a as Diagnostic, c as DiagnosticHandle, d as Diagnostics, f as ansiFormatter, g as formatDiagnostic, h as defineProdDiagnostics, i as DevframeDefineDiagnosticsOptions, l as DiagnosticInit, m as defineDiagnostics, n as ConsoleMethod, o as DiagnosticCallParams, p as createConsoleReporter, r as ConsoleReporterOptions, s as DiagnosticDefinition, t as AnyDiagnosticReporter, u as DiagnosticReporter } from "../nostics-0sKe5HIj.mjs";
2
2
  export { type AnyDiagnosticReporter, type ConsoleMethod, type ConsoleReporterOptions, DevframeDefineDiagnosticsOptions, type Diagnostic, type DiagnosticCallParams, type DiagnosticDefinition, type DiagnosticHandle, type DiagnosticInit, type DiagnosticReporter, type Diagnostics, ansiFormatter, createConsoleReporter, defineDiagnostics, defineProdDiagnostics, formatDiagnostic };
@@ -1,2 +1,2 @@
1
- import { a as defineProdDiagnostics, i as defineDiagnostics, n as ansiFormatter, o as formatDiagnostic, r as createConsoleReporter, t as Diagnostic } from "../nostics-CzECRXpE.mjs";
1
+ import { a as defineProdDiagnostics, i as defineDiagnostics, n as ansiFormatter, o as formatDiagnostic, r as createConsoleReporter, t as Diagnostic } from "../nostics-D0PvLZsn.mjs";
2
2
  export { Diagnostic, ansiFormatter, createConsoleReporter, defineDiagnostics, defineProdDiagnostics, formatDiagnostic };
@@ -4,7 +4,7 @@ import { spawn } from "node:child_process";
4
4
  //#region src/utils/open.ts
5
5
  /**
6
6
  * Launches `command` detached from the current process and resolves once
7
- * the OS has accepted the spawn (not once the launched app exits) — the
7
+ * the OS has accepted the spawn (not once the launched app exits), the
8
8
  * same "fire and forget" behavior `open`'s default (`wait: false`) gave us.
9
9
  */
10
10
  function spawnDetached(command, args) {
@@ -0,0 +1,2 @@
1
+ import { n as isLoopbackHostname, r as validateOriginCandidate, t as isAllowedOrigin } from "../origin-DGDH8BI9.mjs";
2
+ export { isAllowedOrigin, isLoopbackHostname, validateOriginCandidate };
@@ -0,0 +1,80 @@
1
+ //#region src/utils/origin.ts
2
+ /**
3
+ * Origin and hostname predicates shared by the RPC transports (the WS upgrade,
4
+ * SSE, and MCP origin gates) and the instance shell's authentication-link
5
+ * origin validation. Kept dependency-free and runtime-agnostic so any consumer
6
+ * can pull in a single check without dragging in a transport's `crossws`
7
+ * import.
8
+ */
9
+ /**
10
+ * Whether `hostname` names a loopback host: `localhost` (or any `*.localhost`
11
+ * subdomain), the IPv6 loopback `::1`, or an IPv4 literal inside the
12
+ * `127.0.0.0/8` loopback block.
13
+ *
14
+ * The IPv4 case is matched **structurally**: the whole hostname must be a
15
+ * canonical dotted-decimal IPv4 literal whose first octet is `127`. A bare
16
+ * `startsWith('127.')` prefix check would also accept an attacker-controlled
17
+ * DNS name that merely *begins* with `127.` (`127.attacker.example`,
18
+ * `127.0.0.1.attacker.example`), letting a cross-origin browser page defeat
19
+ * the loopback origin gate that guards the RPC/MCP surface (a DNS-rebinding /
20
+ * cross-site WebSocket-hijacking bypass). Requiring a real IPv4 literal keeps
21
+ * genuine loopback addresses (`127.0.0.1`, `127.5.5.5`) allowed while rejecting
22
+ * those DNS names.
23
+ */
24
+ function isLoopbackHostname(hostname) {
25
+ const h = hostname.replace(/^\[|\]$/g, "");
26
+ if (h === "localhost" || h.endsWith(".localhost") || h === "::1") return true;
27
+ return isLoopbackIPv4(h);
28
+ }
29
+ /** A canonical dotted-decimal IPv4 literal in `127.0.0.0/8`. */
30
+ function isLoopbackIPv4(hostname) {
31
+ const octets = hostname.split(".");
32
+ if (octets.length !== 4 || !octets.every(isDecimalOctet)) return false;
33
+ return Number(octets[0]) === 127;
34
+ }
35
+ /** A single canonical IPv4 octet: 1–3 digits, no leading zero, value 0–255. */
36
+ function isDecimalOctet(part) {
37
+ if (!/^\d{1,3}$/.test(part) || part.length > 1 && part[0] === "0") return false;
38
+ return Number(part) <= 255;
39
+ }
40
+ /**
41
+ * Default origin policy for a localhost dev tool: allow requests with no
42
+ * `Origin` header (native, non-browser clients), allow any loopback origin
43
+ * (so cross-port localhost dev setups keep working), and allow explicitly
44
+ * configured origins. Everything else, such as a real remote page in the dev's
45
+ * browser, is rejected.
46
+ */
47
+ function isAllowedOrigin(origin, allowedOrigins) {
48
+ if (!origin) return true;
49
+ if (allowedOrigins.includes(origin)) return true;
50
+ try {
51
+ return isLoopbackHostname(new URL(origin).hostname);
52
+ } catch {
53
+ return false;
54
+ }
55
+ }
56
+ /**
57
+ * Decide whether a request-derived origin candidate may back a devframe's
58
+ * advertised public origin, the destination of the OTP magic link. Stricter
59
+ * than {@link isAllowedOrigin}: it rejects credentials, a path, a query, a
60
+ * fragment, a malformed port, and non-HTTP(S) schemes, and adopts a candidate
61
+ * only when its hostname is loopback or its canonical origin exactly matches
62
+ * an `allowedOrigins` entry (a caller with no static list passes none, so only
63
+ * loopback qualifies). Returns the canonical origin to adopt, or `undefined`
64
+ * to reject. Forwarded headers are never consulted.
65
+ */
66
+ function validateOriginCandidate(candidate, allowedOrigins) {
67
+ let url;
68
+ try {
69
+ url = new URL(candidate);
70
+ } catch {
71
+ return;
72
+ }
73
+ if (url.protocol !== "http:" && url.protocol !== "https:") return void 0;
74
+ if (url.username || url.password || url.search || url.hash || url.pathname !== "/" && url.pathname !== "") return void 0;
75
+ const canonical = url.origin;
76
+ if (canonical === "null") return void 0;
77
+ if (isLoopbackHostname(url.hostname) || allowedOrigins?.includes(canonical)) return canonical;
78
+ }
79
+ //#endregion
80
+ export { isAllowedOrigin, isLoopbackHostname, validateOriginCandidate };
@@ -1,4 +1,4 @@
1
- import { a as RemoteAssetsStore, o as StaticAssetsSource } from "../remote-assets-B13_vRkJ.mjs";
1
+ import { a as RemoteAssetsStore, o as StaticAssetsSource } from "../remote-assets-eBvSKZMS.mjs";
2
2
  //#region src/utils/remote-assets.d.ts
3
3
  /**
4
4
  * Normalize a {@link StaticAssetsSource} into something servable: a local
@@ -7,7 +7,7 @@ import { a as RemoteAssetsStore, o as StaticAssetsSource } from "../remote-asset
7
7
  * {@link RemoteAssetsStore} back-proxy. Remote caches live under
8
8
  * `<projectStorageDir>/.remote-assets/<package>@<version>/`.
9
9
  *
10
- * A remote source's `package`/`version` are validated first (`DF0065`) — both
10
+ * A remote source's `package`/`version` are validated first (`DF0065`); both
11
11
  * are interpolated into CDN URLs and the cache path.
12
12
  *
13
13
  * `defaultResolveFrom` (typically the declaring devframe's `importMetaUrl`)
@@ -1,2 +1,2 @@
1
- import { t as resolveStaticAssetsSource } from "../remote-assets-DezQmPQU.mjs";
1
+ import { t as resolveStaticAssetsSource } from "../remote-assets-BIFWOlBW.mjs";
2
2
  export { resolveStaticAssetsSource };
@@ -1,4 +1,4 @@
1
- import { a as RemoteAssetsStore } from "../remote-assets-B13_vRkJ.mjs";
1
+ import { a as RemoteAssetsStore } from "../remote-assets-eBvSKZMS.mjs";
2
2
  import { IncomingMessage, ServerResponse } from "node:http";
3
3
  import { EventHandler, H3 } from "h3";
4
4
  //#region src/utils/serve-static.d.ts
@@ -14,12 +14,12 @@ interface ServeStaticOptions {
14
14
  single?: boolean;
15
15
  }
16
16
  /**
17
- * h3 event handler that serves files from `source` with SPA fallback — a
17
+ * h3 event handler that serves files from `source` with SPA fallback: a
18
18
  * local directory, or a {@link RemoteAssetsStore} whose files stream through
19
19
  * the CDN back-proxy into the local cache.
20
20
  *
21
21
  * Drop-in replacement for `fromNodeMiddleware(sirv(dir, { dev: true, single: true }))`
22
- * when the surrounding server is an h3 app — no `Cache-Control` beyond
22
+ * when the surrounding server is an h3 app: no `Cache-Control` beyond
23
23
  * `no-store`, `Content-Type` resolved via `mrmime`, and a miss with no
24
24
  * file extension falls back to `<dir>/index.html` so client-side routing
25
25
  * works.
@@ -37,7 +37,7 @@ declare function mountStaticHandler(app: H3, base: string, source: ServableAsset
37
37
  * Connect/Express-style Node middleware variant of {@link serveStaticHandler}.
38
38
  *
39
39
  * Use when mounting onto `viteServer.middlewares.use(base, …)` or any other
40
- * Connect stack — avoids forcing the host package to depend on h3 just to
40
+ * Connect stack; avoids forcing the host package to depend on h3 just to
41
41
  * adapt an event handler back into Node middleware.
42
42
  */
43
43
  declare function serveStaticNodeMiddleware(source: ServableAssets, options?: ServeStaticOptions): (req: IncomingMessage, res: ServerResponse, next?: (err?: Error) => void) => void;
@@ -1,16 +1,30 @@
1
- import { t as DEVFRAME_EVENTS } from "../events-4daw0uK9.mjs";
1
+ import { t as DEVFRAME_EVENTS } from "../events-BV4Dj59a.mjs";
2
2
  import { extname, join, normalize, resolve, sep } from "pathe";
3
3
  import { createReadStream } from "node:fs";
4
- import { stat } from "node:fs/promises";
4
+ import { realpath, stat } from "node:fs/promises";
5
5
  import { Readable } from "node:stream";
6
6
  import { lookup } from "mrmime";
7
7
  import { H3, defineHandler } from "h3";
8
8
  //#region src/utils/serve-static.ts
9
9
  const HTML_EXTENSIONS = [".html", ".htm"];
10
- async function statFile(abs) {
10
+ /**
11
+ * The canonical (symlink-resolved) served root, falling back to the lexical
12
+ * path when the directory doesn't exist yet (an empty deployment then serves
13
+ * nothing rather than throwing).
14
+ */
15
+ async function canonicalRoot(absDir) {
16
+ return realpath(absDir).then(normalize, () => absDir);
17
+ }
18
+ /**
19
+ * Stat a candidate file, confirming its canonical target stays inside the
20
+ * canonical served root; a symlink inside the root can only resolve to a
21
+ * file still within it; one escaping the root reads as a miss, not a leak.
22
+ */
23
+ async function statFile(abs, realRoot) {
11
24
  try {
12
25
  const s = await stat(abs);
13
- if (!s.isFile()) return null;
26
+ const real = normalize(await realpath(abs));
27
+ if (!s.isFile() || real !== realRoot && !real.startsWith(realRoot + sep)) return null;
14
28
  return {
15
29
  abs,
16
30
  size: s.size,
@@ -20,7 +34,7 @@ async function statFile(abs) {
20
34
  return null;
21
35
  }
22
36
  }
23
- async function resolveTarget(absDir, urlPath, indexNames, single) {
37
+ function cleanUrlPath(urlPath) {
24
38
  let cleaned;
25
39
  try {
26
40
  cleaned = decodeURIComponent(urlPath || "/");
@@ -30,23 +44,44 @@ async function resolveTarget(absDir, urlPath, indexNames, single) {
30
44
  cleaned = cleaned.replace(/[?#].*$/, "");
31
45
  if (cleaned.endsWith("/")) cleaned = cleaned.slice(0, -1);
32
46
  if (cleaned.startsWith("/")) cleaned = cleaned.slice(1);
33
- const abs = normalize(join(absDir, cleaned));
34
- if (abs !== absDir && !abs.startsWith(absDir + sep)) return null;
35
- const direct = await statFile(abs);
36
- if (direct) return direct;
47
+ return cleaned;
48
+ }
49
+ async function resolveDirectoryIndex(abs, realRoot, indexNames) {
37
50
  try {
38
51
  if ((await stat(abs)).isDirectory()) for (const name of indexNames) {
39
- const candidate = await statFile(join(abs, name));
52
+ const candidate = await statFile(join(abs, name), realRoot);
40
53
  if (candidate) return candidate;
41
54
  }
42
55
  } catch {}
43
- if (!extname(cleaned)) for (const ext of HTML_EXTENSIONS) {
44
- const candidate = await statFile(abs + ext);
56
+ return null;
57
+ }
58
+ /**
59
+ * Mirror sirv's `extensions: ['html', 'htm']` default: an extension-less
60
+ * request tries `${path}.html` / `${path}.htm` so pretty-URL deployments
61
+ * resolve to the right page before the SPA fallback.
62
+ */
63
+ async function resolveHtmlExtension(abs, cleaned, realRoot) {
64
+ if (extname(cleaned)) return null;
65
+ for (const ext of HTML_EXTENSIONS) {
66
+ const candidate = await statFile(abs + ext, realRoot);
45
67
  if (candidate) return candidate;
46
68
  }
69
+ return null;
70
+ }
71
+ async function resolveTarget(absDir, realRoot, urlPath, indexNames, single) {
72
+ const cleaned = cleanUrlPath(urlPath);
73
+ if (cleaned === null) return null;
74
+ const abs = normalize(join(absDir, cleaned));
75
+ if (abs !== absDir && !abs.startsWith(absDir + sep)) return null;
76
+ const direct = await statFile(abs, realRoot);
77
+ if (direct) return direct;
78
+ const indexed = await resolveDirectoryIndex(abs, realRoot, indexNames);
79
+ if (indexed) return indexed;
80
+ const htmlExt = await resolveHtmlExtension(abs, cleaned, realRoot);
81
+ if (htmlExt) return htmlExt;
47
82
  const fallbackIndex = indexNames[0];
48
83
  if (single && fallbackIndex && !/\.[a-z0-9]+$/i.test(cleaned)) {
49
- const indexFile = await statFile(join(absDir, fallbackIndex));
84
+ const indexFile = await statFile(join(absDir, fallbackIndex), realRoot);
50
85
  if (indexFile) return indexFile;
51
86
  }
52
87
  return null;
@@ -77,7 +112,7 @@ function normalizeOptions(options) {
77
112
  /**
78
113
  * Drive one request through a {@link RemoteAssetsStore}: the store's
79
114
  * `Response` on a hit, a 404 on a miss, or a 502 (styled error page for HTML
80
- * navigations) on provider failure — shared between the h3 and connect flavors.
115
+ * navigations) on provider failure, shared between the h3 and connect flavors.
81
116
  */
82
117
  async function remoteResponse(store, urlPath, accept) {
83
118
  try {
@@ -109,12 +144,12 @@ function serveRemoteAssetsHandler(store) {
109
144
  });
110
145
  }
111
146
  /**
112
- * h3 event handler that serves files from `source` with SPA fallback — a
147
+ * h3 event handler that serves files from `source` with SPA fallback: a
113
148
  * local directory, or a {@link RemoteAssetsStore} whose files stream through
114
149
  * the CDN back-proxy into the local cache.
115
150
  *
116
151
  * Drop-in replacement for `fromNodeMiddleware(sirv(dir, { dev: true, single: true }))`
117
- * when the surrounding server is an h3 app — no `Cache-Control` beyond
152
+ * when the surrounding server is an h3 app: no `Cache-Control` beyond
118
153
  * `no-store`, `Content-Type` resolved via `mrmime`, and a miss with no
119
154
  * file extension falls back to `<dir>/index.html` so client-side routing
120
155
  * works.
@@ -123,6 +158,7 @@ function serveStaticHandler(source, options) {
123
158
  if (typeof source !== "string") return serveRemoteAssetsHandler(source);
124
159
  const absDir = resolve(source);
125
160
  const opts = normalizeOptions(options);
161
+ const realRoot = canonicalRoot(absDir);
126
162
  return defineHandler(async (event) => {
127
163
  const method = event.req.method;
128
164
  if (method !== "GET" && method !== "HEAD") {
@@ -130,7 +166,7 @@ function serveStaticHandler(source, options) {
130
166
  event.res.headers.set("Allow", "GET, HEAD");
131
167
  return "";
132
168
  }
133
- const file = await resolveTarget(absDir, event.url.pathname, opts.indexNames, opts.single);
169
+ const file = await resolveTarget(absDir, await realRoot, event.url.pathname, opts.indexNames, opts.single);
134
170
  if (!file) {
135
171
  event.res.status = 404;
136
172
  return "";
@@ -156,12 +192,13 @@ function mountStaticHandler(app, base, source, options) {
156
192
  * Connect/Express-style Node middleware variant of {@link serveStaticHandler}.
157
193
  *
158
194
  * Use when mounting onto `viteServer.middlewares.use(base, …)` or any other
159
- * Connect stack — avoids forcing the host package to depend on h3 just to
195
+ * Connect stack; avoids forcing the host package to depend on h3 just to
160
196
  * adapt an event handler back into Node middleware.
161
197
  */
162
198
  function serveStaticNodeMiddleware(source, options) {
163
199
  const absDir = typeof source === "string" ? resolve(source) : void 0;
164
200
  const opts = normalizeOptions(options);
201
+ const realRoot = absDir === void 0 ? void 0 : canonicalRoot(absDir);
165
202
  return (req, res, next) => {
166
203
  (async () => {
167
204
  const method = req.method;
@@ -192,7 +229,7 @@ function serveStaticNodeMiddleware(source, options) {
192
229
  Readable.fromWeb(response.body).pipe(res);
193
230
  return;
194
231
  }
195
- const file = await resolveTarget(absDir, url, opts.indexNames, opts.single);
232
+ const file = await resolveTarget(absDir, await realRoot, url, opts.indexNames, opts.single);
196
233
  if (!file) {
197
234
  if (next) {
198
235
  next();
@@ -1,2 +1,2 @@
1
- import { A as SharedStateEvents, D as ImmutableObject, E as ImmutableMap, M as SharedStatePatch, N as createSharedState, O as ImmutableSet, T as ImmutableArray, j as SharedStateOptions, k as SharedState, w as Immutable } from "../context-CLF4-8Pp.mjs";
1
+ import { A as SharedStateEvents, D as ImmutableObject, E as ImmutableMap, M as SharedStatePatch, N as createSharedState, O as ImmutableSet, T as ImmutableArray, j as SharedStateOptions, k as SharedState, w as Immutable } from "../context-4AIVRLYF.mjs";
2
2
  export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
@@ -1,2 +1,2 @@
1
- import { t as createSharedState } from "../shared-state--sduc6Xi.mjs";
1
+ import { t as createSharedState } from "../shared-state-CaxB1q0h.mjs";
2
2
  export { createSharedState };
@@ -8,10 +8,10 @@ import { StandardSchemaV1 } from "@standard-schema/spec";
8
8
  * best-effort validator that exists only so devframe's own first-party
9
9
  * packages (recipes, built-in plugins) can declare `args`/`returns`/flag
10
10
  * schemas without taking on a validator dependency. It implements a small
11
- * subset of primitives and approximates refinements — it is not a
11
+ * subset of primitives and approximates refinements; it is not a
12
12
  * general-purpose validator.
13
13
  *
14
- * For your own code, prefer a real Standard Schema validator — **valibot**,
14
+ * For your own code, prefer a real Standard Schema validator: **valibot**,
15
15
  * **zod**, or **arktype**. Devframe's RPC and CLI-flag layers accept any of
16
16
  * them; install the one you like and use it directly:
17
17
  *
@@ -46,7 +46,7 @@ declare function string(): SimpleSchema<string>;
46
46
  declare function number(): SimpleSchema<number>;
47
47
  /** A boolean. */
48
48
  declare function boolean(): SimpleSchema<boolean>;
49
- /** `undefined` — mirrors valibot's `void`. */
49
+ /** `undefined`, mirroring valibot's `void`. */
50
50
  declare function voidType(): SimpleSchema<void>;
51
51
  /** `null`. */
52
52
  declare function nullType(): SimpleSchema<null>;
@@ -64,7 +64,7 @@ declare function array<T extends StandardSchemaV1>(item: T): SimpleSchema<Standa
64
64
  type Prettify<T> = { [K in keyof T]: T[K]; } & {};
65
65
  /**
66
66
  * Map a shape to its object type, turning fields whose type includes
67
- * `undefined` (i.e. `optional()`) into optional keys — mirroring how
67
+ * `undefined` (i.e. `optional()`) into optional keys, mirroring how
68
68
  * valibot/zod render `optional` object entries.
69
69
  */
70
70
  type InferField<T extends StandardSchemaV1, Mode extends 'input' | 'output'> = Mode extends 'input' ? StandardSchemaV1.InferInput<T> : StandardSchemaV1.InferOutput<T>;
@@ -78,7 +78,7 @@ declare function nullable<T extends StandardSchemaV1>(inner: T): SimpleSchema<St
78
78
  /** Attach a human-readable description (used for CLI option help). */
79
79
  declare function describe<T extends SimpleSchema<any, any>>(schema: T, description: string): T;
80
80
  /**
81
- * Grouped access to every builder — `s.string()`, `s.object({ ... })`,
81
+ * Grouped access to every builder: `s.string()`, `s.object({ ... })`,
82
82
  * `s.void()`, etc. Handy for a valibot-like `import { s } from
83
83
  * 'devframe/utils/simple-schema'` call site.
84
84
  */
@@ -37,7 +37,7 @@ function number() {
37
37
  function boolean() {
38
38
  return make("boolean", (v) => typeof v === "boolean" ? ok(v) : fail("Expected a boolean"));
39
39
  }
40
- /** `undefined` — mirrors valibot's `void`. */
40
+ /** `undefined`, mirroring valibot's `void`. */
41
41
  function voidType() {
42
42
  return make("void", (v) => v === void 0 ? ok(void 0) : fail("Expected undefined"));
43
43
  }
@@ -130,7 +130,7 @@ function describe(schema, description) {
130
130
  };
131
131
  }
132
132
  /**
133
- * Grouped access to every builder — `s.string()`, `s.object({ ... })`,
133
+ * Grouped access to every builder: `s.string()`, `s.object({ ... })`,
134
134
  * `s.void()`, etc. Handy for a valibot-like `import { s } from
135
135
  * 'devframe/utils/simple-schema'` call site.
136
136
  */
@@ -1,2 +1,2 @@
1
- import { C as createStreamSink, S as createStreamReader, _ as CreateStreamSinkOptions, b as StreamSink, g as CreateStreamReaderOptions, h as BufferedChunk, v as StreamErrorPayload, x as StreamSinkEvents, y as StreamReader } from "../context-CLF4-8Pp.mjs";
1
+ import { C as createStreamSink, S as createStreamReader, _ as CreateStreamSinkOptions, b as StreamSink, g as CreateStreamReaderOptions, h as BufferedChunk, v as StreamErrorPayload, x as StreamSinkEvents, y as StreamReader } from "../context-4AIVRLYF.mjs";
2
2
  export { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink };
@@ -6,7 +6,7 @@ var StreamClosedError = class extends Error {
6
6
  name = "StreamClosedError";
7
7
  };
8
8
  /**
9
- * Build a server-side stream sink. RPC-agnostic — the RPC host wires
9
+ * Build a server-side stream sink. RPC-agnostic; the RPC host wires
10
10
  * `events.on('chunk' | 'end')` to broadcast, and reads `buffer` to replay
11
11
  * for late or reconnecting subscribers.
12
12
  */
@@ -77,7 +77,7 @@ function createStreamSink(options = {}) {
77
77
  };
78
78
  }
79
79
  /**
80
- * Build a client-side stream reader. RPC-agnostic — the RPC host calls
80
+ * Build a client-side stream reader. RPC-agnostic; the RPC host calls
81
81
  * `_push(seq, chunk)` on each incoming chunk and `_end(error?)` on the
82
82
  * terminal frame. Consumers iterate with `for await` or pipe `readable`.
83
83
  */
@@ -4,13 +4,13 @@ import { WhenExpression as WhenExpression$1 } from "whenexpr";
4
4
  * Context object for evaluating `when` expressions.
5
5
  *
6
6
  * Built-in variables:
7
- * - `clientType` — `'embedded' | 'standalone'`
8
- * - `dockOpen` — whether the dock panel is open
9
- * - `paletteOpen` — whether the command palette is open
10
- * - `dockSelectedId` — ID of the selected dock entry (empty string if none)
7
+ * - `clientType`: `'embedded' | 'standalone'`
8
+ * - `dockOpen`: whether the dock panel is open
9
+ * - `paletteOpen`: whether the command palette is open
10
+ * - `dockSelectedId`: ID of the selected dock entry (empty string if none)
11
11
  *
12
12
  * Plugins can add namespaced variables using dot or colon separators:
13
- * - `vite.mode`, `vite:mode` — stored as `{ 'vite.mode': 'development' }` or nested `{ vite: { mode: 'development' } }`
13
+ * - `vite.mode`, `vite:mode`: stored as `{ 'vite.mode': 'development' }` or nested `{ vite: { mode: 'development' } }`
14
14
  *
15
15
  * Supported operators: `!`, `==`, `!=`, `===`, `!==`, `<`, `<=`, `>`, `>=`,
16
16
  * `&&`, `||`, `+`, `-`, `*`, `/`, `%`. Parentheses, number and string literals