@camstack/system 1.2.468 → 1.2.470
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 +56 -25
- package/dist/addon-runner.mjs +56 -25
- package/dist/{agent-https-DJ8OzQOr.js → agent-https-D_oo3PNv.js} +1 -1
- package/dist/{agent-https-DR1wmhYY.mjs → agent-https-DmNQyAl7.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.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- 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/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/capture/capture-engine.d.ts +24 -4
- package/dist/builtins/device-history/device-history.addon.js +319 -44
- package/dist/builtins/device-history/device-history.addon.mjs +319 -44
- package/dist/builtins/device-history/query/history-query.d.ts +19 -2
- package/dist/builtins/device-history/retention/orphans.d.ts +50 -0
- package/dist/builtins/device-history/retention/retention.d.ts +9 -2
- package/dist/builtins/device-history/runtime/history-runtime.d.ts +10 -2
- package/dist/builtins/device-history/store/history-store.d.ts +5 -0
- 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/device-manager/device-meta-types.d.ts +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/local-auth.addon.js +2 -2
- package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- 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/accelerator-reprobe.d.ts +23 -0
- package/dist/builtins/platform-probe/coral-accelerators.d.ts +37 -8
- package/dist/builtins/platform-probe/index.d.ts +17 -1
- package/dist/builtins/platform-probe/index.js +192 -11
- package/dist/builtins/platform-probe/index.mjs +192 -12
- package/dist/builtins/platform-probe/platform-scorer.d.ts +14 -0
- 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/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/sqlite-settings.addon.js +2 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- 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 +3 -3
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-Qto-S6MA.mjs → composition-sources-B0tqvf0t.mjs} +1 -1
- package/dist/{composition-sources-5rpWQhA1.js → composition-sources-CRJffEiB.js} +1 -1
- package/dist/{constants-BWli8Cju.mjs → constants--A505iuO.mjs} +1 -1
- package/dist/{constants-CuO3rcw4.js → constants-WF1AqoKF.js} +1 -1
- package/dist/{coral-accelerators-oUXmmbc2.js → coral-accelerators-Cri32b7q.js} +61 -24
- package/dist/{coral-accelerators-D_S1Fo5h.mjs → coral-accelerators-Dl-GnMHn.mjs} +56 -25
- package/dist/{device-ca-C5cLlah1.mjs → device-ca-DYmToMp8.mjs} +1 -1
- package/dist/{device-ca-CGcaSheI.js → device-ca-R4MZZtc0.js} +1 -1
- package/dist/{dist-l6zKmHEb.js → dist-DRL3rEfN.js} +335 -120
- package/dist/{dist-BpUtAgqR.mjs → dist-X1r44BdF.mjs} +324 -121
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-0KWDyIMD.mjs → hub-mdns-ciao-CZV5Hion.mjs} +2 -2
- package/dist/{hub-mdns-ciao-CIno_SNn.js → hub-mdns-ciao-DUoTS6jN.js} +2 -2
- package/dist/index.js +8 -8
- package/dist/index.mjs +8 -8
- package/dist/{restore-archive-B71JI-sP.js → restore-archive-Df6PsOHP.js} +1 -1
- package/dist/{restore-archive-DKxAZ9pI.mjs → restore-archive-X0ciGMmO.mjs} +1 -1
- package/dist/{wal-maintenance-BXYwFecW.mjs → wal-maintenance-D6J_MmZ8.mjs} +0 -0
- package/dist/{wal-maintenance-B6LSQ_OZ.js → wal-maintenance-DYvzJiuK.js} +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orphan series (D917): device series that are no longer linked to a device.
|
|
3
|
+
*
|
|
4
|
+
* - `device-gone` — the device is absent from the successful device listings:
|
|
5
|
+
* the {@link DepartureTracker}'s clock is running for it. The same knowledge
|
|
6
|
+
* the week-long departure purge uses, but REPORTED here the moment the clock
|
|
7
|
+
* starts, so an admin can see it.
|
|
8
|
+
* - `undeclared` — a `cap:` key no capability declares any more (a cap field
|
|
9
|
+
* that was removed, such as the `vacuum-control` tank levels D915 moved into
|
|
10
|
+
* `consumables`). Capture never writes it again; only retention would age it.
|
|
11
|
+
*
|
|
12
|
+
* Nothing is deleted on this judgement alone (D49): an admin deletes, by id,
|
|
13
|
+
* and each id is judged AGAIN at the moment of the delete — a device that came
|
|
14
|
+
* back between the listing and the click keeps its history.
|
|
15
|
+
*/
|
|
16
|
+
import type { DeviceHistoryOrphanDeleteEntry, DeviceHistoryOrphanList, DeviceHistoryOrphanReason, IScopedLogger } from "@camstack/types";
|
|
17
|
+
import type { HistoryStore, SeriesRecord } from "../store/history-store.js";
|
|
18
|
+
import type { SeriesRegistry } from "../store/series-registry.js";
|
|
19
|
+
import type { DepartureTracker } from "./departure-tracker.js";
|
|
20
|
+
import type { RetentionJob } from "./retention.js";
|
|
21
|
+
export interface OrphanVerdict {
|
|
22
|
+
readonly reason: DeviceHistoryOrphanReason;
|
|
23
|
+
readonly missingSince: number | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The orphan verdict of one series, or `null` when it is linked. PURE. A node
|
|
27
|
+
* series is never orphan here (its subject is a node, not a device).
|
|
28
|
+
*/
|
|
29
|
+
export declare function judgeOrphan(series: Pick<SeriesRecord, "key" | "deviceId">, declaredCapKeys: ReadonlySet<string>, missingSince: number | undefined): OrphanVerdict | null;
|
|
30
|
+
export interface OrphanSeriesDeps {
|
|
31
|
+
readonly store: HistoryStore;
|
|
32
|
+
readonly registry: SeriesRegistry;
|
|
33
|
+
readonly departures: DepartureTracker;
|
|
34
|
+
readonly retention: RetentionJob;
|
|
35
|
+
/** Every `cap:` series key the catalogs declare (fields and keyed-item fields). */
|
|
36
|
+
readonly declaredCapKeys: ReadonlySet<string>;
|
|
37
|
+
readonly logger: IScopedLogger;
|
|
38
|
+
readonly clock: () => number;
|
|
39
|
+
}
|
|
40
|
+
export declare class OrphanSeries {
|
|
41
|
+
private readonly deps;
|
|
42
|
+
constructor(deps: OrphanSeriesDeps);
|
|
43
|
+
private verdictOf;
|
|
44
|
+
/** Every orphan, ordered by device, key and scope, the first {@link DEVICE_HISTORY_ORPHAN_LIST_MAX} counted. */
|
|
45
|
+
list(): Promise<DeviceHistoryOrphanList>;
|
|
46
|
+
private rowsOf;
|
|
47
|
+
/** Delete orphans by id, one at a time, each re-judged now. One entry per id, in order. */
|
|
48
|
+
delete(seriesIds: readonly number[]): Promise<readonly DeviceHistoryOrphanDeleteEntry[]>;
|
|
49
|
+
private deleteOne;
|
|
50
|
+
}
|
|
@@ -54,8 +54,15 @@ export declare class RetentionJob {
|
|
|
54
54
|
/** Drop the visit markers of a purged series. */
|
|
55
55
|
forgetSeries(seriesId: number): void;
|
|
56
56
|
private deleteSliced;
|
|
57
|
-
/**
|
|
58
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Tier by tier in slices, then the series row (and whatever the slices missed).
|
|
59
|
+
* Answers the rows the slices deleted per tier. The caller removes the series
|
|
60
|
+
* from the registry, which releases its per-series state.
|
|
61
|
+
*/
|
|
62
|
+
purgeSeries(series: {
|
|
63
|
+
readonly id: number;
|
|
64
|
+
readonly firstTs: number;
|
|
65
|
+
}, now: number): Promise<Readonly<Record<StoredTier, number>>>;
|
|
59
66
|
/**
|
|
60
67
|
* Delete every series of a DELETED device now (D865). Driven by a tombstone
|
|
61
68
|
* through the `device-removal-hook`, never by a listing: the week-long
|
|
@@ -11,13 +11,14 @@
|
|
|
11
11
|
* Then {@link HistoryRuntime.startTimers} arms flush (10 s), rollups (60 s),
|
|
12
12
|
* reconcile (5 min), retention (10 min) and the row counts (30 min).
|
|
13
13
|
*/
|
|
14
|
-
import type { DeviceHistoryStatus, IScopedLogger } from "@camstack/types";
|
|
15
|
-
import { CaptureEngine, type HistoryCatalog, type SnapshotMap } from "../capture/capture-engine.js";
|
|
14
|
+
import type { DeviceHistoryOrphanDeleteEntry, DeviceHistoryOrphanList, DeviceHistoryStatus, IScopedLogger } from "@camstack/types";
|
|
15
|
+
import { CaptureEngine, type HistoryCatalog, type HistoryItemCatalog, type SnapshotMap } from "../capture/capture-engine.js";
|
|
16
16
|
import { DeviceDirectory, type DeviceTypeSource } from "../capture/device-directory.js";
|
|
17
17
|
import { PointWriter } from "../capture/point-writer.js";
|
|
18
18
|
import { ProducerIngest } from "../ingest/producer-ingest.js";
|
|
19
19
|
import { HistoryQuery } from "../query/history-query.js";
|
|
20
20
|
import { DepartureTracker } from "../retention/departure-tracker.js";
|
|
21
|
+
import { OrphanSeries } from "../retention/orphans.js";
|
|
21
22
|
import { RetentionJob, type RetentionPolicy } from "../retention/retention.js";
|
|
22
23
|
import { RollupEngine } from "../rollup/rollup-engine.js";
|
|
23
24
|
import { HistoryCounters } from "../status/counters.js";
|
|
@@ -36,6 +37,8 @@ export declare const FIRST_COUNT_DELAY_MS: number;
|
|
|
36
37
|
export interface HistoryRuntimeDeps {
|
|
37
38
|
readonly door: HistoryDoor;
|
|
38
39
|
readonly catalog: HistoryCatalog;
|
|
40
|
+
/** Keyed-array series (D917): the generated `HISTORY_ITEM_CATALOG`. */
|
|
41
|
+
readonly itemCatalog: HistoryItemCatalog;
|
|
39
42
|
readonly deviceSource: DeviceTypeSource;
|
|
40
43
|
readonly readSnapshots: () => Promise<SnapshotMap>;
|
|
41
44
|
readonly readCapSlice: (deviceId: number, capName: string) => Promise<Readonly<Record<string, unknown>> | null>;
|
|
@@ -56,6 +59,7 @@ export declare class HistoryRuntime {
|
|
|
56
59
|
readonly query: HistoryQuery;
|
|
57
60
|
readonly retentionJob: RetentionJob;
|
|
58
61
|
readonly departures: DepartureTracker;
|
|
62
|
+
readonly orphans: OrphanSeries;
|
|
59
63
|
private optedOutDevices;
|
|
60
64
|
private readonly tierCounts;
|
|
61
65
|
private readonly startedAt;
|
|
@@ -87,6 +91,10 @@ export declare class HistoryRuntime {
|
|
|
87
91
|
removeDevice(deviceId: number): Promise<{
|
|
88
92
|
series: number;
|
|
89
93
|
}>;
|
|
94
|
+
/** Device series no longer linked to a device — reported, never purged here. */
|
|
95
|
+
listOrphans(): Promise<DeviceHistoryOrphanList>;
|
|
96
|
+
/** Delete orphan series by id; a series that is not orphan NOW is refused. */
|
|
97
|
+
deleteOrphans(seriesIds: readonly number[]): Promise<readonly DeviceHistoryOrphanDeleteEntry[]>;
|
|
90
98
|
/** Series held per device, for the admin clean-up listing. */
|
|
91
99
|
seriesByDevice(): ReadonlyMap<number, number>;
|
|
92
100
|
status(): DeviceHistoryStatus;
|
|
@@ -83,6 +83,11 @@ export declare class HistoryStore {
|
|
|
83
83
|
deleteRange(tier: StoredTier, seriesId: number, lo: number, hiInclusive: number): Promise<number>;
|
|
84
84
|
/** Delete every row of one series, in every tier, then the series row. */
|
|
85
85
|
deleteSeries(seriesId: number): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* One series' rows of a tier: a range of the primary key (`series_id = ?`),
|
|
88
|
+
* never a scan of the tier (D447, asserted in `history-query-plans.spec.ts`).
|
|
89
|
+
*/
|
|
90
|
+
countSeriesRows(tier: StoredTier, seriesId: number): Promise<number>;
|
|
86
91
|
countRows(tier: StoredTier): Promise<number>;
|
|
87
92
|
loadOptOuts(): Promise<ReadonlySet<number>>;
|
|
88
93
|
setOptOut(deviceId: number, at: number): Promise<void>;
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-DRL3rEfN.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
8
|
const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
|
|
9
9
|
const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
|
|
@@ -3780,7 +3780,7 @@ async function deriveDeviceConfigContribution(deps, registry, def, entry, device
|
|
|
3780
3780
|
title: ui.label,
|
|
3781
3781
|
tab: ui.tab,
|
|
3782
3782
|
order: ui.order ?? 0,
|
|
3783
|
-
...ui.topTab ? { location: "top-tab" } : {},
|
|
3783
|
+
...ui.placement === "hero" ? { location: "hero" } : ui.topTab ? { location: "top-tab" } : {},
|
|
3784
3784
|
fields: [{
|
|
3785
3785
|
type: "widget",
|
|
3786
3786
|
key: `${entry.capName}Widget`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $i as
|
|
1
|
+
import { $i as isDeviceConfigCap, $r as errMsg, $t as deviceExtensionCapability, Ca as toSecretFieldView, Da as EventCategory, Di as SECRET_CLEAR, F as DeviceTombstoneSchema, Hi as collectZodSecretPaths, In as locationIconKey, Ki as defineRecordKinds, L as FieldClaimModeSchema, Mi as WELL_KNOWN_TAB_MAP, Mn as legacyAutoLinkIds, P as DeviceStatusSchema, Pt as canonicalIconKey, Qr as DeviceType, R as FieldClaimSchema, Ta as userError, Wt as createDeviceExtensionProvider, Xn as parseStreamParamsFormPatch, Xr as DeviceFeature, Y as MINUTES_PER_DAY, Yt as defineExtensionSlotProvider, Zr as DeviceRole, _a as resolveSecretMarkers, br as siteZoneKey, ei as BaseAddon, gn as formatMinutes, ia as isSecretMarkerLike, in as deviceStatusCapability, jt as buildStreamParamsConfigSchema, l as CAP_NAMES_WITH_STATUS, mr as runtimeStatePolicyFor, na as isSecretClear, on as enumerateItemArrayFields, ot as STREAM_PROFILE_META, qn as normalizeUnit, r as ALL_CAPABILITY_DEFINITIONS, ra as isSecretMarker, rn as deviceStateCapability, s as CAMERA_SWITCH_ORDER, sn as enumerateSchemaFields, ta as isKeychainStoredField, tn as deviceManagerCapability, un as expandContainer, w as DAY_NAMES, wa as transformSecretWrite, xa as sleep$1, ya as secretTreeFromPaths } from "../../dist-X1r44BdF.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
3
|
import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
|
|
4
4
|
import { t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
|
|
@@ -3775,7 +3775,7 @@ async function deriveDeviceConfigContribution(deps, registry, def, entry, device
|
|
|
3775
3775
|
title: ui.label,
|
|
3776
3776
|
tab: ui.tab,
|
|
3777
3777
|
order: ui.order ?? 0,
|
|
3778
|
-
...ui.topTab ? { location: "top-tab" } : {},
|
|
3778
|
+
...ui.placement === "hero" ? { location: "hero" } : ui.topTab ? { location: "top-tab" } : {},
|
|
3779
3779
|
fields: [{
|
|
3780
3780
|
type: "widget",
|
|
3781
3781
|
key: `${entry.capName}Widget`,
|
|
@@ -34,8 +34,8 @@ export interface ContributionShape {
|
|
|
34
34
|
defaultCollapsed?: boolean;
|
|
35
35
|
columns?: 1 | 2 | 3 | 4;
|
|
36
36
|
tab?: string;
|
|
37
|
-
/** Where the section renders. Default 'settings' (Config tab); 'top-tab' hoists into the device-detail tab bar via DeviceDetail discovery. */
|
|
38
|
-
location?: "settings" | "top-tab";
|
|
37
|
+
/** Where the section renders. Default 'settings' (Config tab); 'top-tab' hoists into the device-detail tab bar via DeviceDetail discovery; 'hero' shows it once directly under the device's hero card (D915). */
|
|
38
|
+
location?: "settings" | "top-tab" | "hero";
|
|
39
39
|
order?: number;
|
|
40
40
|
fields: unknown[];
|
|
41
41
|
}>;
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-DRL3rEfN.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
9
9
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ln as logDestinationCapability, ei as BaseAddon } from "../../dist-X1r44BdF.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
//#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
|
|
4
4
|
var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
|
|
@@ -3,10 +3,10 @@ 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-
|
|
7
|
-
const require_device_ca = require("../../device-ca-
|
|
6
|
+
const require_dist = require("../../dist-DRL3rEfN.js");
|
|
7
|
+
const require_device_ca = require("../../device-ca-R4MZZtc0.js");
|
|
8
8
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
9
|
-
const require_constants = require("../../constants-
|
|
9
|
+
const require_constants = require("../../constants-WF1AqoKF.js");
|
|
10
10
|
const require_platform_key_source = require("../../platform-key-source-Di7HrlGR.js");
|
|
11
11
|
let node_crypto = require("node:crypto");
|
|
12
12
|
let _camstack_types_node = require("@camstack/types/node");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-
|
|
1
|
+
import { An as keychainAdminCapability, Da as EventCategory, G as KeychainResetRecordSchema, Ki as defineRecordKinds, U as KEYCHAIN_RESET_TRIGGER_ACTOR, W as KeychainAuditEntrySchema, Xi as formatSecretScope, ei as BaseAddon, jn as keychainCapability, pa as parseSecretRef, ua as normalizeSecretOwner } from "../../dist-X1r44BdF.mjs";
|
|
2
|
+
import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-DYmToMp8.mjs";
|
|
3
3
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
4
|
-
import { a as MESH_CA_KEY_REF } from "../../constants
|
|
4
|
+
import { a as MESH_CA_KEY_REF } from "../../constants--A505iuO.mjs";
|
|
5
5
|
import { n as getPlatformKeychainKey } from "../../platform-key-source-BWlq0jjn.mjs";
|
|
6
6
|
import { createCipheriv, createDecipheriv, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
7
7
|
import { restrictDirToOwnerSync, restrictFileToOwnerSync, writeOwnerOnlyFileSync } from "@camstack/types/node";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("../../dist-
|
|
3
|
+
const require_dist = require("../../dist-DRL3rEfN.js");
|
|
4
4
|
//#region src/builtins/liveness-monitor/liveness-checks.ts
|
|
5
5
|
var NO_DEVICES = "liveness:no-devices";
|
|
6
6
|
var ALL_OFFLINE = "liveness:all-devices-offline";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $r as
|
|
1
|
+
import { $r as errMsg, Da as EventCategory, Ui as createEvent, ei as BaseAddon, it as RecordingStatusSchema, nt as RECORDING_SOURCE_CAMSTACK_ADDON } from "../../dist-X1r44BdF.mjs";
|
|
2
2
|
//#region src/builtins/liveness-monitor/liveness-checks.ts
|
|
3
3
|
var NO_DEVICES = "liveness:no-devices";
|
|
4
4
|
var ALL_OFFLINE = "liveness:all-devices-offline";
|
|
@@ -3,10 +3,10 @@ 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-
|
|
6
|
+
const require_dist = require("../../dist-DRL3rEfN.js");
|
|
7
7
|
const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
|
|
8
8
|
const require_ms$1 = require("../../ms-LB3giGoU.js");
|
|
9
|
-
const require_device_ca = require("../../device-ca-
|
|
9
|
+
const require_device_ca = require("../../device-ca-R4MZZtc0.js");
|
|
10
10
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
11
11
|
let zod = require("zod");
|
|
12
12
|
let node_crypto = require("node:crypto");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as PreferenceDeviceIdSchema, At as buildDeviceSignatureMessage, E as DEVICE_ENROLLMENT_TTL_MS, Ki as defineRecordKinds, O as DEVICE_NONCE_TTL_MS, Q as PREFERENCES_MAX_VALUE_BYTES, Qt as deviceCredentialsCapability, Ta as userError, ei as BaseAddon, et as PreferenceNamespaceSchema, gt as UserRecordSchema, h as CREDENTIAL_TOKEN_AUDIENCE, hn as formatDeviceRevoker, jr as userManagementCapability, kt as buildDeviceEnrollmentLink, lt as SsoBridgeClaimsSchema, mt as TokenScopeSchema, oa as makeSecretMarker, ra as isSecretMarker, st as ScopedTokenSchema, tt as PreferenceValueSchema, wn as isCredentialTokenPayload, wt as authProviderCapability, y as CredentialTokenClaimsSchema } from "../../dist-X1r44BdF.mjs";
|
|
3
3
|
import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
|
|
4
4
|
import { t as require_ms } from "../../ms-CgH2OFlD.mjs";
|
|
5
|
-
import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-
|
|
5
|
+
import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-DYmToMp8.mjs";
|
|
6
6
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import * as crypto$1 from "node:crypto";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("../../dist-
|
|
4
|
-
const require_hub_mdns_ciao = require("../../hub-mdns-ciao-
|
|
3
|
+
const require_dist = require("../../dist-DRL3rEfN.js");
|
|
4
|
+
const require_hub_mdns_ciao = require("../../hub-mdns-ciao-DUoTS6jN.js");
|
|
5
5
|
let zod = require("zod");
|
|
6
6
|
let node_net = require("node:net");
|
|
7
7
|
let node_os = require("node:os");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $r as
|
|
2
|
-
import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-
|
|
1
|
+
import { $r as errMsg, Da as EventCategory, Fn as localNetworkCapability, Ft as checkRoleAddress, H as HUB_MDNS_TXT_KEYS, Nr as validateCustomAddress, Tn as isDefaultAppConnectionEndpoint, V as HUB_MDNS_SERVICE_TYPE, Z as NetworkTunnelStartedDataSchema, Zn as pickAppLinkHub, c as CAMSTACK_APP_LINK_ORIGIN, ei as BaseAddon, or as resolveAppConnections, pr as resolveNotificationTapAddress, ur as resolveHubAddressRoles, xn as isAppLinkBase, yr as shortHostname } from "../../dist-X1r44BdF.mjs";
|
|
2
|
+
import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-CZV5Hion.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { isIP } from "node:net";
|
|
5
5
|
import * as os$1 from "node:os";
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-DRL3rEfN.js");
|
|
7
7
|
const require_log_read_filter = require("../../log-read-filter-Bi066jwU.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ln as logDestinationCapability, ei as BaseAddon } from "../../dist-X1r44BdF.mjs";
|
|
2
2
|
import { n as compileLogFilter, o as lineMatches } from "../../log-read-filter-D7Ev3zm-.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-DRL3rEfN.js");
|
|
7
7
|
let node_fs_promises = require("node:fs/promises");
|
|
8
8
|
let node_util = require("node:util");
|
|
9
9
|
let node_os = require("node:os");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $r as
|
|
1
|
+
import { $r as errMsg, Da as EventCategory, Ui as createEvent, Un as metricsProviderCapability, ei as BaseAddon, ht as UNATTRIBUTED_BUCKET_KEY, ir as reducePoints, mn as foldSnapshotByFunction, rt as ROOT_BUCKET_KEY, sr as resolveBucketMs } from "../../dist-X1r44BdF.mjs";
|
|
2
2
|
import { access, readFile, readdir } from "node:fs/promises";
|
|
3
3
|
import { promisify } from "node:util";
|
|
4
4
|
import * as os$1 from "node:os";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CoralInfo, InferenceDeviceDescriptor, PlatformCapabilities } from "@camstack/types";
|
|
2
|
+
import type { CoralDetection } from "./coral-accelerators.js";
|
|
3
|
+
/** Device keys that appeared and disappeared between two probes, sorted. */
|
|
4
|
+
export interface InferenceDeviceSetChange {
|
|
5
|
+
readonly appeared: readonly string[];
|
|
6
|
+
readonly disappeared: readonly string[];
|
|
7
|
+
}
|
|
8
|
+
/** The result of one accelerator re-probe. */
|
|
9
|
+
export interface AcceleratorReprobe {
|
|
10
|
+
readonly caps: PlatformCapabilities;
|
|
11
|
+
readonly change: InferenceDeviceSetChange;
|
|
12
|
+
readonly detection: CoralDetection;
|
|
13
|
+
}
|
|
14
|
+
/** A stable signature of a Coral answer — what decides "did it change". */
|
|
15
|
+
export declare function coralSignature(coral: CoralInfo | null | undefined): string;
|
|
16
|
+
/** Which device keys a new probe added and removed. */
|
|
17
|
+
export declare function diffInferenceDevices(previous: readonly InferenceDeviceDescriptor[], next: readonly InferenceDeviceDescriptor[]): InferenceDeviceSetChange;
|
|
18
|
+
/**
|
|
19
|
+
* The capabilities with a new Coral answer: hardware, scores and the device
|
|
20
|
+
* enumeration are all derived again from it, so the edgetpu runtime and its
|
|
21
|
+
* devices follow the hardware rather than the boot-time snapshot.
|
|
22
|
+
*/
|
|
23
|
+
export declare function withCoral(caps: PlatformCapabilities, coral: CoralInfo | null): PlatformCapabilities;
|
|
@@ -6,8 +6,12 @@ import { type EdgetpuDelegateLookup } from "@camstack/types/node";
|
|
|
6
6
|
* stays a pure, unit-testable function over injected reads.
|
|
7
7
|
*/
|
|
8
8
|
export interface CoralFs {
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* USB device directory names under `/sys/bus/usb/devices` (e.g. `2-4`), or
|
|
11
|
+
* `null` when the bus cannot be read at all (no `/sys`, a restricted view).
|
|
12
|
+
* `null` and an empty listing both mean "the bus is not observable".
|
|
13
|
+
*/
|
|
14
|
+
listUsbDevices(): readonly string[] | null;
|
|
11
15
|
/** Read a `<sysfsNode>/<attr>` value (idVendor / idProduct), trimmed. */
|
|
12
16
|
readUsbAttr(device: string, attr: string): string;
|
|
13
17
|
/** PCI function names under `/sys/bus/pci/devices` (e.g. `0000:03:00.0`). */
|
|
@@ -29,20 +33,45 @@ export interface CoralFs {
|
|
|
29
33
|
* `/data/deps/edgetpu/lib/libedgetpu.so.1`.
|
|
30
34
|
*/
|
|
31
35
|
export type EdgetpuDelegateHost = Omit<EdgetpuDelegateLookup, "exists">;
|
|
36
|
+
/** Whether this process could see the USB bus at all. */
|
|
37
|
+
export type CoralUsbBusView = "observed" | "unobservable";
|
|
32
38
|
/**
|
|
33
|
-
*
|
|
39
|
+
* Which evidence decided the Coral answer — logged by the probe so a node
|
|
40
|
+
* that reports (or stops reporting) a Coral says WHY:
|
|
41
|
+
* - `usb-ids` — a Coral USB id is on the bus;
|
|
42
|
+
* - `pci` — a PCIe/M.2 Coral (usable or not) is on the PCI bus;
|
|
43
|
+
* - `delegate-fallback` — the USB bus is not observable and the libedgetpu
|
|
44
|
+
* delegate is installed, so one USB unit is ASSUMED;
|
|
45
|
+
* - `none` — no Coral.
|
|
46
|
+
*/
|
|
47
|
+
export type CoralDecision = "usb-ids" | "pci" | "delegate-fallback" | "none";
|
|
48
|
+
export interface CoralDetection {
|
|
49
|
+
readonly info: CoralInfo | null;
|
|
50
|
+
readonly usbBus: CoralUsbBusView;
|
|
51
|
+
readonly decidedBy: CoralDecision;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Detect Coral Edge TPUs on USB and PCIe/M.2 — the answer only. See
|
|
55
|
+
* {@link detectCoralAccelerator} for the evidence that decided it.
|
|
56
|
+
*/
|
|
57
|
+
export declare function classifyCoralAccelerator(fsx: CoralFs, delegateHost?: EdgetpuDelegateHost): CoralInfo | null;
|
|
58
|
+
/**
|
|
59
|
+
* Detect Coral Edge TPUs on USB and PCIe/M.2, with the evidence that decided.
|
|
34
60
|
*
|
|
35
61
|
* - USB: every matching USB device counts (multiple Corals run concurrently).
|
|
36
62
|
* - PCIe: the apex driver's units, each usable only if its device node opens;
|
|
37
63
|
* a Coral PCI function the driver did not bind is `driver-missing`.
|
|
38
|
-
* - Fallback: when
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
64
|
+
* - Fallback: when the USB bus is NOT OBSERVABLE (`/sys/bus/usb/devices`
|
|
65
|
+
* missing, unreadable or empty — a macOS desktop, a restricted container)
|
|
66
|
+
* and no PCI Coral was seen, an installed libedgetpu delegate means one USB
|
|
67
|
+
* Coral is assumed. A bus that IS readable and lists no Coral id is the
|
|
68
|
+
* answer: no USB Coral. The delegate stays installed after a stick is
|
|
69
|
+
* unplugged or moved to another node, so it is evidence only where nothing
|
|
70
|
+
* better exists (D919).
|
|
42
71
|
*
|
|
43
72
|
* Returns `null` only when no Coral was found at all; a present-but-unusable
|
|
44
73
|
* Coral is reported with its typed reason, never as absent (D393/D315).
|
|
45
74
|
*/
|
|
46
|
-
export declare function
|
|
75
|
+
export declare function detectCoralAccelerator(fsx: CoralFs, delegateHost?: EdgetpuDelegateHost): CoralDetection;
|
|
47
76
|
/** The real filesystem view: `/sys` for enumeration, `/dev` for access. */
|
|
48
77
|
export declare const nodeCoralFs: CoralFs;
|
|
@@ -5,13 +5,19 @@
|
|
|
5
5
|
* exposes the result via the `platform-probe` capability (singleton per
|
|
6
6
|
* node).
|
|
7
7
|
*/
|
|
8
|
-
import type { ProviderRegistration } from "@camstack/types";
|
|
8
|
+
import type { ProviderRegistration, AcceleratorRescan } from "@camstack/types";
|
|
9
9
|
import { BaseAddon } from "@camstack/types";
|
|
10
10
|
export { PlatformScorer } from "./platform-scorer.js";
|
|
11
11
|
export { InferenceConfigResolver } from "./inference-config-resolver.js";
|
|
12
|
+
/** How often the accelerator part of the probe is re-run (D919). Cheap: `/sys` + `/dev` reads. */
|
|
13
|
+
export declare const ACCELERATOR_REPROBE_INTERVAL_MS = 6e4;
|
|
14
|
+
/** What started an accelerator re-probe — logged with every change. */
|
|
15
|
+
export type AcceleratorReprobeTrigger = "periodic" | "operator";
|
|
12
16
|
export declare class PlatformProbeNativeAddon extends BaseAddon {
|
|
13
17
|
private scorer;
|
|
14
18
|
private cachedCaps;
|
|
19
|
+
/** The periodic accelerator re-probe; started once the full probe completed. */
|
|
20
|
+
private reprobeTimer;
|
|
15
21
|
/**
|
|
16
22
|
* Per-boot generation stamp for the manual readiness emissions below.
|
|
17
23
|
* Constant for the lifetime of this addon instance (== one process boot);
|
|
@@ -36,6 +42,16 @@ export declare class PlatformProbeNativeAddon extends BaseAddon {
|
|
|
36
42
|
/** Emit a `system.ready-state` transition for the platform-probe cap. */
|
|
37
43
|
private emitProbeReadiness;
|
|
38
44
|
protected onInitialize(): Promise<ProviderRegistration[]>;
|
|
45
|
+
/** Start the periodic accelerator re-probe (idempotent). */
|
|
46
|
+
private startAcceleratorReprobe;
|
|
47
|
+
/**
|
|
48
|
+
* Re-run the accelerator part of the probe and serve its answer from now on.
|
|
49
|
+
* Every device that appeared or disappeared is logged, naming the node and
|
|
50
|
+
* what triggered the re-probe; the orchestrator sees the new list on its next
|
|
51
|
+
* `getCapabilities` read and re-elects through its device-set-change path.
|
|
52
|
+
* `null` when the scorer is gone or has not completed its first probe.
|
|
53
|
+
*/
|
|
54
|
+
reprobeAccelerators(trigger: AcceleratorReprobeTrigger): AcceleratorRescan | null;
|
|
39
55
|
protected onShutdown(): Promise<void>;
|
|
40
56
|
}
|
|
41
57
|
export default PlatformProbeNativeAddon;
|