devframe 0.9.0-beta.9 → 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 (72) hide show
  1. package/dist/_shared-BM3PdYli.mjs +68 -0
  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 -22
  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-Chvlqs7I.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/{_shared-CKZPvSrN.mjs → dist-CZXfGEkd.mjs} +2 -68
  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-8Kpkap4_.mjs → http-BbHCU5Zs.mjs} +9 -6
  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-XvN5USg4.mjs → instance-shell-DbDoozNM.mjs} +5 -5
  35. package/dist/internal/index.d.mts +46 -7
  36. package/dist/internal/index.mjs +8 -8
  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/sse-client.mjs +1 -1
  50. package/dist/rpc/transports/sse-server.mjs +2 -2
  51. package/dist/rpc/transports/ws-bun.d.mts +1 -1
  52. package/dist/rpc/transports/ws-bun.mjs +1 -1
  53. package/dist/rpc/transports/ws-client.mjs +1 -1
  54. package/dist/rpc/transports/ws-server.mjs +1 -1
  55. package/dist/{rpc-core-Cc4lucI0.d.mts → rpc-core-CR8o34O9.d.mts} +2 -2
  56. package/dist/{rpc-core-DMTe-hLo.mjs → rpc-core-Dru9uoM0.mjs} +11 -4
  57. package/dist/{state-Cc1IeSmQ.mjs → state-CK9LjrnT.mjs} +1 -1
  58. package/dist/{storage-CYye7P7L.mjs → storage-D4a99Ung.mjs} +3 -3
  59. package/dist/types/index.d.mts +2 -2
  60. package/dist/utils/events.d.mts +1 -1
  61. package/dist/utils/get-port.d.mts +17 -0
  62. package/dist/utils/get-port.mjs +2 -0
  63. package/dist/utils/launch-editor.mjs +12 -11
  64. package/dist/utils/open.mjs +1 -1
  65. package/dist/utils/remote-assets.mjs +1 -1
  66. package/dist/utils/serve-static.mjs +6 -5
  67. package/dist/utils/shared-state.d.mts +1 -1
  68. package/dist/utils/streaming-channel.d.mts +1 -1
  69. package/dist/{wire-codec-GsoRxIsD.mjs → wire-codec-0K-o5MYW.mjs} +0 -2
  70. package/dist/{ws-server-BiUne4K7.mjs → ws-server-BdSLrhxE.mjs} +1 -1
  71. package/package.json +2 -1
  72. package/dist/{host-h3-Crkzm42q.mjs → host-h3-fRbF9yor.mjs} +1 -1
@@ -1,5 +1,5 @@
1
1
  import { DEVFRAME_AUTH_TOKEN_QUERY_PARAM, DEVFRAME_SSE_SESSION_HEADER } from "../../constants.mjs";
2
- import { t as createRpcWireCodec } from "../../wire-codec-GsoRxIsD.mjs";
2
+ import { t as createRpcWireCodec } from "../../wire-codec-0K-o5MYW.mjs";
3
3
  //#region src/rpc/transports/sse-client.ts
4
4
  function NOOP() {}
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { DEVFRAME_SSE_SESSION_HEADER } from "../../constants.mjs";
2
- import { n as peekRpcWireFrame, t as createRpcWireCodec } from "../../wire-codec-GsoRxIsD.mjs";
3
- import { i as isAllowedOrigin, o as createRpcSessionMeta } from "../../ws-server-BiUne4K7.mjs";
2
+ import { n as peekRpcWireFrame, t as createRpcWireCodec } from "../../wire-codec-0K-o5MYW.mjs";
3
+ import { i as isAllowedOrigin, o as createRpcSessionMeta } from "../../ws-server-BdSLrhxE.mjs";
4
4
  //#region src/rpc/transports/sse-server.ts
