@camstack/system 1.2.69 → 1.2.70

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 (66) hide show
  1. package/dist/addon-runner.js +6 -6
  2. package/dist/addon-runner.mjs +3 -3
  3. package/dist/addon-utils.js +11 -11
  4. package/dist/addon-utils.mjs +1 -1
  5. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +3 -3
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +2 -2
  7. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +3 -3
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +2 -2
  9. package/dist/builtins/alerts/alerts.addon.js +1 -1
  10. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +8 -8
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +6 -6
  13. package/dist/builtins/console-logging/index.js +1 -1
  14. package/dist/builtins/console-logging/index.mjs +1 -1
  15. package/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
  16. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  17. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  18. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  19. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  20. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  21. package/dist/builtins/hub-forwarder/index.js +1 -1
  22. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  23. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  24. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  25. package/dist/builtins/local-auth/index.d.ts +0 -1
  26. package/dist/builtins/local-auth/index.js +0 -1
  27. package/dist/builtins/local-auth/index.mjs +2 -2
  28. package/dist/builtins/local-auth/local-auth.addon.js +129 -173
  29. package/dist/builtins/local-auth/local-auth.addon.mjs +130 -173
  30. package/dist/builtins/local-network/local-network.addon.js +1 -1
  31. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  32. package/dist/builtins/loki-logging/index.js +1 -1
  33. package/dist/builtins/loki-logging/index.mjs +1 -1
  34. package/dist/builtins/native-metrics/native-metrics.addon.js +5 -5
  35. package/dist/builtins/native-metrics/native-metrics.addon.mjs +4 -4
  36. package/dist/builtins/platform-probe/index.js +4 -4
  37. package/dist/builtins/platform-probe/index.mjs +3 -3
  38. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  39. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  40. package/dist/builtins/snapshot/index.js +2 -2
  41. package/dist/builtins/snapshot/index.mjs +2 -2
  42. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +4 -4
  43. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +3 -3
  44. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  45. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  46. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +3 -3
  47. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +2 -2
  48. package/dist/builtins/system-config/system-config.addon.js +1 -1
  49. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  50. package/dist/builtins/winston-logging/index.js +1 -1
  51. package/dist/builtins/winston-logging/index.mjs +1 -1
  52. package/dist/{dist-C-QzFJ8v.mjs → dist-CnQXXnK1.mjs} +60 -1
  53. package/dist/{dist-D7wC-S4p.js → dist-DCLoJf2T.js} +59 -6
  54. package/dist/{model-download-service-CTBHzORJ.mjs → file-data-plane-CuE_hBli.mjs} +848 -848
  55. package/dist/index.d.ts +73 -81
  56. package/dist/index.js +1379 -1346
  57. package/dist/index.mjs +1362 -1328
  58. package/dist/kernel/capability-registry.d.ts +26 -0
  59. package/dist/kernel/config-schema.d.ts +1 -1
  60. package/dist/{manifest-python-deps-Dz1ryHIN.mjs → manifest-python-deps-DKrHcUZj.mjs} +47 -47
  61. package/package.json +1 -4
  62. package/dist/builtins/local-auth/homeassistant-integration.d.ts +0 -7
  63. package/dist/{model-download-service-Caj1kaSi.js → file-data-plane-DUHPHa-Y.js} +847 -847
  64. package/dist/{manifest-python-deps-BE6l8Y4W.js → manifest-python-deps-DafB-1hp.js} +47 -47
  65. package/dist/{resource-monitor-BkP504Vq.mjs → resource-monitor-BWmQ5i-o.mjs} +1 -1
  66. package/dist/{resource-monitor-DNNomR-i.js → resource-monitor-CdnzxBLP.js} +1 -1
@@ -3,13 +3,13 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-D7wC-S4p.js");
7
- let node_fs = require("node:fs");
8
- node_fs = require_chunk.__toESM(node_fs);
9
- let node_util = require("node:util");
6
+ const require_dist = require("../../dist-DCLoJf2T.js");
10
7
  let node_child_process = require("node:child_process");
8
+ let node_util = require("node:util");
11
9
  let node_os = require("node:os");
12
10
  node_os = require_chunk.__toESM(node_os);
11
+ let node_fs = require("node:fs");
12
+ node_fs = require_chunk.__toESM(node_fs);
13
13
  //#region src/builtins/native-metrics/native-metrics-provider.ts
