devframe 0.8.2 → 0.9.0-beta.10

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 (127) hide show
  1. package/dist/_shared-BPmX9fqK.d.mts +41 -0
  2. package/dist/_shared-CbZ_yhbz.mjs +68 -0
  3. package/dist/adapters/build.d.mts +10 -12
  4. package/dist/adapters/build.mjs +26 -29
  5. package/dist/adapters/cac.d.mts +1 -1
  6. package/dist/adapters/cac.mjs +156 -1
  7. package/dist/adapters/dev.d.mts +38 -46
  8. package/dist/adapters/dev.mjs +2 -1
  9. package/dist/adapters/embedded.d.mts +1 -1
  10. package/dist/adapters/initiate.d.mts +224 -0
  11. package/dist/adapters/initiate.mjs +2 -0
  12. package/dist/adapters/mcp.d.mts +24 -7
  13. package/dist/adapters/mcp.mjs +2 -2
  14. package/dist/{agent-tool-name-C3b5vEwJ.mjs → agent-tool-name-EgfoFO8C.mjs} +0 -3
  15. package/dist/cli/main.d.mts +0 -2
  16. package/dist/cli/main.mjs +4 -8
  17. package/dist/client/index.d.mts +71 -7
  18. package/dist/client/index.mjs +720 -1540
  19. package/dist/constants.d.mts +28 -7
  20. package/dist/constants.mjs +28 -7
  21. package/dist/{context-DoSozfvx.d.mts → context-B3YUu_95.d.mts} +19 -1
  22. package/dist/{host-h3-D2hYZvDK.mjs → context-CEe4PBz1.mjs} +25 -557
  23. package/dist/{context-CBg8iRbQ.mjs → context-xdynGSLP.mjs} +10 -1
  24. package/dist/dev--rAPzbvO.mjs +239 -0
  25. package/dist/{devframe-mQ4qZAuo.d.mts → devframe-DJMg0WLe.d.mts} +181 -134
  26. package/dist/{diagnostics-hwjXp_UV.mjs → diagnostics-CD8nlgll.mjs} +1 -3
  27. package/dist/{diagnostics-D7wM2cwM.mjs → diagnostics-DOQPnQmX.mjs} +51 -5
  28. package/dist/dist-eNI9qM_I.mjs +228 -0
  29. package/dist/host-agent-xLCSe65D.mjs +264 -0
  30. package/dist/host-h3-Crkzm42q.mjs +26 -0
  31. package/dist/{fetch-BKaD0Vb3.mjs → http-DYpK0cUi.mjs} +42 -11
  32. package/dist/{index-b64Uuhy2.d.mts → index-CB-fSUyn.d.mts} +2 -2
  33. package/dist/{index-Dbw1p5ch.d.mts → index-tdrk1bzV.d.mts} +3 -32
  34. package/dist/index.d.mts +12 -5
  35. package/dist/index.mjs +8 -1
  36. package/dist/{instance-registry-BnnA2Eoh.mjs → instance-registry-WvQkt42E.mjs} +9 -8
  37. package/dist/instance-shell-CMFyszWJ.mjs +486 -0
  38. package/dist/instance-shell-CljiKq1c.d.mts +255 -0
  39. package/dist/internal/index.d.mts +397 -0
  40. package/dist/internal/index.mjs +9 -0
  41. package/dist/node/auth.d.mts +2 -2
  42. package/dist/node/auth.mjs +1 -1
  43. package/dist/node/hub-internals.d.mts +2 -14
  44. package/dist/node/hub-internals.mjs +2 -2
  45. package/dist/node/index.d.mts +4 -268
  46. package/dist/node/index.mjs +3 -5
  47. package/dist/nostics-CzECRXpE.mjs +59 -0
  48. package/dist/nostics-SPGDgHEP.d.mts +33 -0
  49. package/dist/recipes/common-rpc-functions.d.mts +4 -4
  50. package/dist/recipes/interactive-auth.d.mts +3 -3
  51. package/dist/recipes/interactive-auth.mjs +8 -8
  52. package/dist/remote-assets-Bg4gCUZ_.d.mts +123 -0
  53. package/dist/remote-assets-nTTxY2MU.mjs +636 -0
  54. package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
  55. package/dist/rpc/dump.d.mts +77 -1
  56. package/dist/rpc/dump.mjs +1 -1
  57. package/dist/rpc/index.d.mts +3 -3
  58. package/dist/rpc/index.mjs +4 -18
  59. package/dist/rpc/transports/sse-client.d.mts +2 -0
  60. package/dist/rpc/transports/sse-client.mjs +142 -0
  61. package/dist/rpc/transports/sse-server.d.mts +61 -0
  62. package/dist/rpc/transports/sse-server.mjs +209 -0
  63. package/dist/rpc/transports/ws-bun.d.mts +35 -0
  64. package/dist/rpc/transports/ws-bun.mjs +31 -0
  65. package/dist/rpc/transports/ws-client.d.mts +1 -1
  66. package/dist/rpc/transports/ws-client.mjs +10 -18
  67. package/dist/rpc/transports/ws-server.d.mts +2 -2
  68. package/dist/rpc/transports/ws-server.mjs +2 -235
  69. package/dist/rpc-core-Cc4lucI0.d.mts +48 -0
  70. package/dist/rpc-core-DMTe-hLo.mjs +81 -0
  71. package/dist/{serialization-C8Mnw9hK.mjs → serialization-BGzEwAdr.mjs} +2 -2
  72. package/dist/{shared-state-6kHolYZy.mjs → shared-state-fRRbRUtD.mjs} +1 -1
  73. package/dist/sse-client-CFBOIaUi.d.mts +37 -0
  74. package/dist/state-Cc1IeSmQ.mjs +1291 -0
  75. package/dist/{dump-CgZShDRB.mjs → static-BPZ1_OPA.mjs} +3 -266
  76. package/dist/storage-CYye7P7L.mjs +137 -0
  77. package/dist/types/index.d.mts +6 -4
  78. package/dist/types/index.mjs +1 -6
  79. package/dist/{types-CnJSgRVa.d.mts → types-Djq7CBXh.d.mts} +0 -7
  80. package/dist/utils/agent-tool-name.d.mts +0 -3
  81. package/dist/utils/agent-tool-name.mjs +0 -3
  82. package/dist/utils/events.d.mts +1 -1
  83. package/dist/utils/get-port.d.mts +17 -0
  84. package/dist/utils/get-port.mjs +2 -0
  85. package/dist/utils/launch-editor.mjs +1 -25
  86. package/dist/utils/nostics.d.mts +2 -0
  87. package/dist/utils/nostics.mjs +2 -0
  88. package/dist/utils/open.d.mts +2 -10
  89. package/dist/utils/open.mjs +56 -1
  90. package/dist/utils/remote-assets.d.mts +15 -0
  91. package/dist/utils/remote-assets.mjs +2 -0
  92. package/dist/utils/serve-static.d.mts +13 -5
  93. package/dist/utils/serve-static.mjs +119 -9
  94. package/dist/utils/shared-state.d.mts +1 -1
  95. package/dist/utils/shared-state.mjs +1 -1
  96. package/dist/utils/simple-schema.d.mts +101 -1
  97. package/dist/utils/streaming-channel.d.mts +1 -1
  98. package/dist/validation-CpXFB6Dz.mjs +266 -0
  99. package/dist/wire-codec-0K-o5MYW.mjs +56 -0
  100. package/dist/{ws-client-B6Tnr0ic.d.mts → ws-client-DhjNyQo3.d.mts} +7 -2
  101. package/dist/ws-server-BdSLrhxE.mjs +267 -0
  102. package/dist/{ws-server-uKQcClcJ.d.mts → ws-server-D1d3QM9f.d.mts} +90 -9
  103. package/package.json +13 -12
  104. package/skills/devframe/SKILL.md +91 -93
  105. package/dist/_shared-bWRzeSa0.mjs +0 -19
  106. package/dist/adapters/cli.d.mts +0 -11
  107. package/dist/adapters/cli.mjs +0 -6
  108. package/dist/cac-D4_9ok0z.mjs +0 -157
  109. package/dist/dev-Bc49u3qg.mjs +0 -439
  110. package/dist/diagnostics-reporter-CsIG85Q5.mjs +0 -38
  111. package/dist/helpers/vite.d.mts +0 -100
  112. package/dist/helpers/vite.mjs +0 -105
  113. package/dist/http-C4T68YV6.mjs +0 -38
  114. package/dist/index-vAX6bYuc.d.mts +0 -78
  115. package/dist/open-Deb5xmIT.mjs +0 -547
  116. package/dist/recipes/open-helpers.d.mts +0 -6
  117. package/dist/recipes/open-helpers.mjs +0 -6
  118. package/dist/server-CD8XmBXl.mjs +0 -167
  119. package/dist/server-UHWae43Q.d.mts +0 -149
  120. package/dist/simple-schema-BDzLeJDk.d.mts +0 -102
  121. package/dist/state-BeUHDDjk.mjs +0 -108
  122. package/dist/storage-CTNVbuFB.mjs +0 -1122
  123. package/dist/utils/promise.d.mts +0 -8
  124. package/dist/utils/promise.mjs +0 -15
  125. package/dist/utils/scope.d.mts +0 -11
  126. package/dist/utils/scope.mjs +0 -15
  127. package/skills/devframe/templates/spa-devframe.ts +0 -38
