devframe 0.9.0 → 0.9.1

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 (64) hide show
  1. package/dist/{_shared-CbZ_yhbz.mjs → _shared-BM3PdYli.mjs} +1 -1
  2. package/dist/{_shared-BPmX9fqK.d.mts → _shared-DqbKCAew.d.mts} +1 -1
  3. package/dist/adapters/build.d.mts +1 -1
  4. package/dist/adapters/build.mjs +8 -6
  5. package/dist/adapters/cac.d.mts +1 -1
  6. package/dist/adapters/cac.mjs +4 -3
  7. package/dist/adapters/dev.d.mts +3 -3
  8. package/dist/adapters/dev.mjs +2 -2
  9. package/dist/adapters/embedded.d.mts +1 -1
  10. package/dist/adapters/embedded.mjs +1 -0
  11. package/dist/adapters/initiate.d.mts +2 -2
  12. package/dist/adapters/initiate.mjs +1 -1
  13. package/dist/adapters/mcp.d.mts +1 -1
  14. package/dist/adapters/mcp.mjs +1 -1
  15. package/dist/cli/main.mjs +2 -2
  16. package/dist/client/index.d.mts +48 -2
  17. package/dist/client/index.mjs +131 -21
  18. package/dist/constants.d.mts +74 -2
  19. package/dist/constants.mjs +9 -2
  20. package/dist/{context-CEe4PBz1.mjs → context-Bdkakk8S.mjs} +319 -21
  21. package/dist/{context-xdynGSLP.mjs → context-CXhjygJU.mjs} +2 -2
  22. package/dist/{context-B3YUu_95.d.mts → context-dqyXS6o3.d.mts} +1 -1
  23. package/dist/{dev--rAPzbvO.mjs → dev-C8VHtuPP.mjs} +12 -9
  24. package/dist/{devframe-DJMg0WLe.d.mts → devframe-BlLEZR-x.d.mts} +741 -588
  25. package/dist/{diagnostics-DOQPnQmX.mjs → diagnostics-Di8ytitn.mjs} +24 -0
  26. package/dist/{dist-eNI9qM_I.mjs → dist-CZXfGEkd.mjs} +1 -1
  27. package/dist/events-DKfSmoTj.mjs +65 -0
  28. package/dist/{host-agent-xLCSe65D.mjs → host-agent-BDdcOXhG.mjs} +14 -13
  29. package/dist/{http-DYpK0cUi.mjs → http-BbHCU5Zs.mjs} +8 -5
  30. package/dist/{index-CB-fSUyn.d.mts → index-BKFT9-jA.d.mts} +2 -2
  31. package/dist/index.d.mts +2 -2
  32. package/dist/{instance-registry-WvQkt42E.mjs → instance-registry-CHunhMi5.mjs} +4 -4
  33. package/dist/{instance-shell-CljiKq1c.d.mts → instance-shell-0iw-cQ5V.d.mts} +2 -2
  34. package/dist/{instance-shell-CMFyszWJ.mjs → instance-shell-DbDoozNM.mjs} +5 -5
  35. package/dist/internal/index.d.mts +46 -4
  36. package/dist/internal/index.mjs +7 -7
  37. package/dist/node/auth.d.mts +2 -2
  38. package/dist/node/auth.mjs +2 -2
  39. package/dist/node/hub-internals.d.mts +2 -2
  40. package/dist/node/hub-internals.mjs +2 -2
  41. package/dist/node/index.d.mts +1 -1
  42. package/dist/node/index.mjs +2 -2
  43. package/dist/recipes/common-rpc-functions.d.mts +1 -1
  44. package/dist/recipes/interactive-auth.d.mts +2 -2
  45. package/dist/recipes/interactive-auth.mjs +2 -2
  46. package/dist/{remote-assets-nTTxY2MU.mjs → remote-assets-DRfY2RjX.mjs} +6 -5
  47. package/dist/{revoke-DZbJ7Cl0.mjs → revoke-3Q6aDKWk.mjs} +2 -1
  48. package/dist/{rolldown-runtime-JspESFgx.mjs → rolldown-runtime-B4iAMlE-.mjs} +1 -1
  49. package/dist/rpc/transports/ws-bun.d.mts +1 -1
  50. package/dist/{rpc-core-Cc4lucI0.d.mts → rpc-core-CR8o34O9.d.mts} +2 -2
  51. package/dist/{rpc-core-DMTe-hLo.mjs → rpc-core-Dru9uoM0.mjs} +11 -4
  52. package/dist/{state-Cc1IeSmQ.mjs → state-CK9LjrnT.mjs} +1 -1
  53. package/dist/{storage-CYye7P7L.mjs → storage-D4a99Ung.mjs} +3 -3
  54. package/dist/types/index.d.mts +2 -2
  55. package/dist/utils/events.d.mts +1 -1
  56. package/dist/utils/get-port.mjs +1 -1
  57. package/dist/utils/launch-editor.mjs +12 -11
  58. package/dist/utils/open.mjs +1 -1
  59. package/dist/utils/remote-assets.mjs +1 -1
  60. package/dist/utils/serve-static.mjs +6 -5
  61. package/dist/utils/shared-state.d.mts +1 -1
  62. package/dist/utils/streaming-channel.d.mts +1 -1
  63. package/package.json +1 -1
  64. package/dist/{host-h3-Crkzm42q.mjs → host-h3-fRbF9yor.mjs} +1 -1
@@ -137,6 +137,30 @@ const diagnostics = defineDiagnostics({
137
137
  DF0065: {
138
138
  why: (p) => `Invalid remote-assets ${p.field} "${p.value}".`,
139
139
  fix: "A remote-assets `package` must be a valid npm package name and `version` an exact semver version (e.g. `1.2.3`) — they are interpolated into CDN URLs and the cache path."
140
+ },
141
+ DF0066: {
142
+ why: (p) => `Service "${p.package}" is already installed — keeping the first installation and ignoring this one's options.`,
143
+ fix: "Option sets only merge before `ctx.services.ready()` fires. Install the service (or declare it in `DevframeDefinition.services`) before the barrier so its options join the merge."
144
+ },
145
+ DF0067: {
146
+ why: (p) => `Failed to import the required service package "${p.package}": ${p.reason}`,
147
+ fix: "Install the service package next to whoever declares it (a plugin declaring it in `services` should list it in its own dependencies), or drop `required: true` to degrade gracefully when it is absent."
148
+ },
149
+ DF0068: {
150
+ why: (p) => `The installed service "${p.package}@${p.installed}" does not satisfy the required range "${p.required}".`,
151
+ fix: "Align the installed service package with the range its declarer requires, or drop `required: true` to downgrade the mismatch to a warning."
152
+ },
153
+ DF0069: {
154
+ why: (p) => `The installed service "${p.package}@${p.installed}" does not satisfy the declared range "${p.required}" — installing it anyway.`,
155
+ fix: "The advertised meta carries the real version, so clients can gate on it. Align the installed service package with the declared range to silence this warning."
156
+ },
157
+ DF0070: {
158
+ why: (p) => `Invalid service "${p.package}": ${p.reason}`,
159
+ fix: "A service package's default export must be a factory returning a `DevframeServiceDefinition` — an object with `package`, `version`, `scope`, and a `setup` function."
160
+ },
161
+ DF0071: {
162
+ why: (p) => `Deferred service installation failed while flushing on the first client connection: ${p.reason}`,
163
+ fix: "Call `ctx.services.ready()` explicitly after every devframe's setup has run (the first-party adapters do) so installation errors surface at startup instead of at connect time."
140
164
  }
141
165
  }
142
166
  });
