@camstack/addon-remote-storage 1.2.5 → 1.2.6
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/s3.addon.js +1 -1
- package/dist/s3.addon.mjs +1 -1
- package/dist/sftp.addon.js +1 -1
- package/dist/sftp.addon.mjs +1 -1
- package/dist/{shared-KbH8WQMe.mjs → shared-BPGRn0I7.mjs} +1881 -1632
- package/dist/{shared-B6y3vdUQ.js → shared-GZXJlzaK.js} +1881 -1632
- package/dist/webdav.addon.js +1 -1
- package/dist/webdav.addon.mjs +1 -1
- package/package.json +1 -1
|
@@ -7503,16 +7503,23 @@ var StorageLocationDeclarationSchema = object({
|
|
|
7503
7503
|
* Which node root the seeded `<id>:default` instance is placed under on a
|
|
7504
7504
|
* FRESH install:
|
|
7505
7505
|
* - `'data'` (default) — the node's data dir (`CAMSTACK_DATA` / boot dir),
|
|
7506
|
-
* the appData volume. Right for small/durable data (
|
|
7506
|
+
* the appData volume. Right for small/durable data (logs, models).
|
|
7507
7507
|
* - `'media'` — the dedicated media volume (`CAMSTACK_MEDIA_ROOT`) when that
|
|
7508
7508
|
* env is set, else falls back to the data root. Right for bulky, hot media
|
|
7509
7509
|
* (recordings, event media) that should stay off the appData disk.
|
|
7510
|
+
* - `'backup'` — the dedicated backup volume (`CAMSTACK_BACKUP_ROOT`, default
|
|
7511
|
+
* `/backups` in the image) so archives live on their own mount rather than
|
|
7512
|
+
* filling the appData disk. Falls back to the data root when unset.
|
|
7510
7513
|
*
|
|
7511
7514
|
* Only affects the seeded default's `basePath`; operators can repoint any
|
|
7512
7515
|
* location afterwards, and a `defaultsTo` slot inherits its parent's root
|
|
7513
7516
|
* regardless of this field. Absent (the common case) is treated as `'data'`.
|
|
7514
7517
|
*/
|
|
7515
|
-
defaultRoot: _enum([
|
|
7518
|
+
defaultRoot: _enum([
|
|
7519
|
+
"data",
|
|
7520
|
+
"media",
|
|
7521
|
+
"backup"
|
|
7522
|
+
]).optional()
|
|
7516
7523
|
});
|
|
7517
7524
|
var DecoderStatsSchema = object({
|
|
7518
7525
|
inputFps: number(),
|
|
@@ -8863,92 +8870,730 @@ var AccessoryKind = {
|
|
|
8863
8870
|
AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
|
|
8864
8871
|
DeviceFeature.BatteryOperated;
|
|
8865
8872
|
/**
|
|
8866
|
-
*
|
|
8867
|
-
*
|
|
8868
|
-
*
|
|
8869
|
-
*
|
|
8870
|
-
* caps (`battery`, `doorbell`, …) carry their domain-specific state on
|
|
8871
|
-
* their own slices.
|
|
8873
|
+
* Shared geometry vocabulary for on-frame shape caps — privacy-mask,
|
|
8874
|
+
* motion-zones, and the detection zones/lines editor all speak this one
|
|
8875
|
+
* language so a single drawing-plane editor and the providers stay
|
|
8876
|
+
* decoupled from each cap's storage.
|
|
8872
8877
|
*
|
|
8873
|
-
*
|
|
8874
|
-
*
|
|
8875
|
-
* `
|
|
8876
|
-
* `runtimeState.setCapState('device-status', …)`. Cross-process
|
|
8877
|
-
* consumers reach the same data via the `device-state` cap router
|
|
8878
|
-
* (`getCapSlice({deviceId, capName: 'device-status'})`).
|
|
8878
|
+
* All coordinates are normalized 0..1 of the camera frame (top-left
|
|
8879
|
+
* origin). Each cap composes the SUBSET of shape kinds it supports and
|
|
8880
|
+
* advertises it via `supportedShapes` in its `getOptions`.
|
|
8879
8881
|
*/
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
|
|
8883
|
-
|
|
8884
|
-
* stream-health, Reolink reads firmware push events, ONVIF tracks
|
|
8885
|
-
* ping responses. This cap intentionally does NOT prescribe which
|
|
8886
|
-
* signal drives the flag.
|
|
8887
|
-
*/
|
|
8888
|
-
online: boolean(),
|
|
8889
|
-
/** Ms epoch of the last `online` transition. Lets consumers tell
|
|
8890
|
-
* apart "just came online" from "still online". */
|
|
8891
|
-
lastChangedAt: number()
|
|
8882
|
+
/** A normalized 0..1 point (top-left origin). */
|
|
8883
|
+
var MaskPointSchema = object({
|
|
8884
|
+
x: number(),
|
|
8885
|
+
y: number()
|
|
8892
8886
|
});
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8887
|
+
/** Axis-aligned rectangle (normalized 0..1). */
|
|
8888
|
+
var MaskRectShapeSchema = object({
|
|
8889
|
+
kind: literal("rect"),
|
|
8890
|
+
x: number(),
|
|
8891
|
+
y: number(),
|
|
8892
|
+
width: number(),
|
|
8893
|
+
height: number()
|
|
8894
|
+
});
|
|
8895
|
+
/** Free polygon — an ordered list of normalized vertices (≥3). */
|
|
8896
|
+
var MaskPolygonShapeSchema = object({
|
|
8897
|
+
kind: literal("polygon"),
|
|
8898
|
+
points: array(MaskPointSchema)
|
|
8899
|
+
});
|
|
8900
|
+
/** Boolean cell grid — row-major, length === gridWidth*gridHeight. */
|
|
8901
|
+
var MaskGridShapeSchema = object({
|
|
8902
|
+
kind: literal("grid"),
|
|
8903
|
+
gridWidth: number(),
|
|
8904
|
+
gridHeight: number(),
|
|
8905
|
+
cells: array(boolean())
|
|
8906
|
+
});
|
|
8907
|
+
discriminatedUnion("kind", [
|
|
8908
|
+
MaskRectShapeSchema,
|
|
8909
|
+
MaskPolygonShapeSchema,
|
|
8910
|
+
MaskGridShapeSchema,
|
|
8911
|
+
object({
|
|
8912
|
+
kind: literal("line"),
|
|
8913
|
+
points: array(MaskPointSchema)
|
|
8914
|
+
})
|
|
8915
|
+
]);
|
|
8916
|
+
/** Every shape-kind discriminant, for `supportedShapes` advertisement. */
|
|
8917
|
+
var MaskShapeKindSchema = _enum([
|
|
8918
|
+
"rect",
|
|
8919
|
+
"polygon",
|
|
8920
|
+
"grid",
|
|
8921
|
+
"line"
|
|
8922
|
+
]);
|
|
8923
|
+
/** Polygon vertex bounds when a cap supports 'polygon' (e.g. Hikvision {min:4,max:4}). */
|
|
8924
|
+
var MaskPolygonVerticesSchema = object({
|
|
8925
|
+
min: number(),
|
|
8926
|
+
max: number()
|
|
8927
|
+
});
|
|
8928
|
+
/** Grid dimensions when a cap supports 'grid'. */
|
|
8929
|
+
var MaskGridDimsSchema = object({
|
|
8930
|
+
width: number(),
|
|
8931
|
+
height: number()
|
|
8896
8932
|
});
|
|
8897
8933
|
/**
|
|
8898
|
-
*
|
|
8899
|
-
* truth about what a device CAN do — which the kernel uses to:
|
|
8900
|
-
* 1. Reconcile accessory children (hub-children spawn siren/floodlight/PIR
|
|
8901
|
-
* based on what the firmware actually advertises).
|
|
8902
|
-
* 2. Compute the public `features: DeviceFeature[]` array surfaced via
|
|
8903
|
-
* `device-manager.listAll`.
|
|
8904
|
-
* 3. Decide which optional caps (PTZ, intercom, doorbell, battery, …)
|
|
8905
|
-
* to register on the device's capability surface.
|
|
8934
|
+
* notification-rules — the Notification Center rule surface (P1 core).
|
|
8906
8935
|
*
|
|
8907
|
-
*
|
|
8908
|
-
*
|
|
8909
|
-
* accessory reconciliation). Consumers read via:
|
|
8910
|
-
* `runtimeState.getCapState<FeatureProbeStatus>('feature-probe')`
|
|
8936
|
+
* Spec: `docs/superpowers/specs/2026-07-22-notification-center-requirements.md`
|
|
8937
|
+
* (operator decisions D-1/D-2/D-3 are binding):
|
|
8911
8938
|
*
|
|
8912
|
-
*
|
|
8913
|
-
*
|
|
8914
|
-
*
|
|
8939
|
+
* - D-2: rule EVALUATION lives in `addon-post-analysis` (the
|
|
8940
|
+
* `notification-center` module), hooked on the durable persistence
|
|
8941
|
+
* moments (object-event insert, TrackCloser.closeExpired) with a
|
|
8942
|
+
* persisted outbox + retry — never the lossy telemetry bus (D8).
|
|
8943
|
+
* - D-3: urgency belongs to the RULE. `delivery: 'immediate'` fires on the
|
|
8944
|
+
* FIRST persisted detection matching the conditions (per-track dedup,
|
|
8945
|
+
* `maxPerTrack` fixed at 1 — see {@link NC_MAX_PER_TRACK_IMMEDIATE});
|
|
8946
|
+
* `delivery: 'track-end'` evaluates the finalized track record at close.
|
|
8947
|
+
* - DISPATCH stays behind `notification-output` (rules reference targets
|
|
8948
|
+
* by id; per-backend params are a passthrough blob capped by the
|
|
8949
|
+
* target kind's own caps/degrade engine).
|
|
8915
8950
|
*
|
|
8916
|
-
*
|
|
8917
|
-
*
|
|
8918
|
-
*
|
|
8919
|
-
*
|
|
8951
|
+
* P1 scope: admin-authored rules only (`createdBy` stamped from the
|
|
8952
|
+
* server-injected caller identity — the first `caller: 'required'`
|
|
8953
|
+
* adopter). The P1 condition subset is: devices, classes(+exclude),
|
|
8954
|
+
* minConfidence, admin zones (any/all + exclude), weekly schedule
|
|
8955
|
+
* windows, and the optional label/identity/plate matchers. User rules,
|
|
8956
|
+
* private zones, per-recipient fan-out and the wider condition table are
|
|
8957
|
+
* P2+ (see spec §7).
|
|
8958
|
+
*
|
|
8959
|
+
* All schemas here are the single source of truth — `NcRule` etc. are
|
|
8960
|
+
* `z.infer` exports; no duplicate interfaces (the advanced-notifier
|
|
8961
|
+
* schema/interface drift is explicitly not repeated).
|
|
8920
8962
|
*/
|
|
8921
|
-
|
|
8963
|
+
/**
|
|
8964
|
+
* D-3: the trigger/urgency of a rule — which persistence moment evaluates it.
|
|
8965
|
+
* The value maps 1:1 onto the evaluated record kind:
|
|
8966
|
+
* - `immediate` ↔ object-event persist (lowest-latency detection burst)
|
|
8967
|
+
* - `track-end` ↔ TrackCloser.closeExpired (finalized track record)
|
|
8968
|
+
* - `device-event` ↔ SensorEventStore insert (doorbell press / sensor state
|
|
8969
|
+
* change of a LINKED device, one row per linked camera)
|
|
8970
|
+
* - `package-event` ↔ PackageDropDetector object-event insert (a `package`
|
|
8971
|
+
* delivery / pick-up)
|
|
8972
|
+
*
|
|
8973
|
+
* `immediate`/`track-end` carry the D-3 urgency semantics; `device-event`/
|
|
8974
|
+
* `package-event` are pure trigger kinds (no urgency dimension). Extending
|
|
8975
|
+
* this one field keeps the schema additive — a rule still declares exactly
|
|
8976
|
+
* one trigger.
|
|
8977
|
+
*/
|
|
8978
|
+
var NcDeliverySchema = _enum([
|
|
8979
|
+
"immediate",
|
|
8980
|
+
"track-end",
|
|
8981
|
+
"device-event",
|
|
8982
|
+
"package-event"
|
|
8983
|
+
]);
|
|
8984
|
+
/** Weekly schedule — OR of windows; absence on the rule = always active. */
|
|
8985
|
+
var NcScheduleSchema = object({
|
|
8986
|
+
windows: array(object({
|
|
8987
|
+
/** Days of week the window STARTS on (0 = Sunday … 6 = Saturday). */
|
|
8988
|
+
days: array(number().int().min(0).max(6)).min(1),
|
|
8989
|
+
startMinute: number().int().min(0).max(1439),
|
|
8990
|
+
endMinute: number().int().min(0).max(1439)
|
|
8991
|
+
})).min(1),
|
|
8992
|
+
/** IANA timezone; default = hub host timezone. */
|
|
8993
|
+
timezone: string().optional(),
|
|
8994
|
+
/** Active OUTSIDE the windows (e.g. "only outside business hours"). */
|
|
8995
|
+
invert: boolean().optional()
|
|
8996
|
+
});
|
|
8997
|
+
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
8998
|
+
var NcPlateMatcherSchema = object({
|
|
8999
|
+
values: array(string().min(1)).min(1),
|
|
9000
|
+
/** Max Levenshtein distance after normalization (uppercase alphanumeric). */
|
|
9001
|
+
maxDistance: number().int().min(0).max(3).default(1)
|
|
9002
|
+
});
|
|
9003
|
+
/**
|
|
9004
|
+
* Occupancy condition (DEVICE-EVENT trigger). Fires on a ZoneAnalytics
|
|
9005
|
+
* occupancy edge for a device — optionally narrowed to a single admin
|
|
9006
|
+
* `zoneId` and/or object `className`. `op` selects the edge/threshold:
|
|
9007
|
+
* - `became-occupied` (default) — count crossed 0 → ≥ `count`
|
|
9008
|
+
* - `became-free` — count crossed ≥ `count` → below it
|
|
9009
|
+
* - `>=` / `<=` — count is at/over or at/under `count`
|
|
9010
|
+
* `sustainSeconds` requires the condition hold continuously that long
|
|
9011
|
+
* before firing (debounces flicker; 0 = fire on the first matching edge).
|
|
9012
|
+
* Fail-closed: no ZoneAnalytics snapshot / missing zone / null snapshot ⇒
|
|
9013
|
+
* the condition never matches. Confirmed edge-state survives addon restarts
|
|
9014
|
+
* (declared SQLite collection, reseeded on boot).
|
|
9015
|
+
*/
|
|
9016
|
+
var NcOccupancyConditionSchema = object({
|
|
9017
|
+
/** Admin zone id to scope the count to; absent = whole-frame occupancy. */
|
|
9018
|
+
zoneId: string().optional(),
|
|
9019
|
+
/** Object class to count; absent = any class. */
|
|
9020
|
+
className: string().optional(),
|
|
9021
|
+
op: _enum([
|
|
9022
|
+
"became-occupied",
|
|
9023
|
+
"became-free",
|
|
9024
|
+
">=",
|
|
9025
|
+
"<="
|
|
9026
|
+
]).default("became-occupied"),
|
|
9027
|
+
count: number().int().min(0).default(1),
|
|
9028
|
+
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
9029
|
+
});
|
|
9030
|
+
/** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
|
|
9031
|
+
var NcZoneConditionSchema = object({
|
|
9032
|
+
ids: array(string().min(1)).min(1),
|
|
9033
|
+
/** Quantifier over `ids` — at least one / every one visited. */
|
|
9034
|
+
match: _enum(["any", "all"]).default("any")
|
|
9035
|
+
});
|
|
9036
|
+
/**
|
|
9037
|
+
* The P1 condition set — a flat AND of groups; absent group = pass;
|
|
9038
|
+
* membership lists are OR within the list (spec §2.3).
|
|
9039
|
+
*/
|
|
9040
|
+
var NcConditionsSchema = object({
|
|
9041
|
+
/** Device scope — absent = all devices. */
|
|
9042
|
+
devices: array(number()).optional(),
|
|
9043
|
+
/** Detector class names (any overlap with the record's class set). */
|
|
9044
|
+
classes: array(string().min(1)).optional(),
|
|
9045
|
+
/** Veto classes — any overlap fails the rule. */
|
|
9046
|
+
classesExclude: array(string().min(1)).optional(),
|
|
9047
|
+
/** Minimum detection confidence 0–1 (fails when the record has none). */
|
|
9048
|
+
minConfidence: number().min(0).max(1).optional(),
|
|
9049
|
+
/** Admin zone membership over event `zones` / track `zonesVisited`. */
|
|
9050
|
+
zones: NcZoneConditionSchema.optional(),
|
|
9051
|
+
/** Veto zones — any hit fails the rule. */
|
|
9052
|
+
zonesExclude: array(string().min(1)).optional(),
|
|
8922
9053
|
/**
|
|
8923
|
-
*
|
|
8924
|
-
*
|
|
8925
|
-
* `hasPtz`, `hasIntercom`, `hasDoorbell`, `hasFloodlight`, `hasSiren`,
|
|
8926
|
-
* `hasPirSensor`, `hasAutotrack`, `hasBattery`. Hikvision keys:
|
|
8927
|
-
* `hasSupplementalLight`, `lightHasWhiteLight`, `hasAlarmIo`, `hasPtz`.
|
|
9054
|
+
* Exact (case-insensitive) match on the record's collapsed `label`
|
|
9055
|
+
* (identity name / plate text / subclass).
|
|
8928
9056
|
*/
|
|
8929
|
-
|
|
9057
|
+
labelEquals: array(string().min(1)).optional(),
|
|
8930
9058
|
/**
|
|
8931
|
-
*
|
|
8932
|
-
*
|
|
8933
|
-
*
|
|
9059
|
+
* Identity matcher. P1 boundary: matched against the record's collapsed
|
|
9060
|
+
* `label` (the identity display name propagated by the face pipeline) —
|
|
9061
|
+
* identity-ID matching rides in P2 when identity ids reach the record.
|
|
8934
9062
|
*/
|
|
8935
|
-
|
|
8936
|
-
/**
|
|
8937
|
-
|
|
8938
|
-
/** Channel count for NVR/Hub devices; `1` for standalone cameras; `null` pre-probe. */
|
|
8939
|
-
channelCount: number().nullable(),
|
|
9063
|
+
identities: array(string().min(1)).optional(),
|
|
9064
|
+
/** Fuzzy plate matcher against the record's `label` (plate text). */
|
|
9065
|
+
plates: NcPlateMatcherSchema.optional(),
|
|
8940
9066
|
/**
|
|
8941
|
-
*
|
|
8942
|
-
*
|
|
8943
|
-
*
|
|
8944
|
-
*
|
|
9067
|
+
* Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics.
|
|
9068
|
+
* Same P1 boundary: matched against the record's collapsed `label` (the
|
|
9069
|
+
* identity display name). A record with NO label passes (nothing to
|
|
9070
|
+
* exclude), unlike the include variant which fails on an absent label.
|
|
8945
9071
|
*/
|
|
8946
|
-
|
|
9072
|
+
identitiesExclude: array(string().min(1)).optional(),
|
|
8947
9073
|
/**
|
|
8948
|
-
*
|
|
8949
|
-
*
|
|
8950
|
-
*
|
|
8951
|
-
|
|
9074
|
+
* Minimum server-computed key-event importance in [0,1] (`Track.importance`).
|
|
9075
|
+
* TRACK-END only: importance is scored at track close, so it does not exist
|
|
9076
|
+
* at immediate / object-event evaluation time (see catalog `appliesTo`). At
|
|
9077
|
+
* close the value is threaded via the close-time info (the `Track` clone is
|
|
9078
|
+
* captured before the DB row is updated, so it would otherwise read stale).
|
|
9079
|
+
* Fails when the record carries no importance (never guess quality — the
|
|
9080
|
+
* `minConfidence` precedent). MVP cut: a single scalar threshold.
|
|
9081
|
+
*/
|
|
9082
|
+
minImportance: number().min(0).max(1).optional(),
|
|
9083
|
+
/**
|
|
9084
|
+
* Minimum track dwell in SECONDS — `(lastSeen − firstSeen) / 1000`.
|
|
9085
|
+
* TRACK-END only: an `immediate` / object-event subject has no closed
|
|
9086
|
+
* lifespan, so a dwell condition never matches immediate delivery
|
|
9087
|
+
* (documented choice — the object-event record carries no `firstSeen`,
|
|
9088
|
+
* so dwell cannot be computed from what the subject actually carries).
|
|
9089
|
+
*/
|
|
9090
|
+
minDwellSeconds: number().min(0).optional(),
|
|
9091
|
+
/**
|
|
9092
|
+
* Detection provenance filter. `any` (default / absent) matches every
|
|
9093
|
+
* source; otherwise the subject's source must equal it. Legacy records
|
|
9094
|
+
* with no stamped source are treated as `pipeline`. The union spans both
|
|
9095
|
+
* record kinds — object events carry `pipeline` | `onboard`, synthetic
|
|
9096
|
+
* tracks carry `sensor`.
|
|
9097
|
+
*/
|
|
9098
|
+
source: _enum([
|
|
9099
|
+
"pipeline",
|
|
9100
|
+
"onboard",
|
|
9101
|
+
"sensor",
|
|
9102
|
+
"any"
|
|
9103
|
+
]).optional(),
|
|
9104
|
+
/**
|
|
9105
|
+
* Minimum identity / plate MATCH confidence in [0,1] — DISTINCT from the
|
|
9106
|
+
* detector `minConfidence` (that gates the object-detection score; this
|
|
9107
|
+
* gates the recognition/OCR match score). Fails when the subject carries
|
|
9108
|
+
* no label-match confidence (never guess). TRACK-END only: the confidence
|
|
9109
|
+
* lives on the recognition result and reaches the subject at track close.
|
|
9110
|
+
*
|
|
9111
|
+
* What it measures precisely (plumbed at track close — the closer threads
|
|
9112
|
+
* the value into `NcTrackClosedInfo.labelConfidence`, the same seam as
|
|
9113
|
+
* `importance`): the BEST recognition match confidence observed for the
|
|
9114
|
+
* label the track carries at close — for a face, the peak cosine similarity
|
|
9115
|
+
* of the ASSIGNED identity (`FaceMatch.score`, reset on an identity switch);
|
|
9116
|
+
* for a plate, the peak OCR read score of the best-held plate
|
|
9117
|
+
* (`plateText.confidence`). When BOTH a face and a plate were recognized on
|
|
9118
|
+
* one track the higher of the two is used. A track that ended with no
|
|
9119
|
+
* confident identity/plate match carries no value, so the condition fails
|
|
9120
|
+
* closed for it (an un-recognized subject).
|
|
9121
|
+
*/
|
|
9122
|
+
minLabelConfidence: number().min(0).max(1).optional(),
|
|
9123
|
+
/**
|
|
9124
|
+
* DEVICE-EVENT only. Raw device event-type tokens (`EventFire.eventType`,
|
|
9125
|
+
* e.g. a doorbell `press` / `press_long`) — matched case-insensitively
|
|
9126
|
+
* against the token carried on the device-event subject (extracted from the
|
|
9127
|
+
* event-emitter runtime slice's `lastEvent.eventType`). Fails when the
|
|
9128
|
+
* subject carries no token. Doorbell-pulse / passive-sensor kinds emit no
|
|
9129
|
+
* eventType, so gate those with {@link sensorKinds} instead.
|
|
9130
|
+
*/
|
|
9131
|
+
eventTypeTokens: array(string().min(1)).optional(),
|
|
9132
|
+
/**
|
|
9133
|
+
* DEVICE-EVENT only. Sensor/control taxonomy kinds (e.g. `doorbell`,
|
|
9134
|
+
* `contact`, `button`, `device-event`) — matched against the persisted
|
|
9135
|
+
* `SensorEvent.kind` (see `sensor-event-kinds.ts`). Membership is OR.
|
|
9136
|
+
*/
|
|
9137
|
+
sensorKinds: array(string().min(1)).optional(),
|
|
9138
|
+
/**
|
|
9139
|
+
* PACKAGE-EVENT only. Which package phase fires the rule — `delivered`
|
|
9140
|
+
* (a parked parcel appeared), `picked-up` (it departed), or `both`. Fails
|
|
9141
|
+
* when the subject's phase does not match (a subject always carries a phase
|
|
9142
|
+
* on the package-event trigger).
|
|
9143
|
+
*/
|
|
9144
|
+
packagePhase: _enum([
|
|
9145
|
+
"delivered",
|
|
9146
|
+
"picked-up",
|
|
9147
|
+
"both"
|
|
9148
|
+
]).optional(),
|
|
9149
|
+
/**
|
|
9150
|
+
* PERSONAL-RULE custom zones (viewer-drawn). Inline normalized polygons
|
|
9151
|
+
* (MaskShape vocabulary). A record passes when its bbox overlaps ANY
|
|
9152
|
+
* listed polygon (ZoneEngine membership semantics). Evaluated only when
|
|
9153
|
+
* the subject carries a bbox; absent bbox ⇒ the condition FAILS.
|
|
9154
|
+
*/
|
|
9155
|
+
customZones: array(MaskPolygonShapeSchema).optional(),
|
|
9156
|
+
/**
|
|
9157
|
+
* DEVICE-EVENT only. ZoneAnalytics occupancy edge — fires when a device's
|
|
9158
|
+
* (optionally zone/class-scoped) occupancy count crosses the configured
|
|
9159
|
+
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
9160
|
+
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
9161
|
+
*/
|
|
9162
|
+
occupancy: NcOccupancyConditionSchema.optional()
|
|
9163
|
+
});
|
|
9164
|
+
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
9165
|
+
var NcRuleTargetSchema = object({
|
|
9166
|
+
/** `notification-output` Target id. */
|
|
9167
|
+
targetId: string().min(1),
|
|
9168
|
+
/**
|
|
9169
|
+
* Per-backend passthrough. Recognized keys are mapped onto the canonical
|
|
9170
|
+
* Notification (`priority`, `level`, `sound`, `clickUrl`, `ttl`); the
|
|
9171
|
+
* degrade engine drops what the backend can't render.
|
|
9172
|
+
*/
|
|
9173
|
+
params: record(string(), unknown()).optional()
|
|
9174
|
+
});
|
|
9175
|
+
/**
|
|
9176
|
+
* Media attachment policy (P1 still-image subset).
|
|
9177
|
+
* - `best` — the best AVAILABLE subject image at dispatch time (D-3).
|
|
9178
|
+
* - `best-matching` — the media that explains WHY the rule fired: a rule
|
|
9179
|
+
* matched on identities attaches the subject's `faceCrop`, one matched on
|
|
9180
|
+
* plates attaches the `plateCrop`; a rule with no identity/plate condition
|
|
9181
|
+
* (or when the specific crop is missing) degrades to `best`, then
|
|
9182
|
+
* `keyFrame`, then no attachment — never delaying the send. The matched
|
|
9183
|
+
* condition summary is frozen on the outbox row at enqueue (like the rule
|
|
9184
|
+
* name), so the choice never drifts from the record that fired it.
|
|
9185
|
+
* - `keyFrame` — the clean scene frame (no subject box).
|
|
9186
|
+
* - `none` — no attachment.
|
|
9187
|
+
*/
|
|
9188
|
+
var NcMediaPolicySchema = object({ attach: _enum([
|
|
9189
|
+
"best",
|
|
9190
|
+
"best-matching",
|
|
9191
|
+
"keyFrame",
|
|
9192
|
+
"none"
|
|
9193
|
+
]).default("best") });
|
|
9194
|
+
/** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
|
|
9195
|
+
var NcThrottleSchema = object({
|
|
9196
|
+
cooldownSec: number().int().min(0).max(86400).default(60),
|
|
9197
|
+
/** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
|
|
9198
|
+
scope: _enum(["rule", "rule-device"]).default("rule-device")
|
|
9199
|
+
});
|
|
9200
|
+
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
9201
|
+
var NcRuleInputSchema = object({
|
|
9202
|
+
name: string().min(1).max(200),
|
|
9203
|
+
enabled: boolean().default(true),
|
|
9204
|
+
delivery: NcDeliverySchema,
|
|
9205
|
+
conditions: NcConditionsSchema.default({}),
|
|
9206
|
+
schedule: NcScheduleSchema.optional(),
|
|
9207
|
+
targets: array(NcRuleTargetSchema).min(1),
|
|
9208
|
+
media: NcMediaPolicySchema.default({ attach: "best" }),
|
|
9209
|
+
throttle: NcThrottleSchema.default({
|
|
9210
|
+
cooldownSec: 60,
|
|
9211
|
+
scope: "rule-device"
|
|
9212
|
+
}),
|
|
9213
|
+
/** `{{var}}` templating over camera/class/label/zones/confidence/time. */
|
|
9214
|
+
template: object({
|
|
9215
|
+
title: string().max(500).optional(),
|
|
9216
|
+
body: string().max(2e3).optional()
|
|
9217
|
+
}).optional(),
|
|
9218
|
+
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
9219
|
+
priority: number().int().min(1).max(5).default(3),
|
|
9220
|
+
/**
|
|
9221
|
+
* Ownership/visibility key. Absent = admin/global rule (unchanged legacy
|
|
9222
|
+
* behaviour, visible to all, read-only in the viewer). Present = personal
|
|
9223
|
+
* rule owned by this userId. Server-stamped; never trusted from a client.
|
|
9224
|
+
*/
|
|
9225
|
+
ownerUserId: string().optional()
|
|
9226
|
+
});
|
|
9227
|
+
/**
|
|
9228
|
+
* Partial patch for `updateRule` — any subset of the input fields, plus the
|
|
9229
|
+
* persisted-only {@link NcRuleSchema} `disabledTargetIds` set. The latter is
|
|
9230
|
+
* NOT a client-authored input field (it lives on the persisted rule, not the
|
|
9231
|
+
* input), so it is added here explicitly to let the store's per-target opt-out
|
|
9232
|
+
* toggle round-trip through the shared `update` path. Viewer opt-out mutations
|
|
9233
|
+
* still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
|
|
9234
|
+
* `updateRule` patch.
|
|
9235
|
+
*/
|
|
9236
|
+
var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
|
|
9237
|
+
/** A persisted rule. */
|
|
9238
|
+
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
9239
|
+
id: string(),
|
|
9240
|
+
/** userId of the admin who created the rule (server-stamped caller). */
|
|
9241
|
+
createdBy: string(),
|
|
9242
|
+
createdAt: number(),
|
|
9243
|
+
updatedAt: number(),
|
|
9244
|
+
/**
|
|
9245
|
+
* Per-target opt-out set. A targetId here is suppressed for THIS rule at
|
|
9246
|
+
* send time. Only a target's OWNER may add/remove its id (server-checked
|
|
9247
|
+
* in `nc.setRuleTargetEnabled`). Defaults to empty.
|
|
9248
|
+
*/
|
|
9249
|
+
disabledTargetIds: array(string()).default([])
|
|
9250
|
+
});
|
|
9251
|
+
var NcTestResultSchema = object({
|
|
9252
|
+
recordId: string(),
|
|
9253
|
+
recordKind: _enum([
|
|
9254
|
+
"object-event",
|
|
9255
|
+
"track",
|
|
9256
|
+
"device-event",
|
|
9257
|
+
"package-event"
|
|
9258
|
+
]),
|
|
9259
|
+
deviceId: number(),
|
|
9260
|
+
timestamp: number(),
|
|
9261
|
+
wouldFire: boolean(),
|
|
9262
|
+
/** Condition id that failed (first failing group), when `wouldFire` is false. */
|
|
9263
|
+
failedCondition: string().optional(),
|
|
9264
|
+
className: string().optional(),
|
|
9265
|
+
label: string().optional()
|
|
9266
|
+
});
|
|
9267
|
+
var NcConditionDescriptorSchema = object({
|
|
9268
|
+
/** Field id inside `NcConditions` (or `'schedule'` for the rule-level group). */
|
|
9269
|
+
id: string(),
|
|
9270
|
+
group: _enum([
|
|
9271
|
+
"scope",
|
|
9272
|
+
"class",
|
|
9273
|
+
"zones",
|
|
9274
|
+
"quality",
|
|
9275
|
+
"label",
|
|
9276
|
+
"schedule",
|
|
9277
|
+
"device",
|
|
9278
|
+
"package",
|
|
9279
|
+
"occupancy"
|
|
9280
|
+
]),
|
|
9281
|
+
label: string(),
|
|
9282
|
+
/** Editor widget the UI renders — never hardcode per-condition forms. */
|
|
9283
|
+
valueType: _enum([
|
|
9284
|
+
"deviceIdList",
|
|
9285
|
+
"stringList",
|
|
9286
|
+
"number01",
|
|
9287
|
+
"number",
|
|
9288
|
+
"sourceSelect",
|
|
9289
|
+
"zoneSelection",
|
|
9290
|
+
"zoneIdList",
|
|
9291
|
+
"schedule",
|
|
9292
|
+
"plateMatcher",
|
|
9293
|
+
"packagePhase",
|
|
9294
|
+
"polygonDraw",
|
|
9295
|
+
"occupancy"
|
|
9296
|
+
]),
|
|
9297
|
+
operator: _enum([
|
|
9298
|
+
"in",
|
|
9299
|
+
"notIn",
|
|
9300
|
+
"anyOf",
|
|
9301
|
+
"allOf",
|
|
9302
|
+
"gte",
|
|
9303
|
+
"fuzzyIn",
|
|
9304
|
+
"withinSchedule"
|
|
9305
|
+
]),
|
|
9306
|
+
/** Which delivery kinds the condition applies to. */
|
|
9307
|
+
appliesTo: array(NcDeliverySchema),
|
|
9308
|
+
phase: string(),
|
|
9309
|
+
description: string().optional()
|
|
9310
|
+
});
|
|
9311
|
+
/**
|
|
9312
|
+
* The delivery lifecycle status of a history row — a straight read of the
|
|
9313
|
+
* durable outbox row's own status (single source of truth):
|
|
9314
|
+
* - `pending` — enqueued, in-flight or retrying with backoff
|
|
9315
|
+
* - `sent` — delivered (terminal)
|
|
9316
|
+
* - `dead` — dead-lettered after exhausting retries / a permanent
|
|
9317
|
+
* backend rejection / a deleted target (terminal; carries
|
|
9318
|
+
* the failure `error`)
|
|
9319
|
+
*
|
|
9320
|
+
* P1 has no `suppressed-quiet-hours` / `snoozed` states — those ride the P2
|
|
9321
|
+
* user dimension (quiet hours / snooze) and are additive when they land.
|
|
9322
|
+
*/
|
|
9323
|
+
var NcHistoryStatusSchema = _enum([
|
|
9324
|
+
"pending",
|
|
9325
|
+
"sent",
|
|
9326
|
+
"dead"
|
|
9327
|
+
]);
|
|
9328
|
+
/** The evaluated record kind a history row descends from (one per trigger). */
|
|
9329
|
+
var NcHistoryRecordKindSchema = _enum([
|
|
9330
|
+
"object-event",
|
|
9331
|
+
"track-end",
|
|
9332
|
+
"device-event",
|
|
9333
|
+
"package-event"
|
|
9334
|
+
]);
|
|
9335
|
+
/** Subject summary frozen on the row at fire time (survives rule/record edits). */
|
|
9336
|
+
var NcHistorySubjectSchema = object({
|
|
9337
|
+
className: string(),
|
|
9338
|
+
label: string().optional(),
|
|
9339
|
+
confidence: number().optional(),
|
|
9340
|
+
zones: array(string()),
|
|
9341
|
+
timestamp: number()
|
|
9342
|
+
});
|
|
9343
|
+
/**
|
|
9344
|
+
* One delivery-history row. This is a read-only VIEW over the durable
|
|
9345
|
+
* outbox row (single source of truth — the same row the drain loop drives;
|
|
9346
|
+
* NO second write path, so history can never drift from delivery state).
|
|
9347
|
+
* The §3.2 fields map directly: `ruleId`/`targetId`/`deviceId` are columns,
|
|
9348
|
+
* `eventRef` is `recordKind`+`recordId`, `timestamps` are `createdAt`
|
|
9349
|
+
* (fire) / `updatedAt` (last transition), `status` + `error` are the
|
|
9350
|
+
* lifecycle. `ruleName` + `subject` are the intent snapshot frozen at
|
|
9351
|
+
* enqueue. `userId?` (per-recipient history) is P2 — no user dimension in
|
|
9352
|
+
* P1 (admin scope only).
|
|
9353
|
+
*/
|
|
9354
|
+
var NcHistoryEntrySchema = object({
|
|
9355
|
+
/** Outbox row id — the stable dedup id `ruleId:dedupRef:targetId`. */
|
|
9356
|
+
id: string(),
|
|
9357
|
+
ruleId: string(),
|
|
9358
|
+
/** Rule name frozen at fire time (outlives a later rename / delete). */
|
|
9359
|
+
ruleName: string(),
|
|
9360
|
+
/** The rule urgency/trigger that produced this delivery. */
|
|
9361
|
+
delivery: NcDeliverySchema,
|
|
9362
|
+
targetId: string(),
|
|
9363
|
+
deviceId: number(),
|
|
9364
|
+
recordKind: NcHistoryRecordKindSchema,
|
|
9365
|
+
/** Event / track ref of the evaluated record (§3.2 `eventRef`). */
|
|
9366
|
+
recordId: string(),
|
|
9367
|
+
/** Present for track-scoped deliveries (object-event / track-end). */
|
|
9368
|
+
trackId: string().optional(),
|
|
9369
|
+
status: NcHistoryStatusSchema,
|
|
9370
|
+
/** Delivery attempts made so far. */
|
|
9371
|
+
attempts: number().int(),
|
|
9372
|
+
/** Fire time (outbox enqueue). */
|
|
9373
|
+
createdAt: number(),
|
|
9374
|
+
/** Last transition time (terminal for sent / dead). */
|
|
9375
|
+
updatedAt: number(),
|
|
9376
|
+
/** Failure detail — present on a `dead` row. */
|
|
9377
|
+
error: string().optional(),
|
|
9378
|
+
subject: NcHistorySubjectSchema
|
|
9379
|
+
});
|
|
9380
|
+
/**
|
|
9381
|
+
* Query filter for `getHistory` (spec §4.2). Every field is a narrowing
|
|
9382
|
+
* AND; absent = unbounded on that axis. `since`/`until` bound the fire time
|
|
9383
|
+
* (`createdAt`, epoch ms, inclusive). `limit` is clamped to
|
|
9384
|
+
* {@link NC_HISTORY_LIMIT_MAX}. `userId` (per-recipient filtering) is P2.
|
|
9385
|
+
*/
|
|
9386
|
+
var NcHistoryFilterSchema = object({
|
|
9387
|
+
ruleId: string().optional(),
|
|
9388
|
+
deviceId: number().optional(),
|
|
9389
|
+
status: NcHistoryStatusSchema.optional(),
|
|
9390
|
+
since: number().optional(),
|
|
9391
|
+
until: number().optional(),
|
|
9392
|
+
limit: number().int().min(1).max(500).default(100)
|
|
9393
|
+
});
|
|
9394
|
+
method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), method(object({ ruleId: string() }), object({ rule: NcRuleSchema.nullable() }), { auth: "admin" }), method(object({ rule: NcRuleInputSchema }), object({ rule: NcRuleSchema }), {
|
|
9395
|
+
kind: "mutation",
|
|
9396
|
+
auth: "admin",
|
|
9397
|
+
caller: "required"
|
|
9398
|
+
}), method(object({
|
|
9399
|
+
ruleId: string(),
|
|
9400
|
+
patch: NcRulePatchSchema
|
|
9401
|
+
}), object({ rule: NcRuleSchema }), {
|
|
9402
|
+
kind: "mutation",
|
|
9403
|
+
auth: "admin",
|
|
9404
|
+
caller: "required"
|
|
9405
|
+
}), method(object({ ruleId: string() }), object({ success: literal(true) }), {
|
|
9406
|
+
kind: "mutation",
|
|
9407
|
+
auth: "admin"
|
|
9408
|
+
}), method(object({
|
|
9409
|
+
ruleId: string(),
|
|
9410
|
+
enabled: boolean()
|
|
9411
|
+
}), object({ success: literal(true) }), {
|
|
9412
|
+
kind: "mutation",
|
|
9413
|
+
auth: "admin"
|
|
9414
|
+
}), method(object({
|
|
9415
|
+
rule: NcRuleInputSchema,
|
|
9416
|
+
lookbackMinutes: number().int().min(1).max(1440).default(60)
|
|
9417
|
+
}), object({ results: array(NcTestResultSchema) }), {
|
|
9418
|
+
kind: "mutation",
|
|
9419
|
+
auth: "admin"
|
|
9420
|
+
}), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
|
|
9421
|
+
/**
|
|
9422
|
+
* TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
|
|
9423
|
+
*
|
|
9424
|
+
* Spec: `docs/superpowers/specs/2026-07-24-nc-occupancy-timelapse-design.md`
|
|
9425
|
+
* §3.2/§3.3.
|
|
9426
|
+
*
|
|
9427
|
+
* Deliberately NOT a capability definition and NOT an `NcRule`:
|
|
9428
|
+
* - Every `NcDelivery` member is a *persisted-pipeline-record* trigger. A
|
|
9429
|
+
* timelapse fires on a SCHEDULE WINDOW BOUNDARY, evaluates no pipeline
|
|
9430
|
+
* record, and produces a video it assembled itself — so it rides no
|
|
9431
|
+
* delivery-enum member (the enum is frozen) and no cap method. This file is
|
|
9432
|
+
* a plain typed schema; it does NOT go through `npm run codegen`.
|
|
9433
|
+
* - It shares only the delivery leg (`notification-output.send`) and the
|
|
9434
|
+
* persistence/ownership patterns with the Notification Center, reusing
|
|
9435
|
+
* {@link NcScheduleSchema} (weekly windows, midnight-crossing, invertible)
|
|
9436
|
+
* and {@link NcRuleTargetSchema} (target ref + passthrough params).
|
|
9437
|
+
*
|
|
9438
|
+
* Ownership is SERVER-DERIVED. `ownerUserId` / `createdBy` / `createdAt` /
|
|
9439
|
+
* `updatedAt` / `id` / `lastGeneratedAt` live on the PERSISTED rule only —
|
|
9440
|
+
* {@link TimelapseRuleInputSchema} and {@link TimelapseRulePatchSchema} do not
|
|
9441
|
+
* carry them, so a forged client payload can never claim or re-own a rule
|
|
9442
|
+
* (Zod strips unknown keys). The store stamps them from the resolved caller.
|
|
9443
|
+
*/
|
|
9444
|
+
/** `{{var}}` templating over camera/rule/time — same vocabulary as `NcRule`. */
|
|
9445
|
+
var TimelapseTemplateSchema = object({
|
|
9446
|
+
title: string().max(500).optional(),
|
|
9447
|
+
body: string().max(2e3).optional()
|
|
9448
|
+
});
|
|
9449
|
+
var NameField = string().min(1).max(200);
|
|
9450
|
+
var DeviceIdsField = array(number()).min(1);
|
|
9451
|
+
var CadenceSecField = number().int().min(2).max(3600);
|
|
9452
|
+
var FramerateField = number().int().min(1).max(60);
|
|
9453
|
+
var TargetsField = array(NcRuleTargetSchema).min(1);
|
|
9454
|
+
var PriorityField = number().int().min(1).max(5);
|
|
9455
|
+
/**
|
|
9456
|
+
* Client-supplied timelapse-rule fields. The server stamps id / createdBy /
|
|
9457
|
+
* createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
|
|
9458
|
+
* here (see the ownership note above).
|
|
9459
|
+
*/
|
|
9460
|
+
var TimelapseRuleInputSchema = object({
|
|
9461
|
+
name: NameField,
|
|
9462
|
+
enabled: boolean().default(true),
|
|
9463
|
+
/** Cameras sampled by this rule — one scratch dir + one artifact per device. */
|
|
9464
|
+
deviceIds: DeviceIdsField,
|
|
9465
|
+
/**
|
|
9466
|
+
* Activation window(s). REQUIRED (unlike `NcRule`, where an absent schedule
|
|
9467
|
+
* means "always active"): a timelapse is defined by its window boundaries —
|
|
9468
|
+
* open clears the scratch, close assembles and delivers.
|
|
9469
|
+
*/
|
|
9470
|
+
schedule: NcScheduleSchema,
|
|
9471
|
+
/** Force-snapshot cadence inside the window, seconds (predecessor parity). */
|
|
9472
|
+
cadenceSec: CadenceSecField.default(15),
|
|
9473
|
+
/** Output frames per second of the assembled mp4 (predecessor parity). */
|
|
9474
|
+
framerate: FramerateField.default(10),
|
|
9475
|
+
/** `notification-output` targets the finished video/thumbnail is sent to. */
|
|
9476
|
+
targets: TargetsField,
|
|
9477
|
+
template: TimelapseTemplateSchema.optional(),
|
|
9478
|
+
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
9479
|
+
priority: PriorityField.default(3)
|
|
9480
|
+
});
|
|
9481
|
+
object({
|
|
9482
|
+
name: NameField.optional(),
|
|
9483
|
+
enabled: boolean().optional(),
|
|
9484
|
+
deviceIds: DeviceIdsField.optional(),
|
|
9485
|
+
schedule: NcScheduleSchema.optional(),
|
|
9486
|
+
cadenceSec: CadenceSecField.optional(),
|
|
9487
|
+
framerate: FramerateField.optional(),
|
|
9488
|
+
targets: TargetsField.optional(),
|
|
9489
|
+
template: TimelapseTemplateSchema.nullable().optional(),
|
|
9490
|
+
priority: PriorityField.optional()
|
|
9491
|
+
});
|
|
9492
|
+
TimelapseRuleInputSchema.extend({
|
|
9493
|
+
id: string(),
|
|
9494
|
+
/**
|
|
9495
|
+
* Ownership/visibility key. Absent = admin/global rule (visible to all).
|
|
9496
|
+
* Present = personal rule owned by this userId. Server-stamped from the
|
|
9497
|
+
* resolved caller; never trusted from a client payload.
|
|
9498
|
+
*/
|
|
9499
|
+
ownerUserId: string().optional(),
|
|
9500
|
+
/**
|
|
9501
|
+
* Epoch-ms of the last successful generation — the 1-hour re-generation
|
|
9502
|
+
* guard's durable state (predecessor parity). Absent = never generated.
|
|
9503
|
+
*/
|
|
9504
|
+
lastGeneratedAt: number().optional(),
|
|
9505
|
+
/** userId of the caller who created the rule (server-stamped). */
|
|
9506
|
+
createdBy: string(),
|
|
9507
|
+
createdAt: number(),
|
|
9508
|
+
updatedAt: number()
|
|
9509
|
+
});
|
|
9510
|
+
/**
|
|
9511
|
+
* Generic device-level status snapshot. Auto-registered by `BaseDevice`
|
|
9512
|
+
* for every device, regardless of provider — the kernel needs a uniform
|
|
9513
|
+
* cap-keyed slice for the basic device flags every consumer expects to
|
|
9514
|
+
* read across processes (the `online` flag in particular). Driver-specific
|
|
9515
|
+
* caps (`battery`, `doorbell`, …) carry their domain-specific state on
|
|
9516
|
+
* their own slices.
|
|
9517
|
+
*
|
|
9518
|
+
* Pattern is identical to `battery`: schema-bearing `runtimeState`,
|
|
9519
|
+
* empty `methods`, single change event. Reads land at
|
|
9520
|
+
* `runtimeState.getCapState('device-status')`; writes at
|
|
9521
|
+
* `runtimeState.setCapState('device-status', …)`. Cross-process
|
|
9522
|
+
* consumers reach the same data via the `device-state` cap router
|
|
9523
|
+
* (`getCapSlice({deviceId, capName: 'device-status'})`).
|
|
9524
|
+
*/
|
|
9525
|
+
var DeviceStatusSchema = object({
|
|
9526
|
+
/**
|
|
9527
|
+
* Device-level liveness. Drivers flip via `markOnline(boolean)` on
|
|
9528
|
+
* `BaseDevice`. Provider semantics vary — RTSP aggregates broker
|
|
9529
|
+
* stream-health, Reolink reads firmware push events, ONVIF tracks
|
|
9530
|
+
* ping responses. This cap intentionally does NOT prescribe which
|
|
9531
|
+
* signal drives the flag.
|
|
9532
|
+
*/
|
|
9533
|
+
online: boolean(),
|
|
9534
|
+
/** Ms epoch of the last `online` transition. Lets consumers tell
|
|
9535
|
+
* apart "just came online" from "still online". */
|
|
9536
|
+
lastChangedAt: number()
|
|
9537
|
+
});
|
|
9538
|
+
object({
|
|
9539
|
+
deviceId: number(),
|
|
9540
|
+
status: DeviceStatusSchema
|
|
9541
|
+
});
|
|
9542
|
+
/**
|
|
9543
|
+
* Per-device feature/identity probe slice. Holds the runtime-resolved
|
|
9544
|
+
* truth about what a device CAN do — which the kernel uses to:
|
|
9545
|
+
* 1. Reconcile accessory children (hub-children spawn siren/floodlight/PIR
|
|
9546
|
+
* based on what the firmware actually advertises).
|
|
9547
|
+
* 2. Compute the public `features: DeviceFeature[]` array surfaced via
|
|
9548
|
+
* `device-manager.listAll`.
|
|
9549
|
+
* 3. Decide which optional caps (PTZ, intercom, doorbell, battery, …)
|
|
9550
|
+
* to register on the device's capability surface.
|
|
9551
|
+
*
|
|
9552
|
+
* Auto-registered by `BaseDevice` for every device. Drivers populate the
|
|
9553
|
+
* slice from `onProbe()` (kernel calls it once after register, before
|
|
9554
|
+
* accessory reconciliation). Consumers read via:
|
|
9555
|
+
* `runtimeState.getCapState<FeatureProbeStatus>('feature-probe')`
|
|
9556
|
+
*
|
|
9557
|
+
* `flags` is an open record so each driver carries its own keys without
|
|
9558
|
+
* a centralized schema bottleneck — Reolink writes `hasPtz/hasIntercom`,
|
|
9559
|
+
* Hikvision writes `hasSupplementalLight/hasAlarmIo`, etc.
|
|
9560
|
+
*
|
|
9561
|
+
* Replaces the older driver-local `deviceCache.has*` blob: the per-device
|
|
9562
|
+
* config is for operator-edited overrides + UI snapshots; runtime probe
|
|
9563
|
+
* results belong in runtime-state where the kernel handles persistence,
|
|
9564
|
+
* cross-process mirroring, and reactive updates.
|
|
9565
|
+
*/
|
|
9566
|
+
var FeatureProbeStatusSchema = object({
|
|
9567
|
+
/**
|
|
9568
|
+
* Driver-specific flag bag. Each driver picks its own key names — the
|
|
9569
|
+
* cap deliberately does NOT enforce a closed enum here. Reolink keys:
|
|
9570
|
+
* `hasPtz`, `hasIntercom`, `hasDoorbell`, `hasFloodlight`, `hasSiren`,
|
|
9571
|
+
* `hasPirSensor`, `hasAutotrack`, `hasBattery`. Hikvision keys:
|
|
9572
|
+
* `hasSupplementalLight`, `lightHasWhiteLight`, `hasAlarmIo`, `hasPtz`.
|
|
9573
|
+
*/
|
|
9574
|
+
flags: record(string(), unknown()),
|
|
9575
|
+
/**
|
|
9576
|
+
* Coarse driver-classification — lets cross-process consumers tell apart
|
|
9577
|
+
* cameras / battery-cams / NVRs without re-running the probe. `null`
|
|
9578
|
+
* before the first probe completes.
|
|
9579
|
+
*/
|
|
9580
|
+
deviceType: string().nullable(),
|
|
9581
|
+
/** Camera/firmware model string. `null` when the firmware doesn't expose it. */
|
|
9582
|
+
model: string().nullable(),
|
|
9583
|
+
/** Channel count for NVR/Hub devices; `1` for standalone cameras; `null` pre-probe. */
|
|
9584
|
+
channelCount: number().nullable(),
|
|
9585
|
+
/**
|
|
9586
|
+
* Ms epoch of the last SUCCESSFUL probe. `0` before the first probe
|
|
9587
|
+
* completes — drivers' `getAccessoryChildren()` should treat zero as
|
|
9588
|
+
* "probe not done yet, return empty" so accessories aren't spawned
|
|
9589
|
+
* before the firmware is queried.
|
|
9590
|
+
*/
|
|
9591
|
+
lastProbedAt: number(),
|
|
9592
|
+
/**
|
|
9593
|
+
* Framework convention: every runtime-state slice carries this for the
|
|
9594
|
+
* createRuntimeStateBridge stale-check helper. We keep it in sync with
|
|
9595
|
+
* `lastProbedAt` on every write.
|
|
9596
|
+
*/
|
|
8952
9597
|
lastFetchedAt: number()
|
|
8953
9598
|
});
|
|
8954
9599
|
object({
|
|
@@ -11806,101 +12451,40 @@ method(RunnerCameraConfigSchema, object({ success: literal(true) }), { kind: "mu
|
|
|
11806
12451
|
}), object({ details: array(DetailResultSchema) }).nullable(), { kind: "mutation" });
|
|
11807
12452
|
object({
|
|
11808
12453
|
detected: boolean(),
|
|
11809
|
-
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
11810
|
-
lastDetectedAt: number().nullable(),
|
|
11811
|
-
/**
|
|
11812
|
-
* Ms after which `detected` auto-reverts to false if no fresh push
|
|
11813
|
-
* arrives. Null means the provider leaves detected state until a
|
|
11814
|
-
* native "clear" event.
|
|
11815
|
-
*/
|
|
11816
|
-
autoClearAfterMs: number().nullable()
|
|
11817
|
-
});
|
|
11818
|
-
object({
|
|
11819
|
-
deviceId: number(),
|
|
11820
|
-
detected: boolean(),
|
|
11821
|
-
timestamp: number(),
|
|
11822
|
-
source: MotionSourceEnum,
|
|
11823
|
-
regions: array(MotionRegionSchema).readonly().optional()
|
|
11824
|
-
});
|
|
11825
|
-
DeviceType.Camera, DeviceType.Sensor, method(object({ deviceId: number() }), boolean());
|
|
11826
|
-
object({
|
|
11827
|
-
enabled: boolean(),
|
|
11828
|
-
/** Ms epoch of the last operator-driven change. */
|
|
11829
|
-
lastChangedAt: number()
|
|
11830
|
-
}).extend({
|
|
11831
|
-
/** Ms epoch of the last successful camera fetch (0 = never). */
|
|
11832
|
-
lastFetchedAt: number() });
|
|
11833
|
-
DeviceType.Light, DeviceType.Siren, DeviceType.Switch, method(object({
|
|
11834
|
-
deviceId: number().int().nonnegative(),
|
|
11835
|
-
enabled: boolean()
|
|
11836
|
-
}), _void(), {
|
|
11837
|
-
kind: "mutation",
|
|
11838
|
-
auth: "admin"
|
|
11839
|
-
}), object({
|
|
11840
|
-
deviceId: number(),
|
|
11841
|
-
enabled: boolean(),
|
|
11842
|
-
lastChangedAt: number()
|
|
11843
|
-
});
|
|
11844
|
-
/**
|
|
11845
|
-
* Shared geometry vocabulary for on-frame shape caps — privacy-mask,
|
|
11846
|
-
* motion-zones, and the detection zones/lines editor all speak this one
|
|
11847
|
-
* language so a single drawing-plane editor and the providers stay
|
|
11848
|
-
* decoupled from each cap's storage.
|
|
11849
|
-
*
|
|
11850
|
-
* All coordinates are normalized 0..1 of the camera frame (top-left
|
|
11851
|
-
* origin). Each cap composes the SUBSET of shape kinds it supports and
|
|
11852
|
-
* advertises it via `supportedShapes` in its `getOptions`.
|
|
11853
|
-
*/
|
|
11854
|
-
/** A normalized 0..1 point (top-left origin). */
|
|
11855
|
-
var MaskPointSchema = object({
|
|
11856
|
-
x: number(),
|
|
11857
|
-
y: number()
|
|
11858
|
-
});
|
|
11859
|
-
/** Axis-aligned rectangle (normalized 0..1). */
|
|
11860
|
-
var MaskRectShapeSchema = object({
|
|
11861
|
-
kind: literal("rect"),
|
|
11862
|
-
x: number(),
|
|
11863
|
-
y: number(),
|
|
11864
|
-
width: number(),
|
|
11865
|
-
height: number()
|
|
11866
|
-
});
|
|
11867
|
-
/** Free polygon — an ordered list of normalized vertices (≥3). */
|
|
11868
|
-
var MaskPolygonShapeSchema = object({
|
|
11869
|
-
kind: literal("polygon"),
|
|
11870
|
-
points: array(MaskPointSchema)
|
|
11871
|
-
});
|
|
11872
|
-
/** Boolean cell grid — row-major, length === gridWidth*gridHeight. */
|
|
11873
|
-
var MaskGridShapeSchema = object({
|
|
11874
|
-
kind: literal("grid"),
|
|
11875
|
-
gridWidth: number(),
|
|
11876
|
-
gridHeight: number(),
|
|
11877
|
-
cells: array(boolean())
|
|
11878
|
-
});
|
|
11879
|
-
discriminatedUnion("kind", [
|
|
11880
|
-
MaskRectShapeSchema,
|
|
11881
|
-
MaskPolygonShapeSchema,
|
|
11882
|
-
MaskGridShapeSchema,
|
|
11883
|
-
object({
|
|
11884
|
-
kind: literal("line"),
|
|
11885
|
-
points: array(MaskPointSchema)
|
|
11886
|
-
})
|
|
11887
|
-
]);
|
|
11888
|
-
/** Every shape-kind discriminant, for `supportedShapes` advertisement. */
|
|
11889
|
-
var MaskShapeKindSchema = _enum([
|
|
11890
|
-
"rect",
|
|
11891
|
-
"polygon",
|
|
11892
|
-
"grid",
|
|
11893
|
-
"line"
|
|
11894
|
-
]);
|
|
11895
|
-
/** Polygon vertex bounds when a cap supports 'polygon' (e.g. Hikvision {min:4,max:4}). */
|
|
11896
|
-
var MaskPolygonVerticesSchema = object({
|
|
11897
|
-
min: number(),
|
|
11898
|
-
max: number()
|
|
12454
|
+
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
12455
|
+
lastDetectedAt: number().nullable(),
|
|
12456
|
+
/**
|
|
12457
|
+
* Ms after which `detected` auto-reverts to false if no fresh push
|
|
12458
|
+
* arrives. Null means the provider leaves detected state until a
|
|
12459
|
+
* native "clear" event.
|
|
12460
|
+
*/
|
|
12461
|
+
autoClearAfterMs: number().nullable()
|
|
11899
12462
|
});
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
12463
|
+
object({
|
|
12464
|
+
deviceId: number(),
|
|
12465
|
+
detected: boolean(),
|
|
12466
|
+
timestamp: number(),
|
|
12467
|
+
source: MotionSourceEnum,
|
|
12468
|
+
regions: array(MotionRegionSchema).readonly().optional()
|
|
12469
|
+
});
|
|
12470
|
+
DeviceType.Camera, DeviceType.Sensor, method(object({ deviceId: number() }), boolean());
|
|
12471
|
+
object({
|
|
12472
|
+
enabled: boolean(),
|
|
12473
|
+
/** Ms epoch of the last operator-driven change. */
|
|
12474
|
+
lastChangedAt: number()
|
|
12475
|
+
}).extend({
|
|
12476
|
+
/** Ms epoch of the last successful camera fetch (0 = never). */
|
|
12477
|
+
lastFetchedAt: number() });
|
|
12478
|
+
DeviceType.Light, DeviceType.Siren, DeviceType.Switch, method(object({
|
|
12479
|
+
deviceId: number().int().nonnegative(),
|
|
12480
|
+
enabled: boolean()
|
|
12481
|
+
}), _void(), {
|
|
12482
|
+
kind: "mutation",
|
|
12483
|
+
auth: "admin"
|
|
12484
|
+
}), object({
|
|
12485
|
+
deviceId: number(),
|
|
12486
|
+
enabled: boolean(),
|
|
12487
|
+
lastChangedAt: number()
|
|
11904
12488
|
});
|
|
11905
12489
|
/**
|
|
11906
12490
|
* Motion-zones share the same MaskShape vocabulary as privacy-mask — the
|
|
@@ -13771,6 +14355,55 @@ method(object({
|
|
|
13771
14355
|
password: string()
|
|
13772
14356
|
}), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
|
|
13773
14357
|
/**
|
|
14358
|
+
* A live terminal session hosted by the provider addon. Output and input do
|
|
14359
|
+
* NOT flow through the capability — they use the addon data plane
|
|
14360
|
+
* (`GET /addon/terminal/<id>/out` SSE, `POST /addon/terminal/<id>/in`) because
|
|
14361
|
+
* terminal output must be ordered and lossless. The event bus is telemetry and
|
|
14362
|
+
* may drop chunks ([D8]), and a dropped chunk desynchronises the vt parser
|
|
14363
|
+
* permanently until a full repaint. The capability owns only lifecycle.
|
|
14364
|
+
*/
|
|
14365
|
+
var TerminalSessionInfoSchema = object({
|
|
14366
|
+
/** Opaque session id minted by the provider on `openSession`. */
|
|
14367
|
+
sessionId: string(),
|
|
14368
|
+
/** The pre-declared profile this session runs (never a free-form command). */
|
|
14369
|
+
profileId: string(),
|
|
14370
|
+
/** Human-readable profile label for the UI session list. */
|
|
14371
|
+
label: string(),
|
|
14372
|
+
cols: number().int().positive(),
|
|
14373
|
+
rows: number().int().positive(),
|
|
14374
|
+
/** ms-epoch the session's pty was spawned. */
|
|
14375
|
+
startedAt: number()
|
|
14376
|
+
});
|
|
14377
|
+
/**
|
|
14378
|
+
* A profile the operator may open — a pre-declared, allowlisted program
|
|
14379
|
+
* (`monitor` → `btm`). The capability accepts only these ids; a free-form
|
|
14380
|
+
* command string would be remote code execution as the server's user, so it is
|
|
14381
|
+
* deliberately not part of the contract.
|
|
14382
|
+
*/
|
|
14383
|
+
var TerminalProfileInfoSchema = object({
|
|
14384
|
+
profileId: string(),
|
|
14385
|
+
label: string(),
|
|
14386
|
+
description: string().optional()
|
|
14387
|
+
});
|
|
14388
|
+
method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
|
|
14389
|
+
profileId: string(),
|
|
14390
|
+
cols: number().int().positive(),
|
|
14391
|
+
rows: number().int().positive()
|
|
14392
|
+
}), TerminalSessionInfoSchema, {
|
|
14393
|
+
kind: "mutation",
|
|
14394
|
+
auth: "admin"
|
|
14395
|
+
}), method(object({
|
|
14396
|
+
sessionId: string(),
|
|
14397
|
+
cols: number().int().positive(),
|
|
14398
|
+
rows: number().int().positive()
|
|
14399
|
+
}), _void(), {
|
|
14400
|
+
kind: "mutation",
|
|
14401
|
+
auth: "admin"
|
|
14402
|
+
}), method(object({ sessionId: string() }), _void(), {
|
|
14403
|
+
kind: "mutation",
|
|
14404
|
+
auth: "admin"
|
|
14405
|
+
});
|
|
14406
|
+
/**
|
|
13774
14407
|
* Orchestrator-side destination metadata. The orchestrator computes
|
|
13775
14408
|
* `id = <addonId>:<subId>` from its provider lookup so consumers
|
|
13776
14409
|
* (admin UI, restore flow) see one canonical key.
|
|
@@ -13871,11 +14504,53 @@ var LocationStatSchema = object({
|
|
|
13871
14504
|
fileCount: number(),
|
|
13872
14505
|
present: boolean()
|
|
13873
14506
|
});
|
|
14507
|
+
/**
|
|
14508
|
+
* A backup schedule — the N:M "entry" that binds one cron cadence to a
|
|
14509
|
+
* SET of destination locations. Supersedes the per-location cron on
|
|
14510
|
+
* `BackupDestinationPolicy`: an operator creates a schedule, picks the
|
|
14511
|
+
* `backups` locations it should write to, and the orchestrator fans a
|
|
14512
|
+
* single archive out to all of them when the cron fires.
|
|
14513
|
+
*
|
|
14514
|
+
* `retentionCount` is per-schedule (D-decision 2026-07-28): every
|
|
14515
|
+
* location targeted by this schedule keeps this many archives from
|
|
14516
|
+
* this schedule's runs.
|
|
14517
|
+
*
|
|
14518
|
+
* `dataSources` optionally narrows which top-level state locations
|
|
14519
|
+
* (db, addons, tls, …) are archived; omitted = the orchestrator's
|
|
14520
|
+
* default full set.
|
|
14521
|
+
*/
|
|
14522
|
+
var BackupScheduleSchema = object({
|
|
14523
|
+
/** Stable id. Generated by the orchestrator on first upsert if absent. */
|
|
14524
|
+
id: string(),
|
|
14525
|
+
/** Operator-facing display name. */
|
|
14526
|
+
label: string(),
|
|
14527
|
+
/** 5-field POSIX cron. Empty = disabled cadence (kept for editing). */
|
|
14528
|
+
cron: string(),
|
|
14529
|
+
/** Master on/off toggle for the whole schedule. */
|
|
14530
|
+
enabled: boolean(),
|
|
14531
|
+
/** `backups`-location ids this schedule writes to (fan-out set). */
|
|
14532
|
+
locationIds: array(string()).readonly(),
|
|
14533
|
+
/** Archives kept per targeted location for this schedule. */
|
|
14534
|
+
retentionCount: number().int().min(1).max(1e3),
|
|
14535
|
+
/** Optional subset of source locations to include; omitted = all. */
|
|
14536
|
+
dataSources: array(string()).readonly().optional(),
|
|
14537
|
+
/** ms-epoch of last successful run. */
|
|
14538
|
+
lastRunAt: number().optional(),
|
|
14539
|
+
/** ms-epoch of next computed firing (read-only, filled on list). */
|
|
14540
|
+
nextRunAt: number().optional()
|
|
14541
|
+
});
|
|
13874
14542
|
method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }), method(object({
|
|
13875
14543
|
/** Subset of registered `backup-destination` addon ids to write to. */
|
|
13876
14544
|
destinations: array(string()).optional(),
|
|
13877
14545
|
locations: array(string()).optional(),
|
|
13878
|
-
label: string().optional()
|
|
14546
|
+
label: string().optional(),
|
|
14547
|
+
/**
|
|
14548
|
+
* Per-run retention override applied to every targeted
|
|
14549
|
+
* destination. Used by schedule-driven runs (per-entry
|
|
14550
|
+
* retention). Omitted = each destination's own policy
|
|
14551
|
+
* retention (manual runs).
|
|
14552
|
+
*/
|
|
14553
|
+
retentionCount: number().int().min(1).max(1e3).optional()
|
|
13879
14554
|
}).optional(), array(BackupEntrySchema).readonly(), {
|
|
13880
14555
|
kind: "mutation",
|
|
13881
14556
|
auth: "admin"
|
|
@@ -13924,7 +14599,21 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
|
|
|
13924
14599
|
ok: boolean(),
|
|
13925
14600
|
error: string().optional(),
|
|
13926
14601
|
nextRuns: array(number()).readonly()
|
|
13927
|
-
}))
|
|
14602
|
+
})), method(_void(), array(BackupScheduleSchema).readonly(), { auth: "admin" }), method(object({
|
|
14603
|
+
id: string().optional(),
|
|
14604
|
+
label: string(),
|
|
14605
|
+
cron: string(),
|
|
14606
|
+
enabled: boolean(),
|
|
14607
|
+
locationIds: array(string()).readonly(),
|
|
14608
|
+
retentionCount: number().int().min(1).max(1e3),
|
|
14609
|
+
dataSources: array(string()).readonly().optional()
|
|
14610
|
+
}), BackupScheduleSchema, {
|
|
14611
|
+
kind: "mutation",
|
|
14612
|
+
auth: "admin"
|
|
14613
|
+
}), method(object({ id: string() }), _void(), {
|
|
14614
|
+
kind: "mutation",
|
|
14615
|
+
auth: "admin"
|
|
14616
|
+
});
|
|
13928
14617
|
/**
|
|
13929
14618
|
* `broker` — unified pub/sub broker registry, system-scoped collection.
|
|
13930
14619
|
*
|
|
@@ -14940,1596 +15629,1108 @@ method(object({
|
|
|
14940
15629
|
active: boolean()
|
|
14941
15630
|
}), _void(), {
|
|
14942
15631
|
kind: "mutation",
|
|
14943
|
-
auth: "admin"
|
|
14944
|
-
}), method(object({ capName: string() }), array(string())), method(object({ deviceType: string() }), array(object({
|
|
14945
|
-
capName: string(),
|
|
14946
|
-
wrappers: array(string())
|
|
14947
|
-
}))), method(object({ deviceId: number() }), SettingsSchemaWithValuesSchema.nullable()), method(object({ deviceId: number() }), SettingsSchemaWithValuesSchema.nullable()), method(object({ deviceId: number() }), object({
|
|
14948
|
-
settings: SettingsSchemaWithValuesSchema.nullable(),
|
|
14949
|
-
live: SettingsSchemaWithValuesSchema.nullable()
|
|
14950
|
-
})), method(object({
|
|
14951
|
-
deviceId: number().int().nonnegative(),
|
|
14952
|
-
action: string().min(1),
|
|
14953
|
-
input: unknown()
|
|
14954
|
-
}), unknown(), { kind: "mutation" }), method(object({
|
|
14955
|
-
deviceId: number(),
|
|
14956
|
-
writerCapName: string(),
|
|
14957
|
-
writerAddonId: string(),
|
|
14958
|
-
key: string(),
|
|
14959
|
-
value: unknown()
|
|
14960
|
-
}), object({ success: literal(true) }), {
|
|
14961
|
-
kind: "mutation",
|
|
14962
|
-
auth: "admin"
|
|
14963
|
-
}), method(object({
|
|
14964
|
-
deviceId: number(),
|
|
14965
|
-
changes: array(object({
|
|
14966
|
-
writerCapName: string(),
|
|
14967
|
-
writerAddonId: string(),
|
|
14968
|
-
key: string(),
|
|
14969
|
-
value: unknown()
|
|
14970
|
-
}))
|
|
14971
|
-
}), object({
|
|
14972
|
-
success: literal(true),
|
|
14973
|
-
failures: array(object({
|
|
14974
|
-
writerCapName: string(),
|
|
14975
|
-
writerAddonId: string(),
|
|
14976
|
-
error: string()
|
|
14977
|
-
}))
|
|
14978
|
-
}), {
|
|
14979
|
-
kind: "mutation",
|
|
14980
|
-
auth: "admin"
|
|
14981
|
-
}), method(object({ addonId: string() }), array(DiscoveryCandidateSchema), {
|
|
14982
|
-
kind: "mutation",
|
|
14983
|
-
auth: "admin"
|
|
14984
|
-
}), method(object({
|
|
14985
|
-
addonId: string(),
|
|
14986
|
-
candidate: DiscoveryCandidateSchema,
|
|
14987
|
-
/** Owning integration id, stamped onto the new device's meta by the
|
|
14988
|
-
* device-manager forwarder so `removeByIntegration` can cascade it.
|
|
14989
|
-
* Optional for back-compat (omitted = no stamp = pre-existing behavior). */
|
|
14990
|
-
integrationId: string().optional()
|
|
14991
|
-
}), DeviceSummarySchema, {
|
|
14992
|
-
kind: "mutation",
|
|
14993
|
-
auth: "admin"
|
|
14994
|
-
}), method(object({
|
|
14995
|
-
addonId: string(),
|
|
14996
|
-
type: _enum(DeviceType)
|
|
14997
|
-
}), unknown().nullable()), method(object({
|
|
14998
|
-
addonId: string(),
|
|
14999
|
-
type: _enum(DeviceType),
|
|
15000
|
-
config: record(string(), unknown()),
|
|
15001
|
-
/** Owning integration id, stamped onto the new device's meta by the
|
|
15002
|
-
* device-manager forwarder so `removeByIntegration` can cascade it.
|
|
15003
|
-
* Optional for back-compat (omitted = no stamp = pre-existing behavior). */
|
|
15004
|
-
integrationId: string().optional()
|
|
15005
|
-
}), DeviceSummarySchema, {
|
|
15006
|
-
kind: "mutation",
|
|
15007
|
-
auth: "admin"
|
|
15008
|
-
}), method(object({
|
|
15009
|
-
addonId: string(),
|
|
15010
|
-
type: _enum(DeviceType),
|
|
15011
|
-
key: string(),
|
|
15012
|
-
value: unknown(),
|
|
15013
|
-
formValues: record(string(), unknown()).optional()
|
|
15014
|
-
}), FieldProbeResultSchema, {
|
|
15015
|
-
kind: "mutation",
|
|
15016
|
-
auth: "admin"
|
|
15017
|
-
}), method(object({
|
|
15018
|
-
addonId: string(),
|
|
15019
|
-
integrationId: string()
|
|
15020
|
-
}), object({ filters: array(AdoptionFilterSchema) }), { auth: "admin" }), method(ListCandidatesInputSchema.extend({ addonId: string() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
|
|
15021
|
-
addonId: string(),
|
|
15022
|
-
integrationId: string()
|
|
15023
|
-
}), AdoptionStatusSchema, {
|
|
15024
|
-
kind: "mutation",
|
|
15025
|
-
auth: "admin"
|
|
15026
|
-
}), method(AdoptInputSchema.extend({ addonId: string() }), AdoptResultSchema, {
|
|
15027
|
-
kind: "mutation",
|
|
15028
|
-
auth: "admin"
|
|
15029
|
-
}), method(ReleaseInputSchema.extend({ addonId: string() }), _void(), {
|
|
15030
|
-
kind: "mutation",
|
|
15031
|
-
auth: "admin"
|
|
15032
|
-
}), method(ResyncInputSchema, ResyncResultSchema, {
|
|
15033
|
-
kind: "mutation",
|
|
15034
|
-
auth: "admin"
|
|
15035
|
-
}), method(object({}), object({ providers: array(object({
|
|
15036
|
-
addonId: string(),
|
|
15037
|
-
label: string()
|
|
15038
|
-
})).readonly() }), { auth: "admin" }), method(object({}), object({ groups: array(object({
|
|
15039
|
-
addonId: string(),
|
|
15040
|
-
label: string(),
|
|
15041
|
-
candidates: array(DiscoveryCandidateSchema).readonly(),
|
|
15042
|
-
error: string().nullable()
|
|
15043
|
-
})).readonly() }), {
|
|
15044
|
-
kind: "mutation",
|
|
15045
|
-
auth: "admin"
|
|
15046
|
-
}), method(object({
|
|
15047
|
-
addonId: string(),
|
|
15048
|
-
params: record(string(), unknown()).optional()
|
|
15049
|
-
}), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
|
|
15050
|
-
kind: "mutation",
|
|
15051
|
-
auth: "admin"
|
|
15052
|
-
}), method(object({ addonId: string() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string() }), unknown(), { auth: "admin" }), method(object({
|
|
15053
|
-
deviceId: number(),
|
|
15054
|
-
key: string(),
|
|
15055
|
-
value: unknown()
|
|
15056
|
-
}), FieldProbeResultSchema, {
|
|
15057
|
-
kind: "mutation",
|
|
15058
|
-
auth: "admin"
|
|
15059
|
-
}), method(object({
|
|
15060
|
-
deviceId: number(),
|
|
15061
|
-
caps: array(string()).readonly().optional()
|
|
15062
|
-
}), record(string(), unknown().nullable()));
|
|
15063
|
-
method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
|
|
15064
|
-
deviceId: number(),
|
|
15065
|
-
capName: string()
|
|
15066
|
-
}), record(string(), unknown()).nullable()), method(object({}), record(string(), record(string(), record(string(), unknown())))), method(object({
|
|
15067
|
-
deviceId: number(),
|
|
15068
|
-
capName: string(),
|
|
15069
|
-
slice: record(string(), unknown())
|
|
15070
|
-
}), _void(), { kind: "mutation" }), object({
|
|
15071
|
-
deviceId: number(),
|
|
15072
|
-
capName: string(),
|
|
15073
|
-
slice: record(string(), unknown())
|
|
15074
|
-
});
|
|
15075
|
-
/**
|
|
15076
|
-
* Embedding output. `embedding` is wire-encoded as `number[]` so the
|
|
15077
|
-
* Zod-validated tRPC surface round-trips cleanly; consumers that need a
|
|
15078
|
-
* `Float32Array` can wrap it on the way out (in-process, no marshalling
|
|
15079
|
-
* is involved). `inferenceMs` mirrors the runtime field used by the
|
|
15080
|
-
* post-analysis enrichment-engine.
|
|
15081
|
-
*/
|
|
15082
|
-
var EmbeddingResultSchema = object({
|
|
15083
|
-
embedding: array(number()),
|
|
15084
|
-
inferenceMs: number()
|
|
15085
|
-
});
|
|
15086
|
-
var EmbeddingInfoSchema = object({
|
|
15087
|
-
modelId: string(),
|
|
15088
|
-
embeddingDim: number(),
|
|
15089
|
-
ready: boolean()
|
|
15090
|
-
});
|
|
15091
|
-
method(object({
|
|
15092
|
-
crop: _instanceof(Uint8Array),
|
|
15093
|
-
width: number(),
|
|
15094
|
-
height: number()
|
|
15095
|
-
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
15096
|
-
/**
|
|
15097
|
-
* filesystem-browse — per-node capability for browsing the node's local
|
|
15098
|
-
* filesystem, sandboxed to operator-configured allowed roots. Used by the
|
|
15099
|
-
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
15100
|
-
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
15101
|
-
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
15102
|
-
*/
|
|
15103
|
-
var DirEntrySchema = object({
|
|
15104
|
-
name: string(),
|
|
15105
|
-
path: string()
|
|
15106
|
-
});
|
|
15107
|
-
var BrowseResultSchema = object({
|
|
15108
|
-
path: string(),
|
|
15109
|
-
entries: array(DirEntrySchema).readonly(),
|
|
15110
|
-
freeBytes: number(),
|
|
15111
|
-
totalBytes: number()
|
|
15112
|
-
});
|
|
15113
|
-
method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({ path: string() }), BrowseResultSchema, { auth: "admin" }), method(object({ path: string() }), object({ path: string() }), {
|
|
15632
|
+
auth: "admin"
|
|
15633
|
+
}), method(object({ capName: string() }), array(string())), method(object({ deviceType: string() }), array(object({
|
|
15634
|
+
capName: string(),
|
|
15635
|
+
wrappers: array(string())
|
|
15636
|
+
}))), method(object({ deviceId: number() }), SettingsSchemaWithValuesSchema.nullable()), method(object({ deviceId: number() }), SettingsSchemaWithValuesSchema.nullable()), method(object({ deviceId: number() }), object({
|
|
15637
|
+
settings: SettingsSchemaWithValuesSchema.nullable(),
|
|
15638
|
+
live: SettingsSchemaWithValuesSchema.nullable()
|
|
15639
|
+
})), method(object({
|
|
15640
|
+
deviceId: number().int().nonnegative(),
|
|
15641
|
+
action: string().min(1),
|
|
15642
|
+
input: unknown()
|
|
15643
|
+
}), unknown(), { kind: "mutation" }), method(object({
|
|
15644
|
+
deviceId: number(),
|
|
15645
|
+
writerCapName: string(),
|
|
15646
|
+
writerAddonId: string(),
|
|
15647
|
+
key: string(),
|
|
15648
|
+
value: unknown()
|
|
15649
|
+
}), object({ success: literal(true) }), {
|
|
15114
15650
|
kind: "mutation",
|
|
15115
15651
|
auth: "admin"
|
|
15116
|
-
})
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15123
|
-
|
|
15124
|
-
* Token counts only in v1 — no costUsd (operator decision, 2026-07-15).
|
|
15125
|
-
*/
|
|
15126
|
-
var LlmUsageSchema = object({
|
|
15127
|
-
inputTokens: number(),
|
|
15128
|
-
outputTokens: number()
|
|
15129
|
-
});
|
|
15130
|
-
var LlmErrorCodeSchema = _enum([
|
|
15131
|
-
"timeout",
|
|
15132
|
-
"rate-limited",
|
|
15133
|
-
"auth",
|
|
15134
|
-
"refusal",
|
|
15135
|
-
"bad-request",
|
|
15136
|
-
"unavailable",
|
|
15137
|
-
"no-profile",
|
|
15138
|
-
"budget-exceeded",
|
|
15139
|
-
"adapter-error"
|
|
15140
|
-
]);
|
|
15141
|
-
var LlmGenerateResultSchema = discriminatedUnion("ok", [object({
|
|
15142
|
-
ok: literal(true),
|
|
15143
|
-
text: string(),
|
|
15144
|
-
model: string(),
|
|
15145
|
-
usage: LlmUsageSchema,
|
|
15146
|
-
truncated: boolean(),
|
|
15147
|
-
latencyMs: number()
|
|
15652
|
+
}), method(object({
|
|
15653
|
+
deviceId: number(),
|
|
15654
|
+
changes: array(object({
|
|
15655
|
+
writerCapName: string(),
|
|
15656
|
+
writerAddonId: string(),
|
|
15657
|
+
key: string(),
|
|
15658
|
+
value: unknown()
|
|
15659
|
+
}))
|
|
15148
15660
|
}), object({
|
|
15149
|
-
|
|
15150
|
-
|
|
15151
|
-
|
|
15152
|
-
|
|
15153
|
-
|
|
15154
|
-
|
|
15155
|
-
|
|
15156
|
-
* MsgPack channel round-trip typed arrays (embedding-encoder.cap.ts:29,
|
|
15157
|
-
* notification-output.cap.ts:27-31 precedents).
|
|
15158
|
-
*/
|
|
15159
|
-
var LlmImageSchema = object({
|
|
15160
|
-
bytes: _instanceof(Uint8Array),
|
|
15161
|
-
mimeType: string()
|
|
15162
|
-
});
|
|
15163
|
-
var LlmGenerateBaseInputSchema = object({
|
|
15164
|
-
/** Collection routing (the notification-output posture). */
|
|
15165
|
-
addonId: string().optional(),
|
|
15166
|
-
/** Explicit profile; else the resolution chain (spec §3). */
|
|
15167
|
-
profileId: string().optional(),
|
|
15168
|
-
/** MANDATORY usage tag: 'ai-summary', 'notifier-rules', 'adhoc-ui', … */
|
|
15169
|
-
consumer: string(),
|
|
15170
|
-
system: string().optional(),
|
|
15171
|
-
/** v1: single-turn. `messages[]` is a v2 additive field. */
|
|
15172
|
-
prompt: string(),
|
|
15173
|
-
/** Structured output — adapter-mapped (response_format / forced tool / responseSchema). */
|
|
15174
|
-
jsonSchema: record(string(), unknown()).optional(),
|
|
15175
|
-
/** Per-call override of the profile default. */
|
|
15176
|
-
maxTokens: number().int().positive().optional(),
|
|
15177
|
-
temperature: number().optional()
|
|
15178
|
-
});
|
|
15179
|
-
/**
|
|
15180
|
-
* `llm-runtime` — node-side managed llama.cpp executor (spec §4). Registered
|
|
15181
|
-
* on EVERY node where `addon-ai` is installed; the hub `llm` provider reaches
|
|
15182
|
-
* a specific node's runtime with `nodePin(profile.runtime.nodeId)` — normal
|
|
15183
|
-
* cap routing, zero bespoke plumbing. `internal: true`: the operator reaches
|
|
15184
|
-
* this only through the `llm` cap's methods.
|
|
15185
|
-
*
|
|
15186
|
-
* One running llama-server child per node in v1 (models are RAM-heavy).
|
|
15187
|
-
* Resource ceiling = llama-server flags + idleStopMinutes ONLY (no RSS
|
|
15188
|
-
* watchdog — operator decision #3).
|
|
15189
|
-
*/
|
|
15190
|
-
var ManagedModelRefSchema = discriminatedUnion("kind", [
|
|
15191
|
-
object({
|
|
15192
|
-
kind: literal("catalog"),
|
|
15193
|
-
catalogId: string()
|
|
15194
|
-
}),
|
|
15195
|
-
object({
|
|
15196
|
-
kind: literal("url"),
|
|
15197
|
-
url: string(),
|
|
15198
|
-
sha256: string().optional()
|
|
15199
|
-
}),
|
|
15200
|
-
object({
|
|
15201
|
-
kind: literal("path"),
|
|
15202
|
-
path: string()
|
|
15203
|
-
})
|
|
15204
|
-
]);
|
|
15205
|
-
var ManagedRuntimeConfigSchema = object({
|
|
15206
|
-
/** WHERE the runtime lives — hub or any agent. */
|
|
15207
|
-
nodeId: string(),
|
|
15208
|
-
/** Closed for v1; 'ollama' is a v2 candidate. */
|
|
15209
|
-
engine: _enum(["llama-cpp"]),
|
|
15210
|
-
model: ManagedModelRefSchema,
|
|
15211
|
-
contextSize: number().int().default(4096),
|
|
15212
|
-
/** 0 = CPU-only. */
|
|
15213
|
-
gpuLayers: number().int().default(0),
|
|
15214
|
-
/** Default: cpus-2, clamped ≥1 (resolved node-side). */
|
|
15215
|
-
threads: number().int().optional(),
|
|
15216
|
-
/** Concurrent slots. */
|
|
15217
|
-
parallel: number().int().default(1),
|
|
15218
|
-
/** Else lazy: first generate boots it. */
|
|
15219
|
-
autoStart: boolean().default(false),
|
|
15220
|
-
/** 0 = never; frees RAM after quiet periods. */
|
|
15221
|
-
idleStopMinutes: number().int().default(30)
|
|
15222
|
-
});
|
|
15223
|
-
var LlmRuntimeStatusSchema = object({
|
|
15224
|
-
/** Status is ALWAYS node-qualified. */
|
|
15225
|
-
nodeId: string(),
|
|
15226
|
-
state: _enum([
|
|
15227
|
-
"stopped",
|
|
15228
|
-
"downloading",
|
|
15229
|
-
"starting",
|
|
15230
|
-
"ready",
|
|
15231
|
-
"crashed",
|
|
15232
|
-
"failed"
|
|
15233
|
-
]),
|
|
15234
|
-
pid: number().optional(),
|
|
15235
|
-
port: number().optional(),
|
|
15236
|
-
modelPath: string().optional(),
|
|
15237
|
-
modelId: string().optional(),
|
|
15238
|
-
downloadProgress: number().min(0).max(1).optional(),
|
|
15239
|
-
lastError: string().optional(),
|
|
15240
|
-
crashesInWindow: number(),
|
|
15241
|
-
/** Child RSS (sampled best-effort). */
|
|
15242
|
-
memoryBytes: number().optional(),
|
|
15243
|
-
vramBytes: number().optional()
|
|
15244
|
-
});
|
|
15245
|
-
var LlmNodeModelSchema = object({
|
|
15246
|
-
file: string(),
|
|
15247
|
-
sizeBytes: number(),
|
|
15248
|
-
catalogId: string().optional(),
|
|
15249
|
-
installedAt: number().optional()
|
|
15250
|
-
});
|
|
15251
|
-
var LlmRuntimeDiskUsageSchema = object({
|
|
15252
|
-
nodeId: string(),
|
|
15253
|
-
modelsBytes: number(),
|
|
15254
|
-
freeBytes: number().optional()
|
|
15255
|
-
});
|
|
15256
|
-
method(LlmGenerateBaseInputSchema.extend({
|
|
15257
|
-
images: array(LlmImageSchema).optional(),
|
|
15258
|
-
runtime: ManagedRuntimeConfigSchema,
|
|
15259
|
-
/** The managed profile's timeout, threaded by the hub provider. */
|
|
15260
|
-
timeoutMs: number().int().positive().optional()
|
|
15261
|
-
}), LlmGenerateResultSchema, { kind: "mutation" }), method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
|
|
15661
|
+
success: literal(true),
|
|
15662
|
+
failures: array(object({
|
|
15663
|
+
writerCapName: string(),
|
|
15664
|
+
writerAddonId: string(),
|
|
15665
|
+
error: string()
|
|
15666
|
+
}))
|
|
15667
|
+
}), {
|
|
15262
15668
|
kind: "mutation",
|
|
15263
15669
|
auth: "admin"
|
|
15264
|
-
}), method(object({}),
|
|
15670
|
+
}), method(object({ addonId: string() }), array(DiscoveryCandidateSchema), {
|
|
15265
15671
|
kind: "mutation",
|
|
15266
15672
|
auth: "admin"
|
|
15267
|
-
}), method(object({
|
|
15673
|
+
}), method(object({
|
|
15674
|
+
addonId: string(),
|
|
15675
|
+
candidate: DiscoveryCandidateSchema,
|
|
15676
|
+
/** Owning integration id, stamped onto the new device's meta by the
|
|
15677
|
+
* device-manager forwarder so `removeByIntegration` can cascade it.
|
|
15678
|
+
* Optional for back-compat (omitted = no stamp = pre-existing behavior). */
|
|
15679
|
+
integrationId: string().optional()
|
|
15680
|
+
}), DeviceSummarySchema, {
|
|
15268
15681
|
kind: "mutation",
|
|
15269
15682
|
auth: "admin"
|
|
15270
|
-
}), method(object({
|
|
15683
|
+
}), method(object({
|
|
15684
|
+
addonId: string(),
|
|
15685
|
+
type: _enum(DeviceType)
|
|
15686
|
+
}), unknown().nullable()), method(object({
|
|
15687
|
+
addonId: string(),
|
|
15688
|
+
type: _enum(DeviceType),
|
|
15689
|
+
config: record(string(), unknown()),
|
|
15690
|
+
/** Owning integration id, stamped onto the new device's meta by the
|
|
15691
|
+
* device-manager forwarder so `removeByIntegration` can cascade it.
|
|
15692
|
+
* Optional for back-compat (omitted = no stamp = pre-existing behavior). */
|
|
15693
|
+
integrationId: string().optional()
|
|
15694
|
+
}), DeviceSummarySchema, {
|
|
15271
15695
|
kind: "mutation",
|
|
15272
15696
|
auth: "admin"
|
|
15273
|
-
}), method(object({
|
|
15274
|
-
/**
|
|
15275
|
-
* `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
|
|
15276
|
-
* methods concat-fan across providers; single-row methods route to ONE
|
|
15277
|
-
* provider by the `addonId` in the call input (the notification-output
|
|
15278
|
-
* posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
|
|
15279
|
-
* (hub-placed); the cap stays open for future providers.
|
|
15280
|
-
*
|
|
15281
|
-
* Profiles are ROWS (data), not addons: one row = one usable model endpoint.
|
|
15282
|
-
* `apiKey` is a password field — providers REDACT it on read and merge on
|
|
15283
|
-
* write; a stored key NEVER round-trips to a client.
|
|
15284
|
-
*/
|
|
15285
|
-
var LlmProfileKindSchema = _enum([
|
|
15286
|
-
"openai-compatible",
|
|
15287
|
-
"openai",
|
|
15288
|
-
"anthropic",
|
|
15289
|
-
"google",
|
|
15290
|
-
"managed-local"
|
|
15291
|
-
]);
|
|
15292
|
-
var LlmProfileSchema = object({
|
|
15293
|
-
id: string(),
|
|
15294
|
-
name: string(),
|
|
15295
|
-
kind: LlmProfileKindSchema,
|
|
15296
|
-
/** Stamped by the provider — keeps the fanned catalog routable. */
|
|
15697
|
+
}), method(object({
|
|
15297
15698
|
addonId: string(),
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15306
|
-
temperature: number().min(0).max(2).optional(),
|
|
15307
|
-
maxTokens: number().int().positive().optional(),
|
|
15308
|
-
timeoutMs: number().int().positive().default(6e4),
|
|
15309
|
-
extraHeaders: record(string(), string()).optional(),
|
|
15310
|
-
/** kind === 'managed-local' only (spec §4). */
|
|
15311
|
-
runtime: ManagedRuntimeConfigSchema.optional()
|
|
15312
|
-
});
|
|
15313
|
-
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
15314
|
-
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
15315
|
-
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
15316
|
-
var ConfigSchemaPassthrough$1 = unknown();
|
|
15317
|
-
var LlmProfileKindDescriptorSchema = object({
|
|
15318
|
-
kind: LlmProfileKindSchema,
|
|
15319
|
-
label: string(),
|
|
15320
|
-
icon: string(),
|
|
15321
|
-
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
15699
|
+
type: _enum(DeviceType),
|
|
15700
|
+
key: string(),
|
|
15701
|
+
value: unknown(),
|
|
15702
|
+
formValues: record(string(), unknown()).optional()
|
|
15703
|
+
}), FieldProbeResultSchema, {
|
|
15704
|
+
kind: "mutation",
|
|
15705
|
+
auth: "admin"
|
|
15706
|
+
}), method(object({
|
|
15322
15707
|
addonId: string(),
|
|
15323
|
-
|
|
15324
|
-
})
|
|
15325
|
-
var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
|
|
15326
|
-
var LlmDefaultSchema = object({
|
|
15327
|
-
selector: LlmDefaultSelectorSchema,
|
|
15328
|
-
profileId: string()
|
|
15329
|
-
});
|
|
15330
|
-
/** Server-side rollup row — getUsage never dumps raw call rows (spec §6). */
|
|
15331
|
-
var LlmUsageRollupSchema = object({
|
|
15332
|
-
day: string(),
|
|
15333
|
-
consumer: string(),
|
|
15334
|
-
profileId: string(),
|
|
15335
|
-
calls: number(),
|
|
15336
|
-
okCalls: number(),
|
|
15337
|
-
errorCalls: number(),
|
|
15338
|
-
inputTokens: number(),
|
|
15339
|
-
outputTokens: number(),
|
|
15340
|
-
avgLatencyMs: number()
|
|
15341
|
-
});
|
|
15342
|
-
/** LLM-facing view over the reused ModelCatalogEntry mechanism (spec §4.2). */
|
|
15343
|
-
var ManagedModelCatalogEntrySchema = object({
|
|
15344
|
-
id: string(),
|
|
15345
|
-
label: string(),
|
|
15346
|
-
family: string(),
|
|
15347
|
-
purpose: _enum(["text", "vision"]),
|
|
15348
|
-
url: string(),
|
|
15349
|
-
sha256: string(),
|
|
15350
|
-
sizeBytes: number(),
|
|
15351
|
-
quantization: string(),
|
|
15352
|
-
/** Load-time guidance shown in the picker. */
|
|
15353
|
-
minRamBytes: number(),
|
|
15354
|
-
contextSizeDefault: number().int(),
|
|
15355
|
-
/** Vision models: companion projector file. */
|
|
15356
|
-
mmprojUrl: string().optional()
|
|
15357
|
-
});
|
|
15358
|
-
var LlmRuntimeNodeSchema = object({
|
|
15359
|
-
nodeId: string(),
|
|
15360
|
-
reachable: boolean(),
|
|
15361
|
-
status: LlmRuntimeStatusSchema.optional(),
|
|
15362
|
-
disk: LlmRuntimeDiskUsageSchema.optional(),
|
|
15363
|
-
error: string().optional()
|
|
15364
|
-
});
|
|
15365
|
-
var GenerateVisionInputSchema = LlmGenerateBaseInputSchema.extend({ images: array(LlmImageSchema).min(1) });
|
|
15366
|
-
var ProfileRefInputSchema = object({
|
|
15708
|
+
integrationId: string()
|
|
15709
|
+
}), object({ filters: array(AdoptionFilterSchema) }), { auth: "admin" }), method(ListCandidatesInputSchema.extend({ addonId: string() }), ListCandidatesOutputSchema, { auth: "admin" }), method(object({
|
|
15367
15710
|
addonId: string(),
|
|
15368
|
-
|
|
15369
|
-
})
|
|
15370
|
-
method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(GenerateVisionInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
|
|
15711
|
+
integrationId: string()
|
|
15712
|
+
}), AdoptionStatusSchema, {
|
|
15371
15713
|
kind: "mutation",
|
|
15372
15714
|
auth: "admin"
|
|
15373
|
-
}), method(
|
|
15715
|
+
}), method(AdoptInputSchema.extend({ addonId: string() }), AdoptResultSchema, {
|
|
15374
15716
|
kind: "mutation",
|
|
15375
15717
|
auth: "admin"
|
|
15376
|
-
}), method(
|
|
15718
|
+
}), method(ReleaseInputSchema.extend({ addonId: string() }), _void(), {
|
|
15377
15719
|
kind: "mutation",
|
|
15378
15720
|
auth: "admin"
|
|
15379
|
-
}), method(
|
|
15380
|
-
selector: LlmDefaultSelectorSchema,
|
|
15381
|
-
profileId: string().nullable()
|
|
15382
|
-
}), _void(), {
|
|
15721
|
+
}), method(ResyncInputSchema, ResyncResultSchema, {
|
|
15383
15722
|
kind: "mutation",
|
|
15384
15723
|
auth: "admin"
|
|
15385
|
-
}), method(object({
|
|
15386
|
-
|
|
15387
|
-
|
|
15388
|
-
|
|
15389
|
-
|
|
15390
|
-
|
|
15391
|
-
|
|
15392
|
-
|
|
15393
|
-
})
|
|
15724
|
+
}), method(object({}), object({ providers: array(object({
|
|
15725
|
+
addonId: string(),
|
|
15726
|
+
label: string()
|
|
15727
|
+
})).readonly() }), { auth: "admin" }), method(object({}), object({ groups: array(object({
|
|
15728
|
+
addonId: string(),
|
|
15729
|
+
label: string(),
|
|
15730
|
+
candidates: array(DiscoveryCandidateSchema).readonly(),
|
|
15731
|
+
error: string().nullable()
|
|
15732
|
+
})).readonly() }), {
|
|
15394
15733
|
kind: "mutation",
|
|
15395
15734
|
auth: "admin"
|
|
15396
15735
|
}), method(object({
|
|
15397
|
-
|
|
15398
|
-
|
|
15399
|
-
}),
|
|
15736
|
+
addonId: string(),
|
|
15737
|
+
params: record(string(), unknown()).optional()
|
|
15738
|
+
}), object({ candidates: array(DiscoveryCandidateSchema).readonly() }), {
|
|
15400
15739
|
kind: "mutation",
|
|
15401
15740
|
auth: "admin"
|
|
15402
|
-
}), method(
|
|
15741
|
+
}), method(object({ addonId: string() }), object({ deviceType: _enum(DeviceType).nullable() }), { auth: "admin" }), method(object({ addonId: string() }), unknown(), { auth: "admin" }), method(object({
|
|
15742
|
+
deviceId: number(),
|
|
15743
|
+
key: string(),
|
|
15744
|
+
value: unknown()
|
|
15745
|
+
}), FieldProbeResultSchema, {
|
|
15403
15746
|
kind: "mutation",
|
|
15404
15747
|
auth: "admin"
|
|
15405
|
-
}), method(
|
|
15748
|
+
}), method(object({
|
|
15749
|
+
deviceId: number(),
|
|
15750
|
+
caps: array(string()).readonly().optional()
|
|
15751
|
+
}), record(string(), unknown().nullable()));
|
|
15752
|
+
method(object({ deviceId: number() }), record(string(), record(string(), unknown()))), method(object({
|
|
15753
|
+
deviceId: number(),
|
|
15754
|
+
capName: string()
|
|
15755
|
+
}), record(string(), unknown()).nullable()), method(object({}), record(string(), record(string(), record(string(), unknown())))), method(object({
|
|
15756
|
+
deviceId: number(),
|
|
15757
|
+
capName: string(),
|
|
15758
|
+
slice: record(string(), unknown())
|
|
15759
|
+
}), _void(), { kind: "mutation" }), object({
|
|
15760
|
+
deviceId: number(),
|
|
15761
|
+
capName: string(),
|
|
15762
|
+
slice: record(string(), unknown())
|
|
15763
|
+
});
|
|
15764
|
+
/**
|
|
15765
|
+
* Embedding output. `embedding` is wire-encoded as `number[]` so the
|
|
15766
|
+
* Zod-validated tRPC surface round-trips cleanly; consumers that need a
|
|
15767
|
+
* `Float32Array` can wrap it on the way out (in-process, no marshalling
|
|
15768
|
+
* is involved). `inferenceMs` mirrors the runtime field used by the
|
|
15769
|
+
* post-analysis enrichment-engine.
|
|
15770
|
+
*/
|
|
15771
|
+
var EmbeddingResultSchema = object({
|
|
15772
|
+
embedding: array(number()),
|
|
15773
|
+
inferenceMs: number()
|
|
15774
|
+
});
|
|
15775
|
+
var EmbeddingInfoSchema = object({
|
|
15776
|
+
modelId: string(),
|
|
15777
|
+
embeddingDim: number(),
|
|
15778
|
+
ready: boolean()
|
|
15779
|
+
});
|
|
15780
|
+
method(object({
|
|
15781
|
+
crop: _instanceof(Uint8Array),
|
|
15782
|
+
width: number(),
|
|
15783
|
+
height: number()
|
|
15784
|
+
}), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
|
|
15785
|
+
/**
|
|
15786
|
+
* filesystem-browse — per-node capability for browsing the node's local
|
|
15787
|
+
* filesystem, sandboxed to operator-configured allowed roots. Used by the
|
|
15788
|
+
* admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
|
|
15789
|
+
* (one provider per node); the hub calls it with `{nodeId}` so the codegen
|
|
15790
|
+
* routes to that exact node (default `nodeIdMode:'routing'`).
|
|
15791
|
+
*/
|
|
15792
|
+
var DirEntrySchema = object({
|
|
15793
|
+
name: string(),
|
|
15794
|
+
path: string()
|
|
15795
|
+
});
|
|
15796
|
+
var BrowseResultSchema = object({
|
|
15797
|
+
path: string(),
|
|
15798
|
+
entries: array(DirEntrySchema).readonly(),
|
|
15799
|
+
freeBytes: number(),
|
|
15800
|
+
totalBytes: number()
|
|
15801
|
+
});
|
|
15802
|
+
method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({ path: string() }), BrowseResultSchema, { auth: "admin" }), method(object({ path: string() }), object({ path: string() }), {
|
|
15406
15803
|
kind: "mutation",
|
|
15407
15804
|
auth: "admin"
|
|
15408
15805
|
});
|
|
15409
|
-
|
|
15410
|
-
|
|
15411
|
-
|
|
15412
|
-
|
|
15413
|
-
|
|
15806
|
+
/**
|
|
15807
|
+
* Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
|
|
15808
|
+
* surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
|
|
15809
|
+
* caps stay wire-compatible without a circular cap→cap import.
|
|
15810
|
+
*
|
|
15811
|
+
* Errors are a discriminated-union RESULT, never thrown: the shape survives
|
|
15812
|
+
* every transport tier structurally, and failed calls still write usage rows.
|
|
15813
|
+
* Token counts only in v1 — no costUsd (operator decision, 2026-07-15).
|
|
15814
|
+
*/
|
|
15815
|
+
var LlmUsageSchema = object({
|
|
15816
|
+
inputTokens: number(),
|
|
15817
|
+
outputTokens: number()
|
|
15818
|
+
});
|
|
15819
|
+
var LlmErrorCodeSchema = _enum([
|
|
15820
|
+
"timeout",
|
|
15821
|
+
"rate-limited",
|
|
15822
|
+
"auth",
|
|
15823
|
+
"refusal",
|
|
15824
|
+
"bad-request",
|
|
15825
|
+
"unavailable",
|
|
15826
|
+
"no-profile",
|
|
15827
|
+
"budget-exceeded",
|
|
15828
|
+
"adapter-error"
|
|
15414
15829
|
]);
|
|
15415
|
-
var
|
|
15416
|
-
|
|
15417
|
-
|
|
15418
|
-
|
|
15830
|
+
var LlmGenerateResultSchema = discriminatedUnion("ok", [object({
|
|
15831
|
+
ok: literal(true),
|
|
15832
|
+
text: string(),
|
|
15833
|
+
model: string(),
|
|
15834
|
+
usage: LlmUsageSchema,
|
|
15835
|
+
truncated: boolean(),
|
|
15836
|
+
latencyMs: number()
|
|
15837
|
+
}), object({
|
|
15838
|
+
ok: literal(false),
|
|
15839
|
+
code: LlmErrorCodeSchema,
|
|
15419
15840
|
message: string(),
|
|
15420
|
-
|
|
15421
|
-
|
|
15422
|
-
});
|
|
15423
|
-
method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
15424
|
-
scope: array(string()).optional(),
|
|
15425
|
-
level: LogLevelSchema.optional(),
|
|
15426
|
-
since: date().optional(),
|
|
15427
|
-
until: date().optional(),
|
|
15428
|
-
limit: number().optional(),
|
|
15429
|
-
tags: record(string(), string()).optional()
|
|
15430
|
-
}), array(LogEntrySchema).readonly());
|
|
15841
|
+
retryAfterMs: number().optional()
|
|
15842
|
+
})]);
|
|
15431
15843
|
/**
|
|
15432
|
-
* `
|
|
15433
|
-
*
|
|
15434
|
-
*
|
|
15435
|
-
|
|
15436
|
-
|
|
15437
|
-
|
|
15438
|
-
|
|
15439
|
-
|
|
15440
|
-
|
|
15441
|
-
|
|
15442
|
-
|
|
15443
|
-
|
|
15444
|
-
|
|
15445
|
-
|
|
15446
|
-
|
|
15447
|
-
|
|
15448
|
-
|
|
15449
|
-
|
|
15450
|
-
|
|
15451
|
-
|
|
15452
|
-
|
|
15453
|
-
|
|
15454
|
-
|
|
15455
|
-
|
|
15456
|
-
|
|
15457
|
-
*
|
|
15458
|
-
*
|
|
15459
|
-
*
|
|
15460
|
-
*
|
|
15461
|
-
*
|
|
15462
|
-
* Every contribution carries a `stage`:
|
|
15463
|
-
* - `primary` — shown on the first credentials screen (OIDC /
|
|
15464
|
-
* magic-link buttons; a future usernameless passkey).
|
|
15465
|
-
* - `second-factor` — shown AFTER the password leg, gated on the
|
|
15466
|
-
* returned `factors` (passkey-as-2FA today).
|
|
15844
|
+
* `Uint8Array` is the sanctioned binary convention — superjson + the UDS
|
|
15845
|
+
* MsgPack channel round-trip typed arrays (embedding-encoder.cap.ts:29,
|
|
15846
|
+
* notification-output.cap.ts:27-31 precedents).
|
|
15847
|
+
*/
|
|
15848
|
+
var LlmImageSchema = object({
|
|
15849
|
+
bytes: _instanceof(Uint8Array),
|
|
15850
|
+
mimeType: string()
|
|
15851
|
+
});
|
|
15852
|
+
var LlmGenerateBaseInputSchema = object({
|
|
15853
|
+
/** Collection routing (the notification-output posture). */
|
|
15854
|
+
addonId: string().optional(),
|
|
15855
|
+
/** Explicit profile; else the resolution chain (spec §3). */
|
|
15856
|
+
profileId: string().optional(),
|
|
15857
|
+
/** MANDATORY usage tag: 'ai-summary', 'notifier-rules', 'adhoc-ui', … */
|
|
15858
|
+
consumer: string(),
|
|
15859
|
+
system: string().optional(),
|
|
15860
|
+
/** v1: single-turn. `messages[]` is a v2 additive field. */
|
|
15861
|
+
prompt: string(),
|
|
15862
|
+
/** Structured output — adapter-mapped (response_format / forced tool / responseSchema). */
|
|
15863
|
+
jsonSchema: record(string(), unknown()).optional(),
|
|
15864
|
+
/** Per-call override of the profile default. */
|
|
15865
|
+
maxTokens: number().int().positive().optional(),
|
|
15866
|
+
temperature: number().optional()
|
|
15867
|
+
});
|
|
15868
|
+
/**
|
|
15869
|
+
* `llm-runtime` — node-side managed llama.cpp executor (spec §4). Registered
|
|
15870
|
+
* on EVERY node where `addon-ai` is installed; the hub `llm` provider reaches
|
|
15871
|
+
* a specific node's runtime with `nodePin(profile.runtime.nodeId)` — normal
|
|
15872
|
+
* cap routing, zero bespoke plumbing. `internal: true`: the operator reaches
|
|
15873
|
+
* this only through the `llm` cap's methods.
|
|
15467
15874
|
*
|
|
15468
|
-
*
|
|
15469
|
-
*
|
|
15470
|
-
*
|
|
15875
|
+
* One running llama-server child per node in v1 (models are RAM-heavy).
|
|
15876
|
+
* Resource ceiling = llama-server flags + idleStopMinutes ONLY (no RSS
|
|
15877
|
+
* watchdog — operator decision #3).
|
|
15471
15878
|
*/
|
|
15472
|
-
|
|
15473
|
-
var LoginStageEnum = _enum(["primary", "second-factor"]);
|
|
15474
|
-
/** One login-method contribution — redirect button, pre-auth widget, or native passkey ceremony. */
|
|
15475
|
-
var LoginMethodContributionSchema = discriminatedUnion("kind", [
|
|
15879
|
+
var ManagedModelRefSchema = discriminatedUnion("kind", [
|
|
15476
15880
|
object({
|
|
15477
|
-
kind: literal("
|
|
15478
|
-
|
|
15479
|
-
id: string(),
|
|
15480
|
-
/** Operator-facing button label. */
|
|
15481
|
-
label: string(),
|
|
15482
|
-
/** lucide-react icon name. */
|
|
15483
|
-
icon: string().optional(),
|
|
15484
|
-
/** Addon-owned HTTP route the button navigates to (GET). */
|
|
15485
|
-
startUrl: string(),
|
|
15486
|
-
stage: LoginStageEnum
|
|
15881
|
+
kind: literal("catalog"),
|
|
15882
|
+
catalogId: string()
|
|
15487
15883
|
}),
|
|
15488
15884
|
object({
|
|
15489
|
-
kind: literal("
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
/** Owning addon id — drives the public bundle URL + the MF namespace. */
|
|
15493
|
-
addonId: string(),
|
|
15494
|
-
/** Bundle filename inside the addon's dist dir (`remoteEntry.js`). */
|
|
15495
|
-
bundle: string(),
|
|
15496
|
-
/** MF remote descriptor — `{ remoteName, exposedModule, componentKey }`. */
|
|
15497
|
-
remote: WidgetRemoteSchema,
|
|
15498
|
-
stage: LoginStageEnum
|
|
15885
|
+
kind: literal("url"),
|
|
15886
|
+
url: string(),
|
|
15887
|
+
sha256: string().optional()
|
|
15499
15888
|
}),
|
|
15500
15889
|
object({
|
|
15501
|
-
kind: literal("
|
|
15502
|
-
|
|
15503
|
-
id: string(),
|
|
15504
|
-
/** Operator-facing button label. */
|
|
15505
|
-
label: string(),
|
|
15506
|
-
stage: LoginStageEnum,
|
|
15507
|
-
/** Effective WebAuthn RP ID (`resolveRpID()`) — the shell gates visibility on it. */
|
|
15508
|
-
rpId: string(),
|
|
15509
|
-
/** Effective expected origin (`resolveOrigin()`), null when unconfigured. */
|
|
15510
|
-
origin: string().nullable()
|
|
15890
|
+
kind: literal("path"),
|
|
15891
|
+
path: string()
|
|
15511
15892
|
})
|
|
15512
15893
|
]);
|
|
15513
|
-
|
|
15514
|
-
|
|
15515
|
-
|
|
15516
|
-
|
|
15517
|
-
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
|
|
15521
|
-
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
|
|
15525
|
-
|
|
15526
|
-
|
|
15527
|
-
|
|
15528
|
-
|
|
15529
|
-
|
|
15530
|
-
usedBytes: number(),
|
|
15531
|
-
availableBytes: number(),
|
|
15532
|
-
swapUsedBytes: number(),
|
|
15533
|
-
swapTotalBytes: number()
|
|
15534
|
-
});
|
|
15535
|
-
var DiskIoSnapshotSchema = object({
|
|
15536
|
-
readBytes: number(),
|
|
15537
|
-
writeBytes: number(),
|
|
15538
|
-
readOps: number(),
|
|
15539
|
-
writeOps: number(),
|
|
15540
|
-
timestampMs: number()
|
|
15541
|
-
});
|
|
15542
|
-
var NetworkIoSnapshotSchema = object({
|
|
15543
|
-
rxBytes: number(),
|
|
15544
|
-
txBytes: number(),
|
|
15545
|
-
rxPackets: number(),
|
|
15546
|
-
txPackets: number(),
|
|
15547
|
-
rxErrors: number(),
|
|
15548
|
-
txErrors: number(),
|
|
15549
|
-
timestampMs: number()
|
|
15550
|
-
});
|
|
15551
|
-
var MetricsGpuInfoSchema = object({
|
|
15552
|
-
utilization: number(),
|
|
15553
|
-
model: string(),
|
|
15554
|
-
memoryUsedBytes: number(),
|
|
15555
|
-
memoryTotalBytes: number(),
|
|
15556
|
-
temperature: number().nullable()
|
|
15557
|
-
});
|
|
15558
|
-
var ProcessResourceInfoSchema = object({
|
|
15559
|
-
openFds: number(),
|
|
15560
|
-
threadCount: number(),
|
|
15561
|
-
activeHandles: number(),
|
|
15562
|
-
activeRequests: number()
|
|
15563
|
-
});
|
|
15564
|
-
var PressureAvgsSchema = object({
|
|
15565
|
-
avg10: number(),
|
|
15566
|
-
avg60: number(),
|
|
15567
|
-
avg300: number()
|
|
15568
|
-
});
|
|
15569
|
-
var PressureInfoSchema = object({
|
|
15570
|
-
some: PressureAvgsSchema,
|
|
15571
|
-
full: PressureAvgsSchema.nullable()
|
|
15572
|
-
});
|
|
15573
|
-
var SystemResourceSnapshotSchema = object({
|
|
15574
|
-
cpu: CpuBreakdownSchema,
|
|
15575
|
-
memory: MemoryInfoSchema,
|
|
15576
|
-
gpu: MetricsGpuInfoSchema.nullable(),
|
|
15577
|
-
network: NetworkIoSnapshotSchema,
|
|
15578
|
-
disk: DiskIoSnapshotSchema,
|
|
15579
|
-
pressure: object({
|
|
15580
|
-
cpu: PressureInfoSchema.nullable(),
|
|
15581
|
-
memory: PressureInfoSchema.nullable(),
|
|
15582
|
-
io: PressureInfoSchema.nullable()
|
|
15583
|
-
}),
|
|
15584
|
-
process: ProcessResourceInfoSchema,
|
|
15585
|
-
cpuTemperature: number().nullable(),
|
|
15586
|
-
timestampMs: number()
|
|
15587
|
-
});
|
|
15588
|
-
var DiskSpaceInfoSchema = object({
|
|
15589
|
-
path: string(),
|
|
15590
|
-
totalBytes: number(),
|
|
15591
|
-
usedBytes: number(),
|
|
15592
|
-
availableBytes: number(),
|
|
15593
|
-
percent: number()
|
|
15594
|
-
});
|
|
15595
|
-
var PidResourceStatsSchema = object({
|
|
15596
|
-
pid: number(),
|
|
15597
|
-
cpu: number(),
|
|
15598
|
-
memory: number(),
|
|
15599
|
-
/**
|
|
15600
|
-
* Private (anonymous) resident bytes — the per-process V8 heap + native
|
|
15601
|
-
* allocations NOT shared with other processes (Linux RssAnon). This is the
|
|
15602
|
-
* "real" per-runner cost; summing it across runners is meaningful, unlike
|
|
15603
|
-
* `memory` (RSS), which double-counts the shared mmap'd framework code.
|
|
15604
|
-
* Undefined where /proc is unavailable (e.g. macOS).
|
|
15605
|
-
*/
|
|
15606
|
-
privateBytes: number().optional(),
|
|
15607
|
-
/**
|
|
15608
|
-
* Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
|
|
15609
|
-
* code shared copy-on-write across runners. Undefined on macOS.
|
|
15610
|
-
*/
|
|
15611
|
-
sharedBytes: number().optional()
|
|
15894
|
+
var ManagedRuntimeConfigSchema = object({
|
|
15895
|
+
/** WHERE the runtime lives — hub or any agent. */
|
|
15896
|
+
nodeId: string(),
|
|
15897
|
+
/** Closed for v1; 'ollama' is a v2 candidate. */
|
|
15898
|
+
engine: _enum(["llama-cpp"]),
|
|
15899
|
+
model: ManagedModelRefSchema,
|
|
15900
|
+
contextSize: number().int().default(4096),
|
|
15901
|
+
/** 0 = CPU-only. */
|
|
15902
|
+
gpuLayers: number().int().default(0),
|
|
15903
|
+
/** Default: cpus-2, clamped ≥1 (resolved node-side). */
|
|
15904
|
+
threads: number().int().optional(),
|
|
15905
|
+
/** Concurrent slots. */
|
|
15906
|
+
parallel: number().int().default(1),
|
|
15907
|
+
/** Else lazy: first generate boots it. */
|
|
15908
|
+
autoStart: boolean().default(false),
|
|
15909
|
+
/** 0 = never; frees RAM after quiet periods. */
|
|
15910
|
+
idleStopMinutes: number().int().default(30)
|
|
15612
15911
|
});
|
|
15613
|
-
var
|
|
15614
|
-
|
|
15912
|
+
var LlmRuntimeStatusSchema = object({
|
|
15913
|
+
/** Status is ALWAYS node-qualified. */
|
|
15615
15914
|
nodeId: string(),
|
|
15616
|
-
role: _enum(["hub", "worker"]),
|
|
15617
|
-
pid: number(),
|
|
15618
15915
|
state: _enum([
|
|
15619
|
-
"starting",
|
|
15620
|
-
"running",
|
|
15621
|
-
"stopping",
|
|
15622
15916
|
"stopped",
|
|
15623
|
-
"
|
|
15624
|
-
|
|
15625
|
-
|
|
15626
|
-
|
|
15627
|
-
|
|
15628
|
-
pid: number(),
|
|
15629
|
-
ppid: number(),
|
|
15630
|
-
pgid: number(),
|
|
15631
|
-
classification: _enum([
|
|
15632
|
-
"root",
|
|
15633
|
-
"managed",
|
|
15634
|
-
"system",
|
|
15635
|
-
"ghost"
|
|
15917
|
+
"downloading",
|
|
15918
|
+
"starting",
|
|
15919
|
+
"ready",
|
|
15920
|
+
"crashed",
|
|
15921
|
+
"failed"
|
|
15636
15922
|
]),
|
|
15637
|
-
/** `$process` addon binding when `managed`, else null. */
|
|
15638
|
-
addonId: string().nullable(),
|
|
15639
|
-
/** Kernel-reported nodeId when the process is a known agent/worker. */
|
|
15640
|
-
nodeId: string().nullable(),
|
|
15641
|
-
/** Truncated command line. */
|
|
15642
|
-
command: string(),
|
|
15643
|
-
cpuPercent: number(),
|
|
15644
|
-
memoryRssBytes: number(),
|
|
15645
|
-
/** Wall-clock uptime (seconds). Parsed from `ps etime`. */
|
|
15646
|
-
uptimeSec: number(),
|
|
15647
|
-
/** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
|
|
15648
|
-
orphaned: boolean()
|
|
15649
|
-
});
|
|
15650
|
-
var KillProcessInputSchema = object({
|
|
15651
|
-
pid: number(),
|
|
15652
|
-
/** Force = SIGKILL. Default is SIGTERM. */
|
|
15653
|
-
force: boolean().optional()
|
|
15654
|
-
});
|
|
15655
|
-
var KillProcessResultSchema = object({
|
|
15656
|
-
success: boolean(),
|
|
15657
|
-
reason: string().optional(),
|
|
15658
|
-
signal: _enum(["SIGTERM", "SIGKILL"]).optional()
|
|
15659
|
-
});
|
|
15660
|
-
var DumpHeapSnapshotInputSchema = object({
|
|
15661
|
-
/** The addon whose runner should dump a heap snapshot. */
|
|
15662
|
-
addonId: string() });
|
|
15663
|
-
var DumpHeapSnapshotResultSchema = object({
|
|
15664
|
-
success: boolean(),
|
|
15665
|
-
/** Path of the written .heapsnapshot inside the runner's container/host. */
|
|
15666
|
-
path: string().optional(),
|
|
15667
|
-
/** Process pid that was signalled. */
|
|
15668
15923
|
pid: number().optional(),
|
|
15669
|
-
|
|
15924
|
+
port: number().optional(),
|
|
15925
|
+
modelPath: string().optional(),
|
|
15926
|
+
modelId: string().optional(),
|
|
15927
|
+
downloadProgress: number().min(0).max(1).optional(),
|
|
15928
|
+
lastError: string().optional(),
|
|
15929
|
+
crashesInWindow: number(),
|
|
15930
|
+
/** Child RSS (sampled best-effort). */
|
|
15931
|
+
memoryBytes: number().optional(),
|
|
15932
|
+
vramBytes: number().optional()
|
|
15670
15933
|
});
|
|
15671
|
-
var
|
|
15672
|
-
|
|
15673
|
-
|
|
15674
|
-
|
|
15675
|
-
|
|
15676
|
-
diskPercent: number().optional(),
|
|
15677
|
-
temperature: number().optional(),
|
|
15678
|
-
gpuPercent: number().optional(),
|
|
15679
|
-
gpuMemoryPercent: number().optional()
|
|
15934
|
+
var LlmNodeModelSchema = object({
|
|
15935
|
+
file: string(),
|
|
15936
|
+
sizeBytes: number(),
|
|
15937
|
+
catalogId: string().optional(),
|
|
15938
|
+
installedAt: number().optional()
|
|
15680
15939
|
});
|
|
15681
|
-
|
|
15940
|
+
var LlmRuntimeDiskUsageSchema = object({
|
|
15941
|
+
nodeId: string(),
|
|
15942
|
+
modelsBytes: number(),
|
|
15943
|
+
freeBytes: number().optional()
|
|
15944
|
+
});
|
|
15945
|
+
method(LlmGenerateBaseInputSchema.extend({
|
|
15946
|
+
images: array(LlmImageSchema).optional(),
|
|
15947
|
+
runtime: ManagedRuntimeConfigSchema,
|
|
15948
|
+
/** The managed profile's timeout, threaded by the hub provider. */
|
|
15949
|
+
timeoutMs: number().int().positive().optional()
|
|
15950
|
+
}), LlmGenerateResultSchema, { kind: "mutation" }), method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
|
|
15682
15951
|
kind: "mutation",
|
|
15683
15952
|
auth: "admin"
|
|
15684
|
-
}), method(
|
|
15953
|
+
}), method(object({}), _void(), {
|
|
15685
15954
|
kind: "mutation",
|
|
15686
15955
|
auth: "admin"
|
|
15687
|
-
})
|
|
15688
|
-
method(object({
|
|
15689
|
-
sourceUrl: string(),
|
|
15690
|
-
metadata: ModelConvertMetadataSchema,
|
|
15691
|
-
targets: array(ConvertTargetSchema).min(1).readonly(),
|
|
15692
|
-
calibrationRef: string().optional(),
|
|
15693
|
-
sessionId: string().optional()
|
|
15694
|
-
}), ConvertResultSchema, {
|
|
15956
|
+
}), method(object({}), LlmRuntimeStatusSchema), method(object({ model: ManagedModelRefSchema }), _void(), {
|
|
15695
15957
|
kind: "mutation",
|
|
15696
|
-
auth: "admin"
|
|
15697
|
-
|
|
15698
|
-
});
|
|
15699
|
-
method(object({
|
|
15700
|
-
nodeId: string(),
|
|
15701
|
-
modelId: string(),
|
|
15702
|
-
format: _enum(MODEL_FORMATS),
|
|
15703
|
-
entry: ModelCatalogEntrySchema
|
|
15704
|
-
}), object({
|
|
15705
|
-
ok: boolean(),
|
|
15706
|
-
/** sha256 of the staged tarball (empty for a hub-local no-op). */
|
|
15707
|
-
sha256: string(),
|
|
15708
|
-
bytes: number(),
|
|
15709
|
-
/** The target node's modelsDir the artifact landed in. */
|
|
15710
|
-
path: string()
|
|
15711
|
-
}), {
|
|
15958
|
+
auth: "admin"
|
|
15959
|
+
}), method(object({ file: string() }), _void(), {
|
|
15712
15960
|
kind: "mutation",
|
|
15713
15961
|
auth: "admin"
|
|
15714
|
-
});
|
|
15715
|
-
/**
|
|
15716
|
-
* `mqtt-broker` — broker-registry cap.
|
|
15717
|
-
*
|
|
15718
|
-
* NOT a pub/sub proxy. The cap exposes (a) a registry of configured
|
|
15719
|
-
* MQTT brokers (external + optionally an embedded `aedes`-backed one)
|
|
15720
|
-
* and (b) the connection details a consumer addon needs to spin up
|
|
15721
|
-
* its OWN `mqtt.js` client.
|
|
15722
|
-
*
|
|
15723
|
-
* Why: pub/sub routing over the system event-bus loses fidelity
|
|
15724
|
-
* (callback shape, QoS guarantees, will/retain semantics) and adds
|
|
15725
|
-
* refcount bookkeeping that addons would rather own themselves. The
|
|
15726
|
-
* canonical consumer (`addon-export-ha-mqtt`) needs raw `mqtt.js`
|
|
15727
|
-
* features anyway — give it the connection config, get out of the way.
|
|
15728
|
-
*
|
|
15729
|
-
* Consumer flow:
|
|
15730
|
-
* const cfg = await ctx.api.mqttBroker.getBrokerConfig({ id })
|
|
15731
|
-
* const client = mqtt.connect(cfg.url, { username: cfg.username, … })
|
|
15732
|
-
* client.subscribe('zigbee2mqtt/+')
|
|
15733
|
-
*
|
|
15734
|
-
* Collection mode: multiple brokers (e.g. one local mosquitto + one
|
|
15735
|
-
* cloud bridge). The "embedded" entry (when present) is just another
|
|
15736
|
-
* broker in the registry — its lifecycle is owned by the addon that
|
|
15737
|
-
* spawned it.
|
|
15738
|
-
*/
|
|
15739
|
-
var BrokerKindSchema = _enum(["external", "embedded"]);
|
|
15962
|
+
}), method(object({}), array(LlmNodeModelSchema)), method(object({}), LlmRuntimeDiskUsageSchema);
|
|
15740
15963
|
/**
|
|
15741
|
-
*
|
|
15964
|
+
* `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
|
|
15965
|
+
* methods concat-fan across providers; single-row methods route to ONE
|
|
15966
|
+
* provider by the `addonId` in the call input (the notification-output
|
|
15967
|
+
* posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
|
|
15968
|
+
* (hub-placed); the cap stays open for future providers.
|
|
15742
15969
|
*
|
|
15743
|
-
*
|
|
15744
|
-
*
|
|
15745
|
-
*
|
|
15746
|
-
* - `unreachable` — TCP connect timed out / refused
|
|
15747
|
-
* - `tls-error` — TLS handshake failed (cert / SNI / cipher)
|
|
15970
|
+
* Profiles are ROWS (data), not addons: one row = one usable model endpoint.
|
|
15971
|
+
* `apiKey` is a password field — providers REDACT it on read and merge on
|
|
15972
|
+
* write; a stored key NEVER round-trips to a client.
|
|
15748
15973
|
*/
|
|
15749
|
-
var
|
|
15750
|
-
"
|
|
15751
|
-
"
|
|
15752
|
-
"
|
|
15753
|
-
"
|
|
15754
|
-
"
|
|
15974
|
+
var LlmProfileKindSchema = _enum([
|
|
15975
|
+
"openai-compatible",
|
|
15976
|
+
"openai",
|
|
15977
|
+
"anthropic",
|
|
15978
|
+
"google",
|
|
15979
|
+
"managed-local"
|
|
15755
15980
|
]);
|
|
15756
|
-
var
|
|
15981
|
+
var LlmProfileSchema = object({
|
|
15757
15982
|
id: string(),
|
|
15758
15983
|
name: string(),
|
|
15759
|
-
|
|
15760
|
-
|
|
15761
|
-
|
|
15762
|
-
|
|
15763
|
-
|
|
15764
|
-
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
|
|
15984
|
+
kind: LlmProfileKindSchema,
|
|
15985
|
+
/** Stamped by the provider — keeps the fanned catalog routable. */
|
|
15986
|
+
addonId: string(),
|
|
15987
|
+
enabled: boolean(),
|
|
15988
|
+
/** Vendor model id, or the managed runtime's loaded model. */
|
|
15989
|
+
model: string(),
|
|
15990
|
+
/** Required for openai-compatible; override for cloud kinds. */
|
|
15991
|
+
baseUrl: string().optional(),
|
|
15992
|
+
/** ConfigUISchema type:'password' — never round-trips (spec §5). */
|
|
15993
|
+
apiKey: string().optional(),
|
|
15994
|
+
supportsVision: boolean(),
|
|
15995
|
+
temperature: number().min(0).max(2).optional(),
|
|
15996
|
+
maxTokens: number().int().positive().optional(),
|
|
15997
|
+
timeoutMs: number().int().positive().default(6e4),
|
|
15998
|
+
extraHeaders: record(string(), string()).optional(),
|
|
15999
|
+
/** kind === 'managed-local' only (spec §4). */
|
|
16000
|
+
runtime: ManagedRuntimeConfigSchema.optional()
|
|
15768
16001
|
});
|
|
15769
|
-
/**
|
|
15770
|
-
*
|
|
15771
|
-
*
|
|
15772
|
-
|
|
15773
|
-
|
|
15774
|
-
|
|
15775
|
-
|
|
15776
|
-
|
|
15777
|
-
|
|
15778
|
-
|
|
15779
|
-
|
|
15780
|
-
* Suggested prefix for `clientId`. Each consumer should suffix this
|
|
15781
|
-
* with its own discriminator (addon id, instance id) so reconnects
|
|
15782
|
-
* don't kick each other off (MQTT spec: clientId must be unique per
|
|
15783
|
-
* broker).
|
|
15784
|
-
*/
|
|
15785
|
-
clientIdPrefix: string().optional()
|
|
16002
|
+
/** ConfigUISchema tree passed through untyped on the wire (the
|
|
16003
|
+
* notification-output `ConfigSchemaPassthrough` precedent at
|
|
16004
|
+
* notification-output.cap.ts:151); the exported TS type re-tightens it. */
|
|
16005
|
+
var ConfigSchemaPassthrough$1 = unknown();
|
|
16006
|
+
var LlmProfileKindDescriptorSchema = object({
|
|
16007
|
+
kind: LlmProfileKindSchema,
|
|
16008
|
+
label: string(),
|
|
16009
|
+
icon: string(),
|
|
16010
|
+
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
16011
|
+
addonId: string(),
|
|
16012
|
+
configSchema: ConfigSchemaPassthrough$1
|
|
15786
16013
|
});
|
|
15787
|
-
var
|
|
15788
|
-
|
|
15789
|
-
|
|
15790
|
-
|
|
15791
|
-
password: string().optional(),
|
|
15792
|
-
clientIdPrefix: string().optional()
|
|
16014
|
+
var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
|
|
16015
|
+
var LlmDefaultSchema = object({
|
|
16016
|
+
selector: LlmDefaultSelectorSchema,
|
|
16017
|
+
profileId: string()
|
|
15793
16018
|
});
|
|
15794
|
-
|
|
15795
|
-
var
|
|
15796
|
-
|
|
15797
|
-
|
|
15798
|
-
|
|
15799
|
-
|
|
15800
|
-
|
|
15801
|
-
|
|
15802
|
-
|
|
15803
|
-
|
|
15804
|
-
|
|
15805
|
-
/** Allow anonymous connect (no username/password). Default: false. */
|
|
15806
|
-
allowAnonymous: boolean().default(false),
|
|
15807
|
-
/** Optional shared username/password for clients. */
|
|
15808
|
-
username: string().optional(),
|
|
15809
|
-
password: string().optional()
|
|
16019
|
+
/** Server-side rollup row — getUsage never dumps raw call rows (spec §6). */
|
|
16020
|
+
var LlmUsageRollupSchema = object({
|
|
16021
|
+
day: string(),
|
|
16022
|
+
consumer: string(),
|
|
16023
|
+
profileId: string(),
|
|
16024
|
+
calls: number(),
|
|
16025
|
+
okCalls: number(),
|
|
16026
|
+
errorCalls: number(),
|
|
16027
|
+
inputTokens: number(),
|
|
16028
|
+
outputTokens: number(),
|
|
16029
|
+
avgLatencyMs: number()
|
|
15810
16030
|
});
|
|
15811
|
-
|
|
16031
|
+
/** LLM-facing view over the reused ModelCatalogEntry mechanism (spec §4.2). */
|
|
16032
|
+
var ManagedModelCatalogEntrySchema = object({
|
|
15812
16033
|
id: string(),
|
|
15813
|
-
|
|
15814
|
-
|
|
15815
|
-
|
|
15816
|
-
brokerCount: number(),
|
|
15817
|
-
embeddedRunning: boolean()
|
|
15818
|
-
});
|
|
15819
|
-
method(_void(), array(BrokerInfoSchema)), method(IdInputSchema, BrokerConnectionDetailsSchema), method(AddBrokerInputSchema, AddBrokerResultSchema, { kind: "mutation" }), method(IdInputSchema, _void(), { kind: "mutation" }), method(IdInputSchema, TestResultSchema$1, { kind: "mutation" }), method(StartEmbeddedInputSchema, StartEmbeddedResultSchema, { kind: "mutation" }), method(IdInputSchema, _void(), { kind: "mutation" }), method(_void(), StatusSchema);
|
|
15820
|
-
var NetworkEndpointSchema = object({
|
|
16034
|
+
label: string(),
|
|
16035
|
+
family: string(),
|
|
16036
|
+
purpose: _enum(["text", "vision"]),
|
|
15821
16037
|
url: string(),
|
|
15822
|
-
|
|
15823
|
-
|
|
15824
|
-
|
|
16038
|
+
sha256: string(),
|
|
16039
|
+
sizeBytes: number(),
|
|
16040
|
+
quantization: string(),
|
|
16041
|
+
/** Load-time guidance shown in the picker. */
|
|
16042
|
+
minRamBytes: number(),
|
|
16043
|
+
contextSizeDefault: number().int(),
|
|
16044
|
+
/** Vision models: companion projector file. */
|
|
16045
|
+
mmprojUrl: string().optional()
|
|
15825
16046
|
});
|
|
15826
|
-
var
|
|
15827
|
-
|
|
15828
|
-
|
|
16047
|
+
var LlmRuntimeNodeSchema = object({
|
|
16048
|
+
nodeId: string(),
|
|
16049
|
+
reachable: boolean(),
|
|
16050
|
+
status: LlmRuntimeStatusSchema.optional(),
|
|
16051
|
+
disk: LlmRuntimeDiskUsageSchema.optional(),
|
|
15829
16052
|
error: string().optional()
|
|
15830
16053
|
});
|
|
15831
|
-
|
|
15832
|
-
|
|
15833
|
-
|
|
15834
|
-
|
|
15835
|
-
|
|
15836
|
-
|
|
15837
|
-
|
|
15838
|
-
|
|
15839
|
-
|
|
15840
|
-
|
|
15841
|
-
|
|
15842
|
-
|
|
15843
|
-
|
|
15844
|
-
|
|
15845
|
-
|
|
15846
|
-
|
|
15847
|
-
|
|
15848
|
-
|
|
15849
|
-
|
|
15850
|
-
|
|
16054
|
+
var GenerateVisionInputSchema = LlmGenerateBaseInputSchema.extend({ images: array(LlmImageSchema).min(1) });
|
|
16055
|
+
var ProfileRefInputSchema = object({
|
|
16056
|
+
addonId: string(),
|
|
16057
|
+
profileId: string()
|
|
16058
|
+
});
|
|
16059
|
+
method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(GenerateVisionInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
|
|
16060
|
+
kind: "mutation",
|
|
16061
|
+
auth: "admin"
|
|
16062
|
+
}), method(ProfileRefInputSchema, _void(), {
|
|
16063
|
+
kind: "mutation",
|
|
16064
|
+
auth: "admin"
|
|
16065
|
+
}), method(ProfileRefInputSchema, LlmGenerateResultSchema, {
|
|
16066
|
+
kind: "mutation",
|
|
16067
|
+
auth: "admin"
|
|
16068
|
+
}), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
|
|
16069
|
+
selector: LlmDefaultSelectorSchema,
|
|
16070
|
+
profileId: string().nullable()
|
|
16071
|
+
}), _void(), {
|
|
16072
|
+
kind: "mutation",
|
|
16073
|
+
auth: "admin"
|
|
16074
|
+
}), method(object({
|
|
16075
|
+
since: number().optional(),
|
|
16076
|
+
until: number().optional(),
|
|
16077
|
+
consumer: string().optional(),
|
|
16078
|
+
profileId: string().optional()
|
|
16079
|
+
}), array(LlmUsageRollupSchema)), method(object({}), array(ManagedModelCatalogEntrySchema)), method(object({}), array(LlmRuntimeNodeSchema)), method(object({ nodeId: string() }), array(LlmNodeModelSchema)), method(object({
|
|
16080
|
+
nodeId: string(),
|
|
16081
|
+
model: ManagedModelRefSchema
|
|
16082
|
+
}), _void(), {
|
|
16083
|
+
kind: "mutation",
|
|
16084
|
+
auth: "admin"
|
|
16085
|
+
}), method(object({
|
|
16086
|
+
nodeId: string(),
|
|
16087
|
+
file: string()
|
|
16088
|
+
}), _void(), {
|
|
16089
|
+
kind: "mutation",
|
|
16090
|
+
auth: "admin"
|
|
16091
|
+
}), method(ProfileRefInputSchema, LlmRuntimeStatusSchema), method(ProfileRefInputSchema, LlmRuntimeStatusSchema, {
|
|
16092
|
+
kind: "mutation",
|
|
16093
|
+
auth: "admin"
|
|
16094
|
+
}), method(ProfileRefInputSchema, _void(), {
|
|
16095
|
+
kind: "mutation",
|
|
16096
|
+
auth: "admin"
|
|
16097
|
+
});
|
|
16098
|
+
var LogLevelSchema = _enum([
|
|
16099
|
+
"debug",
|
|
16100
|
+
"info",
|
|
16101
|
+
"warn",
|
|
16102
|
+
"error"
|
|
16103
|
+
]);
|
|
16104
|
+
var LogEntrySchema = object({
|
|
16105
|
+
timestamp: date(),
|
|
16106
|
+
level: LogLevelSchema,
|
|
16107
|
+
scope: array(string()),
|
|
16108
|
+
message: string(),
|
|
16109
|
+
meta: record(string(), unknown()).optional(),
|
|
16110
|
+
tags: record(string(), string()).optional()
|
|
15851
16111
|
});
|
|
15852
|
-
method(
|
|
16112
|
+
method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
16113
|
+
scope: array(string()).optional(),
|
|
16114
|
+
level: LogLevelSchema.optional(),
|
|
16115
|
+
since: date().optional(),
|
|
16116
|
+
until: date().optional(),
|
|
16117
|
+
limit: number().optional(),
|
|
16118
|
+
tags: record(string(), string()).optional()
|
|
16119
|
+
}), array(LogEntrySchema).readonly());
|
|
15853
16120
|
/**
|
|
15854
|
-
*
|
|
16121
|
+
* `login-method` — collection cap through which auth addons contribute
|
|
16122
|
+
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
16123
|
+
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
16124
|
+
* every auth addon (OIDC, magic-link, WebAuthn/passkey) registers a
|
|
16125
|
+
* `login-method` provider and the PUBLIC `auth.listLoginMethods`
|
|
16126
|
+
* procedure aggregates them for the unauthenticated login page.
|
|
15855
16127
|
*
|
|
15856
|
-
*
|
|
15857
|
-
* `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
|
|
15858
|
-
* callers emit ONE canonical `Notification`; each provider declares a
|
|
15859
|
-
* per-kind capability descriptor (`TargetKind`), and the pure degrade
|
|
15860
|
-
* engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
|
|
15861
|
-
* message to what the kind supports — callers never special-case a service.
|
|
16128
|
+
* A contribution is a discriminated union on `kind`:
|
|
15862
16129
|
*
|
|
15863
|
-
*
|
|
15864
|
-
*
|
|
15865
|
-
* `
|
|
15866
|
-
*
|
|
15867
|
-
*
|
|
15868
|
-
* alternative would fork the UI per addon and cannot host the
|
|
15869
|
-
* discovery→adopt flow.
|
|
15870
|
-
* - `listTargetKinds` / `listTargets` / `discoverTargets` return arrays →
|
|
15871
|
-
* the generated cap-mount auto-`concatCollection`-fans them across every
|
|
15872
|
-
* registered provider (notifiers addon + HA addon) so one catalog is
|
|
15873
|
-
* routable. `send` / `testTarget` / CRUD route to ONE provider by the
|
|
15874
|
-
* `addonId` the generated collection router extracts from the call input.
|
|
15875
|
-
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
15876
|
-
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
15877
|
-
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
15878
|
-
* base64 fallback needed.
|
|
16130
|
+
* - `redirect` — a declarative button. The login page renders a generic
|
|
16131
|
+
* button that navigates to `startUrl` (an addon-owned HTTP route).
|
|
16132
|
+
* Covers OIDC (`/addon/auth-oidc/<id>/start`) and magic-link with
|
|
16133
|
+
* ZERO shell-side JS. A future SSO addon plugs in the same way — the
|
|
16134
|
+
* login page needs NO change.
|
|
15879
16135
|
*
|
|
15880
|
-
*
|
|
15881
|
-
*
|
|
15882
|
-
*
|
|
15883
|
-
|
|
15884
|
-
|
|
15885
|
-
*
|
|
15886
|
-
*
|
|
15887
|
-
|
|
15888
|
-
|
|
15889
|
-
|
|
15890
|
-
|
|
15891
|
-
|
|
15892
|
-
|
|
15893
|
-
|
|
15894
|
-
|
|
15895
|
-
|
|
15896
|
-
*
|
|
15897
|
-
*
|
|
15898
|
-
*
|
|
15899
|
-
*
|
|
16136
|
+
* - `widget` — a Module-Federation widget the login page mounts (via
|
|
16137
|
+
* `loadRemoteBundle`) for an in-page ceremony. `auth.listLoginMethods`
|
|
16138
|
+
* stamps a public `bundleUrl` from `addonId` + `bundle`. Generic
|
|
16139
|
+
* mechanism kept for future use; no shipped addon uses it on the login
|
|
16140
|
+
* page (the passkey ceremony below runs natively in the shell instead).
|
|
16141
|
+
*
|
|
16142
|
+
* - `passkey` — a declarative WebAuthn ceremony the shell renders
|
|
16143
|
+
* natively (`@simplewebauthn/browser` lives in `addon-admin-ui`, not in
|
|
16144
|
+
* a remotely-loaded bundle). Carries the addon's effective `rpId` /
|
|
16145
|
+
* `origin` (from its `resolveRpID()` / `resolveOrigin()`) so the shell
|
|
16146
|
+
* can gate visibility (IP-literal origin, hostname/rpId mismatch) WITHOUT
|
|
16147
|
+
* fetching any remote code pre-auth. Contribution stays unconditional —
|
|
16148
|
+
* enrollment state is never leaked pre-auth; visibility is a shell
|
|
16149
|
+
* decision.
|
|
16150
|
+
*
|
|
16151
|
+
* Every contribution carries a `stage`:
|
|
16152
|
+
* - `primary` — shown on the first credentials screen (OIDC /
|
|
16153
|
+
* magic-link buttons; a future usernameless passkey).
|
|
16154
|
+
* - `second-factor` — shown AFTER the password leg, gated on the
|
|
16155
|
+
* returned `factors` (passkey-as-2FA today).
|
|
16156
|
+
*
|
|
16157
|
+
* `mount: skip` — the cap is read server-side by the core auth router
|
|
16158
|
+
* (`registry.getCollection('login-method')`), never mounted as its own
|
|
16159
|
+
* tRPC router.
|
|
15900
16160
|
*/
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
15904
|
-
|
|
15905
|
-
|
|
15906
|
-
|
|
15907
|
-
|
|
15908
|
-
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
|
|
16161
|
+
/** When a login method renders in the two-phase login flow. */
|
|
16162
|
+
var LoginStageEnum = _enum(["primary", "second-factor"]);
|
|
16163
|
+
/** One login-method contribution — redirect button, pre-auth widget, or native passkey ceremony. */
|
|
16164
|
+
var LoginMethodContributionSchema = discriminatedUnion("kind", [
|
|
16165
|
+
object({
|
|
16166
|
+
kind: literal("redirect"),
|
|
16167
|
+
/** Stable id within the login-method set (e.g. `auth-oidc/google`). */
|
|
16168
|
+
id: string(),
|
|
16169
|
+
/** Operator-facing button label. */
|
|
16170
|
+
label: string(),
|
|
16171
|
+
/** lucide-react icon name. */
|
|
16172
|
+
icon: string().optional(),
|
|
16173
|
+
/** Addon-owned HTTP route the button navigates to (GET). */
|
|
16174
|
+
startUrl: string(),
|
|
16175
|
+
stage: LoginStageEnum
|
|
16176
|
+
}),
|
|
16177
|
+
object({
|
|
16178
|
+
kind: literal("widget"),
|
|
16179
|
+
/** Stable id within the login-method set (e.g. `auth-webauthn/passkey-login`). */
|
|
16180
|
+
id: string(),
|
|
16181
|
+
/** Owning addon id — drives the public bundle URL + the MF namespace. */
|
|
16182
|
+
addonId: string(),
|
|
16183
|
+
/** Bundle filename inside the addon's dist dir (`remoteEntry.js`). */
|
|
16184
|
+
bundle: string(),
|
|
16185
|
+
/** MF remote descriptor — `{ remoteName, exposedModule, componentKey }`. */
|
|
16186
|
+
remote: WidgetRemoteSchema,
|
|
16187
|
+
stage: LoginStageEnum
|
|
16188
|
+
}),
|
|
16189
|
+
object({
|
|
16190
|
+
kind: literal("passkey"),
|
|
16191
|
+
/** Stable id within the login-method set (e.g. `auth-webauthn/passkey-direct-login`). */
|
|
16192
|
+
id: string(),
|
|
16193
|
+
/** Operator-facing button label. */
|
|
16194
|
+
label: string(),
|
|
16195
|
+
stage: LoginStageEnum,
|
|
16196
|
+
/** Effective WebAuthn RP ID (`resolveRpID()`) — the shell gates visibility on it. */
|
|
16197
|
+
rpId: string(),
|
|
16198
|
+
/** Effective expected origin (`resolveOrigin()`), null when unconfigured. */
|
|
16199
|
+
origin: string().nullable()
|
|
16200
|
+
})
|
|
15912
16201
|
]);
|
|
15913
|
-
|
|
15914
|
-
var
|
|
15915
|
-
|
|
15916
|
-
|
|
15917
|
-
|
|
16202
|
+
method(_void(), array(LoginMethodContributionSchema).readonly());
|
|
16203
|
+
var CpuBreakdownSchema = object({
|
|
16204
|
+
total: number(),
|
|
16205
|
+
user: number(),
|
|
16206
|
+
system: number(),
|
|
16207
|
+
irq: number(),
|
|
16208
|
+
nice: number(),
|
|
16209
|
+
loadAvg: tuple([
|
|
16210
|
+
number(),
|
|
16211
|
+
number(),
|
|
16212
|
+
number()
|
|
16213
|
+
]),
|
|
16214
|
+
cores: number()
|
|
15918
16215
|
});
|
|
15919
|
-
|
|
15920
|
-
|
|
15921
|
-
|
|
15922
|
-
|
|
15923
|
-
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
|
|
15927
|
-
var
|
|
15928
|
-
|
|
15929
|
-
|
|
15930
|
-
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
|
|
15934
|
-
|
|
15935
|
-
|
|
15936
|
-
|
|
15937
|
-
|
|
15938
|
-
|
|
15939
|
-
|
|
15940
|
-
|
|
15941
|
-
|
|
16216
|
+
var MemoryInfoSchema = object({
|
|
16217
|
+
percent: number(),
|
|
16218
|
+
totalBytes: number(),
|
|
16219
|
+
usedBytes: number(),
|
|
16220
|
+
availableBytes: number(),
|
|
16221
|
+
swapUsedBytes: number(),
|
|
16222
|
+
swapTotalBytes: number()
|
|
16223
|
+
});
|
|
16224
|
+
var DiskIoSnapshotSchema = object({
|
|
16225
|
+
readBytes: number(),
|
|
16226
|
+
writeBytes: number(),
|
|
16227
|
+
readOps: number(),
|
|
16228
|
+
writeOps: number(),
|
|
16229
|
+
timestampMs: number()
|
|
16230
|
+
});
|
|
16231
|
+
var NetworkIoSnapshotSchema = object({
|
|
16232
|
+
rxBytes: number(),
|
|
16233
|
+
txBytes: number(),
|
|
16234
|
+
rxPackets: number(),
|
|
16235
|
+
txPackets: number(),
|
|
16236
|
+
rxErrors: number(),
|
|
16237
|
+
txErrors: number(),
|
|
16238
|
+
timestampMs: number()
|
|
16239
|
+
});
|
|
16240
|
+
var MetricsGpuInfoSchema = object({
|
|
16241
|
+
utilization: number(),
|
|
16242
|
+
model: string(),
|
|
16243
|
+
memoryUsedBytes: number(),
|
|
16244
|
+
memoryTotalBytes: number(),
|
|
16245
|
+
temperature: number().nullable()
|
|
16246
|
+
});
|
|
16247
|
+
var ProcessResourceInfoSchema = object({
|
|
16248
|
+
openFds: number(),
|
|
16249
|
+
threadCount: number(),
|
|
16250
|
+
activeHandles: number(),
|
|
16251
|
+
activeRequests: number()
|
|
15942
16252
|
});
|
|
15943
|
-
|
|
15944
|
-
|
|
15945
|
-
|
|
15946
|
-
|
|
15947
|
-
/** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
|
|
15948
|
-
ordinal: number().int().min(1).max(5).nullable(),
|
|
15949
|
-
flags: object({
|
|
15950
|
-
critical: boolean().optional(),
|
|
15951
|
-
silent: boolean().optional(),
|
|
15952
|
-
noPush: boolean().optional()
|
|
15953
|
-
}).optional(),
|
|
15954
|
-
/** e.g. Pushover `emergency` requires `retry` / `expire`. */
|
|
15955
|
-
requires: array(string()).optional(),
|
|
15956
|
-
description: string().optional()
|
|
16253
|
+
var PressureAvgsSchema = object({
|
|
16254
|
+
avg10: number(),
|
|
16255
|
+
avg60: number(),
|
|
16256
|
+
avg300: number()
|
|
15957
16257
|
});
|
|
15958
|
-
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
|
|
15962
|
-
|
|
15963
|
-
|
|
15964
|
-
|
|
15965
|
-
|
|
15966
|
-
|
|
15967
|
-
|
|
15968
|
-
|
|
16258
|
+
var PressureInfoSchema = object({
|
|
16259
|
+
some: PressureAvgsSchema,
|
|
16260
|
+
full: PressureAvgsSchema.nullable()
|
|
16261
|
+
});
|
|
16262
|
+
var SystemResourceSnapshotSchema = object({
|
|
16263
|
+
cpu: CpuBreakdownSchema,
|
|
16264
|
+
memory: MemoryInfoSchema,
|
|
16265
|
+
gpu: MetricsGpuInfoSchema.nullable(),
|
|
16266
|
+
network: NetworkIoSnapshotSchema,
|
|
16267
|
+
disk: DiskIoSnapshotSchema,
|
|
16268
|
+
pressure: object({
|
|
16269
|
+
cpu: PressureInfoSchema.nullable(),
|
|
16270
|
+
memory: PressureInfoSchema.nullable(),
|
|
16271
|
+
io: PressureInfoSchema.nullable()
|
|
15969
16272
|
}),
|
|
15970
|
-
|
|
15971
|
-
|
|
15972
|
-
|
|
15973
|
-
format: array(NotificationFormatSchema),
|
|
15974
|
-
clickUrl: boolean(),
|
|
15975
|
-
sound: boolean(),
|
|
15976
|
-
ttl: boolean(),
|
|
15977
|
-
bodyMaxLen: number().int().positive()
|
|
16273
|
+
process: ProcessResourceInfoSchema,
|
|
16274
|
+
cpuTemperature: number().nullable(),
|
|
16275
|
+
timestampMs: number()
|
|
15978
16276
|
});
|
|
15979
|
-
|
|
15980
|
-
|
|
15981
|
-
|
|
15982
|
-
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
*/
|
|
15986
|
-
var ConfigSchemaPassthrough = unknown();
|
|
15987
|
-
var TargetKindSchema = object({
|
|
15988
|
-
kind: string(),
|
|
15989
|
-
label: string(),
|
|
15990
|
-
icon: string(),
|
|
15991
|
-
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
15992
|
-
addonId: string(),
|
|
15993
|
-
configSchema: ConfigSchemaPassthrough,
|
|
15994
|
-
supportsDiscovery: boolean(),
|
|
15995
|
-
caps: TargetKindCapsSchema
|
|
16277
|
+
var DiskSpaceInfoSchema = object({
|
|
16278
|
+
path: string(),
|
|
16279
|
+
totalBytes: number(),
|
|
16280
|
+
usedBytes: number(),
|
|
16281
|
+
availableBytes: number(),
|
|
16282
|
+
percent: number()
|
|
15996
16283
|
});
|
|
15997
|
-
|
|
15998
|
-
|
|
15999
|
-
|
|
16000
|
-
|
|
16001
|
-
|
|
16002
|
-
|
|
16003
|
-
|
|
16004
|
-
|
|
16005
|
-
|
|
16284
|
+
var PidResourceStatsSchema = object({
|
|
16285
|
+
pid: number(),
|
|
16286
|
+
cpu: number(),
|
|
16287
|
+
memory: number(),
|
|
16288
|
+
/**
|
|
16289
|
+
* Private (anonymous) resident bytes — the per-process V8 heap + native
|
|
16290
|
+
* allocations NOT shared with other processes (Linux RssAnon). This is the
|
|
16291
|
+
* "real" per-runner cost; summing it across runners is meaningful, unlike
|
|
16292
|
+
* `memory` (RSS), which double-counts the shared mmap'd framework code.
|
|
16293
|
+
* Undefined where /proc is unavailable (e.g. macOS).
|
|
16294
|
+
*/
|
|
16295
|
+
privateBytes: number().optional(),
|
|
16296
|
+
/**
|
|
16297
|
+
* Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
|
|
16298
|
+
* code shared copy-on-write across runners. Undefined on macOS.
|
|
16299
|
+
*/
|
|
16300
|
+
sharedBytes: number().optional()
|
|
16301
|
+
});
|
|
16302
|
+
var AddonInstanceSchema = object({
|
|
16006
16303
|
addonId: string(),
|
|
16007
|
-
|
|
16008
|
-
|
|
16304
|
+
nodeId: string(),
|
|
16305
|
+
role: _enum(["hub", "worker"]),
|
|
16306
|
+
pid: number(),
|
|
16307
|
+
state: _enum([
|
|
16308
|
+
"starting",
|
|
16309
|
+
"running",
|
|
16310
|
+
"stopping",
|
|
16311
|
+
"stopped",
|
|
16312
|
+
"crashed"
|
|
16313
|
+
]),
|
|
16314
|
+
uptimeSec: number()
|
|
16009
16315
|
});
|
|
16010
|
-
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
|
|
16316
|
+
var NodeProcessSchema = object({
|
|
16317
|
+
pid: number(),
|
|
16318
|
+
ppid: number(),
|
|
16319
|
+
pgid: number(),
|
|
16320
|
+
classification: _enum([
|
|
16321
|
+
"root",
|
|
16322
|
+
"managed",
|
|
16323
|
+
"system",
|
|
16324
|
+
"ghost"
|
|
16325
|
+
]),
|
|
16326
|
+
/** `$process` addon binding when `managed`, else null. */
|
|
16327
|
+
addonId: string().nullable(),
|
|
16328
|
+
/** Kernel-reported nodeId when the process is a known agent/worker. */
|
|
16329
|
+
nodeId: string().nullable(),
|
|
16330
|
+
/** Truncated command line. */
|
|
16331
|
+
command: string(),
|
|
16332
|
+
cpuPercent: number(),
|
|
16333
|
+
memoryRssBytes: number(),
|
|
16334
|
+
/** Wall-clock uptime (seconds). Parsed from `ps etime`. */
|
|
16335
|
+
uptimeSec: number(),
|
|
16336
|
+
/** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
|
|
16337
|
+
orphaned: boolean()
|
|
16015
16338
|
});
|
|
16016
|
-
|
|
16017
|
-
|
|
16018
|
-
|
|
16019
|
-
|
|
16020
|
-
attachmentsSent: number().int().nonnegative(),
|
|
16021
|
-
actionsSent: number().int().nonnegative(),
|
|
16022
|
-
truncated: boolean(),
|
|
16023
|
-
dropped: array(string())
|
|
16339
|
+
var KillProcessInputSchema = object({
|
|
16340
|
+
pid: number(),
|
|
16341
|
+
/** Force = SIGKILL. Default is SIGTERM. */
|
|
16342
|
+
force: boolean().optional()
|
|
16024
16343
|
});
|
|
16025
|
-
var
|
|
16344
|
+
var KillProcessResultSchema = object({
|
|
16026
16345
|
success: boolean(),
|
|
16027
|
-
|
|
16028
|
-
|
|
16346
|
+
reason: string().optional(),
|
|
16347
|
+
signal: _enum(["SIGTERM", "SIGKILL"]).optional()
|
|
16348
|
+
});
|
|
16349
|
+
var DumpHeapSnapshotInputSchema = object({
|
|
16350
|
+
/** The addon whose runner should dump a heap snapshot. */
|
|
16351
|
+
addonId: string() });
|
|
16352
|
+
var DumpHeapSnapshotResultSchema = object({
|
|
16353
|
+
success: boolean(),
|
|
16354
|
+
/** Path of the written .heapsnapshot inside the runner's container/host. */
|
|
16355
|
+
path: string().optional(),
|
|
16356
|
+
/** Process pid that was signalled. */
|
|
16357
|
+
pid: number().optional(),
|
|
16358
|
+
reason: string().optional()
|
|
16359
|
+
});
|
|
16360
|
+
var SystemMetricsSchema = object({
|
|
16361
|
+
cpuPercent: number(),
|
|
16362
|
+
memoryPercent: number(),
|
|
16363
|
+
memoryUsedMB: number(),
|
|
16364
|
+
memoryTotalMB: number(),
|
|
16365
|
+
diskPercent: number().optional(),
|
|
16366
|
+
temperature: number().optional(),
|
|
16367
|
+
gpuPercent: number().optional(),
|
|
16368
|
+
gpuMemoryPercent: number().optional()
|
|
16369
|
+
});
|
|
16370
|
+
method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(KillProcessInputSchema, KillProcessResultSchema, {
|
|
16371
|
+
kind: "mutation",
|
|
16372
|
+
auth: "admin"
|
|
16373
|
+
}), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
|
|
16374
|
+
kind: "mutation",
|
|
16375
|
+
auth: "admin"
|
|
16376
|
+
});
|
|
16377
|
+
method(object({
|
|
16378
|
+
sourceUrl: string(),
|
|
16379
|
+
metadata: ModelConvertMetadataSchema,
|
|
16380
|
+
targets: array(ConvertTargetSchema).min(1).readonly(),
|
|
16381
|
+
calibrationRef: string().optional(),
|
|
16382
|
+
sessionId: string().optional()
|
|
16383
|
+
}), ConvertResultSchema, {
|
|
16384
|
+
kind: "mutation",
|
|
16385
|
+
auth: "admin",
|
|
16386
|
+
timeoutMs: 6e5
|
|
16387
|
+
});
|
|
16388
|
+
method(object({
|
|
16389
|
+
nodeId: string(),
|
|
16390
|
+
modelId: string(),
|
|
16391
|
+
format: _enum(MODEL_FORMATS),
|
|
16392
|
+
entry: ModelCatalogEntrySchema
|
|
16393
|
+
}), object({
|
|
16394
|
+
ok: boolean(),
|
|
16395
|
+
/** sha256 of the staged tarball (empty for a hub-local no-op). */
|
|
16396
|
+
sha256: string(),
|
|
16397
|
+
bytes: number(),
|
|
16398
|
+
/** The target node's modelsDir the artifact landed in. */
|
|
16399
|
+
path: string()
|
|
16400
|
+
}), {
|
|
16401
|
+
kind: "mutation",
|
|
16402
|
+
auth: "admin"
|
|
16029
16403
|
});
|
|
16030
|
-
/** Same shape as SendResult — kept as a distinct name for the test panel. */
|
|
16031
|
-
var TestResultSchema = SendResultSchema;
|
|
16032
|
-
method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSchema)), method(object({
|
|
16033
|
-
kind: string(),
|
|
16034
|
-
config: record(string(), unknown()).optional()
|
|
16035
|
-
}), array(DiscoveredTargetSchema)), method(object({
|
|
16036
|
-
targetId: string(),
|
|
16037
|
-
notification: NotificationSchema
|
|
16038
|
-
}), SendResultSchema, { kind: "mutation" }), method(object({
|
|
16039
|
-
targetId: string(),
|
|
16040
|
-
sample: NotificationSchema.optional()
|
|
16041
|
-
}), TestResultSchema, { kind: "mutation" }), method(object({ target: TargetSchema }), TargetSchema, { kind: "mutation" }), method(object({ targetId: string() }), _void(), { kind: "mutation" }), method(object({
|
|
16042
|
-
targetId: string(),
|
|
16043
|
-
enabled: boolean()
|
|
16044
|
-
}), _void(), { kind: "mutation" });
|
|
16045
16404
|
/**
|
|
16046
|
-
*
|
|
16047
|
-
*
|
|
16048
|
-
* Spec: `docs/superpowers/specs/2026-07-22-notification-center-requirements.md`
|
|
16049
|
-
* (operator decisions D-1/D-2/D-3 are binding):
|
|
16405
|
+
* `mqtt-broker` — broker-registry cap.
|
|
16050
16406
|
*
|
|
16051
|
-
*
|
|
16052
|
-
*
|
|
16053
|
-
*
|
|
16054
|
-
*
|
|
16055
|
-
* - D-3: urgency belongs to the RULE. `delivery: 'immediate'` fires on the
|
|
16056
|
-
* FIRST persisted detection matching the conditions (per-track dedup,
|
|
16057
|
-
* `maxPerTrack` fixed at 1 — see {@link NC_MAX_PER_TRACK_IMMEDIATE});
|
|
16058
|
-
* `delivery: 'track-end'` evaluates the finalized track record at close.
|
|
16059
|
-
* - DISPATCH stays behind `notification-output` (rules reference targets
|
|
16060
|
-
* by id; per-backend params are a passthrough blob capped by the
|
|
16061
|
-
* target kind's own caps/degrade engine).
|
|
16407
|
+
* NOT a pub/sub proxy. The cap exposes (a) a registry of configured
|
|
16408
|
+
* MQTT brokers (external + optionally an embedded `aedes`-backed one)
|
|
16409
|
+
* and (b) the connection details a consumer addon needs to spin up
|
|
16410
|
+
* its OWN `mqtt.js` client.
|
|
16062
16411
|
*
|
|
16063
|
-
*
|
|
16064
|
-
*
|
|
16065
|
-
*
|
|
16066
|
-
*
|
|
16067
|
-
*
|
|
16068
|
-
* private zones, per-recipient fan-out and the wider condition table are
|
|
16069
|
-
* P2+ (see spec §7).
|
|
16412
|
+
* Why: pub/sub routing over the system event-bus loses fidelity
|
|
16413
|
+
* (callback shape, QoS guarantees, will/retain semantics) and adds
|
|
16414
|
+
* refcount bookkeeping that addons would rather own themselves. The
|
|
16415
|
+
* canonical consumer (`addon-export-ha-mqtt`) needs raw `mqtt.js`
|
|
16416
|
+
* features anyway — give it the connection config, get out of the way.
|
|
16070
16417
|
*
|
|
16071
|
-
*
|
|
16072
|
-
*
|
|
16073
|
-
*
|
|
16418
|
+
* Consumer flow:
|
|
16419
|
+
* const cfg = await ctx.api.mqttBroker.getBrokerConfig({ id })
|
|
16420
|
+
* const client = mqtt.connect(cfg.url, { username: cfg.username, … })
|
|
16421
|
+
* client.subscribe('zigbee2mqtt/+')
|
|
16422
|
+
*
|
|
16423
|
+
* Collection mode: multiple brokers (e.g. one local mosquitto + one
|
|
16424
|
+
* cloud bridge). The "embedded" entry (when present) is just another
|
|
16425
|
+
* broker in the registry — its lifecycle is owned by the addon that
|
|
16426
|
+
* spawned it.
|
|
16074
16427
|
*/
|
|
16428
|
+
var BrokerKindSchema = _enum(["external", "embedded"]);
|
|
16075
16429
|
/**
|
|
16076
|
-
*
|
|
16077
|
-
* The value maps 1:1 onto the evaluated record kind:
|
|
16078
|
-
* - `immediate` ↔ object-event persist (lowest-latency detection burst)
|
|
16079
|
-
* - `track-end` ↔ TrackCloser.closeExpired (finalized track record)
|
|
16080
|
-
* - `device-event` ↔ SensorEventStore insert (doorbell press / sensor state
|
|
16081
|
-
* change of a LINKED device, one row per linked camera)
|
|
16082
|
-
* - `package-event` ↔ PackageDropDetector object-event insert (a `package`
|
|
16083
|
-
* delivery / pick-up)
|
|
16430
|
+
* Broker live-probe status.
|
|
16084
16431
|
*
|
|
16085
|
-
*
|
|
16086
|
-
*
|
|
16087
|
-
*
|
|
16088
|
-
*
|
|
16432
|
+
* - `connected` — last probe completed a clean CONNACK
|
|
16433
|
+
* - `disconnected` — no probe has run yet (cold cache)
|
|
16434
|
+
* - `auth-failed` — CONNACK refused with auth error (RC 4 / 5)
|
|
16435
|
+
* - `unreachable` — TCP connect timed out / refused
|
|
16436
|
+
* - `tls-error` — TLS handshake failed (cert / SNI / cipher)
|
|
16089
16437
|
*/
|
|
16090
|
-
var
|
|
16091
|
-
"
|
|
16092
|
-
"
|
|
16093
|
-
"
|
|
16094
|
-
"
|
|
16438
|
+
var BrokerStatusSchema$1 = _enum([
|
|
16439
|
+
"connected",
|
|
16440
|
+
"disconnected",
|
|
16441
|
+
"auth-failed",
|
|
16442
|
+
"unreachable",
|
|
16443
|
+
"tls-error"
|
|
16095
16444
|
]);
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
/**
|
|
16105
|
-
|
|
16106
|
-
/**
|
|
16107
|
-
|
|
16108
|
-
});
|
|
16109
|
-
/** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
|
|
16110
|
-
var NcPlateMatcherSchema = object({
|
|
16111
|
-
values: array(string().min(1)).min(1),
|
|
16112
|
-
/** Max Levenshtein distance after normalization (uppercase alphanumeric). */
|
|
16113
|
-
maxDistance: number().int().min(0).max(3).default(1)
|
|
16114
|
-
});
|
|
16115
|
-
/**
|
|
16116
|
-
* Occupancy condition (DEVICE-EVENT trigger). Fires on a ZoneAnalytics
|
|
16117
|
-
* occupancy edge for a device — optionally narrowed to a single admin
|
|
16118
|
-
* `zoneId` and/or object `className`. `op` selects the edge/threshold:
|
|
16119
|
-
* - `became-occupied` (default) — count crossed 0 → ≥ `count`
|
|
16120
|
-
* - `became-free` — count crossed ≥ `count` → below it
|
|
16121
|
-
* - `>=` / `<=` — count is at/over or at/under `count`
|
|
16122
|
-
* `sustainSeconds` requires the condition hold continuously that long
|
|
16123
|
-
* before firing (debounces flicker; 0 = fire on the first matching edge).
|
|
16124
|
-
* Fail-closed: no ZoneAnalytics snapshot / missing zone / null snapshot ⇒
|
|
16125
|
-
* the condition never matches. Confirmed edge-state survives addon restarts
|
|
16126
|
-
* (declared SQLite collection, reseeded on boot).
|
|
16127
|
-
*/
|
|
16128
|
-
var NcOccupancyConditionSchema = object({
|
|
16129
|
-
/** Admin zone id to scope the count to; absent = whole-frame occupancy. */
|
|
16130
|
-
zoneId: string().optional(),
|
|
16131
|
-
/** Object class to count; absent = any class. */
|
|
16132
|
-
className: string().optional(),
|
|
16133
|
-
op: _enum([
|
|
16134
|
-
"became-occupied",
|
|
16135
|
-
"became-free",
|
|
16136
|
-
">=",
|
|
16137
|
-
"<="
|
|
16138
|
-
]).default("became-occupied"),
|
|
16139
|
-
count: number().int().min(0).default(1),
|
|
16140
|
-
sustainSeconds: number().int().min(0).max(3600).default(15)
|
|
16141
|
-
});
|
|
16142
|
-
/** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
|
|
16143
|
-
var NcZoneConditionSchema = object({
|
|
16144
|
-
ids: array(string().min(1)).min(1),
|
|
16145
|
-
/** Quantifier over `ids` — at least one / every one visited. */
|
|
16146
|
-
match: _enum(["any", "all"]).default("any")
|
|
16147
|
-
});
|
|
16148
|
-
/**
|
|
16149
|
-
* The P1 condition set — a flat AND of groups; absent group = pass;
|
|
16150
|
-
* membership lists are OR within the list (spec §2.3).
|
|
16151
|
-
*/
|
|
16152
|
-
var NcConditionsSchema = object({
|
|
16153
|
-
/** Device scope — absent = all devices. */
|
|
16154
|
-
devices: array(number()).optional(),
|
|
16155
|
-
/** Detector class names (any overlap with the record's class set). */
|
|
16156
|
-
classes: array(string().min(1)).optional(),
|
|
16157
|
-
/** Veto classes — any overlap fails the rule. */
|
|
16158
|
-
classesExclude: array(string().min(1)).optional(),
|
|
16159
|
-
/** Minimum detection confidence 0–1 (fails when the record has none). */
|
|
16160
|
-
minConfidence: number().min(0).max(1).optional(),
|
|
16161
|
-
/** Admin zone membership over event `zones` / track `zonesVisited`. */
|
|
16162
|
-
zones: NcZoneConditionSchema.optional(),
|
|
16163
|
-
/** Veto zones — any hit fails the rule. */
|
|
16164
|
-
zonesExclude: array(string().min(1)).optional(),
|
|
16165
|
-
/**
|
|
16166
|
-
* Exact (case-insensitive) match on the record's collapsed `label`
|
|
16167
|
-
* (identity name / plate text / subclass).
|
|
16168
|
-
*/
|
|
16169
|
-
labelEquals: array(string().min(1)).optional(),
|
|
16170
|
-
/**
|
|
16171
|
-
* Identity matcher. P1 boundary: matched against the record's collapsed
|
|
16172
|
-
* `label` (the identity display name propagated by the face pipeline) —
|
|
16173
|
-
* identity-ID matching rides in P2 when identity ids reach the record.
|
|
16174
|
-
*/
|
|
16175
|
-
identities: array(string().min(1)).optional(),
|
|
16176
|
-
/** Fuzzy plate matcher against the record's `label` (plate text). */
|
|
16177
|
-
plates: NcPlateMatcherSchema.optional(),
|
|
16178
|
-
/**
|
|
16179
|
-
* Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics.
|
|
16180
|
-
* Same P1 boundary: matched against the record's collapsed `label` (the
|
|
16181
|
-
* identity display name). A record with NO label passes (nothing to
|
|
16182
|
-
* exclude), unlike the include variant which fails on an absent label.
|
|
16183
|
-
*/
|
|
16184
|
-
identitiesExclude: array(string().min(1)).optional(),
|
|
16185
|
-
/**
|
|
16186
|
-
* Minimum server-computed key-event importance in [0,1] (`Track.importance`).
|
|
16187
|
-
* TRACK-END only: importance is scored at track close, so it does not exist
|
|
16188
|
-
* at immediate / object-event evaluation time (see catalog `appliesTo`). At
|
|
16189
|
-
* close the value is threaded via the close-time info (the `Track` clone is
|
|
16190
|
-
* captured before the DB row is updated, so it would otherwise read stale).
|
|
16191
|
-
* Fails when the record carries no importance (never guess quality — the
|
|
16192
|
-
* `minConfidence` precedent). MVP cut: a single scalar threshold.
|
|
16193
|
-
*/
|
|
16194
|
-
minImportance: number().min(0).max(1).optional(),
|
|
16195
|
-
/**
|
|
16196
|
-
* Minimum track dwell in SECONDS — `(lastSeen − firstSeen) / 1000`.
|
|
16197
|
-
* TRACK-END only: an `immediate` / object-event subject has no closed
|
|
16198
|
-
* lifespan, so a dwell condition never matches immediate delivery
|
|
16199
|
-
* (documented choice — the object-event record carries no `firstSeen`,
|
|
16200
|
-
* so dwell cannot be computed from what the subject actually carries).
|
|
16201
|
-
*/
|
|
16202
|
-
minDwellSeconds: number().min(0).optional(),
|
|
16203
|
-
/**
|
|
16204
|
-
* Detection provenance filter. `any` (default / absent) matches every
|
|
16205
|
-
* source; otherwise the subject's source must equal it. Legacy records
|
|
16206
|
-
* with no stamped source are treated as `pipeline`. The union spans both
|
|
16207
|
-
* record kinds — object events carry `pipeline` | `onboard`, synthetic
|
|
16208
|
-
* tracks carry `sensor`.
|
|
16209
|
-
*/
|
|
16210
|
-
source: _enum([
|
|
16211
|
-
"pipeline",
|
|
16212
|
-
"onboard",
|
|
16213
|
-
"sensor",
|
|
16214
|
-
"any"
|
|
16215
|
-
]).optional(),
|
|
16216
|
-
/**
|
|
16217
|
-
* Minimum identity / plate MATCH confidence in [0,1] — DISTINCT from the
|
|
16218
|
-
* detector `minConfidence` (that gates the object-detection score; this
|
|
16219
|
-
* gates the recognition/OCR match score). Fails when the subject carries
|
|
16220
|
-
* no label-match confidence (never guess). TRACK-END only: the confidence
|
|
16221
|
-
* lives on the recognition result and reaches the subject at track close.
|
|
16222
|
-
*
|
|
16223
|
-
* What it measures precisely (plumbed at track close — the closer threads
|
|
16224
|
-
* the value into `NcTrackClosedInfo.labelConfidence`, the same seam as
|
|
16225
|
-
* `importance`): the BEST recognition match confidence observed for the
|
|
16226
|
-
* label the track carries at close — for a face, the peak cosine similarity
|
|
16227
|
-
* of the ASSIGNED identity (`FaceMatch.score`, reset on an identity switch);
|
|
16228
|
-
* for a plate, the peak OCR read score of the best-held plate
|
|
16229
|
-
* (`plateText.confidence`). When BOTH a face and a plate were recognized on
|
|
16230
|
-
* one track the higher of the two is used. A track that ended with no
|
|
16231
|
-
* confident identity/plate match carries no value, so the condition fails
|
|
16232
|
-
* closed for it (an un-recognized subject).
|
|
16233
|
-
*/
|
|
16234
|
-
minLabelConfidence: number().min(0).max(1).optional(),
|
|
16235
|
-
/**
|
|
16236
|
-
* DEVICE-EVENT only. Raw device event-type tokens (`EventFire.eventType`,
|
|
16237
|
-
* e.g. a doorbell `press` / `press_long`) — matched case-insensitively
|
|
16238
|
-
* against the token carried on the device-event subject (extracted from the
|
|
16239
|
-
* event-emitter runtime slice's `lastEvent.eventType`). Fails when the
|
|
16240
|
-
* subject carries no token. Doorbell-pulse / passive-sensor kinds emit no
|
|
16241
|
-
* eventType, so gate those with {@link sensorKinds} instead.
|
|
16242
|
-
*/
|
|
16243
|
-
eventTypeTokens: array(string().min(1)).optional(),
|
|
16244
|
-
/**
|
|
16245
|
-
* DEVICE-EVENT only. Sensor/control taxonomy kinds (e.g. `doorbell`,
|
|
16246
|
-
* `contact`, `button`, `device-event`) — matched against the persisted
|
|
16247
|
-
* `SensorEvent.kind` (see `sensor-event-kinds.ts`). Membership is OR.
|
|
16248
|
-
*/
|
|
16249
|
-
sensorKinds: array(string().min(1)).optional(),
|
|
16250
|
-
/**
|
|
16251
|
-
* PACKAGE-EVENT only. Which package phase fires the rule — `delivered`
|
|
16252
|
-
* (a parked parcel appeared), `picked-up` (it departed), or `both`. Fails
|
|
16253
|
-
* when the subject's phase does not match (a subject always carries a phase
|
|
16254
|
-
* on the package-event trigger).
|
|
16255
|
-
*/
|
|
16256
|
-
packagePhase: _enum([
|
|
16257
|
-
"delivered",
|
|
16258
|
-
"picked-up",
|
|
16259
|
-
"both"
|
|
16260
|
-
]).optional(),
|
|
16261
|
-
/**
|
|
16262
|
-
* PERSONAL-RULE custom zones (viewer-drawn). Inline normalized polygons
|
|
16263
|
-
* (MaskShape vocabulary). A record passes when its bbox overlaps ANY
|
|
16264
|
-
* listed polygon (ZoneEngine membership semantics). Evaluated only when
|
|
16265
|
-
* the subject carries a bbox; absent bbox ⇒ the condition FAILS.
|
|
16266
|
-
*/
|
|
16267
|
-
customZones: array(MaskPolygonShapeSchema).optional(),
|
|
16268
|
-
/**
|
|
16269
|
-
* DEVICE-EVENT only. ZoneAnalytics occupancy edge — fires when a device's
|
|
16270
|
-
* (optionally zone/class-scoped) occupancy count crosses the configured
|
|
16271
|
-
* threshold and holds for `sustainSeconds`. Fail-closed on missing
|
|
16272
|
-
* substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
|
|
16273
|
-
*/
|
|
16274
|
-
occupancy: NcOccupancyConditionSchema.optional()
|
|
16275
|
-
});
|
|
16276
|
-
/** One delivery target: a `notification-output` Target ref + passthrough params. */
|
|
16277
|
-
var NcRuleTargetSchema = object({
|
|
16278
|
-
/** `notification-output` Target id. */
|
|
16279
|
-
targetId: string().min(1),
|
|
16280
|
-
/**
|
|
16281
|
-
* Per-backend passthrough. Recognized keys are mapped onto the canonical
|
|
16282
|
-
* Notification (`priority`, `level`, `sound`, `clickUrl`, `ttl`); the
|
|
16283
|
-
* degrade engine drops what the backend can't render.
|
|
16284
|
-
*/
|
|
16285
|
-
params: record(string(), unknown()).optional()
|
|
16445
|
+
var BrokerInfoSchema = object({
|
|
16446
|
+
id: string(),
|
|
16447
|
+
name: string(),
|
|
16448
|
+
url: string(),
|
|
16449
|
+
kind: BrokerKindSchema,
|
|
16450
|
+
status: BrokerStatusSchema$1,
|
|
16451
|
+
latencyMs: number().nullable(),
|
|
16452
|
+
error: string().optional(),
|
|
16453
|
+
/** Embedded brokers only: number of MQTT clients currently connected. */
|
|
16454
|
+
connectedClients: number().int().nonnegative().optional(),
|
|
16455
|
+
/** Epoch ms of the last live probe (external) or aedes snapshot (embedded). */
|
|
16456
|
+
lastCheckedAt: number().optional()
|
|
16286
16457
|
});
|
|
16287
16458
|
/**
|
|
16288
|
-
*
|
|
16289
|
-
*
|
|
16290
|
-
*
|
|
16291
|
-
*
|
|
16292
|
-
* plates attaches the `plateCrop`; a rule with no identity/plate condition
|
|
16293
|
-
* (or when the specific crop is missing) degrades to `best`, then
|
|
16294
|
-
* `keyFrame`, then no attachment — never delaying the send. The matched
|
|
16295
|
-
* condition summary is frozen on the outbox row at enqueue (like the rule
|
|
16296
|
-
* name), so the choice never drifts from the record that fired it.
|
|
16297
|
-
* - `keyFrame` — the clean scene frame (no subject box).
|
|
16298
|
-
* - `none` — no attachment.
|
|
16459
|
+
* Connection details — what a consumer needs to call
|
|
16460
|
+
* `mqtt.connect(url, options)`. We split URL + credentials so the
|
|
16461
|
+
* consumer can pass them as `mqtt.connect(url, { username, password })`
|
|
16462
|
+
* instead of stuffing creds into the URL (which leaks them into logs).
|
|
16299
16463
|
*/
|
|
16300
|
-
var
|
|
16301
|
-
|
|
16302
|
-
|
|
16303
|
-
|
|
16304
|
-
"none"
|
|
16305
|
-
]).default("best") });
|
|
16306
|
-
/** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
|
|
16307
|
-
var NcThrottleSchema = object({
|
|
16308
|
-
cooldownSec: number().int().min(0).max(86400).default(60),
|
|
16309
|
-
/** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
|
|
16310
|
-
scope: _enum(["rule", "rule-device"]).default("rule-device")
|
|
16311
|
-
});
|
|
16312
|
-
/** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
|
|
16313
|
-
var NcRuleInputSchema = object({
|
|
16314
|
-
name: string().min(1).max(200),
|
|
16315
|
-
enabled: boolean().default(true),
|
|
16316
|
-
delivery: NcDeliverySchema,
|
|
16317
|
-
conditions: NcConditionsSchema.default({}),
|
|
16318
|
-
schedule: NcScheduleSchema.optional(),
|
|
16319
|
-
targets: array(NcRuleTargetSchema).min(1),
|
|
16320
|
-
media: NcMediaPolicySchema.default({ attach: "best" }),
|
|
16321
|
-
throttle: NcThrottleSchema.default({
|
|
16322
|
-
cooldownSec: 60,
|
|
16323
|
-
scope: "rule-device"
|
|
16324
|
-
}),
|
|
16325
|
-
/** `{{var}}` templating over camera/class/label/zones/confidence/time. */
|
|
16326
|
-
template: object({
|
|
16327
|
-
title: string().max(500).optional(),
|
|
16328
|
-
body: string().max(2e3).optional()
|
|
16329
|
-
}).optional(),
|
|
16330
|
-
/** Canonical notification priority ordinal (1..5); per-target overridable. */
|
|
16331
|
-
priority: number().int().min(1).max(5).default(3),
|
|
16464
|
+
var BrokerConnectionDetailsSchema = object({
|
|
16465
|
+
url: string(),
|
|
16466
|
+
username: string().optional(),
|
|
16467
|
+
password: string().optional(),
|
|
16332
16468
|
/**
|
|
16333
|
-
*
|
|
16334
|
-
*
|
|
16335
|
-
*
|
|
16469
|
+
* Suggested prefix for `clientId`. Each consumer should suffix this
|
|
16470
|
+
* with its own discriminator (addon id, instance id) so reconnects
|
|
16471
|
+
* don't kick each other off (MQTT spec: clientId must be unique per
|
|
16472
|
+
* broker).
|
|
16336
16473
|
*/
|
|
16337
|
-
|
|
16474
|
+
clientIdPrefix: string().optional()
|
|
16475
|
+
});
|
|
16476
|
+
var AddBrokerInputSchema = object({
|
|
16477
|
+
name: string().min(1),
|
|
16478
|
+
url: string().regex(/^(mqtt|mqtts|ws|wss):\/\//, "URL must start with mqtt(s):// or ws(s)://"),
|
|
16479
|
+
username: string().optional(),
|
|
16480
|
+
password: string().optional(),
|
|
16481
|
+
clientIdPrefix: string().optional()
|
|
16482
|
+
});
|
|
16483
|
+
var AddBrokerResultSchema = object({ id: string() });
|
|
16484
|
+
var IdInputSchema = object({ id: string() });
|
|
16485
|
+
var TestResultSchema$1 = discriminatedUnion("ok", [object({
|
|
16486
|
+
ok: literal(true),
|
|
16487
|
+
latencyMs: number()
|
|
16488
|
+
}), object({
|
|
16489
|
+
ok: literal(false),
|
|
16490
|
+
error: string()
|
|
16491
|
+
})]);
|
|
16492
|
+
var StartEmbeddedInputSchema = object({
|
|
16493
|
+
port: number().int().min(1).max(65535).default(1883),
|
|
16494
|
+
/** Allow anonymous connect (no username/password). Default: false. */
|
|
16495
|
+
allowAnonymous: boolean().default(false),
|
|
16496
|
+
/** Optional shared username/password for clients. */
|
|
16497
|
+
username: string().optional(),
|
|
16498
|
+
password: string().optional()
|
|
16499
|
+
});
|
|
16500
|
+
var StartEmbeddedResultSchema = object({
|
|
16501
|
+
id: string(),
|
|
16502
|
+
url: string()
|
|
16503
|
+
});
|
|
16504
|
+
var StatusSchema = object({
|
|
16505
|
+
brokerCount: number(),
|
|
16506
|
+
embeddedRunning: boolean()
|
|
16507
|
+
});
|
|
16508
|
+
method(_void(), array(BrokerInfoSchema)), method(IdInputSchema, BrokerConnectionDetailsSchema), method(AddBrokerInputSchema, AddBrokerResultSchema, { kind: "mutation" }), method(IdInputSchema, _void(), { kind: "mutation" }), method(IdInputSchema, TestResultSchema$1, { kind: "mutation" }), method(StartEmbeddedInputSchema, StartEmbeddedResultSchema, { kind: "mutation" }), method(IdInputSchema, _void(), { kind: "mutation" }), method(_void(), StatusSchema);
|
|
16509
|
+
var NetworkEndpointSchema = object({
|
|
16510
|
+
url: string(),
|
|
16511
|
+
hostname: string(),
|
|
16512
|
+
port: number(),
|
|
16513
|
+
protocol: _enum(["http", "https"])
|
|
16514
|
+
});
|
|
16515
|
+
var NetworkAccessStatusSchema = object({
|
|
16516
|
+
connected: boolean(),
|
|
16517
|
+
endpoint: NetworkEndpointSchema.nullable(),
|
|
16518
|
+
error: string().optional()
|
|
16338
16519
|
});
|
|
16339
16520
|
/**
|
|
16340
|
-
*
|
|
16341
|
-
*
|
|
16342
|
-
*
|
|
16343
|
-
*
|
|
16344
|
-
*
|
|
16345
|
-
*
|
|
16346
|
-
* `updateRule` patch.
|
|
16521
|
+
* Optional, richer endpoint shape returned by providers that expose
|
|
16522
|
+
* MORE than one ingress concurrently (Tailscale Ingress with mixed
|
|
16523
|
+
* serve+funnel rules, future ngrok multi-tunnel, …). Each entry carries
|
|
16524
|
+
* the originating provider config (mode + sourcePort) so the
|
|
16525
|
+
* orchestrator UI can label rows distinctly. Providers that expose only
|
|
16526
|
+
* one endpoint just omit `listEndpoints` from their provider impl.
|
|
16347
16527
|
*/
|
|
16348
|
-
var
|
|
16349
|
-
/** A persisted rule. */
|
|
16350
|
-
var NcRuleSchema = NcRuleInputSchema.extend({
|
|
16351
|
-
id: string(),
|
|
16352
|
-
/** userId of the admin who created the rule (server-stamped caller). */
|
|
16353
|
-
createdBy: string(),
|
|
16354
|
-
createdAt: number(),
|
|
16355
|
-
updatedAt: number(),
|
|
16528
|
+
var NetworkEndpointEntrySchema = NetworkEndpointSchema.extend({
|
|
16356
16529
|
/**
|
|
16357
|
-
*
|
|
16358
|
-
*
|
|
16359
|
-
* in `nc.setRuleTargetEnabled`). Defaults to empty.
|
|
16530
|
+
* Stable id within the provider — typically `<mode>-<sourcePort>` so
|
|
16531
|
+
* the orchestrator can dedupe across `listEndpoints` polls.
|
|
16360
16532
|
*/
|
|
16361
|
-
|
|
16362
|
-
|
|
16363
|
-
|
|
16364
|
-
|
|
16365
|
-
|
|
16366
|
-
|
|
16367
|
-
|
|
16368
|
-
"device-event",
|
|
16369
|
-
"package-event"
|
|
16370
|
-
]),
|
|
16371
|
-
deviceId: number(),
|
|
16372
|
-
timestamp: number(),
|
|
16373
|
-
wouldFire: boolean(),
|
|
16374
|
-
/** Condition id that failed (first failing group), when `wouldFire` is false. */
|
|
16375
|
-
failedCondition: string().optional(),
|
|
16376
|
-
className: string().optional(),
|
|
16377
|
-
label: string().optional()
|
|
16533
|
+
id: string(),
|
|
16534
|
+
/** Operator-facing label (mirrors `MeshEndpoint.label`). */
|
|
16535
|
+
label: string(),
|
|
16536
|
+
/** Optional provider-specific mode tag, used for icon/colour in admin UI. */
|
|
16537
|
+
mode: string().optional(),
|
|
16538
|
+
/** Originating local port the ingress fronts (informational). */
|
|
16539
|
+
sourcePort: number().optional()
|
|
16378
16540
|
});
|
|
16379
|
-
|
|
16380
|
-
|
|
16541
|
+
method(_void(), NetworkEndpointSchema, { kind: "mutation" }), method(_void(), _void(), { kind: "mutation" }), method(_void(), NetworkEndpointSchema.nullable()), method(_void(), NetworkAccessStatusSchema), method(_void(), array(NetworkEndpointEntrySchema).readonly());
|
|
16542
|
+
/**
|
|
16543
|
+
* notification-output — canonical, capability-gated notification delivery.
|
|
16544
|
+
*
|
|
16545
|
+
* Apprise-derived model (see
|
|
16546
|
+
* `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
|
|
16547
|
+
* callers emit ONE canonical `Notification`; each provider declares a
|
|
16548
|
+
* per-kind capability descriptor (`TargetKind`), and the pure degrade
|
|
16549
|
+
* engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
|
|
16550
|
+
* message to what the kind supports — callers never special-case a service.
|
|
16551
|
+
*
|
|
16552
|
+
* DESIGN DECISIONS (locked):
|
|
16553
|
+
* - Target CRUD lives on THIS cap (`upsertTarget` / `deleteTarget` /
|
|
16554
|
+
* `setTargetEnabled`), each provider persisting via the `settings-store`
|
|
16555
|
+
* cap. Rationale: the admin UI needs one uniform surface across the
|
|
16556
|
+
* notifiers addon AND the HA addon; the addon-`globalSettingsSchema`-array
|
|
16557
|
+
* alternative would fork the UI per addon and cannot host the
|
|
16558
|
+
* discovery→adopt flow.
|
|
16559
|
+
* - `listTargetKinds` / `listTargets` / `discoverTargets` return arrays →
|
|
16560
|
+
* the generated cap-mount auto-`concatCollection`-fans them across every
|
|
16561
|
+
* registered provider (notifiers addon + HA addon) so one catalog is
|
|
16562
|
+
* routable. `send` / `testTarget` / CRUD route to ONE provider by the
|
|
16563
|
+
* `addonId` the generated collection router extracts from the call input.
|
|
16564
|
+
* - `Attachment.bytes` is `Uint8Array`. Transport-safe: superjson (the tRPC
|
|
16565
|
+
* transformer) + UDS MsgPack both round-trip typed arrays — already used by
|
|
16566
|
+
* `storage` / `storage-provider` / `recording` caps over the same path. No
|
|
16567
|
+
* base64 fallback needed.
|
|
16568
|
+
*
|
|
16569
|
+
* TODO (deferred, closed-set change — separate decision): add
|
|
16570
|
+
* `providerKind: 'notify'` so notification providers surface on the unified
|
|
16571
|
+
* admin "Integrations" page.
|
|
16572
|
+
*/
|
|
16573
|
+
/**
|
|
16574
|
+
* Zentik-derived typed-media enum — the superset across every kind. Each
|
|
16575
|
+
* adapter picks what it supports and the degrade engine filters the rest.
|
|
16576
|
+
*/
|
|
16577
|
+
var AttachmentMediaTypeSchema = _enum([
|
|
16578
|
+
"image",
|
|
16579
|
+
"video",
|
|
16580
|
+
"gif",
|
|
16581
|
+
"audio",
|
|
16582
|
+
"icon"
|
|
16583
|
+
]);
|
|
16584
|
+
/**
|
|
16585
|
+
* A single attachment. Exactly one of `url` (remote source, most adapters
|
|
16586
|
+
* prefer this) or `bytes` (inline source; required for Pushover-style
|
|
16587
|
+
* bytes-only kinds) MUST be present — the degrade engine expresses a
|
|
16588
|
+
* url→bytes fetch as a `needsFetch` directive the adapter executes.
|
|
16589
|
+
*/
|
|
16590
|
+
var AttachmentSchema = object({
|
|
16591
|
+
mediaType: AttachmentMediaTypeSchema,
|
|
16592
|
+
url: string().optional(),
|
|
16593
|
+
bytes: _instanceof(Uint8Array).optional(),
|
|
16594
|
+
mime: string().optional(),
|
|
16595
|
+
name: string().optional()
|
|
16596
|
+
}).refine((a) => a.url !== void 0 || a.bytes !== void 0, { message: "Attachment requires either `url` or `bytes`" });
|
|
16597
|
+
var NotificationFormatSchema = _enum([
|
|
16598
|
+
"text",
|
|
16599
|
+
"markdown",
|
|
16600
|
+
"html"
|
|
16601
|
+
]);
|
|
16602
|
+
/** A single tap-through action button. */
|
|
16603
|
+
var NotificationActionSchema = object({
|
|
16604
|
+
id: string(),
|
|
16605
|
+
label: string(),
|
|
16606
|
+
url: string().optional()
|
|
16607
|
+
});
|
|
16608
|
+
/**
|
|
16609
|
+
* The canonical notification. `body` is the only hard field (Apprise model).
|
|
16610
|
+
* `priority` is a 5-level ORDINAL (1=lowest … 3=normal(default) … 5=urgent),
|
|
16611
|
+
* NOT a fixed severity enum — each kind declares its own `caps.levels` and
|
|
16612
|
+
* the adapter maps this ordinal onto its native level. `level?` is an
|
|
16613
|
+
* optional kind-native level id (`emergency`, `silent`, …) that overrides
|
|
16614
|
+
* `priority` for that one target.
|
|
16615
|
+
*/
|
|
16616
|
+
var NotificationSchema = object({
|
|
16617
|
+
body: string(),
|
|
16618
|
+
title: string().optional(),
|
|
16619
|
+
format: NotificationFormatSchema.default("text"),
|
|
16620
|
+
priority: number().int().min(1).max(5).default(3),
|
|
16621
|
+
level: string().optional(),
|
|
16622
|
+
attachments: array(AttachmentSchema).optional(),
|
|
16623
|
+
clickUrl: string().optional(),
|
|
16624
|
+
actions: array(NotificationActionSchema).optional(),
|
|
16625
|
+
sound: string().optional(),
|
|
16626
|
+
ttl: number().optional(),
|
|
16627
|
+
tag: string().optional(),
|
|
16628
|
+
deviceId: number().optional(),
|
|
16629
|
+
eventId: string().optional(),
|
|
16630
|
+
metadata: record(string(), unknown()).optional()
|
|
16631
|
+
});
|
|
16632
|
+
/** One declared native severity/priority level for a kind. */
|
|
16633
|
+
var TargetKindLevelSchema = object({
|
|
16381
16634
|
id: string(),
|
|
16382
|
-
group: _enum([
|
|
16383
|
-
"scope",
|
|
16384
|
-
"class",
|
|
16385
|
-
"zones",
|
|
16386
|
-
"quality",
|
|
16387
|
-
"label",
|
|
16388
|
-
"schedule",
|
|
16389
|
-
"device",
|
|
16390
|
-
"package",
|
|
16391
|
-
"occupancy"
|
|
16392
|
-
]),
|
|
16393
16635
|
label: string(),
|
|
16394
|
-
/**
|
|
16395
|
-
|
|
16396
|
-
|
|
16397
|
-
|
|
16398
|
-
|
|
16399
|
-
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
|
|
16403
|
-
"schedule",
|
|
16404
|
-
"plateMatcher",
|
|
16405
|
-
"packagePhase",
|
|
16406
|
-
"polygonDraw",
|
|
16407
|
-
"occupancy"
|
|
16408
|
-
]),
|
|
16409
|
-
operator: _enum([
|
|
16410
|
-
"in",
|
|
16411
|
-
"notIn",
|
|
16412
|
-
"anyOf",
|
|
16413
|
-
"allOf",
|
|
16414
|
-
"gte",
|
|
16415
|
-
"fuzzyIn",
|
|
16416
|
-
"withinSchedule"
|
|
16417
|
-
]),
|
|
16418
|
-
/** Which delivery kinds the condition applies to. */
|
|
16419
|
-
appliesTo: array(NcDeliverySchema),
|
|
16420
|
-
phase: string(),
|
|
16636
|
+
/** Which canonical priority (1..5) this level maps to. `null` = qualitative-only. */
|
|
16637
|
+
ordinal: number().int().min(1).max(5).nullable(),
|
|
16638
|
+
flags: object({
|
|
16639
|
+
critical: boolean().optional(),
|
|
16640
|
+
silent: boolean().optional(),
|
|
16641
|
+
noPush: boolean().optional()
|
|
16642
|
+
}).optional(),
|
|
16643
|
+
/** e.g. Pushover `emergency` requires `retry` / `expire`. */
|
|
16644
|
+
requires: array(string()).optional(),
|
|
16421
16645
|
description: string().optional()
|
|
16422
16646
|
});
|
|
16647
|
+
/** The full capability block consulted before dispatch. */
|
|
16648
|
+
var TargetKindCapsSchema = object({
|
|
16649
|
+
attachments: object({
|
|
16650
|
+
mediaTypes: array(AttachmentMediaTypeSchema),
|
|
16651
|
+
mode: _enum([
|
|
16652
|
+
"url",
|
|
16653
|
+
"bytes",
|
|
16654
|
+
"both"
|
|
16655
|
+
]),
|
|
16656
|
+
max: number().int().nonnegative(),
|
|
16657
|
+
maxBytes: number().int().positive().optional()
|
|
16658
|
+
}),
|
|
16659
|
+
/** Max action buttons (0 = none). */
|
|
16660
|
+
actions: number().int().nonnegative(),
|
|
16661
|
+
levels: array(TargetKindLevelSchema),
|
|
16662
|
+
format: array(NotificationFormatSchema),
|
|
16663
|
+
clickUrl: boolean(),
|
|
16664
|
+
sound: boolean(),
|
|
16665
|
+
ttl: boolean(),
|
|
16666
|
+
bodyMaxLen: number().int().positive()
|
|
16667
|
+
});
|
|
16423
16668
|
/**
|
|
16424
|
-
*
|
|
16425
|
-
*
|
|
16426
|
-
*
|
|
16427
|
-
*
|
|
16428
|
-
*
|
|
16429
|
-
* backend rejection / a deleted target (terminal; carries
|
|
16430
|
-
* the failure `error`)
|
|
16431
|
-
*
|
|
16432
|
-
* P1 has no `suppressed-quiet-hours` / `snoozed` states — those ride the P2
|
|
16433
|
-
* user dimension (quiet hours / snooze) and are additive when they land.
|
|
16669
|
+
* `configSchema` is a `ConfigUISchema` tree passed through to the admin
|
|
16670
|
+
* FormBuilder. Stored as `z.unknown()` at the cap seam (mirrors
|
|
16671
|
+
* `device-provider.getChildCreationSchema` `CreationSchemaOutputSchema`) —
|
|
16672
|
+
* the union is large and not meant for runtime validation here; the exported
|
|
16673
|
+
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
16434
16674
|
*/
|
|
16435
|
-
var
|
|
16436
|
-
|
|
16437
|
-
|
|
16438
|
-
|
|
16439
|
-
|
|
16440
|
-
/**
|
|
16441
|
-
|
|
16442
|
-
|
|
16443
|
-
|
|
16444
|
-
|
|
16445
|
-
"package-event"
|
|
16446
|
-
]);
|
|
16447
|
-
/** Subject summary frozen on the row at fire time (survives rule/record edits). */
|
|
16448
|
-
var NcHistorySubjectSchema = object({
|
|
16449
|
-
className: string(),
|
|
16450
|
-
label: string().optional(),
|
|
16451
|
-
confidence: number().optional(),
|
|
16452
|
-
zones: array(string()),
|
|
16453
|
-
timestamp: number()
|
|
16675
|
+
var ConfigSchemaPassthrough = unknown();
|
|
16676
|
+
var TargetKindSchema = object({
|
|
16677
|
+
kind: string(),
|
|
16678
|
+
label: string(),
|
|
16679
|
+
icon: string(),
|
|
16680
|
+
/** Stamped by each provider so the concat-fanned catalog stays routable. */
|
|
16681
|
+
addonId: string(),
|
|
16682
|
+
configSchema: ConfigSchemaPassthrough,
|
|
16683
|
+
supportsDiscovery: boolean(),
|
|
16684
|
+
caps: TargetKindCapsSchema
|
|
16454
16685
|
});
|
|
16455
16686
|
/**
|
|
16456
|
-
*
|
|
16457
|
-
*
|
|
16458
|
-
*
|
|
16459
|
-
* The §3.2 fields map directly: `ruleId`/`targetId`/`deviceId` are columns,
|
|
16460
|
-
* `eventRef` is `recordKind`+`recordId`, `timestamps` are `createdAt`
|
|
16461
|
-
* (fire) / `updatedAt` (last transition), `status` + `error` are the
|
|
16462
|
-
* lifecycle. `ruleName` + `subject` are the intent snapshot frozen at
|
|
16463
|
-
* enqueue. `userId?` (per-recipient history) is P2 — no user dimension in
|
|
16464
|
-
* P1 (admin scope only).
|
|
16687
|
+
* A persisted target. `config` holds secrets; providers REDACT secret fields
|
|
16688
|
+
* (return a presence marker only) when serving `listTargets` — never
|
|
16689
|
+
* round-trip a stored secret to the UI.
|
|
16465
16690
|
*/
|
|
16466
|
-
var
|
|
16467
|
-
/** Outbox row id — the stable dedup id `ruleId:dedupRef:targetId`. */
|
|
16691
|
+
var TargetSchema = object({
|
|
16468
16692
|
id: string(),
|
|
16469
|
-
|
|
16470
|
-
|
|
16471
|
-
|
|
16472
|
-
|
|
16473
|
-
|
|
16474
|
-
targetId: string(),
|
|
16475
|
-
deviceId: number(),
|
|
16476
|
-
recordKind: NcHistoryRecordKindSchema,
|
|
16477
|
-
/** Event / track ref of the evaluated record (§3.2 `eventRef`). */
|
|
16478
|
-
recordId: string(),
|
|
16479
|
-
/** Present for track-scoped deliveries (object-event / track-end). */
|
|
16480
|
-
trackId: string().optional(),
|
|
16481
|
-
status: NcHistoryStatusSchema,
|
|
16482
|
-
/** Delivery attempts made so far. */
|
|
16483
|
-
attempts: number().int(),
|
|
16484
|
-
/** Fire time (outbox enqueue). */
|
|
16485
|
-
createdAt: number(),
|
|
16486
|
-
/** Last transition time (terminal for sent / dead). */
|
|
16487
|
-
updatedAt: number(),
|
|
16488
|
-
/** Failure detail — present on a `dead` row. */
|
|
16489
|
-
error: string().optional(),
|
|
16490
|
-
subject: NcHistorySubjectSchema
|
|
16693
|
+
name: string(),
|
|
16694
|
+
kind: string(),
|
|
16695
|
+
addonId: string(),
|
|
16696
|
+
enabled: boolean(),
|
|
16697
|
+
config: record(string(), unknown())
|
|
16491
16698
|
});
|
|
16492
|
-
/**
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
|
|
16497
|
-
*/
|
|
16498
|
-
var NcHistoryFilterSchema = object({
|
|
16499
|
-
ruleId: string().optional(),
|
|
16500
|
-
deviceId: number().optional(),
|
|
16501
|
-
status: NcHistoryStatusSchema.optional(),
|
|
16502
|
-
since: number().optional(),
|
|
16503
|
-
until: number().optional(),
|
|
16504
|
-
limit: number().int().min(1).max(500).default(100)
|
|
16699
|
+
/** A discovery-surfaced candidate (config is partial + non-secret). */
|
|
16700
|
+
var DiscoveredTargetSchema = object({
|
|
16701
|
+
kind: string(),
|
|
16702
|
+
suggestedName: string(),
|
|
16703
|
+
config: record(string(), unknown())
|
|
16505
16704
|
});
|
|
16506
|
-
|
|
16507
|
-
|
|
16508
|
-
|
|
16509
|
-
|
|
16510
|
-
|
|
16511
|
-
|
|
16512
|
-
|
|
16513
|
-
|
|
16514
|
-
|
|
16515
|
-
|
|
16516
|
-
|
|
16517
|
-
|
|
16518
|
-
|
|
16519
|
-
|
|
16520
|
-
|
|
16521
|
-
|
|
16705
|
+
/** The degrade engine's report — what was resolved / dropped / degraded. */
|
|
16706
|
+
var RenderedAsSchema = object({
|
|
16707
|
+
level: string(),
|
|
16708
|
+
format: NotificationFormatSchema,
|
|
16709
|
+
attachmentsSent: number().int().nonnegative(),
|
|
16710
|
+
actionsSent: number().int().nonnegative(),
|
|
16711
|
+
truncated: boolean(),
|
|
16712
|
+
dropped: array(string())
|
|
16713
|
+
});
|
|
16714
|
+
var SendResultSchema = object({
|
|
16715
|
+
success: boolean(),
|
|
16716
|
+
error: string().optional(),
|
|
16717
|
+
renderedAs: RenderedAsSchema.optional()
|
|
16718
|
+
});
|
|
16719
|
+
/** Same shape as SendResult — kept as a distinct name for the test panel. */
|
|
16720
|
+
var TestResultSchema = SendResultSchema;
|
|
16721
|
+
method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSchema)), method(object({
|
|
16722
|
+
kind: string(),
|
|
16723
|
+
config: record(string(), unknown()).optional()
|
|
16724
|
+
}), array(DiscoveredTargetSchema)), method(object({
|
|
16725
|
+
targetId: string(),
|
|
16726
|
+
notification: NotificationSchema
|
|
16727
|
+
}), SendResultSchema, { kind: "mutation" }), method(object({
|
|
16728
|
+
targetId: string(),
|
|
16729
|
+
sample: NotificationSchema.optional()
|
|
16730
|
+
}), TestResultSchema, { kind: "mutation" }), method(object({ target: TargetSchema }), TargetSchema, { kind: "mutation" }), method(object({ targetId: string() }), _void(), { kind: "mutation" }), method(object({
|
|
16731
|
+
targetId: string(),
|
|
16522
16732
|
enabled: boolean()
|
|
16523
|
-
}),
|
|
16524
|
-
kind: "mutation",
|
|
16525
|
-
auth: "admin"
|
|
16526
|
-
}), method(object({
|
|
16527
|
-
rule: NcRuleInputSchema,
|
|
16528
|
-
lookbackMinutes: number().int().min(1).max(1440).default(60)
|
|
16529
|
-
}), object({ results: array(NcTestResultSchema) }), {
|
|
16530
|
-
kind: "mutation",
|
|
16531
|
-
auth: "admin"
|
|
16532
|
-
}), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
|
|
16733
|
+
}), _void(), { kind: "mutation" });
|
|
16533
16734
|
/**
|
|
16534
16735
|
* Zod schemas for persisted record types.
|
|
16535
16736
|
*
|
|
@@ -21579,6 +21780,12 @@ Object.freeze({
|
|
|
21579
21780
|
addonId: null,
|
|
21580
21781
|
access: "delete"
|
|
21581
21782
|
},
|
|
21783
|
+
"backup.deleteSchedule": {
|
|
21784
|
+
capName: "backup",
|
|
21785
|
+
capScope: "system",
|
|
21786
|
+
addonId: null,
|
|
21787
|
+
access: "delete"
|
|
21788
|
+
},
|
|
21582
21789
|
"backup.getEntries": {
|
|
21583
21790
|
capName: "backup",
|
|
21584
21791
|
capScope: "system",
|
|
@@ -21609,6 +21816,12 @@ Object.freeze({
|
|
|
21609
21816
|
addonId: null,
|
|
21610
21817
|
access: "view"
|
|
21611
21818
|
},
|
|
21819
|
+
"backup.listSchedules": {
|
|
21820
|
+
capName: "backup",
|
|
21821
|
+
capScope: "system",
|
|
21822
|
+
addonId: null,
|
|
21823
|
+
access: "view"
|
|
21824
|
+
},
|
|
21612
21825
|
"backup.previewSchedule": {
|
|
21613
21826
|
capName: "backup",
|
|
21614
21827
|
capScope: "system",
|
|
@@ -21633,6 +21846,12 @@ Object.freeze({
|
|
|
21633
21846
|
addonId: null,
|
|
21634
21847
|
access: "create"
|
|
21635
21848
|
},
|
|
21849
|
+
"backup.upsertSchedule": {
|
|
21850
|
+
capName: "backup",
|
|
21851
|
+
capScope: "system",
|
|
21852
|
+
addonId: null,
|
|
21853
|
+
access: "create"
|
|
21854
|
+
},
|
|
21636
21855
|
"battery.wakeForStream": {
|
|
21637
21856
|
capName: "battery",
|
|
21638
21857
|
capScope: "device",
|
|
@@ -25467,6 +25686,36 @@ Object.freeze({
|
|
|
25467
25686
|
addonId: null,
|
|
25468
25687
|
access: "create"
|
|
25469
25688
|
},
|
|
25689
|
+
"terminalSession.close": {
|
|
25690
|
+
capName: "terminal-session",
|
|
25691
|
+
capScope: "system",
|
|
25692
|
+
addonId: null,
|
|
25693
|
+
access: "create"
|
|
25694
|
+
},
|
|
25695
|
+
"terminalSession.listProfiles": {
|
|
25696
|
+
capName: "terminal-session",
|
|
25697
|
+
capScope: "system",
|
|
25698
|
+
addonId: null,
|
|
25699
|
+
access: "view"
|
|
25700
|
+
},
|
|
25701
|
+
"terminalSession.listSessions": {
|
|
25702
|
+
capName: "terminal-session",
|
|
25703
|
+
capScope: "system",
|
|
25704
|
+
addonId: null,
|
|
25705
|
+
access: "view"
|
|
25706
|
+
},
|
|
25707
|
+
"terminalSession.openSession": {
|
|
25708
|
+
capName: "terminal-session",
|
|
25709
|
+
capScope: "system",
|
|
25710
|
+
addonId: null,
|
|
25711
|
+
access: "create"
|
|
25712
|
+
},
|
|
25713
|
+
"terminalSession.resize": {
|
|
25714
|
+
capName: "terminal-session",
|
|
25715
|
+
capScope: "system",
|
|
25716
|
+
addonId: null,
|
|
25717
|
+
access: "create"
|
|
25718
|
+
},
|
|
25470
25719
|
"toast.onToast": {
|
|
25471
25720
|
capName: "toast",
|
|
25472
25721
|
capScope: "system",
|