busabase-sdk 0.30.0 → 0.40.0

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.
@@ -24,7 +24,15 @@ declare const BUSABASE_AIRAPP_RUNTIME_ENV = "BUSABASE_AIRAPP_RUNTIME";
24
24
  * So the list names runtimes; {@link isBusabaseAirAppHosted} decides hosting,
25
25
  * from presence alone, and needs no upgrade to stay correct.
26
26
  */
27
- declare const BUSABASE_AIRAPP_RUNTIMES: readonly ["nodepod", "local", "srt", "sandock", "embed"];
27
+ declare const BUSABASE_AIRAPP_RUNTIMES: readonly ["browser", "local", "remote", "embed"];
28
+ /**
29
+ * Names Busabase has emitted in the past and may still be emitting to an app
30
+ * pinned to an older deployment. Kept separate from the list above so the
31
+ * current vocabulary stays readable, and exported so an app that genuinely
32
+ * wants to branch (a demo that prints where it is running, say) can normalise
33
+ * instead of growing its own if-chain. Nothing here gates `hosted`.
34
+ */
35
+ declare const BUSABASE_AIRAPP_RUNTIME_ALIASES: Record<string, BusabaseAirAppRuntime>;
28
36
  type BusabaseAirAppRuntime = (typeof BUSABASE_AIRAPP_RUNTIMES)[number];
29
37
  /** Read the injected runtime, normalised. `""` means nobody hosted this process. */
30
38
  declare const readBusabaseAirAppRuntime: (env?: Record<string, string | undefined>) => string;
@@ -141,4 +149,4 @@ declare class BusabaseAirAppLocalGateway {
141
149
  }
142
150
  declare const createBusabaseAirAppLocalGateway: (options: BusabaseAirAppLocalGatewayOptions) => BusabaseAirAppLocalGateway;
143
151
  //#endregion
144
- export { BUSABASE_AIRAPP_GATEWAY_REASONS, BUSABASE_AIRAPP_RUNTIMES, BUSABASE_AIRAPP_RUNTIME_ENV, BusabaseAirAppAuthStatus, BusabaseAirAppLocalGateway, BusabaseAirAppLocalGatewayOptions, BusabaseAirAppRuntime, BusabaseAirAppRuntimeReport, asKnownBusabaseAirAppRuntime, createBusabaseAirAppLocalGateway, describeBusabaseAirAppRuntime, isBusabaseAirAppHosted, readBusabaseAirAppRuntime };
152
+ export { BUSABASE_AIRAPP_GATEWAY_REASONS, BUSABASE_AIRAPP_RUNTIMES, BUSABASE_AIRAPP_RUNTIME_ALIASES, BUSABASE_AIRAPP_RUNTIME_ENV, BusabaseAirAppAuthStatus, BusabaseAirAppLocalGateway, BusabaseAirAppLocalGatewayOptions, BusabaseAirAppRuntime, BusabaseAirAppRuntimeReport, asKnownBusabaseAirAppRuntime, createBusabaseAirAppLocalGateway, describeBusabaseAirAppRuntime, isBusabaseAirAppHosted, readBusabaseAirAppRuntime };
@@ -29,12 +29,24 @@ const BUSABASE_AIRAPP_RUNTIME_ENV = "BUSABASE_AIRAPP_RUNTIME";
29
29
  * from presence alone, and needs no upgrade to stay correct.
30
30
  */
31
31
  const BUSABASE_AIRAPP_RUNTIMES = [
32
- "nodepod",
32
+ "browser",
33
33
  "local",
34
- "srt",
35
- "sandock",
34
+ "remote",
36
35
  "embed"
37
36
  ];
37
+ /**
38
+ * Names Busabase has emitted in the past and may still be emitting to an app
39
+ * pinned to an older deployment. Kept separate from the list above so the
40
+ * current vocabulary stays readable, and exported so an app that genuinely
41
+ * wants to branch (a demo that prints where it is running, say) can normalise
42
+ * instead of growing its own if-chain. Nothing here gates `hosted`.
43
+ */
44
+ const BUSABASE_AIRAPP_RUNTIME_ALIASES = {
45
+ nodepod: "browser",
46
+ sandock: "remote",
47
+ "local-node": "local",
48
+ srt: "local"
49
+ };
38
50
  /** Read the injected runtime, normalised. `""` means nobody hosted this process. */
39
51
  const readBusabaseAirAppRuntime = (env = process.env) => (env["BUSABASE_AIRAPP_RUNTIME"] || "").trim();
40
52
  /**
@@ -54,7 +66,10 @@ const isBusabaseAirAppHosted = (runtime = readBusabaseAirAppRuntime()) => runtim
54
66
  * predates is normal, not an error, and the caller should fall back to generic
55
67
  * behaviour rather than break.
56
68
  */
57
- const asKnownBusabaseAirAppRuntime = (runtime) => BUSABASE_AIRAPP_RUNTIMES.includes(runtime) ? runtime : null;
69
+ const asKnownBusabaseAirAppRuntime = (runtime) => {
70
+ const resolved = BUSABASE_AIRAPP_RUNTIME_ALIASES[runtime] ?? runtime;
71
+ return BUSABASE_AIRAPP_RUNTIMES.includes(resolved) ? resolved : null;
72
+ };
58
73
  /**
59
74
  * Build the `__airapp/runtime` body.
60
75
  *
@@ -448,4 +463,4 @@ var BusabaseAirAppLocalGateway = class {
448
463
  };
449
464
  const createBusabaseAirAppLocalGateway = (options) => new BusabaseAirAppLocalGateway(options);
450
465
  //#endregion
451
- export { BUSABASE_AIRAPP_GATEWAY_REASONS, BUSABASE_AIRAPP_RUNTIMES, BUSABASE_AIRAPP_RUNTIME_ENV, BusabaseAirAppLocalGateway, asKnownBusabaseAirAppRuntime, createBusabaseAirAppLocalGateway, describeBusabaseAirAppRuntime, isBusabaseAirAppHosted, readBusabaseAirAppRuntime };
466
+ export { BUSABASE_AIRAPP_GATEWAY_REASONS, BUSABASE_AIRAPP_RUNTIMES, BUSABASE_AIRAPP_RUNTIME_ALIASES, BUSABASE_AIRAPP_RUNTIME_ENV, BusabaseAirAppLocalGateway, asKnownBusabaseAirAppRuntime, createBusabaseAirAppLocalGateway, describeBusabaseAirAppRuntime, isBusabaseAirAppHosted, readBusabaseAirAppRuntime };
package/dist/airapp.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as BusabaseClient } from "./client-CVz2pqrF.js";
1
+ import { t as BusabaseClient } from "./client-CWlHll4H.js";
2
2
  //#region src/airapp.d.ts
3
3
  type NodeChangeRequestInput = Parameters<BusabaseClient["nodes"]["createChangeRequest"]>[0];
4
4
  type NodeOperationInput = NodeChangeRequestInput["operations"][number];