@@ -1,4 +1,4 @@
1
- import { n as __exportAll } from "./rolldown-runtime-JspESFgx.mjs";
1
+ import { n as __exportAll } from "./rolldown-runtime-B4iAMlE-.mjs";
2
2
  import "node:fs/promises";
3
3
  import { createServer } from "node:net";
4
4
  import { networkInterfaces } from "node:os";
@@ -0,0 +1,65 @@
1
+ //#region src/events.ts
2
+ /**
3
+ * Centralized registry of the core devframe event names — the node-side host
4
+ * bus events, the client RPC connection events, and the server→client
5
+ * broadcast notifications — so these names live in one place instead of
6
+ * scattered string literals.
7
+ *
8
+ * **Keep this in sync with [`docs/guide/events.md`](../../../docs/guide/events.md)**
9
+ * (the "Core devframe events" section): every name here appears in that page's
10
+ * tables, and every name there resolves to an entry here. Add, rename, or
11
+ * remove a name in both places in the same change, and reference
12
+ * `DEVFRAME_EVENTS.*` from call sites instead of re-typing a literal.
13
+ *
14
+ * This map covers **notifications** (events, broadcasts). The request/response
15
+ * RPC endpoints of the shared-state, streaming, and auth-handshake protocols
16
+ * (`devframe:rpc:server-state:*`, `devframe:streaming:subscribe`,
17
+ * `anonymous:devframe:auth`, …) are defined at their handlers and typed in
18
+ * `types/rpc-augments.ts`; they aren't events and stay out of this map.
19
+ *
20
+ * The `EventEmitter` maps (`RpcClientEvents`, `DevframeAgentHostEvents`) and the
21
+ * `DevframeRpcClientFunctions` augmentation declare these names as type-level
22
+ * keys (a literal is unavoidable in a type position); those declarations mirror
23
+ * this map and move with it.
24
+ */
25
+ const DEVFRAME_EVENTS = {
26
+ /**
27
+ * Node-side host `EventEmitter` events. The agent host (`ctx.agent.events`)
28
+ * emits these as its tool/resource surface changes; protocol adapters (e.g.
29
+ * MCP) subscribe to re-publish their manifest.
30
+ */
31
+ bus: {
32
+ agentManifestChanged: "agent:manifest:changed",
33
+ agentToolRegistered: "agent:tool:registered",
34
+ agentToolUnregistered: "agent:tool:unregistered",
35
+ agentResourceRegistered: "agent:resource:registered",
36
+ agentResourceUnregistered: "agent:resource:unregistered"
37
+ },
38
+ /**
39
+ * Client-side RPC connection `EventEmitter` events (`rpc.events`) a UI
40
+ * subscribes to for connection lifecycle and error surfacing.
41
+ */
42
+ client: {
43
+ isTrustedUpdated: "rpc:is-trusted:updated",
44
+ error: "rpc:error",
45
+ connectionStatus: "connection:status",
46
+ connectionError: "connection:error"
47
+ },
48
+ /**
49
+ * Broadcast notifications the server pushes to clients (server → client),
50
+ * `devframe:` prefix. The paired request methods (subscribe/get/set/…) are
51
+ * RPC endpoints, not events, and are omitted deliberately.
52
+ */
53
+ broadcast: {
54
+ authRevoked: "devframe:auth:revoked",
55
+ clientStateUpdated: "devframe:rpc:client-state:updated",
56
+ clientStatePatch: "devframe:rpc:client-state:patch",
57
+ streamingChunk: "devframe:streaming:chunk",
58
+ streamingEnd: "devframe:streaming:end",
59
+ streamingUploadCancel: "devframe:streaming:upload-cancel"
60
+ },
61
+ /** `postMessage` channels the runtime posts across window boundaries. */
62
+ postMessage: { remoteAssetsError: "devframe:remote-assets-error" }
63
+ };
64
+ //#endregion
65
+ export { DEVFRAME_EVENTS as t };
@@ -1,4 +1,5 @@
1
- import { t as diagnostics } from "./diagnostics-DOQPnQmX.mjs";
1
+ import { t as DEVFRAME_EVENTS } from "./events-DKfSmoTj.mjs";
2
+ import { t as diagnostics } from "./diagnostics-Di8ytitn.mjs";
2
3
  //#region src/utils/events.ts