5
5
  const SSE_STREAM_HEADERS = {
6
6
  "content-type": "text/event-stream",
@@ -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,4 +1,4 @@
1
- import { i as isAllowedOrigin, r as createWsRpcPeerHooks } from "../../ws-server-BiUne4K7.mjs";
1
+ import { i as isAllowedOrigin, r as createWsRpcPeerHooks } from "../../ws-server-BdSLrhxE.mjs";
2
2
  //#region src/rpc/transports/ws-bun.ts
3
3
  /**
4
4
  * The Bun fetch-upgrade WebSocket tier for `initDevframe` / `initHub` — the
@@ -1,5 +1,5 @@
1
1
  import { DEVFRAME_AUTH_TOKEN_QUERY_PARAM } from "../../constants.mjs";
2
- import { t as createRpcWireCodec } from "../../wire-codec-GsoRxIsD.mjs";
2
+ import { t as createRpcWireCodec } from "../../wire-codec-0K-o5MYW.mjs";
3
3
  //#region src/rpc/transports/ws-client.ts
4
4
  function NOOP() {}
5
5
  const EMPTY_DEFS = /* @__PURE__ */ new Map();
@@ -1,2 +1,2 @@
1
- import { a as isLoopbackHostname, i as isAllowedOrigin, n as createWsOriginRegistry, r as createWsRpcPeerHooks, t as attachWsRpcTransport } from "../../ws-server-BiUne4K7.mjs";
1
+ import { a as isLoopbackHostname, i as isAllowedOrigin, n as createWsOriginRegistry, r as createWsRpcPeerHooks, t as attachWsRpcTransport } from "../../ws-server-BdSLrhxE.mjs";
2
2
  export { attachWsRpcTransport, createWsOriginRegistry, createWsRpcPeerHooks, isAllowedOrigin, isLoopbackHostname };
@@ -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
  /**
@@ -1,6 +1,6 @@
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 { g as RpcFunctionAgentOptions } from "../types-Djq7CBXh.mjs";
3
3
  import { d as DevframeRpcConnection, f as DevframeRpcConnectionRequest, p as DevframeRpcTransportKind, u as DevframeNodeRpcSessionMeta } from "../ws-server-D1d3QM9f.mjs";
4
4
  import { i as DevframeDefineDiagnosticsOptions } from "../nostics-SPGDgHEP.mjs";
5
5
  import { a as RemoteAssetsStore, i as RemoteAssetsProviderCustom, n as RemoteAssetsErrorMessage, o as StaticAssetsSource, r as RemoteAssetsProvider, t as RemoteAssets } from "../remote-assets-Bg4gCUZ_.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, DevframeRpcServerFunctions, DevframeRpcSharedStates, type DevframeRpcTransportKind, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeServiceId, DevframeServiceOf, DevframeServicesHost, DevframeServicesRegistry, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, 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 };
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, DevframeRpcServerFunctions, DevframeRpcSharedStates, type DevframeRpcTransportKind, DevframeScopedNodeContext, DevframeScopedNodeRpc, DevframeScopedStreamingHost, DevframeServiceDefinition, DevframeServiceDescriptor, DevframeServiceId, DevframeServiceInput, DevframeServiceMeta, DevframeServiceOf, DevframeServiceScopeOf, DevframeServicesHost, DevframeServicesRegistry, DevframeServicesScopeRegistry, DevframeServicesState, DevframeSettings, DevframeSettingsRegistry, DevframeSettingsStore, DevframeSetupInfo, 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,4 +1,4 @@
1
- import { Dt as EventsMap, Tt as EventEmitter } from "../devframe-DJMg0WLe.mjs";
1
+ import { Mt as EventEmitter, Pt as EventsMap } from "../devframe-BlLEZR-x.mjs";
2
2
  //#region src/utils/events.d.ts
3
3
  /**
4
4
  * Create event emitter.
@@ -0,0 +1,17 @@
1
+ //#region ../../node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.d.mts
2
+ interface GetPortOptions {
3
+ name: string;
4
+ random: boolean;
5
+ port: number;
6
+ ports: number[];
7
+ portRange: [fromInclusive: number, toInclusive: number];
8
+ alternativePortRange: [fromInclusive: number, toInclusive: number];
9
+ host: string;
10
+ verbose?: boolean;
11
+ public?: boolean;
12
+ }
13
+ type GetPortInput = Partial<GetPortOptions> | number | string;
14
+ type PortNumber = number;
15
+ declare function getPort(_userOptions?: GetPortInput): Promise<PortNumber>;
16
+ //#endregion
17
+ export { type GetPortInput, type GetPortOptions, getPort };
@@ -0,0 +1,2 @@
1
+ import { n as getPort } from "../dist-CZXfGEkd.mjs";
2
+ export { getPort };
@@ -1,4 +1,4 @@
1
- import { i as __toESM, r as __require, t as __commonJSMin } from "../rolldown-runtime-JspESFgx.mjs";
1
+ import { i as __toESM, r as __require, t as __commonJSMin } from "../rolldown-runtime-B4iAMlE-.mjs";
2
2
  //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
3
3
  var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4
4
  let p = process || {};
@@ -269,16 +269,17 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
269
269
  if (esc) {
270
270
  out += c;
271
271
  esc = false;
272
- } else if (quote) if (c === quote) quote = false;
273
- else if (quote == SQ) out += c;
274
- else if (c === BS) {
275
- i += 1;
276
- c = s.charAt(i);
277
- if (c === DQ || c === BS || c === DS) out += c;
278
- else out += BS + c;
279
- } else if (c === DS) out += parseEnvVar();
280
- else out += c;
281
- else if (c === DQ || c === SQ) {
272
+ } else if (quote) {
273
+ if (c === quote) quote = false;
274
+ else if (quote == SQ) out += c;
275
+ else if (c === BS) {
276
+ i += 1;
277
+ c = s.charAt(i);
278
+ if (c === DQ || c === BS || c === DS) out += c;
279
+ else out += BS + c;
280
+ } else if (c === DS) out += parseEnvVar();
281
+ else out += c;
282
+ } else if (c === DQ || c === SQ) {
282
283
  quote = c;
283
284
  sawQuote = true;
284
285
  } else if (controlRE.test(c)) return { op: s };
@@ -1,5 +1,5 @@
1
- import fs from "node:fs";
2
1
  import process from "node:process";
2
+ import fs from "node:fs";
3
3
  import { spawn } from "node:child_process";
4
4
  //#region src/utils/open.ts
5
5
  /**
@@ -1,2 +1,2 @@
1
- import { t as resolveStaticAssetsSource } from "../remote-assets-nTTxY2MU.mjs";
1
+ import { t as resolveStaticAssetsSource } from "../remote-assets-DRfY2RjX.mjs";
2
2
  export { resolveStaticAssetsSource };
@@ -1,9 +1,9 @@
1
- import { DEVFRAME_REMOTE_ASSETS_ERROR_MESSAGE_TYPE } from "../constants.mjs";
1
+ import { t as DEVFRAME_EVENTS } from "../events-DKfSmoTj.mjs";
2
+ import { extname, join, normalize, resolve, sep } from "pathe";
2
3
  import { createReadStream } from "node:fs";
3
4
  import { stat } from "node:fs/promises";
4
5
  import { Readable } from "node:stream";
5
6
  import { lookup } from "mrmime";
6
- import { extname, join, normalize, resolve, sep } from "pathe";
7
7
  import { H3, defineHandler } from "h3";
8
8
  //#region src/utils/serve-static.ts
9
9
  const HTML_EXTENSIONS = [".html", ".htm"];
@@ -231,12 +231,13 @@ function remoteErrorPage(pkg, version, reason) {
231
231
  const esc = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
232
232
  const name = esc(pkg);
233
233
  const ver = esc(version);
234
- const payload = JSON.stringify({
235
- type: DEVFRAME_REMOTE_ASSETS_ERROR_MESSAGE_TYPE,
234
+ const message = {
235
+ type: DEVFRAME_EVENTS.postMessage.remoteAssetsError,
236
236
  package: pkg,
237
237
  version,
238
238
  reason
239
- }).replace(/</g, "\\u003c");
239
+ };
240
+ const payload = JSON.stringify(message).replace(/</g, "\\u003c");
240
241
  return `<!doctype html>
241
242
  <html lang="en">
242
243
  <head>
@@ -1,2 +1,2 @@
1
- import { at as ImmutableArray, ct as ImmutableSet, dt as SharedStateOptions, ft as SharedStatePatch, it as Immutable, lt as SharedState, ot as ImmutableMap, pt as createSharedState, st as ImmutableObject, ut as SharedStateEvents } from "../devframe-DJMg0WLe.mjs";
1
+ import { _t as SharedStateEvents, bt as createSharedState, dt as Immutable, ft as ImmutableArray, gt as SharedState, ht as ImmutableSet, mt as ImmutableObject, pt as ImmutableMap, vt as SharedStateOptions, yt as SharedStatePatch } from "../devframe-BlLEZR-x.mjs";
2
2
  export { Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableSet, SharedState, SharedStateEvents, SharedStateOptions, SharedStatePatch, createSharedState };
@@ -1,2 +1,2 @@
1
- import { $ as StreamReader, Q as StreamErrorPayload, X as CreateStreamReaderOptions, Y as BufferedChunk, Z as CreateStreamSinkOptions, et as StreamSink, nt as createStreamReader, rt as createStreamSink, tt as StreamSinkEvents } from "../devframe-DJMg0WLe.mjs";
1
+ import { at as StreamErrorPayload, ct as StreamSinkEvents, it as CreateStreamSinkOptions, lt as createStreamReader, nt as BufferedChunk, ot as StreamReader, rt as CreateStreamReaderOptions, st as StreamSink, ut as createStreamSink } from "../devframe-BlLEZR-x.mjs";
2
2
  export { BufferedChunk, CreateStreamReaderOptions, CreateStreamSinkOptions, StreamErrorPayload, StreamReader, StreamSink, StreamSinkEvents, createStreamReader, createStreamSink };
@@ -12,7 +12,6 @@ const EMPTY_WIRE_DEFS = /* @__PURE__ */ new Map();
12
12
  * don't collide across connections.
13
13
  *
14
14
  * @internal
15
- * implementations; not part of the stable public API.
16
15
  */
17
16
  function createRpcWireCodec(definitions = EMPTY_WIRE_DEFS) {
18
17
  const pendingRequestMethods = /* @__PURE__ */ new Map();
@@ -41,7 +40,6 @@ function createRpcWireCodec(definitions = EMPTY_WIRE_DEFS) {
41
40
  * handed to birpc proper.
42
41
  *
43
42
  * @internal
44
- * implementations; not part of the stable public API.
45
43
  */
46
44
  function peekRpcWireFrame(raw) {
47
45
  try {
@@ -1,5 +1,5 @@
1
1
  import "./constants.mjs";
2
- import { t as createRpcWireCodec } from "./wire-codec-GsoRxIsD.mjs";
2
+ import { t as createRpcWireCodec } from "./wire-codec-0K-o5MYW.mjs";
3
3
  import { n as randomToken, r as timingSafeEqual } from "./crypto-token-XCqTSMg9.mjs";
4
4
  import { createServer } from "node:http";
5
5
  import { createServer as createServer$1 } from "node:https";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "devframe",
3
3
  "type": "module",
4
- "version": "0.9.0-beta.9",
4
+ "version": "0.9.1",
5
5
  "description": "Framework for building one portable devtool integration that runs in any viewer.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -48,6 +48,7 @@
48
48
  "./utils/colors": "./dist/utils/colors.mjs",
49
49
  "./utils/crypto-token": "./dist/utils/crypto-token.mjs",
50
50
  "./utils/events": "./dist/utils/events.mjs",
51
+ "./utils/get-port": "./dist/utils/get-port.mjs",
51
52
  "./utils/hash": "./dist/utils/hash.mjs",
52
53
  "./utils/launch-editor": "./dist/utils/launch-editor.mjs",
53
54
  "./utils/nanoid": "./dist/utils/nanoid.mjs",
@@ -1,5 +1,5 @@
1
- import { join } from "pathe";
2
1
  import process from "node:process";
2
+ import { join } from "pathe";
3
3
  import { homedir } from "node:os";
4
4
  //#region src/node/host-h3.ts
5
5
  /**