@camstack/addon-pipeline 1.2.6 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/audio-analyzer/index.js +3 -3
  2. package/dist/audio-analyzer/index.mjs +2 -3
  3. package/dist/{chunk-D6vf50IK.js → chunk-emK7D4bc.js} +7 -0
  4. package/dist/detection-pipeline/index.js +104 -8
  5. package/dist/detection-pipeline/index.mjs +103 -8
  6. package/dist/{dist-Bh0H8jM6.js → dist-DNjy_sr4.js} +1374 -925
  7. package/dist/{dist-Bw_V5L0r.mjs → dist-owmpaeIY.mjs} +1379 -924
  8. package/dist/fmp4-keyframes-BzTPoPVn.js +6676 -0
  9. package/dist/fmp4-keyframes-qOgJBjMO.mjs +6669 -0
  10. package/dist/{sheet-geometry-DcpuGTCm.mjs → hub-hostname-DAJXlOgV.js} +6 -39
  11. package/dist/{sheet-geometry-BR-ip0CP.js → hub-hostname-cCknRYKj.mjs} +1 -56
  12. package/dist/{model-download-service-Cp9f4dk6-CwUb5v3Y.mjs → model-download-service-Cp9f4dk6-WO-foD7W.mjs} +26 -1
  13. package/dist/{model-download-service-Cp9f4dk6-Dv-oFwjN.js → model-download-service-Cp9f4dk6-fsdDExML.js} +1 -1
  14. package/dist/motion-wasm/index.js +1 -1
  15. package/dist/motion-wasm/index.mjs +1 -1
  16. package/dist/pipeline-runner/index.js +51 -132
  17. package/dist/pipeline-runner/index.mjs +49 -130
  18. package/dist/recorder/index.js +695 -974
  19. package/dist/recorder/index.mjs +694 -972
  20. package/dist/session-decode/decode-worker-child.js +9 -5
  21. package/dist/session-decode/decode-worker-child.mjs +8 -4
  22. package/dist/{step-definitions-xxdpJX9-.js → step-definitions-C2bNlww3.js} +1 -1
  23. package/dist/{step-definitions-aY4D9Loy.mjs → step-definitions-CkvctwuS.mjs} +1 -1
  24. package/dist/stream-broker/_stub.js +2 -2
  25. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DX-Ef8CP.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-XdI0RgvI.mjs} +2 -2
  26. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DSfbOjdi.mjs +26 -0
  27. package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BdxY9zld.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js--zEZtV2N.mjs} +1 -1
  28. package/dist/stream-broker/{hostInit-DUL71Vjq.mjs → hostInit-DsMIdlwP.mjs} +2 -2
  29. package/dist/stream-broker/index.js +680 -15
  30. package/dist/stream-broker/index.mjs +679 -15
  31. package/dist/stream-broker/remoteEntry.js +1 -1
  32. package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-CGWEeRkz.js → MaskShapeCanvas-DI4BY7W2-CftzR7Pj.js} +1 -1
  33. package/embed-dist/assets/{MotionZonesSettings-NcxxQN8r-4YbTa3Wp.js → MotionZonesSettings-NcxxQN8r-DPgVIdEn.js} +1 -1
  34. package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-DL_tAs9-.js → PrivacyMaskSettings-APgPLF7p-D0HqiXHW.js} +1 -1
  35. package/embed-dist/assets/{index-CvBwcYl_.js → index-DRtbV_en.js} +17 -15
  36. package/embed-dist/index.html +1 -1
  37. package/package.json +1 -1
  38. package/python/postprocessors/ctc.py +14 -5
  39. package/python/postprocessors/test_ctc.py +35 -0
  40. package/dist/chunk-BdkLduGY.mjs +0 -5
  41. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-gchR4WlX.mjs +0 -26
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-D4HJq7Mw.mjs
1
+ //#region ../types/dist/event-category-BLcNejAE.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -148,9 +148,6 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
148
148
  EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
149
149
  EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
150
150
  EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
151
- /** Runner-sampled scrub thumbnail (~1/5 s/camera). Telemetry (D8): a lost
152
- * thumb is a scrub gap the recorder's keyframe backfill covers. */
153
- EventCategory["RecordingThumbSampled"] = "recording.thumb-sampled";
154
151
  /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
155
152
  * progress bar the client reconciles via `recordingExport.getExport`. */
156
153
  EventCategory["RecordingExportProgress"] = "recording.export.progress";
@@ -6915,7 +6912,6 @@ object({ deviceId: number() }), object({ deviceId: number() }), object({
6915
6912
  patch: record(string(), unknown())
6916
6913
  }), object({ success: literal(true) });
6917
6914
  object({ deviceId: number() }), unknown().nullable();
6918
- /** Shorthand to define a method schema */
6919
6915
  function method(input, output, options) {
6920
6916
  return {
6921
6917
  input,
@@ -6923,6 +6919,7 @@ function method(input, output, options) {
6923
6919
  kind: options?.kind ?? "query",
6924
6920
  auth: options?.auth ?? "protected",
6925
6921
  ...options?.access !== void 0 ? { access: options.access } : {},
6922
+ ...options?.caller !== void 0 ? { caller: options.caller } : {},
6926
6923
  timeoutMs: options?.timeoutMs
6927
6924
  };
6928
6925
  }
@@ -7451,47 +7448,6 @@ var ScrubThumbnailPresetSchema = _enum([
7451
7448
  "max"
7452
7449
  ]);
7453
7450
  /**
7454
- * Preset → tile geometry + JPEG quality. Every step is 16:9; the graduated
7455
- * ladder trades sheet size (and remote fetch cost) for scrub crispness.
7456
- * `standard` matches the shipped `sheet-geometry`/`sheet-composer` defaults
7457
- * (480×270 q72), so an unset config is byte-identical to today. The map is
7458
- * strictly monotone in resolution AND quality across the ordered steps.
7459
- */
7460
- var SCRUB_THUMBNAIL_PRESETS = {
7461
- minimal: {
7462
- tileWidth: 240,
7463
- tileHeight: 135,
7464
- quality: 55
7465
- },
7466
- low: {
7467
- tileWidth: 320,
7468
- tileHeight: 180,
7469
- quality: 60
7470
- },
7471
- standard: {
7472
- tileWidth: 480,
7473
- tileHeight: 270,
7474
- quality: 72
7475
- },
7476
- high: {
7477
- tileWidth: 640,
7478
- tileHeight: 360,
7479
- quality: 80
7480
- },
7481
- max: {
7482
- tileWidth: 960,
7483
- tileHeight: 540,
7484
- quality: 85
7485
- }
7486
- };
7487
- /**
7488
- * Resolve the geometry for a recording config's scrub-thumbnail preset,
7489
- * defaulting to `standard` when unset. Pure — no I/O.
7490
- */
7491
- function resolveScrubThumbnailGeometry(preset) {
7492
- return SCRUB_THUMBNAIL_PRESETS[preset ?? "standard"];
7493
- }
7494
- /**
7495
7451
  * The full per-camera recording intent — the wire shape of a RecordingTarget.
7496
7452
  *
7497
7453
  * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
@@ -8807,6 +8763,59 @@ for (const l of AUDIO_MACRO_LABELS) {
8807
8763
  /** The complete taxonomy dictionary, keyed by kind. */
8808
8764
  var EVENT_TAXONOMY = Object.freeze(Object.fromEntries(entries));
8809
8765
  /**
8766
+ * Notification-Center taxonomy — the fixed vocabulary the NC rule editor
8767
+ * offers as pickers instead of free text. Derived (never hand-listed) from the
8768
+ * single `EVENT_TAXONOMY` dictionary so it stays in lockstep with every other
8769
+ * taxonomy surface (timeline, filters, event page).
8770
+ *
8771
+ * Three buckets, mapped onto the rule editor's `stringList` conditions:
8772
+ * - `videoClasses` → detection classes (person / vehicle / animal + subs)
8773
+ * for the `classes` / `classesExclude` conditions.
8774
+ * - `audioKinds` → audio-analyzer sub kinds (`audio-scream`, …) shown in
8775
+ * the same class picker, grouped under an Audio header.
8776
+ * - `labels` → sensor + control taxonomy kinds (doorbell / contact /
8777
+ * lock / …) for the `sensorKinds` device-event condition.
8778
+ *
8779
+ * Each entry carries `parentKind` so the client can group video subs under
8780
+ * their macro and sensor/control kinds under their category. This surface is
8781
+ * served ADDITIVELY on the `nc.getConditionCatalog` bridge response — no cap
8782
+ * method, no codegen — so it ships train-free with an addon deploy.
8783
+ */
8784
+ /** One selectable taxonomy value: a stable kind id + display label + parent. */
8785
+ var NcTaxonomyEntrySchema = object({
8786
+ /** Stable kind id (e.g. 'person', 'car', 'audio-scream', 'doorbell'). */
8787
+ kind: string(),
8788
+ /** English fallback label (the UI translates via the event-kind i18n key). */
8789
+ label: string(),
8790
+ /** Macro/category parent for grouping ('car' → 'vehicle'); null for a top. */
8791
+ parentKind: string().nullable()
8792
+ });
8793
+ object({
8794
+ videoClasses: array(NcTaxonomyEntrySchema),
8795
+ audioKinds: array(NcTaxonomyEntrySchema),
8796
+ labels: array(NcTaxonomyEntrySchema)
8797
+ });
8798
+ function toEntry(kind, label, parentKind) {
8799
+ return {
8800
+ kind,
8801
+ label,
8802
+ parentKind
8803
+ };
8804
+ }
8805
+ /**
8806
+ * Build the NC taxonomy from `EVENT_TAXONOMY`. Insertion order is preserved
8807
+ * (macros before their subs), which the client relies on for stable grouping.
8808
+ */
8809
+ function buildNcTaxonomy() {
8810
+ const all = Object.values(EVENT_TAXONOMY);
8811
+ return {
8812
+ videoClasses: all.filter((e) => e.category === "detection").map((e) => toEntry(e.kind, e.label, e.parentKind)),
8813
+ audioKinds: all.filter((e) => e.category === "audio" && e.level === "sub").map((e) => toEntry(e.kind, e.label, e.parentKind)),
8814
+ labels: all.filter((e) => e.category === "sensor" || e.category === "control").map((e) => toEntry(e.kind, e.label, e.parentKind))
8815
+ };
8816
+ }
8817
+ Object.freeze(buildNcTaxonomy());
8818
+ /**
8810
8819
  * Error types for the safe expression engine. Two distinct classes so callers
8811
8820
  * can tell a compile-time (grammar) failure from a runtime (evaluation)
8812
8821
  * failure — both are non-fatal to the host: read paths degrade to "skip link".
@@ -14685,94 +14694,6 @@ var EnrichedWidgetMetadataSchema = WidgetMetadataSchema.extend({
14685
14694
  bundleUrl: string()
14686
14695
  });
14687
14696
  method(_void(), array(EnrichedWidgetMetadataSchema).readonly());
14688
- var NotificationRuleConditionsSchema = object({
14689
- deviceIds: array(number()).readonly().optional(),
14690
- classNames: array(string()).readonly().optional(),
14691
- zoneIds: array(string()).readonly().optional(),
14692
- minConfidence: number().optional(),
14693
- source: _enum([
14694
- "pipeline",
14695
- "onboard",
14696
- "any"
14697
- ]).optional(),
14698
- schedule: object({
14699
- days: array(number()).readonly(),
14700
- startHour: number(),
14701
- endHour: number()
14702
- }).optional(),
14703
- cooldownSeconds: number().optional(),
14704
- minDwellSeconds: number().optional(),
14705
- /** Match against `event.data.eventType` token (e.g. `'press_long'`). When non-empty, only events
14706
- * carrying a matching `data.eventType` string pass this condition. Rules without this field are
14707
- * unaffected (back-compat). Distinct from `rule.eventTypes` which holds EventCategory strings. */
14708
- eventTypeTokens: array(string()).readonly().optional(),
14709
- /** Match detections whose CLIP image embedding is semantically similar to this free-text
14710
- * description. Requires the embedding-encoder cap to have pre-warmed the text vector.
14711
- * `minSimilarity` is the cosine similarity threshold in [0, 1]. */
14712
- clipDescription: object({
14713
- text: string().min(1),
14714
- minSimilarity: number().min(0).max(1)
14715
- }).optional(),
14716
- /** Match events whose recognized-entity label (face identity name or plate
14717
- * vehicle name, propagated onto `event.data.label`) is one of these values.
14718
- * Empty/absent → unaffected (back-compat). Enables "notify me when <named
14719
- * vehicle/person> is seen". */
14720
- labels: array(string()).readonly().optional()
14721
- });
14722
- var NotificationRuleTemplateSchema = object({
14723
- title: string(),
14724
- body: string(),
14725
- imageMode: _enum([
14726
- "crop",
14727
- "annotated",
14728
- "full",
14729
- "none"
14730
- ])
14731
- });
14732
- var NotificationRuleSchema = object({
14733
- id: string(),
14734
- name: string(),
14735
- enabled: boolean(),
14736
- eventTypes: array(string()).readonly(),
14737
- conditions: NotificationRuleConditionsSchema,
14738
- outputs: array(string()).readonly(),
14739
- template: NotificationRuleTemplateSchema.optional(),
14740
- priority: _enum([
14741
- "low",
14742
- "normal",
14743
- "high",
14744
- "critical"
14745
- ])
14746
- });
14747
- var NotificationTestResultSchema = object({
14748
- ruleId: string(),
14749
- eventId: string(),
14750
- timestamp: number(),
14751
- wouldFire: boolean(),
14752
- reason: string().optional()
14753
- });
14754
- var NotificationHistoryEntrySchema = object({
14755
- id: string(),
14756
- ruleId: string(),
14757
- ruleName: string(),
14758
- eventId: string(),
14759
- timestamp: number(),
14760
- outputs: array(string()).readonly(),
14761
- success: boolean(),
14762
- error: string().optional(),
14763
- deviceId: number().optional()
14764
- });
14765
- var NotificationHistoryFilterSchema = object({
14766
- ruleId: string().optional(),
14767
- deviceId: number().optional(),
14768
- from: number().optional(),
14769
- to: number().optional(),
14770
- limit: number().optional()
14771
- });
14772
- method(_void(), object({ rules: array(NotificationRuleSchema).readonly() })), method(object({ rule: NotificationRuleSchema }), object({ success: literal(true) }), { kind: "mutation" }), method(object({ ruleId: string() }), object({ success: literal(true) }), { kind: "mutation" }), method(object({
14773
- ruleId: string(),
14774
- lookbackMinutes: number()
14775
- }), object({ results: array(NotificationTestResultSchema).readonly() }), { kind: "mutation" }), method(object({ filter: NotificationHistoryFilterSchema.optional() }), object({ entries: array(NotificationHistoryEntrySchema).readonly() }));
14776
14697
  /**
14777
14698
  * Alerts capability — collection-based internal alert system.
14778
14699
  *
@@ -15044,89 +14965,6 @@ method(object({
15044
14965
  password: string()
15045
14966
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
15046
14967
  /**
15047
- * `login-method` — collection cap through which auth addons contribute
15048
- * their pre-auth login surfaces to the login page. This is the SINGLE,
15049
- * generic mechanism that supersedes the dead `auth.listProviders` reader:
15050
- * every auth addon (OIDC, magic-link, WebAuthn/passkey) registers a
15051
- * `login-method` provider and the PUBLIC `auth.listLoginMethods`
15052
- * procedure aggregates them for the unauthenticated login page.
15053
- *
15054
- * A contribution is a discriminated union on `kind`:
15055
- *
15056
- * - `redirect` — a declarative button. The login page renders a generic
15057
- * button that navigates to `startUrl` (an addon-owned HTTP route).
15058
- * Covers OIDC (`/addon/auth-oidc/<id>/start`) and magic-link with
15059
- * ZERO shell-side JS. A future SSO addon plugs in the same way — the
15060
- * login page needs NO change.
15061
- *
15062
- * - `widget` — a Module-Federation widget the login page mounts (via
15063
- * `loadRemoteBundle`) for an in-page ceremony. `auth.listLoginMethods`
15064
- * stamps a public `bundleUrl` from `addonId` + `bundle`. Generic
15065
- * mechanism kept for future use; no shipped addon uses it on the login
15066
- * page (the passkey ceremony below runs natively in the shell instead).
15067
- *
15068
- * - `passkey` — a declarative WebAuthn ceremony the shell renders
15069
- * natively (`@simplewebauthn/browser` lives in `addon-admin-ui`, not in
15070
- * a remotely-loaded bundle). Carries the addon's effective `rpId` /
15071
- * `origin` (from its `resolveRpID()` / `resolveOrigin()`) so the shell
15072
- * can gate visibility (IP-literal origin, hostname/rpId mismatch) WITHOUT
15073
- * fetching any remote code pre-auth. Contribution stays unconditional —
15074
- * enrollment state is never leaked pre-auth; visibility is a shell
15075
- * decision.
15076
- *
15077
- * Every contribution carries a `stage`:
15078
- * - `primary` — shown on the first credentials screen (OIDC /
15079
- * magic-link buttons; a future usernameless passkey).
15080
- * - `second-factor` — shown AFTER the password leg, gated on the
15081
- * returned `factors` (passkey-as-2FA today).
15082
- *
15083
- * `mount: skip` — the cap is read server-side by the core auth router
15084
- * (`registry.getCollection('login-method')`), never mounted as its own
15085
- * tRPC router.
15086
- */
15087
- /** When a login method renders in the two-phase login flow. */
15088
- var LoginStageEnum = _enum(["primary", "second-factor"]);
15089
- /** One login-method contribution — redirect button, pre-auth widget, or native passkey ceremony. */
15090
- var LoginMethodContributionSchema = discriminatedUnion("kind", [
15091
- object({
15092
- kind: literal("redirect"),
15093
- /** Stable id within the login-method set (e.g. `auth-oidc/google`). */
15094
- id: string(),
15095
- /** Operator-facing button label. */
15096
- label: string(),
15097
- /** lucide-react icon name. */
15098
- icon: string().optional(),
15099
- /** Addon-owned HTTP route the button navigates to (GET). */
15100
- startUrl: string(),
15101
- stage: LoginStageEnum
15102
- }),
15103
- object({
15104
- kind: literal("widget"),
15105
- /** Stable id within the login-method set (e.g. `auth-webauthn/passkey-login`). */
15106
- id: string(),
15107
- /** Owning addon id — drives the public bundle URL + the MF namespace. */
15108
- addonId: string(),
15109
- /** Bundle filename inside the addon's dist dir (`remoteEntry.js`). */
15110
- bundle: string(),
15111
- /** MF remote descriptor — `{ remoteName, exposedModule, componentKey }`. */
15112
- remote: WidgetRemoteSchema,
15113
- stage: LoginStageEnum
15114
- }),
15115
- object({
15116
- kind: literal("passkey"),
15117
- /** Stable id within the login-method set (e.g. `auth-webauthn/passkey-direct-login`). */
15118
- id: string(),
15119
- /** Operator-facing button label. */
15120
- label: string(),
15121
- stage: LoginStageEnum,
15122
- /** Effective WebAuthn RP ID (`resolveRpID()`) — the shell gates visibility on it. */
15123
- rpId: string(),
15124
- /** Effective expected origin (`resolveOrigin()`), null when unconfigured. */
15125
- origin: string().nullable()
15126
- })
15127
- ]);
15128
- method(_void(), array(LoginMethodContributionSchema).readonly());
15129
- /**
15130
14968
  * Orchestrator-side destination metadata. The orchestrator computes
15131
14969
  * `id = <addonId>:<subId>` from its provider lookup so consumers
15132
14970
  * (admin UI, restore flow) see one canonical key.
@@ -15500,7 +15338,8 @@ function customAction(input, output, options) {
15500
15338
  output,
15501
15339
  kind: options?.kind ?? "query",
15502
15340
  auth: options?.auth ?? "protected",
15503
- scope: options?.scope ?? { kind: "system" }
15341
+ scope: options?.scope ?? { kind: "system" },
15342
+ ...options?.caller ? { caller: "required" } : {}
15504
15343
  };
15505
15344
  }
15506
15345
  /**
@@ -16522,376 +16361,751 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
16522
16361
  kind: "mutation",
16523
16362
  auth: "admin"
16524
16363
  });
16525
- var LogLevelSchema = _enum([
16526
- "debug",
16527
- "info",
16528
- "warn",
16529
- "error"
16364
+ /**
16365
+ * Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
16366
+ * surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
16367
+ * caps stay wire-compatible without a circular cap→cap import.
16368
+ *
16369
+ * Errors are a discriminated-union RESULT, never thrown: the shape survives
16370
+ * every transport tier structurally, and failed calls still write usage rows.
16371
+ * Token counts only in v1 — no costUsd (operator decision, 2026-07-15).
16372
+ */
16373
+ var LlmUsageSchema = object({
16374
+ inputTokens: number(),
16375
+ outputTokens: number()
16376
+ });
16377
+ var LlmErrorCodeSchema = _enum([
16378
+ "timeout",
16379
+ "rate-limited",
16380
+ "auth",
16381
+ "refusal",
16382
+ "bad-request",
16383
+ "unavailable",
16384
+ "no-profile",
16385
+ "budget-exceeded",
16386
+ "adapter-error"
16530
16387
  ]);
