@camstack/addon-notifiers 1.2.604 → 1.2.606

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 (3) hide show
  1. package/dist/addon.js +419 -124
  2. package/dist/addon.mjs +419 -124
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -5577,7 +5577,7 @@ var ZodIssueCode = {
5577
5577
  var ZodFirstPartyTypeKind;
5578
5578
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5579
5579
  //#endregion
5580
- //#region ../types/dist/sleep-BxjU_fJM.mjs
5580
+ //#region ../types/dist/sleep-BSuCCFjf.mjs
5581
5581
  /**
5582
5582
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5583
5583
  * window to float samples (D455).
@@ -7960,9 +7960,9 @@ function normalizeAddonInitResult(result) {
7960
7960
  return result;
7961
7961
  }
7962
7962
  /**
7963
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7964
- * and validates them (`share-token.service.ts` builds its enum from this
7965
- * list); a data plane names the kinds it ACCEPTS in `share`.
7963
+ * The share-view scope kinds a share-link token can carry. The hub mints
7964
+ * and validates them (`ShareViewGrantSchema` builds its
7965
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7966
7966
  */
7967
7967
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7968
7968
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -12938,7 +12938,7 @@ var ConvertResultSchema = object({
12938
12938
  * `super_admin` — collapsed onto the single boolean because every
12939
12939
  * non-admin caller is governed by the same scope-check rules; the
12940
12940
  * distinction was only ever used to route role-specific procedures
12941
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12941
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
12942
12942
  * with `isAdmin: false` + an explicit scope list.
12943
12943
  */
12944
12944
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -13127,10 +13127,12 @@ var AddonRoutesScopeSchema = object({
13127
13127
  type: literal("addon-routes"),
13128
13128
  access: array(MethodAccessSchema).min(1)
13129
13129
  });
13130
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
13130
13131
  var CredentialScopeSchema = union([
13131
13132
  literal("*"),
13132
13133
  ShareViewScopeSchema,
13133
13134
  AddonRoutesScopeSchema,
13135
+ PreferencesSelfScopeSchema,
13134
13136
  TokenScopeSchema
13135
13137
  ]);
13136
13138
  object({
@@ -13139,6 +13141,55 @@ object({
13139
13141
  jti: string().min(16),
13140
13142
  scopes: array(CredentialScopeSchema).min(1)
13141
13143
  });
13144
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
13145
+ /** A namespace's value: a JSON object, opaque to the hub. */
13146
+ var PreferenceValueSchema = record(string(), unknown());
13147
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
13148
+ /** A stored row, as the owner reads it. */
13149
+ var PreferenceRowSchema = object({
13150
+ namespace: PreferenceNamespaceSchema,
13151
+ value: PreferenceValueSchema,
13152
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
13153
+ revision: number().int().positive(),
13154
+ updatedAt: number().int(),
13155
+ /** The client id the last writer sent; `null` when it sent none. */
13156
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
13157
+ });
13158
+ object({
13159
+ /** Absent: every namespace the caller holds. */
13160
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
13161
+ object({ rows: array(PreferenceRowSchema) });
13162
+ object({
13163
+ namespace: PreferenceNamespaceSchema,
13164
+ value: PreferenceValueSchema,
13165
+ /**
13166
+ * The revision the edit was based on. Absent: last write wins. `0`: the
13167
+ * namespace must not exist yet. Any other value that is not the current
13168
+ * revision answers `conflict` and writes nothing.
13169
+ */
13170
+ baseRevision: number().int().nonnegative().optional(),
13171
+ deviceId: PreferenceDeviceIdSchema.optional()
13172
+ });
13173
+ discriminatedUnion("status", [object({
13174
+ status: literal("saved"),
13175
+ row: PreferenceRowSchema
13176
+ }), object({
13177
+ status: literal("conflict"),
13178
+ current: PreferenceRowSchema.nullable()
13179
+ })]);
13180
+ object({ namespace: PreferenceNamespaceSchema });
13181
+ object({
13182
+ /** `false` when the namespace did not exist. */
13183
+ deleted: boolean() });
13184
+ object({
13185
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
13186
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
13187
+ object({
13188
+ /** Every row whose revision differs from the client's, and every row it did not list. */
13189
+ rows: array(PreferenceRowSchema),
13190
+ /** Namespaces the client listed that no longer exist. */
13191
+ deleted: array(PreferenceNamespaceSchema)
13192
+ });
13142
13193
  _enum(["new-session", "step-up"]);
13143
13194
  /** The languages the hub's app landing pages are written in (D858). */
13144
13195
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -17305,7 +17356,19 @@ var DeviceHistorySubjectSchema = discriminatedUnion("kind", [object({
17305
17356
  kind: literal("node"),
17306
17357
  nodeId: string().min(1)
17307
17358
  })]);
17359
+ /**
17360
+ * `enum` stores a STATE as the ordinal of its value in the series' value list
17361
+ * (`DeviceHistorySeriesInfo.values`, append-only, so an ordinal never changes
17362
+ * meaning); a rollup keeps the time spent in each state (`states`).
17363
+ */
17308
17364
  var DeviceHistoryKindSchema = _enum([
17365
+ "gauge",
17366
+ "counter",
17367
+ "boolean",
17368
+ "enum"
17369
+ ]);
17370
+ /** What a PRODUCER may declare. `enum` is cap-only: its value list is the cap field's. */
17371
+ var DeviceHistoryProducerKindSchema = _enum([
17309
17372
  "gauge",
17310
17373
  "counter",
17311
17374
  "boolean"
@@ -17342,7 +17405,13 @@ var SeriesInfoSchema = object({
17342
17405
  /** `null` is unknown (a `unitFrom` series whose device does not state a unit right now), never a guess. */
17343
17406
  unit: string().nullable(),
17344
17407
  displayName: string(),
17345
- source: _enum(["cap", "addon"]),
17408
+ source: _enum([
17409
+ "cap",
17410
+ "addon",
17411
+ "derived"
17412
+ ]),
17413
+ /** `enum`: the value of each ordinal (index = ordinal); `null` for every other kind. */
17414
+ values: array(string()).readonly().nullable(),
17346
17415
  firstTs: number(),
17347
17416
  lastTs: number()
17348
17417
  });
@@ -17356,17 +17425,31 @@ var QueryPointSchema = object({
17356
17425
  twMean: number().nullable(),
17357
17426
  min: number(),
17358
17427
  max: number(),
17359
- /** `null` is unknown, never zero (D393). */
17360
- last: number().nullable()
17428
+ /** `null` is unknown, never zero (D393). For an `enum` series: the ordinal of {@link state}. */
17429
+ last: number().nullable(),
17430
+ /**
17431
+ * The increase over the point: a `counter`'s growth since the previous point
17432
+ * or bucket (a drop is a reset, counted from zero), and for
17433
+ * {@link DEVICE_HISTORY_ENERGY_KEY} the kWh used in the bucket. `null` for
17434
+ * every other kind, and when it cannot be known.
17435
+ */
17436
+ delta: number().nullable(),
17437
+ /** `enum`: the state in force at the end of the point (the name of `last`); `null` otherwise. */
17438
+ state: string().nullable(),
17439
+ /** `enum` rollup: milliseconds spent in each state inside the bucket; `null` for raw points and other kinds. */
17440
+ states: record(string(), number()).nullable()
17361
17441
  });
17362
17442
  var QuerySeriesSchema = object({
17363
17443
  scope: string(),
17364
17444
  /** The last point STRICTLY BEFORE `from` in the chosen tier, so a step chart can start at the held value. */
17365
17445
  before: object({
17366
17446
  t: number(),
17367
- value: number().nullable()
17447
+ value: number().nullable(),
17448
+ state: string().nullable()
17368
17449
  }).nullable(),
17369
- points: array(QueryPointSchema).readonly()
17450
+ points: array(QueryPointSchema).readonly(),
17451
+ /** A derived key: the stored key its points were computed from; `null` for a stored series. */
17452
+ derivedFrom: string().nullable()
17370
17453
  });
17371
17454
  /** The window part of a query, shared by the device and node forms. */
17372
17455
  var QueryWindowShape = {
@@ -17382,6 +17465,23 @@ var QueryResultSchema = object({
17382
17465
  series: array(QuerySeriesSchema).readonly(),
17383
17466
  truncated: boolean()
17384
17467
  });
17468
+ /** One read of a batch: a device's key or a node's key (exactly one subject). */
17469
+ var QueryManyItemSchema = union([object({
17470
+ deviceId: number().int(),
17471
+ key: string(),
17472
+ scope: string().optional()
17473
+ }), object({
17474
+ forNodeId: string().min(1),
17475
+ key: string(),
17476
+ scope: string().optional()
17477
+ })]);
17478
+ var QueryManyEntrySchema = discriminatedUnion("ok", [object({
17479
+ ok: literal(true),
17480
+ result: QueryResultSchema
17481
+ }), object({
17482
+ ok: literal(false),
17483
+ error: string()
17484
+ })]);
17385
17485
  var TierStatusSchema = object({
17386
17486
  tier: DeviceHistoryResolutionSchema,
17387
17487
  /** `null` until the first background count answered. */
@@ -17437,16 +17537,22 @@ var DeviceHistoryStatusSchema = object({
17437
17537
  lastRefreshAt: number().nullable()
17438
17538
  })
17439
17539
  });
17440
- method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ nodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
17540
+ method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ forNodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
17441
17541
  deviceId: number().int(),
17442
17542
  ...QueryWindowShape
17443
17543
  }), QueryResultSchema), method(object({
17444
- nodeId: string().min(1),
17544
+ forNodeId: string().min(1),
17445
17545
  ...QueryWindowShape
17446
17546
  }), QueryResultSchema, { auth: "admin" }), method(object({
17547
+ items: array(QueryManyItemSchema).min(1).max(24),
17548
+ from: QueryWindowShape.from,
17549
+ to: QueryWindowShape.to,
17550
+ resolution: QueryWindowShape.resolution,
17551
+ maxPoints: QueryWindowShape.maxPoints
17552
+ }), object({ results: array(QueryManyEntrySchema).readonly() }), { auth: "admin" }), method(object({
17447
17553
  name: string().regex(/^[a-z0-9-]+$/),
17448
17554
  subjectKind: _enum(["device", "node"]),
17449
- kind: DeviceHistoryKindSchema,
17555
+ kind: DeviceHistoryProducerKindSchema,
17450
17556
  unit: string().optional(),
17451
17557
  displayName: string().min(1),
17452
17558
  ingest: _enum(["points", "buckets"])
@@ -40036,38 +40142,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
40036
40142
  auth: "admin",
40037
40143
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40038
40144
  });
40145
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
40146
+ /** What a model (or, by default, every model of a kind) can do. */
40147
+ var LlmModelFeaturesSchema = object({
40148
+ vision: boolean(),
40149
+ tools: boolean(),
40150
+ streaming: boolean()
40151
+ });
40152
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
40153
+ var LlmModelInfoSchema = object({
40154
+ id: string(),
40155
+ label: string().optional(),
40156
+ contextLength: number().int().positive().optional(),
40157
+ features: LlmModelFeaturesSchema.partial().optional()
40158
+ });
40039
40159
  /**
40040
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
40041
- * methods concat-fan across providers; single-row methods route to ONE
40042
- * provider by the `addonId` in the call input (the notification-output
40043
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
40044
- * (hub-placed); the cap stays open for future providers.
40045
- *
40046
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
40047
- * `apiKey` is a password field — providers REDACT it on read and merge on
40048
- * write; a stored key NEVER round-trips to a client.
40160
+ * The provider-specific part of a profile, validated by the provider that owns
40161
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
40162
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
40163
+ * keychain, never in the row, and reads back as the redaction marker.
40049
40164
  */
40050
- var LlmProfileKindSchema = _enum([
40051
- "openai-compatible",
40052
- "openai",
40053
- "anthropic",
40054
- "google",
40055
- "managed-local",
40056
- "apple-foundation"
40057
- ]);
40165
+ var LlmProviderConfigSchema = record(string(), unknown());
40058
40166
  var LlmProfileSchema = object({
40059
40167
  id: string(),
40060
40168
  name: string(),
40169
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
40061
40170
  kind: LlmProfileKindSchema,
40062
40171
  /** Stamped by the provider — keeps the fanned catalog routable. */
40063
40172
  addonId: string(),
40064
40173
  enabled: boolean(),
40065
40174
  /** Vendor model id, or the managed runtime's loaded model. */
40066
40175
  model: string(),
40067
- /** Required for openai-compatible; override for cloud kinds. */
40068
- baseUrl: string().optional(),
40069
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
40070
- apiKey: string().optional(),
40071
40176
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
40072
40177
  * degraded to text — that shipped once and produced a confident answer to a
40073
40178
  * question about a picture nobody sent. */
@@ -40075,15 +40180,11 @@ var LlmProfileSchema = object({
40075
40180
  temperature: number().min(0).max(2).optional(),
40076
40181
  /** Nucleus sampling. Every wire we speak has it. */
40077
40182
  topP: number().min(0).max(1).optional(),
40078
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
40079
- * wire does, and the client drops it there (measured: the request body gets
40080
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
40081
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
40183
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
40184
+ * field in its editor only when its descriptor lists it in `profileFields`. */
40082
40185
  topK: number().int().positive().optional(),
40083
40186
  maxTokens: number().int().positive().optional(),
40084
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
40085
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
40086
- * the model with, so it is the one field that changes a PROCESS. */
40187
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
40087
40188
  contextLength: number().int().positive().optional(),
40088
40189
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
40089
40190
  * two system prompts fighting is worse than either alone). */
@@ -40109,16 +40210,37 @@ var LlmProfileSchema = object({
40109
40210
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
40110
40211
  * `true` here buys the wiring, not behaviour, until tools are registered. */
40111
40212
  toolsEnabled: boolean().default(false),
40112
- extraHeaders: record(string(), string()).optional(),
40113
- /** kind === 'managed-local' only (spec §4). */
40114
- runtime: ManagedRuntimeConfigSchema.optional(),
40115
- /**
40116
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
40117
- * to configure (no key, no URL, no download; `model` is `apple-system`).
40118
- * `supportsVision` on such a row is stamped by the provider from the node's
40119
- * reported `imageInput`, never taken from the operator (D62).
40120
- */
40121
- appleFoundation: object({ nodeId: string() }).optional()
40213
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
40214
+ providerConfig: LlmProviderConfigSchema.default({})
40215
+ });
40216
+ /**
40217
+ * The common profile fields a kind's editor offers. The editor owns how each
40218
+ * one is drawn; the provider says which of them mean something on its wire.
40219
+ */
40220
+ var LlmProfileFieldSchema = _enum([
40221
+ "temperature",
40222
+ "topP",
40223
+ "topK",
40224
+ "maxTokens",
40225
+ "contextLength",
40226
+ "systemPrompt",
40227
+ "timeoutMs",
40228
+ "connectTimeoutMs",
40229
+ "firstTokenTimeoutMs",
40230
+ "idleTimeoutMs",
40231
+ "retry",
40232
+ "toolsEnabled"
40233
+ ]);
40234
+ /**
40235
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
40236
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
40237
+ * picker: that widget owns the model choice.
40238
+ */
40239
+ var LlmProviderWidgetSchema = object({
40240
+ id: string(),
40241
+ placement: _enum(["connection", "model"]),
40242
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
40243
+ requires: array(string()).optional()
40122
40244
  });
40123
40245
  /** ConfigUISchema tree passed through untyped on the wire (the
40124
40246
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -40127,11 +40249,56 @@ var ConfigSchemaPassthrough$3 = unknown();
40127
40249
  var LlmProfileKindDescriptorSchema = object({
40128
40250
  kind: LlmProfileKindSchema,
40129
40251
  label: string(),
40252
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
40130
40253
  icon: string(),
40131
40254
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
40132
40255
  addonId: string(),
40133
- configSchema: ConfigSchemaPassthrough$3
40256
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
40257
+ connectionSchema: ConfigSchemaPassthrough$3,
40258
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
40259
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
40260
+ /** The kind's defaults; a model from `listModels` may override any of them. */
40261
+ features: LlmModelFeaturesSchema,
40262
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
40263
+ visionEditable: boolean(),
40264
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
40265
+ modelCatalog: _enum([
40266
+ "fetch",
40267
+ "static",
40268
+ "none"
40269
+ ]),
40270
+ staticModels: array(LlmModelInfoSchema).optional(),
40271
+ /** The common fields that mean something on this kind's wire. */
40272
+ profileFields: array(LlmProfileFieldSchema),
40273
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
40274
+ });
40275
+ /**
40276
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
40277
+ * (the editor's form); with `profileId` too, a secret the draft leaves
40278
+ * untouched (absent or the redaction marker) is resolved server-side from the
40279
+ * stored profile — the browser never receives it.
40280
+ */
40281
+ var LlmListModelsInputSchema = object({
40282
+ addonId: string(),
40283
+ kind: LlmProfileKindSchema,
40284
+ profileId: string().optional(),
40285
+ connection: LlmProviderConfigSchema.optional()
40134
40286
  });
40287
+ var LlmListModelsErrorCodeSchema = _enum([
40288
+ "auth",
40289
+ "network",
40290
+ "unsupported",
40291
+ "invalid"
40292
+ ]);
40293
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
40294
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
40295
+ ok: literal(true),
40296
+ models: array(LlmModelInfoSchema)
40297
+ }), object({
40298
+ ok: literal(false),
40299
+ code: LlmListModelsErrorCodeSchema,
40300
+ message: string()
40301
+ })]);
40135
40302
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
40136
40303
  var LlmDefaultSchema = object({
40137
40304
  selector: LlmDefaultSelectorSchema,
@@ -40231,7 +40398,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
40231
40398
  kind: "mutation",
40232
40399
  auth: "admin",
40233
40400
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40234
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
40401
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
40402
+ kind: "mutation",
40403
+ auth: "admin"
40404
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
40235
40405
  selector: LlmDefaultSelectorSchema,
40236
40406
  profileId: string().nullable()
40237
40407
  }), _void(), {
@@ -40399,14 +40569,106 @@ var LogEntrySchema = object({
40399
40569
  meta: record(string(), unknown()).optional(),
40400
40570
  tags: record(string(), string()).optional()
40401
40571
  });
40402
- method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
40403
- scope: array(string()).optional(),
40572
+ /**
40573
+ * A history READ against one destination (D898).
40574
+ *
40575
+ * Every filter is applied by the PROVIDER, before the limit — a filter the
40576
+ * browser applied after the limit is what made a rare device's lines
40577
+ * unreachable behind a busy one's. `before` / `after` are cursors the provider
40578
+ * minted (opaque to everyone else): a file position for the rotated files, a
40579
+ * nanosecond timestamp for Loki.
40580
+ *
40581
+ * A read is BOUNDED by `budgetMs`: a filter that matches nothing on a 30-day
40582
+ * store answers `done: false` with the cursor it reached and the bytes it
40583
+ * scanned, and the caller decides whether to go on. That is what makes a long
40584
+ * scan show progress and stop when asked — `cancelRead` ends the slice in
40585
+ * flight, and not asking for the next slice ends the scan.
40586
+ */
40587
+ var LogReadQuerySchema = object({
40588
+ /** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
40589
+ requestId: string().min(1).max(64).optional(),
40590
+ /** The device the line is about (`tags.deviceId`, numeric). */
40591
+ deviceId: number().int().optional(),
40592
+ /**
40593
+ * The emitting addon — bare manifest id; `@<version>` / `::<sub>` suffixes
40594
+ * match. Not `addonId`: a cap router reads that name as "which provider".
40595
+ */
40596
+ fromAddonId: string().min(1).max(200).optional(),
40597
+ /**
40598
+ * The emitting node: matches the agent that emitted the line, the node
40599
+ * itself, or a worker under it (`<agent>/<runner>`) — the `agentId`
40600
+ * semantics of `matchesLogTags`. Not `nodeId`: a cap router reads that
40601
+ * name as "which node's provider".
40602
+ */
40603
+ fromNodeId: string().min(1).max(200).optional(),
40604
+ /** Any other tag, exact match (AND). */
40605
+ tags: record(string(), union([string(), number()])).optional(),
40606
+ /** Severity FLOOR: this level and above. */
40404
40607
  level: LogLevelSchema.optional(),
40405
- since: date().optional(),
40406
- until: date().optional(),
40407
- limit: number().optional(),
40408
- tags: record(string(), string()).optional()
40409
- }), array(LogEntrySchema).readonly());
40608
+ /** Case-insensitive substring over message, scope, tag values and meta values. */
40609
+ text: string().min(1).max(200).optional(),
40610
+ /** Epoch ms, inclusive. */
40611
+ since: number().optional(),
40612
+ /** Epoch ms, inclusive. */
40613
+ until: number().optional(),
40614
+ /** Older than this cursor (exclusive). Absent with `after` absent ⇒ from the newest. */
40615
+ before: string().min(1).max(1024).optional(),
40616
+ /** Newer than this cursor (exclusive). */
40617
+ after: string().min(1).max(1024).optional(),
40618
+ limit: number().int().min(1).max(1e3).optional(),
40619
+ /** Wall-clock bound of this slice. The provider caps it. */
40620
+ budgetMs: number().int().min(50).max(1e4).optional()
40621
+ });
40622
+ var LogReadResultSchema = object({
40623
+ /** Newest first. */
40624
+ entries: array(object({
40625
+ /** `<bootId>.<seq>` minted by the emitting LogManager — the dedupe key. */
40626
+ id: string().optional(),
40627
+ /** Epoch ms. */
40628
+ timestamp: number(),
40629
+ level: LogLevelSchema,
40630
+ scope: string().optional(),
40631
+ message: string(),
40632
+ tags: record(string(), union([string(), number()])).optional(),
40633
+ meta: record(string(), unknown()).optional()
40634
+ })),
40635
+ /** Pass as `before` for the next older page; null when nothing older exists. */
40636
+ nextBefore: string().nullable(),
40637
+ /** Pass as `after` to read what arrived since; null when unknown. */
40638
+ nextAfter: string().nullable(),
40639
+ /** Bytes this slice read (files) or received (remote). Progress, not a promise. */
40640
+ scannedBytes: number().int().nonnegative(),
40641
+ /**
40642
+ * True when the scan in this direction reached the end of the store.
40643
+ * False with fewer than `limit` entries means the budget ran out first —
40644
+ * call again with `nextBefore` to go on.
40645
+ */
40646
+ done: boolean(),
40647
+ /** True when `cancelRead` ended this slice early. */
40648
+ cancelled: boolean().optional()
40649
+ });
40650
+ var LogReadCapabilitiesSchema = object({
40651
+ /** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
40652
+ readable: boolean(),
40653
+ /** Why not, when `readable` is false — rendered next to the source. */
40654
+ reason: string().nullable(),
40655
+ /** Filters the provider applies itself. A false one is applied by nobody. */
40656
+ filters: object({
40657
+ deviceId: boolean(),
40658
+ addonId: boolean(),
40659
+ nodeId: boolean(),
40660
+ tags: boolean(),
40661
+ level: boolean(),
40662
+ text: boolean(),
40663
+ timeRange: boolean()
40664
+ }),
40665
+ /** How far back the store reaches, when the provider knows (days). */
40666
+ retentionDays: number().nullable()
40667
+ });
40668
+ method(LogEntrySchema, _void(), { kind: "mutation" }), optionalMethod(_void(), LogReadCapabilitiesSchema, { auth: "admin" }), optionalMethod(LogReadQuerySchema, LogReadResultSchema, { auth: "admin" }), optionalMethod(object({ requestId: string().min(1).max(64) }), object({ cancelled: boolean() }), {
40669
+ kind: "mutation",
40670
+ auth: "admin"
40671
+ });
40410
40672
  /**
40411
40673
  * `login-method` — collection cap through which auth addons contribute
40412
40674
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -42984,6 +43246,33 @@ var NcRuleTargetSchema = object({
42984
43246
  params: record(string(), unknown()).optional()
42985
43247
  });
42986
43248
  /**
43249
+ * WHAT THE NOTIFICATION'S PICTURE IS (D897) — the ONE media choice of a rule.
43250
+ *
43251
+ * Every mode starts from the same CLEAN source frame of the trigger moment
43252
+ * (keyFrame → sceneFrame → lastSceneFrame, narrowed to the trigger instant and
43253
+ * to the zone that fired the rule) and renders it once at send time:
43254
+ * - `scene-boxes` — the whole scene, the subject outlined thick in the accent
43255
+ * colour and every OTHER track visible at that instant outlined thin, each
43256
+ * labelled with class and confidence ("dog 87%").
43257
+ * - `crop` — the subject cut out of that frame around its box at that instant.
43258
+ * - `clean` — the whole scene with nothing drawn on it.
43259
+ * - `none` — no picture.
43260
+ *
43261
+ * A mode that cannot be honoured (no box at that instant, a photograph with no
43262
+ * tracked subject) ships `clean` and names the reason in the log, per camera.
43263
+ * It replaces the `attach` × `frame` × `zoneCrop` triple, which let one rule
43264
+ * ship a crop on one event and a boxed scene on the next depending on which
43265
+ * stored kind had landed.
43266
+ */
43267
+ var NcMediaImageSchema = _enum([
43268
+ "scene-boxes",
43269
+ "crop",
43270
+ "clean",
43271
+ "none"
43272
+ ]);
43273
+ /**
43274
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
43275
+ *
42987
43276
  * Media attachment policy (P1 still-image subset).
42988
43277
  * - `best` — the best AVAILABLE subject image at dispatch time (D-3).
42989
43278
  * - `best-matching` — the media that explains WHY the rule fired: a rule
@@ -42997,6 +43286,8 @@ var NcRuleTargetSchema = object({
42997
43286
  * - `none` — no attachment.
42998
43287
  */
42999
43288
  /**
43289
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
43290
+ *
43000
43291
  * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
43001
43292
  * conflate it with the selection strategy and betray the request: asking for
43002
43293
  * the clean scene frame on an object-event owner used to start at
@@ -43025,16 +43316,29 @@ var NcMediaFrameSchema = _enum([
43025
43316
  */
43026
43317
  var NcLinkedCameraModeSchema = _enum(["mosaic", "each"]);
43027
43318
  var NcMediaPolicySchema = object({
43319
+ /**
43320
+ * The picture — see {@link NcMediaImageSchema}. Absent on a rule nobody has
43321
+ * saved since D897: `normalizeNcMediaPolicy` derives it from the legacy
43322
+ * triple below, at load and at every write, and the store keeps only this.
43323
+ */
43324
+ image: NcMediaImageSchema.optional(),
43325
+ /**
43326
+ * Draw the zone that FIRED the rule on the picture (`scene-boxes` / `clean`;
43327
+ * a `crop` never shows it). Valid only on a rule whose trigger is a zone —
43328
+ * `conditions.zones` or an occupancy zone — and refused on save otherwise.
43329
+ * Replaces `zoneCrop`.
43330
+ */
43331
+ showTriggerZone: boolean().optional(),
43332
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
43028
43333
  attach: _enum([
43029
43334
  "best",
43030
43335
  "best-matching",
43031
43336
  "keyFrame",
43032
43337
  "none"
43033
- ]).default("best"),
43034
- /** What the still shows. Absent = `cropped` (the historical `best` shape). */
43338
+ ]).optional(),
43339
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
43035
43340
  frame: NcMediaFrameSchema.optional(),
43036
- /** Crop the attached still to the rule's condition-zone bbox (padded) —
43037
- * "show me the ZONE", not the whole scene or the subject crop. */
43341
+ /** @deprecated D897 — folded into `image: 'clean'` + `showTriggerZone` on save. */
43038
43342
  zoneCrop: boolean().optional(),
43039
43343
  /**
43040
43344
  * Also attach a short GIF cut from the stream broker's clip ring around the
@@ -43206,7 +43510,9 @@ var NcRuleInputSchema = object({
43206
43510
  * targets.
43207
43511
  */
43208
43512
  targetUsers: array(string()).optional(),
43209
- media: NcMediaPolicySchema.default({ attach: "best" }),
43513
+ /** Absent = the kind's default picture (`resolveNcMediaImage`): the subject crop for a
43514
+ * detection, the clean scene for a sensor or a sound. Set explicitly on save (D897). */
43515
+ media: NcMediaPolicySchema.default({}),
43210
43516
  throttle: NcThrottleSchema.default({
43211
43517
  cooldownSec: 60,
43212
43518
  scope: "rule-device"
@@ -44143,13 +44449,37 @@ var NcAlarmModeOpeningsSchema = object({
44143
44449
  /** Covered devices whose state could not be read (D49): neither open nor closed. */
44144
44450
  unknown: array(number().int())
44145
44451
  });
44452
+ /**
44453
+ * One alarm INPUT — a (rule, device) pair — the operator bypassed until the
44454
+ * next disarm ("Bypass this input until disarm" on a trigger notification, or
44455
+ * `nc.bypassAlarmInput`). Reported so an armed alarm with a silenced input
44456
+ * never looks fully armed (D62: off must never look like broken).
44457
+ */
44458
+ var NcAlarmInputBypassViewSchema = object({
44459
+ ruleId: string(),
44460
+ /** The rule's current name (its frozen name when the rule is gone). */
44461
+ ruleName: string(),
44462
+ /** The input: the sensor of the match, else its camera. */
44463
+ deviceId: number().int(),
44464
+ /** The input's current name. */
44465
+ name: string(),
44466
+ /** When it was bypassed (ms epoch). */
44467
+ since: number(),
44468
+ /** Triggers from this input dropped since. */
44469
+ dropped: number().int().min(0)
44470
+ });
44146
44471
  var NcAlarmLiveSchema = object({
44147
44472
  state: AlarmStateSchema,
44148
44473
  /** The mode being armed into (exit delay) or held; null when disarmed. */
44149
44474
  targetMode: AlarmArmModeSchema.nullable(),
44150
44475
  availableModes: array(AlarmArmModeSchema),
44151
44476
  openings: array(NcAlarmModeOpeningsSchema),
44152
- exclusions: array(NcAlarmExclusionViewSchema)
44477
+ exclusions: array(NcAlarmExclusionViewSchema),
44478
+ /**
44479
+ * Inputs bypassed for the rest of this arm session; cleared on disarm.
44480
+ * Defaulted so an older hub answer still parses (as "none known").
44481
+ */
44482
+ bypassedInputs: array(NcAlarmInputBypassViewSchema).default([])
44153
44483
  });
44154
44484
  var NcAlarmConfigSchema = object({
44155
44485
  /**
@@ -61248,26 +61578,6 @@ var ApiKeySummarySchema = object({
61248
61578
  createdAt: number(),
61249
61579
  lastUsedAt: number().optional()
61250
61580
  });
61251
- var ScopedTokenSummarySchema = object({
61252
- id: string(),
61253
- userId: string(),
61254
- name: string(),
61255
- tokenPrefix: string(),
61256
- scopes: array(TokenScopeSchema),
61257
- expiresAt: number().nullish(),
61258
- lastUsedAt: number().nullish(),
61259
- createdAt: number()
61260
- });
61261
- var CreateScopedTokenInputSchema = object({
61262
- userId: string(),
61263
- name: string(),
61264
- scopes: array(TokenScopeSchema),
61265
- expiresAt: number().optional()
61266
- });
61267
- var CreateScopedTokenResultSchema = object({
61268
- token: string(),
61269
- record: ScopedTokenSummarySchema
61270
- });
61271
61581
  var OauthSessionSummarySchema = object({
61272
61582
  id: string(),
61273
61583
  userId: string(),
@@ -61289,11 +61599,11 @@ var TotpStatusSchema = object({
61289
61599
  confirmedAt: number().nullable()
61290
61600
  });
61291
61601
  /**
61292
- * user-management — singleton capability for user accounts, API keys,
61293
- * and scoped tokens.
61602
+ * user-management — singleton capability for user accounts and the
61603
+ * legacy API-key rows.
61294
61604
  *
61295
61605
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
61296
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
61606
+ * — the subset check on `setUserScopes` is moot
61297
61607
  * because non-admins never reach these. If/when we open non-admin
61298
61608
  * delegation, structural caller-scope subset check goes inside the
61299
61609
  * provider.
@@ -61350,15 +61660,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
61350
61660
  kind: "mutation",
61351
61661
  auth: "admin",
61352
61662
  access: "delete"
61353
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
61354
- kind: "mutation",
61355
- auth: "admin",
61356
- access: "create"
61357
- }), method(object({ id: string() }), object({ success: literal(true) }), {
61358
- kind: "mutation",
61359
- auth: "admin",
61360
- access: "delete"
61361
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
61663
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
61362
61664
  kind: "mutation",
61363
61665
  auth: "admin",
61364
61666
  access: "create"
@@ -65514,7 +65816,7 @@ Object.freeze({
65514
65816
  capName: "llm",
65515
65817
  capScope: "system",
65516
65818
  addonId: null,
65517
- access: "view"
65819
+ access: "create"
65518
65820
  },
65519
65821
  "llm.listNodeModels": {
65520
65822
  capName: "llm",
@@ -65816,7 +66118,19 @@ Object.freeze({
65816
66118
  addonId: null,
65817
66119
  access: "view"
65818
66120
  },
65819
- "logDestination.query": {
66121
+ "logDestination.cancelRead": {
66122
+ capName: "log-destination",
66123
+ capScope: "system",
66124
+ addonId: null,
66125
+ access: "create"
66126
+ },
66127
+ "logDestination.describeRead": {
66128
+ capName: "log-destination",
66129
+ capScope: "system",
66130
+ addonId: null,
66131
+ access: "view"
66132
+ },
66133
+ "logDestination.read": {
65820
66134
  capName: "log-destination",
65821
66135
  capScope: "system",
65822
66136
  addonId: null,
@@ -70178,12 +70492,6 @@ Object.freeze({
70178
70492
  addonId: null,
70179
70493
  access: "create"
70180
70494
  },
70181
- "userManagement.createScopedToken": {
70182
- capName: "user-management",
70183
- capScope: "system",
70184
- addonId: null,
70185
- access: "create"
70186
- },
70187
70495
  "userManagement.createUser": {
70188
70496
  capName: "user-management",
70189
70497
  capScope: "system",
@@ -70232,12 +70540,6 @@ Object.freeze({
70232
70540
  addonId: null,
70233
70541
  access: "view"
70234
70542
  },
70235
- "userManagement.listScopedTokens": {
70236
- capName: "user-management",
70237
- capScope: "system",
70238
- addonId: null,
70239
- access: "view"
70240
- },
70241
70543
  "userManagement.listUsers": {
70242
70544
  capName: "user-management",
70243
70545
  capScope: "system",
@@ -70292,12 +70594,6 @@ Object.freeze({
70292
70594
  addonId: null,
70293
70595
  access: "delete"
70294
70596
  },
70295
- "userManagement.revokeScopedToken": {
70296
- capName: "user-management",
70297
- capScope: "system",
70298
- addonId: null,
70299
- access: "delete"
70300
- },
70301
70597
  "userManagement.setupTotp": {
70302
70598
  capName: "user-management",
70303
70599
  capScope: "system",
@@ -70328,12 +70624,6 @@ Object.freeze({
70328
70624
  addonId: null,
70329
70625
  access: "view"
70330
70626
  },
70331
- "userManagement.validateScopedToken": {
70332
- capName: "user-management",
70333
- capScope: "system",
70334
- addonId: null,
70335
- access: "view"
70336
- },
70337
70627
  "userManagement.verifyTotp": {
70338
70628
  capName: "user-management",
70339
70629
  capScope: "system",
@@ -71847,6 +72137,11 @@ Object.freeze({
71847
72137
  form: "single",
71848
72138
  optional: false
71849
72139
  }],
72140
+ "logDestination.read": [{
72141
+ name: "deviceId",
72142
+ form: "single",
72143
+ optional: true
72144
+ }],
71850
72145
  "mediaPlayer.getStatus": [{
71851
72146
  name: "deviceId",
71852
72147
  form: "single",