@camstack/system 1.2.34 → 1.2.36

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 (60) hide show
  1. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  2. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  3. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/alerts/alerts.addon.js +1 -1
  6. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  7. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  8. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  9. package/dist/builtins/console-logging/index.js +1 -1
  10. package/dist/builtins/console-logging/index.mjs +1 -1
  11. package/dist/builtins/core-blocks/block-type-defs.d.ts +14 -0
  12. package/dist/builtins/core-blocks/compile-block.d.ts +21 -0
  13. package/dist/builtins/core-blocks/core-block-store.d.ts +73 -0
  14. package/dist/builtins/core-blocks/core-blocks.addon.d.ts +19 -0
  15. package/dist/builtins/core-blocks/core-blocks.addon.js +418 -0
  16. package/dist/builtins/core-blocks/core-blocks.addon.mjs +411 -0
  17. package/dist/builtins/core-blocks/index.d.ts +4 -0
  18. package/dist/builtins/core-blocks/index.js +12 -0
  19. package/dist/builtins/core-blocks/index.mjs +2 -0
  20. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  21. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  22. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  23. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  24. package/dist/builtins/hub-forwarder/index.js +1 -1
  25. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  26. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  27. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  28. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  29. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  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 +1 -1
  35. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  36. package/dist/builtins/platform-probe/index.js +1 -1
  37. package/dist/builtins/platform-probe/index.mjs +1 -1
  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 +1 -1
  41. package/dist/builtins/snapshot/index.mjs +1 -1
  42. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  43. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  44. package/dist/builtins/sqlite-storage/integration-registry.d.ts +10 -0
  45. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  46. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  47. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  48. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  49. package/dist/builtins/system-config/system-config.addon.js +1 -1
  50. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  51. package/dist/builtins/winston-logging/index.js +1 -1
  52. package/dist/builtins/winston-logging/index.mjs +1 -1
  53. package/dist/{dist-Bqyu3d1X.js → dist-CFinlH7b.js} +263 -1
  54. package/dist/{dist-BjUYsgkj.mjs → dist-DO76YVO2.mjs} +252 -2
  55. package/dist/index.d.ts +1 -0
  56. package/dist/index.js +17 -2
  57. package/dist/index.mjs +17 -3
  58. package/dist/main-CVLq8IzA.js +2356 -0
  59. package/dist/main-CzH19GkU.mjs +2353 -0
  60. package/package.json +14 -1
