@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.mjs CHANGED
@@ -5550,7 +5550,7 @@ var ZodIssueCode = {
5550
5550
  var ZodFirstPartyTypeKind;
5551
5551
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5552
5552
  //#endregion
5553
- //#region ../types/dist/sleep-BxjU_fJM.mjs
5553
+ //#region ../types/dist/sleep-BSuCCFjf.mjs
5554
5554
  /**
5555
5555
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5556
5556
  * window to float samples (D455).
@@ -7933,9 +7933,9 @@ function normalizeAddonInitResult(result) {
7933
7933
  return result;
7934
7934
  }
7935
7935
  /**
7936
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7937
- * and validates them (`share-token.service.ts` builds its enum from this
7938
- * list); a data plane names the kinds it ACCEPTS in `share`.
7936
+ * The share-view scope kinds a share-link token can carry. The hub mints
7937
+ * and validates them (`ShareViewGrantSchema` builds its
7938
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7939
7939
  */
7940
7940
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7941
7941
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -12911,7 +12911,7 @@ var ConvertResultSchema = object({
12911
12911
  * `super_admin` — collapsed onto the single boolean because every
12912
12912
  * non-admin caller is governed by the same scope-check rules; the
12913
12913
  * distinction was only ever used to route role-specific procedures
12914
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12914
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
12915
12915
  * with `isAdmin: false` + an explicit scope list.
12916
12916
  */
12917
12917
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -13100,10 +13100,12 @@ var AddonRoutesScopeSchema = object({
13100
13100
  type: literal("addon-routes"),
13101
13101
  access: array(MethodAccessSchema).min(1)
13102
13102
  });
13103
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
13103
13104
  var CredentialScopeSchema = union([
13104
13105
  literal("*"),
13105
13106
  ShareViewScopeSchema,
13106
13107
  AddonRoutesScopeSchema,
13108
+ PreferencesSelfScopeSchema,
13107
13109
  TokenScopeSchema
13108
13110
  ]);
13109
13111
  object({
@@ -13112,6 +13114,55 @@ object({
13112
13114
  jti: string().min(16),
13113
13115
  scopes: array(CredentialScopeSchema).min(1)
13114
13116
  });
13117
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
13118
+ /** A namespace's value: a JSON object, opaque to the hub. */
13119
+ var PreferenceValueSchema = record(string(), unknown());
13120
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
13121
+ /** A stored row, as the owner reads it. */
13122
+ var PreferenceRowSchema = object({
13123
+ namespace: PreferenceNamespaceSchema,
13124
+ value: PreferenceValueSchema,
13125
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
13126
+ revision: number().int().positive(),
13127
+ updatedAt: number().int(),
13128
+ /** The client id the last writer sent; `null` when it sent none. */
13129
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
13130
+ });
13131
+ object({
13132
+ /** Absent: every namespace the caller holds. */
13133
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
13134
+ object({ rows: array(PreferenceRowSchema) });
13135
+ object({
13136
+ namespace: PreferenceNamespaceSchema,
13137
+ value: PreferenceValueSchema,
13138
+ /**
13139
+ * The revision the edit was based on. Absent: last write wins. `0`: the
13140
+ * namespace must not exist yet. Any other value that is not the current
13141
+ * revision answers `conflict` and writes nothing.
13142
+ */
13143
+ baseRevision: number().int().nonnegative().optional(),
13144
+ deviceId: PreferenceDeviceIdSchema.optional()
13145
+ });
13146
+ discriminatedUnion("status", [object({
13147
+ status: literal("saved"),
13148
+ row: PreferenceRowSchema
13149
+ }), object({
13150
+ status: literal("conflict"),
13151
+ current: PreferenceRowSchema.nullable()
13152
+ })]);
13153
+ object({ namespace: PreferenceNamespaceSchema });
13154
+ object({
13155
+ /** `false` when the namespace did not exist. */
13156
+ deleted: boolean() });
13157
+ object({
13158
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
13159
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
13160
+ object({
13161
+ /** Every row whose revision differs from the client's, and every row it did not list. */
13162
+ rows: array(PreferenceRowSchema),
13163
+ /** Namespaces the client listed that no longer exist. */
13164
+ deleted: array(PreferenceNamespaceSchema)
13165
+ });
13115
13166
  _enum(["new-session", "step-up"]);
13116
13167
  /** The languages the hub's app landing pages are written in (D858). */
13117
13168
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -17278,7 +17329,19 @@ var DeviceHistorySubjectSchema = discriminatedUnion("kind", [object({
17278
17329
  kind: literal("node"),
17279
17330
  nodeId: string().min(1)
17280
17331
  })]);
17332
+ /**
17333
+ * `enum` stores a STATE as the ordinal of its value in the series' value list
17334
+ * (`DeviceHistorySeriesInfo.values`, append-only, so an ordinal never changes
17335
+ * meaning); a rollup keeps the time spent in each state (`states`).
17336
+ */
17281
17337
  var DeviceHistoryKindSchema = _enum([
17338
+ "gauge",
17339
+ "counter",
17340
+ "boolean",
17341
+ "enum"
17342
+ ]);
17343
+ /** What a PRODUCER may declare. `enum` is cap-only: its value list is the cap field's. */
17344
+ var DeviceHistoryProducerKindSchema = _enum([
17282
17345
  "gauge",
17283
17346
  "counter",
17284
17347
  "boolean"
@@ -17315,7 +17378,13 @@ var SeriesInfoSchema = object({
17315
17378
  /** `null` is unknown (a `unitFrom` series whose device does not state a unit right now), never a guess. */
17316
17379
  unit: string().nullable(),
17317
17380
  displayName: string(),
17318
- source: _enum(["cap", "addon"]),
17381
+ source: _enum([
17382
+ "cap",
17383
+ "addon",
17384
+ "derived"
17385
+ ]),
17386
+ /** `enum`: the value of each ordinal (index = ordinal); `null` for every other kind. */
17387
+ values: array(string()).readonly().nullable(),
17319
17388
  firstTs: number(),
17320
17389
  lastTs: number()
17321
17390
  });
@@ -17329,17 +17398,31 @@ var QueryPointSchema = object({
17329
17398
  twMean: number().nullable(),
17330
17399
  min: number(),
17331
17400
  max: number(),
17332
- /** `null` is unknown, never zero (D393). */
17333
- last: number().nullable()
17401
+ /** `null` is unknown, never zero (D393). For an `enum` series: the ordinal of {@link state}. */
17402
+ last: number().nullable(),
17403
+ /**
17404
+ * The increase over the point: a `counter`'s growth since the previous point
17405
+ * or bucket (a drop is a reset, counted from zero), and for
17406
+ * {@link DEVICE_HISTORY_ENERGY_KEY} the kWh used in the bucket. `null` for
17407
+ * every other kind, and when it cannot be known.
17408
+ */
17409
+ delta: number().nullable(),
17410
+ /** `enum`: the state in force at the end of the point (the name of `last`); `null` otherwise. */
17411
+ state: string().nullable(),
17412
+ /** `enum` rollup: milliseconds spent in each state inside the bucket; `null` for raw points and other kinds. */
17413
+ states: record(string(), number()).nullable()
17334
17414
  });
17335
17415
  var QuerySeriesSchema = object({
17336
17416
  scope: string(),
17337
17417
  /** The last point STRICTLY BEFORE `from` in the chosen tier, so a step chart can start at the held value. */
17338
17418
  before: object({
17339
17419
  t: number(),
17340
- value: number().nullable()
17420
+ value: number().nullable(),
17421
+ state: string().nullable()
17341
17422
  }).nullable(),
17342
- points: array(QueryPointSchema).readonly()
17423
+ points: array(QueryPointSchema).readonly(),
17424
+ /** A derived key: the stored key its points were computed from; `null` for a stored series. */
17425
+ derivedFrom: string().nullable()
17343
17426
  });
17344
17427
  /** The window part of a query, shared by the device and node forms. */
17345
17428
  var QueryWindowShape = {
@@ -17355,6 +17438,23 @@ var QueryResultSchema = object({
17355
17438
  series: array(QuerySeriesSchema).readonly(),
17356
17439
  truncated: boolean()
17357
17440
  });
17441
+ /** One read of a batch: a device's key or a node's key (exactly one subject). */
17442
+ var QueryManyItemSchema = union([object({
17443
+ deviceId: number().int(),
17444
+ key: string(),
17445
+ scope: string().optional()
17446
+ }), object({
17447
+ forNodeId: string().min(1),
17448
+ key: string(),
17449
+ scope: string().optional()
17450
+ })]);
17451
+ var QueryManyEntrySchema = discriminatedUnion("ok", [object({
17452
+ ok: literal(true),
17453
+ result: QueryResultSchema
17454
+ }), object({
17455
+ ok: literal(false),
17456
+ error: string()
17457
+ })]);
17358
17458
  var TierStatusSchema = object({
17359
17459
  tier: DeviceHistoryResolutionSchema,
17360
17460
  /** `null` until the first background count answered. */
@@ -17410,16 +17510,22 @@ var DeviceHistoryStatusSchema = object({
17410
17510
  lastRefreshAt: number().nullable()
17411
17511
  })
17412
17512
  });
17413
- method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ nodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
17513
+ method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ forNodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
17414
17514
  deviceId: number().int(),
17415
17515
  ...QueryWindowShape
17416
17516
  }), QueryResultSchema), method(object({
17417
- nodeId: string().min(1),
17517
+ forNodeId: string().min(1),
17418
17518
  ...QueryWindowShape
17419
17519
  }), QueryResultSchema, { auth: "admin" }), method(object({
17520
+ items: array(QueryManyItemSchema).min(1).max(24),
17521
+ from: QueryWindowShape.from,
17522
+ to: QueryWindowShape.to,
17523
+ resolution: QueryWindowShape.resolution,
17524
+ maxPoints: QueryWindowShape.maxPoints
17525
+ }), object({ results: array(QueryManyEntrySchema).readonly() }), { auth: "admin" }), method(object({
17420
17526
  name: string().regex(/^[a-z0-9-]+$/),
17421
17527
  subjectKind: _enum(["device", "node"]),
17422
- kind: DeviceHistoryKindSchema,
17528
+ kind: DeviceHistoryProducerKindSchema,
17423
17529
  unit: string().optional(),
17424
17530
  displayName: string().min(1),
17425
17531
  ingest: _enum(["points", "buckets"])
@@ -40009,38 +40115,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
40009
40115
  auth: "admin",
40010
40116
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40011
40117
  });
40118
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
40119
+ /** What a model (or, by default, every model of a kind) can do. */
40120
+ var LlmModelFeaturesSchema = object({
40121
+ vision: boolean(),
40122
+ tools: boolean(),
40123
+ streaming: boolean()
40124
+ });
40125
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
40126
+ var LlmModelInfoSchema = object({
40127
+ id: string(),
40128
+ label: string().optional(),
40129
+ contextLength: number().int().positive().optional(),
40130
+ features: LlmModelFeaturesSchema.partial().optional()
40131
+ });
40012
40132
  /**
40013
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
40014
- * methods concat-fan across providers; single-row methods route to ONE
40015
- * provider by the `addonId` in the call input (the notification-output
40016
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
40017
- * (hub-placed); the cap stays open for future providers.
40018
- *
40019
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
40020
- * `apiKey` is a password field — providers REDACT it on read and merge on
40021
- * write; a stored key NEVER round-trips to a client.
40133
+ * The provider-specific part of a profile, validated by the provider that owns
40134
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
40135
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
40136
+ * keychain, never in the row, and reads back as the redaction marker.
40022
40137
  */
40023
- var LlmProfileKindSchema = _enum([
40024
- "openai-compatible",
40025
- "openai",
40026
- "anthropic",
40027
- "google",
40028
- "managed-local",
40029
- "apple-foundation"
40030
- ]);
40138
+ var LlmProviderConfigSchema = record(string(), unknown());
40031
40139
  var LlmProfileSchema = object({
40032
40140
  id: string(),
40033
40141
  name: string(),
40142
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
40034
40143
  kind: LlmProfileKindSchema,
40035
40144
  /** Stamped by the provider — keeps the fanned catalog routable. */
40036
40145
  addonId: string(),
40037
40146
  enabled: boolean(),
40038
40147
  /** Vendor model id, or the managed runtime's loaded model. */
40039
40148
  model: string(),
40040
- /** Required for openai-compatible; override for cloud kinds. */
40041
- baseUrl: string().optional(),
40042
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
40043
- apiKey: string().optional(),
40044
40149
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
40045
40150
  * degraded to text — that shipped once and produced a confident answer to a
40046
40151
  * question about a picture nobody sent. */
@@ -40048,15 +40153,11 @@ var LlmProfileSchema = object({
40048
40153
  temperature: number().min(0).max(2).optional(),
40049
40154
  /** Nucleus sampling. Every wire we speak has it. */
40050
40155
  topP: number().min(0).max(1).optional(),
40051
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
40052
- * wire does, and the client drops it there (measured: the request body gets
40053
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
40054
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
40156
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
40157
+ * field in its editor only when its descriptor lists it in `profileFields`. */
40055
40158
  topK: number().int().positive().optional(),
40056
40159
  maxTokens: number().int().positive().optional(),
40057
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
40058
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
40059
- * the model with, so it is the one field that changes a PROCESS. */
40160
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
40060
40161
  contextLength: number().int().positive().optional(),
40061
40162
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
40062
40163
  * two system prompts fighting is worse than either alone). */
@@ -40082,16 +40183,37 @@ var LlmProfileSchema = object({
40082
40183
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
40083
40184
  * `true` here buys the wiring, not behaviour, until tools are registered. */
40084
40185
  toolsEnabled: boolean().default(false),
40085
- extraHeaders: record(string(), string()).optional(),
40086
- /** kind === 'managed-local' only (spec §4). */
40087
- runtime: ManagedRuntimeConfigSchema.optional(),
40088
- /**
40089
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
40090
- * to configure (no key, no URL, no download; `model` is `apple-system`).
40091
- * `supportsVision` on such a row is stamped by the provider from the node's
40092
- * reported `imageInput`, never taken from the operator (D62).
40093
- */
40094
- appleFoundation: object({ nodeId: string() }).optional()
40186
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
40187
+ providerConfig: LlmProviderConfigSchema.default({})
40188
+ });
40189
+ /**
40190
+ * The common profile fields a kind's editor offers. The editor owns how each
40191
+ * one is drawn; the provider says which of them mean something on its wire.
40192
+ */
40193
+ var LlmProfileFieldSchema = _enum([
40194
+ "temperature",
40195
+ "topP",
40196
+ "topK",
40197
+ "maxTokens",
40198
+ "contextLength",
40199
+ "systemPrompt",
40200
+ "timeoutMs",
40201
+ "connectTimeoutMs",
40202
+ "firstTokenTimeoutMs",
40203
+ "idleTimeoutMs",
40204
+ "retry",
40205
+ "toolsEnabled"
40206
+ ]);
40207
+ /**
40208
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
40209
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
40210
+ * picker: that widget owns the model choice.
40211
+ */
40212
+ var LlmProviderWidgetSchema = object({
40213
+ id: string(),
40214
+ placement: _enum(["connection", "model"]),
40215
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
40216
+ requires: array(string()).optional()
40095
40217
  });
40096
40218
  /** ConfigUISchema tree passed through untyped on the wire (the
40097
40219
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -40100,11 +40222,56 @@ var ConfigSchemaPassthrough$3 = unknown();
40100
40222
  var LlmProfileKindDescriptorSchema = object({
40101
40223
  kind: LlmProfileKindSchema,
40102
40224
  label: string(),
40225
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
40103
40226
  icon: string(),
40104
40227
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
40105
40228
  addonId: string(),
40106
- configSchema: ConfigSchemaPassthrough$3
40229
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
40230
+ connectionSchema: ConfigSchemaPassthrough$3,
40231
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
40232
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
40233
+ /** The kind's defaults; a model from `listModels` may override any of them. */
40234
+ features: LlmModelFeaturesSchema,
40235
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
40236
+ visionEditable: boolean(),
40237
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
40238
+ modelCatalog: _enum([
40239
+ "fetch",
40240
+ "static",
40241
+ "none"
40242
+ ]),
40243
+ staticModels: array(LlmModelInfoSchema).optional(),
40244
+ /** The common fields that mean something on this kind's wire. */
40245
+ profileFields: array(LlmProfileFieldSchema),
40246
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
40247
+ });
40248
+ /**
40249
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
40250
+ * (the editor's form); with `profileId` too, a secret the draft leaves
40251
+ * untouched (absent or the redaction marker) is resolved server-side from the
40252
+ * stored profile — the browser never receives it.
40253
+ */
40254
+ var LlmListModelsInputSchema = object({
40255
+ addonId: string(),
40256
+ kind: LlmProfileKindSchema,
40257
+ profileId: string().optional(),
40258
+ connection: LlmProviderConfigSchema.optional()
40107
40259
  });
40260
+ var LlmListModelsErrorCodeSchema = _enum([
40261
+ "auth",
40262
+ "network",
40263
+ "unsupported",
40264
+ "invalid"
40265
+ ]);
40266
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
40267
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
40268
+ ok: literal(true),
40269
+ models: array(LlmModelInfoSchema)
40270
+ }), object({
40271
+ ok: literal(false),
40272
+ code: LlmListModelsErrorCodeSchema,
40273
+ message: string()
40274
+ })]);
40108
40275
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
40109
40276
  var LlmDefaultSchema = object({
40110
40277
  selector: LlmDefaultSelectorSchema,
@@ -40204,7 +40371,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
40204
40371
  kind: "mutation",
40205
40372
  auth: "admin",
40206
40373
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40207
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
40374
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
40375
+ kind: "mutation",
40376
+ auth: "admin"
40377
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
40208
40378
  selector: LlmDefaultSelectorSchema,
40209
40379
  profileId: string().nullable()
40210
40380
  }), _void(), {
@@ -40372,14 +40542,106 @@ var LogEntrySchema = object({
40372
40542
  meta: record(string(), unknown()).optional(),
40373
40543
  tags: record(string(), string()).optional()
40374
40544
  });
40375
- method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
40376
- scope: array(string()).optional(),
40545
+ /**
40546
+ * A history READ against one destination (D898).
40547
+ *
40548
+ * Every filter is applied by the PROVIDER, before the limit — a filter the
40549
+ * browser applied after the limit is what made a rare device's lines
40550
+ * unreachable behind a busy one's. `before` / `after` are cursors the provider
40551
+ * minted (opaque to everyone else): a file position for the rotated files, a
40552
+ * nanosecond timestamp for Loki.
40553
+ *
40554
+ * A read is BOUNDED by `budgetMs`: a filter that matches nothing on a 30-day
40555
+ * store answers `done: false` with the cursor it reached and the bytes it
40556
+ * scanned, and the caller decides whether to go on. That is what makes a long
40557
+ * scan show progress and stop when asked — `cancelRead` ends the slice in
40558
+ * flight, and not asking for the next slice ends the scan.
40559
+ */
40560
+ var LogReadQuerySchema = object({
40561
+ /** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
40562
+ requestId: string().min(1).max(64).optional(),
40563
+ /** The device the line is about (`tags.deviceId`, numeric). */
40564
+ deviceId: number().int().optional(),
40565
+ /**
40566
+ * The emitting addon — bare manifest id; `@<version>` / `::<sub>` suffixes
40567
+ * match. Not `addonId`: a cap router reads that name as "which provider".
40568
+ */
40569
+ fromAddonId: string().min(1).max(200).optional(),
40570
+ /**
40571
+ * The emitting node: matches the agent that emitted the line, the node
40572
+ * itself, or a worker under it (`<agent>/<runner>`) — the `agentId`
40573
+ * semantics of `matchesLogTags`. Not `nodeId`: a cap router reads that
40574
+ * name as "which node's provider".
40575
+ */
40576
+ fromNodeId: string().min(1).max(200).optional(),
40577
+ /** Any other tag, exact match (AND). */
40578
+ tags: record(string(), union([string(), number()])).optional(),
40579
+ /** Severity FLOOR: this level and above. */
40377
40580
  level: LogLevelSchema.optional(),
40378
- since: date().optional(),
40379
- until: date().optional(),
40380
- limit: number().optional(),
40381
- tags: record(string(), string()).optional()
40382
- }), array(LogEntrySchema).readonly());
40581
+ /** Case-insensitive substring over message, scope, tag values and meta values. */
40582
+ text: string().min(1).max(200).optional(),
40583
+ /** Epoch ms, inclusive. */
40584
+ since: number().optional(),
40585
+ /** Epoch ms, inclusive. */
40586
+ until: number().optional(),
40587
+ /** Older than this cursor (exclusive). Absent with `after` absent ⇒ from the newest. */
40588
+ before: string().min(1).max(1024).optional(),
40589
+ /** Newer than this cursor (exclusive). */
40590
+ after: string().min(1).max(1024).optional(),
40591
+ limit: number().int().min(1).max(1e3).optional(),
40592
+ /** Wall-clock bound of this slice. The provider caps it. */
40593
+ budgetMs: number().int().min(50).max(1e4).optional()
40594
+ });
40595
+ var LogReadResultSchema = object({
40596
+ /** Newest first. */
40597
+ entries: array(object({
40598
+ /** `<bootId>.<seq>` minted by the emitting LogManager — the dedupe key. */
40599
+ id: string().optional(),
40600
+ /** Epoch ms. */
40601
+ timestamp: number(),
40602
+ level: LogLevelSchema,
40603
+ scope: string().optional(),
40604
+ message: string(),
40605
+ tags: record(string(), union([string(), number()])).optional(),
40606
+ meta: record(string(), unknown()).optional()
40607
+ })),
40608
+ /** Pass as `before` for the next older page; null when nothing older exists. */
40609
+ nextBefore: string().nullable(),
40610
+ /** Pass as `after` to read what arrived since; null when unknown. */
40611
+ nextAfter: string().nullable(),
40612
+ /** Bytes this slice read (files) or received (remote). Progress, not a promise. */
40613
+ scannedBytes: number().int().nonnegative(),
40614
+ /**
40615
+ * True when the scan in this direction reached the end of the store.
40616
+ * False with fewer than `limit` entries means the budget ran out first —
40617
+ * call again with `nextBefore` to go on.
40618
+ */
40619
+ done: boolean(),
40620
+ /** True when `cancelRead` ended this slice early. */
40621
+ cancelled: boolean().optional()
40622
+ });
40623
+ var LogReadCapabilitiesSchema = object({
40624
+ /** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
40625
+ readable: boolean(),
40626
+ /** Why not, when `readable` is false — rendered next to the source. */
40627
+ reason: string().nullable(),
40628
+ /** Filters the provider applies itself. A false one is applied by nobody. */
40629
+ filters: object({
40630
+ deviceId: boolean(),
40631
+ addonId: boolean(),
40632
+ nodeId: boolean(),
40633
+ tags: boolean(),
40634
+ level: boolean(),
40635
+ text: boolean(),
40636
+ timeRange: boolean()
40637
+ }),
40638
+ /** How far back the store reaches, when the provider knows (days). */
40639
+ retentionDays: number().nullable()
40640
+ });
40641
+ 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() }), {
40642
+ kind: "mutation",
40643
+ auth: "admin"
40644
+ });
40383
40645
  /**
40384
40646
  * `login-method` — collection cap through which auth addons contribute
40385
40647
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -42957,6 +43219,33 @@ var NcRuleTargetSchema = object({
42957
43219
  params: record(string(), unknown()).optional()
42958
43220
  });
42959
43221
  /**
43222
+ * WHAT THE NOTIFICATION'S PICTURE IS (D897) — the ONE media choice of a rule.
43223
+ *
43224
+ * Every mode starts from the same CLEAN source frame of the trigger moment
43225
+ * (keyFrame → sceneFrame → lastSceneFrame, narrowed to the trigger instant and
43226
+ * to the zone that fired the rule) and renders it once at send time:
43227
+ * - `scene-boxes` — the whole scene, the subject outlined thick in the accent
43228
+ * colour and every OTHER track visible at that instant outlined thin, each
43229
+ * labelled with class and confidence ("dog 87%").
43230
+ * - `crop` — the subject cut out of that frame around its box at that instant.
43231
+ * - `clean` — the whole scene with nothing drawn on it.
43232
+ * - `none` — no picture.
43233
+ *
43234
+ * A mode that cannot be honoured (no box at that instant, a photograph with no
43235
+ * tracked subject) ships `clean` and names the reason in the log, per camera.
43236
+ * It replaces the `attach` × `frame` × `zoneCrop` triple, which let one rule
43237
+ * ship a crop on one event and a boxed scene on the next depending on which
43238
+ * stored kind had landed.
43239
+ */
43240
+ var NcMediaImageSchema = _enum([
43241
+ "scene-boxes",
43242
+ "crop",
43243
+ "clean",
43244
+ "none"
43245
+ ]);
43246
+ /**
43247
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
43248
+ *
42960
43249
  * Media attachment policy (P1 still-image subset).
42961
43250
  * - `best` — the best AVAILABLE subject image at dispatch time (D-3).
42962
43251
  * - `best-matching` — the media that explains WHY the rule fired: a rule
@@ -42970,6 +43259,8 @@ var NcRuleTargetSchema = object({
42970
43259
  * - `none` — no attachment.
42971
43260
  */
42972
43261
  /**
43262
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
43263
+ *
42973
43264
  * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
42974
43265
  * conflate it with the selection strategy and betray the request: asking for
42975
43266
  * the clean scene frame on an object-event owner used to start at
@@ -42998,16 +43289,29 @@ var NcMediaFrameSchema = _enum([
42998
43289
  */
42999
43290
  var NcLinkedCameraModeSchema = _enum(["mosaic", "each"]);
43000
43291
  var NcMediaPolicySchema = object({
43292
+ /**
43293
+ * The picture — see {@link NcMediaImageSchema}. Absent on a rule nobody has
43294
+ * saved since D897: `normalizeNcMediaPolicy` derives it from the legacy
43295
+ * triple below, at load and at every write, and the store keeps only this.
43296
+ */
43297
+ image: NcMediaImageSchema.optional(),
43298
+ /**
43299
+ * Draw the zone that FIRED the rule on the picture (`scene-boxes` / `clean`;
43300
+ * a `crop` never shows it). Valid only on a rule whose trigger is a zone —
43301
+ * `conditions.zones` or an occupancy zone — and refused on save otherwise.
43302
+ * Replaces `zoneCrop`.
43303
+ */
43304
+ showTriggerZone: boolean().optional(),
43305
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
43001
43306
  attach: _enum([
43002
43307
  "best",
43003
43308
  "best-matching",
43004
43309
  "keyFrame",
43005
43310
  "none"
43006
- ]).default("best"),
43007
- /** What the still shows. Absent = `cropped` (the historical `best` shape). */
43311
+ ]).optional(),
43312
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
43008
43313
  frame: NcMediaFrameSchema.optional(),
43009
- /** Crop the attached still to the rule's condition-zone bbox (padded) —
43010
- * "show me the ZONE", not the whole scene or the subject crop. */
43314
+ /** @deprecated D897 — folded into `image: 'clean'` + `showTriggerZone` on save. */
43011
43315
  zoneCrop: boolean().optional(),
43012
43316
  /**
43013
43317
  * Also attach a short GIF cut from the stream broker's clip ring around the
@@ -43179,7 +43483,9 @@ var NcRuleInputSchema = object({
43179
43483
  * targets.
43180
43484
  */
43181
43485
  targetUsers: array(string()).optional(),
43182
- media: NcMediaPolicySchema.default({ attach: "best" }),
43486
+ /** Absent = the kind's default picture (`resolveNcMediaImage`): the subject crop for a
43487
+ * detection, the clean scene for a sensor or a sound. Set explicitly on save (D897). */
43488
+ media: NcMediaPolicySchema.default({}),
43183
43489
  throttle: NcThrottleSchema.default({
43184
43490
  cooldownSec: 60,
43185
43491
  scope: "rule-device"
@@ -44116,13 +44422,37 @@ var NcAlarmModeOpeningsSchema = object({
44116
44422
  /** Covered devices whose state could not be read (D49): neither open nor closed. */
44117
44423
  unknown: array(number().int())
44118
44424
  });
44425
+ /**
44426
+ * One alarm INPUT — a (rule, device) pair — the operator bypassed until the
44427
+ * next disarm ("Bypass this input until disarm" on a trigger notification, or
44428
+ * `nc.bypassAlarmInput`). Reported so an armed alarm with a silenced input
44429
+ * never looks fully armed (D62: off must never look like broken).
44430
+ */
44431
+ var NcAlarmInputBypassViewSchema = object({
44432
+ ruleId: string(),
44433
+ /** The rule's current name (its frozen name when the rule is gone). */
44434
+ ruleName: string(),
44435
+ /** The input: the sensor of the match, else its camera. */
44436
+ deviceId: number().int(),
44437
+ /** The input's current name. */
44438
+ name: string(),
44439
+ /** When it was bypassed (ms epoch). */
44440
+ since: number(),
44441
+ /** Triggers from this input dropped since. */
44442
+ dropped: number().int().min(0)
44443
+ });
44119
44444
  var NcAlarmLiveSchema = object({
44120
44445
  state: AlarmStateSchema,
44121
44446
  /** The mode being armed into (exit delay) or held; null when disarmed. */
44122
44447
  targetMode: AlarmArmModeSchema.nullable(),
44123
44448
  availableModes: array(AlarmArmModeSchema),
44124
44449
  openings: array(NcAlarmModeOpeningsSchema),
44125
- exclusions: array(NcAlarmExclusionViewSchema)
44450
+ exclusions: array(NcAlarmExclusionViewSchema),
44451
+ /**
44452
+ * Inputs bypassed for the rest of this arm session; cleared on disarm.
44453
+ * Defaulted so an older hub answer still parses (as "none known").
44454
+ */
44455
+ bypassedInputs: array(NcAlarmInputBypassViewSchema).default([])
44126
44456
  });
44127
44457
  var NcAlarmConfigSchema = object({
44128
44458
  /**
@@ -61221,26 +61551,6 @@ var ApiKeySummarySchema = object({
61221
61551
  createdAt: number(),
61222
61552
  lastUsedAt: number().optional()
61223
61553
  });
61224
- var ScopedTokenSummarySchema = object({
61225
- id: string(),
61226
- userId: string(),
61227
- name: string(),
61228
- tokenPrefix: string(),
61229
- scopes: array(TokenScopeSchema),
61230
- expiresAt: number().nullish(),
61231
- lastUsedAt: number().nullish(),
61232
- createdAt: number()
61233
- });
61234
- var CreateScopedTokenInputSchema = object({
61235
- userId: string(),
61236
- name: string(),
61237
- scopes: array(TokenScopeSchema),
61238
- expiresAt: number().optional()
61239
- });
61240
- var CreateScopedTokenResultSchema = object({
61241
- token: string(),
61242
- record: ScopedTokenSummarySchema
61243
- });
61244
61554
  var OauthSessionSummarySchema = object({
61245
61555
  id: string(),
61246
61556
  userId: string(),
@@ -61262,11 +61572,11 @@ var TotpStatusSchema = object({
61262
61572
  confirmedAt: number().nullable()
61263
61573
  });
61264
61574
  /**
61265
- * user-management — singleton capability for user accounts, API keys,
61266
- * and scoped tokens.
61575
+ * user-management — singleton capability for user accounts and the
61576
+ * legacy API-key rows.
61267
61577
  *
61268
61578
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
61269
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
61579
+ * — the subset check on `setUserScopes` is moot
61270
61580
  * because non-admins never reach these. If/when we open non-admin
61271
61581
  * delegation, structural caller-scope subset check goes inside the
61272
61582
  * provider.
@@ -61323,15 +61633,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
61323
61633
  kind: "mutation",
61324
61634
  auth: "admin",
61325
61635
  access: "delete"
61326
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
61327
- kind: "mutation",
61328
- auth: "admin",
61329
- access: "create"
61330
- }), method(object({ id: string() }), object({ success: literal(true) }), {
61331
- kind: "mutation",
61332
- auth: "admin",
61333
- access: "delete"
61334
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
61636
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
61335
61637
  kind: "mutation",
61336
61638
  auth: "admin",
61337
61639
  access: "create"
@@ -65487,7 +65789,7 @@ Object.freeze({
65487
65789
  capName: "llm",
65488
65790
  capScope: "system",
65489
65791
  addonId: null,
65490
- access: "view"
65792
+ access: "create"
65491
65793
  },
65492
65794
  "llm.listNodeModels": {
65493
65795
  capName: "llm",
@@ -65789,7 +66091,19 @@ Object.freeze({
65789
66091
  addonId: null,
65790
66092
  access: "view"
65791
66093
  },
65792
- "logDestination.query": {
66094
+ "logDestination.cancelRead": {
66095
+ capName: "log-destination",
66096
+ capScope: "system",
66097
+ addonId: null,
66098
+ access: "create"
66099
+ },
66100
+ "logDestination.describeRead": {
66101
+ capName: "log-destination",
66102
+ capScope: "system",
66103
+ addonId: null,
66104
+ access: "view"
66105
+ },
66106
+ "logDestination.read": {
65793
66107
  capName: "log-destination",
65794
66108
  capScope: "system",
65795
66109
  addonId: null,
@@ -70151,12 +70465,6 @@ Object.freeze({
70151
70465
  addonId: null,
70152
70466
  access: "create"
70153
70467
  },
70154
- "userManagement.createScopedToken": {
70155
- capName: "user-management",
70156
- capScope: "system",
70157
- addonId: null,
70158
- access: "create"
70159
- },
70160
70468
  "userManagement.createUser": {
70161
70469
  capName: "user-management",
70162
70470
  capScope: "system",
@@ -70205,12 +70513,6 @@ Object.freeze({
70205
70513
  addonId: null,
70206
70514
  access: "view"
70207
70515
  },
70208
- "userManagement.listScopedTokens": {
70209
- capName: "user-management",
70210
- capScope: "system",
70211
- addonId: null,
70212
- access: "view"
70213
- },
70214
70516
  "userManagement.listUsers": {
70215
70517
  capName: "user-management",
70216
70518
  capScope: "system",
@@ -70265,12 +70567,6 @@ Object.freeze({
70265
70567
  addonId: null,
70266
70568
  access: "delete"
70267
70569
  },
70268
- "userManagement.revokeScopedToken": {
70269
- capName: "user-management",
70270
- capScope: "system",
70271
- addonId: null,
70272
- access: "delete"
70273
- },
70274
70570
  "userManagement.setupTotp": {
70275
70571
  capName: "user-management",
70276
70572
  capScope: "system",
@@ -70301,12 +70597,6 @@ Object.freeze({
70301
70597
  addonId: null,
70302
70598
  access: "view"
70303
70599
  },
70304
- "userManagement.validateScopedToken": {
70305
- capName: "user-management",
70306
- capScope: "system",
70307
- addonId: null,
70308
- access: "view"
70309
- },
70310
70600
  "userManagement.verifyTotp": {
70311
70601
  capName: "user-management",
70312
70602
  capScope: "system",
@@ -71820,6 +72110,11 @@ Object.freeze({
71820
72110
  form: "single",
71821
72111
  optional: false
71822
72112
  }],
72113
+ "logDestination.read": [{
72114
+ name: "deviceId",
72115
+ form: "single",
72116
+ optional: true
72117
+ }],
71823
72118
  "mediaPlayer.getStatus": [{
71824
72119
  name: "deviceId",
71825
72120
  form: "single",