@camstack/system 1.2.460 → 1.2.462
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.
- package/dist/addon-runner.js +21 -276
- package/dist/addon-runner.mjs +21 -276
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/{agent-https-Dnr_nIVx.js → agent-https-C6M6apPV.js} +1 -1
- package/dist/{agent-https-Iw3RSQup.mjs → agent-https-CC7jpktS.mjs} +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +1 -3
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +51 -502
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +51 -502
- package/dist/builtins/backup-orchestrator/destination-policy.d.ts +5 -21
- package/dist/builtins/backup-orchestrator/record-kinds.d.ts +0 -2
- package/dist/builtins/backup-orchestrator/schedule-store.d.ts +5 -13
- package/dist/builtins/backup-orchestrator/seed-marker-store.d.ts +9 -19
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/cluster-agent/record-kinds.d.ts +0 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-history/device-history.addon.js +1 -1
- package/dist/builtins/device-history/device-history.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +3 -3
- package/dist/builtins/keychain/index.mjs +3 -3
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/auth-schema.d.ts +2 -12
- package/dist/builtins/local-auth/local-auth.addon.js +52 -191
- package/dist/builtins/local-auth/local-auth.addon.mjs +52 -191
- package/dist/builtins/local-auth/oauth-session-manager.d.ts +13 -4
- package/dist/builtins/local-auth/record-kinds.d.ts +1 -1
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/record-entries/index.js +1 -1
- package/dist/builtins/record-entries/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/file-host-protocol.d.ts +0 -9
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/owned-sqlite-file.d.ts +0 -8
- package/dist/builtins/sqlite-storage/records/records-sql.d.ts +0 -2
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +0 -28
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +1 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +6 -170
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +6 -170
- package/dist/builtins/sqlite-storage/storage-admin-provider.d.ts +3 -17
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +3 -3
- package/dist/builtins/system-config/system-config.addon.mjs +280 -280
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-b0e_2I-D.js → composition-sources-BPnpB9XG.js} +1 -1
- package/dist/{composition-sources-DNRZWR1j.mjs → composition-sources-BlcYzFwY.mjs} +1 -1
- package/dist/{constants-6OeJiZgi.js → constants-7ZMxWr8Z.js} +1 -1
- package/dist/{constants-BnkOdj9Q.mjs → constants-CH5UXe_G.mjs} +1 -1
- package/dist/{custom-action-registry-DStvrQKI.mjs → custom-action-registry-DZSCLBuT.mjs} +2 -0
- package/dist/{custom-action-registry-COyb49zm.js → custom-action-registry-MRyes5j0.js} +2 -0
- package/dist/{device-ca-Bnkw8GyU.mjs → device-ca-BU_gnd-q.mjs} +1 -1
- package/dist/{device-ca-CPTDs--d.js → device-ca-CUEx7sti.js} +1 -1
- package/dist/{dist-Wy8cTxg6.mjs → dist-8tWIDoWp.mjs} +15 -55
- package/dist/{dist-Bn-RNanh.js → dist-Ct-4tTeX.js} +14 -66
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-CJu0nhla.mjs → hub-mdns-ciao-Cuy7LUdz.mjs} +2 -2
- package/dist/{hub-mdns-ciao-CTBTlia4.js → hub-mdns-ciao-DJ-Amqd7.js} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +89 -241
- package/dist/index.mjs +90 -237
- package/dist/kernel/index.d.ts +0 -1
- package/dist/kernel/moleculer/runner-addon-settings.d.ts +1 -6
- package/dist/kernel/moleculer/runner-device-settings.d.ts +2 -2
- package/dist/{restore-archive-CM23Pq9B.mjs → restore-archive-BDua3jO6.mjs} +78 -78
- package/dist/{restore-archive-DM1OBYq4.js → restore-archive-HwOA83v3.js} +1 -1
- package/dist/{retired-settings-keys-D_VwZiDt.js → retired-settings-keys-CGUqX-Oz.js} +0 -6
- package/dist/{retired-settings-keys-Bhwe4ymb.mjs → retired-settings-keys-C_Kjp-Bj.mjs} +1 -1
- package/dist/{wal-maintenance-Bj_MmDkr.mjs → wal-maintenance-BvzVehem.mjs} +0 -0
- package/dist/{wal-maintenance-CaJjuLHq.js → wal-maintenance-DBvuVU9s.js} +0 -0
- package/package.json +1 -1
- package/dist/builtins/sqlite-storage/retired-collections.d.ts +0 -146
- package/dist/kernel/legacy-blob-guard.d.ts +0 -63
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retired COLLECTIONS — the boot-time drop of dead tables.
|
|
3
|
-
*
|
|
4
|
-
* ## Why this is not the retired-key purge
|
|
5
|
-
*
|
|
6
|
-
* `retired-settings-keys.ts` handles two shapes of dead configuration: keys
|
|
7
|
-
* inside a live row, and whole rows inside a live collection. Neither can
|
|
8
|
-
* express the third shape — a whole TABLE whose owning code is gone. Deleting
|
|
9
|
-
* its rows would leave the table, and the table is what makes a reader believe
|
|
10
|
-
* the feature still exists: `devices` and `device_settings_kv` sat in the
|
|
11
|
-
* schema of every hub, described by their own `@durable` records, next to a
|
|
12
|
-
* fleet of 974 cameras none of which had ever been written there.
|
|
13
|
-
*
|
|
14
|
-
* ## Where it runs: EVERY node, unlike the key purge
|
|
15
|
-
*
|
|
16
|
-
* The retired keys live in the hub-central settings store, so cleaning them
|
|
17
|
-
* anywhere else is work that can never find anything — hence
|
|
18
|
-
* `settingsStoreIsAuthoritativeHere`. A retired table is the opposite: it was
|
|
19
|
-
* materialised by a `declareCollection` that ran inside whatever engine the
|
|
20
|
-
* declaring code booted next to, so every node that ever ran that code has its
|
|
21
|
-
* own copy. This purge is therefore NOT role-gated — and it takes no `env`
|
|
22
|
-
* parameter at all, where its sibling does, so that the gate cannot be added
|
|
23
|
-
* back by copying a signature.
|
|
24
|
-
*
|
|
25
|
-
* ## Contract
|
|
26
|
-
*
|
|
27
|
-
* - **Idempotent.** An absent table plans nothing, drops nothing, logs nothing.
|
|
28
|
-
* - **Loud exactly once per drop**, and the line carries the row count. An
|
|
29
|
-
* empty drop is `info`; a drop that destroyed rows is `warn`, because
|
|
30
|
-
* "nothing read this" is a claim about the code and the number is the only
|
|
31
|
-
* evidence of what it cost on this machine.
|
|
32
|
-
* - **A fault never blocks boot.** A drop that throws is warned about and the
|
|
33
|
-
* next spec still runs; the next boot retries.
|
|
34
|
-
*
|
|
35
|
-
* ## Adding a collection
|
|
36
|
-
*
|
|
37
|
-
* Only add a table whose declaring code you have DELETED in the same change.
|
|
38
|
-
* A table listed here while something still declares it is dropped at every
|
|
39
|
-
* boot and recreated moments later — a churn no test would catch. Worse than
|
|
40
|
-
* churn, in fact: the purge is not role-gated, so a live table added here is
|
|
41
|
-
* dropped **on the hub too**, at every boot, and the rows are reported only
|
|
42
|
-
* after they are gone. `scripts/check-retired-collections-are-dead.ts` now
|
|
43
|
-
* refuses any entry that still appears in `docs/reference/storage.md`.
|
|
44
|
-
*
|
|
45
|
-
* ## What this list can NOT retire: a whole node's store
|
|
46
|
-
*
|
|
47
|
-
* On 2026-09-01 agents stopped booting a `data-store-provider` of their own
|
|
48
|
-
* (`server/backend/src/agent/agent-infra-capabilities.ts`). It looks like a
|
|
49
|
-
* deletion that should retire its tables. It is not, for two independent
|
|
50
|
-
* reasons, and both are worth writing down because the next session will reach
|
|
51
|
-
* for this file first:
|
|
52
|
-
*
|
|
53
|
-
* 1. **Every table an agent held is a table the hub still declares.**
|
|
54
|
-
* `addon-settings`, `storage_locations`, `system-settings`, `sections`,
|
|
55
|
-
* `provider-settings`, the `device-*` family, `alerts`, `vec_indexes` and
|
|
56
|
-
* each `<addonId>:addon-settings` variant are all live on the hub. Listing
|
|
57
|
-
* any of them here drops the HUB's copy — see the guard.
|
|
58
|
-
* 2. **The purge runs inside the engine's boot, and the agent no longer boots
|
|
59
|
-
* one.** Nothing on that node would execute the drop even if a name were
|
|
60
|
-
* safe to add. This is not hypothetical: the `macmini` node's leftover
|
|
61
|
-
* store still carries `devices` and `device_settings_kv` — the two tables
|
|
62
|
-
* D183 retired — because its engine has not booted since 2026-05-09.
|
|
63
|
-
*
|
|
64
|
-
* The agent's leftover `camstack.db` is therefore inert, not resurrectable: no
|
|
65
|
-
* engine opens it and no code reads it. Its disposal is an operator decision,
|
|
66
|
-
* not a boot-time one, and it is recorded in the ADR rather than automated
|
|
67
|
-
* here — this module drops TABLES, and deleting somebody's database file is a
|
|
68
|
-
* different kind of act.
|
|
69
|
-
*/
|
|
70
|
-
import type { OwnedSqliteFile } from "./owned-sqlite-file.js";
|
|
71
|
-
import type { RetiredKeyLogger } from "./retired-settings-keys.js";
|
|
72
|
-
import type { DroppedTable, SqliteSettingsBackend } from "./sqlite-settings-backend.js";
|
|
73
|
-
/** One retired-table declaration. */
|
|
74
|
-
export interface RetiredCollectionSpec {
|
|
75
|
-
/**
|
|
76
|
-
* The table name as it exists on disk. These tables are NOT namespaced —
|
|
77
|
-
* the retired code declared them bare — so this is the literal name, not a
|
|
78
|
-
* `<namespace>:<collection>` pair to be resolved.
|
|
79
|
-
*/
|
|
80
|
-
readonly collection: string;
|
|
81
|
-
/** The code that used to own it — reported, never used to address it. */
|
|
82
|
-
readonly owner: string;
|
|
83
|
-
/** Why it is dead. Cited in the log line, not re-derived at the call site. */
|
|
84
|
-
readonly reason: string;
|
|
85
|
-
}
|
|
86
|
-
/** What one drop destroyed. */
|
|
87
|
-
export interface RetiredCollectionDrop {
|
|
88
|
-
readonly collection: string;
|
|
89
|
-
readonly owner: string;
|
|
90
|
-
/** Rows the table held. Zero is the expected case and is still reported. */
|
|
91
|
-
readonly rows: number;
|
|
92
|
-
}
|
|
93
|
-
/** The engine access the purge needs. Narrow on purpose — trivially fakeable. */
|
|
94
|
-
export interface RetiredCollectionStore {
|
|
95
|
-
/** Drop `collection`, or answer `null` when it is not there. Throws on fault. */
|
|
96
|
-
drop(collection: string): Promise<DroppedTable | null>;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* The dead tables.
|
|
100
|
-
*
|
|
101
|
-
* `devices` / `device_settings_kv` — the device half of the
|
|
102
|
-
* integration-registry ([D183](../../../../../docs/decisions/adr-0183.md)).
|
|
103
|
-
* The registry's INTEGRATION half is live (`integrations`,
|
|
104
|
-
* `integration_settings`); its device half never had a production caller and
|
|
105
|
-
* never had a row. The fleet lives in `device-manager:devices`, under numeric
|
|
106
|
-
* ids, while these tables key on `dev_NNNN` — the two id-spaces could not be
|
|
107
|
-
* reconciled even if something had wanted to.
|
|
108
|
-
*
|
|
109
|
-
* `pipeline-analytics:track-groups` / `:track-group-members` — the co-moving
|
|
110
|
-
* GROUP entity. It shipped on 2026-08-24 and was kill-switched the same day
|
|
111
|
-
* (duplicate sealed rows made Library → Gruppi unusable); the operator decided
|
|
112
|
-
* on 2026-09-01 to delete it rather than re-open it. The clusterer, the live
|
|
113
|
-
* buffer, the sealer, the query, the two cap methods and the two custom
|
|
114
|
-
* actions are gone, so nothing declares these tables any more. The group-owned
|
|
115
|
-
* MEDIA rows are NOT here — they live in the shared `pipeline-analytics:media`
|
|
116
|
-
* and are collected by the orphan audit through `RETIRED_OWNER_KINDS`.
|
|
117
|
-
*
|
|
118
|
-
* `pipeline-analytics:summaries` / `:summary-members` — the session SUMMARY,
|
|
119
|
-
* the entity that grouped tracks by proximity at birth (D489) and split them
|
|
120
|
-
* when they walked apart (D490). Its production path was switched off on
|
|
121
|
-
* 2026-09-16 and the operator decided on 2026-09-29 to delete it (D680): the
|
|
122
|
-
* sealer, the store, the group shot, the three cap methods and the digest's
|
|
123
|
-
* `groups` reading are gone, so nothing declares these tables. The group
|
|
124
|
-
* shots were `summary`-owned rows in `pipeline-analytics:media` and go the
|
|
125
|
-
* same way as the group entity's — through `RETIRED_OWNER_KINDS`.
|
|
126
|
-
*/
|
|
127
|
-
export declare const RETIRED_COLLECTIONS: readonly RetiredCollectionSpec[];
|
|
128
|
-
/**
|
|
129
|
-
* Adapt the SQLite engine to {@link RetiredCollectionStore}.
|
|
130
|
-
*
|
|
131
|
-
* The DDL itself is the engine's — it owns the handle and the memos a drop has
|
|
132
|
-
* to evict. This module owns only the list and the reporting.
|
|
133
|
-
*/
|
|
134
|
-
export declare function retiredCollectionStoreOf(backend: SqliteSettingsBackend): RetiredCollectionStore;
|
|
135
|
-
/**
|
|
136
|
-
* The same adapter over an {@link OwnedSqliteFile} — the purge runs against
|
|
137
|
-
* EVERY open database file (D851), and a file served by a worker answers the
|
|
138
|
-
* drop through its thread.
|
|
139
|
-
*/
|
|
140
|
-
export declare function retiredCollectionStoreOfFile(file: OwnedSqliteFile): RetiredCollectionStore;
|
|
141
|
-
/**
|
|
142
|
-
* Drop every retired table that is still present. Returns one entry per table
|
|
143
|
-
* actually dropped — empty when the schema is already clean, which is the
|
|
144
|
-
* steady state after the first boot that ran it.
|
|
145
|
-
*/
|
|
146
|
-
export declare function purgeRetiredCollections(store: RetiredCollectionStore, logger: RetiredKeyLogger, specs?: readonly RetiredCollectionSpec[]): Promise<readonly RetiredCollectionDrop[]>;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The boot guard of the D870 cut-over: an addon never starts on `absent`.
|
|
3
|
-
*
|
|
4
|
-
* Until `scripts/hub/migrate-device-store.ts --copy` has run, a forked addon's
|
|
5
|
-
* settings still sit in its per-addon blobs (`<addonId>:addon-devices`,
|
|
6
|
-
* `<addonId>:addon-settings` / `root`) while the standard rows are empty. New
|
|
7
|
-
* code reads only the standard rows, so it would run on "no settings" - every
|
|
8
|
-
* camera unconfigured, recording off, with nothing in a log. Instead the addon
|
|
9
|
-
* REFUSES to start, and says why.
|
|
10
|
-
*
|
|
11
|
-
* Reads of an unwritten scoped table answer absent and create nothing, so the
|
|
12
|
-
* guard costs two counts and a `get` on a hub that never had blobs, and it goes
|
|
13
|
-
* quiet by itself once `--drop` removed the old tables.
|
|
14
|
-
*/
|
|
15
|
-
import type { IScopedLogger } from "@camstack/types";
|
|
16
|
-
import { AddonRefusedError } from "./addon-refused-error.js";
|
|
17
|
-
/** Is `key` of `addonId` a root key that was retired (and must not be migrated)? */
|
|
18
|
-
export declare function isRetiredRootKey(addonId: string, key: string): boolean;
|
|
19
|
-
/** The client calls the guard uses. */
|
|
20
|
-
export interface LegacyGuardClient {
|
|
21
|
-
readonly query: {
|
|
22
|
-
query(input: {
|
|
23
|
-
namespace?: string;
|
|
24
|
-
collection: string;
|
|
25
|
-
filter?: {
|
|
26
|
-
whereBetween: Record<string, [string, string]>;
|
|
27
|
-
orderBy: {
|
|
28
|
-
field: string;
|
|
29
|
-
direction: "asc" | "desc";
|
|
30
|
-
};
|
|
31
|
-
limit: number;
|
|
32
|
-
};
|
|
33
|
-
}): Promise<unknown>;
|
|
34
|
-
};
|
|
35
|
-
readonly get: {
|
|
36
|
-
query(input: {
|
|
37
|
-
namespace: string;
|
|
38
|
-
collection: string;
|
|
39
|
-
key: string;
|
|
40
|
-
}): Promise<unknown>;
|
|
41
|
-
};
|
|
42
|
-
readonly count: {
|
|
43
|
-
query(input: {
|
|
44
|
-
namespace?: string;
|
|
45
|
-
collection: string;
|
|
46
|
-
filter?: {
|
|
47
|
-
whereBetween: Record<string, [string, string]>;
|
|
48
|
-
};
|
|
49
|
-
}): Promise<unknown>;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/** Stable `code` of the D870 refusal. */
|
|
53
|
-
export declare const UNMIGRATED_SETTINGS_CODE = "unmigrated-settings";
|
|
54
|
-
/** The remedy the refusal (and the update pre-flight) names. */
|
|
55
|
-
export declare const UNMIGRATED_SETTINGS_REMEDY = "Run scripts/hub/migrate-device-store.ts --copy --apply (D870), then restart the addon.";
|
|
56
|
-
export declare class UnmigratedSettingsError extends AddonRefusedError {
|
|
57
|
-
constructor(addonId: string, what: string);
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* THROWS when the addon has blob settings and the standard store has none of
|
|
61
|
-
* its own. A store that cannot be asked also throws: it is not "no blobs".
|
|
62
|
-
*/
|
|
63
|
-
export declare function assertLegacyBlobsMigrated(client: LegacyGuardClient, addonId: string, logger: IScopedLogger): Promise<void>;
|