@@ -5413,6 +5413,69 @@ var NcZoneConditionSchema = z.object({
5413
5413
  * membership lists are OR within the list (spec §2.3).
5414
5414
  */
5415
5415
  /**
5416
+ * What a rule may actuate.
5417
+ *
5418
+ * **No hand-maintained allowlist** (operator decision, and the right one — a
5419
+ * written list of methods is a third parallel map to keep aligned, and this
5420
+ * repo has paid for those). The boundary instead comes from a property the
5421
+ * capabilities already carry: an action may target only a **device-scoped**
5422
+ * capability method.
5423
+ *
5424
+ * That is not decoration. A rule can be authored by a NON-ADMIN — personal
5425
+ * rules are a supported flow — and the executor runs with the addon's
5426
+ * privileges, so an unbounded action is an arbitrary RPC channel with a
5427
+ * privilege escalation attached. Restricting to device scope excludes the
5428
+ * system caps (`device-manager.removeDevice` and friends) by construction,
5429
+ * costs nothing to maintain, and cannot rot: a cap that stops being
5430
+ * device-scoped stops being actuatable in the same change.
5431
+ *
5432
+ * The executor enforces it; {@link NcRuleActionSchema} carries the intent.
5433
+ */
5434
+ /**
5435
+ * One step of a sequence.
5436
+ *
5437
+ * `wait` is a first-class step rather than a property of the next action: it is
5438
+ * what makes a sequence a SEQUENCE and not a list — "unlock, wait 5s, open"
5439
+ * cannot be expressed otherwise.
5440
+ */
5441
+ var NcRuleActionSchema = z.discriminatedUnion("kind", [z.object({
5442
+ kind: z.literal("wait"),
5443
+ seconds: z.number().min(0).max(300)
5444
+ }), z.object({
5445
+ kind: z.literal("cap"),
5446
+ deviceId: z.number().int(),
5447
+ /** Capability name, e.g. `alarm-panel`. */
5448
+ cap: z.string().min(1),
5449
+ /** Method on it. The executor refuses a non-device-scoped cap. */
5450
+ method: z.string().min(1),
5451
+ /** Method arguments, minus `deviceId` (the executor injects it). */
5452
+ args: z.record(z.string(), z.unknown()).optional()
5453
+ })]);
5454
+ /**
5455
+ * A named, ordered run of steps with its own throttle.
5456
+ *
5457
+ * `minDelaySec` exists because a noisy rule otherwise hammers a physical
5458
+ * actuator — the rule's own cooldown governs NOTIFICATIONS, which is a
5459
+ * different budget from "how often may this gate actually open".
5460
+ */
5461
+ var NcRuleActionSequenceSchema = z.object({
5462
+ name: z.string().min(1).max(120),
5463
+ enabled: z.boolean(),
5464
+ minDelaySec: z.number().int().min(0).max(86400).optional(),
5465
+ actions: z.array(NcRuleActionSchema).min(1)
5466
+ });
5467
+ /**
5468
+ * Sequences a rule runs, by hook point.
5469
+ *
5470
+ * ONLY `onTrigger` is here, deliberately. The reference also has activation /
5471
+ * deactivation / reset / post-generation hooks, and they are wanted — but this
5472
+ * repo's expensive failure mode is declaring a surface nothing produces, so a
5473
+ * hook appears here in the same change that produces its edge, never before.
5474
+ */
5475
+ var NcRuleActionsSchema = z.object({
5476
+ /** Runs when the rule MATCHES. */
5477
+ onTrigger: z.array(NcRuleActionSequenceSchema).optional() });
5478
+ /**
5416
5479
  * "This rule applies only while `deviceId` is in one of `states`."
5417
5480
  *
5418
5481
  * The states are the DEVICE's own vocabulary — `AlarmState` for a panel,
@@ -5723,7 +5786,16 @@ var NcRuleInputSchema = z.object({
5723
5786
  * read as `false` by {@link canSetGlobal} in the engine. Admins are not bound
5724
5787
  * by this flag — see the scope rules on that function.
5725
5788
  */
5726
- snoozeAllowGlobal: z.boolean().optional()
5789
+ snoozeAllowGlobal: z.boolean().optional(),
5790
+ /**
5791
+ * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
5792
+ *
5793
+ * This is what makes the rule set the alarm's trigger set without the alarm
5794
+ * being a special case: arming is
5795
+ * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
5796
+ * shape as every other actuation.
5797
+ */
5798
+ actions: NcRuleActionsSchema.optional()
5727
5799
  });