16531
- var LogEntrySchema = object({
16532
- timestamp: date(),
16533
- level: LogLevelSchema,
16534
- scope: array(string()),
16388
+ var LlmGenerateResultSchema = discriminatedUnion("ok", [object({
16389
+ ok: literal(true),
16390
+ text: string(),
16391
+ model: string(),
16392
+ usage: LlmUsageSchema,
16393
+ truncated: boolean(),
16394
+ latencyMs: number()
16395
+ }), object({
16396
+ ok: literal(false),
16397
+ code: LlmErrorCodeSchema,
16535
16398
  message: string(),
16536
- meta: record(string(), unknown()).optional(),
16537
- tags: record(string(), string()).optional()
16538
- });
16539
- method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
16540
- scope: array(string()).optional(),
16541
- level: LogLevelSchema.optional(),
16542
- since: date().optional(),
16543
- until: date().optional(),
16544
- limit: number().optional(),
16545
- tags: record(string(), string()).optional()
16546
- }), array(LogEntrySchema).readonly());
16547
- var CpuBreakdownSchema = object({
16548
- total: number(),
16549
- user: number(),
16550
- system: number(),
16551
- irq: number(),
16552
- nice: number(),
16553
- loadAvg: tuple([
16554
- number(),
16555
- number(),
16556
- number()
16557
- ]),
16558
- cores: number()
16559
- });
16560
- var MemoryInfoSchema = object({
16561
- percent: number(),
16562
- totalBytes: number(),
16563
- usedBytes: number(),
16564
- availableBytes: number(),
16565
- swapUsedBytes: number(),
16566
- swapTotalBytes: number()
16399
+ retryAfterMs: number().optional()
16400
+ })]);
16401
+ /**
16402
+ * `Uint8Array` is the sanctioned binary convention — superjson + the UDS
16403
+ * MsgPack channel round-trip typed arrays (embedding-encoder.cap.ts:29,
16404
+ * notification-output.cap.ts:27-31 precedents).
16405
+ */
16406
+ var LlmImageSchema = object({
16407
+ bytes: _instanceof(Uint8Array),
16408
+ mimeType: string()
16567
16409
  });