@@ -1,5 +1,4 @@
1
- import { C as RpcFunctionType, S as RpcFunctionSetupResult, T as RpcReturnSchema, _ as RpcFunctionDefinition, i as RpcArgsSchema, v as RpcFunctionDefinitionAny, w as RpcFunctionsCollector } from "./types-CnJSgRVa.mjs";
2
- import { a as getDefinitionsWithDumps$1, c as StaticRpcDumpManifest$1, d as StaticRpcDumpManifestValue$1, f as StaticRpcDumpSerialization$1, i as dumpFunctions$1, l as StaticRpcDumpManifestQueryEntry$1, n as serializeDumpError$1, o as StaticRpcDumpCollection$1, p as collectStaticRpcDump$1, r as createClientFromDump$1, s as StaticRpcDumpFile$1, t as reviveDumpError$1, u as StaticRpcDumpManifestStaticEntry$1 } from "./index-vAX6bYuc.mjs";
1
+ import { C as RpcFunctionType, S as RpcFunctionSetupResult, T as RpcReturnSchema, _ as RpcFunctionDefinition, i as RpcArgsSchema, v as RpcFunctionDefinitionAny, w as RpcFunctionsCollector } from "./types-Djq7CBXh.mjs";
3
2
  //#region src/rpc/cache.d.ts