14
14
  var IS_DARWIN = node_os.platform() === "darwin";
15
15
  var IS_LINUX = node_os.platform() === "linux";
@@ -123,7 +123,7 @@ var NativeMetricsProvider = class {
123
123
  return getCpuTemperatureInternal();
124
124
  }
125
125
  async getProcessStats(input) {
126
- const { getPidStats } = await Promise.resolve().then(() => require("../../resource-monitor-DNNomR-i.js")).then((n) => n.resource_monitor_exports);
126
+ const { getPidStats } = await Promise.resolve().then(() => require("../../resource-monitor-CdnzxBLP.js")).then((n) => n.resource_monitor_exports);
127
127
  const raw = await getPidStats(input.pids);
128
128
  const result = [];
129
129
  for (const [pid, s] of raw) result.push({
@@ -1,8 +1,8 @@
1
- import { Et as createEvent, X as metricsProviderCapability, pt as BaseAddon, zt as EventCategory } from "../../dist-C-QzFJ8v.mjs";
2
- import * as fs from "node:fs";
3
- import { promisify } from "node:util";
1
+ import { Rt as EventCategory, Tt as createEvent, X as metricsProviderCapability, ft as BaseAddon } from "../../dist-CnQXXnK1.mjs";
4
2
  import { execFile, execFileSync } from "node:child_process";
3
+ import { promisify } from "node:util";
5
4
  import * as os from "node:os";
5
+ import * as fs from "node:fs";
6
6
  //#region src/builtins/native-metrics/native-metrics-provider.ts
7
7
  var IS_DARWIN = os.platform() === "darwin";
8
8
  var IS_LINUX = os.platform() === "linux";
@@ -116,7 +116,7 @@ var NativeMetricsProvider = class {
116
116
  return getCpuTemperatureInternal();
117
117
  }
118
118
  async getProcessStats(input) {
119
- const { getPidStats } = await import("../../resource-monitor-BkP504Vq.mjs").then((n) => n.r);
119
+ const { getPidStats } = await import("../../resource-monitor-BWmQ5i-o.mjs").then((n) => n.r);
120
120
  const raw = await getPidStats(input.pids);
121
121
  const result = [];
122
122
  for (const [pid, s] of raw) result.push({
@@ -3,13 +3,13 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-D7wC-S4p.js");
7
- let node_fs = require("node:fs");
8
- node_fs = require_chunk.__toESM(node_fs);
9
- let node_util = require("node:util");
6
+ const require_dist = require("../../dist-DCLoJf2T.js");
10
7
  let node_child_process = require("node:child_process");
8
+ let node_util = require("node:util");
11
9
  let node_os = require("node:os");
12
10
  node_os = require_chunk.__toESM(node_os);
11
+ let node_fs = require("node:fs");
12
+ node_fs = require_chunk.__toESM(node_fs);
13
13
  //#region src/builtins/platform-probe/coral-accelerators.ts
14
14
  /**
15
15
  * Coral USB Edge TPU USB identifiers.
@@ -1,9 +1,9 @@
1
1
  import { o as __toESM } from "../../chunk-CNf5ZN-e.mjs";
2
- import { Ot as emitReadiness, P as enumerateInferenceDevices, ft as errMsg, pt as BaseAddon, rt as scoreRuntimes, tt as platformProbeCapability, zt as EventCategory } from "../../dist-C-QzFJ8v.mjs";
3
- import * as fs from "node:fs";
4
- import { promisify } from "node:util";
2
+ import { Dt as emitReadiness, P as enumerateInferenceDevices, Rt as EventCategory, dt as errMsg, et as platformProbeCapability, ft as BaseAddon, nt as scoreRuntimes } from "../../dist-CnQXXnK1.mjs";
5
3
  import { execFile } from "node:child_process";
4
+ import { promisify } from "node:util";
6
5
  import * as os from "node:os";
6
+ import * as fs from "node:fs";
7
7
  //#region src/builtins/platform-probe/coral-accelerators.ts
8
8
  /**
9
9
  * Coral USB Edge TPU USB identifiers.
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-D7wC-S4p.js");
6
+ const require_dist = require("../../dist-DCLoJf2T.js");
7
7
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
8
8
  /**
9
9
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -1,4 +1,4 @@
1
- import { pt as BaseAddon, zt as EventCategory } from "../../dist-C-QzFJ8v.mjs";
1
+ import { Rt as EventCategory, ft as BaseAddon } from "../../dist-CnQXXnK1.mjs";
2
2
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
3
3
  /**
4
4
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -3,10 +3,10 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-D7wC-S4p.js");
7
- let _camstack_types_node = require("@camstack/types/node");
6
+ const require_dist = require("../../dist-DCLoJf2T.js");
8
7
  let zod = require("zod");
9
8
  let node_crypto = require("node:crypto");
9
+ let _camstack_types_node = require("@camstack/types/node");
10
10
  let node_child_process = require("node:child_process");
11
11
  //#region src/builtins/snapshot/snapshot-coalescing.ts
12
12
  /**
@@ -1,7 +1,7 @@
1
- import { C as bareAddonId, Mt as nodePin, _t as DeviceFeature, at as snapshotCapability, ct as streamQualityLabel, ft as errMsg, i as BatteryStatusSchema, pt as BaseAddon, yt as DeviceType } from "../../dist-C-QzFJ8v.mjs";
2
- import { signExpiringUrl, verifyExpiringUrl } from "@camstack/types/node";
1
+ import { C as bareAddonId, dt as errMsg, ft as BaseAddon, gt as DeviceFeature, i as BatteryStatusSchema, it as snapshotCapability, jt as nodePin, st as streamQualityLabel, vt as DeviceType } from "../../dist-CnQXXnK1.mjs";
3
2
  import { z } from "zod";
4
3
  import { randomUUID } from "node:crypto";
4
+ import { signExpiringUrl, verifyExpiringUrl } from "@camstack/types/node";
5
5
  import { execFile, spawn } from "node:child_process";
6
6
  //#region src/builtins/snapshot/snapshot-coalescing.ts
7
7
  /**
@@ -3,14 +3,14 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-D7wC-S4p.js");
6
+ const require_dist = require("../../dist-DCLoJf2T.js");
7
7
  let node_crypto = require("node:crypto");
8
- let node_fs = require("node:fs");
9
- node_fs = require_chunk.__toESM(node_fs);
8
+ let node_fs_promises = require("node:fs/promises");
10
9
  let node_path = require("node:path");
11
10
  node_path = require_chunk.__toESM(node_path);
12
11
  let node_os = require("node:os");
13
- let node_fs_promises = require("node:fs/promises");
12
+ let node_fs = require("node:fs");
13
+ node_fs = require_chunk.__toESM(node_fs);
14
14
  //#region src/builtins/sqlite-storage/path-guard.ts
15
15
  /**
16
16
  * Allowed-root containment guard for the filesystem-browse cap. Pure +
@@ -1,10 +1,10 @@
1
- import { R as filesystemBrowseCapability, pt as BaseAddon, st as storageProviderCapability } from "../../dist-C-QzFJ8v.mjs";
1
+ import { R as filesystemBrowseCapability, ft as BaseAddon, ot as storageProviderCapability } from "../../dist-CnQXXnK1.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
- import * as fs from "node:fs";
3
+ import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
4
4
  import * as path$1 from "node:path";
5
5
  import { basename, dirname, join, resolve, sep } from "node:path";
6
6
  import { homedir } from "node:os";
7
- import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
7
+ import * as fs from "node:fs";
8
8
  //#region src/builtins/sqlite-storage/path-guard.ts
9
9
  /**
10
10
  * Allowed-root containment guard for the filesystem-browse cap. Pure +
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-D7wC-S4p.js");
6
+ const require_dist = require("../../dist-DCLoJf2T.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let node_fs = require("node:fs");
9
9
  let node_module = require("node:module");
@@ -1,4 +1,4 @@
1
- import { C as bareAddonId, Ct as asJsonObject, O as dataStoreProviderCapability, Pt as parseJsonUnknown, dt as vectorStoreCapability, f as RUNTIME_DEFAULTS, ft as errMsg, k as decodeVectorBase64, pt as BaseAddon, ut as vectorDimFromBase64 } from "../../dist-C-QzFJ8v.mjs";
1
+ import { C as bareAddonId, Nt as parseJsonUnknown, O as dataStoreProviderCapability, St as asJsonObject, dt as errMsg, f as RUNTIME_DEFAULTS, ft as BaseAddon, k as decodeVectorBase64, lt as vectorDimFromBase64, ut as vectorStoreCapability } from "../../dist-CnQXXnK1.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { statSync } from "node:fs";
@@ -3,11 +3,11 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-D7wC-S4p.js");
7
- let node_path = require("node:path");
8
- node_path = require_chunk.__toESM(node_path);
6
+ const require_dist = require("../../dist-DCLoJf2T.js");
9
7
  let node_fs_promises = require("node:fs/promises");
10
8
  node_fs_promises = require_chunk.__toESM(node_fs_promises);
9
+ let node_path = require("node:path");
10
+ node_path = require_chunk.__toESM(node_path);
11
11
  let _camstack_system = require("@camstack/system");
12
12
  //#region src/builtins/storage-orchestrator/storage-orchestrator.service.ts
13
13
  var SESSION_VOCABULARY = {
@@ -1,6 +1,6 @@
1
- import { Nt as parseJsonObject, h as StorageLocationTypeSchema, it as settingsStoreCapability, ot as storageCapability, pt as BaseAddon } from "../../dist-C-QzFJ8v.mjs";
2
- import * as path$1 from "node:path";
1
+ import { Mt as parseJsonObject, at as storageCapability, ft as BaseAddon, h as StorageLocationTypeSchema, rt as settingsStoreCapability } from "../../dist-CnQXXnK1.mjs";
3
2
  import * as fs from "node:fs/promises";
3
+ import * as path$1 from "node:path";
4
4
  import { buildStorageLocationRegistry } from "@camstack/system";
5
5
  //#region src/builtins/storage-orchestrator/storage-orchestrator.service.ts
6
6
  var SESSION_VOCABULARY = {
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-D7wC-S4p.js");
6
+ const require_dist = require("../../dist-DCLoJf2T.js");
7
7
  //#region src/builtins/system-config/system-config.addon.ts
8
8
  /**
9
9
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -1,4 +1,4 @@
1
- import { At as hydrateSchema, ft as errMsg, pt as BaseAddon } from "../../dist-C-QzFJ8v.mjs";
1
+ import { dt as errMsg, ft as BaseAddon, kt as hydrateSchema } from "../../dist-CnQXXnK1.mjs";
2
2
  //#region src/builtins/system-config/system-config.addon.ts
3
3
  /**
4
4
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-D7wC-S4p.js");
6
+ const require_dist = require("../../dist-DCLoJf2T.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  let node_path = require("node:path");
9
9
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { pt as BaseAddon, q as logDestinationCapability } from "../../dist-C-QzFJ8v.mjs";
1
+ import { ft as BaseAddon, q as logDestinationCapability } from "../../dist-CnQXXnK1.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";
@@ -13022,6 +13022,65 @@ var ScopedTokenSchema = z.object({
13022
13022
  * Each provider returns a static descriptor; the core enumerates them
13023
13023
  * to validate the `integration=` query param and resolve the consent
13024
13024
  * label + the scopes baked into the issued token.
13025
+ *
13026
+ * ## Declaring one
13027
+ *
13028
+ * An OAuth client is integration-specific knowledge — who the client is, what
13029
+ * it may ask for, where it may be sent — so it is declared by the ADDON that
13030
+ * owns the integration, never by the kernel and never as a branch inside
13031
+ * `oauth2-routes.ts` ([D101](../../../../docs/decisions/adr-0101.md)). Three
13032
+ * steps, no others:
13033
+ *
13034
+ * 1. Add `{ "name": "oauth-integration" }` to the addon's `camstack.addons[]`
13035
+ * manifest entry. This is also what tells the hub, at addon-LOAD time, that
13036
+ * a descriptor is owed — see "the boot window" below.
13037
+ * 2. Return a provider from `onInitialize()`:
13038
+ *
13039
+ * ```ts
13040
+ * const provider: IOauthIntegrationProvider = {
13041
+ * getDescriptor: async () => ({
13042
+ * integrationId: 'my-thing', // the `integration=` query param
13043
+ * displayName: 'My Thing',
13044
+ * requestedScopes: [ … ], // see below
13045
+ * allowedRedirectPrefixes: ['https://callback.example/'],
13046
+ * }),
13047
+ * }
13048
+ * return [{ capability: oauthIntegrationCapability, provider }]
13049
+ * ```
13050
+ *
13051
+ * The descriptor must be **static** — it is read on the authorize path, so
13052
+ * never put an await on network or disk behind it, and never register it
13053
+ * behind one either (a provider is registered only once `onInitialize`
13054
+ * RETURNS, so anything awaited before the return delays linking).
13055
+ * 3. Nothing else. There is no allow-list to join, no id to register with the
13056
+ * core, and no per-integration branch anywhere: `/api/oauth2/authorize` and
13057
+ * `/api/oauth2/integrations` are built from this collection alone.
13058
+ *
13059
+ * **Scopes.** `requestedScopes` is baked into every token this integration is
13060
+ * ever issued and the operator consents to it once. Derive it from the tRPC
13061
+ * paths the client calls **with that token**, against `METHOD_ACCESS_MAP`, and
13062
+ * prefer a narrow `capability:` scope to a `category:` one unless the client
13063
+ * genuinely needs a whole family. A category scope grants every future member
13064
+ * of that category too. `category:system [create]` has been rejected once and
13065
+ * should stay rejected: it hands `addons.installPackage` to an integration.
13066
+ *
13067
+ * What it does NOT cover: calls the ADDON makes over `ctx.api`, which run as
13068
+ * the addon and are not scope-checked. Alexa's descriptor is narrower than
13069
+ * Home Assistant's for exactly that reason — its Lambda posts directives and
13070
+ * the addon does the work, while the Home Assistant component calls tRPC
13071
+ * directly with the token. So `requestedScopes` describes the blast radius of
13072
+ * the GRANT, not the reach of the integration; do not widen one to describe the
13073
+ * other.
13074
+ *
13075
+ * **The boot window.** An addon registers its provider after its runner forks
13076
+ * and initialises, so between hub start and that moment this collection is
13077
+ * incomplete and an `integrationId` can be legitimately absent. The core does
13078
+ * not wait, poll or cache around this ([D3](../../../../docs/decisions/adr-0003.md)):
13079
+ * it compares the manifest declarers against the registered providers and
13080
+ * answers `503 temporarily_unavailable` (with `Retry-After` and the pending
13081
+ * addon ids) instead of `400 unknown integration`, and reports
13082
+ * `complete: false` on `GET /api/oauth2/integrations`. A client should retry
13083
+ * while the list is incomplete rather than conclude the hub cannot do OAuth.
13025
13084
  */
13026
13085
  var OauthIntegrationDescriptorSchema = z.object({
13027
13086
  /** Stable id used as the `integration=` query param, e.g. 'export-alexa'. */
@@ -33179,4 +33238,4 @@ function enumerateInferenceDevices(hw) {
33179
33238
  return out;
33180
33239
  }
33181
33240
  //#endregion
33182
- export { objectInputDeclaresAddonId as $, deviceManagerCapability as A, hydrateSchema as At, isCollectionArrayMethod as B, bareAddonId as C, asJsonObject as Ct, coreBlocksCapability as D, emitDownForOwnedCaps as Dt, coreBlockIdFromAddonId as E, createEvent as Et, enumerateItemArrayFields as F, readinessKey as Ft, lifecycleJobSchema as G, isSameAddonId as H, enumerateSchemaFields as I, resolveCapMount as It, logLevelAtMost as J, localNetworkCapability as K, extractNestedAddonId as L, scopeKey as Lt, deviceStatusCapability as M, nodePin as Mt, doorbellCapability as N, parseJsonObject as Nt, dataStoreProviderCapability as O, emitReadiness as Ot, enumerateInferenceDevices as P, parseJsonUnknown as Pt, oauthIntegrationCapability as Q, filesystemBrowseCapability as R, sleep as Rt, backupCapability as S, WELL_KNOWN_TAB_MAP as St, coreBlockAddonId as T, asString as Tt, isVoidInput as U, isObjectInput as V, kebabToCamel as W, metricsProviderCapability as X, looseSchema as Y, normalizeUnit as Z, addonPagesCapability as _, DeviceFeature as _t, CAP_NAMES_WITH_STATUS as a, snapshotCapability as at, alertsCapability as b, ReadinessRegistry as bt, CoreBlockSchema as c, streamQualityLabel as ct, METHOD_ACCESS_MAP as d, vectorStoreCapability as dt, parseStreamParamsFormPatch as et, RUNTIME_DEFAULTS as f, errMsg as ft, UserRecordSchema as g, DEVICE_STATUS_METHOD as gt, StorageLocationTypeSchema as h, DEVICE_SETTINGS_CONTRIBUTION_METHODS as ht, BatteryStatusSchema as i, settingsStoreCapability as it, deviceStateCapability as j, isDeviceConfigCap as jt, decodeVectorBase64 as k, expandCapMethods as kt, DeclaredDevices as l, userManagementCapability as lt, ScopedTokenSchema as m, DATAPLANE_SECRET_HEADER as mt, AlertSchema as n, procedureAuthKey as nt, CORE_BLOCKS_ADDON_ID as o, storageCapability as ot, STREAM_PROFILE_META as p, BaseAddon as pt, logDestinationCapability as q, ApiKeyRecordSchema as r, scoreRuntimes as rt, CORE_BLOCK_ADDON_PREFIX as s, storageProviderCapability as st, ALL_CAPABILITY_DEFINITIONS as t, platformProbeCapability as tt, DeviceStatusSchema as u, vectorDimFromBase64 as ut, addonSettingsCapability as v, DeviceRole as vt, buildStreamParamsConfigSchema as w, asNumber as wt, authProviderCapability as x, ReadinessTimeoutError as xt, addonWidgetsCapability as y, DeviceType as yt, isArrayOutputSchema as z, EventCategory as zt };
33241
+ export { parseStreamParamsFormPatch as $, deviceManagerCapability as A, isDeviceConfigCap as At, isCollectionArrayMethod as B, bareAddonId as C, asNumber as Ct, coreBlocksCapability as D, emitReadiness as Dt, coreBlockIdFromAddonId as E, emitDownForOwnedCaps as Et, enumerateItemArrayFields as F, resolveCapMount as Ft, lifecycleJobSchema as G, isSameAddonId as H, enumerateSchemaFields as I, scopeKey as It, logLevelAtMost as J, localNetworkCapability as K, extractNestedAddonId as L, sleep as Lt, deviceStatusCapability as M, parseJsonObject as Mt, doorbellCapability as N, parseJsonUnknown as Nt, dataStoreProviderCapability as O, expandCapMethods as Ot, enumerateInferenceDevices as P, readinessKey as Pt, objectInputDeclaresAddonId as Q, filesystemBrowseCapability as R, EventCategory as Rt, backupCapability as S, asJsonObject as St, coreBlockAddonId as T, createEvent as Tt, isVoidInput as U, isObjectInput as V, kebabToCamel as W, metricsProviderCapability as X, looseSchema as Y, normalizeUnit as Z, addonPagesCapability as _, DeviceRole as _t, CAP_NAMES_WITH_STATUS as a, storageCapability as at, alertsCapability as b, ReadinessTimeoutError as bt, CoreBlockSchema as c, userManagementCapability as ct, METHOD_ACCESS_MAP as d, errMsg as dt, platformProbeCapability as et, RUNTIME_DEFAULTS as f, BaseAddon as ft, UserRecordSchema as g, DeviceFeature as gt, StorageLocationTypeSchema as h, DEVICE_STATUS_METHOD as ht, BatteryStatusSchema as i, snapshotCapability as it, deviceStateCapability as j, nodePin as jt, decodeVectorBase64 as k, hydrateSchema as kt, DeclaredDevices as l, vectorDimFromBase64 as lt, ScopedTokenSchema as m, DEVICE_SETTINGS_CONTRIBUTION_METHODS as mt, AlertSchema as n, scoreRuntimes as nt, CORE_BLOCKS_ADDON_ID as o, storageProviderCapability as ot, STREAM_PROFILE_META as p, DATAPLANE_SECRET_HEADER as pt, logDestinationCapability as q, ApiKeyRecordSchema as r, settingsStoreCapability as rt, CORE_BLOCK_ADDON_PREFIX as s, streamQualityLabel as st, ALL_CAPABILITY_DEFINITIONS as t, procedureAuthKey as tt, DeviceStatusSchema as u, vectorStoreCapability as ut, addonSettingsCapability as v, DeviceType as vt, buildStreamParamsConfigSchema as w, asString as wt, authProviderCapability as x, WELL_KNOWN_TAB_MAP as xt, addonWidgetsCapability as y, ReadinessRegistry as yt, isArrayOutputSchema as z };
@@ -13022,6 +13022,65 @@ var ScopedTokenSchema = zod.z.object({
13022
13022
  * Each provider returns a static descriptor; the core enumerates them
13023
13023
  * to validate the `integration=` query param and resolve the consent
13024
13024
  * label + the scopes baked into the issued token.
13025
+ *
13026
+ * ## Declaring one
13027
+ *
13028
+ * An OAuth client is integration-specific knowledge — who the client is, what
13029
+ * it may ask for, where it may be sent — so it is declared by the ADDON that
13030
+ * owns the integration, never by the kernel and never as a branch inside
13031
+ * `oauth2-routes.ts` ([D101](../../../../docs/decisions/adr-0101.md)). Three
13032
+ * steps, no others:
13033
+ *
13034
+ * 1. Add `{ "name": "oauth-integration" }` to the addon's `camstack.addons[]`
13035
+ * manifest entry. This is also what tells the hub, at addon-LOAD time, that
13036
+ * a descriptor is owed — see "the boot window" below.
13037
+ * 2. Return a provider from `onInitialize()`:
13038
+ *
13039
+ * ```ts
13040
+ * const provider: IOauthIntegrationProvider = {
13041
+ * getDescriptor: async () => ({
13042
+ * integrationId: 'my-thing', // the `integration=` query param
13043
+ * displayName: 'My Thing',
13044
+ * requestedScopes: [ … ], // see below
13045
+ * allowedRedirectPrefixes: ['https://callback.example/'],
13046
+ * }),
13047
+ * }
13048
+ * return [{ capability: oauthIntegrationCapability, provider }]
13049
+ * ```
13050
+ *
13051
+ * The descriptor must be **static** — it is read on the authorize path, so
13052
+ * never put an await on network or disk behind it, and never register it
13053
+ * behind one either (a provider is registered only once `onInitialize`
13054
+ * RETURNS, so anything awaited before the return delays linking).
13055
+ * 3. Nothing else. There is no allow-list to join, no id to register with the
13056
+ * core, and no per-integration branch anywhere: `/api/oauth2/authorize` and
13057
+ * `/api/oauth2/integrations` are built from this collection alone.
13058
+ *
13059
+ * **Scopes.** `requestedScopes` is baked into every token this integration is
13060
+ * ever issued and the operator consents to it once. Derive it from the tRPC
13061
+ * paths the client calls **with that token**, against `METHOD_ACCESS_MAP`, and
13062
+ * prefer a narrow `capability:` scope to a `category:` one unless the client
13063
+ * genuinely needs a whole family. A category scope grants every future member
13064
+ * of that category too. `category:system [create]` has been rejected once and
13065
+ * should stay rejected: it hands `addons.installPackage` to an integration.
13066
+ *
13067
+ * What it does NOT cover: calls the ADDON makes over `ctx.api`, which run as
13068
+ * the addon and are not scope-checked. Alexa's descriptor is narrower than
13069
+ * Home Assistant's for exactly that reason — its Lambda posts directives and
13070
+ * the addon does the work, while the Home Assistant component calls tRPC
13071
+ * directly with the token. So `requestedScopes` describes the blast radius of
13072
+ * the GRANT, not the reach of the integration; do not widen one to describe the
13073
+ * other.
13074
+ *
13075
+ * **The boot window.** An addon registers its provider after its runner forks
13076
+ * and initialises, so between hub start and that moment this collection is
13077
+ * incomplete and an `integrationId` can be legitimately absent. The core does
13078
+ * not wait, poll or cache around this ([D3](../../../../docs/decisions/adr-0003.md)):
13079
+ * it compares the manifest declarers against the registered providers and
13080
+ * answers `503 temporarily_unavailable` (with `Retry-After` and the pending
13081
+ * addon ids) instead of `400 unknown integration`, and reports
13082
+ * `complete: false` on `GET /api/oauth2/integrations`. A client should retry
13083
+ * while the list is incomplete rather than conclude the hub cannot do OAuth.
13025
13084
  */
13026
13085
  var OauthIntegrationDescriptorSchema = zod.z.object({
13027
13086
  /** Stable id used as the `integration=` query param, e.g. 'export-alexa'. */
@@ -33617,12 +33676,6 @@ Object.defineProperty(exports, "normalizeUnit", {
33617
33676
  return normalizeUnit;
33618
33677
  }
33619
33678
  });
33620
- Object.defineProperty(exports, "oauthIntegrationCapability", {
33621
- enumerable: true,
33622
- get: function() {
33623
- return oauthIntegrationCapability;
33624
- }
33625
- });
33626
33679
  Object.defineProperty(exports, "objectInputDeclaresAddonId", {
33627
33680
  enumerable: true,
33628
33681
  get: function() {