16568
- var DiskIoSnapshotSchema = object({
16569
- readBytes: number(),
16570
- writeBytes: number(),
16571
- readOps: number(),
16572
- writeOps: number(),
16573
- timestampMs: number()
16410
+ var LlmGenerateBaseInputSchema = object({
16411
+ /** Collection routing (the notification-output posture). */
16412
+ addonId: string().optional(),
16413
+ /** Explicit profile; else the resolution chain (spec §3). */
16414
+ profileId: string().optional(),
16415
+ /** MANDATORY usage tag: 'ai-summary', 'notifier-rules', 'adhoc-ui', … */
16416
+ consumer: string(),
16417
+ system: string().optional(),
16418
+ /** v1: single-turn. `messages[]` is a v2 additive field. */
16419
+ prompt: string(),
16420
+ /** Structured output — adapter-mapped (response_format / forced tool / responseSchema). */
16421
+ jsonSchema: record(string(), unknown()).optional(),
16422
+ /** Per-call override of the profile default. */
16423
+ maxTokens: number().int().positive().optional(),
16424
+ temperature: number().optional()
16574
16425
  });
16575
- var NetworkIoSnapshotSchema = object({
16576
- rxBytes: number(),
16577
- txBytes: number(),
16578
- rxPackets: number(),
16579
- txPackets: number(),
16580
- rxErrors: number(),
16581
- txErrors: number(),
16582
- timestampMs: number()
16583
- });
16584
- var MetricsGpuInfoSchema = object({
16585
- utilization: number(),
16586
- model: string(),
16587
- memoryUsedBytes: number(),
16588
- memoryTotalBytes: number(),
16589
- temperature: number().nullable()
16590
- });
16591
- var ProcessResourceInfoSchema = object({
16592
- openFds: number(),
16593
- threadCount: number(),
16594
- activeHandles: number(),
16595
- activeRequests: number()
16596
- });
16597
- var PressureAvgsSchema = object({
16598
- avg10: number(),
16599
- avg60: number(),
16600
- avg300: number()
16601
- });
16602
- var PressureInfoSchema = object({
16603
- some: PressureAvgsSchema,
16604
- full: PressureAvgsSchema.nullable()
16605
- });
16606
- var SystemResourceSnapshotSchema = object({
16607
- cpu: CpuBreakdownSchema,
16608
- memory: MemoryInfoSchema,
16609
- gpu: MetricsGpuInfoSchema.nullable(),
16610
- network: NetworkIoSnapshotSchema,
16611
- disk: DiskIoSnapshotSchema,
16612
- pressure: object({
16613
- cpu: PressureInfoSchema.nullable(),
16614
- memory: PressureInfoSchema.nullable(),
16615
- io: PressureInfoSchema.nullable()
16426
+ /**
16427
+ * `llm-runtime` — node-side managed llama.cpp executor (spec §4). Registered
16428
+ * on EVERY node where `addon-ai` is installed; the hub `llm` provider reaches
16429
+ * a specific node's runtime with `nodePin(profile.runtime.nodeId)` — normal
16430
+ * cap routing, zero bespoke plumbing. `internal: true`: the operator reaches
16431
+ * this only through the `llm` cap's methods.
16432
+ *
16433
+ * One running llama-server child per node in v1 (models are RAM-heavy).
16434
+ * Resource ceiling = llama-server flags + idleStopMinutes ONLY (no RSS
16435
+ * watchdog operator decision #3).
16436
+ */
16437
+ var ManagedModelRefSchema = discriminatedUnion("kind", [
16438
+ object({
16439
+ kind: literal("catalog"),
16440
+ catalogId: string()
16616
16441
  }),
16617
- process: ProcessResourceInfoSchema,
16618
- cpuTemperature: number().nullable(),
16619
- timestampMs: number()
16620
- });
16621
- var DiskSpaceInfoSchema = object({
16622
- path: string(),
16623
- totalBytes: number(),
16624
- usedBytes: number(),
16625
- availableBytes: number(),
16626
- percent: number()
16627
- });
16628
- var PidResourceStatsSchema = object({
16629
- pid: number(),
16630
- cpu: number(),
16631
- memory: number(),
16632
- /**
16633
- * Private (anonymous) resident bytes — the per-process V8 heap + native
16634
- * allocations NOT shared with other processes (Linux RssAnon). This is the
16635
- * "real" per-runner cost; summing it across runners is meaningful, unlike
16636
- * `memory` (RSS), which double-counts the shared mmap'd framework code.
16637
- * Undefined where /proc is unavailable (e.g. macOS).
16638
- */
16639
- privateBytes: number().optional(),
16640
- /**
16641
- * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
16642
- * code shared copy-on-write across runners. Undefined on macOS.
16643
- */
16644
- sharedBytes: number().optional()
16442
+ object({
16443
+ kind: literal("url"),
16444
+ url: string(),
16445
+ sha256: string().optional()
16446
+ }),
16447
+ object({
16448
+ kind: literal("path"),
16449
+ path: string()
16450
+ })
16451
+ ]);
16452
+ var ManagedRuntimeConfigSchema = object({
16453
+ /** WHERE the runtime lives — hub or any agent. */
16454
+ nodeId: string(),
16455
+ /** Closed for v1; 'ollama' is a v2 candidate. */
16456
+ engine: _enum(["llama-cpp"]),
16457
+ model: ManagedModelRefSchema,
16458
+ contextSize: number().int().default(4096),
16459
+ /** 0 = CPU-only. */
16460
+ gpuLayers: number().int().default(0),
16461
+ /** Default: cpus-2, clamped ≥1 (resolved node-side). */
16462
+ threads: number().int().optional(),
16463
+ /** Concurrent slots. */
16464
+ parallel: number().int().default(1),
16465
+ /** Else lazy: first generate boots it. */
16466
+ autoStart: boolean().default(false),
16467
+ /** 0 = never; frees RAM after quiet periods. */
16468
+ idleStopMinutes: number().int().default(30)
16645
16469
  });
16646
- var AddonInstanceSchema = object({
16647
- addonId: string(),
16470
+ var LlmRuntimeStatusSchema = object({
16471
+ /** Status is ALWAYS node-qualified. */
16648
16472
  nodeId: string(),
16649
- role: _enum(["hub", "worker"]),
16650
- pid: number(),
16651
16473
  state: _enum([
16652
- "starting",
16653
- "running",
16654
- "stopping",
16655
16474
  "stopped",
16656
- "crashed"
16657
- ]),
16658
- uptimeSec: number()
16659
- });
16660
- var NodeProcessSchema = object({
16661
- pid: number(),
16662
- ppid: number(),
16663
- pgid: number(),
16664
- classification: _enum([
16665
- "root",
16666
- "managed",
16667
- "system",
16668
- "ghost"
16475
+ "downloading",
16476
+ "starting",
16477
+ "ready",
16478
+ "crashed",
16479
+ "failed"
16669
16480
  ]),
16670
- /** `$process` addon binding when `managed`, else null. */
16671
- addonId: string().nullable(),
16672
- /** Kernel-reported nodeId when the process is a known agent/worker. */
16673
- nodeId: string().nullable(),
16674
- /** Truncated command line. */
16675
- command: string(),
16676
- cpuPercent: number(),
16677
- memoryRssBytes: number(),
16678
- /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
16679
- uptimeSec: number(),
16680
- /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
16681
- orphaned: boolean()
16682
- });
16683
- var KillProcessInputSchema = object({
16684
- pid: number(),
16685
- /** Force = SIGKILL. Default is SIGTERM. */
16686
- force: boolean().optional()
16687
- });
16688
- var KillProcessResultSchema = object({
16689
- success: boolean(),
16690
- reason: string().optional(),
16691
- signal: _enum(["SIGTERM", "SIGKILL"]).optional()
16692
- });
16693
- var DumpHeapSnapshotInputSchema = object({
16694
- /** The addon whose runner should dump a heap snapshot. */
16695
- addonId: string() });
16696
- var DumpHeapSnapshotResultSchema = object({
16697
- success: boolean(),
16698
- /** Path of the written .heapsnapshot inside the runner's container/host. */
16699
- path: string().optional(),
16700
- /** Process pid that was signalled. */
16701
16481
  pid: number().optional(),
16702
- reason: string().optional()
16482
+ port: number().optional(),
16483
+ modelPath: string().optional(),
16484
+ modelId: string().optional(),
16485
+ downloadProgress: number().min(0).max(1).optional(),
16486
+ lastError: string().optional(),
16487
+ crashesInWindow: number(),
16488
+ /** Child RSS (sampled best-effort). */
16489
+ memoryBytes: number().optional(),
16490
+ vramBytes: number().optional()
16703
16491
  });
16704
- var SystemMetricsSchema = object({
16705
- cpuPercent: number(),
16706
- memoryPercent: number(),
16707
- memoryUsedMB: number(),
16708
- memoryTotalMB: number(),
16709
- diskPercent: number().optional(),
16710
- temperature: number().optional(),
16711
- gpuPercent: number().optional(),
16712
- gpuMemoryPercent: number().optional()
16492
+ var LlmNodeModelSchema = object({
16493
+ file: string(),
16494
+ sizeBytes: number(),
16495
+ catalogId: string().optional(),
16496
+ installedAt: number().optional()
16713
16497
  });
16714
- 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, {
16498
+ var LlmRuntimeDiskUsageSchema = object({
16499
+ nodeId: string(),
16500
+ modelsBytes: number(),
16501
+ freeBytes: number().optional()
16502
+ });
16503
+ method(LlmGenerateBaseInputSchema.extend({
16504
+ images: array(LlmImageSchema).optional(),
16505
+ runtime: ManagedRuntimeConfigSchema,
16506
+ /** The managed profile's timeout, threaded by the hub provider. */
16507
+ timeoutMs: number().int().positive().optional()
16508
+ }), LlmGenerateResultSchema, { kind: "mutation" }), method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
16715
16509
  kind: "mutation",
16716
16510
  auth: "admin"
16717
- }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
16511
+ }), method(object({}), _void(), {
16718
16512
  kind: "mutation",
16719
16513
  auth: "admin"
16720
- });
16721
- method(object({
16722
- sourceUrl: string(),
16723
- metadata: ModelConvertMetadataSchema,
16724
- targets: array(ConvertTargetSchema).min(1).readonly(),
16725
- calibrationRef: string().optional(),
16726
- sessionId: string().optional()
16727
- }), ConvertResultSchema, {
16514
+ }), method(object({}), LlmRuntimeStatusSchema), method(object({ model: ManagedModelRefSchema }), _void(), {
16728
16515
  kind: "mutation",
16729
- auth: "admin",
16730
- timeoutMs: 6e5
16731
- });
16732
- method(object({
16733
- nodeId: string(),
16734
- modelId: string(),
16735
- format: _enum(MODEL_FORMATS),
16736
- entry: ModelCatalogEntrySchema
16737
- }), object({
16738
- ok: boolean(),
16739
- /** sha256 of the staged tarball (empty for a hub-local no-op). */
16740
- sha256: string(),
16741
- bytes: number(),
16742
- /** The target node's modelsDir the artifact landed in. */
16743
- path: string()
16744
- }), {
16516
+ auth: "admin"
16517
+ }), method(object({ file: string() }), _void(), {
16745
16518
  kind: "mutation",
16746
16519
  auth: "admin"
16747
- });
16520
+ }), method(object({}), array(LlmNodeModelSchema)), method(object({}), LlmRuntimeDiskUsageSchema);
16748
16521
  /**
16749
- * `mqtt-broker` — broker-registry cap.
16750
- *
16751
- * NOT a pub/sub proxy. The cap exposes (a) a registry of configured
16752
- * MQTT brokers (external + optionally an embedded `aedes`-backed one)
16753
- * and (b) the connection details a consumer addon needs to spin up
16754
- * its OWN `mqtt.js` client.
16755
- *
16756
- * Why: pub/sub routing over the system event-bus loses fidelity
16757
- * (callback shape, QoS guarantees, will/retain semantics) and adds
16758
- * refcount bookkeeping that addons would rather own themselves. The
16759
- * canonical consumer (`addon-export-ha-mqtt`) needs raw `mqtt.js`
16760
- * features anyway — give it the connection config, get out of the way.
16522
+ * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
16523
+ * methods concat-fan across providers; single-row methods route to ONE
16524
+ * provider by the `addonId` in the call input (the notification-output
16525
+ * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
16526
+ * (hub-placed); the cap stays open for future providers.
16761
16527
  *
16762
- * Consumer flow:
16763
- * const cfg = await ctx.api.mqttBroker.getBrokerConfig({ id })
16764
- * const client = mqtt.connect(cfg.url, { username: cfg.username, })
16765
- * client.subscribe('zigbee2mqtt/+')
16766
- *
16767
- * Collection mode: multiple brokers (e.g. one local mosquitto + one
16768
- * cloud bridge). The "embedded" entry (when present) is just another
16769
- * broker in the registry — its lifecycle is owned by the addon that
16770
- * spawned it.
16771
- */
16772
- var BrokerKindSchema = _enum(["external", "embedded"]);
16773
- /**
16774
- * Broker live-probe status.
16775
- *
16776
- * - `connected` — last probe completed a clean CONNACK
16777
- * - `disconnected` — no probe has run yet (cold cache)
16778
- * - `auth-failed` — CONNACK refused with auth error (RC 4 / 5)
16779
- * - `unreachable` — TCP connect timed out / refused
16780
- * - `tls-error` — TLS handshake failed (cert / SNI / cipher)
16528
+ * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
16529
+ * `apiKey` is a password field — providers REDACT it on read and merge on
16530
+ * write; a stored key NEVER round-trips to a client.
16781
16531
  */
16782
- var BrokerStatusSchema$1 = _enum([
16783
- "connected",
16784
- "disconnected",
16785
- "auth-failed",
16786
- "unreachable",
16787
- "tls-error"
16532
+ var LlmProfileKindSchema = _enum([
16533
+ "openai-compatible",
16534
+ "openai",
16535
+ "anthropic",
16536
+ "google",
16537
+ "managed-local"
16788
16538
  ]);
16789
- var BrokerInfoSchema = object({
16539
+ var LlmProfileSchema = object({
16790
16540
  id: string(),
16791
16541
  name: string(),
16792
- url: string(),
16793
- kind: BrokerKindSchema,
16794
- status: BrokerStatusSchema$1,
16795
- latencyMs: number().nullable(),
16796
- error: string().optional(),
16797
- /** Embedded brokers only: number of MQTT clients currently connected. */
16798
- connectedClients: number().int().nonnegative().optional(),
16799
- /** Epoch ms of the last live probe (external) or aedes snapshot (embedded). */
16800
- lastCheckedAt: number().optional()
16542
+ kind: LlmProfileKindSchema,
16543
+ /** Stamped by the provider — keeps the fanned catalog routable. */
16544
+ addonId: string(),
16545
+ enabled: boolean(),
16546
+ /** Vendor model id, or the managed runtime's loaded model. */
16547
+ model: string(),
16548
+ /** Required for openai-compatible; override for cloud kinds. */
16549
+ baseUrl: string().optional(),
16550
+ /** ConfigUISchema type:'password' — never round-trips (spec §5). */
16551
+ apiKey: string().optional(),
16552
+ supportsVision: boolean(),
16553
+ temperature: number().min(0).max(2).optional(),
16554
+ maxTokens: number().int().positive().optional(),
16555
+ timeoutMs: number().int().positive().default(6e4),
16556
+ extraHeaders: record(string(), string()).optional(),
16557
+ /** kind === 'managed-local' only (spec §4). */
16558
+ runtime: ManagedRuntimeConfigSchema.optional()
16801
16559
  });
16802
- /**
16803
- * Connection details — what a consumer needs to call
16804
- * `mqtt.connect(url, options)`. We split URL + credentials so the
16805
- * consumer can pass them as `mqtt.connect(url, { username, password })`
16806
- * instead of stuffing creds into the URL (which leaks them into logs).
16807
- */
16808
- var BrokerConnectionDetailsSchema = object({
16809
- url: string(),
16810
- username: string().optional(),
16811
- password: string().optional(),
16812
- /**
16813
- * Suggested prefix for `clientId`. Each consumer should suffix this
16814
- * with its own discriminator (addon id, instance id) so reconnects
16815
- * don't kick each other off (MQTT spec: clientId must be unique per
16816
- * broker).
16817
- */
16818
- clientIdPrefix: string().optional()
16560
+ /** ConfigUISchema tree passed through untyped on the wire (the
16561
+ * notification-output `ConfigSchemaPassthrough` precedent at
16562
+ * notification-output.cap.ts:151); the exported TS type re-tightens it. */
16563
+ var ConfigSchemaPassthrough$1 = unknown();
16564
+ var LlmProfileKindDescriptorSchema = object({
16565
+ kind: LlmProfileKindSchema,
16566
+ label: string(),
16567
+ icon: string(),
16568
+ /** Stamped by each provider so the concat-fanned catalog stays routable. */
16569
+ addonId: string(),
16570
+ configSchema: ConfigSchemaPassthrough$1
16819
16571
  });
16820
- var AddBrokerInputSchema = object({
16821
- name: string().min(1),
16822
- url: string().regex(/^(mqtt|mqtts|ws|wss):\/\//, "URL must start with mqtt(s):// or ws(s)://"),
16823
- username: string().optional(),
16824
- password: string().optional(),
16825
- clientIdPrefix: string().optional()
16572
+ var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
16573
+ var LlmDefaultSchema = object({
16574
+ selector: LlmDefaultSelectorSchema,
16575
+ profileId: string()
16826
16576
  });
16827
- var AddBrokerResultSchema = object({ id: string() });
16828
- var IdInputSchema = object({ id: string() });
16829
- var TestResultSchema$1 = discriminatedUnion("ok", [object({
16830
- ok: literal(true),
16831
- latencyMs: number()
16832
- }), object({
16833
- ok: literal(false),
16834
- error: string()
16835
- })]);
16836
- var StartEmbeddedInputSchema = object({
16837
- port: number().int().min(1).max(65535).default(1883),
16838
- /** Allow anonymous connect (no username/password). Default: false. */
16839
- allowAnonymous: boolean().default(false),
16840
- /** Optional shared username/password for clients. */
16841
- username: string().optional(),
16842
- password: string().optional()
16577
+ /** Server-side rollup row getUsage never dumps raw call rows (spec §6). */
16578
+ var LlmUsageRollupSchema = object({
16579
+ day: string(),
16580
+ consumer: string(),
16581
+ profileId: string(),
16582
+ calls: number(),
16583
+ okCalls: number(),
16584
+ errorCalls: number(),
16585
+ inputTokens: number(),
16586
+ outputTokens: number(),
16587
+ avgLatencyMs: number()
16843
16588
  });
16844
- var StartEmbeddedResultSchema = object({
16589
+ /** LLM-facing view over the reused ModelCatalogEntry mechanism (spec §4.2). */
16590
+ var ManagedModelCatalogEntrySchema = object({
16845
16591
  id: string(),
16846
- url: string()
16847
- });
16848
- var StatusSchema = object({
16849
- brokerCount: number(),
16850
- embeddedRunning: boolean()
16851
- });
16852
- 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);
16853
- var NetworkEndpointSchema = object({
16592
+ label: string(),
16593
+ family: string(),
16594
+ purpose: _enum(["text", "vision"]),
16854
16595
  url: string(),
16855
- hostname: string(),
16856
- port: number(),
16857
- protocol: _enum(["http", "https"])
16596
+ sha256: string(),
16597
+ sizeBytes: number(),
16598
+ quantization: string(),
16599
+ /** Load-time guidance shown in the picker. */
16600
+ minRamBytes: number(),
16601
+ contextSizeDefault: number().int(),
16602
+ /** Vision models: companion projector file. */
16603
+ mmprojUrl: string().optional()
16858
16604
  });
16859
- var NetworkAccessStatusSchema = object({
16860
- connected: boolean(),
16861
- endpoint: NetworkEndpointSchema.nullable(),
16605
+ var LlmRuntimeNodeSchema = object({
16606
+ nodeId: string(),
16607
+ reachable: boolean(),
16608
+ status: LlmRuntimeStatusSchema.optional(),
16609
+ disk: LlmRuntimeDiskUsageSchema.optional(),
16862
16610
  error: string().optional()
16863
16611
  });
16864
- /**
16865
- * Optional, richer endpoint shape returned by providers that expose
16866
- * MORE than one ingress concurrently (Tailscale Ingress with mixed
16867
- * serve+funnel rules, future ngrok multi-tunnel, …). Each entry carries
16868
- * the originating provider config (mode + sourcePort) so the
16869
- * orchestrator UI can label rows distinctly. Providers that expose only
16870
- * one endpoint just omit `listEndpoints` from their provider impl.
16871
- */
16872
- var NetworkEndpointEntrySchema = NetworkEndpointSchema.extend({
16873
- /**
16874
- * Stable id within the provider — typically `<mode>-<sourcePort>` so
16875
- * the orchestrator can dedupe across `listEndpoints` polls.
16876
- */
16877
- id: string(),
16878
- /** Operator-facing label (mirrors `MeshEndpoint.label`). */
16879
- label: string(),
16880
- /** Optional provider-specific mode tag, used for icon/colour in admin UI. */
16881
- mode: string().optional(),
16882
- /** Originating local port the ingress fronts (informational). */
16883
- sourcePort: number().optional()
16612
+ var GenerateVisionInputSchema = LlmGenerateBaseInputSchema.extend({ images: array(LlmImageSchema).min(1) });
16613
+ var ProfileRefInputSchema = object({
16614
+ addonId: string(),
16615
+ profileId: string()
16884
16616
  });
16885
- method(_void(), NetworkEndpointSchema, { kind: "mutation" }), method(_void(), _void(), { kind: "mutation" }), method(_void(), NetworkEndpointSchema.nullable()), method(_void(), NetworkAccessStatusSchema), method(_void(), array(NetworkEndpointEntrySchema).readonly());
16617
+ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(GenerateVisionInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
16618
+ kind: "mutation",
16619
+ auth: "admin"
16620
+ }), method(ProfileRefInputSchema, _void(), {
16621
+ kind: "mutation",
16622
+ auth: "admin"
16623
+ }), method(ProfileRefInputSchema, LlmGenerateResultSchema, {
16624
+ kind: "mutation",
16625
+ auth: "admin"
16626
+ }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
16627
+ selector: LlmDefaultSelectorSchema,
16628
+ profileId: string().nullable()
16629
+ }), _void(), {
16630
+ kind: "mutation",
16631
+ auth: "admin"
16632
+ }), method(object({
16633
+ since: number().optional(),
16634
+ until: number().optional(),
16635
+ consumer: string().optional(),
16636
+ profileId: string().optional()
16637
+ }), array(LlmUsageRollupSchema)), method(object({}), array(ManagedModelCatalogEntrySchema)), method(object({}), array(LlmRuntimeNodeSchema)), method(object({ nodeId: string() }), array(LlmNodeModelSchema)), method(object({
16638
+ nodeId: string(),
16639
+ model: ManagedModelRefSchema
16640
+ }), _void(), {
16641
+ kind: "mutation",
16642
+ auth: "admin"
16643
+ }), method(object({
16644
+ nodeId: string(),
16645
+ file: string()
16646
+ }), _void(), {
16647
+ kind: "mutation",
16648
+ auth: "admin"
16649
+ }), method(ProfileRefInputSchema, LlmRuntimeStatusSchema), method(ProfileRefInputSchema, LlmRuntimeStatusSchema, {
16650
+ kind: "mutation",
16651
+ auth: "admin"
16652
+ }), method(ProfileRefInputSchema, _void(), {
16653
+ kind: "mutation",
16654
+ auth: "admin"
16655
+ });
16656
+ var LogLevelSchema = _enum([
16657
+ "debug",
16658
+ "info",
16659
+ "warn",
16660
+ "error"
16661
+ ]);
16662
+ var LogEntrySchema = object({
16663
+ timestamp: date(),
16664
+ level: LogLevelSchema,
16665
+ scope: array(string()),
16666
+ message: string(),
16667
+ meta: record(string(), unknown()).optional(),
16668
+ tags: record(string(), string()).optional()
16669
+ });
16670
+ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
16671
+ scope: array(string()).optional(),
16672
+ level: LogLevelSchema.optional(),
16673
+ since: date().optional(),
16674
+ until: date().optional(),
16675
+ limit: number().optional(),
16676
+ tags: record(string(), string()).optional()
16677
+ }), array(LogEntrySchema).readonly());
16886
16678
  /**
16887
- * notification-outputcanonical, capability-gated notification delivery.
16679
+ * `login-method`collection cap through which auth addons contribute
16680
+ * their pre-auth login surfaces to the login page. This is the SINGLE,
16681
+ * generic mechanism that supersedes the dead `auth.listProviders` reader:
16682
+ * every auth addon (OIDC, magic-link, WebAuthn/passkey) registers a
16683
+ * `login-method` provider and the PUBLIC `auth.listLoginMethods`
16684
+ * procedure aggregates them for the unauthenticated login page.
16888
16685
  *
16889
- * Apprise-derived model (see
16890
- * `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
16891
- * callers emit ONE canonical `Notification`; each provider declares a
16892
- * per-kind capability descriptor (`TargetKind`), and the pure degrade
16893
- * engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
16894
- * message to what the kind supports callers never special-case a service.
16686
+ * A contribution is a discriminated union on `kind`:
16687
+ *
16688
+ * - `redirect` a declarative button. The login page renders a generic
16689
+ * button that navigates to `startUrl` (an addon-owned HTTP route).
16690
+ * Covers OIDC (`/addon/auth-oidc/<id>/start`) and magic-link with
16691
+ * ZERO shell-side JS. A future SSO addon plugs in the same way — the
16692
+ * login page needs NO change.
16693
+ *
16694
+ * - `widget` — a Module-Federation widget the login page mounts (via
16695
+ * `loadRemoteBundle`) for an in-page ceremony. `auth.listLoginMethods`
16696
+ * stamps a public `bundleUrl` from `addonId` + `bundle`. Generic
16697
+ * mechanism kept for future use; no shipped addon uses it on the login
16698
+ * page (the passkey ceremony below runs natively in the shell instead).
16699
+ *
16700
+ * - `passkey` — a declarative WebAuthn ceremony the shell renders
16701
+ * natively (`@simplewebauthn/browser` lives in `addon-admin-ui`, not in
16702
+ * a remotely-loaded bundle). Carries the addon's effective `rpId` /
16703
+ * `origin` (from its `resolveRpID()` / `resolveOrigin()`) so the shell
16704
+ * can gate visibility (IP-literal origin, hostname/rpId mismatch) WITHOUT
16705
+ * fetching any remote code pre-auth. Contribution stays unconditional —
16706
+ * enrollment state is never leaked pre-auth; visibility is a shell
16707
+ * decision.
16708
+ *
16709
+ * Every contribution carries a `stage`:
16710
+ * - `primary` — shown on the first credentials screen (OIDC /
16711
+ * magic-link buttons; a future usernameless passkey).
16712
+ * - `second-factor` — shown AFTER the password leg, gated on the
16713
+ * returned `factors` (passkey-as-2FA today).
16714
+ *
16715
+ * `mount: skip` — the cap is read server-side by the core auth router
16716
+ * (`registry.getCollection('login-method')`), never mounted as its own
16717
+ * tRPC router.
16718
+ */
16719
+ /** When a login method renders in the two-phase login flow. */
16720
+ var LoginStageEnum = _enum(["primary", "second-factor"]);
16721
+ /** One login-method contribution — redirect button, pre-auth widget, or native passkey ceremony. */
16722
+ var LoginMethodContributionSchema = discriminatedUnion("kind", [
16723
+ object({
16724
+ kind: literal("redirect"),
16725
+ /** Stable id within the login-method set (e.g. `auth-oidc/google`). */
16726
+ id: string(),
16727
+ /** Operator-facing button label. */
16728
+ label: string(),
16729
+ /** lucide-react icon name. */
16730
+ icon: string().optional(),
16731
+ /** Addon-owned HTTP route the button navigates to (GET). */
16732
+ startUrl: string(),
16733
+ stage: LoginStageEnum
16734
+ }),
16735
+ object({
16736
+ kind: literal("widget"),
16737
+ /** Stable id within the login-method set (e.g. `auth-webauthn/passkey-login`). */
16738
+ id: string(),
16739
+ /** Owning addon id — drives the public bundle URL + the MF namespace. */
16740
+ addonId: string(),
16741
+ /** Bundle filename inside the addon's dist dir (`remoteEntry.js`). */
16742
+ bundle: string(),
16743
+ /** MF remote descriptor — `{ remoteName, exposedModule, componentKey }`. */
16744
+ remote: WidgetRemoteSchema,
16745
+ stage: LoginStageEnum
16746
+ }),
16747
+ object({
16748
+ kind: literal("passkey"),
16749
+ /** Stable id within the login-method set (e.g. `auth-webauthn/passkey-direct-login`). */
16750
+ id: string(),
16751
+ /** Operator-facing button label. */
16752
+ label: string(),
16753
+ stage: LoginStageEnum,
16754
+ /** Effective WebAuthn RP ID (`resolveRpID()`) — the shell gates visibility on it. */
16755
+ rpId: string(),
16756
+ /** Effective expected origin (`resolveOrigin()`), null when unconfigured. */
16757
+ origin: string().nullable()
16758
+ })
16759
+ ]);
16760
+ method(_void(), array(LoginMethodContributionSchema).readonly());
16761
+ var CpuBreakdownSchema = object({
16762
+ total: number(),
16763
+ user: number(),
16764
+ system: number(),
16765
+ irq: number(),
16766
+ nice: number(),
16767
+ loadAvg: tuple([
16768
+ number(),
16769
+ number(),
16770
+ number()
16771
+ ]),
16772
+ cores: number()
16773
+ });
16774
+ var MemoryInfoSchema = object({
16775
+ percent: number(),
16776
+ totalBytes: number(),
16777
+ usedBytes: number(),
16778
+ availableBytes: number(),
16779
+ swapUsedBytes: number(),
16780
+ swapTotalBytes: number()
16781
+ });
16782
+ var DiskIoSnapshotSchema = object({
16783
+ readBytes: number(),
16784
+ writeBytes: number(),
16785
+ readOps: number(),
16786
+ writeOps: number(),
16787
+ timestampMs: number()
16788
+ });
16789
+ var NetworkIoSnapshotSchema = object({
16790
+ rxBytes: number(),
16791
+ txBytes: number(),
16792
+ rxPackets: number(),
16793
+ txPackets: number(),
16794
+ rxErrors: number(),
16795
+ txErrors: number(),
16796
+ timestampMs: number()
16797
+ });
16798
+ var MetricsGpuInfoSchema = object({
16799
+ utilization: number(),
16800
+ model: string(),
16801
+ memoryUsedBytes: number(),
16802
+ memoryTotalBytes: number(),
16803
+ temperature: number().nullable()
16804
+ });
16805
+ var ProcessResourceInfoSchema = object({
16806
+ openFds: number(),
16807
+ threadCount: number(),
16808
+ activeHandles: number(),
16809
+ activeRequests: number()
16810
+ });
16811
+ var PressureAvgsSchema = object({
16812
+ avg10: number(),
16813
+ avg60: number(),
16814
+ avg300: number()
16815
+ });
16816
+ var PressureInfoSchema = object({
16817
+ some: PressureAvgsSchema,
16818
+ full: PressureAvgsSchema.nullable()
16819
+ });
16820
+ var SystemResourceSnapshotSchema = object({
16821
+ cpu: CpuBreakdownSchema,
16822
+ memory: MemoryInfoSchema,
16823
+ gpu: MetricsGpuInfoSchema.nullable(),
16824
+ network: NetworkIoSnapshotSchema,
16825
+ disk: DiskIoSnapshotSchema,
16826
+ pressure: object({
16827
+ cpu: PressureInfoSchema.nullable(),
16828
+ memory: PressureInfoSchema.nullable(),
16829
+ io: PressureInfoSchema.nullable()
16830
+ }),
16831
+ process: ProcessResourceInfoSchema,
16832
+ cpuTemperature: number().nullable(),
16833
+ timestampMs: number()
16834
+ });
16835
+ var DiskSpaceInfoSchema = object({
16836
+ path: string(),
16837
+ totalBytes: number(),
16838
+ usedBytes: number(),
16839
+ availableBytes: number(),
16840
+ percent: number()
16841
+ });
16842
+ var PidResourceStatsSchema = object({
16843
+ pid: number(),
16844
+ cpu: number(),
16845
+ memory: number(),
16846
+ /**
16847
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
16848
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
16849
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
16850
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
16851
+ * Undefined where /proc is unavailable (e.g. macOS).
16852
+ */
16853
+ privateBytes: number().optional(),
16854
+ /**
16855
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
16856
+ * code shared copy-on-write across runners. Undefined on macOS.
16857
+ */
16858
+ sharedBytes: number().optional()
16859
+ });
16860
+ var AddonInstanceSchema = object({
16861
+ addonId: string(),
16862
+ nodeId: string(),
16863
+ role: _enum(["hub", "worker"]),
16864
+ pid: number(),
16865
+ state: _enum([
16866
+ "starting",
16867
+ "running",
16868
+ "stopping",
16869
+ "stopped",
16870
+ "crashed"
16871
+ ]),
16872
+ uptimeSec: number()
16873
+ });
16874
+ var NodeProcessSchema = object({
16875
+ pid: number(),
16876
+ ppid: number(),
16877
+ pgid: number(),
16878
+ classification: _enum([
16879
+ "root",
16880
+ "managed",
16881
+ "system",
16882
+ "ghost"
16883
+ ]),
16884
+ /** `$process` addon binding when `managed`, else null. */
16885
+ addonId: string().nullable(),
16886
+ /** Kernel-reported nodeId when the process is a known agent/worker. */
16887
+ nodeId: string().nullable(),
16888
+ /** Truncated command line. */
16889
+ command: string(),
16890
+ cpuPercent: number(),
16891
+ memoryRssBytes: number(),
16892
+ /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
16893
+ uptimeSec: number(),
16894
+ /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
16895
+ orphaned: boolean()
16896
+ });
16897
+ var KillProcessInputSchema = object({
16898
+ pid: number(),
16899
+ /** Force = SIGKILL. Default is SIGTERM. */
16900
+ force: boolean().optional()
16901
+ });
16902
+ var KillProcessResultSchema = object({
16903
+ success: boolean(),
16904
+ reason: string().optional(),
16905
+ signal: _enum(["SIGTERM", "SIGKILL"]).optional()
16906
+ });
16907
+ var DumpHeapSnapshotInputSchema = object({
16908
+ /** The addon whose runner should dump a heap snapshot. */
16909
+ addonId: string() });
16910
+ var DumpHeapSnapshotResultSchema = object({
16911
+ success: boolean(),
16912
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
16913
+ path: string().optional(),
16914
+ /** Process pid that was signalled. */
16915
+ pid: number().optional(),
16916
+ reason: string().optional()
16917
+ });
16918
+ var SystemMetricsSchema = object({
16919
+ cpuPercent: number(),
16920
+ memoryPercent: number(),
16921
+ memoryUsedMB: number(),
16922
+ memoryTotalMB: number(),
16923
+ diskPercent: number().optional(),
16924
+ temperature: number().optional(),
16925
+ gpuPercent: number().optional(),
16926
+ gpuMemoryPercent: number().optional()
16927
+ });
16928
+ 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, {
16929
+ kind: "mutation",
16930
+ auth: "admin"
16931
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
16932
+ kind: "mutation",
16933
+ auth: "admin"
16934
+ });
16935
+ method(object({
16936
+ sourceUrl: string(),
16937
+ metadata: ModelConvertMetadataSchema,
16938
+ targets: array(ConvertTargetSchema).min(1).readonly(),
16939
+ calibrationRef: string().optional(),
16940
+ sessionId: string().optional()
16941
+ }), ConvertResultSchema, {
16942
+ kind: "mutation",
16943
+ auth: "admin",
16944
+ timeoutMs: 6e5
16945
+ });
16946
+ method(object({
16947
+ nodeId: string(),
16948
+ modelId: string(),
16949
+ format: _enum(MODEL_FORMATS),
16950
+ entry: ModelCatalogEntrySchema
16951
+ }), object({
16952
+ ok: boolean(),
16953
+ /** sha256 of the staged tarball (empty for a hub-local no-op). */
16954
+ sha256: string(),
16955
+ bytes: number(),
16956
+ /** The target node's modelsDir the artifact landed in. */
16957
+ path: string()
16958
+ }), {
16959
+ kind: "mutation",
16960
+ auth: "admin"
16961
+ });
16962
+ /**
16963
+ * `mqtt-broker` — broker-registry cap.
16964
+ *
16965
+ * NOT a pub/sub proxy. The cap exposes (a) a registry of configured
16966
+ * MQTT brokers (external + optionally an embedded `aedes`-backed one)
16967
+ * and (b) the connection details a consumer addon needs to spin up
16968
+ * its OWN `mqtt.js` client.
16969
+ *
16970
+ * Why: pub/sub routing over the system event-bus loses fidelity
16971
+ * (callback shape, QoS guarantees, will/retain semantics) and adds
16972
+ * refcount bookkeeping that addons would rather own themselves. The
16973
+ * canonical consumer (`addon-export-ha-mqtt`) needs raw `mqtt.js`
16974
+ * features anyway — give it the connection config, get out of the way.
16975
+ *
16976
+ * Consumer flow:
16977
+ * const cfg = await ctx.api.mqttBroker.getBrokerConfig({ id })
16978
+ * const client = mqtt.connect(cfg.url, { username: cfg.username, … })
16979
+ * client.subscribe('zigbee2mqtt/+')
16980
+ *
16981
+ * Collection mode: multiple brokers (e.g. one local mosquitto + one
16982
+ * cloud bridge). The "embedded" entry (when present) is just another
16983
+ * broker in the registry — its lifecycle is owned by the addon that
16984
+ * spawned it.
16985
+ */
16986
+ var BrokerKindSchema = _enum(["external", "embedded"]);
16987
+ /**
16988
+ * Broker live-probe status.
16989
+ *
16990
+ * - `connected` — last probe completed a clean CONNACK
16991
+ * - `disconnected` — no probe has run yet (cold cache)
16992
+ * - `auth-failed` — CONNACK refused with auth error (RC 4 / 5)
16993
+ * - `unreachable` — TCP connect timed out / refused
16994
+ * - `tls-error` — TLS handshake failed (cert / SNI / cipher)
16995
+ */
16996
+ var BrokerStatusSchema$1 = _enum([
16997
+ "connected",
16998
+ "disconnected",
16999
+ "auth-failed",
17000
+ "unreachable",
17001
+ "tls-error"
17002
+ ]);
17003
+ var BrokerInfoSchema = object({
17004
+ id: string(),
17005
+ name: string(),
17006
+ url: string(),
17007
+ kind: BrokerKindSchema,
17008
+ status: BrokerStatusSchema$1,
17009
+ latencyMs: number().nullable(),
17010
+ error: string().optional(),
17011
+ /** Embedded brokers only: number of MQTT clients currently connected. */
17012
+ connectedClients: number().int().nonnegative().optional(),
17013
+ /** Epoch ms of the last live probe (external) or aedes snapshot (embedded). */
17014
+ lastCheckedAt: number().optional()
17015
+ });
17016
+ /**
17017
+ * Connection details — what a consumer needs to call
17018
+ * `mqtt.connect(url, options)`. We split URL + credentials so the
17019
+ * consumer can pass them as `mqtt.connect(url, { username, password })`
17020
+ * instead of stuffing creds into the URL (which leaks them into logs).
17021
+ */
17022
+ var BrokerConnectionDetailsSchema = object({
17023
+ url: string(),
17024
+ username: string().optional(),
17025
+ password: string().optional(),
17026
+ /**
17027
+ * Suggested prefix for `clientId`. Each consumer should suffix this
17028
+ * with its own discriminator (addon id, instance id) so reconnects
17029
+ * don't kick each other off (MQTT spec: clientId must be unique per
17030
+ * broker).
17031
+ */
17032
+ clientIdPrefix: string().optional()
17033
+ });
17034
+ var AddBrokerInputSchema = object({
17035
+ name: string().min(1),
17036
+ url: string().regex(/^(mqtt|mqtts|ws|wss):\/\//, "URL must start with mqtt(s):// or ws(s)://"),
17037
+ username: string().optional(),
17038
+ password: string().optional(),
17039
+ clientIdPrefix: string().optional()
17040
+ });
17041
+ var AddBrokerResultSchema = object({ id: string() });
17042
+ var IdInputSchema = object({ id: string() });
17043
+ var TestResultSchema$1 = discriminatedUnion("ok", [object({
17044
+ ok: literal(true),
17045
+ latencyMs: number()
17046
+ }), object({
17047
+ ok: literal(false),
17048
+ error: string()
17049
+ })]);
17050
+ var StartEmbeddedInputSchema = object({
17051
+ port: number().int().min(1).max(65535).default(1883),
17052
+ /** Allow anonymous connect (no username/password). Default: false. */
17053
+ allowAnonymous: boolean().default(false),
17054
+ /** Optional shared username/password for clients. */
17055
+ username: string().optional(),
17056
+ password: string().optional()
17057
+ });
17058
+ var StartEmbeddedResultSchema = object({
17059
+ id: string(),
17060
+ url: string()
17061
+ });
17062
+ var StatusSchema = object({
17063
+ brokerCount: number(),
17064
+ embeddedRunning: boolean()
17065
+ });
17066
+ 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);
17067
+ var NetworkEndpointSchema = object({
17068
+ url: string(),
17069
+ hostname: string(),
17070
+ port: number(),
17071
+ protocol: _enum(["http", "https"])
17072
+ });
17073
+ var NetworkAccessStatusSchema = object({
17074
+ connected: boolean(),
17075
+ endpoint: NetworkEndpointSchema.nullable(),
17076
+ error: string().optional()
17077
+ });
17078
+ /**
17079
+ * Optional, richer endpoint shape returned by providers that expose
17080
+ * MORE than one ingress concurrently (Tailscale Ingress with mixed
17081
+ * serve+funnel rules, future ngrok multi-tunnel, …). Each entry carries
17082
+ * the originating provider config (mode + sourcePort) so the
17083
+ * orchestrator UI can label rows distinctly. Providers that expose only
17084
+ * one endpoint just omit `listEndpoints` from their provider impl.
17085
+ */
17086
+ var NetworkEndpointEntrySchema = NetworkEndpointSchema.extend({
17087
+ /**
17088
+ * Stable id within the provider — typically `<mode>-<sourcePort>` so
17089
+ * the orchestrator can dedupe across `listEndpoints` polls.
17090
+ */
17091
+ id: string(),
17092
+ /** Operator-facing label (mirrors `MeshEndpoint.label`). */
17093
+ label: string(),
17094
+ /** Optional provider-specific mode tag, used for icon/colour in admin UI. */
17095
+ mode: string().optional(),
17096
+ /** Originating local port the ingress fronts (informational). */
17097
+ sourcePort: number().optional()
17098
+ });
17099
+ method(_void(), NetworkEndpointSchema, { kind: "mutation" }), method(_void(), _void(), { kind: "mutation" }), method(_void(), NetworkEndpointSchema.nullable()), method(_void(), NetworkAccessStatusSchema), method(_void(), array(NetworkEndpointEntrySchema).readonly());
17100
+ /**
17101
+ * notification-output — canonical, capability-gated notification delivery.
17102
+ *
17103
+ * Apprise-derived model (see
17104
+ * `docs/superpowers/specs/2026-07-03-notification-output-notifier-matrix.md`):
17105
+ * callers emit ONE canonical `Notification`; each provider declares a
17106
+ * per-kind capability descriptor (`TargetKind`), and the pure degrade
17107
+ * engine (`@camstack/types` `prepareNotification`) transcodes / degrades the
17108
+ * message to what the kind supports — callers never special-case a service.
16895
17109
  *
16896
17110
  * DESIGN DECISIONS (locked):
16897
17111
  * - Target CRUD lives on THIS cap (`upsertTarget` / `deleteTarget` /
@@ -17016,14 +17230,14 @@ var TargetKindCapsSchema = object({
17016
17230
  * the union is large and not meant for runtime validation here; the exported
17017
17231
  * `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
17018
17232
  */
17019
- var ConfigSchemaPassthrough$1 = unknown();
17233
+ var ConfigSchemaPassthrough = unknown();
17020
17234
  var TargetKindSchema = object({
17021
17235
  kind: string(),
17022
17236
  label: string(),
17023
17237
  icon: string(),
17024
17238
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
17025
17239
  addonId: string(),
17026
- configSchema: ConfigSchemaPassthrough$1,
17240
+ configSchema: ConfigSchemaPassthrough,
17027
17241
  supportsDiscovery: boolean(),
17028
17242
  caps: TargetKindCapsSchema
17029
17243
  });
@@ -17073,300 +17287,496 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
17073
17287
  sample: NotificationSchema.optional()
17074
17288
  }), TestResultSchema, { kind: "mutation" }), method(object({ target: TargetSchema }), TargetSchema, { kind: "mutation" }), method(object({ targetId: string() }), _void(), { kind: "mutation" }), method(object({
17075
17289
  targetId: string(),
17076
- enabled: boolean()
17077
- }), _void(), { kind: "mutation" });
17078
- /**
17079
- * Shared LLM generate contracts — imported by BOTH `llm.cap.ts` (consumer
17080
- * surface) and `llm-runtime.cap.ts` (node-side managed executor) so the two
17081
- * caps stay wire-compatible without a circular cap→cap import.
17082
- *
17083
- * Errors are a discriminated-union RESULT, never thrown: the shape survives
17084
- * every transport tier structurally, and failed calls still write usage rows.
17085
- * Token counts only in v1 — no costUsd (operator decision, 2026-07-15).
17086
- */
17087
- var LlmUsageSchema = object({
17088
- inputTokens: number(),
17089
- outputTokens: number()
17090
- });
17091
- var LlmErrorCodeSchema = _enum([
17092
- "timeout",
17093
- "rate-limited",
17094
- "auth",
17095
- "refusal",
17096
- "bad-request",
17097
- "unavailable",
17098
- "no-profile",
17099
- "budget-exceeded",
17100
- "adapter-error"
17101
- ]);
17102
- var LlmGenerateResultSchema = discriminatedUnion("ok", [object({
17103
- ok: literal(true),
17104
- text: string(),
17105
- model: string(),
17106
- usage: LlmUsageSchema,
17107
- truncated: boolean(),
17108
- latencyMs: number()
17109
- }), object({
17110
- ok: literal(false),
17111
- code: LlmErrorCodeSchema,
17112
- message: string(),
17113
- retryAfterMs: number().optional()
17114
- })]);
17115
- /**
17116
- * `Uint8Array` is the sanctioned binary convention — superjson + the UDS
17117
- * MsgPack channel round-trip typed arrays (embedding-encoder.cap.ts:29,
17118
- * notification-output.cap.ts:27-31 precedents).
17119
- */
17120
- var LlmImageSchema = object({
17121
- bytes: _instanceof(Uint8Array),
17122
- mimeType: string()
17123
- });
17124
- var LlmGenerateBaseInputSchema = object({
17125
- /** Collection routing (the notification-output posture). */
17126
- addonId: string().optional(),
17127
- /** Explicit profile; else the resolution chain (spec §3). */
17128
- profileId: string().optional(),
17129
- /** MANDATORY usage tag: 'ai-summary', 'notifier-rules', 'adhoc-ui', … */
17130
- consumer: string(),
17131
- system: string().optional(),
17132
- /** v1: single-turn. `messages[]` is a v2 additive field. */
17133
- prompt: string(),
17134
- /** Structured output — adapter-mapped (response_format / forced tool / responseSchema). */
17135
- jsonSchema: record(string(), unknown()).optional(),
17136
- /** Per-call override of the profile default. */
17137
- maxTokens: number().int().positive().optional(),
17138
- temperature: number().optional()
17139
- });
17290
+ enabled: boolean()
17291
+ }), _void(), { kind: "mutation" });
17140
17292
  /**
17141
- * `llm-runtime`node-side managed llama.cpp executor (spec §4). Registered
17142
- * on EVERY node where `addon-ai` is installed; the hub `llm` provider reaches
17143
- * a specific node's runtime with `nodePin(profile.runtime.nodeId)` — normal
17144
- * cap routing, zero bespoke plumbing. `internal: true`: the operator reaches
17145
- * this only through the `llm` cap's methods.
17293
+ * notification-rulesthe Notification Center rule surface (P1 core).
17146
17294
  *
17147
- * One running llama-server child per node in v1 (models are RAM-heavy).
17148
- * Resource ceiling = llama-server flags + idleStopMinutes ONLY (no RSS
17149
- * watchdog — operator decision #3).
17295
+ * Spec: `docs/superpowers/specs/2026-07-22-notification-center-requirements.md`
17296
+ * (operator decisions D-1/D-2/D-3 are binding):
17297
+ *
17298
+ * - D-2: rule EVALUATION lives in `addon-post-analysis` (the
17299
+ * `notification-center` module), hooked on the durable persistence
17300
+ * moments (object-event insert, TrackCloser.closeExpired) with a
17301
+ * persisted outbox + retry — never the lossy telemetry bus (D8).
17302
+ * - D-3: urgency belongs to the RULE. `delivery: 'immediate'` fires on the
17303
+ * FIRST persisted detection matching the conditions (per-track dedup,
17304
+ * `maxPerTrack` fixed at 1 — see {@link NC_MAX_PER_TRACK_IMMEDIATE});
17305
+ * `delivery: 'track-end'` evaluates the finalized track record at close.
17306
+ * - DISPATCH stays behind `notification-output` (rules reference targets
17307
+ * by id; per-backend params are a passthrough blob capped by the
17308
+ * target kind's own caps/degrade engine).
17309
+ *
17310
+ * P1 scope: admin-authored rules only (`createdBy` stamped from the
17311
+ * server-injected caller identity — the first `caller: 'required'`
17312
+ * adopter). The P1 condition subset is: devices, classes(+exclude),
17313
+ * minConfidence, admin zones (any/all + exclude), weekly schedule
17314
+ * windows, and the optional label/identity/plate matchers. User rules,
17315
+ * private zones, per-recipient fan-out and the wider condition table are
17316
+ * P2+ (see spec §7).
17317
+ *
17318
+ * All schemas here are the single source of truth — `NcRule` etc. are
17319
+ * `z.infer` exports; no duplicate interfaces (the advanced-notifier
17320
+ * schema/interface drift is explicitly not repeated).
17150
17321
  */
17151
- var ManagedModelRefSchema = discriminatedUnion("kind", [
17152
- object({
17153
- kind: literal("catalog"),
17154
- catalogId: string()
17155
- }),
17156
- object({
17157
- kind: literal("url"),
17158
- url: string(),
17159
- sha256: string().optional()
17160
- }),
17161
- object({
17162
- kind: literal("path"),
17163
- path: string()
17164
- })
17322
+ /**
17323
+ * D-3: the trigger/urgency of a rule — which persistence moment evaluates it.
17324
+ * The value maps 1:1 onto the evaluated record kind:
17325
+ * - `immediate` ↔ object-event persist (lowest-latency detection burst)
17326
+ * - `track-end` ↔ TrackCloser.closeExpired (finalized track record)
17327
+ * - `device-event` ↔ SensorEventStore insert (doorbell press / sensor state
17328
+ * change of a LINKED device, one row per linked camera)
17329
+ * - `package-event` ↔ PackageDropDetector object-event insert (a `package`
17330
+ * delivery / pick-up)
17331
+ *
17332
+ * `immediate`/`track-end` carry the D-3 urgency semantics; `device-event`/
17333
+ * `package-event` are pure trigger kinds (no urgency dimension). Extending
17334
+ * this one field keeps the schema additive — a rule still declares exactly
17335
+ * one trigger.
17336
+ */
17337
+ var NcDeliverySchema = _enum([
17338
+ "immediate",
17339
+ "track-end",
17340
+ "device-event",
17341
+ "package-event"
17165
17342
  ]);
17166
- var ManagedRuntimeConfigSchema = object({
17167
- /** WHERE the runtime lives — hub or any agent. */
17168
- nodeId: string(),
17169
- /** Closed for v1; 'ollama' is a v2 candidate. */
17170
- engine: _enum(["llama-cpp"]),
17171
- model: ManagedModelRefSchema,
17172
- contextSize: number().int().default(4096),
17173
- /** 0 = CPU-only. */
17174
- gpuLayers: number().int().default(0),
17175
- /** Default: cpus-2, clamped ≥1 (resolved node-side). */
17176
- threads: number().int().optional(),
17177
- /** Concurrent slots. */
17178
- parallel: number().int().default(1),
17179
- /** Else lazy: first generate boots it. */
17180
- autoStart: boolean().default(false),
17181
- /** 0 = never; frees RAM after quiet periods. */
17182
- idleStopMinutes: number().int().default(30)
17183
- });
17184
- var LlmRuntimeStatusSchema = object({
17185
- /** Status is ALWAYS node-qualified. */
17186
- nodeId: string(),
17187
- state: _enum([
17188
- "stopped",
17189
- "downloading",
17190
- "starting",
17191
- "ready",
17192
- "crashed",
17193
- "failed"
17194
- ]),
17195
- pid: number().optional(),
17196
- port: number().optional(),
17197
- modelPath: string().optional(),
17198
- modelId: string().optional(),
17199
- downloadProgress: number().min(0).max(1).optional(),
17200
- lastError: string().optional(),
17201
- crashesInWindow: number(),
17202
- /** Child RSS (sampled best-effort). */
17203
- memoryBytes: number().optional(),
17204
- vramBytes: number().optional()
17343
+ /** Weekly schedule — OR of windows; absence on the rule = always active. */
17344
+ var NcScheduleSchema = object({
17345
+ windows: array(object({
17346
+ /** Days of week the window STARTS on (0 = Sunday … 6 = Saturday). */
17347
+ days: array(number().int().min(0).max(6)).min(1),
17348
+ startMinute: number().int().min(0).max(1439),
17349
+ endMinute: number().int().min(0).max(1439)
17350
+ })).min(1),
17351
+ /** IANA timezone; default = hub host timezone. */
17352
+ timezone: string().optional(),
17353
+ /** Active OUTSIDE the windows (e.g. "only outside business hours"). */
17354
+ invert: boolean().optional()
17205
17355
  });
17206
- var LlmNodeModelSchema = object({
17207
- file: string(),
17208
- sizeBytes: number(),
17209
- catalogId: string().optional(),
17210
- installedAt: number().optional()
17356
+ /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
17357
+ var NcPlateMatcherSchema = object({
17358
+ values: array(string().min(1)).min(1),
17359
+ /** Max Levenshtein distance after normalization (uppercase alphanumeric). */
17360
+ maxDistance: number().int().min(0).max(3).default(1)
17211
17361
  });
17212
- var LlmRuntimeDiskUsageSchema = object({
17213
- nodeId: string(),
17214
- modelsBytes: number(),
17215
- freeBytes: number().optional()
17362
+ /**
17363
+ * Occupancy condition (DEVICE-EVENT trigger). Fires on a ZoneAnalytics
17364
+ * occupancy edge for a device — optionally narrowed to a single admin
17365
+ * `zoneId` and/or object `className`. `op` selects the edge/threshold:
17366
+ * - `became-occupied` (default) — count crossed 0 → ≥ `count`
17367
+ * - `became-free` — count crossed ≥ `count` → below it
17368
+ * - `>=` / `<=` — count is at/over or at/under `count`
17369
+ * `sustainSeconds` requires the condition hold continuously that long
17370
+ * before firing (debounces flicker; 0 = fire on the first matching edge).
17371
+ * Fail-closed: no ZoneAnalytics snapshot / missing zone / null snapshot ⇒
17372
+ * the condition never matches. Confirmed edge-state survives addon restarts
17373
+ * (declared SQLite collection, reseeded on boot).
17374
+ */
17375
+ var NcOccupancyConditionSchema = object({
17376
+ /** Admin zone id to scope the count to; absent = whole-frame occupancy. */
17377
+ zoneId: string().optional(),
17378
+ /** Object class to count; absent = any class. */
17379
+ className: string().optional(),
17380
+ op: _enum([
17381
+ "became-occupied",
17382
+ "became-free",
17383
+ ">=",
17384
+ "<="
17385
+ ]).default("became-occupied"),
17386
+ count: number().int().min(0).default(1),
17387
+ sustainSeconds: number().int().min(0).max(3600).default(15)
17388
+ });
17389
+ /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
17390
+ var NcZoneConditionSchema = object({
17391
+ ids: array(string().min(1)).min(1),
17392
+ /** Quantifier over `ids` — at least one / every one visited. */
17393
+ match: _enum(["any", "all"]).default("any")
17216
17394
  });
17217
- method(LlmGenerateBaseInputSchema.extend({
17218
- images: array(LlmImageSchema).optional(),
17219
- runtime: ManagedRuntimeConfigSchema,
17220
- /** The managed profile's timeout, threaded by the hub provider. */
17221
- timeoutMs: number().int().positive().optional()
17222
- }), LlmGenerateResultSchema, { kind: "mutation" }), method(object({ runtime: ManagedRuntimeConfigSchema }), LlmRuntimeStatusSchema, {
17223
- kind: "mutation",
17224
- auth: "admin"
17225
- }), method(object({}), _void(), {
17226
- kind: "mutation",
17227
- auth: "admin"
17228
- }), method(object({}), LlmRuntimeStatusSchema), method(object({ model: ManagedModelRefSchema }), _void(), {
17229
- kind: "mutation",
17230
- auth: "admin"
17231
- }), method(object({ file: string() }), _void(), {
17232
- kind: "mutation",
17233
- auth: "admin"
17234
- }), method(object({}), array(LlmNodeModelSchema)), method(object({}), LlmRuntimeDiskUsageSchema);
17235
17395
  /**
17236
- * `llm`consumer-facing LLM surface (spec §1-§3). Collection-mode: array
17237
- * methods concat-fan across providers; single-row methods route to ONE
17238
- * provider by the `addonId` in the call input (the notification-output
17239
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
17240
- * (hub-placed); the cap stays open for future providers.
17241
- *
17242
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
17243
- * `apiKey` is a password field — providers REDACT it on read and merge on
17244
- * write; a stored key NEVER round-trips to a client.
17396
+ * The P1 condition set a flat AND of groups; absent group = pass;
17397
+ * membership lists are OR within the list (spec §2.3).
17245
17398
  */
17246
- var LlmProfileKindSchema = _enum([
17247
- "openai-compatible",
17248
- "openai",
17249
- "anthropic",
17250
- "google",
17251
- "managed-local"
17252
- ]);
17253
- var LlmProfileSchema = object({
17254
- id: string(),
17255
- name: string(),
17256
- kind: LlmProfileKindSchema,
17257
- /** Stamped by the provider keeps the fanned catalog routable. */
17258
- addonId: string(),
17259
- enabled: boolean(),
17260
- /** Vendor model id, or the managed runtime's loaded model. */
17261
- model: string(),
17262
- /** Required for openai-compatible; override for cloud kinds. */
17263
- baseUrl: string().optional(),
17264
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
17265
- apiKey: string().optional(),
17266
- supportsVision: boolean(),
17267
- temperature: number().min(0).max(2).optional(),
17268
- maxTokens: number().int().positive().optional(),
17269
- timeoutMs: number().int().positive().default(6e4),
17270
- extraHeaders: record(string(), string()).optional(),
17271
- /** kind === 'managed-local' only (spec §4). */
17272
- runtime: ManagedRuntimeConfigSchema.optional()
17399
+ var NcConditionsSchema = object({
17400
+ /** Device scope — absent = all devices. */
17401
+ devices: array(number()).optional(),
17402
+ /** Detector class names (any overlap with the record's class set). */
17403
+ classes: array(string().min(1)).optional(),
17404
+ /** Veto classes — any overlap fails the rule. */
17405
+ classesExclude: array(string().min(1)).optional(),
17406
+ /** Minimum detection confidence 0–1 (fails when the record has none). */
17407
+ minConfidence: number().min(0).max(1).optional(),
17408
+ /** Admin zone membership over event `zones` / track `zonesVisited`. */
17409
+ zones: NcZoneConditionSchema.optional(),
17410
+ /** Veto zones any hit fails the rule. */
17411
+ zonesExclude: array(string().min(1)).optional(),
17412
+ /**
17413
+ * Exact (case-insensitive) match on the record's collapsed `label`
17414
+ * (identity name / plate text / subclass).
17415
+ */
17416
+ labelEquals: array(string().min(1)).optional(),
17417
+ /**
17418
+ * Identity matcher. P1 boundary: matched against the record's collapsed
17419
+ * `label` (the identity display name propagated by the face pipeline)
17420
+ * identity-ID matching rides in P2 when identity ids reach the record.
17421
+ */
17422
+ identities: array(string().min(1)).optional(),
17423
+ /** Fuzzy plate matcher against the record's `label` (plate text). */
17424
+ plates: NcPlateMatcherSchema.optional(),
17425
+ /**
17426
+ * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics.
17427
+ * Same P1 boundary: matched against the record's collapsed `label` (the
17428
+ * identity display name). A record with NO label passes (nothing to
17429
+ * exclude), unlike the include variant which fails on an absent label.
17430
+ */
17431
+ identitiesExclude: array(string().min(1)).optional(),
17432
+ /**
17433
+ * Minimum server-computed key-event importance in [0,1] (`Track.importance`).
17434
+ * TRACK-END only: importance is scored at track close, so it does not exist
17435
+ * at immediate / object-event evaluation time (see catalog `appliesTo`). At
17436
+ * close the value is threaded via the close-time info (the `Track` clone is
17437
+ * captured before the DB row is updated, so it would otherwise read stale).
17438
+ * Fails when the record carries no importance (never guess quality — the
17439
+ * `minConfidence` precedent). MVP cut: a single scalar threshold.
17440
+ */
17441
+ minImportance: number().min(0).max(1).optional(),
17442
+ /**
17443
+ * Minimum track dwell in SECONDS — `(lastSeen − firstSeen) / 1000`.
17444
+ * TRACK-END only: an `immediate` / object-event subject has no closed
17445
+ * lifespan, so a dwell condition never matches immediate delivery
17446
+ * (documented choice — the object-event record carries no `firstSeen`,
17447
+ * so dwell cannot be computed from what the subject actually carries).
17448
+ */
17449
+ minDwellSeconds: number().min(0).optional(),
17450
+ /**
17451
+ * Detection provenance filter. `any` (default / absent) matches every
17452
+ * source; otherwise the subject's source must equal it. Legacy records
17453
+ * with no stamped source are treated as `pipeline`. The union spans both
17454
+ * record kinds — object events carry `pipeline` | `onboard`, synthetic
17455
+ * tracks carry `sensor`.
17456
+ */
17457
+ source: _enum([
17458
+ "pipeline",
17459
+ "onboard",
17460
+ "sensor",
17461
+ "any"
17462
+ ]).optional(),
17463
+ /**
17464
+ * Minimum identity / plate MATCH confidence in [0,1] — DISTINCT from the
17465
+ * detector `minConfidence` (that gates the object-detection score; this
17466
+ * gates the recognition/OCR match score). Fails when the subject carries
17467
+ * no label-match confidence (never guess). TRACK-END only: the confidence
17468
+ * lives on the recognition result and reaches the subject at track close.
17469
+ *
17470
+ * What it measures precisely (plumbed at track close — the closer threads
17471
+ * the value into `NcTrackClosedInfo.labelConfidence`, the same seam as
17472
+ * `importance`): the BEST recognition match confidence observed for the
17473
+ * label the track carries at close — for a face, the peak cosine similarity
17474
+ * of the ASSIGNED identity (`FaceMatch.score`, reset on an identity switch);
17475
+ * for a plate, the peak OCR read score of the best-held plate
17476
+ * (`plateText.confidence`). When BOTH a face and a plate were recognized on
17477
+ * one track the higher of the two is used. A track that ended with no
17478
+ * confident identity/plate match carries no value, so the condition fails
17479
+ * closed for it (an un-recognized subject).
17480
+ */
17481
+ minLabelConfidence: number().min(0).max(1).optional(),
17482
+ /**
17483
+ * DEVICE-EVENT only. Raw device event-type tokens (`EventFire.eventType`,
17484
+ * e.g. a doorbell `press` / `press_long`) — matched case-insensitively
17485
+ * against the token carried on the device-event subject (extracted from the
17486
+ * event-emitter runtime slice's `lastEvent.eventType`). Fails when the
17487
+ * subject carries no token. Doorbell-pulse / passive-sensor kinds emit no
17488
+ * eventType, so gate those with {@link sensorKinds} instead.
17489
+ */
17490
+ eventTypeTokens: array(string().min(1)).optional(),
17491
+ /**
17492
+ * DEVICE-EVENT only. Sensor/control taxonomy kinds (e.g. `doorbell`,
17493
+ * `contact`, `button`, `device-event`) — matched against the persisted
17494
+ * `SensorEvent.kind` (see `sensor-event-kinds.ts`). Membership is OR.
17495
+ */
17496
+ sensorKinds: array(string().min(1)).optional(),
17497
+ /**
17498
+ * PACKAGE-EVENT only. Which package phase fires the rule — `delivered`
17499
+ * (a parked parcel appeared), `picked-up` (it departed), or `both`. Fails
17500
+ * when the subject's phase does not match (a subject always carries a phase
17501
+ * on the package-event trigger).
17502
+ */
17503
+ packagePhase: _enum([
17504
+ "delivered",
17505
+ "picked-up",
17506
+ "both"
17507
+ ]).optional(),
17508
+ /**
17509
+ * PERSONAL-RULE custom zones (viewer-drawn). Inline normalized polygons
17510
+ * (MaskShape vocabulary). A record passes when its bbox overlaps ANY
17511
+ * listed polygon (ZoneEngine membership semantics). Evaluated only when
17512
+ * the subject carries a bbox; absent bbox ⇒ the condition FAILS.
17513
+ */
17514
+ customZones: array(MaskPolygonShapeSchema).optional(),
17515
+ /**
17516
+ * DEVICE-EVENT only. ZoneAnalytics occupancy edge — fires when a device's
17517
+ * (optionally zone/class-scoped) occupancy count crosses the configured
17518
+ * threshold and holds for `sustainSeconds`. Fail-closed on missing
17519
+ * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
17520
+ */
17521
+ occupancy: NcOccupancyConditionSchema.optional()
17273
17522
  });
17274
- /** ConfigUISchema tree passed through untyped on the wire (the
17275
- * notification-output `ConfigSchemaPassthrough` precedent at
17276
- * notification-output.cap.ts:151); the exported TS type re-tightens it. */
17277
- var ConfigSchemaPassthrough = unknown();
17278
- var LlmProfileKindDescriptorSchema = object({
17279
- kind: LlmProfileKindSchema,
17280
- label: string(),
17281
- icon: string(),
17282
- /** Stamped by each provider so the concat-fanned catalog stays routable. */
17283
- addonId: string(),
17284
- configSchema: ConfigSchemaPassthrough
17523
+ /** One delivery target: a `notification-output` Target ref + passthrough params. */
17524
+ var NcRuleTargetSchema = object({
17525
+ /** `notification-output` Target id. */
17526
+ targetId: string().min(1),
17527
+ /**
17528
+ * Per-backend passthrough. Recognized keys are mapped onto the canonical
17529
+ * Notification (`priority`, `level`, `sound`, `clickUrl`, `ttl`); the
17530
+ * degrade engine drops what the backend can't render.
17531
+ */
17532
+ params: record(string(), unknown()).optional()
17285
17533
  });
17286
- var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
17287
- var LlmDefaultSchema = object({
17288
- selector: LlmDefaultSelectorSchema,
17289
- profileId: string()
17534
+ /**
17535
+ * Media attachment policy (P1 still-image subset).
17536
+ * - `best` — the best AVAILABLE subject image at dispatch time (D-3).
17537
+ * - `best-matching` — the media that explains WHY the rule fired: a rule
17538
+ * matched on identities attaches the subject's `faceCrop`, one matched on
17539
+ * plates attaches the `plateCrop`; a rule with no identity/plate condition
17540
+ * (or when the specific crop is missing) degrades to `best`, then
17541
+ * `keyFrame`, then no attachment — never delaying the send. The matched
17542
+ * condition summary is frozen on the outbox row at enqueue (like the rule
17543
+ * name), so the choice never drifts from the record that fired it.
17544
+ * - `keyFrame` — the clean scene frame (no subject box).
17545
+ * - `none` — no attachment.
17546
+ */
17547
+ var NcMediaPolicySchema = object({ attach: _enum([
17548
+ "best",
17549
+ "best-matching",
17550
+ "keyFrame",
17551
+ "none"
17552
+ ]).default("best") });
17553
+ /** Throttle — cooldown survives restarts (rebuilt from the outbox on boot). */
17554
+ var NcThrottleSchema = object({
17555
+ cooldownSec: number().int().min(0).max(86400).default(60),
17556
+ /** `rule` = one shared cooldown; `rule-device` = per-camera cooldown. */
17557
+ scope: _enum(["rule", "rule-device"]).default("rule-device")
17558
+ });
17559
+ /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
17560
+ var NcRuleInputSchema = object({
17561
+ name: string().min(1).max(200),
17562
+ enabled: boolean().default(true),
17563
+ delivery: NcDeliverySchema,
17564
+ conditions: NcConditionsSchema.default({}),
17565
+ schedule: NcScheduleSchema.optional(),
17566
+ targets: array(NcRuleTargetSchema).min(1),
17567
+ media: NcMediaPolicySchema.default({ attach: "best" }),
17568
+ throttle: NcThrottleSchema.default({
17569
+ cooldownSec: 60,
17570
+ scope: "rule-device"
17571
+ }),
17572
+ /** `{{var}}` templating over camera/class/label/zones/confidence/time. */
17573
+ template: object({
17574
+ title: string().max(500).optional(),
17575
+ body: string().max(2e3).optional()
17576
+ }).optional(),
17577
+ /** Canonical notification priority ordinal (1..5); per-target overridable. */
17578
+ priority: number().int().min(1).max(5).default(3),
17579
+ /**
17580
+ * Ownership/visibility key. Absent = admin/global rule (unchanged legacy
17581
+ * behaviour, visible to all, read-only in the viewer). Present = personal
17582
+ * rule owned by this userId. Server-stamped; never trusted from a client.
17583
+ */
17584
+ ownerUserId: string().optional()
17290
17585
  });
17291
- /** Server-side rollup row — getUsage never dumps raw call rows (spec §6). */
17292
- var LlmUsageRollupSchema = object({
17293
- day: string(),
17294
- consumer: string(),
17295
- profileId: string(),
17296
- calls: number(),
17297
- okCalls: number(),
17298
- errorCalls: number(),
17299
- inputTokens: number(),
17300
- outputTokens: number(),
17301
- avgLatencyMs: number()
17586
+ /**
17587
+ * Partial patch for `updateRule` — any subset of the input fields, plus the
17588
+ * persisted-only {@link NcRuleSchema} `disabledTargetIds` set. The latter is
17589
+ * NOT a client-authored input field (it lives on the persisted rule, not the
17590
+ * input), so it is added here explicitly to let the store's per-target opt-out
17591
+ * toggle round-trip through the shared `update` path. Viewer opt-out mutations
17592
+ * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
17593
+ * `updateRule` patch.
17594
+ */
17595
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
17596
+ /** A persisted rule. */
17597
+ var NcRuleSchema = NcRuleInputSchema.extend({
17598
+ id: string(),
17599
+ /** userId of the admin who created the rule (server-stamped caller). */
17600
+ createdBy: string(),
17601
+ createdAt: number(),
17602
+ updatedAt: number(),
17603
+ /**
17604
+ * Per-target opt-out set. A targetId here is suppressed for THIS rule at
17605
+ * send time. Only a target's OWNER may add/remove its id (server-checked
17606
+ * in `nc.setRuleTargetEnabled`). Defaults to empty.
17607
+ */
17608
+ disabledTargetIds: array(string()).default([])
17609
+ });
17610
+ var NcTestResultSchema = object({
17611
+ recordId: string(),
17612
+ recordKind: _enum([
17613
+ "object-event",
17614
+ "track",
17615
+ "device-event",
17616
+ "package-event"
17617
+ ]),
17618
+ deviceId: number(),
17619
+ timestamp: number(),
17620
+ wouldFire: boolean(),
17621
+ /** Condition id that failed (first failing group), when `wouldFire` is false. */
17622
+ failedCondition: string().optional(),
17623
+ className: string().optional(),
17624
+ label: string().optional()
17302
17625
  });
17303
- /** LLM-facing view over the reused ModelCatalogEntry mechanism (spec §4.2). */
17304
- var ManagedModelCatalogEntrySchema = object({
17626
+ var NcConditionDescriptorSchema = object({
17627
+ /** Field id inside `NcConditions` (or `'schedule'` for the rule-level group). */
17305
17628
  id: string(),
17629
+ group: _enum([
17630
+ "scope",
17631
+ "class",
17632
+ "zones",
17633
+ "quality",
17634
+ "label",
17635
+ "schedule",
17636
+ "device",
17637
+ "package",
17638
+ "occupancy"
17639
+ ]),
17306
17640
  label: string(),
17307
- family: string(),
17308
- purpose: _enum(["text", "vision"]),
17309
- url: string(),
17310
- sha256: string(),
17311
- sizeBytes: number(),
17312
- quantization: string(),
17313
- /** Load-time guidance shown in the picker. */
17314
- minRamBytes: number(),
17315
- contextSizeDefault: number().int(),
17316
- /** Vision models: companion projector file. */
17317
- mmprojUrl: string().optional()
17641
+ /** Editor widget the UI renders — never hardcode per-condition forms. */
17642
+ valueType: _enum([
17643
+ "deviceIdList",
17644
+ "stringList",
17645
+ "number01",
17646
+ "number",
17647
+ "sourceSelect",
17648
+ "zoneSelection",
17649
+ "zoneIdList",
17650
+ "schedule",
17651
+ "plateMatcher",
17652
+ "packagePhase",
17653
+ "polygonDraw",
17654
+ "occupancy"
17655
+ ]),
17656
+ operator: _enum([
17657
+ "in",
17658
+ "notIn",
17659
+ "anyOf",
17660
+ "allOf",
17661
+ "gte",
17662
+ "fuzzyIn",
17663
+ "withinSchedule"
17664
+ ]),
17665
+ /** Which delivery kinds the condition applies to. */
17666
+ appliesTo: array(NcDeliverySchema),
17667
+ phase: string(),
17668
+ description: string().optional()
17318
17669
  });
17319
- var LlmRuntimeNodeSchema = object({
17320
- nodeId: string(),
17321
- reachable: boolean(),
17322
- status: LlmRuntimeStatusSchema.optional(),
17323
- disk: LlmRuntimeDiskUsageSchema.optional(),
17324
- error: string().optional()
17670
+ /**
17671
+ * The delivery lifecycle status of a history row — a straight read of the
17672
+ * durable outbox row's own status (single source of truth):
17673
+ * - `pending` — enqueued, in-flight or retrying with backoff
17674
+ * - `sent` — delivered (terminal)
17675
+ * - `dead` — dead-lettered after exhausting retries / a permanent
17676
+ * backend rejection / a deleted target (terminal; carries
17677
+ * the failure `error`)
17678
+ *
17679
+ * P1 has no `suppressed-quiet-hours` / `snoozed` states — those ride the P2
17680
+ * user dimension (quiet hours / snooze) and are additive when they land.
17681
+ */
17682
+ var NcHistoryStatusSchema = _enum([
17683
+ "pending",
17684
+ "sent",
17685
+ "dead"
17686
+ ]);
17687
+ /** The evaluated record kind a history row descends from (one per trigger). */
17688
+ var NcHistoryRecordKindSchema = _enum([
17689
+ "object-event",
17690
+ "track-end",
17691
+ "device-event",
17692
+ "package-event"
17693
+ ]);
17694
+ /** Subject summary frozen on the row at fire time (survives rule/record edits). */
17695
+ var NcHistorySubjectSchema = object({
17696
+ className: string(),
17697
+ label: string().optional(),
17698
+ confidence: number().optional(),
17699
+ zones: array(string()),
17700
+ timestamp: number()
17701
+ });
17702
+ /**
17703
+ * One delivery-history row. This is a read-only VIEW over the durable
17704
+ * outbox row (single source of truth — the same row the drain loop drives;
17705
+ * NO second write path, so history can never drift from delivery state).
17706
+ * The §3.2 fields map directly: `ruleId`/`targetId`/`deviceId` are columns,
17707
+ * `eventRef` is `recordKind`+`recordId`, `timestamps` are `createdAt`
17708
+ * (fire) / `updatedAt` (last transition), `status` + `error` are the
17709
+ * lifecycle. `ruleName` + `subject` are the intent snapshot frozen at
17710
+ * enqueue. `userId?` (per-recipient history) is P2 — no user dimension in
17711
+ * P1 (admin scope only).
17712
+ */
17713
+ var NcHistoryEntrySchema = object({
17714
+ /** Outbox row id — the stable dedup id `ruleId:dedupRef:targetId`. */
17715
+ id: string(),
17716
+ ruleId: string(),
17717
+ /** Rule name frozen at fire time (outlives a later rename / delete). */
17718
+ ruleName: string(),
17719
+ /** The rule urgency/trigger that produced this delivery. */
17720
+ delivery: NcDeliverySchema,
17721
+ targetId: string(),
17722
+ deviceId: number(),
17723
+ recordKind: NcHistoryRecordKindSchema,
17724
+ /** Event / track ref of the evaluated record (§3.2 `eventRef`). */
17725
+ recordId: string(),
17726
+ /** Present for track-scoped deliveries (object-event / track-end). */
17727
+ trackId: string().optional(),
17728
+ status: NcHistoryStatusSchema,
17729
+ /** Delivery attempts made so far. */
17730
+ attempts: number().int(),
17731
+ /** Fire time (outbox enqueue). */
17732
+ createdAt: number(),
17733
+ /** Last transition time (terminal for sent / dead). */
17734
+ updatedAt: number(),
17735
+ /** Failure detail — present on a `dead` row. */
17736
+ error: string().optional(),
17737
+ subject: NcHistorySubjectSchema
17325
17738
  });
17326
- var GenerateVisionInputSchema = LlmGenerateBaseInputSchema.extend({ images: array(LlmImageSchema).min(1) });
17327
- var ProfileRefInputSchema = object({
17328
- addonId: string(),
17329
- profileId: string()
17739
+ /**
17740
+ * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
17741
+ * AND; absent = unbounded on that axis. `since`/`until` bound the fire time
17742
+ * (`createdAt`, epoch ms, inclusive). `limit` is clamped to
17743
+ * {@link NC_HISTORY_LIMIT_MAX}. `userId` (per-recipient filtering) is P2.
17744
+ */
17745
+ var NcHistoryFilterSchema = object({
17746
+ ruleId: string().optional(),
17747
+ deviceId: number().optional(),
17748
+ status: NcHistoryStatusSchema.optional(),
17749
+ since: number().optional(),
17750
+ until: number().optional(),
17751
+ limit: number().int().min(1).max(500).default(100)
17330
17752
  });
17331
- method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(GenerateVisionInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
17332
- kind: "mutation",
17333
- auth: "admin"
17334
- }), method(ProfileRefInputSchema, _void(), {
17753
+ 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 }), {
17335
17754
  kind: "mutation",
17336
- auth: "admin"
17337
- }), method(ProfileRefInputSchema, LlmGenerateResultSchema, {
17755
+ auth: "admin",
17756
+ caller: "required"
17757
+ }), method(object({
17758
+ ruleId: string(),
17759
+ patch: NcRulePatchSchema
17760
+ }), object({ rule: NcRuleSchema }), {
17338
17761
  kind: "mutation",
17339
- auth: "admin"
17340
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
17341
- selector: LlmDefaultSelectorSchema,
17342
- profileId: string().nullable()
17343
- }), _void(), {
17762
+ auth: "admin",
17763
+ caller: "required"
17764
+ }), method(object({ ruleId: string() }), object({ success: literal(true) }), {
17344
17765
  kind: "mutation",
17345
17766
  auth: "admin"
17346
17767
  }), method(object({
17347
- since: number().optional(),
17348
- until: number().optional(),
17349
- consumer: string().optional(),
17350
- profileId: string().optional()
17351
- }), array(LlmUsageRollupSchema)), method(object({}), array(ManagedModelCatalogEntrySchema)), method(object({}), array(LlmRuntimeNodeSchema)), method(object({ nodeId: string() }), array(LlmNodeModelSchema)), method(object({
17352
- nodeId: string(),
17353
- model: ManagedModelRefSchema
17354
- }), _void(), {
17768
+ ruleId: string(),
17769
+ enabled: boolean()
17770
+ }), object({ success: literal(true) }), {
17355
17771
  kind: "mutation",
17356
17772
  auth: "admin"
17357
17773
  }), method(object({
17358
- nodeId: string(),
17359
- file: string()
17360
- }), _void(), {
17361
- kind: "mutation",
17362
- auth: "admin"
17363
- }), method(ProfileRefInputSchema, LlmRuntimeStatusSchema), method(ProfileRefInputSchema, LlmRuntimeStatusSchema, {
17364
- kind: "mutation",
17365
- auth: "admin"
17366
- }), method(ProfileRefInputSchema, _void(), {
17774
+ rule: NcRuleInputSchema,
17775
+ lookbackMinutes: number().int().min(1).max(1440).default(60)
17776
+ }), object({ results: array(NcTestResultSchema) }), {
17367
17777
  kind: "mutation",
17368
17778
  auth: "admin"
17369
- });
17779
+ }), method(object({}), object({ catalog: array(NcConditionDescriptorSchema) })), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" });
17370
17780
  /**
17371
17781
  * Zod schemas for persisted record types.
17372
17782
  *
@@ -18076,76 +18486,6 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
18076
18486
  eventId: string(),
18077
18487
  timestamp: number()
18078
18488
  });
18079
- /**
18080
- * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
18081
- * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
18082
- * caps into per-camera event-kind descriptors.
18083
- *
18084
- * The descriptor DATA (color / iconId / labelKey / parentKind / category)
18085
- * is NOT duplicated here — every entry is derived from the single
18086
- * `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
18087
- * ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
18088
- * control cap means adding one line here (and a taxonomy entry); the anti-
18089
- * drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
18090
- * eventful cap is missing.
18091
- */
18092
- /** Map a taxonomy `iconId` onto the legacy closed `EventKindIcon` enum. */
18093
- var LEGACY_ICON = {
18094
- motion: "motion",
18095
- audio: "audio",
18096
- person: "person",
18097
- vehicle: "vehicle",
18098
- animal: "animal",
18099
- package: "package",
18100
- door: "door",
18101
- pir: "pir",
18102
- smoke: "smoke",
18103
- water: "water",
18104
- button: "button",
18105
- generic: "generic",
18106
- gas: "smoke",
18107
- vibration: "generic",
18108
- tamper: "generic",
18109
- presence: "person",
18110
- lock: "generic",
18111
- siren: "generic",
18112
- switch: "generic",
18113
- doorbell: "button"
18114
- };
18115
- function legacyIcon(iconId) {
18116
- return LEGACY_ICON[iconId] ?? "generic";
18117
- }
18118
- /**
18119
- * Cap name → taxonomy kind id. Covers EVERY eventful sensor / control cap.
18120
- * The anti-drift guard cross-checks this against the eventful caps declared
18121
- * in `packages/types/src/capabilities/*.cap.ts`.
18122
- */
18123
- var CAP_TO_KIND = {
18124
- contact: "contact",
18125
- motion: "motion-sensor",
18126
- smoke: "smoke",
18127
- flood: "flood",
18128
- gas: "gas",
18129
- "carbon-monoxide": "carbon-monoxide",
18130
- vibration: "vibration",
18131
- tamper: "tamper",
18132
- presence: "presence",
18133
- "enum-sensor": "enum-sensor",
18134
- "event-emitter": "device-event",
18135
- "lock-control": "lock",
18136
- switch: "switch",
18137
- button: "button",
18138
- doorbell: "doorbell"
18139
- };
18140
- function buildDescriptor(capName, kind) {
18141
- const t = EVENT_TAXONOMY[kind];
18142
- if (t === void 0) throw new Error(`EVENT_KIND_BY_CAP: cap '${capName}' maps to unknown taxonomy kind '${kind}'`);
18143
- return {
18144
- ...t,
18145
- icon: legacyIcon(t.iconId)
18146
- };
18147
- }
18148
- Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
18149
18489
  var CameraPipelineConfigSchema = object({
18150
18490
  engine: PipelineEngineChoiceSchema.optional(),
18151
18491
  steps: array(PipelineStepInputSchema).readonly(),
@@ -18631,6 +18971,76 @@ method(object({
18631
18971
  auth: "admin"
18632
18972
  });
18633
18973
  /**
18974
+ * Cap → event-kind mapping for the SENSOR / CONTROL cap families — the table
18975
+ * `pipeline-analytics.listEventKinds` uses to turn a linked device's bound
18976
+ * caps into per-camera event-kind descriptors.
18977
+ *
18978
+ * The descriptor DATA (color / iconId / labelKey / parentKind / category)
18979
+ * is NOT duplicated here — every entry is derived from the single
18980
+ * `EVENT_TAXONOMY` dictionary (`catalogs/event-taxonomy.ts`). This file owns
18981
+ * ONLY the cap-name → taxonomy-kind mapping. Adding a new eventful sensor /
18982
+ * control cap means adding one line here (and a taxonomy entry); the anti-
18983
+ * drift guard `scripts/check-event-kind-coverage.ts` fails the build if an
18984
+ * eventful cap is missing.
18985
+ */
18986
+ /** Map a taxonomy `iconId` onto the legacy closed `EventKindIcon` enum. */
18987
+ var LEGACY_ICON = {
18988
+ motion: "motion",
18989
+ audio: "audio",
18990
+ person: "person",
18991
+ vehicle: "vehicle",
18992
+ animal: "animal",
18993
+ package: "package",
18994
+ door: "door",
18995
+ pir: "pir",
18996
+ smoke: "smoke",
18997
+ water: "water",
18998
+ button: "button",
18999
+ generic: "generic",
19000
+ gas: "smoke",
19001
+ vibration: "generic",
19002
+ tamper: "generic",
19003
+ presence: "person",
19004
+ lock: "generic",
19005
+ siren: "generic",
19006
+ switch: "generic",
19007
+ doorbell: "button"
19008
+ };
19009
+ function legacyIcon(iconId) {
19010
+ return LEGACY_ICON[iconId] ?? "generic";
19011
+ }
19012
+ /**
19013
+ * Cap name → taxonomy kind id. Covers EVERY eventful sensor / control cap.
19014
+ * The anti-drift guard cross-checks this against the eventful caps declared
19015
+ * in `packages/types/src/capabilities/*.cap.ts`.
19016
+ */
19017
+ var CAP_TO_KIND = {
19018
+ contact: "contact",
19019
+ motion: "motion-sensor",
19020
+ smoke: "smoke",
19021
+ flood: "flood",
19022
+ gas: "gas",
19023
+ "carbon-monoxide": "carbon-monoxide",
19024
+ vibration: "vibration",
19025
+ tamper: "tamper",
19026
+ presence: "presence",
19027
+ "enum-sensor": "enum-sensor",
19028
+ "event-emitter": "device-event",
19029
+ "lock-control": "lock",
19030
+ switch: "switch",
19031
+ button: "button",
19032
+ doorbell: "doorbell"
19033
+ };
19034
+ function buildDescriptor(capName, kind) {
19035
+ const t = EVENT_TAXONOMY[kind];
19036
+ if (t === void 0) throw new Error(`EVENT_KIND_BY_CAP: cap '${capName}' maps to unknown taxonomy kind '${kind}'`);
19037
+ return {
19038
+ ...t,
19039
+ icon: legacyIcon(t.iconId)
19040
+ };
19041
+ }
19042
+ Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
19043
+ /**
18634
19044
  * server-management — per-NODE singleton capability for a node's ROOT
18635
19045
  * package lifecycle (runtime-updatable node packages).
18636
19046
  *
@@ -20180,7 +20590,28 @@ var FaceInfoSchema = object({
20180
20590
  * (`/addon/<addonId>/event-media/<keyFrameMediaKey>`). Absent when the
20181
20591
  * track produced no key frame (e.g. native/onboard source) — the UI falls
20182
20592
  * back to the inline `base64` face crop. */
20183
- keyFrameMediaKey: string().optional()
20593
+ keyFrameMediaKey: string().optional(),
20594
+ /** Winning identity-match cosine (0..1) for this face's track, when an
20595
+ * identity was auto-confirmed. Lets the UI surface WHY a face was assigned
20596
+ * (confidence badge / low-confidence audit). Absent on legacy rows and on
20597
+ * faces that were never auto-recognized. */
20598
+ bestMatchScore: number().optional(),
20599
+ /** Native-scale face short side (px) at recognition time, when the runner
20600
+ * measured it. Lets the UI flag low-resolution auto-assignments. Absent on
20601
+ * legacy rows / runners that reported no native measure. */
20602
+ nativeFaceShortSidePx: number().optional(),
20603
+ /** SUGGESTED identity for this face — a plausible-but-not-confident match that
20604
+ * MISSED auto-assignment (cosine in the suggestion band, or above threshold
20605
+ * but blocked only by the recognition size floor). Mutually exclusive with
20606
+ * `recognizedIdentityId` (a suggestion is NEVER an assignment): the face stays
20607
+ * UNASSIGNED and everything else keeps treating it as unrecognized — the UI
20608
+ * merely offers a one-tap "is this <name>?" confirm. Absent on legacy rows and
20609
+ * on faces that were auto-assigned or below the suggestion band. (2026-07-24) */
20610
+ suggestedIdentityId: string().optional(),
20611
+ /** Peak identity-match cosine (0..1) for `suggestedIdentityId`, captured at the
20612
+ * same moment as `bestMatchScore` (track peak, at close). Lets the UI rank /
20613
+ * badge suggestion confidence. Present iff `suggestedIdentityId` is. (2026-07-24) */
20614
+ suggestedMatchScore: number().optional()
20184
20615
  });
20185
20616
  var FaceFilterEnum = _enum([
20186
20617
  "unassigned",
@@ -22286,36 +22717,6 @@ Object.freeze({
22286
22717
  addonId: null,
22287
22718
  access: "view"
22288
22719
  },
22289
- "advancedNotifier.deleteRule": {
22290
- capName: "advanced-notifier",
22291
- capScope: "system",
22292
- addonId: null,
22293
- access: "delete"
22294
- },
22295
- "advancedNotifier.getHistory": {
22296
- capName: "advanced-notifier",
22297
- capScope: "system",
22298
- addonId: null,
22299
- access: "view"
22300
- },
22301
- "advancedNotifier.getRules": {
22302
- capName: "advanced-notifier",
22303
- capScope: "system",
22304
- addonId: null,
22305
- access: "view"
22306
- },
22307
- "advancedNotifier.testRule": {
22308
- capName: "advanced-notifier",
22309
- capScope: "system",
22310
- addonId: null,
22311
- access: "create"
22312
- },
22313
- "advancedNotifier.upsertRule": {
22314
- capName: "advanced-notifier",
22315
- capScope: "system",
22316
- addonId: null,
22317
- access: "create"
22318
- },
22319
22720
  "alarmPanel.arm": {
22320
22721
  capName: "alarm-panel",
22321
22722
  capScope: "device",
@@ -24620,6 +25021,60 @@ Object.freeze({
24620
25021
  addonId: null,
24621
25022
  access: "create"
24622
25023
  },
25024
+ "notificationRules.createRule": {
25025
+ capName: "notification-rules",
25026
+ capScope: "system",
25027
+ addonId: null,
25028
+ access: "create"
25029
+ },
25030
+ "notificationRules.deleteRule": {
25031
+ capName: "notification-rules",
25032
+ capScope: "system",
25033
+ addonId: null,
25034
+ access: "delete"
25035
+ },
25036
+ "notificationRules.getConditionCatalog": {
25037
+ capName: "notification-rules",
25038
+ capScope: "system",
25039
+ addonId: null,
25040
+ access: "view"
25041
+ },
25042
+ "notificationRules.getHistory": {
25043
+ capName: "notification-rules",
25044
+ capScope: "system",
25045
+ addonId: null,
25046
+ access: "view"
25047
+ },
25048
+ "notificationRules.getRule": {
25049
+ capName: "notification-rules",
25050
+ capScope: "system",
25051
+ addonId: null,
25052
+ access: "view"
25053
+ },
25054
+ "notificationRules.listRules": {
25055
+ capName: "notification-rules",
25056
+ capScope: "system",
25057
+ addonId: null,
25058
+ access: "view"
25059
+ },
25060
+ "notificationRules.setRuleEnabled": {
25061
+ capName: "notification-rules",
25062
+ capScope: "system",
25063
+ addonId: null,
25064
+ access: "create"
25065
+ },
25066
+ "notificationRules.testRule": {
25067
+ capName: "notification-rules",
25068
+ capScope: "system",
25069
+ addonId: null,
25070
+ access: "create"
25071
+ },
25072
+ "notificationRules.updateRule": {
25073
+ capName: "notification-rules",
25074
+ capScope: "system",
25075
+ addonId: null,
25076
+ access: "create"
25077
+ },
24623
25078
  "notifier.cancel": {
24624
25079
  capName: "notifier",
24625
25080
  capScope: "device",
@@ -27490,12 +27945,6 @@ Object.defineProperty(exports, "recordingExportCapability", {
27490
27945
  return recordingExportCapability;
27491
27946
  }
27492
27947
  });
27493
- Object.defineProperty(exports, "resolveScrubThumbnailGeometry", {
27494
- enumerable: true,
27495
- get: function() {
27496
- return resolveScrubThumbnailGeometry;
27497
- }
27498
- });
27499
27948
  Object.defineProperty(exports, "runtimeDevices", {
27500
27949
  enumerable: true,
27501
27950
  get: function() {