@camstack/server 1.2.891 → 1.2.892

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 (117) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/api/trpc/generated-cap-mounts.js +2 -1
  3. package/dist/api/trpc/generated-cap-routers.js +194 -39
  4. package/dist/core/addon/addon-registry.service.js +47 -0
  5. package/dist/core/addon/retire-undeclared-fixed-integrations.js +57 -0
  6. package/package.json +31 -15
  7. package/system/dist/addon-runner.js +25 -9
  8. package/system/dist/addon-runner.mjs +25 -9
  9. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  10. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  11. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  12. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  13. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  14. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  15. package/system/dist/builtins/autotrack/index.js +1 -1
  16. package/system/dist/builtins/autotrack/index.mjs +1 -1
  17. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  18. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  19. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  20. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  21. package/system/dist/builtins/camera-grid/addon.d.ts +65 -41
  22. package/system/dist/builtins/camera-grid/grid-blocks.d.ts +51 -0
  23. package/system/dist/builtins/camera-grid/grid-camera-device.d.ts +4 -3
  24. package/system/dist/builtins/camera-grid/grid-layout-native-provider.d.ts +3 -1
  25. package/system/dist/builtins/camera-grid/grid-plan.d.ts +3 -3
  26. package/system/dist/builtins/camera-grid/index.d.ts +2 -6
  27. package/system/dist/builtins/camera-grid/index.js +431 -727
  28. package/system/dist/builtins/camera-grid/index.mjs +428 -719
  29. package/system/dist/builtins/composer/composed-device.d.ts +12 -2
  30. package/system/dist/builtins/composer/composer.addon.js +28 -10
  31. package/system/dist/builtins/composer/composer.addon.mjs +28 -10
  32. package/system/dist/builtins/composer/composition-declarations.d.ts +3 -1
  33. package/system/dist/builtins/console-logging/index.js +1 -1
  34. package/system/dist/builtins/console-logging/index.mjs +1 -1
  35. package/system/dist/builtins/core-blocks/core-blocks.addon.js +174 -39
  36. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +175 -40
  37. package/system/dist/builtins/core-blocks/hero-layout-service.d.ts +19 -1
  38. package/system/dist/builtins/core-blocks/power-source-devices.d.ts +9 -0
  39. package/system/dist/builtins/core-blocks/power-source-service.d.ts +39 -2
  40. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  41. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  42. package/system/dist/builtins/device-manager/device-identifiers-action.d.ts +9 -0
  43. package/system/dist/builtins/device-manager/device-manager.addon.js +172 -5
  44. package/system/dist/builtins/device-manager/device-manager.addon.mjs +172 -5
  45. package/system/dist/builtins/device-manager/device-meta-types.d.ts +5 -1
  46. package/system/dist/builtins/device-manager/device-row-store.d.ts +3 -2
  47. package/system/dist/builtins/device-manager/device-state-mirror.d.ts +7 -0
  48. package/system/dist/builtins/device-manager/workload-transition.d.ts +23 -0
  49. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  50. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  51. package/system/dist/builtins/keychain/index.js +4 -4
  52. package/system/dist/builtins/keychain/index.mjs +4 -4
  53. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  54. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  55. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  56. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  57. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  58. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  59. package/system/dist/builtins/loki-logging/index.js +1 -1
  60. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  61. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  62. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  63. package/system/dist/builtins/platform-probe/index.js +1 -1
  64. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  65. package/system/dist/builtins/record-entries/index.js +1 -1
  66. package/system/dist/builtins/record-entries/index.mjs +1 -1
  67. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  68. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  69. package/system/dist/builtins/snapshot/index.js +1 -1
  70. package/system/dist/builtins/snapshot/index.mjs +1 -1
  71. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  72. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  73. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  74. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  75. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  76. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  77. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  78. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  79. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  80. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  81. package/system/dist/builtins/winston-logging/index.js +1 -1
  82. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  83. package/system/dist/{capture-engine-DXz37Mjg.js → capture-engine-DHmlkW_d.js} +1 -1
  84. package/system/dist/{capture-engine-nmelnj-Y.mjs → capture-engine-sl6e9f9S.mjs} +1 -1
  85. package/system/dist/{composition-sources-uphZtYtN.mjs → composition-sources-CznD85Ri.mjs} +1 -1
  86. package/system/dist/{composition-sources-BLn3cU74.js → composition-sources-PqcZfe3j.js} +1 -1
  87. package/system/dist/{constants-DWU46D02.mjs → constants-CHwj_mIM.mjs} +1 -1
  88. package/system/dist/{constants-BAaGwvKn.js → constants-_2SOk0By.js} +1 -1
  89. package/system/dist/{device-ca-CK6mLB2w.mjs → device-ca-D2H1EMUY.mjs} +1 -1
  90. package/system/dist/{device-ca-jbH_rqZh.js → device-ca-WIEO5ZcE.js} +1 -1
  91. package/system/dist/{dist-Dgq9nuvh.mjs → dist-DbAhCrHy.mjs} +2366 -444
  92. package/system/dist/{dist-m5beNMze.js → dist-yx2KHo3b.js} +2467 -443
  93. package/system/dist/file-host-worker.js +1 -1
  94. package/system/dist/file-host-worker.mjs +1 -1
  95. package/system/dist/{hub-identity-DlBBoHJC.mjs → hub-identity-BcvZqT0L.mjs} +1 -1
  96. package/system/dist/{hub-identity-CKCA89XP.js → hub-identity-Buegac-w.js} +1 -1
  97. package/system/dist/{hub-mdns-ciao-B8uFW-RG.mjs → hub-mdns-ciao-B6K_dO2s.mjs} +2 -2
  98. package/system/dist/{hub-mdns-ciao-CqcCGPdi.js → hub-mdns-ciao-DcNPj7WJ.js} +2 -2
  99. package/system/dist/index.js +33 -19
  100. package/system/dist/index.mjs +33 -19
  101. package/system/dist/kernel/moleculer/child-cap-dispatch.d.ts +3 -6
  102. package/system/dist/kernel/moleculer/switch-toggle.d.ts +7 -2
  103. package/system/dist/{legacy-integration-rows-door-Co0gj1Lm.js → legacy-integration-rows-door-BsZyVNiR.js} +1 -1
  104. package/system/dist/{legacy-integration-rows-door-HI4nmSe_.mjs → legacy-integration-rows-door-DHOJeDPG.mjs} +1 -1
  105. package/system/dist/{rename-composition-block-UeVUYCwx.js → rename-composition-block-BXMor7MR.js} +1 -1
  106. package/system/dist/{rename-composition-block-BthBMrXA.mjs → rename-composition-block-DcVS1LuC.mjs} +1 -1
  107. package/system/dist/{restore-archive-P-ICnU58.mjs → restore-archive-BG8VJ8Ar.mjs} +82 -82
  108. package/system/dist/{restore-archive-CJLsfBwK.js → restore-archive-BURufVQd.js} +1 -1
  109. package/system/dist/{wal-maintenance-qWjb7_f2.mjs → wal-maintenance-B4wGD6QR.mjs} +0 -0
  110. package/system/dist/{wal-maintenance-CUtwx-2Z.js → wal-maintenance-CeaJyKNT.js} +0 -0
  111. package/system/package.json +2 -5
  112. package/system/dist/builtins/camera-grid/grid-camera-declarations.d.ts +0 -59
  113. package/system/dist/builtins/camera-grid/grid-instances.d.ts +0 -40
  114. package/system/dist/builtins/camera-grid/grid-record-kinds.d.ts +0 -31
  115. package/system/dist/builtins/camera-grid/migrations/__fixtures__/seed.d.ts +0 -13
  116. package/system/dist/builtins/camera-grid/migrations/camera-grids-to-records.d.ts +0 -26
  117. package/system/dist/builtins/camera-grid/migrations/index.d.ts +0 -6
