@camstack/types 1.2.112 → 1.2.114
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/capabilities/face-gallery.cap.d.ts +60 -0
- package/dist/capabilities/index.d.ts +2 -2
- package/dist/capabilities/recording.cap.d.ts +18 -0
- package/dist/capabilities/system.cap.d.ts +618 -1
- package/dist/catalogs/index.d.ts +1 -0
- package/dist/catalogs/sensor-active-state.d.ts +130 -0
- package/dist/generated/addon-api.d.ts +21 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.js +882 -107
- package/dist/index.mjs +850 -108
- package/dist/interfaces/recording-config.d.ts +44 -0
- package/dist/pipeline/native-lease.d.ts +9 -1
- package/dist/types/detection.d.ts +11 -2
- package/dist/types/labels.d.ts +26 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1436,6 +1436,76 @@ var OPS_LOG_RING_DEFAULT_MAX = 500;
|
|
|
1436
1436
|
/** Default page size for a `listOpsLog` query when the caller omits `limit`. */
|
|
1437
1437
|
var OPS_LOG_DEFAULT_LIMIT = 200;
|
|
1438
1438
|
//#endregion
|
|
1439
|
+
//#region src/types/labels.ts
|
|
1440
|
+
var LabelDefinitionSchema = zod.z.object({
|
|
1441
|
+
id: zod.z.string(),
|
|
1442
|
+
name: zod.z.string(),
|
|
1443
|
+
category: zod.z.string().optional(),
|
|
1444
|
+
description: zod.z.string().optional(),
|
|
1445
|
+
icon: zod.z.string().optional()
|
|
1446
|
+
});
|
|
1447
|
+
/** Detection-macro targets a catalog `classMap` may resolve to. */
|
|
1448
|
+
var CLASS_MAP_MACRO_TARGETS = [
|
|
1449
|
+
"person",
|
|
1450
|
+
"vehicle",
|
|
1451
|
+
"animal",
|
|
1452
|
+
"package"
|
|
1453
|
+
];
|
|
1454
|
+
/**
|
|
1455
|
+
* Le macro classi di PRIMO LIVELLO: quelle che un object detector emette e che
|
|
1456
|
+
* un operatore può selezionare.
|
|
1457
|
+
*
|
|
1458
|
+
* Sono le tre offerte dallo step `object-detection`
|
|
1459
|
+
* (`addon-pipeline/src/detection-pipeline/registry/step-definitions.ts`,
|
|
1460
|
+
* `enabledMacroClasses`). `package` sta in {@link CLASS_MAP_MACRO_TARGETS} e in
|
|
1461
|
+
* `MACRO_LABELS` — è una macro vera — ma NON qui: appartiene allo step
|
|
1462
|
+
* `package-detection`, la cui abilitazione è guidata dalle zone, e offrire la
|
|
1463
|
+
* stessa parola due volte ha già fatto accendere a un operatore il proxy COCO
|
|
1464
|
+
* (suitcase/backpack/handbag) lasciando spento il detector dedicato.
|
|
1465
|
+
*
|
|
1466
|
+
* UNA lista. Prima di oggi le stesse tre erano scritte a mano nell'offerta
|
|
1467
|
+
* dello step e una seconda volta come union `FirstLevelMacro`
|
|
1468
|
+
* (`types/detection.ts`); una terza copia per il trigger di registrazione
|
|
1469
|
+
* (`RecordingTriggers.objectClasses`) avrebbe reso invisibile la divergenza
|
|
1470
|
+
* successiva.
|
|
1471
|
+
*/
|
|
1472
|
+
var FIRST_LEVEL_MACRO_CLASSES = [
|
|
1473
|
+
"person",
|
|
1474
|
+
"vehicle",
|
|
1475
|
+
"animal"
|
|
1476
|
+
];
|
|
1477
|
+
/**
|
|
1478
|
+
* True quando `value` è una macro di primo livello. Type guard, non cast: un
|
|
1479
|
+
* `className` che arriva dal bus è una stringa qualunque finché non passa di
|
|
1480
|
+
* qui.
|
|
1481
|
+
*/
|
|
1482
|
+
function isFirstLevelMacroClass(value) {
|
|
1483
|
+
return FIRST_LEVEL_MACRO_CLASSES.some((macro) => macro === value);
|
|
1484
|
+
}
|
|
1485
|
+
/**
|
|
1486
|
+
* Wire schema for a per-model CATALOG classMap override
|
|
1487
|
+
* (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
|
|
1488
|
+
* restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
|
|
1489
|
+
* detection pipeline executor actually routes.
|
|
1490
|
+
*
|
|
1491
|
+
* This is deliberately a DIFFERENT, narrower shape than the general-purpose
|
|
1492
|
+
* `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
|
|
1493
|
+
* and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
|
|
1494
|
+
* enum) — the two used to share the name `ClassMapDefinition`/
|
|
1495
|
+
* `ClassMapDefinitionSchema`, which made the schema-type-twin guard
|
|
1496
|
+
* (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
|
|
1497
|
+
* are not: it is two different concepts colliding on a name. Keep this type
|
|
1498
|
+
* under its own name rather than reusing `ClassMapDefinition` — reusing it
|
|
1499
|
+
* would either narrow every `ClassMapDefinition` consumer to the four
|
|
1500
|
+
* detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
|
|
1501
|
+
* schema exists for (see the "rejects a classMap whose target is not a
|
|
1502
|
+
* detection macro" test in `model-catalog-schema.test.ts`).
|
|
1503
|
+
*/
|
|
1504
|
+
var DetectionCatalogClassMapSchema = zod.z.object({
|
|
1505
|
+
mapping: zod.z.record(zod.z.string(), zod.z.enum(CLASS_MAP_MACRO_TARGETS)),
|
|
1506
|
+
preserveOriginal: zod.z.boolean()
|
|
1507
|
+
});
|
|
1508
|
+
//#endregion
|
|
1439
1509
|
//#region src/interfaces/recording-config.ts
|
|
1440
1510
|
/**
|
|
1441
1511
|
* THE canonical event-clip pad: the time window a single-timestamp analytics
|
|
@@ -1478,10 +1548,64 @@ var RecordingStorageModeSchema = zod.z.enum([
|
|
|
1478
1548
|
"events",
|
|
1479
1549
|
"continuous"
|
|
1480
1550
|
]);
|
|
1551
|
+
/**
|
|
1552
|
+
* Le macro classi che possono aprire una finestra di registrazione — le stesse
|
|
1553
|
+
* tre offerte dallo step `object-detection`, da UNA lista
|
|
1554
|
+
* ({@link FIRST_LEVEL_MACRO_CLASSES}).
|
|
1555
|
+
*/
|
|
1556
|
+
var RecordingObjectTriggerClassSchema = zod.z.enum(FIRST_LEVEL_MACRO_CLASSES);
|
|
1557
|
+
/**
|
|
1558
|
+
* True quando `values` non ripete un elemento.
|
|
1559
|
+
*
|
|
1560
|
+
* Un duplicato non è innocuo: ogni voce di `objectClasses` / `sensorDeviceIds`
|
|
1561
|
+
* diventa una SORGENTE in `bandTriggerSources`, e la stessa sorgente due volte
|
|
1562
|
+
* conterebbe due volte le sue finestre in `segmentMissedByMs`.
|
|
1563
|
+
*/
|
|
1564
|
+
var noDuplicates = (values) => new Set(values).size === values.length;
|
|
1565
|
+
/**
|
|
1566
|
+
* Quanti device sorgente una singola banda può ascoltare.
|
|
1567
|
+
*
|
|
1568
|
+
* Non è un gusto: ogni sorgente è una CHIAVE nel `TriggerState` del recorder, e
|
|
1569
|
+
* il limite per chiave (`MAX_TRIGGER_WINDOWS = 32`) senza un limite sulle
|
|
1570
|
+
* chiavi lascerebbe crescere la mappa con l'inventario dell'operatore. 16
|
|
1571
|
+
* sensori su UNA camera è già oltre qualunque installazione osservata.
|
|
1572
|
+
*/
|
|
1573
|
+
var MAX_SENSOR_TRIGGER_DEVICES = 16;
|
|
1481
1574
|
/** Which detectors trigger an `events`-mode band. */
|
|
1482
1575
|
var RecordingTriggersSchema = zod.z.object({
|
|
1483
1576
|
motion: zod.z.boolean().optional(),
|
|
1484
|
-
audioThresholdDbfs: zod.z.number().optional()
|
|
1577
|
+
audioThresholdDbfs: zod.z.number().optional(),
|
|
1578
|
+
/**
|
|
1579
|
+
* Le macro classi la cui detection apre una finestra. ASSENTE = la sorgente
|
|
1580
|
+
* non è ascoltata; un array VUOTO è rifiutato, perché "banda events, trigger
|
|
1581
|
+
* object acceso, nessuna classe" è la stessa forma "abilitata e non registra
|
|
1582
|
+
* nulla, per sempre" contro cui è scritto `eventsBandCanEverDemand`.
|
|
1583
|
+
*
|
|
1584
|
+
* Il segnale letto è GIÀ FILTRATO: solo detection `source: 'pipeline'`, cioè
|
|
1585
|
+
* quelle che hanno attraversato `enabledMacroClasses`, i
|
|
1586
|
+
* `minConfidence<Macro>` e il full-frame guard. L'AI a bordo camera
|
|
1587
|
+
* (`source: 'onboard'`) non attraversa nessuno di quei gate e NON apre
|
|
1588
|
+
* finestre — vedi `recorder/object-trigger.ts`.
|
|
1589
|
+
*/
|
|
1590
|
+
objectClasses: zod.z.array(RecordingObjectTriggerClassSchema).min(1).refine(noDuplicates, { message: "objectClasses must not repeat a class" }).optional(),
|
|
1591
|
+
/**
|
|
1592
|
+
* I device LINKED il cui FRONTE ALTO apre una finestra. Assente = la sorgente
|
|
1593
|
+
* non è ascoltata; un array vuoto è rifiutato per la stessa ragione di
|
|
1594
|
+
* `objectClasses`.
|
|
1595
|
+
*
|
|
1596
|
+
* Sono id di device SORGENTE, non camere: la banda li nomina, quindi il
|
|
1597
|
+
* percorso caldo (`DeviceStateChanged`, a ritmo di bus su tutta la flotta)
|
|
1598
|
+
* non fa RPC. L'OFFERTA da cui l'operatore li sceglie è un'altra domanda, e
|
|
1599
|
+
* si risolve con `deviceManager.getLinkedDevices` + `getBindingsBatch` per
|
|
1600
|
+
* device (D12) — mai un elenco globale di cap.
|
|
1601
|
+
*
|
|
1602
|
+
* Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
|
|
1603
|
+
* `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
|
|
1604
|
+
* la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
|
|
1605
|
+
* il livello: un contatto trovato già aperto al riavvio del runner non fa
|
|
1606
|
+
* registrare.
|
|
1607
|
+
*/
|
|
1608
|
+
sensorDeviceIds: zod.z.array(zod.z.number().int().positive()).min(1).max(16).refine(noDuplicates, { message: "sensorDeviceIds must not repeat a device" }).optional()
|
|
1485
1609
|
});
|
|
1486
1610
|
/**
|
|
1487
1611
|
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
@@ -2271,45 +2395,6 @@ function pickClosestResolution(entries, target) {
|
|
|
2271
2395
|
return bestAbove?.entry ?? bestBelow?.entry;
|
|
2272
2396
|
}
|
|
2273
2397
|
//#endregion
|
|
2274
|
-
//#region src/types/labels.ts
|
|
2275
|
-
var LabelDefinitionSchema = zod.z.object({
|
|
2276
|
-
id: zod.z.string(),
|
|
2277
|
-
name: zod.z.string(),
|
|
2278
|
-
category: zod.z.string().optional(),
|
|
2279
|
-
description: zod.z.string().optional(),
|
|
2280
|
-
icon: zod.z.string().optional()
|
|
2281
|
-
});
|
|
2282
|
-
/** Detection-macro targets a catalog `classMap` may resolve to. */
|
|
2283
|
-
var CLASS_MAP_MACRO_TARGETS = [
|
|
2284
|
-
"person",
|
|
2285
|
-
"vehicle",
|
|
2286
|
-
"animal",
|
|
2287
|
-
"package"
|
|
2288
|
-
];
|
|
2289
|
-
/**
|
|
2290
|
-
* Wire schema for a per-model CATALOG classMap override
|
|
2291
|
-
* (`ModelCatalogEntry.classMap` / `ModelConvertMetadata.classMap`) —
|
|
2292
|
-
* restricted to {@link CLASS_MAP_MACRO_TARGETS}, the only macros the
|
|
2293
|
-
* detection pipeline executor actually routes.
|
|
2294
|
-
*
|
|
2295
|
-
* This is deliberately a DIFFERENT, narrower shape than the general-purpose
|
|
2296
|
-
* `ClassMapDefinition` interface above (e.g. `IDetectionAddon.getClassMap()`
|
|
2297
|
-
* and the audio `YAMNET_TO_MACRO` catalog both use macro targets outside this
|
|
2298
|
-
* enum) — the two used to share the name `ClassMapDefinition`/
|
|
2299
|
-
* `ClassMapDefinitionSchema`, which made the schema-type-twin guard
|
|
2300
|
-
* (`scripts/check-schema-type-twins.ts`) flag them as a duplicated shape. They
|
|
2301
|
-
* are not: it is two different concepts colliding on a name. Keep this type
|
|
2302
|
-
* under its own name rather than reusing `ClassMapDefinition` — reusing it
|
|
2303
|
-
* would either narrow every `ClassMapDefinition` consumer to the four
|
|
2304
|
-
* detection macros (breaking `YAMNET_TO_MACRO`) or drop the validation this
|
|
2305
|
-
* schema exists for (see the "rejects a classMap whose target is not a
|
|
2306
|
-
* detection macro" test in `model-catalog-schema.test.ts`).
|
|
2307
|
-
*/
|
|
2308
|
-
var DetectionCatalogClassMapSchema = zod.z.object({
|
|
2309
|
-
mapping: zod.z.record(zod.z.string(), zod.z.enum(CLASS_MAP_MACRO_TARGETS)),
|
|
2310
|
-
preserveOriginal: zod.z.boolean()
|
|
2311
|
-
});
|
|
2312
|
-
//#endregion
|
|
2313
2398
|
//#region src/types/model-variant-groups.ts
|
|
2314
2399
|
var FORMAT_KEYS = [
|
|
2315
2400
|
"onnx",
|
|
@@ -21651,7 +21736,7 @@ var lifecycleJobSchema = zod.z.object({
|
|
|
21651
21736
|
* `useAddonsOnAddonLogs`, etc. flow through the same codegen pipeline
|
|
21652
21737
|
* as every other cap.
|
|
21653
21738
|
*/
|
|
21654
|
-
var LogLevelSchema$
|
|
21739
|
+
var LogLevelSchema$2 = zod.z.enum([
|
|
21655
21740
|
"debug",
|
|
21656
21741
|
"info",
|
|
21657
21742
|
"warn",
|
|
@@ -21878,7 +21963,7 @@ var addonsCapability = {
|
|
|
21878
21963
|
getLogs: require_sleep.method(zod.z.object({
|
|
21879
21964
|
addonId: zod.z.string(),
|
|
21880
21965
|
limit: zod.z.number().min(1).max(500).default(100),
|
|
21881
|
-
level: LogLevelSchema$
|
|
21966
|
+
level: LogLevelSchema$2.optional()
|
|
21882
21967
|
}), zod.z.array(LogQueryEntrySchema)),
|
|
21883
21968
|
listPackages: require_sleep.method(zod.z.void(), zod.z.array(InstalledPackageSchema).readonly()),
|
|
21884
21969
|
installPackage: require_sleep.method(zod.z.object({
|
|
@@ -22116,7 +22201,7 @@ var addonsCapability = {
|
|
|
22116
22201
|
}),
|
|
22117
22202
|
onAddonLogs: require_sleep.method(zod.z.object({
|
|
22118
22203
|
addonId: zod.z.string(),
|
|
22119
|
-
level: LogLevelSchema$
|
|
22204
|
+
level: LogLevelSchema$2.optional()
|
|
22120
22205
|
}), LogStreamEntrySchema, { kind: "subscription" })
|
|
22121
22206
|
},
|
|
22122
22207
|
/** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
|
|
@@ -24062,6 +24147,35 @@ var FaceFilterEnum = zod.z.enum([
|
|
|
24062
24147
|
"identified",
|
|
24063
24148
|
"all"
|
|
24064
24149
|
]);
|
|
24150
|
+
/**
|
|
24151
|
+
* What a `listRecentFaces` page is ORDERED BY.
|
|
24152
|
+
*
|
|
24153
|
+
* - `timestamp` — when the face was seen. The historical (and default) order.
|
|
24154
|
+
* - `suggestionConfidence` — {@link FaceInfo.suggestedMatchScore}, the peak
|
|
24155
|
+
* cosine of the face's SUGGESTED identity. This is the "review by certainty"
|
|
24156
|
+
* order: it puts the suggestions an operator can confirm with one tap at the
|
|
24157
|
+
* top, and it is the reason this enum exists — a client that ranked a capped
|
|
24158
|
+
* page client-side was ranking the newest N, never the most certain N.
|
|
24159
|
+
*
|
|
24160
|
+
* A row with NO suggestion (`suggestedMatchScore` absent — a legacy row, an
|
|
24161
|
+
* auto-assigned face, or a face below the suggestion band) has no certainty to
|
|
24162
|
+
* compare. Under `suggestionConfidence` it sorts **LAST, in BOTH directions**
|
|
24163
|
+
* — flipping the direction reorders the rows that HAVE a certainty and never
|
|
24164
|
+
* floods the page with the ones that do not. `addon-post-analysis`'s
|
|
24165
|
+
* `store/face-sort.ts` is the single implementation, tiebreaks newest-first
|
|
24166
|
+
* then by faceId, and is what makes this a total order instead of the
|
|
24167
|
+
* backend's NULL-collation accident.
|
|
24168
|
+
*/
|
|
24169
|
+
var FaceSortFieldEnum = zod.z.enum(["timestamp", "suggestionConfidence"]);
|
|
24170
|
+
var FaceSortDirectionEnum = zod.z.enum(["asc", "desc"]);
|
|
24171
|
+
/** One suggested group of look-alike UNASSIGNED faces. Ids only — an embedding
|
|
24172
|
+
* never leaves the server. */
|
|
24173
|
+
var FaceClusterSchema = zod.z.object({
|
|
24174
|
+
faceIds: zod.z.array(zod.z.string()).readonly(),
|
|
24175
|
+
representativeFaceId: zod.z.string(),
|
|
24176
|
+
size: zod.z.number().int(),
|
|
24177
|
+
cohesion: zod.z.number()
|
|
24178
|
+
});
|
|
24065
24179
|
var MediaFileLiteSchema$1 = zod.z.object({
|
|
24066
24180
|
key: zod.z.string(),
|
|
24067
24181
|
kind: zod.z.string(),
|
|
@@ -24119,24 +24233,72 @@ includeCrops: zod.z.boolean().optional() }).optional(), zod.z.array(IdentitySche
|
|
|
24119
24233
|
auth: "admin"
|
|
24120
24234
|
}),
|
|
24121
24235
|
listRecentFaces: require_sleep.method(zod.z.object({
|
|
24122
|
-
/**
|
|
24236
|
+
/**
|
|
24237
|
+
* Restrict to ONE camera. Absent keeps the cluster-wide gallery view.
|
|
24238
|
+
*
|
|
24239
|
+
* The legacy single-camera form, kept verbatim for every caller that
|
|
24240
|
+
* already sends it. A caller that wants a SET sends {@link deviceIds}
|
|
24241
|
+
* instead — never both: `deviceIds` is the authority whenever it is
|
|
24242
|
+
* present, and this field is then ignored rather than unioned, so
|
|
24243
|
+
* there is exactly one answer to "which cameras did I ask for".
|
|
24244
|
+
*/
|
|
24123
24245
|
deviceId: zod.z.number().int().optional(),
|
|
24246
|
+
/**
|
|
24247
|
+
* Restrict to a SET of cameras — the review UI's camera filter, which
|
|
24248
|
+
* until now had to fetch the cluster-wide page and drop rows in the
|
|
24249
|
+
* client (so the `limit` it asked for was spent on cameras it was
|
|
24250
|
+
* about to discard).
|
|
24251
|
+
*
|
|
24252
|
+
* An **empty array reads NOTHING** — `[]` is an empty page, never
|
|
24253
|
+
* "every camera". A request for no devices is a request, not an
|
|
24254
|
+
* omission; same contract as `deviceManager.listFleet` and
|
|
24255
|
+
* `pipelineAnalytics.listRecentTracks`.
|
|
24256
|
+
*
|
|
24257
|
+
* Absent (`undefined`) is the omission, and keeps the cluster-wide view.
|
|
24258
|
+
*/
|
|
24259
|
+
deviceIds: zod.z.array(zod.z.number().int()).optional(),
|
|
24124
24260
|
limit: zod.z.number().int().positive().optional(),
|
|
24125
24261
|
filter: FaceFilterEnum.optional(),
|
|
24126
24262
|
/**
|
|
24127
|
-
*
|
|
24128
|
-
*
|
|
24263
|
+
* Window lower bound on {@link FaceInfo.timestamp}, INCLUSIVE.
|
|
24264
|
+
* Absent means no lower bound.
|
|
24265
|
+
*/
|
|
24266
|
+
since: zod.z.number().int().optional(),
|
|
24267
|
+
/**
|
|
24268
|
+
* Window upper bound on {@link FaceInfo.timestamp}, INCLUSIVE.
|
|
24269
|
+
* Absent means no upper bound.
|
|
24270
|
+
*/
|
|
24271
|
+
until: zod.z.number().int().optional(),
|
|
24272
|
+
/**
|
|
24273
|
+
* Order the page by time or by suggestion certainty. Default
|
|
24274
|
+
* `'timestamp'` — the historical order, unchanged for every caller
|
|
24275
|
+
* that does not ask.
|
|
24129
24276
|
*
|
|
24130
|
-
*
|
|
24131
|
-
*
|
|
24132
|
-
* the browser cache the images.
|
|
24277
|
+
* See {@link FaceSortFieldEnum} for what a row with no suggestion
|
|
24278
|
+
* does under `'suggestionConfidence'`.
|
|
24133
24279
|
*
|
|
24134
|
-
*
|
|
24135
|
-
*
|
|
24136
|
-
*
|
|
24137
|
-
*
|
|
24138
|
-
*
|
|
24139
|
-
|
|
24280
|
+
* Cost note: `'timestamp'` is served by the `(deviceId, timestamp)`
|
|
24281
|
+
* index and stops reading as soon as `limit` rows have PASSED the
|
|
24282
|
+
* filter. `'suggestionConfidence'` cannot stop early — the most
|
|
24283
|
+
* certain row may be the oldest — so it walks the window. Narrow it
|
|
24284
|
+
* with {@link since} / {@link until}.
|
|
24285
|
+
*/
|
|
24286
|
+
sortBy: FaceSortFieldEnum.optional(),
|
|
24287
|
+
/** Sort direction for {@link sortBy}. Default `'desc'`. */
|
|
24288
|
+
sortDirection: FaceSortDirectionEnum.optional(),
|
|
24289
|
+
/**
|
|
24290
|
+
* Inline the base64 crop on every row.
|
|
24291
|
+
*
|
|
24292
|
+
* Default `false` since the 2026-08-25 inversion — see
|
|
24293
|
+
* `include-crops-default.ts`, which is the ONE place that resolves
|
|
24294
|
+
* this for every gallery, and which records why the inline shape had
|
|
24295
|
+
* to become the one you ASK for (60 457 ms → UDS timeout at 500 rows).
|
|
24296
|
+
* The doc here used to still say `true`; it was wrong, and a leftover
|
|
24297
|
+
* that describes the old design reads as permission to rely on it.
|
|
24298
|
+
*
|
|
24299
|
+
* Nothing loses its image: the row carries {@link FaceInfo.cropUrl},
|
|
24300
|
+
* which the browser fetches off the `event-media` plane in parallel,
|
|
24301
|
+
* cached and ETagged.
|
|
24140
24302
|
*/
|
|
24141
24303
|
includeCrops: zod.z.boolean().optional()
|
|
24142
24304
|
}).optional(), zod.z.array(FaceInfoSchema).readonly()),
|
|
@@ -24185,13 +24347,39 @@ includeCrops: zod.z.boolean().optional() }).optional(), zod.z.array(IdentitySche
|
|
|
24185
24347
|
suggestFaceClusters: require_sleep.method(zod.z.object({
|
|
24186
24348
|
threshold: zod.z.number().min(0).max(1).optional(),
|
|
24187
24349
|
minClusterSize: zod.z.number().int().min(2).optional(),
|
|
24188
|
-
|
|
24189
|
-
|
|
24190
|
-
|
|
24191
|
-
|
|
24192
|
-
|
|
24193
|
-
|
|
24194
|
-
|
|
24350
|
+
/**
|
|
24351
|
+
* Cap on the number of CLUSTERS returned. Renamed from `limit`,
|
|
24352
|
+
* which read as though it bounded the work — it never did.
|
|
24353
|
+
*
|
|
24354
|
+
* Wins over {@link limit} when both are sent.
|
|
24355
|
+
*/
|
|
24356
|
+
maxClusters: zod.z.number().int().positive().optional(),
|
|
24357
|
+
/**
|
|
24358
|
+
* @deprecated Ambiguous name for {@link maxClusters} — it cuts the
|
|
24359
|
+
* RESULT, not the scan. Kept so existing callers keep working; send
|
|
24360
|
+
* `maxClusters` (and, if you care about cost, {@link maxFacesScanned}).
|
|
24361
|
+
*/
|
|
24362
|
+
limit: zod.z.number().int().positive().optional(),
|
|
24363
|
+
/**
|
|
24364
|
+
* Cap on the number of unassigned faces READ AND CLUSTERED — the
|
|
24365
|
+
* POOL, not the result.
|
|
24366
|
+
*
|
|
24367
|
+
* This is the knob {@link maxClusters} was mistaken for. Clustering
|
|
24368
|
+
* used to read every unassigned face on the hub no matter what the
|
|
24369
|
+
* caller asked for, because the only bound cut the finished clusters
|
|
24370
|
+
* afterwards; a UI showing a window of 100 paid for a scan of the
|
|
24371
|
+
* whole corpus, on an addon whose disk is under contention.
|
|
24372
|
+
*
|
|
24373
|
+
* The pool is the NEWEST matching faces first — the same order the
|
|
24374
|
+
* gallery shows — so a bound here shortens the horizon, it does not
|
|
24375
|
+
* sample it randomly.
|
|
24376
|
+
*
|
|
24377
|
+
* Default: 1 000 (`FACE_SWEEP_PAGE`, exactly one store page). Chosen
|
|
24378
|
+
* so the live corpus — 372 face rows — is unaffected while the
|
|
24379
|
+
* unbounded scan can never come back as the table grows.
|
|
24380
|
+
*/
|
|
24381
|
+
maxFacesScanned: zod.z.number().int().positive().optional()
|
|
24382
|
+
}).optional(), zod.z.array(FaceClusterSchema).readonly())
|
|
24195
24383
|
}
|
|
24196
24384
|
};
|
|
24197
24385
|
//#endregion
|
|
@@ -30257,6 +30445,295 @@ var SetSiteLocationInputSchema = zod.z.object({
|
|
|
30257
30445
|
latitude: zod.z.number().min(-90).max(90),
|
|
30258
30446
|
longitude: zod.z.number().min(-180).max(180)
|
|
30259
30447
|
}).nullable();
|
|
30448
|
+
/**
|
|
30449
|
+
* The TRANSPORT a call arrived on.
|
|
30450
|
+
*
|
|
30451
|
+
* Every counted call carries exactly one of these, and `unknown` is a PLANE
|
|
30452
|
+
* rather than a gap: a plane that cannot attribute a call declares it here, so
|
|
30453
|
+
* the call lands in a named bucket instead of vanishing. `planes` summing to
|
|
30454
|
+
* `procedureCalls` is what makes "the sum of the planes explains the total"
|
|
30455
|
+
* checkable rather than asserted.
|
|
30456
|
+
*
|
|
30457
|
+
* - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
|
|
30458
|
+
* - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
|
|
30459
|
+
* connection; the viewer talks to the hub over `wsLink`
|
|
30460
|
+
* exclusively, so this is the plane the HTTP census could not see.
|
|
30461
|
+
* - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
|
|
30462
|
+
* never touches a socket and therefore never touched a census.
|
|
30463
|
+
* - `unknown` — counted, plane undecidable. No hook produces it today, and
|
|
30464
|
+
* that is exactly what its `0` asserts: every plane the hub has can name
|
|
30465
|
+
* itself. It is an output bucket, never a knob — a call that arrives on a
|
|
30466
|
+
* plane nobody instrumented lands here instead of vanishing from the total.
|
|
30467
|
+
*/
|
|
30468
|
+
var TransportPlaneSchema = zod.z.enum([
|
|
30469
|
+
"http",
|
|
30470
|
+
"ws",
|
|
30471
|
+
"mesh",
|
|
30472
|
+
"unknown"
|
|
30473
|
+
]);
|
|
30474
|
+
/**
|
|
30475
|
+
* Calls per plane. Every key is always present, `0` included — an absent plane
|
|
30476
|
+
* reads as "not instrumented", which is the one thing this census must never
|
|
30477
|
+
* make an operator wonder about.
|
|
30478
|
+
*/
|
|
30479
|
+
var TransportPlaneCountsSchema = zod.z.object({
|
|
30480
|
+
http: zod.z.number(),
|
|
30481
|
+
ws: zod.z.number(),
|
|
30482
|
+
mesh: zod.z.number(),
|
|
30483
|
+
unknown: zod.z.number()
|
|
30484
|
+
});
|
|
30485
|
+
/**
|
|
30486
|
+
* One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
|
|
30487
|
+
* census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
|
|
30488
|
+
* `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
|
|
30489
|
+
* already prints - never a token, never an `Authorization` header.
|
|
30490
|
+
*
|
|
30491
|
+
* `subscriptions` is counted APART from `calls`: a subscription is opened once
|
|
30492
|
+
* and lives for hours, so folding it into a call count makes one long-lived
|
|
30493
|
+
* stream look like a storm.
|
|
30494
|
+
*/
|
|
30495
|
+
var RequestCensusGroupSchema = zod.z.object({
|
|
30496
|
+
plane: TransportPlaneSchema,
|
|
30497
|
+
procedure: zod.z.string(),
|
|
30498
|
+
userAgent: zod.z.string(),
|
|
30499
|
+
ip: zod.z.string(),
|
|
30500
|
+
principal: zod.z.string(),
|
|
30501
|
+
calls: zod.z.number(),
|
|
30502
|
+
subscriptions: zod.z.number(),
|
|
30503
|
+
perMin: zod.z.number()
|
|
30504
|
+
});
|
|
30505
|
+
/**
|
|
30506
|
+
* A procedure's TOTAL over the window, across every caller.
|
|
30507
|
+
*
|
|
30508
|
+
* This block, not the group list, is what answers "did these calls arrive over
|
|
30509
|
+
* HTTP at all". A total far BELOW what a store-side census counted over the
|
|
30510
|
+
* same window excludes the HTTP plane, which is a result, not a failure.
|
|
30511
|
+
*/
|
|
30512
|
+
var RequestCensusProcedureSchema = zod.z.object({
|
|
30513
|
+
procedure: zod.z.string(),
|
|
30514
|
+
calls: zod.z.number(),
|
|
30515
|
+
/**
|
|
30516
|
+
* The same total, split by transport. THIS is the row that answers the
|
|
30517
|
+
* question the census exists for: one look at `deviceManager.listAll` says
|
|
30518
|
+
* which plane carried the 4 960, without joining two log lines by eye.
|
|
30519
|
+
*/
|
|
30520
|
+
planes: TransportPlaneCountsSchema,
|
|
30521
|
+
/** Subscription STARTS on this procedure. Never folded into `calls`. */
|
|
30522
|
+
subscriptions: zod.z.number(),
|
|
30523
|
+
perMin: zod.z.number()
|
|
30524
|
+
});
|
|
30525
|
+
/** What one armed window measured. Mirrors `TransportCensus.snapshot()`. */
|
|
30526
|
+
var RequestCensusSnapshotSchema = zod.z.object({
|
|
30527
|
+
armed: zod.z.boolean(),
|
|
30528
|
+
/** How long the current - or just-closed - window collected, in ms. */
|
|
30529
|
+
elapsedMs: zod.z.number(),
|
|
30530
|
+
/** The window actually armed, after the server clamped the request. */
|
|
30531
|
+
windowMs: zod.z.number(),
|
|
30532
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
30533
|
+
armedUntilMs: zod.z.number(),
|
|
30534
|
+
httpRequests: zod.z.number(),
|
|
30535
|
+
batchedRequests: zod.z.number(),
|
|
30536
|
+
/**
|
|
30537
|
+
* Procedure invocations. Higher than `httpRequests` whenever tRPC batching
|
|
30538
|
+
* is in play (`?batch=1` carries several procedures in one request); this is
|
|
30539
|
+
* the number comparable with a store-side call count.
|
|
30540
|
+
*/
|
|
30541
|
+
procedureCalls: zod.z.number(),
|
|
30542
|
+
/**
|
|
30543
|
+
* `procedureCalls` split by transport. The four keys sum to
|
|
30544
|
+
* `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
|
|
30545
|
+
* `planesExplainTotal` is that identity, checked rather than assumed.
|
|
30546
|
+
*/
|
|
30547
|
+
planes: TransportPlaneCountsSchema,
|
|
30548
|
+
/**
|
|
30549
|
+
* True iff `planes` sums to `procedureCalls`. False means a call was counted
|
|
30550
|
+
* on no plane at all - which is a RESULT (a plane is missing from the
|
|
30551
|
+
* instrument), not a failure, and it has to be visible to be read as one.
|
|
30552
|
+
*/
|
|
30553
|
+
planesExplainTotal: zod.z.boolean(),
|
|
30554
|
+
/**
|
|
30555
|
+
* tRPC WebSocket connections opened during the window. NOT calls - the WS
|
|
30556
|
+
* adapter resolves one context per connection - kept because a plane's call
|
|
30557
|
+
* count of zero against 37 open connections says something different from a
|
|
30558
|
+
* plane with no connections at all.
|
|
30559
|
+
*/
|
|
30560
|
+
wsConnections: zod.z.number(),
|
|
30561
|
+
/**
|
|
30562
|
+
* Client frames the WS plane looked at. `wsMessages` far above
|
|
30563
|
+
* `planes.ws + subscriptions` means most traffic is not operations
|
|
30564
|
+
* (keepalives, connection params) - which is itself an answer.
|
|
30565
|
+
*/
|
|
30566
|
+
wsMessages: zod.z.number(),
|
|
30567
|
+
/**
|
|
30568
|
+
* Subscription STARTS across every plane, excluded from `procedureCalls` on
|
|
30569
|
+
* purpose: one live-events stream opened at boot and held for six hours is
|
|
30570
|
+
* one subscription, and counting it as a call would let a quiet plane
|
|
30571
|
+
* masquerade as the storm.
|
|
30572
|
+
*/
|
|
30573
|
+
subscriptions: zod.z.number(),
|
|
30574
|
+
/** `subscription.stop` frames. Starts minus stops is what is still open. */
|
|
30575
|
+
subscriptionStops: zod.z.number(),
|
|
30576
|
+
distinctGroups: zod.z.number(),
|
|
30577
|
+
/**
|
|
30578
|
+
* Operations counted in the totals whose CALLER attribution was shed at the
|
|
30579
|
+
* cardinality bound. Unrelated to the `unknown` PLANE: these calls know
|
|
30580
|
+
* which transport they arrived on, they just lost their group row.
|
|
30581
|
+
*/
|
|
30582
|
+
unattributedCalls: zod.z.number(),
|
|
30583
|
+
procedures: zod.z.array(RequestCensusProcedureSchema).readonly(),
|
|
30584
|
+
groups: zod.z.array(RequestCensusGroupSchema).readonly()
|
|
30585
|
+
});
|
|
30586
|
+
/**
|
|
30587
|
+
* The census as an operator sees it.
|
|
30588
|
+
*
|
|
30589
|
+
* `persisted` is the honest answer to "will this survive the restart I am
|
|
30590
|
+
* about to do": the arm deadline is written to `system-settings` so a window
|
|
30591
|
+
* armed now can measure the NEXT boot, and a write that failed must not look
|
|
30592
|
+
* like one that succeeded.
|
|
30593
|
+
*/
|
|
30594
|
+
var RequestCensusStatusSchema = RequestCensusSnapshotSchema.extend({ persisted: zod.z.boolean() });
|
|
30595
|
+
/** Severity vocabulary. Mirrors `LogLevel` in `interfaces/logging.ts`. */
|
|
30596
|
+
var LogLevelSchema$1 = zod.z.enum([
|
|
30597
|
+
"debug",
|
|
30598
|
+
"info",
|
|
30599
|
+
"warn",
|
|
30600
|
+
"error"
|
|
30601
|
+
]);
|
|
30602
|
+
/**
|
|
30603
|
+
* The diagnostics that can be ARMED for a window. Exactly one today.
|
|
30604
|
+
*
|
|
30605
|
+
* A diagnostic is anything whose cost is only worth paying while a question is
|
|
30606
|
+
* open. It never persists as a boolean: see {@link DiagnosticWindowSchema}.
|
|
30607
|
+
*/
|
|
30608
|
+
var DiagnosticIdSchema = zod.z.enum(["request-census"]);
|
|
30609
|
+
/**
|
|
30610
|
+
* The layers of the level hierarchy, general → specific. The most specific
|
|
30611
|
+
* layer that carries an explicit value wins.
|
|
30612
|
+
*
|
|
30613
|
+
* `component` is DECLARED and not yet resolvable: the per-component channels
|
|
30614
|
+
* are a later slice of the same plan, and a `levelSource` enum that has to
|
|
30615
|
+
* grow later would force every consumer of this document to change with it.
|
|
30616
|
+
* Nothing returns `component` today.
|
|
30617
|
+
*/
|
|
30618
|
+
var LoggingScopeKindSchema = zod.z.enum([
|
|
30619
|
+
"cluster",
|
|
30620
|
+
"node",
|
|
30621
|
+
"component"
|
|
30622
|
+
]);
|
|
30623
|
+
/** Where an effective level came from. `default` = nothing is set anywhere. */
|
|
30624
|
+
var LoggingLevelSourceSchema = zod.z.enum([
|
|
30625
|
+
"default",
|
|
30626
|
+
"cluster",
|
|
30627
|
+
"node",
|
|
30628
|
+
"component"
|
|
30629
|
+
]);
|
|
30630
|
+
/**
|
|
30631
|
+
* One layer of the hierarchy as it actually STANDS.
|
|
30632
|
+
*
|
|
30633
|
+
* `level: null` is the whole reason this array is returned: it is the
|
|
30634
|
+
* difference between "this node is at `info` because I decided it" and
|
|
30635
|
+
* "...because it inherits". An operator who clears an override believing they
|
|
30636
|
+
* are clearing an inherited value has been handed the same defect as the two
|
|
30637
|
+
* contradicting knobs this document exists to remove, moved one floor up.
|
|
30638
|
+
*/
|
|
30639
|
+
var LoggingLevelLayerSchema = zod.z.object({
|
|
30640
|
+
scope: LoggingScopeKindSchema,
|
|
30641
|
+
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
30642
|
+
nodeId: zod.z.string().nullable(),
|
|
30643
|
+
/** Explicitly set here, or `null` when this layer inherits. */
|
|
30644
|
+
level: LogLevelSchema$1.nullable()
|
|
30645
|
+
});
|
|
30646
|
+
/** What a line is judged against, and WHICH layer decided it. */
|
|
30647
|
+
var LoggingEffectiveSchema = zod.z.object({
|
|
30648
|
+
level: LogLevelSchema$1,
|
|
30649
|
+
levelSource: LoggingLevelSourceSchema
|
|
30650
|
+
});
|
|
30651
|
+
/** Every layer, general → specific. Never collapsed into the effective value. */
|
|
30652
|
+
var LoggingExplicitSchema = zod.z.object({ layers: zod.z.array(LoggingLevelLayerSchema).readonly() });
|
|
30653
|
+
/**
|
|
30654
|
+
* An armed diagnostic, with its DEADLINE.
|
|
30655
|
+
*
|
|
30656
|
+
* The shape of ADR-0244: what is stored is a deadline and never a flag, so a
|
|
30657
|
+
* diagnostic somebody forgot expires by itself, and a boot-window measurement
|
|
30658
|
+
* survives the restart it exists to measure. `remainingMs` is 0 whenever
|
|
30659
|
+
* `armed` is false — a window is never reported as slightly expired.
|
|
30660
|
+
*/
|
|
30661
|
+
var DiagnosticWindowSchema = zod.z.object({
|
|
30662
|
+
id: DiagnosticIdSchema,
|
|
30663
|
+
armed: zod.z.boolean(),
|
|
30664
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
30665
|
+
armedUntilMs: zod.z.number(),
|
|
30666
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
30667
|
+
remainingMs: zod.z.number(),
|
|
30668
|
+
/** Whether the stored deadline is the one the live diagnostic is running —
|
|
30669
|
+
* i.e. whether this window would survive a restart. */
|
|
30670
|
+
persisted: zod.z.boolean()
|
|
30671
|
+
});
|
|
30672
|
+
/**
|
|
30673
|
+
* `armMs: 0` DISARMS. Any positive value arms for that long, clamped by the
|
|
30674
|
+
* server — there is no maximum here on purpose: a bound repeated in a schema
|
|
30675
|
+
* is a second knob that disagrees with the first the day one of them moves.
|
|
30676
|
+
*/
|
|
30677
|
+
var DiagnosticWindowPatchSchema = zod.z.object({
|
|
30678
|
+
id: DiagnosticIdSchema,
|
|
30679
|
+
armMs: zod.z.number().int().min(0),
|
|
30680
|
+
/** Cadence of the diagnostic's aggregated report line. Clamped by the server. */
|
|
30681
|
+
reportEveryMs: zod.z.number().int().positive().optional()
|
|
30682
|
+
});
|
|
30683
|
+
/**
|
|
30684
|
+
* A PATCH, and patches MERGE.
|
|
30685
|
+
*
|
|
30686
|
+
* A field absent from the patch is left exactly as it was — arming a
|
|
30687
|
+
* diagnostic never resets a level, and setting a level never disarms a window.
|
|
30688
|
+
* The provider must not reconstruct the document as `{ ...snapshot, ...patch }`:
|
|
30689
|
+
* `setAll` already merges, and rebuilding the object is how an absent field
|
|
30690
|
+
* turns into an erased one.
|
|
30691
|
+
*/
|
|
30692
|
+
var LoggingSettingsPatchSchema = zod.z.object({
|
|
30693
|
+
/**
|
|
30694
|
+
* Absent leaves the level untouched. `null` CLEARS the explicit value at the
|
|
30695
|
+
* addressed scope so it inherits again. A value sets it.
|
|
30696
|
+
*/
|
|
30697
|
+
level: LogLevelSchema$1.nullable().optional(),
|
|
30698
|
+
/**
|
|
30699
|
+
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
30700
|
+
* keeps running — a patch is never a full replacement.
|
|
30701
|
+
*/
|
|
30702
|
+
diagnostics: zod.z.array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
30703
|
+
});
|
|
30704
|
+
/**
|
|
30705
|
+
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
30706
|
+
*
|
|
30707
|
+
* Deliberately NOT called `nodeId`: that key is reserved on every cap method
|
|
30708
|
+
* input — the generated router strips it and uses it to resolve the PROVIDER
|
|
30709
|
+
* on that node (`resolveProvider(cap, nodeId, …)`). A document about
|
|
30710
|
+
* `agent-1` addressed as `nodeId` would be forwarded to agent-1 and answered
|
|
30711
|
+
* by an agent that holds no cluster document at all. The hub is the single
|
|
30712
|
+
* authority over the whole hierarchy and answers for every layer, so the
|
|
30713
|
+
* layer selector needs a name the transport does not already own.
|
|
30714
|
+
*/
|
|
30715
|
+
var GetLoggingSettingsInputSchema = zod.z.object({ scopeNodeId: zod.z.string().optional() });
|
|
30716
|
+
var SetLoggingSettingsInputSchema = zod.z.object({
|
|
30717
|
+
scopeNodeId: zod.z.string().optional(),
|
|
30718
|
+
patch: LoggingSettingsPatchSchema
|
|
30719
|
+
});
|
|
30720
|
+
/**
|
|
30721
|
+
* The whole document, as read and as returned after every write.
|
|
30722
|
+
*
|
|
30723
|
+
* `persisted: false` means the settings store could not be read or written.
|
|
30724
|
+
* The in-memory mirror still governs behaviour and is unchanged by the
|
|
30725
|
+
* failure — a read that fails neither switches a level nor disarms a window
|
|
30726
|
+
* (D49) — but the operator is told that what they are looking at would not
|
|
30727
|
+
* survive a restart.
|
|
30728
|
+
*/
|
|
30729
|
+
var LoggingSettingsStateSchema = zod.z.object({
|
|
30730
|
+
/** The layer this document was read at. `null` = the cluster layer. */
|
|
30731
|
+
scopeNodeId: zod.z.string().nullable(),
|
|
30732
|
+
effective: LoggingEffectiveSchema,
|
|
30733
|
+
explicit: LoggingExplicitSchema,
|
|
30734
|
+
activeWindows: zod.z.array(DiagnosticWindowSchema).readonly(),
|
|
30735
|
+
persisted: zod.z.boolean()
|
|
30736
|
+
});
|
|
30260
30737
|
var systemCapability = {
|
|
30261
30738
|
name: "system",
|
|
30262
30739
|
scope: "system",
|
|
@@ -30300,6 +30777,38 @@ var systemCapability = {
|
|
|
30300
30777
|
detectSiteLocation: require_sleep.method(zod.z.void(), SiteLocationStatusSchema, {
|
|
30301
30778
|
kind: "mutation",
|
|
30302
30779
|
auth: "admin"
|
|
30780
|
+
}),
|
|
30781
|
+
/**
|
|
30782
|
+
* Read the HTTP request census - which caller, from which address, with
|
|
30783
|
+
* which user-agent, invoked which tRPC procedure, and how often.
|
|
30784
|
+
*
|
|
30785
|
+
* Reading NEVER re-arms: re-arming clears the counts, which would throw
|
|
30786
|
+
* away exactly the numbers being asked for. A closed window may be read as
|
|
30787
|
+
* many times as the operator likes and always describes the same window.
|
|
30788
|
+
*
|
|
30789
|
+
* Admin-only: the rows carry source addresses and principal names.
|
|
30790
|
+
*/
|
|
30791
|
+
getRequestCensus: require_sleep.method(zod.z.void(), RequestCensusStatusSchema, { auth: "admin" }),
|
|
30792
|
+
/**
|
|
30793
|
+
* The logging settings document — levels and armed diagnostics — resolved
|
|
30794
|
+
* for `nodeId`, or for the cluster when `nodeId` is absent.
|
|
30795
|
+
*
|
|
30796
|
+
* Returns BOTH `effective` and `explicit`. See
|
|
30797
|
+
* {@link LoggingLevelLayerSchema} for why collapsing them is the defect.
|
|
30798
|
+
*/
|
|
30799
|
+
getLoggingSettings: require_sleep.method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }),
|
|
30800
|
+
/**
|
|
30801
|
+
* Write the logging settings document. The ONLY write authority over log
|
|
30802
|
+
* levels and diagnostic windows — arming the request census went through
|
|
30803
|
+
* `system.setRequestCensus` until 2026-08-27 and no longer does, because
|
|
30804
|
+
* two writes that disagree about the same window is exactly the defect
|
|
30805
|
+
* this document exists to remove (D245).
|
|
30806
|
+
*
|
|
30807
|
+
* The patch MERGES: see {@link LoggingSettingsPatchSchema}.
|
|
30808
|
+
*/
|
|
30809
|
+
setLoggingSettings: require_sleep.method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
|
|
30810
|
+
kind: "mutation",
|
|
30811
|
+
auth: "admin"
|
|
30303
30812
|
})
|
|
30304
30813
|
},
|
|
30305
30814
|
/** BIG PLAN 2: declarative mount hint — read by `@camstack/system` `buildCapRouters`. */
|
|
@@ -31494,6 +32003,172 @@ function stateVocabularyFor(runtimeState, alarmStates = []) {
|
|
|
31494
32003
|
return [];
|
|
31495
32004
|
}
|
|
31496
32005
|
//#endregion
|
|
32006
|
+
//#region src/catalogs/sensor-active-state.ts
|
|
32007
|
+
/**
|
|
32008
|
+
* LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
|
|
32009
|
+
* valutatore puro del suo FRONTE.
|
|
32010
|
+
*
|
|
32011
|
+
* Viveva dentro il builtin virtual-doorbell
|
|
32012
|
+
* (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
|
|
32013
|
+
* predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
|
|
32014
|
+
* `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
|
|
32015
|
+
* tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
|
|
32016
|
+
* fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
|
|
32017
|
+
* SPOSTA qui e il doorbell la ri-esporta.
|
|
32018
|
+
*
|
|
32019
|
+
* ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
|
|
32020
|
+
* due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
|
|
32021
|
+
* regola" (e include `presence`, `cover`, `alarm-panel`), questa a "qual è il
|
|
32022
|
+
* booleano il cui FRONTE conta". Vocabolari deliberatamente diversi.
|
|
32023
|
+
*/
|
|
32024
|
+
/**
|
|
32025
|
+
* Known binary / switch source caps → the boolean slice field whose
|
|
32026
|
+
* false→true rise counts as ACTIVE. Every entry is "fire on active".
|
|
32027
|
+
* Sensors whose "active" reading is not a plain boolean (presence's string
|
|
32028
|
+
* state, connectivity's connected flag) are deliberately excluded — a
|
|
32029
|
+
* reconnect is not a doorbell press, and it is not a recording either.
|
|
32030
|
+
*/
|
|
32031
|
+
var SOURCE_CAP_ACTIVE_FIELD = {
|
|
32032
|
+
contact: "entryOpen",
|
|
32033
|
+
binary: "on",
|
|
32034
|
+
switch: "on",
|
|
32035
|
+
motion: "detected",
|
|
32036
|
+
flood: "flooded",
|
|
32037
|
+
gas: "detected",
|
|
32038
|
+
smoke: "detected",
|
|
32039
|
+
"carbon-monoxide": "detected",
|
|
32040
|
+
vibration: "detected",
|
|
32041
|
+
tamper: "tampered"
|
|
32042
|
+
};
|
|
32043
|
+
/**
|
|
32044
|
+
* The same caps → the slice field carrying the ms-epoch timestamp of the
|
|
32045
|
+
* last transition. Every source cap MUST appear here (guarded by a spec):
|
|
32046
|
+
* without a transition timestamp the evaluator cannot tell a genuine rise
|
|
32047
|
+
* from a boot-time hydration when the FIRST slice it ever sees is already
|
|
32048
|
+
* active, and errs towards silence — swallowing the rise.
|
|
32049
|
+
*
|
|
32050
|
+
* These timestamps are UPSTREAM ones, not ingest ones: the Home Assistant
|
|
32051
|
+
* provider derives them from `state.last_changed`, so they survive our own
|
|
32052
|
+
* restarts and correctly read as "hours ago" for a state that has been
|
|
32053
|
+
* active for hours. `motion` names its rise timestamp `lastDetectedAt`.
|
|
32054
|
+
*/
|
|
32055
|
+
var SOURCE_CAP_CHANGED_AT_FIELD = {
|
|
32056
|
+
contact: "lastChangedAt",
|
|
32057
|
+
binary: "lastChangedAt",
|
|
32058
|
+
switch: "lastChangedAt",
|
|
32059
|
+
motion: "lastDetectedAt",
|
|
32060
|
+
flood: "lastChangedAt",
|
|
32061
|
+
gas: "lastChangedAt",
|
|
32062
|
+
smoke: "lastChangedAt",
|
|
32063
|
+
"carbon-monoxide": "lastChangedAt",
|
|
32064
|
+
vibration: "lastChangedAt",
|
|
32065
|
+
tamper: "lastChangedAt"
|
|
32066
|
+
};
|
|
32067
|
+
/** Cap names whose presence in a device's bindings qualify it as a source. */
|
|
32068
|
+
var SOURCE_CAPS = Object.keys(SOURCE_CAP_ACTIVE_FIELD);
|
|
32069
|
+
/**
|
|
32070
|
+
* Device `type` values (from `DeviceType`) that can host a binary/switch
|
|
32071
|
+
* source cap. Used by the camera's `device-multiselect` picker as the
|
|
32072
|
+
* CLIENT-SIDE filter, alongside `SOURCE_CAPS`.
|
|
32073
|
+
*
|
|
32074
|
+
* Why types and not caps alone: the shared picker filters
|
|
32075
|
+
* `deviceManager.listAll` rows client-side, and those rows carry only the
|
|
32076
|
+
* device's advertised `features` — NOT its registered cap list. On the live
|
|
32077
|
+
* cluster binary sensors and switches advertise EMPTY features (features
|
|
32078
|
+
* mirror only a handful of caps like `motion-trigger`), so a caps-only
|
|
32079
|
+
* filter matched against `features` would list nothing (the very bug this
|
|
32080
|
+
* replaced, which relied on the now-empty `getAllBindings`). Matching by
|
|
32081
|
+
* `type` is the reliable client-side signal; the union with `SOURCE_CAPS`
|
|
32082
|
+
* still captures any device that DOES advertise a source-cap feature.
|
|
32083
|
+
* `sensor` covers contact/motion/flood/gas/smoke/CO/vibration/tamper,
|
|
32084
|
+
* `switch` covers switches, `control` covers generic binary actuators.
|
|
32085
|
+
*/
|
|
32086
|
+
var SOURCE_DEVICE_TYPES = [
|
|
32087
|
+
"sensor",
|
|
32088
|
+
"switch",
|
|
32089
|
+
"control"
|
|
32090
|
+
];
|
|
32091
|
+
/** True when a cap is a recognised binary/switch source. */
|
|
32092
|
+
function isSourceCap(capName) {
|
|
32093
|
+
return Object.prototype.hasOwnProperty.call(SOURCE_CAP_ACTIVE_FIELD, capName);
|
|
32094
|
+
}
|
|
32095
|
+
/** Extract the "active" boolean a source cap's slice carries, or null when
|
|
32096
|
+
* the cap is unknown or the field is missing / non-boolean. */
|
|
32097
|
+
function sliceActiveValue(capName, slice) {
|
|
32098
|
+
const field = SOURCE_CAP_ACTIVE_FIELD[capName];
|
|
32099
|
+
if (field === void 0) return null;
|
|
32100
|
+
const raw = slice[field];
|
|
32101
|
+
return typeof raw === "boolean" ? raw : null;
|
|
32102
|
+
}
|
|
32103
|
+
/** Ms-epoch transition timestamp a source cap's slice carries, or null when
|
|
32104
|
+
* it is absent, non-numeric or the zero "never observed" sentinel. */
|
|
32105
|
+
function sliceChangedAt(capName, slice) {
|
|
32106
|
+
const field = SOURCE_CAP_CHANGED_AT_FIELD[capName];
|
|
32107
|
+
if (field === void 0) return null;
|
|
32108
|
+
const raw = slice[field];
|
|
32109
|
+
if (typeof raw !== "number" || !Number.isFinite(raw) || raw <= 0) return null;
|
|
32110
|
+
return raw;
|
|
32111
|
+
}
|
|
32112
|
+
/**
|
|
32113
|
+
* How recent a source's own transition timestamp must be for a FIRST
|
|
32114
|
+
* sighting that is already active to count as a genuine rise rather than a
|
|
32115
|
+
* hydration of long-standing state.
|
|
32116
|
+
*/
|
|
32117
|
+
var DEFAULT_FIRST_SIGHTING_FRESHNESS_MS = 3e4;
|
|
32118
|
+
/**
|
|
32119
|
+
* IL fronte. Puro: nessun orologio proprio, nessuna memoria — il chiamante
|
|
32120
|
+
* porta `prior`, `nowMs` e il proprio `startedAtMs`.
|
|
32121
|
+
*
|
|
32122
|
+
* Il caso della PRIMA slice già attiva è trattato esplicitamente e vale come
|
|
32123
|
+
* fronte solo se il timestamp UPSTREAM della transizione è posteriore a
|
|
32124
|
+
* `startedAtMs` **e** entro `firstSightingFreshnessMs`. Entrambe le metà
|
|
32125
|
+
* servono: la sola freschezza scatterebbe su un'idratazione al boot di uno
|
|
32126
|
+
* stato flippato pochi secondi prima del riavvio, e il solo "dopo che abbiamo
|
|
32127
|
+
* iniziato" scatterebbe, su un processo di lunga vita, per una sorgente
|
|
32128
|
+
* adottata oggi il cui stato è cambiato ieri. Il caso ambiguo ERRA VERSO IL
|
|
32129
|
+
* SILENZIO e lo dichiara (`baseline-seeded-stale-active`).
|
|
32130
|
+
*/
|
|
32131
|
+
function evaluateSensorEdge(input) {
|
|
32132
|
+
const value = sliceActiveValue(input.capName, input.slice);
|
|
32133
|
+
if (value === null) return {
|
|
32134
|
+
edge: "none",
|
|
32135
|
+
value: null,
|
|
32136
|
+
reason: isSourceCap(input.capName) ? "non-boolean-value" : "unknown-cap"
|
|
32137
|
+
};
|
|
32138
|
+
if (input.prior === void 0) {
|
|
32139
|
+
if (!value) return {
|
|
32140
|
+
edge: "none",
|
|
32141
|
+
value,
|
|
32142
|
+
reason: "baseline-seeded-inactive"
|
|
32143
|
+
};
|
|
32144
|
+
const changedAt = sliceChangedAt(input.capName, input.slice);
|
|
32145
|
+
const floor = Math.max(input.startedAtMs, input.nowMs - input.firstSightingFreshnessMs);
|
|
32146
|
+
if (changedAt === null || changedAt < floor) return {
|
|
32147
|
+
edge: "none",
|
|
32148
|
+
value,
|
|
32149
|
+
reason: "baseline-seeded-stale-active"
|
|
32150
|
+
};
|
|
32151
|
+
return {
|
|
32152
|
+
edge: "rising",
|
|
32153
|
+
value: true
|
|
32154
|
+
};
|
|
32155
|
+
}
|
|
32156
|
+
if (input.prior === value) return {
|
|
32157
|
+
edge: "none",
|
|
32158
|
+
value,
|
|
32159
|
+
reason: "no-change"
|
|
32160
|
+
};
|
|
32161
|
+
if (!value) return {
|
|
32162
|
+
edge: "none",
|
|
32163
|
+
value,
|
|
32164
|
+
reason: "falling-edge"
|
|
32165
|
+
};
|
|
32166
|
+
return {
|
|
32167
|
+
edge: "rising",
|
|
32168
|
+
value: true
|
|
32169
|
+
};
|
|
32170
|
+
}
|
|
32171
|
+
//#endregion
|
|
31497
32172
|
//#region src/constants.ts
|
|
31498
32173
|
var HF_REPO = "camstack/camstack-models";
|
|
31499
32174
|
var HF_BASE_URL = `https://huggingface.co/${HF_REPO}/resolve/main`;
|
|
@@ -32655,6 +33330,47 @@ var BaseDeviceProvider = class extends require_sleep.BaseAddon {
|
|
|
32655
33330
|
}
|
|
32656
33331
|
};
|
|
32657
33332
|
//#endregion
|
|
33333
|
+
//#region src/device/battery-presence.ts
|
|
33334
|
+
/**
|
|
33335
|
+
* Default silence budget before a sleeping battery camera is called gone.
|
|
33336
|
+
*
|
|
33337
|
+
* Sized off the mechanism that produces contact, not off taste: a battery cam
|
|
33338
|
+
* on this deployment surfaces a firmware push (battery level, sleep/wake, or a
|
|
33339
|
+
* motion email) on the order of hours even with no visitors, and the snapshot
|
|
33340
|
+
* wrapper's own battery window is 1 hour. Six hours is therefore several
|
|
33341
|
+
* missed opportunities, not one — so a single quiet night does not raise a
|
|
33342
|
+
* fault, and a genuinely flat camera is named well inside a day.
|
|
33343
|
+
*/
|
|
33344
|
+
var BATTERY_UNREACHABLE_AFTER_MS = 360 * 6e4;
|
|
33345
|
+
/**
|
|
33346
|
+
* THE derivation. One crop rectangle, one presence verdict — see D52 for why
|
|
33347
|
+
* this repo insists a derived value has exactly one implementation.
|
|
33348
|
+
*
|
|
33349
|
+
* `undefined` status ⇒ `sleeping`. A device with no slice has made no claim,
|
|
33350
|
+
* and the caller decides separately whether it is even battery-operated
|
|
33351
|
+
* (`DeviceFeature.BatteryOperated`); this function never answers that
|
|
33352
|
+
* question, only what a battery device is doing.
|
|
33353
|
+
*/
|
|
33354
|
+
function deriveBatteryPresence(input) {
|
|
33355
|
+
const status = input.status;
|
|
33356
|
+
if (!status) return "sleeping";
|
|
33357
|
+
if (status.sleeping !== true) return "awake";
|
|
33358
|
+
const lastContactAt = status.lastContactAt;
|
|
33359
|
+
if (typeof lastContactAt !== "number" || lastContactAt <= 0) return "sleeping";
|
|
33360
|
+
const budget = input.unreachableAfterMs ?? 216e5;
|
|
33361
|
+
return input.nowMs - lastContactAt > budget ? "unreachable" : "sleeping";
|
|
33362
|
+
}
|
|
33363
|
+
/**
|
|
33364
|
+
* Is this presence a FAULT the operator should be told about?
|
|
33365
|
+
*
|
|
33366
|
+
* Exists so no surface has to re-decide it — the whole point of the third
|
|
33367
|
+
* state is that `sleeping` stops being rendered as breakage, and a caller that
|
|
33368
|
+
* writes `presence !== 'awake'` has silently undone that.
|
|
33369
|
+
*/
|
|
33370
|
+
function isBatteryPresenceFault(presence) {
|
|
33371
|
+
return presence === "unreachable";
|
|
33372
|
+
}
|
|
33373
|
+
//#endregion
|
|
32658
33374
|
//#region src/device/declared-device.ts
|
|
32659
33375
|
/** Marker written to a declared integration's `info`. */
|
|
32660
33376
|
var DECLARED_INTEGRATION_FIXED_KEY = "fixed";
|
|
@@ -33121,47 +33837,6 @@ function resolveDeviceProfile(features) {
|
|
|
33121
33837
|
return null;
|
|
33122
33838
|
}
|
|
33123
33839
|
//#endregion
|
|
33124
|
-
//#region src/device/battery-presence.ts
|
|
33125
|
-
/**
|
|
33126
|
-
* Default silence budget before a sleeping battery camera is called gone.
|
|
33127
|
-
*
|
|
33128
|
-
* Sized off the mechanism that produces contact, not off taste: a battery cam
|
|
33129
|
-
* on this deployment surfaces a firmware push (battery level, sleep/wake, or a
|
|
33130
|
-
* motion email) on the order of hours even with no visitors, and the snapshot
|
|
33131
|
-
* wrapper's own battery window is 1 hour. Six hours is therefore several
|
|
33132
|
-
* missed opportunities, not one — so a single quiet night does not raise a
|
|
33133
|
-
* fault, and a genuinely flat camera is named well inside a day.
|
|
33134
|
-
*/
|
|
33135
|
-
var BATTERY_UNREACHABLE_AFTER_MS = 360 * 6e4;
|
|
33136
|
-
/**
|
|
33137
|
-
* THE derivation. One crop rectangle, one presence verdict — see D52 for why
|
|
33138
|
-
* this repo insists a derived value has exactly one implementation.
|
|
33139
|
-
*
|
|
33140
|
-
* `undefined` status ⇒ `sleeping`. A device with no slice has made no claim,
|
|
33141
|
-
* and the caller decides separately whether it is even battery-operated
|
|
33142
|
-
* (`DeviceFeature.BatteryOperated`); this function never answers that
|
|
33143
|
-
* question, only what a battery device is doing.
|
|
33144
|
-
*/
|
|
33145
|
-
function deriveBatteryPresence(input) {
|
|
33146
|
-
const status = input.status;
|
|
33147
|
-
if (!status) return "sleeping";
|
|
33148
|
-
if (status.sleeping !== true) return "awake";
|
|
33149
|
-
const lastContactAt = status.lastContactAt;
|
|
33150
|
-
if (typeof lastContactAt !== "number" || lastContactAt <= 0) return "sleeping";
|
|
33151
|
-
const budget = input.unreachableAfterMs ?? 216e5;
|
|
33152
|
-
return input.nowMs - lastContactAt > budget ? "unreachable" : "sleeping";
|
|
33153
|
-
}
|
|
33154
|
-
/**
|
|
33155
|
-
* Is this presence a FAULT the operator should be told about?
|
|
33156
|
-
*
|
|
33157
|
-
* Exists so no surface has to re-decide it — the whole point of the third
|
|
33158
|
-
* state is that `sleeping` stops being rendered as breakage, and a caller that
|
|
33159
|
-
* writes `presence !== 'awake'` has silently undone that.
|
|
33160
|
-
*/
|
|
33161
|
-
function isBatteryPresenceFault(presence) {
|
|
33162
|
-
return presence === "unreachable";
|
|
33163
|
-
}
|
|
33164
|
-
//#endregion
|
|
33165
33840
|
//#region src/device/path-util.ts
|
|
33166
33841
|
/** Returns true when `x` is a non-null, non-array plain object. */
|
|
33167
33842
|
function isRecord(x) {
|
|
@@ -40445,6 +41120,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
40445
41120
|
addonId: null,
|
|
40446
41121
|
access: "create"
|
|
40447
41122
|
},
|
|
41123
|
+
"system.getLoggingSettings": {
|
|
41124
|
+
capName: "system",
|
|
41125
|
+
capScope: "system",
|
|
41126
|
+
addonId: null,
|
|
41127
|
+
access: "view"
|
|
41128
|
+
},
|
|
41129
|
+
"system.getRequestCensus": {
|
|
41130
|
+
capName: "system",
|
|
41131
|
+
capScope: "system",
|
|
41132
|
+
addonId: null,
|
|
41133
|
+
access: "view"
|
|
41134
|
+
},
|
|
40448
41135
|
"system.getRetentionConfig": {
|
|
40449
41136
|
capName: "system",
|
|
40450
41137
|
capScope: "system",
|
|
@@ -40475,6 +41162,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
40475
41162
|
addonId: null,
|
|
40476
41163
|
access: "view"
|
|
40477
41164
|
},
|
|
41165
|
+
"system.setLoggingSettings": {
|
|
41166
|
+
capName: "system",
|
|
41167
|
+
capScope: "system",
|
|
41168
|
+
addonId: null,
|
|
41169
|
+
access: "create"
|
|
41170
|
+
},
|
|
40478
41171
|
"system.setRetentionConfig": {
|
|
40479
41172
|
capName: "system",
|
|
40480
41173
|
capScope: "system",
|
|
@@ -41887,6 +42580,10 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
|
|
|
41887
42580
|
name: "deviceId",
|
|
41888
42581
|
form: "single",
|
|
41889
42582
|
optional: true
|
|
42583
|
+
}, {
|
|
42584
|
+
name: "deviceIds",
|
|
42585
|
+
form: "array",
|
|
42586
|
+
optional: true
|
|
41890
42587
|
}],
|
|
41891
42588
|
"fanControl.setDirection": [{
|
|
41892
42589
|
name: "deviceId",
|
|
@@ -44204,7 +44901,10 @@ function createSystemProxy(api) {
|
|
|
44204
44901
|
forceRetentionCleanup: (input) => dispatch("system", "forceRetentionCleanup", "mutation", input),
|
|
44205
44902
|
getSiteLocation: (input) => dispatch("system", "getSiteLocation", "query", input),
|
|
44206
44903
|
setSiteLocation: (input) => dispatch("system", "setSiteLocation", "mutation", input),
|
|
44207
|
-
detectSiteLocation: (input) => dispatch("system", "detectSiteLocation", "mutation", input)
|
|
44904
|
+
detectSiteLocation: (input) => dispatch("system", "detectSiteLocation", "mutation", input),
|
|
44905
|
+
getRequestCensus: (input) => dispatch("system", "getRequestCensus", "query", input),
|
|
44906
|
+
getLoggingSettings: (input) => dispatch("system", "getLoggingSettings", "query", input),
|
|
44907
|
+
setLoggingSettings: (input) => dispatch("system", "setLoggingSettings", "mutation", input)
|
|
44208
44908
|
},
|
|
44209
44909
|
terminalSession: {
|
|
44210
44910
|
listProfiles: (input) => dispatch("terminalSession", "listProfiles", "query", input),
|
|
@@ -46067,6 +46767,7 @@ var NATIVE_LEASE_BUDGET_KEY = "nativeLeaseBudgetMb";
|
|
|
46067
46767
|
var NATIVE_LEASE_ACTIVITY_KEY = "nativeLeaseActivityMs";
|
|
46068
46768
|
var NATIVE_LEASE_ADMISSION_KEY = "nativeLeaseAdmission";
|
|
46069
46769
|
var NATIVE_LEASE_TILE_BUDGET_KEY = "nativeTileBudgetMb";
|
|
46770
|
+
var NATIVE_LEASE_SCENE_BUDGET_KEY = "nativeSceneBudgetMb";
|
|
46070
46771
|
/**
|
|
46071
46772
|
* WHICH delivered frames the decode worker retains a native copy of.
|
|
46072
46773
|
*
|
|
@@ -46161,7 +46862,38 @@ var NativeLeaseSettingsSchema = zod.z.object({
|
|
|
46161
46862
|
* fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
|
|
46162
46863
|
* reproduce that.
|
|
46163
46864
|
*/
|
|
46164
|
-
tileBudgetMb: zod.z.number().int().min(0).max(1024)
|
|
46865
|
+
tileBudgetMb: zod.z.number().int().min(0).max(1024),
|
|
46866
|
+
/**
|
|
46867
|
+
* RAM ceiling per decode worker, in MB, for the SCENE TILES — one
|
|
46868
|
+
* JPEG-encoded copy of the WHOLE native frame, cut in the same instant as the
|
|
46869
|
+
* subject tiles, on frames that detected something.
|
|
46870
|
+
*
|
|
46871
|
+
* It exists because a subject tile cannot answer a FULL-FRAME request:
|
|
46872
|
+
* containment is strict by design, so the native `keyFrame`, the detail
|
|
46873
|
+
* plane's `frameJpeg` rung and the display-crop fallback had no rung at all
|
|
46874
|
+
* below the hold. Measured on the live cluster: 23.3% of key-frame captures
|
|
46875
|
+
* missed, 95.7% of them with `worker-lease-gone` — the raster released one
|
|
46876
|
+
* frame-time after delivery, with the request only p50 367 ms behind it.
|
|
46877
|
+
*
|
|
46878
|
+
* Sizing, and why this is a budget and not a duration: a scene tile is
|
|
46879
|
+
* ~1.5-2.5 MB at 4K (against ~23.75 MB for the raster it was cut from and
|
|
46880
|
+
* ~60-120 KB for a subject tile), and it is cut ~0.4 times a second per busy
|
|
46881
|
+
* camera — only detection-bearing frames get one. 48 MB is therefore ~20-30
|
|
46882
|
+
* frames, i.e. the store's 30 s TTL binds at the steady state and the budget
|
|
46883
|
+
* binds only through a detection burst, where it still covers well past the
|
|
46884
|
+
* measured p90 ask age of 4.3 s. Holding the RASTERS for the same window
|
|
46885
|
+
* would be ~498 MB per camera and ~6 GB at peak concurrency — the OOM this
|
|
46886
|
+
* whole shape exists to avoid.
|
|
46887
|
+
*
|
|
46888
|
+
* A SEPARATE ceiling from `tileBudgetMb` on purpose: a scene tile is ~20× a
|
|
46889
|
+
* subject tile, so one shared budget would let a busy camera's key frames
|
|
46890
|
+
* evict the face/plate tiles the recognisers depend on. Two budgets make that
|
|
46891
|
+
* impossible rather than unlikely. `0` DISABLES scene tiles and restores the
|
|
46892
|
+
* pre-existing behaviour, where a late full-frame request had nothing but the
|
|
46893
|
+
* ≤640 RAM raster — which the `keyFrame` gate rejects, so in practice it had
|
|
46894
|
+
* nothing.
|
|
46895
|
+
*/
|
|
46896
|
+
sceneBudgetMb: zod.z.number().int().min(0).max(1024)
|
|
46165
46897
|
});
|
|
46166
46898
|
/**
|
|
46167
46899
|
* The values in force when the operator has set nothing.
|
|
@@ -46177,6 +46909,7 @@ var DEFAULT_NATIVE_LEASE_SETTINGS = {
|
|
|
46177
46909
|
budgetMb: 1024,
|
|
46178
46910
|
activityMs: 15e3,
|
|
46179
46911
|
tileBudgetMb: 64,
|
|
46912
|
+
sceneBudgetMb: 48,
|
|
46180
46913
|
admission: "inferred"
|
|
46181
46914
|
};
|
|
46182
46915
|
/** Slider bounds for the operator-facing knobs (orchestrator settings UI). */
|
|
@@ -46204,6 +46937,12 @@ var NATIVE_LEASE_TILE_BUDGET_FIELD = {
|
|
|
46204
46937
|
step: 16,
|
|
46205
46938
|
default: DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb
|
|
46206
46939
|
};
|
|
46940
|
+
var NATIVE_LEASE_SCENE_BUDGET_FIELD = {
|
|
46941
|
+
min: 0,
|
|
46942
|
+
max: 1024,
|
|
46943
|
+
step: 16,
|
|
46944
|
+
default: DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb
|
|
46945
|
+
};
|
|
46207
46946
|
/** Select options for the admission knob (orchestrator settings UI). */
|
|
46208
46947
|
var NATIVE_LEASE_ADMISSION_FIELD = {
|
|
46209
46948
|
options: [{
|
|
@@ -46262,12 +47001,14 @@ function readNativeLeaseOverride(config) {
|
|
|
46262
47001
|
const activityMs = readKnob("activityMs", config[NATIVE_LEASE_ACTIVITY_KEY]);
|
|
46263
47002
|
const admission = readAdmissionKnob(config[NATIVE_LEASE_ADMISSION_KEY]);
|
|
46264
47003
|
const tileBudgetMb = readKnob("tileBudgetMb", config[NATIVE_LEASE_TILE_BUDGET_KEY]);
|
|
47004
|
+
const sceneBudgetMb = readKnob("sceneBudgetMb", config[NATIVE_LEASE_SCENE_BUDGET_KEY]);
|
|
46265
47005
|
return {
|
|
46266
47006
|
...holdFrames === null ? {} : { holdFrames },
|
|
46267
47007
|
...budgetMb === null ? {} : { budgetMb },
|
|
46268
47008
|
...activityMs === null ? {} : { activityMs },
|
|
46269
47009
|
...admission === null ? {} : { admission },
|
|
46270
|
-
...tileBudgetMb === null ? {} : { tileBudgetMb }
|
|
47010
|
+
...tileBudgetMb === null ? {} : { tileBudgetMb },
|
|
47011
|
+
...sceneBudgetMb === null ? {} : { sceneBudgetMb }
|
|
46271
47012
|
};
|
|
46272
47013
|
}
|
|
46273
47014
|
function isHydratedField(entry) {
|
|
@@ -46278,7 +47019,8 @@ var LEASE_KEYS = [
|
|
|
46278
47019
|
NATIVE_LEASE_BUDGET_KEY,
|
|
46279
47020
|
NATIVE_LEASE_ACTIVITY_KEY,
|
|
46280
47021
|
NATIVE_LEASE_ADMISSION_KEY,
|
|
46281
|
-
NATIVE_LEASE_TILE_BUDGET_KEY
|
|
47022
|
+
NATIVE_LEASE_TILE_BUDGET_KEY,
|
|
47023
|
+
NATIVE_LEASE_SCENE_BUDGET_KEY
|
|
46282
47024
|
];
|
|
46283
47025
|
/**
|
|
46284
47026
|
* Extract the operator's lease overrides from an
|
|
@@ -48370,6 +49112,7 @@ exports.DEFAULT_DETAIL_CROP_CONVENTION = DEFAULT_DETAIL_CROP_CONVENTION;
|
|
|
48370
49112
|
exports.DEFAULT_EVENTS_BAND_BUFFER_SEC = DEFAULT_EVENTS_BAND_BUFFER_SEC;
|
|
48371
49113
|
exports.DEFAULT_EVENT_COLOR = DEFAULT_EVENT_COLOR;
|
|
48372
49114
|
exports.DEFAULT_FEATURES = DEFAULT_FEATURES;
|
|
49115
|
+
exports.DEFAULT_FIRST_SIGHTING_FRESHNESS_MS = DEFAULT_FIRST_SIGHTING_FRESHNESS_MS;
|
|
48373
49116
|
exports.DEFAULT_MIN_LANDMARK_FACE_SIZE_PX = DEFAULT_MIN_LANDMARK_FACE_SIZE_PX;
|
|
48374
49117
|
exports.DEFAULT_NATIVE_LEASE_SETTINGS = DEFAULT_NATIVE_LEASE_SETTINGS;
|
|
48375
49118
|
exports.DEFAULT_POOL_MEMORY_POLICY = DEFAULT_POOL_MEMORY_POLICY;
|
|
@@ -48420,6 +49163,9 @@ exports.DeviceRuntimeState = DeviceRuntimeState;
|
|
|
48420
49163
|
exports.DeviceSelectorSchema = DeviceSelectorSchema;
|
|
48421
49164
|
exports.DeviceStatusSchema = DeviceStatusSchema;
|
|
48422
49165
|
exports.DeviceType = require_sleep.DeviceType;
|
|
49166
|
+
exports.DiagnosticIdSchema = DiagnosticIdSchema;
|
|
49167
|
+
exports.DiagnosticWindowPatchSchema = DiagnosticWindowPatchSchema;
|
|
49168
|
+
exports.DiagnosticWindowSchema = DiagnosticWindowSchema;
|
|
48423
49169
|
exports.DiscoveredChildDeviceSchema = DiscoveredChildDeviceSchema;
|
|
48424
49170
|
exports.DiscoveredChildStatusSchema = DiscoveredChildStatusSchema;
|
|
48425
49171
|
exports.DiscoveredDeviceSchema = DiscoveredDeviceSchema;
|
|
@@ -48484,6 +49230,7 @@ exports.ExpressionGlobalBindingSchema = ExpressionGlobalBindingSchema;
|
|
|
48484
49230
|
exports.ExpressionLiteralBindingSchema = ExpressionLiteralBindingSchema;
|
|
48485
49231
|
exports.ExpressionParseError = ExpressionParseError;
|
|
48486
49232
|
exports.ExpressionSourceSchema = ExpressionSourceSchema;
|
|
49233
|
+
exports.FIRST_LEVEL_MACRO_CLASSES = FIRST_LEVEL_MACRO_CLASSES;
|
|
48487
49234
|
exports.FULL_IMAGE_BBOX = FULL_IMAGE_BBOX;
|
|
48488
49235
|
exports.FanControlStatusSchema = FanControlStatusSchema;
|
|
48489
49236
|
exports.FanDirectionSchema = FanDirectionSchema;
|
|
@@ -48497,6 +49244,7 @@ exports.FrameInputSchema = FrameInputSchema;
|
|
|
48497
49244
|
exports.FrameLazyCountersSchema = FrameLazyCountersSchema;
|
|
48498
49245
|
exports.FrameLazyMetricsSchema = FrameLazyMetricsSchema;
|
|
48499
49246
|
exports.GasStatusSchema = GasStatusSchema;
|
|
49247
|
+
exports.GetLoggingSettingsInputSchema = GetLoggingSettingsInputSchema;
|
|
48500
49248
|
exports.GetStreamWithCodecInputSchema = GetStreamWithCodecInputSchema;
|
|
48501
49249
|
exports.GlobalMetricsSchema = GlobalMetricsSchema;
|
|
48502
49250
|
exports.HAP_AUDIO_BASE = HAP_AUDIO_BASE;
|
|
@@ -48568,6 +49316,13 @@ exports.LockStateSchema = LockStateSchema;
|
|
|
48568
49316
|
exports.LogEntrySchema = LogEntrySchema;
|
|
48569
49317
|
exports.LogLevelSchema = LogLevelSchema;
|
|
48570
49318
|
exports.LogStreamEntrySchema = LogStreamEntrySchema;
|
|
49319
|
+
exports.LoggingEffectiveSchema = LoggingEffectiveSchema;
|
|
49320
|
+
exports.LoggingExplicitSchema = LoggingExplicitSchema;
|
|
49321
|
+
exports.LoggingLevelLayerSchema = LoggingLevelLayerSchema;
|
|
49322
|
+
exports.LoggingLevelSourceSchema = LoggingLevelSourceSchema;
|
|
49323
|
+
exports.LoggingScopeKindSchema = LoggingScopeKindSchema;
|
|
49324
|
+
exports.LoggingSettingsPatchSchema = LoggingSettingsPatchSchema;
|
|
49325
|
+
exports.LoggingSettingsStateSchema = LoggingSettingsStateSchema;
|
|
48571
49326
|
exports.LoginMethodContributionSchema = LoginMethodContributionSchema;
|
|
48572
49327
|
exports.LoginStageEnum = LoginStageEnum;
|
|
48573
49328
|
exports.MACRO_LABELS = MACRO_LABELS;
|
|
@@ -48580,6 +49335,7 @@ exports.MAX_EXPRESSION_BINDINGS = MAX_EXPRESSION_BINDINGS;
|
|
|
48580
49335
|
exports.MAX_EXPRESSION_CALL_ARGS = MAX_EXPRESSION_CALL_ARGS;
|
|
48581
49336
|
exports.MAX_EXPRESSION_EVAL_STEPS = MAX_EXPRESSION_EVAL_STEPS;
|
|
48582
49337
|
exports.MAX_EXPRESSION_SOURCE_LENGTH = MAX_EXPRESSION_SOURCE_LENGTH;
|
|
49338
|
+
exports.MAX_SENSOR_TRIGGER_DEVICES = MAX_SENSOR_TRIGGER_DEVICES;
|
|
48583
49339
|
exports.METHOD_ACCESS_MAP = METHOD_ACCESS_MAP;
|
|
48584
49340
|
exports.METHOD_DEVICE_SELECTORS = METHOD_DEVICE_SELECTORS;
|
|
48585
49341
|
exports.MODEL_FORMATS = MODEL_FORMATS;
|
|
@@ -48640,6 +49396,8 @@ exports.NATIVE_LEASE_BUDGET_FIELD = NATIVE_LEASE_BUDGET_FIELD;
|
|
|
48640
49396
|
exports.NATIVE_LEASE_BUDGET_KEY = NATIVE_LEASE_BUDGET_KEY;
|
|
48641
49397
|
exports.NATIVE_LEASE_HOLD_FIELD = NATIVE_LEASE_HOLD_FIELD;
|
|
48642
49398
|
exports.NATIVE_LEASE_HOLD_KEY = NATIVE_LEASE_HOLD_KEY;
|
|
49399
|
+
exports.NATIVE_LEASE_SCENE_BUDGET_FIELD = NATIVE_LEASE_SCENE_BUDGET_FIELD;
|
|
49400
|
+
exports.NATIVE_LEASE_SCENE_BUDGET_KEY = NATIVE_LEASE_SCENE_BUDGET_KEY;
|
|
48643
49401
|
exports.NATIVE_LEASE_SECTION_ID = NATIVE_LEASE_SECTION_ID;
|
|
48644
49402
|
exports.NATIVE_LEASE_TILE_BUDGET_FIELD = NATIVE_LEASE_TILE_BUDGET_FIELD;
|
|
48645
49403
|
exports.NATIVE_LEASE_TILE_BUDGET_KEY = NATIVE_LEASE_TILE_BUDGET_KEY;
|
|
@@ -48846,6 +49604,7 @@ exports.RecordingDaysSchema = RecordingDaysSchema;
|
|
|
48846
49604
|
exports.RecordingDeviceUsageSchema = RecordingDeviceUsageSchema;
|
|
48847
49605
|
exports.RecordingLocationUsageSchema = RecordingLocationUsageSchema;
|
|
48848
49606
|
exports.RecordingManifestSchema = RecordingManifestSchema;
|
|
49607
|
+
exports.RecordingObjectTriggerClassSchema = RecordingObjectTriggerClassSchema;
|
|
48849
49608
|
exports.RecordingRangeSchema = RecordingRangeSchema;
|
|
48850
49609
|
exports.RecordingRebalanceInputSchema = RecordingRebalanceInputSchema;
|
|
48851
49610
|
exports.RecordingRebalanceMoveSchema = RecordingRebalanceMoveSchema;
|
|
@@ -48866,6 +49625,10 @@ exports.RelocateJobStateSchema = RelocateJobStateSchema;
|
|
|
48866
49625
|
exports.RelocateMediaInputSchema = RelocateMediaInputSchema;
|
|
48867
49626
|
exports.RenderedAsSchema = RenderedAsSchema;
|
|
48868
49627
|
exports.ReportMotionInputSchema = ReportMotionInputSchema;
|
|
49628
|
+
exports.RequestCensusGroupSchema = RequestCensusGroupSchema;
|
|
49629
|
+
exports.RequestCensusProcedureSchema = RequestCensusProcedureSchema;
|
|
49630
|
+
exports.RequestCensusSnapshotSchema = RequestCensusSnapshotSchema;
|
|
49631
|
+
exports.RequestCensusStatusSchema = RequestCensusStatusSchema;
|
|
48869
49632
|
exports.RetrainAnnotationDraftSchema = RetrainAnnotationDraftSchema;
|
|
48870
49633
|
exports.RetrainAnnotationKindSchema = RetrainAnnotationKindSchema;
|
|
48871
49634
|
exports.RetrainAnnotationSchema = RetrainAnnotationSchema;
|
|
@@ -48903,6 +49666,10 @@ exports.SCENE_RESET_RECAPTURES = SCENE_RESET_RECAPTURES;
|
|
|
48903
49666
|
exports.SCOPE_PRESETS = SCOPE_PRESETS;
|
|
48904
49667
|
exports.SENSOR_FEATURES = SENSOR_FEATURES;
|
|
48905
49668
|
exports.SENSOR_MAP = SENSOR_MAP;
|
|
49669
|
+
exports.SOURCE_CAPS = SOURCE_CAPS;
|
|
49670
|
+
exports.SOURCE_CAP_ACTIVE_FIELD = SOURCE_CAP_ACTIVE_FIELD;
|
|
49671
|
+
exports.SOURCE_CAP_CHANGED_AT_FIELD = SOURCE_CAP_CHANGED_AT_FIELD;
|
|
49672
|
+
exports.SOURCE_DEVICE_TYPES = SOURCE_DEVICE_TYPES;
|
|
48906
49673
|
exports.SOURCE_INFO_METADATA_KEY = SOURCE_INFO_METADATA_KEY;
|
|
48907
49674
|
exports.STREAM_PROFILE_META = STREAM_PROFILE_META;
|
|
48908
49675
|
exports.STREAM_QUALITY_LABELS = STREAM_QUALITY_LABELS;
|
|
@@ -48934,6 +49701,7 @@ exports.ServerRollbackInfoSchema = ServerRollbackInfoSchema;
|
|
|
48934
49701
|
exports.ServerUpdateActionResultSchema = ServerUpdateActionResultSchema;
|
|
48935
49702
|
exports.ServerUpdateCheckResultSchema = ServerUpdateCheckResultSchema;
|
|
48936
49703
|
exports.ServerUpdateStateSchema = ServerUpdateStateSchema;
|
|
49704
|
+
exports.SetLoggingSettingsInputSchema = SetLoggingSettingsInputSchema;
|
|
48937
49705
|
exports.SetSiteLocationInputSchema = SetSiteLocationInputSchema;
|
|
48938
49706
|
exports.SettingsPatchSchema = SettingsPatchSchema;
|
|
48939
49707
|
exports.SettingsRecordSchema = SettingsRecordSchema;
|
|
@@ -49037,6 +49805,8 @@ exports.TrackZoneFilterSchema = TrackZoneFilterSchema;
|
|
|
49037
49805
|
exports.TrackedDetectionSchema = TrackedDetectionSchema;
|
|
49038
49806
|
exports.TrainingExportDeviceTotalsSchema = TrainingExportDeviceTotalsSchema;
|
|
49039
49807
|
exports.TrainingExportSummarySchema = TrainingExportSummarySchema;
|
|
49808
|
+
exports.TransportPlaneCountsSchema = TransportPlaneCountsSchema;
|
|
49809
|
+
exports.TransportPlaneSchema = TransportPlaneSchema;
|
|
49040
49810
|
exports.TurnServerSchema = TurnServerSchema;
|
|
49041
49811
|
exports.UNIT_TABLE = UNIT_TABLE;
|
|
49042
49812
|
exports.UnifiedBrokerInfoSchema = BrokerInfoSchema$1;
|
|
@@ -49239,6 +50009,7 @@ exports.errMsg = require_err_msg.errMsg;
|
|
|
49239
50009
|
exports.evaluateAst = evaluateAst;
|
|
49240
50010
|
exports.evaluateExpressionSource = evaluateExpressionSource;
|
|
49241
50011
|
exports.evaluatePoolMemory = evaluatePoolMemory;
|
|
50012
|
+
exports.evaluateSensorEdge = evaluateSensorEdge;
|
|
49242
50013
|
exports.evaluateZoneRules = evaluateZoneRules;
|
|
49243
50014
|
exports.event = require_sleep.event;
|
|
49244
50015
|
exports.eventEmitterCapability = eventEmitterCapability;
|
|
@@ -49286,6 +50057,7 @@ exports.isDetectionMacroClass = isDetectionMacroClass;
|
|
|
49286
50057
|
exports.isDeviceConfigCap = require_sleep.isDeviceConfigCap;
|
|
49287
50058
|
exports.isDeviceScopedCap = require_sleep.isDeviceScopedCap;
|
|
49288
50059
|
exports.isEvent = require_sleep.isEvent;
|
|
50060
|
+
exports.isFirstLevelMacroClass = isFirstLevelMacroClass;
|
|
49289
50061
|
exports.isIsolatedBuiltin = isIsolatedBuiltin;
|
|
49290
50062
|
exports.isNode = isNode;
|
|
49291
50063
|
exports.isObjectInput = isObjectInput;
|
|
@@ -49294,6 +50066,7 @@ exports.isRestoredCap = isRestoredCap;
|
|
|
49294
50066
|
exports.isSameAddonId = isSameAddonId;
|
|
49295
50067
|
exports.isScheduleActive = isScheduleActive;
|
|
49296
50068
|
exports.isSoftwareDecode = require_canonical_hash.isSoftwareDecode;
|
|
50069
|
+
exports.isSourceCap = isSourceCap;
|
|
49297
50070
|
exports.isSystemDelivery = isSystemDelivery;
|
|
49298
50071
|
exports.isVoidInput = isVoidInput;
|
|
49299
50072
|
exports.jobKindSchema = jobKindSchema;
|
|
@@ -49447,6 +50220,8 @@ exports.setByPath = setByPath;
|
|
|
49447
50220
|
exports.settingsStoreCapability = settingsStoreCapability;
|
|
49448
50221
|
exports.sleep = require_sleep.sleep;
|
|
49449
50222
|
exports.sleepCancellable = require_sleep.sleepCancellable;
|
|
50223
|
+
exports.sliceActiveValue = sliceActiveValue;
|
|
50224
|
+
exports.sliceChangedAt = sliceChangedAt;
|
|
49450
50225
|
exports.smokeCapability = smokeCapability;
|
|
49451
50226
|
exports.smtpProviderCapability = smtpProviderCapability;
|
|
49452
50227
|
exports.snapshotCapability = snapshotCapability;
|