3
4
  /**
4
5
  * Create event emitter.
@@ -90,7 +91,7 @@ var DevframeAgentHost = class {
90
91
  constructor(context) {
91
92
  this.context = context;
92
93
  this._rpcUnsubscribe = context.rpc.onChanged(() => {
93
- this.events.emit("agent:manifest:changed");
94
+ this.events.emit(DEVFRAME_EVENTS.bus.agentManifestChanged);
94
95
  });
95
96
  }
96
97
  registerTool(input) {
@@ -100,28 +101,28 @@ var DevframeAgentHost = class {
100
101
  tool,
101
102
  handler: input.handler
102
103
  });
103
- this.events.emit("agent:tool:registered", tool);
104
- this.events.emit("agent:manifest:changed");
104
+ this.events.emit(DEVFRAME_EVENTS.bus.agentToolRegistered, tool);
105
+ this.events.emit(DEVFRAME_EVENTS.bus.agentManifestChanged);
105
106
  return { unregister: () => this.unregisterTool(tool.id) };
106
107
  }
107
108
  unregisterTool(id) {
108
109
  const existed = this.tools.delete(id);
109
110
  if (existed) {
110
- this.events.emit("agent:tool:unregistered", id);
111
- this.events.emit("agent:manifest:changed");
111
+ this.events.emit(DEVFRAME_EVENTS.bus.agentToolUnregistered, id);
112
+ this.events.emit(DEVFRAME_EVENTS.bus.agentManifestChanged);
112
113
  }
113
114
  return existed;
114
115
  }
115
116
  registerToolProvider(provider) {
116
117
  this.providers.add(provider);
117
- this.events.emit("agent:manifest:changed");
118
+ this.events.emit(DEVFRAME_EVENTS.bus.agentManifestChanged);
118
119
  const notifyChanged = () => {
119
- if (this.providers.has(provider)) this.events.emit("agent:manifest:changed");
120
+ if (this.providers.has(provider)) this.events.emit(DEVFRAME_EVENTS.bus.agentManifestChanged);
120
121
  };
121
122
  return {
122
123
  notifyChanged,
123
124
  unregister: () => {
124
- if (this.providers.delete(provider)) this.events.emit("agent:manifest:changed");
125
+ if (this.providers.delete(provider)) this.events.emit(DEVFRAME_EVENTS.bus.agentManifestChanged);
125
126
  }
126
127
  };
127
128
  }
@@ -138,15 +139,15 @@ var DevframeAgentHost = class {
138
139
  resource,
139
140
  read: input.read
140
141
  });
141
- this.events.emit("agent:resource:registered", resource);
142
- this.events.emit("agent:manifest:changed");
142
+ this.events.emit(DEVFRAME_EVENTS.bus.agentResourceRegistered, resource);
143
+ this.events.emit(DEVFRAME_EVENTS.bus.agentManifestChanged);
143
144
  return { unregister: () => this.unregisterResource(resource.id) };
144
145
  }
145
146
  unregisterResource(id) {
146
147
  const existed = this.resources.delete(id);
147
148
  if (existed) {
148
- this.events.emit("agent:resource:unregistered", id);
149
- this.events.emit("agent:manifest:changed");
149
+ this.events.emit(DEVFRAME_EVENTS.bus.agentResourceUnregistered, id);
150
+ this.events.emit(DEVFRAME_EVENTS.bus.agentManifestChanged);
150
151
  }
151
152
  return existed;
152
153
  }
@@ -1,12 +1,13 @@
1
- import { n as __exportAll } from "./rolldown-runtime-JspESFgx.mjs";
1
+ import { n as __exportAll } from "./rolldown-runtime-B4iAMlE-.mjs";
2
2
  import { t as Diagnostic } from "./nostics-CzECRXpE.mjs";
3
+ import { t as DEVFRAME_EVENTS } from "./events-DKfSmoTj.mjs";
3
4
  import { i as isAllowedOrigin } from "./ws-server-BdSLrhxE.mjs";
4
- import { t as diagnostics } from "./diagnostics-DOQPnQmX.mjs";
5
- import { t as createHostContext } from "./context-CEe4PBz1.mjs";
5
+ import { t as diagnostics } from "./diagnostics-Di8ytitn.mjs";
6
+ import { t as createHostContext } from "./context-Bdkakk8S.mjs";
6
7
  import { t as toAgentToolName } from "./agent-tool-name-EgfoFO8C.mjs";
7
8
  import { randomUUID } from "node:crypto";
8
- import { join } from "pathe";
9
9
  import process from "node:process";
10
+ import { join } from "pathe";
10
11
  import { homedir } from "node:os";
11
12
  import { defineHandler } from "h3";
12
13
  import { Server, WebStandardStreamableHTTPServerTransport, isInitializeRequest } from "@modelcontextprotocol/server";
@@ -172,7 +173,7 @@ function buildMcpServerFromContext(ctx, options) {
172
173
  const notify = (method) => {
173
174
  server.notification({ method }).catch(() => {});
174
175
  };
175
- const offManifest = ctx.agent.events.on("agent:manifest:changed", () => {
176
+ const offManifest = ctx.agent.events.on(DEVFRAME_EVENTS.bus.agentManifestChanged, () => {
176
177
  notify("notifications/tools/list_changed");
177
178
  notify("notifications/resources/list_changed");
178
179
  });
@@ -210,7 +211,9 @@ async function createMcpServer(definition, options = {}) {
210
211
  }
211
212
  }
212
213
  });
214
+ for (const input of definition.services ?? []) ctx.services.install(input, { resolveFrom: definition.packageName });
213
215
  await definition.setup(ctx);
216
+ await ctx.services.ready();
214
217
  const { server, dispose } = buildMcpServerFromContext(ctx, {
215
218
  serverName: options.serverName ?? `${definition.id} (devframe)`,
216
219
  serverVersion: options.serverVersion ?? definition.version ?? "0.0.0",
@@ -1,5 +1,5 @@
1
- import { R as DevframeNodeRpcSession, g as DevframeNodeContext, lt as SharedState } from "./devframe-DJMg0WLe.mjs";
2
- import { n as InternalAnonymousAuthStorage } from "./context-B3YUu_95.mjs";
1
+ import { _ as DevframeNodeRpcSession, g as DevframeNodeContext, gt as SharedState } from "./devframe-BlLEZR-x.mjs";
2
+ import { n as InternalAnonymousAuthStorage } from "./context-dqyXS6o3.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 { A as ScopedServerFunctions, B as RpcFunctionsHost, C as DevframeScopedStreamingHost, Ct as DevframeAgentHost, D as ScopedBroadcastOptions, Dt as EventsMap, E as DevframeSettingsStore, Et as EventUnsubscribe, F as DevframeStorageScope, G as RpcStreamingHost, H as RpcSharedStateHost, I as DevframeDiagnosticsHost, J as DevframeRpcSharedStates, K as DevframeRpcClientFunctions, L as DevframeDiagnosticsLogger, M as SettingsForNamespace, N as DevframeViewHost, O as ScopedClientFunctions, P as DevframeHost, R as DevframeNodeRpcSession, S as DevframeScopedNodeRpc, St as AgentToolProviderHandle, T as DevframeSettingsRegistry, Tt as EventEmitter, U as RpcStreamingChannel, V as RpcSharedStateGetOptions, W as RpcStreamingChannelOptions, _ as DevframeServiceId, _t as AgentResourceContent, a as DevframeDuplicationStrategy, b as DevframeServicesRegistry, bt as AgentToolInput, c as DevframeWsOptions, d as ConnectionMeta, f as ConnectionMetaSse, g as DevframeNodeContext, gt as AgentResource, h as DevframeConnectionConfigsRegistry, ht as AgentManifest, i as DevframeDockDefaults, j as ScopedSharedStates, k as ScopedRpcFn, l as McpRouteOptions, m as DevframeCapabilities, mt as AgentHandle, n as DevframeDefinition, o as DevframeSetupInfo, p as ConnectionMetaWebsocket, q as DevframeRpcServerFunctions, r as DevframeDeploymentKind, s as DevframeSseOptions, t as DevframeCliOptions, v as DevframeServiceOf, vt as AgentResourceInput, w as DevframeSettings, wt as DevframeAgentHostEvents, x as DevframeScopedNodeContext, xt as AgentToolProvider, y as DevframeServicesHost, yt as AgentTool, z as RpcBroadcastOptions } from "./devframe-DJMg0WLe.mjs";
1
+ import { $ as DevframeStorageScope, A as DevframeServiceId, At as DevframeAgentHost, B as DevframeScopedNodeRpc, C as RpcStreamingChannelOptions, Ct as AgentResource, D as DevframeRpcSharedStates, Dt as AgentToolInput, E as DevframeRpcServerFunctions, Et as AgentTool, F as DevframeServicesHost, G as ScopedBroadcastOptions, H as DevframeSettings, I as DevframeServicesRegistry, J as ScopedServerFunctions, K as ScopedClientFunctions, L as DevframeServicesScopeRegistry, M as DevframeServiceMeta, Mt as EventEmitter, N as DevframeServiceOf, Nt as EventUnsubscribe, O as DevframeServiceDefinition, Ot as AgentToolProvider, P as DevframeServiceScopeOf, Pt as EventsMap, Q as DevframeHost, R as DevframeServicesState, S as RpcStreamingChannel, St as AgentManifest, T as DevframeRpcClientFunctions, Tt as AgentResourceInput, U as DevframeSettingsRegistry, V as DevframeScopedStreamingHost, W as DevframeSettingsStore, X as SettingsForNamespace, Y as ScopedSharedStates, Z as DevframeViewHost, _ as DevframeNodeRpcSession, a as DevframeDuplicationStrategy, b as RpcSharedStateGetOptions, c as DevframeWsOptions, d as ConnectionMeta, et as DevframeDiagnosticsHost, f as ConnectionMetaSse, g as DevframeNodeContext, h as DevframeConnectionConfigsRegistry, i as DevframeDockDefaults, j as DevframeServiceInput, jt as DevframeAgentHostEvents, k as DevframeServiceDescriptor, kt as AgentToolProviderHandle, l as McpRouteOptions, m as DevframeCapabilities, n as DevframeDefinition, o as DevframeSetupInfo, p as ConnectionMetaWebsocket, q as ScopedRpcFn, r as DevframeDeploymentKind, s as DevframeSseOptions, t as DevframeCliOptions, tt as DevframeDiagnosticsLogger, v as RpcBroadcastOptions, w as RpcStreamingHost, wt as AgentResourceContent, x as RpcSharedStateHost, xt as AgentHandle, y as RpcFunctionsHost, z as DevframeScopedNodeContext } from "./devframe-BlLEZR-x.mjs";
2
2
  import "./index-tdrk1bzV.mjs";
3
3
  import { C as RpcFunctionType, T as RpcReturnSchema, _ as RpcFunctionDefinition, g as RpcFunctionAgentOptions, i as RpcArgsSchema } from "./types-Djq7CBXh.mjs";
4
4
  import { d as DevframeRpcConnection, f as DevframeRpcConnectionRequest, p as DevframeRpcTransportKind, u as DevframeNodeRpcSessionMeta } from "./ws-server-D1d3QM9f.mjs";
@@ -12,4 +12,4 @@ declare const defineRpcFunction: <NAME extends string, TYPE extends RpcFunctionT
12
12
  */