5728
5800
  /**
5729
5801
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -17657,6 +17729,135 @@ var notificationOutputCapability = {
17657
17729
  }
17658
17730
  };
17659
17731
  /**
17732
+ * core-blocks — user-authored TypeScript, stored in the kernel and executed in
17733
+ * its own process.
17734
+ *
17735
+ * Spec: `docs/superpowers/specs/2026-08-04-core-blocks-and-synthetic-devices-design.md`.
17736
+ *
17737
+ * The first use is **owning devices without being a device provider**: a block
17738
+ * declares devices under a system or custom integration and drives their state,
17739
+ * with the same `ctx` an addon gets. Automations come later; nothing here
17740
+ * models a trigger.
17741
+ *
17742
+ * **Stated plainly, because it does not change by being true:** a block has an
17743
+ * addon's powers — devices, storage, the event bus, `ctx.api`. It is a plugin
17744
+ * with no review step. What makes that survivable is not a sandbox, it is
17745
+ * PROCESS ISOLATION: one process per block, supervised by `CrashSupervisor`,
17746
+ * so a block that throws or never returns is marked `failed` and visible
17747
+ * instead of taking the hub with it (D6). Every method here is admin-only, and
17748
+ * must stay so.
17749
+ */
17750
+ /** Where a block runs. The operator chooses — a block driving a device on an
17751
+ * agent is the reason placement is not fixed to the hub. */
17752
+ var CoreBlockPlacementSchema = z.union([z.literal("hub"), z.string().min(1)]);
17753
+ /** What a block's process is doing. Mirrors the addon runner's own lifecycle so
17754
+ * a failing block reads the same way a failing addon does. */
17755
+ var CoreBlockStatusSchema = z.enum([
17756
+ "stopped",
17757
+ "starting",
17758
+ "running",
17759
+ "failed"
17760
+ ]);
17761
+ /** Client-authored fields. */
17762
+ var CoreBlockInputSchema = z.object({
17763
+ name: z.string().min(1).max(120),
17764
+ /** TypeScript source. Compiled server-side before it is ever stored — a
17765
+ * block that does not compile is a fork failure the operator would meet
17766
+ * minutes later, in a log, instead of in the editor. */
17767
+ code: z.string().max(2e5),
17768
+ enabled: z.boolean(),
17769
+ placement: CoreBlockPlacementSchema,
17770
+ /**
17771
+ * Integration the block's devices hang from. Absent = the system integration
17772
+ * blocks share. A block may declare its own instead.
17773
+ */
17774
+ integrationId: z.string().optional()
17775
+ });
17776
+ /** A stored block. */
17777
+ var CoreBlockSchema = CoreBlockInputSchema.extend({
17778
+ id: z.string(),
17779
+ createdAt: z.number(),
17780
+ updatedAt: z.number(),
17781
+ /** Server-stamped author. */
17782
+ createdBy: z.string(),
17783
+ status: CoreBlockStatusSchema,
17784
+ /**
17785
+ * Why the block is not running, when it is not. The operator's ONLY window
17786
+ * into a block that failed at load — a block that is silently absent is the
17787
+ * failure mode this whole feature has to avoid.
17788
+ */
17789
+ lastError: z.string().optional(),
17790
+ /** Ms epoch of the last state change. */
17791
+ lastChangedAt: z.number()
17792
+ });
17793
+ /** What a compile attempt produced. */
17794
+ var CoreBlockCompileResultSchema = z.object({
17795
+ ok: z.boolean(),
17796
+ /** Present when `ok` is false — the first error, in the author's words. */
17797
+ error: z.string().optional(),
17798
+ line: z.number().optional(),
17799
+ column: z.number().optional()
17800
+ });
17801
+ var coreBlocksCapability = {
17802
+ name: "core-blocks",
17803
+ scope: "system",
17804
+ mode: "singleton",
17805
+ methods: {
17806
+ list: method(z.object({}), z.object({ blocks: z.array(CoreBlockSchema) }), { auth: "admin" }),
17807
+ get: method(z.object({ blockId: z.string() }), z.object({ block: CoreBlockSchema.nullable() }), { auth: "admin" }),
17808
+ /**
17809
+ * Create a block. The code is COMPILED first: storing source that does not
17810
+ * compile turns an editor error into a fork failure the operator meets
17811
+ * minutes later in a log.
17812
+ */
17813
+ create: method(z.object({ block: CoreBlockInputSchema }), z.object({ block: CoreBlockSchema }), {
17814
+ kind: "mutation",
17815
+ auth: "admin",
17816
+ caller: "required"
17817
+ }),
17818
+ update: method(z.object({
17819
+ blockId: z.string(),
17820
+ block: CoreBlockInputSchema.partial()
17821
+ }), z.object({ block: CoreBlockSchema }), {
17822
+ kind: "mutation",
17823
+ auth: "admin",
17824
+ caller: "required"
17825
+ }),
17826
+ delete: method(z.object({ blockId: z.string() }), z.object({ success: z.literal(true) }), {
17827
+ kind: "mutation",
17828
+ auth: "admin"
17829
+ }),
17830
+ setEnabled: method(z.object({
17831
+ blockId: z.string(),
17832
+ enabled: z.boolean()
17833
+ }), z.object({ block: CoreBlockSchema }), {
17834
+ kind: "mutation",
17835
+ auth: "admin"
17836
+ }),
17837
+ /**
17838
+ * Type-check without saving — what the editor calls as the author types, so
17839
+ * the compiler's verdict is the same one the server will reach.
17840
+ */
17841
+ compile: method(z.object({ code: z.string() }), CoreBlockCompileResultSchema, {
17842
+ kind: "mutation",
17843
+ auth: "admin"
17844
+ }),
17845
+ /**
17846
+ * The declaration files the editor type-checks against.
17847
+ *
17848
+ * Served rather than bundled: the graph is 3.4 MB across 344 files, and
17849
+ * bundling it would roughly double the admin remote. Served rather than
17850
+ * hand-stubbed: a block runs with the same `ctx` an addon gets, so a stub
17851
+ * would drift and the editor would confidently autocomplete methods that
17852
+ * do not exist.
17853
+ */
17854
+ getTypeDefs: method(z.object({}), z.object({ libs: z.array(z.object({
17855
+ filePath: z.string(),
17856
+ content: z.string()
17857
+ })) }), { auth: "admin" })
17858
+ }
17859
+ };
17860
+ /**
17660
17861
  * Zod schemas for persisted record types.
17661
17862
  *
17662
17863
  * These schemas serve as the single source of truth for types that are
@@ -24191,6 +24392,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
24191
24392
  consumablesCapability,
24192
24393
  contactCapability,
24193
24394
  controlCapability,
24395
+ coreBlocksCapability,
24194
24396
  coverCapability,
24195
24397
  customModelRegistryCapability,
24196
24398
  dataStoreProviderCapability,
@@ -25163,6 +25365,54 @@ var METHOD_ACCESS_MAP = Object.freeze({
25163
25365
  addonId: null,
25164
25366
  access: "create"
25165
25367
  },
25368
+ "coreBlocks.compile": {
25369
+ capName: "core-blocks",
25370
+ capScope: "system",
25371
+ addonId: null,
25372
+ access: "create"
25373
+ },
25374
+ "coreBlocks.create": {
25375
+ capName: "core-blocks",
25376
+ capScope: "system",
25377
+ addonId: null,
25378
+ access: "create"
25379
+ },
25380
+ "coreBlocks.delete": {
25381
+ capName: "core-blocks",
25382
+ capScope: "system",
25383
+ addonId: null,
25384
+ access: "delete"
25385
+ },
25386
+ "coreBlocks.get": {
25387
+ capName: "core-blocks",
25388
+ capScope: "system",
25389
+ addonId: null,
25390
+ access: "view"
25391
+ },
25392
+ "coreBlocks.getTypeDefs": {
25393
+ capName: "core-blocks",
25394
+ capScope: "system",
25395
+ addonId: null,
25396
+ access: "view"
25397
+ },
25398
+ "coreBlocks.list": {
25399
+ capName: "core-blocks",
25400
+ capScope: "system",
25401
+ addonId: null,
25402
+ access: "view"
25403
+ },
25404
+ "coreBlocks.setEnabled": {
25405
+ capName: "core-blocks",
25406
+ capScope: "system",
25407
+ addonId: null,
25408
+ access: "create"
25409
+ },
25410
+ "coreBlocks.update": {
25411
+ capName: "core-blocks",
25412
+ capScope: "system",
25413
+ addonId: null,
25414
+ access: "create"
25415
+ },
25166
25416
  "cover.close": {
25167
25417
  capName: "cover",
25168
25418
  capScope: "device",
@@ -29565,4 +29815,4 @@ function enumerateInferenceDevices(hw) {
29565
29815
  return out;
29566
29816
  }
29567
29817
  //#endregion
29568
- export { storageCapability as $, extractNestedAddonId as A, scopeKey as At, logDestinationCapability as B, deviceStateCapability as C, hydrateSchema as Ct, enumerateItemArrayFields as D, parseJsonUnknown as Dt, enumerateInferenceDevices as E, parseJsonObject as Et, isObjectInput as F, objectInputDeclaresAddonId as G, looseSchema as H, isVoidInput as I, procedureAuthKey as J, parseStreamParamsFormPatch as K, kebabToCamel as L, getByPath as M, EventCategory as Mt, isArrayOutputSchema as N, enumerateSchemaFields as O, readinessKey as Ot, isCollectionArrayMethod as P, snapshotCapability as Q, lifecycleJobSchema as R, deviceManagerCapability as S, expandCapMethods as St, doorbellCapability as T, nodePin as Tt, metricsProviderCapability as U, logLevelAtMost as V, normalizeUnit as W, setByPath as X, scoreRuntimes as Y, settingsStoreCapability as Z, applyTransform as _, asNumber as _t, CAP_NAMES_WITH_STATUS as a, errMsg as at, buildStreamParamsConfigSchema as b, emitDownForOwnedCaps as bt, RUNTIME_DEFAULTS as c, DEVICE_SETTINGS_CONTRIBUTION_METHODS as ct, StorageLocationTypeSchema as d, DeviceRole as dt, storageProviderCapability as et, UserRecordSchema as f, DeviceType as ft, alertsCapability as g, asJsonObject as gt, addonWidgetsCapability as h, WELL_KNOWN_TAB_MAP as ht, BatteryStatusSchema as i, validateExpressionSource as it, filesystemBrowseCapability as j, sleep as jt, evaluateLinkExpression as k, resolveCapMount as kt, STREAM_PROFILE_META as l, DEVICE_STATUS_METHOD as lt, addonSettingsCapability as m, ReadinessTimeoutError as mt, AlertSchema as n, toExpressionValue as nt, DeviceStatusSchema as o, BaseAddon as ot, addonPagesCapability as p, ReadinessRegistry as pt, platformProbeCapability as q, ApiKeyRecordSchema as r, userManagementCapability as rt, METHOD_ACCESS_MAP as s, DATAPLANE_SECRET_HEADER as st, ALL_CAPABILITY_DEFINITIONS as t, streamQualityLabel as tt, ScopedTokenSchema as u, DeviceFeature as ut, authProviderCapability as v, asString as vt, deviceStatusCapability as w, isDeviceConfigCap as wt, dataStoreProviderCapability as x, emitReadiness as xt, backupCapability as y, createEvent as yt, localNetworkCapability as z };
29818
+ export { settingsStoreCapability as $, enumerateSchemaFields as A, readinessKey as At, lifecycleJobSchema as B, dataStoreProviderCapability as C, emitReadiness as Ct, doorbellCapability as D, nodePin as Dt, deviceStatusCapability as E, isDeviceConfigCap as Et, isArrayOutputSchema as F, metricsProviderCapability as G, logDestinationCapability as H, isCollectionArrayMethod as I, parseStreamParamsFormPatch as J, normalizeUnit as K, isObjectInput as L, extractNestedAddonId as M, scopeKey as Mt, filesystemBrowseCapability as N, sleep as Nt, enumerateInferenceDevices as O, parseJsonObject as Ot, getByPath as P, EventCategory as Pt, setByPath as Q, isVoidInput as R, coreBlocksCapability as S, emitDownForOwnedCaps as St, deviceStateCapability as T, hydrateSchema as Tt, logLevelAtMost as U, localNetworkCapability as V, looseSchema as W, procedureAuthKey as X, platformProbeCapability as Y, scoreRuntimes as Z, alertsCapability as _, WELL_KNOWN_TAB_MAP as _t, CAP_NAMES_WITH_STATUS as a, userManagementCapability as at, backupCapability as b, asString as bt, METHOD_ACCESS_MAP as c, BaseAddon as ct, ScopedTokenSchema as d, DEVICE_STATUS_METHOD as dt, snapshotCapability as et, StorageLocationTypeSchema as f, DeviceFeature as ft, addonWidgetsCapability as g, ReadinessTimeoutError as gt, addonSettingsCapability as h, ReadinessRegistry as ht, BatteryStatusSchema as i, toExpressionValue as it, evaluateLinkExpression as j, resolveCapMount as jt, enumerateItemArrayFields as k, parseJsonUnknown as kt, RUNTIME_DEFAULTS as l, DATAPLANE_SECRET_HEADER as lt, addonPagesCapability as m, DeviceType as mt, AlertSchema as n, storageProviderCapability as nt, CoreBlockSchema as o, validateExpressionSource as ot, UserRecordSchema as p, DeviceRole as pt, objectInputDeclaresAddonId as q, ApiKeyRecordSchema as r, streamQualityLabel as rt, DeviceStatusSchema as s, errMsg as st, ALL_CAPABILITY_DEFINITIONS as t, storageCapability as tt, STREAM_PROFILE_META as u, DEVICE_SETTINGS_CONTRIBUTION_METHODS as ut, applyTransform as v, asJsonObject as vt, deviceManagerCapability as w, expandCapMethods as wt, buildStreamParamsConfigSchema as x, createEvent as xt, authProviderCapability as y, asNumber as yt, kebabToCamel as z };
package/dist/index.d.ts CHANGED
@@ -50,6 +50,7 @@ export { AlertCenterAddon } from './builtins/alerts/index.js';
50
50
  export { LivenessMonitorAddon } from './builtins/liveness-monitor/index.js';
51
51
  export { NativeMetricsProvider } from './builtins/native-metrics/native-metrics-provider.js';
52
52
  export { SystemConfigAddon } from './builtins/system-config/index.js';
53
+ export { CoreBlocksAddon } from './builtins/core-blocks/index.js';
53
54
  export { LocalAuthAddon } from './builtins/local-auth/index.js';
54
55
  export { DeviceManagerAddon } from './builtins/device-manager/index.js';
55
56
  export { LifecycleStateMachine } from './lifecycle/lifecycle-state-machine.js';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-Cek0wNdY.js");
3
- const require_dist = require("./dist-Bqyu3d1X.js");
3
+ const require_dist = require("./dist-CFinlH7b.js");
4
4
  const require_model_download_service = require("./model-download-service-hf0ookyy.js");
5
5
  const require_manifest_python_deps = require("./manifest-python-deps-BqE5j0-O.js");
6
6
  const require_resource_monitor = require("./resource-monitor-DNNomR-i.js");
@@ -21,6 +21,8 @@ const require_builtins_liveness_monitor_liveness_monitor_addon = require("./buil
21
21
  require("./builtins/liveness-monitor/index.js");
22
22
  const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
23
23
  require("./builtins/system-config/index.js");
24
+ const require_builtins_core_blocks_core_blocks_addon = require("./builtins/core-blocks/core-blocks.addon.js");
25
+ require("./builtins/core-blocks/index.js");
24
26
  const require_builtins_local_auth_local_auth_addon = require("./builtins/local-auth/local-auth.addon.js");
25
27
  require("./builtins/local-auth/index.js");
26
28
  const require_builtins_device_manager_device_manager_addon = require("./builtins/device-manager/device-manager.addon.js");
@@ -2287,7 +2289,7 @@ var INTEGRATIONS = "integrations";
2287
2289
  var INTEGRATION_SETTINGS = "integration_settings";
2288
2290
  var DEVICES = "devices";
2289
2291
  var DEVICE_SETTINGS = "device_settings_kv";
2290
- var IntegrationRegistry = class {
2292
+ var IntegrationRegistry = class IntegrationRegistry {
2291
2293
  store;
2292
2294
  constructor(backend) {
2293
2295
  this.store = backend;
@@ -2409,7 +2411,19 @@ var IntegrationRegistry = class {
2409
2411
  });
2410
2412
  return this.getIntegration(id);
2411
2413
  }
2414
+ /**
2415
+ * A FIXED integration exists because an addon declares it, not because an
2416
+ * operator added it — the Notification Center's alarm panel is the first.
2417
+ * There is no add or delete flow for one, and this is where that is true
2418
+ * rather than merely hidden: a UI that only omits the button still leaves the
2419
+ * mutation one API call away.
2420
+ */
2421
+ static isFixed(integration) {
2422
+ return integration.info["fixed"] === true;
2423
+ }
2412
2424
  async deleteIntegration(id) {
2425
+ const integration = await this.getIntegration(id);
2426
+ if (integration !== null && IntegrationRegistry.isFixed(integration)) throw new Error(`integration "${id}" is fixed — it belongs to the addon that declared it and cannot be deleted`);
2413
2427
  const devices = await this.listDevices(id);
2414
2428
  for (const d of devices) await this.store.deleteWhere({
2415
2429
  collection: DEVICE_SETTINGS,
@@ -94384,6 +94398,7 @@ exports.ConfigManager = ConfigManager;
94384
94398
  exports.ConfigStore = require_builtins_sqlite_storage_index.ConfigStore$1;
94385
94399
  exports.ConsoleDestination = require_builtins_console_logging_index.ConsoleDestination$1;
94386
94400
  exports.ConsoleLoggingAddon = require_builtins_console_logging_index.ConsoleLoggingAddon$1;
94401
+ exports.CoreBlocksAddon = require_builtins_core_blocks_core_blocks_addon.CoreBlocksAddon;
94387
94402
  exports.CustomActionRegistry = require_custom_action_registry.CustomActionRegistry;
94388
94403
  exports.DEFAULT_DATA_PATH = DEFAULT_DATA_PATH;
94389
94404
  exports.DEVICE_SETTINGS_CONTRIBUTION_METHODS = require_dist.DEVICE_SETTINGS_CONTRIBUTION_METHODS;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
2
- import { A as extractNestedAddonId, At as scopeKey, Dt as parseJsonUnknown$1, Et as parseJsonObject, F as isObjectInput, G as objectInputDeclaresAddonId, H as looseSchema, I as isVoidInput, J as procedureAuthKey, L as kebabToCamel, Mt as EventCategory$1, N as isArrayOutputSchema, Ot as readinessKey, P as isCollectionArrayMethod, R as lifecycleJobSchema, St as expandCapMethods, V as logLevelAtMost, _t as asNumber, at as errMsg$1, bt as emitDownForOwnedCaps, c as RUNTIME_DEFAULTS, ct as DEVICE_SETTINGS_CONTRIBUTION_METHODS, gt as asJsonObject$1, kt as resolveCapMount, lt as DEVICE_STATUS_METHOD, m as addonSettingsCapability, mt as ReadinessTimeoutError, pt as ReadinessRegistry, s as METHOD_ACCESS_MAP, st as DATAPLANE_SECRET_HEADER$1, t as ALL_CAPABILITY_DEFINITIONS, vt as asString$1, yt as createEvent } from "./dist-BjUYsgkj.mjs";
2
+ import { At as readinessKey, B as lifecycleJobSchema, F as isArrayOutputSchema, I as isCollectionArrayMethod, L as isObjectInput, M as extractNestedAddonId, Mt as scopeKey, Ot as parseJsonObject, Pt as EventCategory$1, R as isVoidInput, St as emitDownForOwnedCaps, U as logLevelAtMost, W as looseSchema, X as procedureAuthKey, bt as asString$1, c as METHOD_ACCESS_MAP, dt as DEVICE_STATUS_METHOD, gt as ReadinessTimeoutError, h as addonSettingsCapability, ht as ReadinessRegistry, jt as resolveCapMount, kt as parseJsonUnknown$1, l as RUNTIME_DEFAULTS, lt as DATAPLANE_SECRET_HEADER$1, q as objectInputDeclaresAddonId, st as errMsg$1, t as ALL_CAPABILITY_DEFINITIONS, ut as DEVICE_SETTINGS_CONTRIBUTION_METHODS, vt as asJsonObject$1, wt as expandCapMethods, xt as createEvent, yt as asNumber, z as kebabToCamel } from "./dist-DO76YVO2.mjs";
3
3
  import { a as downloadModel, c as getModelFilePath, d as contentTypeFor, f as createAuthenticatedFileServer, h as resolveFilePath, i as downloadFile, l as isModelDownloaded, m as parseTokenizedUrl, n as collectModelFiles, o as ensureModel, p as parseRangeHeader, r as deleteModelFromDisk, s as fetchJson, t as ModelDownloadService, u as createFileDataPlaneHandler } from "./model-download-service-Cp9f4dk6.mjs";
4
4
  import { $ as buildNativeCapProxy, A as createHubCapForwardService, B as AGENT_CAP_FWD_ACTION, C as brokerTransportLink, Ct as resolveAddonClass, D as localProviderLink, E as ipcParentLink, F as createUdsLogger, G as callWithServiceDiscovery, H as CapRouteResolver, I as createUdsLoggerWithControl, J as UdsLocalTransportServer, K as createLocalTransport, L as LocalChildClient, M as createUdsEventBridge, N as createUdsEventBus, O as HUB_CAP_FWD_ACTION, P as udsChildLogToWorkerEntry, Q as encodeFrame, R as LocalChildRegistry, S as brokerCallForCap, St as runNpm, T as ipcChildLink, U as CapRouteError, V as AGENT_CAP_FWD_SERVICE, W as classifyCapRoute, X as localEndpointPath, Y as SocketChannel, Z as FrameDecoder, _ as createKernelHwAccel, _t as CapabilityHandle, a as getWorkerDeviceRegistry, b as __resetCapUsageRegistryForTests, bt as installManifestNativeDeps, c as setHubConnected, ct as NATIVE_PROVIDER_SERVICE_INFIX, d as getBrokerEventBus, dt as capBareAction, et as buildUdsNativeCapProxy, f as getMoleculerEventStats, ft as capServiceName, g as AddonDepsManager, gt as DeviceRegistry, h as subscribePassthrough, ht as serializeTypedArrays, i as createUdsAddonContext, it as mountNativeCapService, j as createParentUnownedCallHandler, k as HUB_CAP_FWD_SERVICE, l as EVENT_TOPIC_PREFIX, lt as capActionName, m as setNodeEventInterest, mt as deserializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as createAddonService, p as registerEventBusService, pt as parseCapAction, q as UdsLocalTransportClient, r as createAddonContext, s as getOrInitReadinessRegistryForClient, st as validateProviderRegistrations, t as installManifestPythonDeps, tt as createBrokerDeviceManagerApi, u as clusterEventTopic, ut as capActionSuffix, v as resolveHwAccel, vt as CapabilityUnavailableError, w as buildLinkChain, wt as createAddonDataPlaneFacility, x as getCapUsageRegistry, xt as resolveNpmInvocation, y as CapUsageRegistry, yt as copyBundledNativeModules, z as UDS_NO_ROUTE_PREFIX } from "./manifest-python-deps-Ck4-9K9m.mjs";
5
5
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-BkP504Vq.mjs";
@@ -20,6 +20,8 @@ import { LivenessMonitorAddon } from "./builtins/liveness-monitor/liveness-monit
20
20
  import "./builtins/liveness-monitor/index.mjs";
21
21
  import { SystemConfigAddon } from "./builtins/system-config/system-config.addon.mjs";
22
22
  import "./builtins/system-config/index.mjs";
23
+ import { CoreBlocksAddon } from "./builtins/core-blocks/core-blocks.addon.mjs";
24
+ import "./builtins/core-blocks/index.mjs";
23
25
  import { LocalAuthAddon, a as require_ms, i as AuthManager, n as ApiKeyManager, o as require_safe_buffer, r as UserManager, t as ScopedTokenManager } from "./builtins/local-auth/local-auth.addon.mjs";
24
26
  import "./builtins/local-auth/index.mjs";
25
27
  import { DeviceManagerAddon } from "./builtins/device-manager/device-manager.addon.mjs";
@@ -2279,7 +2281,7 @@ var INTEGRATIONS = "integrations";
2279
2281
  var INTEGRATION_SETTINGS = "integration_settings";
2280
2282
  var DEVICES = "devices";
2281
2283
  var DEVICE_SETTINGS = "device_settings_kv";
2282
- var IntegrationRegistry = class {
2284
+ var IntegrationRegistry = class IntegrationRegistry {
2283
2285
  store;
2284
2286
  constructor(backend) {
2285
2287
  this.store = backend;
@@ -2401,7 +2403,19 @@ var IntegrationRegistry = class {
2401
2403
  });
2402
2404
  return this.getIntegration(id);
2403
2405
  }
2406
+ /**
2407
+ * A FIXED integration exists because an addon declares it, not because an
2408
+ * operator added it — the Notification Center's alarm panel is the first.
2409
+ * There is no add or delete flow for one, and this is where that is true
2410
+ * rather than merely hidden: a UI that only omits the button still leaves the
2411
+ * mutation one API call away.
2412
+ */
2413
+ static isFixed(integration) {
2414
+ return integration.info["fixed"] === true;
2415
+ }
2404
2416
  async deleteIntegration(id) {
2417
+ const integration = await this.getIntegration(id);
2418
+ if (integration !== null && IntegrationRegistry.isFixed(integration)) throw new Error(`integration "${id}" is fixed — it belongs to the addon that declared it and cannot be deleted`);
2405
2419
  const devices = await this.listDevices(id);
2406
2420
  for (const d of devices) await this.store.deleteWhere({
2407
2421
  collection: DEVICE_SETTINGS,
@@ -94348,4 +94362,4 @@ var LifecycleJobEngine = class {
94348
94362
  }
94349
94363
  };
94350
94364
  //#endregion
94351
- export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CustomActionRegistry, DEFAULT_DATA_PATH, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LokiDestination, LokiLoggingAddon, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, RESTART_MARKER_FILE, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, __resetCapUsageRegistryForTests, adaptBrokerToCluster, addonSettingsCapability, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, capActionName, capActionSuffix, capBareAction, capServiceName, classifyCapRoute, clearPendingRestart, clusterEventTopic, clusterSecretMatches, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, detectWorkspacePackagesDir, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, expandCapMethods, fetchJson, findInPath, formatLogLine, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, installManifestNativeDeps, installManifestPythonDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcChildLink, ipcParentLink, isAddonDeploySource, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, parseCapAction, parseRangeHeader, parseTokenizedUrl, proxyToUpstream, readPendingRestart, readinessKey, registerEventBusService, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runNpm, scheduleSelfRestart, scopeKey, scopesAllowDeviceCap, serializeTypedArrays, setHubConnected, setNodeEventInterest, startHeapWatch, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, writePendingRestart };
94365
+ export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DEFAULT_DATA_PATH, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LokiDestination, LokiLoggingAddon, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, RESTART_MARKER_FILE, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, __resetCapUsageRegistryForTests, adaptBrokerToCluster, addonSettingsCapability, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, capActionName, capActionSuffix, capBareAction, capServiceName, classifyCapRoute, clearPendingRestart, clusterEventTopic, clusterSecretMatches, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, detectWorkspacePackagesDir, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, expandCapMethods, fetchJson, findInPath, formatLogLine, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, installManifestNativeDeps, installManifestPythonDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcChildLink, ipcParentLink, isAddonDeploySource, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, parseCapAction, parseRangeHeader, parseTokenizedUrl, proxyToUpstream, readPendingRestart, readinessKey, registerEventBusService, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runNpm, scheduleSelfRestart, scopeKey, scopesAllowDeviceCap, serializeTypedArrays, setHubConnected, setNodeEventInterest, startHeapWatch, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, writePendingRestart };