@@ -1,59 +0,0 @@
1
- import type { GridInstance } from "./grid-instances.js";
2
- /**
3
- * The stable id is `camera-grid-<instance uuid>` and NOTHING else.
4
- *
5
- * A stable id is permanent the instant it is minted: bindings, grid layouts in
6
- * other addons, recording rows, the timeline and this addon's own tombstones
7
- * all reference it, and a device whose stable id changes is a NEW camera with
8
- * an empty history. So it may only be derived from something that itself never
9
- * changes.
10
- *
11
- * The instance uuid is the only such thing here. Deriving it from the NAME
12
- * would rename-break every reference; deriving it from the CELLS would mint a
13
- * new camera every time the operator drags a rectangle — which is the entire
14
- * activity this addon exists for. Terminal learned the same lesson from the
15
- * other end: its original one-camera-per-node id is permanent, and its profile
16
- * migration had to ENRICH that row rather than mint a replacement.
17
- */
18
- export declare function newGridCameraStableId(instanceId: string): string;
19
- /** The config a declared grid camera device carries. */
20
- export interface GridCameraConfig {
21
- readonly instanceId: string;
22
- /** `DeviceDeclaration.config` is an open record; this keeps the named type assignable. */
23
- readonly [key: string]: unknown;
24
- }
25
- export interface GridCameraDeclaration {
26
- readonly stableId: string;
27
- readonly name: string;
28
- readonly config: GridCameraConfig;
29
- }
30
- export interface ExistingGridCameraRow {
31
- readonly id: number;
32
- readonly stableId: string;
33
- readonly integrationId?: string | null;
34
- readonly config: Readonly<Record<string, unknown>>;
35
- }
36
- /**
37
- * Explicit persisted instances only. A grid camera exists because an operator
38
- * created a grid, never because some source camera happens to exist.
39
- *
40
- * A grid with NO cells is declared like any other: creation is name-only and
41
- * the layout is authored afterwards in the camera's own device details, so
42
- * "no cells yet" is the normal first state, not an invalid row.
43
- */
44
- export declare function buildGridCameraDeclarations(instances: readonly GridInstance[]): readonly GridCameraDeclaration[];
45
- /**
46
- * The rows `DeclaredDevices` is allowed to consider — every live declaration
47
- * plus ONE bounded batch of orphans.
48
- *
49
- * Two guards, both copied from Terminal because both were paid for there:
50
- *
51
- * 1. **An unknown integration id yields an EMPTY index.** `null`/`undefined`
52
- * means "the integration lookup has not answered", which is not the same
53
- * fact as "this addon owns no rows" — and only the second one may drive a
54
- * withdrawal.
55
- * 2. **The orphan batch is bounded and deterministically ordered.** The generic
56
- * sweep refuses an over-limit set outright; selecting a batch here drains a
57
- * large historical orphan set across passes without weakening that guard.
58
- */
59
- export declare function gridCameraReconciliationIndex(rows: readonly ExistingGridCameraRow[], integrationId: string | null | undefined, declarations: readonly GridCameraDeclaration[], managedStableIds?: ReadonlySet<string>): readonly ExistingGridCameraRow[];
@@ -1,40 +0,0 @@
1
- /**
2
- * The operator-written grid rows.
3
- *
4
- * Shape follows `readTerminalInstances`: a grid is a persisted row that
5
- * DECLARES a camera, and the declaration reconcile turns rows into devices.
6
- *
7
- * Config is operator-writable, so a malformed or duplicate row is IGNORED
8
- * rather than allowed to make the reconcile destructive. One bad row must never
9
- * delete every camera this addon declares — that failure mode is why the
10
- * Terminal addon reads its rows the same way.
11
- */
12
- import { z } from "zod";
13
- type NormalizedRect = {
14
- x: number;
15
- y: number;
16
- width: number;
17
- height: number;
18
- };
19
- export type GridCellConfig = {
20
- deviceId: number;
21
- source: NormalizedRect;
22
- cell: NormalizedRect;
23
- };
24
- /**
25
- * One source camera, the part of its picture taken, and where that part lands
26
- * on the composite's canvas. Both rectangles are NORMALIZED so a source that
27
- * changes resolution does not silently start cutting the wrong region.
28
- */
29
- export declare const GridCellSchema: z.ZodType<GridCellConfig>;
30
- export type GridInstance = {
31
- id: string;
32
- cameraStableId: string;
33
- name: string;
34
- enabled: boolean;
35
- fps: number;
36
- publishedProfiles: Array<"high" | "mid" | "low">;
37
- cells: GridCellConfig[];
38
- };
39
- export declare function readGridInstances(raw: readonly Record<string, unknown>[], onInvalid?: (message: string) => void): readonly GridInstance[];
40
- export {};
@@ -1,31 +0,0 @@
1
- /**
2
- * A camera grid as a record (D1013): one `camera-grid` row per grid, owned by the `camera-grid`
3
- * builtin, listed and edited through `integration-instances` on the Camera grids page. The layout
4
- * (cells, frame rate, published profiles) is authored in the camera's own device details and
5
- * saved onto the same record.
6
- *
7
- * The record id IS the grid id the old settings list carried (a uuid), so the camera
8
- * `camera-grid-<id>` and everything that names it keeps its stable identity. `cameraStableId` is
9
- * stored only where it is not derivable from the id.
10
- */
11
- import { type DefinedRecordKind } from "@camstack/types";
12
- import { z } from "zod";
13
- import { type GridCellConfig } from "./grid-instances.js";
14
- export type GridBody = {
15
- readonly name: string;
16
- /** Absent means `camera-grid-<id>`. */
17
- readonly cameraStableId?: string | undefined;
18
- readonly fps: number;
19
- readonly publishedProfiles: readonly ("high" | "mid" | "low")[];
20
- readonly cells: readonly GridCellConfig[];
21
- /** The grid's own switch (D1013). Absent means on. */
22
- readonly enabled?: boolean | undefined;
23
- };
24
- /** Checked against the interface by its annotation: a drifted field fails the typecheck. */
25
- export declare const GridBodySchema: z.ZodType<GridBody>;
26
- export declare const CAMERA_GRID_KIND_NAME = "camera-grid";
27
- export declare const cameraGridKind: DefinedRecordKind<z.ZodType<GridBody>>;
28
- /** The body a new grid starts with: a name only, no cells, so it declares a camera and emits nothing. */
29
- export declare function initialGridBody(name: string): GridBody;
30
- /** The row `readGridInstances` parses, from a record. */
31
- export declare function rawGridOfRecord(id: string, body: GridBody): Record<string, unknown>;
@@ -1,13 +0,0 @@
1
- /**
2
- * The legacy data the camera-grid catalogue meets on a node that last ran a release which kept its
3
- * grids in the addon settings (`cameraGrids`): written by hand, in the shape that release stored
4
- * it (including the `width`/`height` rows carried before the canvas was derived), with a MARK in a
5
- * field a migration that re-built a row would drop (`cells[0].source.x`). The replay and the
6
- * real-SQLite spec both seed from here.
7
- */
8
- import type Database from "better-sqlite3";
9
- export declare const GRID_SEED_ADDON = "camera-grid";
10
- /** A laid-out grid with an old canvas size, and a name-only grid that is switched off. */
11
- export declare const GRID_SEED_ROWS: readonly Record<string, unknown>[];
12
- /** Write the legacy list the way the settings writer stored it: one `<addonId>.<key>` row. */
13
- export declare function seedGridLegacySettings(db: Database.Database): void;
@@ -1,26 +0,0 @@
1
- import { type MigrationApiV1, type MigrationProcedureResult } from "@camstack/types";
2
- import { type GridBody } from "../grid-record-kinds.js";
3
- export declare const LEGACY_GRIDS_KEY = "cameraGrids";
4
- export interface GridMigrationPorts {
5
- /** The legacy list as stored; `absent` when the key was never written. */
6
- readLegacy(): Promise<{
7
- readonly kind: "absent";
8
- } | {
9
- readonly kind: "present";
10
- readonly value: unknown;
11
- }>;
12
- /** The ids that already have a record. */
13
- listIds(): Promise<ReadonlySet<string>>;
14
- /** Create the record; never replaces one. */
15
- putRecord(id: string, body: GridBody): Promise<void>;
16
- /** The record as stored; `null` when there is none. */
17
- readRecord(id: string): Promise<GridBody | null>;
18
- /** Delete the legacy key. Called only once every row has a record that reads back equal. */
19
- dropLegacyKey(): Promise<void>;
20
- /** Rewrite the legacy key to hold only these raw rows (the ones that could not be converted). */
21
- keepLegacyRows(rows: readonly unknown[]): Promise<void>;
22
- /** A row that was not copied, by id and reason (never a value). */
23
- warn(message: string): void;
24
- }
25
- export declare function copyGridsToRecords(ports: GridMigrationPorts): Promise<MigrationProcedureResult>;
26
- export declare function gridPortsOver(api: MigrationApiV1): GridMigrationPorts;
@@ -1,6 +0,0 @@
1
- import type { AddonMigration } from "@camstack/types";
2
- import { type GridMigrationPorts } from "./camera-grids-to-records.js";
3
- export { gridPortsOver, LEGACY_GRIDS_KEY, type GridMigrationPorts } from "./camera-grids-to-records.js";
4
- export declare const GRIDS_TO_RECORDS_ID = "camera-grid/2026-11-07-grids-to-records";
5
- /** The `camera-grid` catalogue (D987): offered to the engine when the addon initialises. */
6
- export declare const ADDON_MIGRATIONS: readonly AddonMigration<GridMigrationPorts>[];