13
13
  declare function defineDevframe(d: DevframeDefinition): DevframeDefinition;
14
14
  //#endregion
15
- export { type AgentHandle, type AgentManifest, type AgentResource, type AgentResourceContent, type AgentResourceInput, type AgentTool, type AgentToolInput, type AgentToolProvider, type AgentToolProviderHandle, type ConnectionMeta, type ConnectionMetaSse, type ConnectionMetaWebsocket, type DevframeAgentHost, type DevframeAgentHostEvents, type DevframeCapabilities, type DevframeCliOptions, type DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, type DevframeDefinition, type DevframeDeploymentKind, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDockDefaults, type DevframeDuplicationStrategy, type DevframeHost, type DevframeNodeContext, type DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, type DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeRpcTransportKind, type DevframeScopedNodeContext, type DevframeScopedNodeRpc, type DevframeScopedStreamingHost, type DevframeServiceId, type DevframeServiceOf, type DevframeServicesHost, type DevframeServicesRegistry, type DevframeSettings, type DevframeSettingsRegistry, type DevframeSettingsStore, type DevframeSetupInfo, type DevframeSseOptions, type DevframeStorageScope, type DevframeViewHost, type DevframeWsOptions, type EventEmitter, type EventUnsubscribe, type EventsMap, type McpRouteOptions, type RemoteAssets, type RemoteAssetsErrorMessage, type RemoteAssetsProvider, type RemoteAssetsProviderCustom, type RemoteAssetsStore, type RpcBroadcastOptions, type RpcFunctionAgentOptions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type ScopedBroadcastOptions, type ScopedClientFunctions, type ScopedRpcFn, type ScopedServerFunctions, type ScopedSharedStates, type SettingsForNamespace, type StaticAssetsSource, defineDevframe, defineRpcFunction };
15
+ export { type AgentHandle, type AgentManifest, type AgentResource, type AgentResourceContent, type AgentResourceInput, type AgentTool, type AgentToolInput, type AgentToolProvider, type AgentToolProviderHandle, type ConnectionMeta, type ConnectionMetaSse, type ConnectionMetaWebsocket, type DevframeAgentHost, type DevframeAgentHostEvents, type DevframeCapabilities, type DevframeCliOptions, type DevframeConnectionConfigsRegistry, type DevframeDefineDiagnosticsOptions, type DevframeDefinition, type DevframeDeploymentKind, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDockDefaults, type DevframeDuplicationStrategy, type DevframeHost, type DevframeNodeContext, type DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, type DevframeRpcClientFunctions, type DevframeRpcConnection, type DevframeRpcConnectionRequest, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeRpcTransportKind, type DevframeScopedNodeContext, type DevframeScopedNodeRpc, type DevframeScopedStreamingHost, type DevframeServiceDefinition, type DevframeServiceDescriptor, type DevframeServiceId, type DevframeServiceInput, type DevframeServiceMeta, type DevframeServiceOf, type DevframeServiceScopeOf, type DevframeServicesHost, type DevframeServicesRegistry, type DevframeServicesScopeRegistry, type DevframeServicesState, type DevframeSettings, type DevframeSettingsRegistry, type DevframeSettingsStore, type DevframeSetupInfo, type DevframeSseOptions, type DevframeStorageScope, type DevframeViewHost, type DevframeWsOptions, type EventEmitter, type EventUnsubscribe, type EventsMap, type McpRouteOptions, type RemoteAssets, type RemoteAssetsErrorMessage, type RemoteAssetsProvider, type RemoteAssetsProviderCustom, type RemoteAssetsStore, type RpcBroadcastOptions, type RpcFunctionAgentOptions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type ScopedBroadcastOptions, type ScopedClientFunctions, type ScopedRpcFn, type ScopedServerFunctions, type ScopedSharedStates, type SettingsForNamespace, type StaticAssetsSource, defineDevframe, defineRpcFunction };
@@ -1,8 +1,8 @@
1
- import { n as __exportAll } from "./rolldown-runtime-JspESFgx.mjs";
2
- import { t as diagnostics } from "./diagnostics-DOQPnQmX.mjs";
3
- import { mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
4
- import { join } from "pathe";
1
+ import { n as __exportAll } from "./rolldown-runtime-B4iAMlE-.mjs";
2
+ import { t as diagnostics } from "./diagnostics-Di8ytitn.mjs";
5
3
  import process from "node:process";
4
+ import { join } from "pathe";
5
+ import { mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
6
6
  import { homedir } from "node:os";
7
7
  //#region src/node/instance-registry.ts
8
8
  var instance_registry_exports = /* @__PURE__ */ __exportAll({
@@ -1,6 +1,6 @@
1
- import { K as DevframeRpcClientFunctions, R as DevframeNodeRpcSession, c as DevframeWsOptions, d as ConnectionMeta, g as DevframeNodeContext, q as DevframeRpcServerFunctions, s as DevframeSseOptions, u as DevframeAuthHandler } from "./devframe-DJMg0WLe.mjs";
1
+ import { E as DevframeRpcServerFunctions, T as DevframeRpcClientFunctions, _ as DevframeNodeRpcSession, c as DevframeWsOptions, d as ConnectionMeta, g as DevframeNodeContext, s as DevframeSseOptions, u as DevframeAuthHandler } from "./devframe-BlLEZR-x.mjs";
2
2
  import { d as DevframeRpcConnection, n as WsOriginRegistry, u as DevframeNodeRpcSessionMeta } from "./ws-server-D1d3QM9f.mjs";
3
- import "./index-CB-fSUyn.mjs";
3
+ import "./index-BKFT9-jA.mjs";
4
4
  import { BirpcGroup } from "birpc";
5
5
  import { NodeAdapter } from "crossws/adapters/node";
6
6
  import { Buffer } from "node:buffer";
@@ -1,6 +1,6 @@
1
1
  import "./constants.mjs";
2
- import { t as diagnostics } from "./diagnostics-DOQPnQmX.mjs";
3
- import { t as getInternalContext } from "./context-xdynGSLP.mjs";
2
+ import { t as diagnostics } from "./diagnostics-Di8ytitn.mjs";
3
+ import { t as getInternalContext } from "./context-CXhjygJU.mjs";
4
4
  import { createInteractiveAuth } from "./recipes/interactive-auth.mjs";
5
5
  import { createServer } from "node:http";
6
6
  import process from "node:process";
@@ -197,7 +197,7 @@ function createInstanceShell(options) {
197
197
  const origin = currentOrigin();
198
198
  if (!cfg || registerPromise || !origin || !meta) return;
199
199
  const resolvedMeta = meta;
200
- registerPromise = import("./instance-registry-WvQkt42E.mjs").then((n) => n.t).then(({ registerDevframeInstance }) => {
200
+ registerPromise = import("./instance-registry-CHunhMi5.mjs").then((n) => n.t).then(({ registerDevframeInstance }) => {
201
201
  let port = 0;
202
202
  try {
203
203
  const url = new URL(origin);
@@ -257,7 +257,7 @@ function createInstanceShell(options) {
257
257
  let resolvedAuth = false;
258
258
  let corePromise;
259
259
  function ensureCore() {
260
- corePromise ??= import("./rpc-core-DMTe-hLo.mjs").then((n) => n.n).then(({ createContextRpcServer }) => createContextRpcServer({
260
+ corePromise ??= import("./rpc-core-Dru9uoM0.mjs").then((n) => n.n).then(({ createContextRpcServer }) => createContextRpcServer({
261
261
  context: ctx,
262
262
  auth: resolvedAuth,
263
263
  onPeerConnect: options.onPeerConnect,
@@ -298,7 +298,7 @@ function createInstanceShell(options) {
298
298
  allowedOrigins: options.allowedOrigins
299
299
  });
300
300
  if (ws.port != null) return await start(ws.port);
301
- const { getPort } = await import("./dist-eNI9qM_I.mjs").then((n) => n.t);
301
+ const { getPort } = await import("./dist-CZXfGEkd.mjs").then((n) => n.t);
302
302
  let lastError;
303
303
  for (let attempt = 0; attempt < 3; attempt++) {
304
304
  const port = attempt === 0 && options.resolveSidecarPort ? await options.resolveSidecarPort(sidecarHost) : await getPort({
@@ -1,9 +1,9 @@
1
- import { Ct as DevframeAgentHost$1, P as DevframeHost, St as AgentToolProviderHandle, Tt as EventEmitter, _t as AgentResourceContent, bt as AgentToolInput, g as DevframeNodeContext, gt as AgentResource, ht as AgentManifest, mt as AgentHandle, vt as AgentResourceInput, wt as DevframeAgentHostEvents, xt as AgentToolProvider, yt as AgentTool } from "../devframe-DJMg0WLe.mjs";
1
+ import { At as DevframeAgentHost$1, Ct as AgentResource, Dt as AgentToolInput, Et as AgentTool, Mt as EventEmitter, Ot as AgentToolProvider, Q as DevframeHost, St as AgentManifest, Tt as AgentResourceInput, g as DevframeNodeContext, jt as DevframeAgentHostEvents, kt as AgentToolProviderHandle, wt as AgentResourceContent, xt as AgentHandle } from "../devframe-BlLEZR-x.mjs";
2
2
  import { v as RpcFunctionDefinitionAny } from "../types-Djq7CBXh.mjs";
3
3
  import { a as RemoteAssetsStore } from "../remote-assets-Bg4gCUZ_.mjs";
4
- import { a as InstanceShellInit, c as StartedServer, d as samePath, f as DevframeInstanceRecord, h as registerDevframeInstance, i as InstanceShellApi, l as createInstanceShell, m as listLiveDevframeInstances, n as InstanceRegisterConfig, o as InstanceShellInternals, p as DevframeInstanceRegistration, r as InstanceShell, s as InstanceWsTier, t as CreateInstanceShellOptions, u as resolveInstanceRegister } from "../instance-shell-CljiKq1c.mjs";
5
- import { n as normalizeBasePath, r as resolveBasePath } from "../_shared-BPmX9fqK.mjs";
6
- import { n as CreateContextRpcServerOptions, r as createContextRpcServer, t as ContextRpcServer } from "../rpc-core-Cc4lucI0.mjs";
4
+ import { a as InstanceShellInit, c as StartedServer, d as samePath, f as DevframeInstanceRecord, h as registerDevframeInstance, i as InstanceShellApi, l as createInstanceShell, m as listLiveDevframeInstances, n as InstanceRegisterConfig, o as InstanceShellInternals, p as DevframeInstanceRegistration, r as InstanceShell, s as InstanceWsTier, t as CreateInstanceShellOptions, u as resolveInstanceRegister } from "../instance-shell-0iw-cQ5V.mjs";
5
+ import { n as normalizeBasePath, r as resolveBasePath } from "../_shared-DqbKCAew.mjs";
6
+ import { n as CreateContextRpcServerOptions, r as createContextRpcServer, t as ContextRpcServer } from "../rpc-core-CR8o34O9.mjs";
7
7
  //#region src/node/agent-args.d.ts
8
8
  /**
9
9
  * How {@link coerceAgentPositionalArgs} treats an args object that carries
@@ -280,6 +280,48 @@ declare const diagnostics: import("nostics").Diagnostics<{
280
280
  }) => string;
281
281
  readonly fix: "A remote-assets `package` must be a valid npm package name and `version` an exact semver version (e.g. `1.2.3`) — they are interpolated into CDN URLs and the cache path.";
282
282
  };
283
+ readonly DF0066: {
284
+ readonly why: (p: {
285
+ package: string;
286
+ }) => string;
287
+ readonly fix: "Option sets only merge before `ctx.services.ready()` fires. Install the service (or declare it in `DevframeDefinition.services`) before the barrier so its options join the merge.";
288
+ };
289
+ readonly DF0067: {
290
+ readonly why: (p: {
291
+ package: string;
292
+ reason: string;
293
+ }) => string;
294
+ readonly fix: "Install the service package next to whoever declares it (a plugin declaring it in `services` should list it in its own dependencies), or drop `required: true` to degrade gracefully when it is absent.";
295
+ };
296
+ readonly DF0068: {
297
+ readonly why: (p: {
298
+ package: string;
299
+ required: string;
300
+ installed: string;
301
+ }) => string;
302
+ readonly fix: "Align the installed service package with the range its declarer requires, or drop `required: true` to downgrade the mismatch to a warning.";
303
+ };
304
+ readonly DF0069: {
305
+ readonly why: (p: {
306
+ package: string;
307
+ required: string;
308
+ installed: string;
309
+ }) => string;
310
+ readonly fix: "The advertised meta carries the real version, so clients can gate on it. Align the installed service package with the declared range to silence this warning.";
311
+ };
312
+ readonly DF0070: {
313
+ readonly why: (p: {
314
+ package: string;
315
+ reason: string;
316
+ }) => string;
317
+ readonly fix: "A service package's default export must be a factory returning a `DevframeServiceDefinition` — an object with `package`, `version`, `scope`, and a `setup` function.";
318
+ };
319
+ readonly DF0071: {
320
+ readonly why: (p: {
321
+ reason: string;
322
+ }) => string;
323
+ readonly fix: "Call `ctx.services.ready()` explicitly after every devframe's setup has run (the first-party adapters do) so installation errors surface at startup instead of at connect time.";
324
+ };
283
325
  }, readonly [(d: import("nostics").Diagnostic, { method }?: {
284
326
  method?: "log" | "warn" | "error";
285
327
  }) => void]>;
@@ -1,9 +1,9 @@
1
1
  import { n as peekRpcWireFrame, t as createRpcWireCodec } from "../wire-codec-0K-o5MYW.mjs";
2
- import { t as diagnostics } from "../diagnostics-DOQPnQmX.mjs";
3
- import { n as coerceAgentPositionalArgs, t as DevframeAgentHost } from "../host-agent-xLCSe65D.mjs";
4
- import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-CbZ_yhbz.mjs";
5
- import { t as createH3DevframeHost } from "../host-h3-Crkzm42q.mjs";
6
- import { i as registerDevframeInstance, n as listLiveDevframeInstances } from "../instance-registry-WvQkt42E.mjs";
7
- import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, r as samePath, t as createInstanceShell } from "../instance-shell-CMFyszWJ.mjs";
8
- import { t as createContextRpcServer } from "../rpc-core-DMTe-hLo.mjs";
2
+ import { t as diagnostics } from "../diagnostics-Di8ytitn.mjs";
3
+ import { n as coerceAgentPositionalArgs, t as DevframeAgentHost } from "../host-agent-BDdcOXhG.mjs";
4
+ import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-BM3PdYli.mjs";
5
+ import { t as createH3DevframeHost } from "../host-h3-fRbF9yor.mjs";
6
+ import { i as registerDevframeInstance, n as listLiveDevframeInstances } from "../instance-registry-CHunhMi5.mjs";
7
+ import { i as normalizeHttpServerUrl, n as resolveInstanceRegister, r as samePath, t as createInstanceShell } from "../instance-shell-DbDoozNM.mjs";
8
+ import { t as createContextRpcServer } from "../rpc-core-Dru9uoM0.mjs";
9
9
  export { DevframeAgentHost, coerceAgentPositionalArgs, createContextRpcServer, createH3DevframeHost, createInstanceShell, createRpcWireCodec, diagnostics, listLiveDevframeInstances, normalizeBasePath, normalizeHttpServerUrl, peekRpcWireFrame, registerDevframeInstance, resolveBasePath, resolveInstanceRegister, samePath };
@@ -1,3 +1,3 @@
1
- import { u as DevframeAuthHandler } from "../devframe-DJMg0WLe.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-CB-fSUyn.mjs";
1
+ import { u as DevframeAuthHandler } from "../devframe-BlLEZR-x.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-BKFT9-jA.mjs";
3
3
  export { DevframeAuthHandler, buildOtpAuthUrl, exchangeTempAuthCode, getTempAuthCode, refreshTempAuthCode, revokeActiveConnectionsForToken, revokeAuthToken, verifyAuthToken };
@@ -1,3 +1,3 @@
1
- import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "../revoke-DZbJ7Cl0.mjs";
2
- import { a as verifyAuthToken, i as refreshTempAuthCode, n as exchangeTempAuthCode, r as getTempAuthCode, t as buildOtpAuthUrl } from "../state-Cc1IeSmQ.mjs";
1
+ import { n as revokeAuthToken, t as revokeActiveConnectionsForToken } from "../revoke-3Q6aDKWk.mjs";
2
+ import { a as verifyAuthToken, i as refreshTempAuthCode, n as exchangeTempAuthCode, r as getTempAuthCode, t as buildOtpAuthUrl } from "../state-CK9LjrnT.mjs";
3
3
  export { buildOtpAuthUrl, exchangeTempAuthCode, getTempAuthCode, refreshTempAuthCode, revokeActiveConnectionsForToken, revokeAuthToken, verifyAuthToken };
@@ -1,3 +1,3 @@
1
- import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-B3YUu_95.mjs";
2
- import { n as normalizeBasePath, r as resolveBasePath } from "../_shared-BPmX9fqK.mjs";
1
+ import { a as internalContextMap, i as getInternalContext, n as InternalAnonymousAuthStorage, r as RemoteTokenRecord, t as DevframeInternalContext } from "../context-dqyXS6o3.mjs";
2
+ import { n as normalizeBasePath, r as resolveBasePath } from "../_shared-DqbKCAew.mjs";
3
3
  export { type DevframeInternalContext, type InternalAnonymousAuthStorage, type RemoteTokenRecord, getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
@@ -1,3 +1,3 @@
1
- import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-CbZ_yhbz.mjs";
2
- import { n as internalContextMap, t as getInternalContext } from "../context-xdynGSLP.mjs";
1
+ import { n as resolveBasePath, t as normalizeBasePath } from "../_shared-BM3PdYli.mjs";
2
+ import { n as internalContextMap, t as getInternalContext } from "../context-CXhjygJU.mjs";
3
3
  export { getInternalContext, internalContextMap, normalizeBasePath, resolveBasePath };
@@ -1,4 +1,4 @@
1
- import { B as RpcFunctionsHost, P as DevframeHost, g as DevframeNodeContext, lt as SharedState } from "../devframe-DJMg0WLe.mjs";
1
+ import { Q as DevframeHost, g as DevframeNodeContext, gt as SharedState, y as RpcFunctionsHost } from "../devframe-BlLEZR-x.mjs";
2
2
  import "../index-tdrk1bzV.mjs";
3
3
  import { v as RpcFunctionDefinitionAny } from "../types-Djq7CBXh.mjs";
4
4
  import { BirpcGroup } from "birpc";
@@ -1,3 +1,3 @@
1
- import { t as createHostContext } from "../context-CEe4PBz1.mjs";
2
- import { t as createStorage } from "../storage-CYye7P7L.mjs";
1
+ import { t as createHostContext } from "../context-Bdkakk8S.mjs";
2
+ import { t as createStorage } from "../storage-D4a99Ung.mjs";
3
3
  export { createHostContext, createStorage };
@@ -1,4 +1,4 @@
1
- import "../devframe-DJMg0WLe.mjs";
1
+ import "../devframe-BlLEZR-x.mjs";
2
2
  import "../index-tdrk1bzV.mjs";
3
3
  import { E as Thenable, S as RpcFunctionSetupResult, c as RpcDump, g as RpcFunctionAgentOptions } from "../types-Djq7CBXh.mjs";
4
4
  import { SimpleSchema } from "../utils/simple-schema.mjs";
@@ -1,5 +1,5 @@
1
- import { g as DevframeNodeContext, u as DevframeAuthHandler } from "../devframe-DJMg0WLe.mjs";
2
- import "../index-CB-fSUyn.mjs";
1
+ import { g as DevframeNodeContext, u as DevframeAuthHandler } from "../devframe-BlLEZR-x.mjs";
2
+ import "../index-BKFT9-jA.mjs";
3
3
  //#region src/recipes/interactive-auth.d.ts
4
4
  interface CreateInteractiveAuthOptions {
5
5
  /**
@@ -1,8 +1,8 @@
1
1
  import { s as colors } from "../nostics-CzECRXpE.mjs";
2
2
  import { n as defineRpcFunction } from "../define-BLWPsH6y.mjs";
3
3
  import { isAnonymousRpcMethod } from "../constants.mjs";
4
- import { a as verifyAuthToken, n as exchangeTempAuthCode, r as getTempAuthCode, t as buildOtpAuthUrl } from "../state-Cc1IeSmQ.mjs";
5
- import { t as getInternalContext } from "../context-xdynGSLP.mjs";
4
+ import { a as verifyAuthToken, n as exchangeTempAuthCode, r as getTempAuthCode, t as buildOtpAuthUrl } from "../state-CK9LjrnT.mjs";
5
+ import { t as getInternalContext } from "../context-CXhjygJU.mjs";
6
6
  import { t as s } from "../simple-schema-DQPZrAaZ.mjs";
7
7
  //#region src/recipes/interactive-auth.ts
8
8
  function defaultBanner(info) {
@@ -1,13 +1,13 @@
1
- import { t as diagnostics } from "./diagnostics-DOQPnQmX.mjs";
1
+ import { t as diagnostics } from "./diagnostics-Di8ytitn.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { isatty } from "node:tty";
4
4
  import { formatWithOptions, inspect } from "node:util";
5
+ import { dirname, extname, join, normalize, sep } from "pathe";
5
6
  import { createReadStream, existsSync } from "node:fs";
6
7
  import { Buffer } from "node:buffer";
7
8
  import { mkdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
8
9
  import { Readable } from "node:stream";
9
10
  import { lookup } from "mrmime";
10
- import { dirname, extname, join, normalize, sep } from "pathe";
11
11
  //#region ../../node_modules/.pnpm/obug@2.1.4/node_modules/obug/dist/core.js
12
12
  /**
13
13
  * Coerce `value`.
@@ -315,9 +315,10 @@ const CACHE_CONTROL_HEADER = "no-store";
315
315
  function flattenTree(nodes, style) {
316
316
  const out = [];
317
317
  const walk = (list, prefix) => {
318
- for (const node of list) if (style === "path") if (node.type === "file") out.push((node.path ?? "").replace(/^\//, ""));
319
- else walk(node.files ?? [], "");
320
- else if (node.type === "file") out.push(prefix + (node.name ?? ""));
318
+ for (const node of list) if (style === "path") {
319
+ if (node.type === "file") out.push((node.path ?? "").replace(/^\//, ""));
320
+ else walk(node.files ?? [], "");
321
+ } else if (node.type === "file") out.push(prefix + (node.name ?? ""));
321
322
  else if (node.files) walk(node.files, `${prefix}${node.name}/`);
322
323
  };
323
324
  walk(nodes, "");
@@ -1,3 +1,4 @@
1
+ import { t as DEVFRAME_EVENTS } from "./events-DKfSmoTj.mjs";
1
2
  //#region src/node/auth/revoke.ts
2
3
  /**
3
4
  * Flip `isTrusted` to false on any live WS clients connected with `token`
@@ -16,7 +17,7 @@ async function revokeActiveConnectionsForToken(context, token) {
16
17
  }
17
18
  if (affectedSessionIds.size === 0) return;
18
19
  await rpcHost.broadcast({
19
- method: "devframe:auth:revoked",
20
+ method: DEVFRAME_EVENTS.broadcast.authRevoked,
20
21
  args: [],
21
22
  filter: (client) => affectedSessionIds.has(client.$meta.id)
22
23
  });
@@ -26,7 +26,7 @@ var __copyProps = (to, from, except, desc) => {
26
26
  }
27
27
  return to;
28
28
  };
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
30
30
  value: mod,
31
31
  enumerable: true
32
32
  }) : target, mod));
@@ -1,5 +1,5 @@
1
1
  import { n as WsOriginRegistry } from "../../ws-server-D1d3QM9f.mjs";
2
- import { t as ContextRpcServer } from "../../rpc-core-Cc4lucI0.mjs";
2
+ import { t as ContextRpcServer } from "../../rpc-core-CR8o34O9.mjs";
3
3
  //#region src/rpc/transports/ws-bun.d.ts
4
4
  interface AttachBunWsTransportOptions {
5
5
  /** Same contract as `WsRpcTransportOptions.allowedOrigins`. */
@@ -1,6 +1,6 @@
1
- import { K as DevframeRpcClientFunctions, R as DevframeNodeRpcSession, g as DevframeNodeContext, q as DevframeRpcServerFunctions, u as DevframeAuthHandler } from "./devframe-DJMg0WLe.mjs";
1
+ import { E as DevframeRpcServerFunctions, T as DevframeRpcClientFunctions, _ as DevframeNodeRpcSession, g as DevframeNodeContext, u as DevframeAuthHandler } from "./devframe-BlLEZR-x.mjs";
2
2
  import { d as DevframeRpcConnection, u as DevframeNodeRpcSessionMeta } from "./ws-server-D1d3QM9f.mjs";
3
- import "./index-CB-fSUyn.mjs";
3
+ import "./index-BKFT9-jA.mjs";
4
4
  import { BirpcGroup, EventOptions } from "birpc";
5
5
  //#region src/node/rpc-core.d.ts
6
6
  interface CreateContextRpcServerOptions {
@@ -1,6 +1,6 @@
1
- import { n as __exportAll } from "./rolldown-runtime-JspESFgx.mjs";
1
+ import { n as __exportAll } from "./rolldown-runtime-B4iAMlE-.mjs";
2
2
  import { createRpcServer } from "./rpc/server.mjs";
3
- import { t as diagnostics } from "./diagnostics-DOQPnQmX.mjs";
3
+ import { t as diagnostics } from "./diagnostics-Di8ytitn.mjs";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  //#region src/node/rpc-core.ts
6
6
  var rpc_core_exports = /* @__PURE__ */ __exportAll({ createContextRpcServer: () => createContextRpcServer });
@@ -58,14 +58,21 @@ function createContextRpcServer(options) {
58
58
  return { isTrusted: true };
59
59
  }
60
60
  });
61
- const onConnected = authHandler || options.onPeerConnect ? (connection, meta) => {
61
+ const onConnected = (connection, meta) => {
62
+ Promise.resolve().then(() => context.services.ready?.()).catch((error) => {
63
+ const reason = error instanceof Error ? error.message : String(error);
64
+ diagnostics.DF0071({
65
+ reason,
66
+ cause: error
67
+ }, { method: "error" });
68
+ });
62
69
  const session = {
63
70
  meta,
64
71
  rpc: rpcGroup.clients.find((client) => client.$meta === meta)
65
72
  };
66
73
  authHandler?.onConnect(connection, session);
67
74
  options.onPeerConnect?.(connection, session);
68
- } : void 0;
75
+ };
69
76
  const onDisconnected = (connection, meta) => {
70
77
  options.onPeerDisconnect?.(connection, meta);
71
78
  rpcHost._emitSessionDisconnected(meta);
@@ -1191,7 +1191,7 @@ const TEMP_AUTH_CODE_LENGTH = 6;
1191
1191
  * 6-digit code only has ~20 bits of entropy, so a short lifetime plus the
1192
1192
  * attempt cap below are what keep it brute-force resistant.
1193
1193
  */
1194
- const TEMP_AUTH_CODE_TTL = 5 * 6e4;
1194
+ const TEMP_AUTH_CODE_TTL = 3e5;
1195
1195
  /** Failed attempts allowed against a single code before it is rotated. */
1196
1196
  const TEMP_AUTH_MAX_ATTEMPTS = 5;
1197
1197
  let tempAuthCode = generateTempCode();
@@ -1,8 +1,8 @@
1
- import { t as diagnostics } from "./diagnostics-DOQPnQmX.mjs";
1
+ import { t as diagnostics } from "./diagnostics-Di8ytitn.mjs";
2
2
  import { createSharedState } from "devframe/utils/shared-state";
3
- import fs from "node:fs";
4
- import { dirname } from "pathe";
5
3
  import process from "node:process";
4
+ import { dirname } from "pathe";
5
+ import fs from "node:fs";
6
6
  //#region ../../node_modules/.pnpm/perfect-debounce@2.1.0/node_modules/perfect-debounce/dist/index.mjs
7
7
  const DEBOUNCE_DEFAULTS = { trailing: true };
8
8
  /**