4
3
  interface RpcCacheOptions {
5
4
  functions: string[];
@@ -54,7 +53,7 @@ declare function getRpcHandler<NAME extends string, TYPE extends RpcFunctionType
54
53
  //#endregion
55
54
  //#region src/rpc/serialization.d.ts
56
55
  /**
57
- * Wire format used by the WS RPC transport.
56
+ * Wire format used by the live RPC transports (WebSocket and SSE).
58
57
  *
59
58
  * - **JSON (default, unprefixed):** payload is plain JSON text. Used when
60
59
  * the dispatched method is declared `jsonSerializable: true`. Encoded
@@ -133,32 +132,4 @@ declare function validateDefinitions(definitions: readonly RpcFunctionDefinition
133
132
  */
134
133
  declare function validateDefinition(definition: RpcFunctionDefinitionAny): void;
135
134
  //#endregion
136
- //#region src/rpc/index.d.ts
137
- /** @deprecated Import from `devframe/rpc/dump` instead. */
138
- declare const collectStaticRpcDump: typeof collectStaticRpcDump$1;
139
- /** @deprecated Import from `devframe/rpc/dump` instead. */
140
- declare const createClientFromDump: typeof createClientFromDump$1;
141
- /** @deprecated Import from `devframe/rpc/dump` instead. */
142
- declare const dumpFunctions: typeof dumpFunctions$1;
143
- /** @deprecated Import from `devframe/rpc/dump` instead. */
144
- declare const getDefinitionsWithDumps: typeof getDefinitionsWithDumps$1;
145
- /** @deprecated Import from `devframe/rpc/dump` instead. */
146
- declare const reviveDumpError: typeof reviveDumpError$1;
147
- /** @deprecated Import from `devframe/rpc/dump` instead. */
148
- declare const serializeDumpError: typeof serializeDumpError$1;
149
- /** @deprecated Import from `devframe/rpc/dump` instead. */
150
- type StaticRpcDumpCollection = StaticRpcDumpCollection$1;
151
- /** @deprecated Import from `devframe/rpc/dump` instead. */
152
- type StaticRpcDumpFile = StaticRpcDumpFile$1;
153
- /** @deprecated Import from `devframe/rpc/dump` instead. */
154
- type StaticRpcDumpManifest = StaticRpcDumpManifest$1;
155
- /** @deprecated Import from `devframe/rpc/dump` instead. */
156
- type StaticRpcDumpManifestQueryEntry = StaticRpcDumpManifestQueryEntry$1;
157
- /** @deprecated Import from `devframe/rpc/dump` instead. */
158
- type StaticRpcDumpManifestStaticEntry = StaticRpcDumpManifestStaticEntry$1;
159
- /** @deprecated Import from `devframe/rpc/dump` instead. */
160
- type StaticRpcDumpManifestValue = StaticRpcDumpManifestValue$1;
161
- /** @deprecated Import from `devframe/rpc/dump` instead. */
162
- type StaticRpcDumpSerialization = StaticRpcDumpSerialization$1;
163
- //#endregion
164
- export { defineRpcFunction as C, RpcCacheOptions as E, createDefineWrapperWithContext as S, RpcCacheManager as T, validateRpcReturn as _, StaticRpcDumpManifestStaticEntry as a, getRpcHandler as b, collectStaticRpcDump as c, getDefinitionsWithDumps as d, reviveDumpError as f, validateRpcArgs as g, validateDefinitions as h, StaticRpcDumpManifestQueryEntry as i, createClientFromDump as l, validateDefinition as m, StaticRpcDumpFile as n, StaticRpcDumpManifestValue as o, serializeDumpError as p, StaticRpcDumpManifest as r, StaticRpcDumpSerialization as s, StaticRpcDumpCollection as t, dumpFunctions as u, STRUCTURED_CLONE_PREFIX as v, RpcFunctionsCollectorBase as w, getRpcResolvedSetupResult as x, strictJsonStringify as y };
135
+ export { STRUCTURED_CLONE_PREFIX as a, getRpcResolvedSetupResult as c, RpcFunctionsCollectorBase as d, RpcCacheManager as f, validateRpcReturn as i, createDefineWrapperWithContext as l, validateDefinitions as n, strictJsonStringify as o, RpcCacheOptions as p, validateRpcArgs as r, getRpcHandler as s, validateDefinition as t, defineRpcFunction as u };
package/dist/index.d.mts CHANGED
@@ -1,8 +1,15 @@
1
- import { $ as DevframeRpcServerFunctions, A as DevframeSettingsStore, At as DevframeAgentHostEvents, B as DevframeDefineDiagnosticsOptions, C as DevframeServicesHost, Ct as AgentResourceContent, D as DevframeScopedStreamingHost, Dt as AgentToolProvider, E as DevframeScopedNodeRpc, Et as AgentToolInput, F as ScopedSharedStates, G as RpcBroadcastOptions, H as DevframeDiagnosticsHost, I as SettingsForNamespace, J as RpcSharedStateHost, K as RpcFunctionsHost, L as DevframeViewHost, M as ScopedClientFunctions, Mt as EventUnsubscribe, N as ScopedRpcFn, Nt as EventsMap, O as DevframeSettings, Ot as AgentToolProviderHandle, P as ScopedServerFunctions, Q as DevframeRpcClientFunctions, R as DevframeHost, S as DevframeServiceOf, St as AgentResource, T as DevframeScopedNodeContext, Tt as AgentTool, U as DevframeDiagnosticsLogger, V as DevframeDiagnosticsDefinition, W as DevframeNodeRpcSession, X as RpcStreamingChannelOptions, Y as RpcStreamingChannel, Z as RpcStreamingHost, _ as ConnectionMeta, a as DevframeDockDefaults, b as DevframeNodeContext, bt as AgentHandle, c as DevframeSetupInfo, d as McpRouteOptions, et as DevframeRpcSharedStates, f as defineDevframe, g as Thenable, h as PartialWithoutId, i as DevframeDeploymentKind, j as ScopedBroadcastOptions, jt as EventEmitter, k as DevframeSettingsRegistry, kt as DevframeAgentHost, l as DevframeSpaOptions, m as EntriesToObject, n as DevframeCliOptions, o as DevframeDuplicationStrategy, q as RpcSharedStateGetOptions, r as DevframeDefinition, s as DevframeRuntime, t as DevframeBrowserContext, u as DevframeWsOptions, v as ConnectionMetaWebsocket, w as DevframeServicesRegistry, wt as AgentResourceInput, x as DevframeServiceId, xt as AgentManifest, y as DevframeCapabilities, z as DevframeStorageScope } from "./devframe-mQ4qZAuo.mjs";
2
- import { C as RpcFunctionType, T as RpcReturnSchema, _ as RpcFunctionDefinition, g as RpcFunctionAgentOptions, i as RpcArgsSchema } from "./types-CnJSgRVa.mjs";
3
- import "./index-Dbw1p5ch.mjs";
4
- import { n as DevframeNodeRpcSessionMeta } from "./ws-server-uKQcClcJ.mjs";
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";
2
+ import "./index-tdrk1bzV.mjs";
3
+ import { C as RpcFunctionType, T as RpcReturnSchema, _ as RpcFunctionDefinition, g as RpcFunctionAgentOptions, i as RpcArgsSchema } from "./types-Djq7CBXh.mjs";
4
+ import { d as DevframeRpcConnection, f as DevframeRpcConnectionRequest, p as DevframeRpcTransportKind, u as DevframeNodeRpcSessionMeta } from "./ws-server-D1d3QM9f.mjs";
5
+ import { i as DevframeDefineDiagnosticsOptions } from "./nostics-SPGDgHEP.mjs";
6
+ import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "./remote-assets-Bg4gCUZ_.mjs";
5
7
  //#region src/define.d.ts
6
8
  declare const defineRpcFunction: <NAME extends string, TYPE extends RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends RpcArgsSchema | undefined = undefined, const RS extends RpcReturnSchema | undefined = undefined>(definition: RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeNodeContext>) => RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeNodeContext>;
9
+ /**
10
+ * Identity helper that types a devframe definition — the primary authoring
11
+ * entry point. Import it from the package root: `import { defineDevframe } from 'devframe'`.
12
+ */
13
+ declare function defineDevframe(d: DevframeDefinition): DevframeDefinition;
7
14
  //#endregion
8
- export { type AgentHandle, type AgentManifest, type AgentResource, type AgentResourceContent, type AgentResourceInput, type AgentTool, type AgentToolInput, type AgentToolProvider, type AgentToolProviderHandle, type ConnectionMeta, type ConnectionMetaWebsocket, type DevframeAgentHost, type DevframeAgentHostEvents, type DevframeBrowserContext, type DevframeCapabilities, type DevframeCliOptions, type DevframeDefineDiagnosticsOptions, type DevframeDefinition, type DevframeDeploymentKind, type DevframeDiagnosticsDefinition, type DevframeDiagnosticsHost, type DevframeDiagnosticsLogger, type DevframeDockDefaults, type DevframeDuplicationStrategy, type DevframeHost, type DevframeNodeContext, type DevframeNodeRpcSession, type DevframeNodeRpcSessionMeta, type DevframeRpcClientFunctions, type DevframeRpcServerFunctions, type DevframeRpcSharedStates, type DevframeRuntime, type DevframeScopedNodeContext, type DevframeScopedNodeRpc, type DevframeScopedStreamingHost, type DevframeServiceId, type DevframeServiceOf, type DevframeServicesHost, type DevframeServicesRegistry, type DevframeSettings, type DevframeSettingsRegistry, type DevframeSettingsStore, type DevframeSetupInfo, type DevframeSpaOptions, type DevframeStorageScope, type DevframeViewHost, type DevframeWsOptions, type EntriesToObject, type EventEmitter, type EventUnsubscribe, type EventsMap, type McpRouteOptions, type PartialWithoutId, type RpcBroadcastOptions, type RpcFunctionAgentOptions, type RpcFunctionsHost, type RpcSharedStateGetOptions, type RpcSharedStateHost, type RpcStreamingChannel, type RpcStreamingChannelOptions, type RpcStreamingHost, type ScopedBroadcastOptions, type ScopedClientFunctions, type ScopedRpcFn, type ScopedServerFunctions, type ScopedSharedStates, type SettingsForNamespace, type Thenable, type 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 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 };
package/dist/index.mjs CHANGED
@@ -1,5 +1,12 @@
1
1
  import { t as createDefineWrapperWithContext } from "./define-BLWPsH6y.mjs";
2
2
  //#region src/define.ts
3
3
  const defineRpcFunction = createDefineWrapperWithContext();
4
+ /**
5
+ * Identity helper that types a devframe definition — the primary authoring
6
+ * entry point. Import it from the package root: `import { defineDevframe } from 'devframe'`.
7
+ */
8
+ function defineDevframe(d) {
9
+ return d;
10
+ }
4
11
  //#endregion
5
- export { defineRpcFunction };
12
+ export { defineDevframe, defineRpcFunction };
@@ -1,9 +1,16 @@
1
- import { t as diagnostics } from "./diagnostics-D7wM2cwM.mjs";
1
+ import { n as __exportAll } from "./rolldown-runtime-JspESFgx.mjs";
2
+ import { t as diagnostics } from "./diagnostics-DOQPnQmX.mjs";
2
3
  import { mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
3
4
  import { join } from "pathe";
4
5
  import process from "node:process";
5
6
  import { homedir } from "node:os";
6
7
  //#region src/node/instance-registry.ts
8
+ var instance_registry_exports = /* @__PURE__ */ __exportAll({
9
+ listLiveDevframeInstances: () => listLiveDevframeInstances,
10
+ probeDevframeOrigin: () => probeDevframeOrigin,
11
+ readDevframeInstances: () => readDevframeInstances,
12
+ registerDevframeInstance: () => registerDevframeInstance
13
+ });
7
14
  /** Environment variable overriding the registry directory (tests, CI). */
8
15
  const DEVFRAME_INSTANCES_DIR_ENV = "DEVFRAME_INSTANCES_DIR";
9
16
  /** Environment variable disabling instance registration entirely. */
@@ -35,8 +42,6 @@ function isRegistryDisabled() {
35
42
  * crash are pruned by readers whose liveness probe fails. Registration never
36
43
  * throws — a write failure degrades to a coded warning (`DF0045`), since a
37
44
  * dev server must not die over discovery metadata.
38
- *
39
- * @experimental
40
45
  */
41
46
  function registerDevframeInstance(record, options = {}) {
42
47
  const dir = resolveInstancesDir(options.instancesDir);
@@ -71,8 +76,6 @@ function registerDevframeInstance(record, options = {}) {
71
76
  /**
72
77
  * Read every record in the registry directory, dropping unparseable files.
73
78
  * Liveness is the caller's concern — see {@link probeDevframeInstance}.
74
- *
75
- * @experimental
76
79
  */
77
80
  function readDevframeInstances(options = {}) {
78
81
  const dir = resolveInstancesDir(options.instancesDir);
@@ -148,8 +151,6 @@ async function probeDevframeInstance(record, options = {}) {
148
151
  * records left behind by killed processes shadow the server currently bound
149
152
  * there: per `(port, basePath)` only the newest record survives, older
150
153
  * ghosts are pruned with the dead.
151
- *
152
- * @experimental
153
154
  */
154
155
  async function listLiveDevframeInstances(options = {}) {
155
156
  const dir = resolveInstancesDir(options.instancesDir);
@@ -187,4 +188,4 @@ async function listLiveDevframeInstances(options = {}) {
187
188
  };
188
189
  }
189
190
  //#endregion
190
- export { probeDevframeOrigin as n, registerDevframeInstance as r, listLiveDevframeInstances as t };
191
+ export { registerDevframeInstance as i, listLiveDevframeInstances as n, probeDevframeOrigin as r, instance_registry_exports as t };
@@ -0,0 +1,486 @@
1
+ import "./constants.mjs";
2
+ import { t as diagnostics } from "./diagnostics-DOQPnQmX.mjs";
3
+ import { t as getInternalContext } from "./context-xdynGSLP.mjs";
4
+ import { createInteractiveAuth } from "./recipes/interactive-auth.mjs";
5
+ import { createServer } from "node:http";
6
+ import process from "node:process";
7
+ import { isIP } from "node:net";
8
+ import { joinURL, withLeadingSlash, withoutLeadingSlash, withoutTrailingSlash } from "ufo";
9
+ import { H3, defineHandler, toNodeHandler } from "h3";
10
+ //#region src/node/utils.ts
11
+ const NON_DIALABLE_HOSTS = /* @__PURE__ */ new Set([
12
+ "0.0.0.0",
13
+ "127.0.0.1",
14
+ "::",
15
+ "0000:0000:0000:0000:0000:0000:0000:0000",
16
+ ""
17
+ ]);
18
+ /** Map a bind host to a host a client can actually connect to. */
19
+ function toDialableHost(host) {
20
+ return NON_DIALABLE_HOSTS.has(host) ? "localhost" : host;
21
+ }
22
+ /** Format a bind host for use in a URL authority (dialable, IPv6-bracketed). */
23
+ function formatHostForUrl(host) {
24
+ const dialable = toDialableHost(host);
25
+ return isIP(dialable) === 6 ? `[${dialable}]` : dialable;
26
+ }
27
+ function normalizeHttpServerUrl(host, port) {
28
+ return `http://${formatHostForUrl(host)}:${port}`;
29
+ }
30
+ //#endregion
31
+ //#region src/node/instance-shell.ts
32
+ /**
33
+ * Compose an h3 + WebSocket RPC server for a devframe context — the low-level
34
+ * "listen on a port (or share one) + attach the WS transport" binding the
35
+ * side-car and shared-server tiers below are built on. Owns and listens on a
36
+ * fresh `node:http` server unless `server` is supplied, in which case it only
37
+ * attaches the upgrade listener and leaves that server's lifecycle to its
38
+ * owner.
39
+ */
40
+ async function bindHttpAndWs(options) {
41
+ const { context, port, core } = options;
42
+ const bindHost = options.host;
43
+ const app = new H3();
44
+ const ownsHttpServer = !options.server;
45
+ const httpServer = options.server ?? createServer(toNodeHandler(app));
46
+ const rpcHost = context.rpc;
47
+ const websocket = options.websocket !== false;
48
+ let ws;
49
+ let closeWs = async () => {};
50
+ if (websocket) {
51
+ const { attachWsRpcTransport } = await import("./rpc/transports/ws-server.mjs");
52
+ const transport = attachWsRpcTransport(core.rpcGroup, {
53
+ server: httpServer,
54
+ path: options.path,
55
+ destroyUnmatched: options.destroyUnmatched ?? ownsHttpServer,
56
+ allowedOrigins: options.allowedOrigins,
57
+ onConnected: core.onConnected,
58
+ onDisconnected: core.onDisconnected
59
+ });
60
+ ws = transport.ws;
61
+ closeWs = transport.close;
62
+ }
63
+ if (ownsHttpServer) try {
64
+ await new Promise((resolve, reject) => {
65
+ const onError = (error) => reject(error);
66
+ httpServer.once("error", onError);
67
+ httpServer.listen(port, bindHost, () => {
68
+ httpServer.removeListener("error", onError);
69
+ resolve();
70
+ });
71
+ });
72
+ } catch (error) {
73
+ await closeWs().catch(() => {});
74
+ throw diagnostics.DF0052({
75
+ host: bindHost,
76
+ port,
77
+ reason: error instanceof Error ? error.message : String(error),
78
+ cause: error
79
+ });
80
+ }
81
+ const address = httpServer.address();
82
+ const resolvedPort = typeof address === "object" && address ? address.port : port;
83
+ const origin = normalizeHttpServerUrl(bindHost, resolvedPort);
84
+ const internal = getInternalContext(context);
85
+ const wsUrl = `ws://${formatHostForUrl(bindHost)}:${resolvedPort}${options.path ?? ""}`;
86
+ if (websocket) internal.setWsEndpoint({ url: wsUrl });
87
+ function connectionMeta() {
88
+ const jsonSerializableMethods = [];
89
+ for (const def of rpcHost.definitions.values()) if (def.jsonSerializable === true) jsonSerializableMethods.push(def.name);
90
+ return {
91
+ backend: "websocket",
92
+ websocket: { path: options.path },
93
+ jsonSerializableMethods
94
+ };
95
+ }
96
+ return {
97
+ origin,
98
+ port: resolvedPort,
99
+ app,
100
+ ws,
101
+ rpcGroup: core.rpcGroup,
102
+ connectionMeta,
103
+ async close() {
104
+ await closeWs();
105
+ if (ownsHttpServer) await new Promise((r) => httpServer.close(() => r()));
106
+ if (websocket && getInternalContext(context).wsEndpoint?.url === wsUrl) getInternalContext(context).setWsEndpoint(void 0);
107
+ }
108
+ };
109
+ }
110
+ /**
111
+ * Translate the public `register?: boolean | Partial<DevframeInstanceRecord>`
112
+ * option into a shell {@link InstanceRegisterConfig}, or `undefined` when
113
+ * registration is opted out. The object form supplies record overrides on top
114
+ * of the caller-provided identity defaults.
115
+ */
116
+ function resolveInstanceRegister(option, defaults) {
117
+ if (!option) return void 0;
118
+ return {
119
+ id: defaults.id,
120
+ ...defaults.name !== void 0 ? { name: defaults.name } : {},
121
+ ...defaults.rootDir !== void 0 ? { rootDir: defaults.rootDir } : {},
122
+ ...typeof option === "object" ? { overrides: option } : {}
123
+ };
124
+ }
125
+ /** Compare two URL paths ignoring a trailing slash. */
126
+ function samePath(a, b) {
127
+ return withoutTrailingSlash(a) === withoutTrailingSlash(b);
128
+ }
129
+ /**
130
+ * Copy a web `Response` from a fetch-style transport handler onto the h3
131
+ * event's response and return its body — mirroring the MCP route's bridge.
132
+ * Returning the body (a `ReadableStream`, or `''` for an empty one — h3
133
+ * middleware only falls through on `undefined`) terminates the chain with
134
+ * the status/headers set here instead of continuing to the SPA catch-all.
135
+ */
136
+ function respondWith(event, response) {
137
+ event.res.status = response.status;
138
+ event.res.statusText = response.statusText;
139
+ response.headers.forEach((value, key) => {
140
+ event.res.headers.set(key, value);
141
+ });
142
+ return response.body ?? "";
143
+ }
144
+ /**
145
+ * The shared machinery behind `initDevframe` and `initHub`: one mount base,
146
+ * one h3 app, one lazily-derived public origin (and the auth banner that waits
147
+ * for it), one WebSocket binding, and the fetch / connect-middleware pair that
148
+ * serves them. Each factory supplies only what makes it itself — its context,
149
+ * its routes, its diagnostics — through `init` / `mount`.
150
+ *
151
+ * Nothing here listens on a port unless a side-car was explicitly requested:
152
+ * the default tier leaves the socket `unbound`, so a host chains it onto its
153
+ * own server through {@link InstanceShell.attach} /
154
+ * {@link InstanceShell.handleUpgrade}.
155
+ *
156
+ * @internal
157
+ */
158
+ function createInstanceShell(options) {
159
+ const base = options.base;
160
+ const baseNoSlash = withoutTrailingSlash(base);
161
+ const app = options.app ?? new H3();
162
+ const wsDisabled = options.ws === false;
163
+ const ws = options.ws === false ? {} : options.ws ?? {};
164
+ const route = withoutLeadingSlash(ws.route ?? "__ws");
165
+ /** Where an upgrade lands on the host's own origin. */
166
+ const routePath = joinURL(base, route);
167
+ /** What `__connection.json` advertises for a same-origin socket. */
168
+ const advertisedPath = options.absoluteWsPath ? routePath : route;
169
+ const sidecarRequested = ws.port != null || ws.sidecar === true;
170
+ const tier = wsDisabled ? "disabled" : sidecarRequested ? "sidecar" : options.server ? "server" : ws.url ? "external" : "unbound";
171
+ const sseEnabled = options.sse !== false && tier !== "external";
172
+ const sseRoute = withoutLeadingSlash((typeof options.sse === "object" ? options.sse.route : void 0) ?? "__sse");
173
+ const sseRoutePath = joinURL(base, sseRoute);
174
+ const advertisedSsePath = options.absoluteWsPath ? sseRoutePath : sseRoute;
175
+ let derivedOrigin;
176
+ function currentOrigin() {
177
+ return (typeof options.origin === "function" ? options.origin() : options.origin) || derivedOrigin;
178
+ }
179
+ let authHandler;
180
+ let bannerPrinted = false;
181
+ function maybePrintBanner() {
182
+ if (bannerPrinted || !authHandler || !currentOrigin()) return;
183
+ bannerPrinted = true;
184
+ authHandler.printBanner();
185
+ }
186
+ let meta;
187
+ let registration;
188
+ let registerPromise;
189
+ /**
190
+ * Publish the instance in the global registry the moment both its origin
191
+ * and connection meta are known — at init end for a pinned origin, or on
192
+ * the first request for a derived one. Registration never throws (the
193
+ * registry writer degrades to a coded warning), so failures never surface.
194
+ */
195
+ function maybeRegister() {
196
+ const cfg = options.register;
197
+ const origin = currentOrigin();
198
+ if (!cfg || registerPromise || !origin || !meta) return;
199
+ const resolvedMeta = meta;
200
+ registerPromise = import("./instance-registry-WvQkt42E.mjs").then((n) => n.t).then(({ registerDevframeInstance }) => {
201
+ let port = 0;
202
+ try {
203
+ const url = new URL(origin);
204
+ port = Number(url.port) || (url.protocol === "https:" ? 443 : 80);
205
+ } catch {}
206
+ registration = registerDevframeInstance({
207
+ pid: process.pid,
208
+ port,
209
+ origin,
210
+ basePath: base,
211
+ id: cfg.id,
212
+ ...cfg.name !== void 0 ? { name: cfg.name } : {},
213
+ rootDir: cfg.rootDir ?? process.cwd(),
214
+ mcp: resolvedMeta.mcp ? { path: joinURL(base, resolvedMeta.mcp.path) } : null,
215
+ startedAt: Date.now(),
216
+ ...cfg.overrides
217
+ });
218
+ }).catch(() => {});
219
+ }
220
+ function noteOrigin(origin) {
221
+ derivedOrigin ??= origin;
222
+ maybePrintBanner();
223
+ maybeRegister();
224
+ }
225
+ let started;
226
+ let transport;
227
+ let dispose;
228
+ let ctx;
229
+ const api = {
230
+ base,
231
+ app,
232
+ origin: currentOrigin,
233
+ connectionMeta: () => meta
234
+ };
235
+ /**
236
+ * Auth resolution: gate by default, `false` opts out, a handler object
237
+ * installs a custom scheme. The `external` tier has no local transport to
238
+ * gate — the server behind `ws.url` owns auth — so it resolves to nothing.
239
+ */
240
+ function resolveAuth() {
241
+ if (options.auth === false) return false;
242
+ if (typeof options.auth === "object") {
243
+ authHandler = options.auth;
244
+ return options.auth;
245
+ }
246
+ authHandler = createInteractiveAuth(ctx);
247
+ return authHandler;
248
+ }
249
+ /**
250
+ * The context's RPC core (birpc group, session lifecycle, auth gate) —
251
+ * one per instance, shared by every transport binding (WS and SSE), so a
252
+ * WS peer and an SSE session live in the same session/broadcast space.
253
+ * Built lazily: an `unbound` host that never wires a transport pays
254
+ * nothing for it, not even the imports. `resolvedAuth` and `ctx` are
255
+ * assigned during `init()` before any caller can reach this.
256
+ */
257
+ let resolvedAuth = false;
258
+ let corePromise;
259
+ function ensureCore() {
260
+ corePromise ??= import("./rpc-core-DMTe-hLo.mjs").then((n) => n.n).then(({ createContextRpcServer }) => createContextRpcServer({
261
+ context: ctx,
262
+ auth: resolvedAuth,
263
+ onPeerConnect: options.onPeerConnect,
264
+ onPeerDisconnect: options.onPeerDisconnect
265
+ }));
266
+ return corePromise;
267
+ }
268
+ /**
269
+ * The SSE transport, built on the first request to its route so an
270
+ * instance nobody dials over SSE never loads it.
271
+ */
272
+ let ssePromise;
273
+ function ensureSse() {
274
+ ssePromise ??= (async () => {
275
+ const [core, { attachSseRpcTransport }] = await Promise.all([ensureCore(), import("./rpc/transports/sse-server.mjs")]);
276
+ return attachSseRpcTransport(core.rpcGroup, {
277
+ allowedOrigins: options.allowedOrigins,
278
+ onConnected: core.onConnected,
279
+ onDisconnected: core.onDisconnected
280
+ });
281
+ })();
282
+ return ssePromise;
283
+ }
284
+ /**
285
+ * A side-car server on its own port. `getPort` probes and the bind can
286
+ * still race (or disagree across the v4/v6 duals of `localhost`), so an
287
+ * auto-port side-car retries on a fresh random port instead of failing
288
+ * init; a pinned `ws.port` is honored as given and fails loudly.
289
+ */
290
+ async function startSidecar(core) {
291
+ const sidecarHost = options.host ?? "localhost";
292
+ const start = (port) => bindHttpAndWs({
293
+ context: ctx,
294
+ core,
295
+ host: sidecarHost,
296
+ port,
297
+ path: withLeadingSlash(route),
298
+ allowedOrigins: options.allowedOrigins
299
+ });
300
+ if (ws.port != null) return await start(ws.port);
301
+ const { getPort } = await import("./dist-eNI9qM_I.mjs").then((n) => n.t);
302
+ let lastError;
303
+ for (let attempt = 0; attempt < 3; attempt++) {
304
+ const port = attempt === 0 && options.resolveSidecarPort ? await options.resolveSidecarPort(sidecarHost) : await getPort({
305
+ random: true,
306
+ host: sidecarHost
307
+ });
308
+ try {
309
+ return await start(port);
310
+ } catch (error) {
311
+ lastError = error;
312
+ }
313
+ }
314
+ throw lastError;
315
+ }
316
+ async function init() {
317
+ const result = await options.init(api);
318
+ ctx = result.context;
319
+ dispose = result.dispose;
320
+ resolvedAuth = tier === "external" ? false : resolveAuth();
321
+ let websocketMeta;
322
+ if (tier === "sidecar") {
323
+ started = await startSidecar(await ensureCore());
324
+ websocketMeta = {
325
+ port: started.port,
326
+ path: route
327
+ };
328
+ } else if (tier === "server") {
329
+ started = await bindHttpAndWs({
330
+ context: ctx,
331
+ core: await ensureCore(),
332
+ host: options.host ?? "localhost",
333
+ port: 0,
334
+ server: options.server,
335
+ path: routePath,
336
+ allowedOrigins: options.allowedOrigins,
337
+ destroyUnmatched: options.destroyUnmatchedUpgrades
338
+ });
339
+ websocketMeta = { path: advertisedPath };
340
+ } else if (tier === "external") websocketMeta = ws.url;
341
+ else if (tier === "unbound") websocketMeta = { path: advertisedPath };
342
+ if (!wsDisabled && ws.url) websocketMeta = ws.url;
343
+ if (sseEnabled) app.use(sseRoutePath, defineHandler(async (event) => respondWith(event, await (await ensureSse()).handler(event.req))));
344
+ meta = {
345
+ backend: wsDisabled ? sseEnabled ? "sse" : "none" : "websocket",
346
+ ...websocketMeta !== void 0 ? { websocket: websocketMeta } : {},
347
+ ...sseEnabled ? { sse: { path: advertisedSsePath } } : {},
348
+ ...result.mcp ? { mcp: result.mcp } : {}
349
+ };
350
+ if (Object.keys(ctx.staticConfig).length > 0) meta.configs = ctx.staticConfig;
351
+ await options.mount?.(ctx, meta, api);
352
+ maybePrintBanner();
353
+ maybeRegister();
354
+ }
355
+ const initPromise = init();
356
+ initPromise.catch(() => {});
357
+ const contextPromise = initPromise.then(() => ctx);
358
+ contextPromise.catch(() => {});
359
+ /**
360
+ * The `unbound` tier: the RPC core and its crossws adapter, bound to
361
+ * nothing. Built on the first `attach` / `handleUpgrade` — a host that
362
+ * never wires the socket (or whose runtime brings its own WS transport)
363
+ * pays nothing for it, not even the adapter's imports.
364
+ */
365
+ let transportPromise;
366
+ function ensureTransport() {
367
+ transportPromise ??= initPromise.then(async () => {
368
+ const [core, { attachWsRpcTransport }] = await Promise.all([ensureCore(), import("./rpc/transports/ws-server.mjs")]);
369
+ transport = attachWsRpcTransport(core.rpcGroup, {
370
+ unbound: true,
371
+ path: routePath,
372
+ allowedOrigins: options.allowedOrigins,
373
+ onConnected: core.onConnected,
374
+ onDisconnected: core.onDisconnected
375
+ });
376
+ return transport;
377
+ });
378
+ return transportPromise;
379
+ }
380
+ async function handleRequest(request) {
381
+ await initPromise;
382
+ noteOrigin(new URL(request.url).origin);
383
+ const response = await app.fetch(request);
384
+ if (response.status === 404) return new Response(null, { status: 404 });
385
+ return response;
386
+ }
387
+ let nodeHandler;
388
+ function nodeMiddleware(req, res, next) {
389
+ let pathname = req.url ?? "/";
390
+ try {
391
+ pathname = new URL(pathname, "http://localhost").pathname;
392
+ } catch {}
393
+ if (!(samePath(pathname, baseNoSlash) || pathname.startsWith(base))) {
394
+ if (next) {
395
+ next();
396
+ return;
397
+ }
398
+ res.statusCode = 404;
399
+ res.end();
400
+ return;
401
+ }
402
+ initPromise.then(async () => {
403
+ const host = req.headers.host;
404
+ if (host) {
405
+ const encrypted = req.socket.encrypted;
406
+ noteOrigin(`${encrypted ? "https" : "http"}://${host}`);
407
+ }
408
+ if (!nodeHandler) {
409
+ const { toNodeHandler } = await import("h3/node");
410
+ nodeHandler = toNodeHandler(app);
411
+ }
412
+ return nodeHandler(req, res);
413
+ }).catch((err) => {
414
+ if (next) {
415
+ next(err);
416
+ return;
417
+ }
418
+ res.statusCode = 500;
419
+ res.end();
420
+ });
421
+ }
422
+ /** The `unbound` tier is the only one whose socket the host may drive. */
423
+ function assertUnbound() {
424
+ if (tier === "disabled") throw diagnostics.DF0057();
425
+ if (tier === "external") throw diagnostics.DF0056({ url: ws.url });
426
+ if (tier !== "unbound") throw diagnostics.DF0055({ tier });
427
+ }
428
+ /**
429
+ * Publish the socket's absolute URL on the context, so surfaces that hand
430
+ * out a complete endpoint (the hub's remote docks) work on this tier too.
431
+ * {@link bindHttpAndWs} does the same for the tiers it owns.
432
+ */
433
+ function publishWsEndpoint(server) {
434
+ const record = () => {
435
+ const address = server.address();
436
+ if (typeof address !== "object" || !address) return;
437
+ const host = options.host ?? (address.address === "::" || address.address === "0.0.0.0" ? "localhost" : address.address);
438
+ getInternalContext(ctx).setWsEndpoint({ url: `ws://${formatHostForUrl(host)}:${address.port}${routePath}` });
439
+ };
440
+ if (server.listening) record();
441
+ else server.once("listening", record);
442
+ }
443
+ function handleUpgrade(req, socket, head) {
444
+ assertUnbound();
445
+ if (transport) {
446
+ transport.handleUpgrade(req, socket, head);
447
+ return;
448
+ }
449
+ ensureTransport().then((live) => live.handleUpgrade(req, socket, head)).catch(() => socket.destroy());
450
+ }
451
+ function attach(server) {
452
+ assertUnbound();
453
+ server.on("upgrade", handleUpgrade);
454
+ ensureTransport().then(() => publishWsEndpoint(server)).catch(() => {});
455
+ return () => server.off("upgrade", handleUpgrade);
456
+ }
457
+ return {
458
+ base,
459
+ handler: handleRequest,
460
+ nodeMiddleware,
461
+ ready: initPromise,
462
+ context: contextPromise,
463
+ connectionMeta: () => meta ?? options.onMetaUnavailable(),
464
+ handleUpgrade,
465
+ attach,
466
+ async close() {
467
+ await initPromise.catch(() => {});
468
+ await registerPromise?.catch(() => {});
469
+ registration?.unregister();
470
+ await dispose?.();
471
+ await ssePromise?.then((live) => live.close()).catch(() => {});
472
+ await started?.close();
473
+ await transportPromise?.then((live) => live.close()).catch(() => {});
474
+ },
475
+ internals: {
476
+ get started() {
477
+ return started;
478
+ },
479
+ get authHandler() {
480
+ return authHandler;
481
+ }
482
+ }
483
+ };
484
+ }
485
+ //#endregion
486
+ export { normalizeHttpServerUrl as i, resolveInstanceRegister as n, samePath as r, createInstanceShell as t };