@camstack/addon-google-services 0.2.13 → 0.2.15

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.
@@ -5551,7 +5551,7 @@ var ZodIssueCode = {
5551
5551
  var ZodFirstPartyTypeKind;
5552
5552
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5553
5553
  //#endregion
5554
- //#region ../types/dist/sleep-BxjU_fJM.mjs
5554
+ //#region ../types/dist/sleep-BSuCCFjf.mjs
5555
5555
  /**
5556
5556
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5557
5557
  * window to float samples (D455).
@@ -7934,9 +7934,9 @@ function normalizeAddonInitResult(result) {
7934
7934
  return result;
7935
7935
  }
7936
7936
  /**
7937
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7938
- * and validates them (`share-token.service.ts` builds its enum from this
7939
- * list); a data plane names the kinds it ACCEPTS in `share`.
7937
+ * The share-view scope kinds a share-link token can carry. The hub mints
7938
+ * and validates them (`ShareViewGrantSchema` builds its
7939
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7940
7940
  */
7941
7941
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7942
7942
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -12943,7 +12943,7 @@ var ConvertResultSchema = object({
12943
12943
  * `super_admin` — collapsed onto the single boolean because every
12944
12944
  * non-admin caller is governed by the same scope-check rules; the
12945
12945
  * distinction was only ever used to route role-specific procedures
12946
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12946
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
12947
12947
  * with `isAdmin: false` + an explicit scope list.
12948
12948
  */
12949
12949
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -13132,10 +13132,12 @@ var AddonRoutesScopeSchema = object({
13132
13132
  type: literal("addon-routes"),
13133
13133
  access: array(MethodAccessSchema).min(1)
13134
13134
  });
13135
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
13135
13136
  var CredentialScopeSchema = union([
13136
13137
  literal("*"),
13137
13138
  ShareViewScopeSchema,
13138
13139
  AddonRoutesScopeSchema,
13140
+ PreferencesSelfScopeSchema,
13139
13141
  TokenScopeSchema
13140
13142
  ]);
13141
13143
  object({
@@ -13144,6 +13146,55 @@ object({
13144
13146
  jti: string().min(16),
13145
13147
  scopes: array(CredentialScopeSchema).min(1)
13146
13148
  });
13149
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
13150
+ /** A namespace's value: a JSON object, opaque to the hub. */
13151
+ var PreferenceValueSchema = record(string(), unknown());
13152
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
13153
+ /** A stored row, as the owner reads it. */
13154
+ var PreferenceRowSchema = object({
13155
+ namespace: PreferenceNamespaceSchema,
13156
+ value: PreferenceValueSchema,
13157
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
13158
+ revision: number().int().positive(),
13159
+ updatedAt: number().int(),
13160
+ /** The client id the last writer sent; `null` when it sent none. */
13161
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
13162
+ });
13163
+ object({
13164
+ /** Absent: every namespace the caller holds. */
13165
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
13166
+ object({ rows: array(PreferenceRowSchema) });
13167
+ object({
13168
+ namespace: PreferenceNamespaceSchema,
13169
+ value: PreferenceValueSchema,
13170
+ /**
13171
+ * The revision the edit was based on. Absent: last write wins. `0`: the
13172
+ * namespace must not exist yet. Any other value that is not the current
13173
+ * revision answers `conflict` and writes nothing.
13174
+ */
13175
+ baseRevision: number().int().nonnegative().optional(),
13176
+ deviceId: PreferenceDeviceIdSchema.optional()
13177
+ });
13178
+ discriminatedUnion("status", [object({
13179
+ status: literal("saved"),
13180
+ row: PreferenceRowSchema
13181
+ }), object({
13182
+ status: literal("conflict"),
13183
+ current: PreferenceRowSchema.nullable()
13184
+ })]);
13185
+ object({ namespace: PreferenceNamespaceSchema });
13186
+ object({
13187
+ /** `false` when the namespace did not exist. */
13188
+ deleted: boolean() });
13189
+ object({
13190
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
13191
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
13192
+ object({
13193
+ /** Every row whose revision differs from the client's, and every row it did not list. */
13194
+ rows: array(PreferenceRowSchema),
13195
+ /** Namespaces the client listed that no longer exist. */
13196
+ deleted: array(PreferenceNamespaceSchema)
13197
+ });
13147
13198
  _enum(["new-session", "step-up"]);
13148
13199
  /** The languages the hub's app landing pages are written in (D858). */
13149
13200
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -17359,7 +17410,19 @@ var DeviceHistorySubjectSchema = discriminatedUnion("kind", [object({
17359
17410
  kind: literal("node"),
17360
17411
  nodeId: string().min(1)
17361
17412
  })]);
17413
+ /**
17414
+ * `enum` stores a STATE as the ordinal of its value in the series' value list
17415
+ * (`DeviceHistorySeriesInfo.values`, append-only, so an ordinal never changes
17416
+ * meaning); a rollup keeps the time spent in each state (`states`).
17417
+ */
17362
17418
  var DeviceHistoryKindSchema = _enum([
17419
+ "gauge",
17420
+ "counter",
17421
+ "boolean",
17422
+ "enum"
17423
+ ]);
17424
+ /** What a PRODUCER may declare. `enum` is cap-only: its value list is the cap field's. */
17425
+ var DeviceHistoryProducerKindSchema = _enum([
17363
17426
  "gauge",
17364
17427
  "counter",
17365
17428
  "boolean"
@@ -17396,7 +17459,13 @@ var SeriesInfoSchema = object({
17396
17459
  /** `null` is unknown (a `unitFrom` series whose device does not state a unit right now), never a guess. */
17397
17460
  unit: string().nullable(),
17398
17461
  displayName: string(),
17399
- source: _enum(["cap", "addon"]),
17462
+ source: _enum([
17463
+ "cap",
17464
+ "addon",
17465
+ "derived"
17466
+ ]),
17467
+ /** `enum`: the value of each ordinal (index = ordinal); `null` for every other kind. */
17468
+ values: array(string()).readonly().nullable(),
17400
17469
  firstTs: number(),
17401
17470
  lastTs: number()
17402
17471
  });
@@ -17410,17 +17479,31 @@ var QueryPointSchema = object({
17410
17479
  twMean: number().nullable(),
17411
17480
  min: number(),
17412
17481
  max: number(),
17413
- /** `null` is unknown, never zero (D393). */
17414
- last: number().nullable()
17482
+ /** `null` is unknown, never zero (D393). For an `enum` series: the ordinal of {@link state}. */
17483
+ last: number().nullable(),
17484
+ /**
17485
+ * The increase over the point: a `counter`'s growth since the previous point
17486
+ * or bucket (a drop is a reset, counted from zero), and for
17487
+ * {@link DEVICE_HISTORY_ENERGY_KEY} the kWh used in the bucket. `null` for
17488
+ * every other kind, and when it cannot be known.
17489
+ */
17490
+ delta: number().nullable(),
17491
+ /** `enum`: the state in force at the end of the point (the name of `last`); `null` otherwise. */
17492
+ state: string().nullable(),
17493
+ /** `enum` rollup: milliseconds spent in each state inside the bucket; `null` for raw points and other kinds. */
17494
+ states: record(string(), number()).nullable()
17415
17495
  });
17416
17496
  var QuerySeriesSchema = object({
17417
17497
  scope: string(),
17418
17498
  /** The last point STRICTLY BEFORE `from` in the chosen tier, so a step chart can start at the held value. */
17419
17499
  before: object({
17420
17500
  t: number(),
17421
- value: number().nullable()
17501
+ value: number().nullable(),
17502
+ state: string().nullable()
17422
17503
  }).nullable(),
17423
- points: array(QueryPointSchema).readonly()
17504
+ points: array(QueryPointSchema).readonly(),
17505
+ /** A derived key: the stored key its points were computed from; `null` for a stored series. */
17506
+ derivedFrom: string().nullable()
17424
17507
  });
17425
17508
  /** The window part of a query, shared by the device and node forms. */
17426
17509
  var QueryWindowShape = {
@@ -17436,6 +17519,23 @@ var QueryResultSchema = object({
17436
17519
  series: array(QuerySeriesSchema).readonly(),
17437
17520
  truncated: boolean()
17438
17521
  });
17522
+ /** One read of a batch: a device's key or a node's key (exactly one subject). */
17523
+ var QueryManyItemSchema = union([object({
17524
+ deviceId: number().int(),
17525
+ key: string(),
17526
+ scope: string().optional()
17527
+ }), object({
17528
+ forNodeId: string().min(1),
17529
+ key: string(),
17530
+ scope: string().optional()
17531
+ })]);
17532
+ var QueryManyEntrySchema = discriminatedUnion("ok", [object({
17533
+ ok: literal(true),
17534
+ result: QueryResultSchema
17535
+ }), object({
17536
+ ok: literal(false),
17537
+ error: string()
17538
+ })]);
17439
17539
  var TierStatusSchema = object({
17440
17540
  tier: DeviceHistoryResolutionSchema,
17441
17541
  /** `null` until the first background count answered. */
@@ -17491,16 +17591,22 @@ var DeviceHistoryStatusSchema = object({
17491
17591
  lastRefreshAt: number().nullable()
17492
17592
  })
17493
17593
  });
17494
- method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ nodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
17594
+ method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ forNodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
17495
17595
  deviceId: number().int(),
17496
17596
  ...QueryWindowShape
17497
17597
  }), QueryResultSchema), method(object({
17498
- nodeId: string().min(1),
17598
+ forNodeId: string().min(1),
17499
17599
  ...QueryWindowShape
17500
17600
  }), QueryResultSchema, { auth: "admin" }), method(object({
17601
+ items: array(QueryManyItemSchema).min(1).max(24),
17602
+ from: QueryWindowShape.from,
17603
+ to: QueryWindowShape.to,
17604
+ resolution: QueryWindowShape.resolution,
17605
+ maxPoints: QueryWindowShape.maxPoints
17606
+ }), object({ results: array(QueryManyEntrySchema).readonly() }), { auth: "admin" }), method(object({
17501
17607
  name: string().regex(/^[a-z0-9-]+$/),
17502
17608
  subjectKind: _enum(["device", "node"]),
17503
- kind: DeviceHistoryKindSchema,
17609
+ kind: DeviceHistoryProducerKindSchema,
17504
17610
  unit: string().optional(),
17505
17611
  displayName: string().min(1),
17506
17612
  ingest: _enum(["points", "buckets"])
@@ -40090,38 +40196,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
40090
40196
  auth: "admin",
40091
40197
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40092
40198
  });
40199
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
40200
+ /** What a model (or, by default, every model of a kind) can do. */
40201
+ var LlmModelFeaturesSchema = object({
40202
+ vision: boolean(),
40203
+ tools: boolean(),
40204
+ streaming: boolean()
40205
+ });
40206
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
40207
+ var LlmModelInfoSchema = object({
40208
+ id: string(),
40209
+ label: string().optional(),
40210
+ contextLength: number().int().positive().optional(),
40211
+ features: LlmModelFeaturesSchema.partial().optional()
40212
+ });
40093
40213
  /**
40094
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
40095
- * methods concat-fan across providers; single-row methods route to ONE
40096
- * provider by the `addonId` in the call input (the notification-output
40097
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
40098
- * (hub-placed); the cap stays open for future providers.
40099
- *
40100
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
40101
- * `apiKey` is a password field — providers REDACT it on read and merge on
40102
- * write; a stored key NEVER round-trips to a client.
40214
+ * The provider-specific part of a profile, validated by the provider that owns
40215
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
40216
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
40217
+ * keychain, never in the row, and reads back as the redaction marker.
40103
40218
  */
40104
- var LlmProfileKindSchema = _enum([
40105
- "openai-compatible",
40106
- "openai",
40107
- "anthropic",
40108
- "google",
40109
- "managed-local",
40110
- "apple-foundation"
40111
- ]);
40219
+ var LlmProviderConfigSchema = record(string(), unknown());
40112
40220
  var LlmProfileSchema = object({
40113
40221
  id: string(),
40114
40222
  name: string(),
40223
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
40115
40224
  kind: LlmProfileKindSchema,
40116
40225
  /** Stamped by the provider — keeps the fanned catalog routable. */
40117
40226
  addonId: string(),
40118
40227
  enabled: boolean(),
40119
40228
  /** Vendor model id, or the managed runtime's loaded model. */
40120
40229
  model: string(),
40121
- /** Required for openai-compatible; override for cloud kinds. */
40122
- baseUrl: string().optional(),
40123
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
40124
- apiKey: string().optional(),
40125
40230
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
40126
40231
  * degraded to text — that shipped once and produced a confident answer to a
40127
40232
  * question about a picture nobody sent. */
@@ -40129,15 +40234,11 @@ var LlmProfileSchema = object({
40129
40234
  temperature: number().min(0).max(2).optional(),
40130
40235
  /** Nucleus sampling. Every wire we speak has it. */
40131
40236
  topP: number().min(0).max(1).optional(),
40132
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
40133
- * wire does, and the client drops it there (measured: the request body gets
40134
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
40135
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
40237
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
40238
+ * field in its editor only when its descriptor lists it in `profileFields`. */
40136
40239
  topK: number().int().positive().optional(),
40137
40240
  maxTokens: number().int().positive().optional(),
40138
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
40139
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
40140
- * the model with, so it is the one field that changes a PROCESS. */
40241
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
40141
40242
  contextLength: number().int().positive().optional(),
40142
40243
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
40143
40244
  * two system prompts fighting is worse than either alone). */
@@ -40163,16 +40264,37 @@ var LlmProfileSchema = object({
40163
40264
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
40164
40265
  * `true` here buys the wiring, not behaviour, until tools are registered. */
40165
40266
  toolsEnabled: boolean().default(false),
40166
- extraHeaders: record(string(), string()).optional(),
40167
- /** kind === 'managed-local' only (spec §4). */
40168
- runtime: ManagedRuntimeConfigSchema.optional(),
40169
- /**
40170
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
40171
- * to configure (no key, no URL, no download; `model` is `apple-system`).
40172
- * `supportsVision` on such a row is stamped by the provider from the node's
40173
- * reported `imageInput`, never taken from the operator (D62).
40174
- */
40175
- appleFoundation: object({ nodeId: string() }).optional()
40267
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
40268
+ providerConfig: LlmProviderConfigSchema.default({})
40269
+ });
40270
+ /**
40271
+ * The common profile fields a kind's editor offers. The editor owns how each
40272
+ * one is drawn; the provider says which of them mean something on its wire.
40273
+ */
40274
+ var LlmProfileFieldSchema = _enum([
40275
+ "temperature",
40276
+ "topP",
40277
+ "topK",
40278
+ "maxTokens",
40279
+ "contextLength",
40280
+ "systemPrompt",
40281
+ "timeoutMs",
40282
+ "connectTimeoutMs",
40283
+ "firstTokenTimeoutMs",
40284
+ "idleTimeoutMs",
40285
+ "retry",
40286
+ "toolsEnabled"
40287
+ ]);
40288
+ /**
40289
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
40290
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
40291
+ * picker: that widget owns the model choice.
40292
+ */
40293
+ var LlmProviderWidgetSchema = object({
40294
+ id: string(),
40295
+ placement: _enum(["connection", "model"]),
40296
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
40297
+ requires: array(string()).optional()
40176
40298
  });
40177
40299
  /** ConfigUISchema tree passed through untyped on the wire (the
40178
40300
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -40181,11 +40303,56 @@ var ConfigSchemaPassthrough$3 = unknown();
40181
40303
  var LlmProfileKindDescriptorSchema = object({
40182
40304
  kind: LlmProfileKindSchema,
40183
40305
  label: string(),
40306
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
40184
40307
  icon: string(),
40185
40308
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
40186
40309
  addonId: string(),
40187
- configSchema: ConfigSchemaPassthrough$3
40310
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
40311
+ connectionSchema: ConfigSchemaPassthrough$3,
40312
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
40313
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
40314
+ /** The kind's defaults; a model from `listModels` may override any of them. */
40315
+ features: LlmModelFeaturesSchema,
40316
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
40317
+ visionEditable: boolean(),
40318
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
40319
+ modelCatalog: _enum([
40320
+ "fetch",
40321
+ "static",
40322
+ "none"
40323
+ ]),
40324
+ staticModels: array(LlmModelInfoSchema).optional(),
40325
+ /** The common fields that mean something on this kind's wire. */
40326
+ profileFields: array(LlmProfileFieldSchema),
40327
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
40328
+ });
40329
+ /**
40330
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
40331
+ * (the editor's form); with `profileId` too, a secret the draft leaves
40332
+ * untouched (absent or the redaction marker) is resolved server-side from the
40333
+ * stored profile — the browser never receives it.
40334
+ */
40335
+ var LlmListModelsInputSchema = object({
40336
+ addonId: string(),
40337
+ kind: LlmProfileKindSchema,
40338
+ profileId: string().optional(),
40339
+ connection: LlmProviderConfigSchema.optional()
40188
40340
  });
40341
+ var LlmListModelsErrorCodeSchema = _enum([
40342
+ "auth",
40343
+ "network",
40344
+ "unsupported",
40345
+ "invalid"
40346
+ ]);
40347
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
40348
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
40349
+ ok: literal(true),
40350
+ models: array(LlmModelInfoSchema)
40351
+ }), object({
40352
+ ok: literal(false),
40353
+ code: LlmListModelsErrorCodeSchema,
40354
+ message: string()
40355
+ })]);
40189
40356
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
40190
40357
  var LlmDefaultSchema = object({
40191
40358
  selector: LlmDefaultSelectorSchema,
@@ -40285,7 +40452,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
40285
40452
  kind: "mutation",
40286
40453
  auth: "admin",
40287
40454
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40288
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
40455
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
40456
+ kind: "mutation",
40457
+ auth: "admin"
40458
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
40289
40459
  selector: LlmDefaultSelectorSchema,
40290
40460
  profileId: string().nullable()
40291
40461
  }), _void(), {
@@ -40453,14 +40623,106 @@ var LogEntrySchema = object({
40453
40623
  meta: record(string(), unknown()).optional(),
40454
40624
  tags: record(string(), string()).optional()
40455
40625
  });
40456
- method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
40457
- scope: array(string()).optional(),
40626
+ /**
40627
+ * A history READ against one destination (D898).
40628
+ *
40629
+ * Every filter is applied by the PROVIDER, before the limit — a filter the
40630
+ * browser applied after the limit is what made a rare device's lines
40631
+ * unreachable behind a busy one's. `before` / `after` are cursors the provider
40632
+ * minted (opaque to everyone else): a file position for the rotated files, a
40633
+ * nanosecond timestamp for Loki.
40634
+ *
40635
+ * A read is BOUNDED by `budgetMs`: a filter that matches nothing on a 30-day
40636
+ * store answers `done: false` with the cursor it reached and the bytes it
40637
+ * scanned, and the caller decides whether to go on. That is what makes a long
40638
+ * scan show progress and stop when asked — `cancelRead` ends the slice in
40639
+ * flight, and not asking for the next slice ends the scan.
40640
+ */
40641
+ var LogReadQuerySchema = object({
40642
+ /** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
40643
+ requestId: string().min(1).max(64).optional(),
40644
+ /** The device the line is about (`tags.deviceId`, numeric). */
40645
+ deviceId: number().int().optional(),
40646
+ /**
40647
+ * The emitting addon — bare manifest id; `@<version>` / `::<sub>` suffixes
40648
+ * match. Not `addonId`: a cap router reads that name as "which provider".
40649
+ */
40650
+ fromAddonId: string().min(1).max(200).optional(),
40651
+ /**
40652
+ * The emitting node: matches the agent that emitted the line, the node
40653
+ * itself, or a worker under it (`<agent>/<runner>`) — the `agentId`
40654
+ * semantics of `matchesLogTags`. Not `nodeId`: a cap router reads that
40655
+ * name as "which node's provider".
40656
+ */
40657
+ fromNodeId: string().min(1).max(200).optional(),
40658
+ /** Any other tag, exact match (AND). */
40659
+ tags: record(string(), union([string(), number()])).optional(),
40660
+ /** Severity FLOOR: this level and above. */
40458
40661
  level: LogLevelSchema.optional(),
40459
- since: date().optional(),
40460
- until: date().optional(),
40461
- limit: number().optional(),
40462
- tags: record(string(), string()).optional()
40463
- }), array(LogEntrySchema).readonly());
40662
+ /** Case-insensitive substring over message, scope, tag values and meta values. */
40663
+ text: string().min(1).max(200).optional(),
40664
+ /** Epoch ms, inclusive. */
40665
+ since: number().optional(),
40666
+ /** Epoch ms, inclusive. */
40667
+ until: number().optional(),
40668
+ /** Older than this cursor (exclusive). Absent with `after` absent ⇒ from the newest. */
40669
+ before: string().min(1).max(1024).optional(),
40670
+ /** Newer than this cursor (exclusive). */
40671
+ after: string().min(1).max(1024).optional(),
40672
+ limit: number().int().min(1).max(1e3).optional(),
40673
+ /** Wall-clock bound of this slice. The provider caps it. */
40674
+ budgetMs: number().int().min(50).max(1e4).optional()
40675
+ });
40676
+ var LogReadResultSchema = object({
40677
+ /** Newest first. */
40678
+ entries: array(object({
40679
+ /** `<bootId>.<seq>` minted by the emitting LogManager — the dedupe key. */
40680
+ id: string().optional(),
40681
+ /** Epoch ms. */
40682
+ timestamp: number(),
40683
+ level: LogLevelSchema,
40684
+ scope: string().optional(),
40685
+ message: string(),
40686
+ tags: record(string(), union([string(), number()])).optional(),
40687
+ meta: record(string(), unknown()).optional()
40688
+ })),
40689
+ /** Pass as `before` for the next older page; null when nothing older exists. */
40690
+ nextBefore: string().nullable(),
40691
+ /** Pass as `after` to read what arrived since; null when unknown. */
40692
+ nextAfter: string().nullable(),
40693
+ /** Bytes this slice read (files) or received (remote). Progress, not a promise. */
40694
+ scannedBytes: number().int().nonnegative(),
40695
+ /**
40696
+ * True when the scan in this direction reached the end of the store.
40697
+ * False with fewer than `limit` entries means the budget ran out first —
40698
+ * call again with `nextBefore` to go on.
40699
+ */
40700
+ done: boolean(),
40701
+ /** True when `cancelRead` ended this slice early. */
40702
+ cancelled: boolean().optional()
40703
+ });
40704
+ var LogReadCapabilitiesSchema = object({
40705
+ /** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
40706
+ readable: boolean(),
40707
+ /** Why not, when `readable` is false — rendered next to the source. */
40708
+ reason: string().nullable(),
40709
+ /** Filters the provider applies itself. A false one is applied by nobody. */
40710
+ filters: object({
40711
+ deviceId: boolean(),
40712
+ addonId: boolean(),
40713
+ nodeId: boolean(),
40714
+ tags: boolean(),
40715
+ level: boolean(),
40716
+ text: boolean(),
40717
+ timeRange: boolean()
40718
+ }),
40719
+ /** How far back the store reaches, when the provider knows (days). */
40720
+ retentionDays: number().nullable()
40721
+ });
40722
+ 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() }), {
40723
+ kind: "mutation",
40724
+ auth: "admin"
40725
+ });
40464
40726
  /**
40465
40727
  * `login-method` — collection cap through which auth addons contribute
40466
40728
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -43016,6 +43278,33 @@ var NcRuleTargetSchema = object({
43016
43278
  params: record(string(), unknown()).optional()
43017
43279
  });
43018
43280
  /**
43281
+ * WHAT THE NOTIFICATION'S PICTURE IS (D897) — the ONE media choice of a rule.
43282
+ *
43283
+ * Every mode starts from the same CLEAN source frame of the trigger moment
43284
+ * (keyFrame → sceneFrame → lastSceneFrame, narrowed to the trigger instant and
43285
+ * to the zone that fired the rule) and renders it once at send time:
43286
+ * - `scene-boxes` — the whole scene, the subject outlined thick in the accent
43287
+ * colour and every OTHER track visible at that instant outlined thin, each
43288
+ * labelled with class and confidence ("dog 87%").
43289
+ * - `crop` — the subject cut out of that frame around its box at that instant.
43290
+ * - `clean` — the whole scene with nothing drawn on it.
43291
+ * - `none` — no picture.
43292
+ *
43293
+ * A mode that cannot be honoured (no box at that instant, a photograph with no
43294
+ * tracked subject) ships `clean` and names the reason in the log, per camera.
43295
+ * It replaces the `attach` × `frame` × `zoneCrop` triple, which let one rule
43296
+ * ship a crop on one event and a boxed scene on the next depending on which
43297
+ * stored kind had landed.
43298
+ */
43299
+ var NcMediaImageSchema = _enum([
43300
+ "scene-boxes",
43301
+ "crop",
43302
+ "clean",
43303
+ "none"
43304
+ ]);
43305
+ /**
43306
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
43307
+ *
43019
43308
  * Media attachment policy (P1 still-image subset).
43020
43309
  * - `best` — the best AVAILABLE subject image at dispatch time (D-3).
43021
43310
  * - `best-matching` — the media that explains WHY the rule fired: a rule
@@ -43029,6 +43318,8 @@ var NcRuleTargetSchema = object({
43029
43318
  * - `none` — no attachment.
43030
43319
  */
43031
43320
  /**
43321
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
43322
+ *
43032
43323
  * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
43033
43324
  * conflate it with the selection strategy and betray the request: asking for
43034
43325
  * the clean scene frame on an object-event owner used to start at
@@ -43057,16 +43348,29 @@ var NcMediaFrameSchema = _enum([
43057
43348
  */
43058
43349
  var NcLinkedCameraModeSchema = _enum(["mosaic", "each"]);
43059
43350
  var NcMediaPolicySchema = object({
43351
+ /**
43352
+ * The picture — see {@link NcMediaImageSchema}. Absent on a rule nobody has
43353
+ * saved since D897: `normalizeNcMediaPolicy` derives it from the legacy
43354
+ * triple below, at load and at every write, and the store keeps only this.
43355
+ */
43356
+ image: NcMediaImageSchema.optional(),
43357
+ /**
43358
+ * Draw the zone that FIRED the rule on the picture (`scene-boxes` / `clean`;
43359
+ * a `crop` never shows it). Valid only on a rule whose trigger is a zone —
43360
+ * `conditions.zones` or an occupancy zone — and refused on save otherwise.
43361
+ * Replaces `zoneCrop`.
43362
+ */
43363
+ showTriggerZone: boolean().optional(),
43364
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
43060
43365
  attach: _enum([
43061
43366
  "best",
43062
43367
  "best-matching",
43063
43368
  "keyFrame",
43064
43369
  "none"
43065
- ]).default("best"),
43066
- /** What the still shows. Absent = `cropped` (the historical `best` shape). */
43370
+ ]).optional(),
43371
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
43067
43372
  frame: NcMediaFrameSchema.optional(),
43068
- /** Crop the attached still to the rule's condition-zone bbox (padded) —
43069
- * "show me the ZONE", not the whole scene or the subject crop. */
43373
+ /** @deprecated D897 — folded into `image: 'clean'` + `showTriggerZone` on save. */
43070
43374
  zoneCrop: boolean().optional(),
43071
43375
  /**
43072
43376
  * Also attach a short GIF cut from the stream broker's clip ring around the
@@ -43238,7 +43542,9 @@ var NcRuleInputSchema = object({
43238
43542
  * targets.
43239
43543
  */
43240
43544
  targetUsers: array(string()).optional(),
43241
- media: NcMediaPolicySchema.default({ attach: "best" }),
43545
+ /** Absent = the kind's default picture (`resolveNcMediaImage`): the subject crop for a
43546
+ * detection, the clean scene for a sensor or a sound. Set explicitly on save (D897). */
43547
+ media: NcMediaPolicySchema.default({}),
43242
43548
  throttle: NcThrottleSchema.default({
43243
43549
  cooldownSec: 60,
43244
43550
  scope: "rule-device"
@@ -44175,13 +44481,37 @@ var NcAlarmModeOpeningsSchema = object({
44175
44481
  /** Covered devices whose state could not be read (D49): neither open nor closed. */
44176
44482
  unknown: array(number().int())
44177
44483
  });
44484
+ /**
44485
+ * One alarm INPUT — a (rule, device) pair — the operator bypassed until the
44486
+ * next disarm ("Bypass this input until disarm" on a trigger notification, or
44487
+ * `nc.bypassAlarmInput`). Reported so an armed alarm with a silenced input
44488
+ * never looks fully armed (D62: off must never look like broken).
44489
+ */
44490
+ var NcAlarmInputBypassViewSchema = object({
44491
+ ruleId: string(),
44492
+ /** The rule's current name (its frozen name when the rule is gone). */
44493
+ ruleName: string(),
44494
+ /** The input: the sensor of the match, else its camera. */
44495
+ deviceId: number().int(),
44496
+ /** The input's current name. */
44497
+ name: string(),
44498
+ /** When it was bypassed (ms epoch). */
44499
+ since: number(),
44500
+ /** Triggers from this input dropped since. */
44501
+ dropped: number().int().min(0)
44502
+ });
44178
44503
  var NcAlarmLiveSchema = object({
44179
44504
  state: AlarmStateSchema,
44180
44505
  /** The mode being armed into (exit delay) or held; null when disarmed. */
44181
44506
  targetMode: AlarmArmModeSchema.nullable(),
44182
44507
  availableModes: array(AlarmArmModeSchema),
44183
44508
  openings: array(NcAlarmModeOpeningsSchema),
44184
- exclusions: array(NcAlarmExclusionViewSchema)
44509
+ exclusions: array(NcAlarmExclusionViewSchema),
44510
+ /**
44511
+ * Inputs bypassed for the rest of this arm session; cleared on disarm.
44512
+ * Defaulted so an older hub answer still parses (as "none known").
44513
+ */
44514
+ bypassedInputs: array(NcAlarmInputBypassViewSchema).default([])
44185
44515
  });
44186
44516
  var NcAlarmConfigSchema = object({
44187
44517
  /**
@@ -61303,26 +61633,6 @@ var ApiKeySummarySchema = object({
61303
61633
  createdAt: number(),
61304
61634
  lastUsedAt: number().optional()
61305
61635
  });
61306
- var ScopedTokenSummarySchema = object({
61307
- id: string(),
61308
- userId: string(),
61309
- name: string(),
61310
- tokenPrefix: string(),
61311
- scopes: array(TokenScopeSchema),
61312
- expiresAt: number().nullish(),
61313
- lastUsedAt: number().nullish(),
61314
- createdAt: number()
61315
- });
61316
- var CreateScopedTokenInputSchema = object({
61317
- userId: string(),
61318
- name: string(),
61319
- scopes: array(TokenScopeSchema),
61320
- expiresAt: number().optional()
61321
- });
61322
- var CreateScopedTokenResultSchema = object({
61323
- token: string(),
61324
- record: ScopedTokenSummarySchema
61325
- });
61326
61636
  var OauthSessionSummarySchema = object({
61327
61637
  id: string(),
61328
61638
  userId: string(),
@@ -61344,11 +61654,11 @@ var TotpStatusSchema = object({
61344
61654
  confirmedAt: number().nullable()
61345
61655
  });
61346
61656
  /**
61347
- * user-management — singleton capability for user accounts, API keys,
61348
- * and scoped tokens.
61657
+ * user-management — singleton capability for user accounts and the
61658
+ * legacy API-key rows.
61349
61659
  *
61350
61660
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
61351
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
61661
+ * — the subset check on `setUserScopes` is moot
61352
61662
  * because non-admins never reach these. If/when we open non-admin
61353
61663
  * delegation, structural caller-scope subset check goes inside the
61354
61664
  * provider.
@@ -61405,15 +61715,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
61405
61715
  kind: "mutation",
61406
61716
  auth: "admin",
61407
61717
  access: "delete"
61408
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
61409
- kind: "mutation",
61410
- auth: "admin",
61411
- access: "create"
61412
- }), method(object({ id: string() }), object({ success: literal(true) }), {
61413
- kind: "mutation",
61414
- auth: "admin",
61415
- access: "delete"
61416
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
61718
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
61417
61719
  kind: "mutation",
61418
61720
  auth: "admin",
61419
61721
  access: "create"
@@ -65569,7 +65871,7 @@ Object.freeze({
65569
65871
  capName: "llm",
65570
65872
  capScope: "system",
65571
65873
  addonId: null,
65572
- access: "view"
65874
+ access: "create"
65573
65875
  },
65574
65876
  "llm.listNodeModels": {
65575
65877
  capName: "llm",
@@ -65871,7 +66173,19 @@ Object.freeze({
65871
66173
  addonId: null,
65872
66174
  access: "view"
65873
66175
  },
65874
- "logDestination.query": {
66176
+ "logDestination.cancelRead": {
66177
+ capName: "log-destination",
66178
+ capScope: "system",
66179
+ addonId: null,
66180
+ access: "create"
66181
+ },
66182
+ "logDestination.describeRead": {
66183
+ capName: "log-destination",
66184
+ capScope: "system",
66185
+ addonId: null,
66186
+ access: "view"
66187
+ },
66188
+ "logDestination.read": {
65875
66189
  capName: "log-destination",
65876
66190
  capScope: "system",
65877
66191
  addonId: null,
@@ -70233,12 +70547,6 @@ Object.freeze({
70233
70547
  addonId: null,
70234
70548
  access: "create"
70235
70549
  },
70236
- "userManagement.createScopedToken": {
70237
- capName: "user-management",
70238
- capScope: "system",
70239
- addonId: null,
70240
- access: "create"
70241
- },
70242
70550
  "userManagement.createUser": {
70243
70551
  capName: "user-management",
70244
70552
  capScope: "system",
@@ -70287,12 +70595,6 @@ Object.freeze({
70287
70595
  addonId: null,
70288
70596
  access: "view"
70289
70597
  },
70290
- "userManagement.listScopedTokens": {
70291
- capName: "user-management",
70292
- capScope: "system",
70293
- addonId: null,
70294
- access: "view"
70295
- },
70296
70598
  "userManagement.listUsers": {
70297
70599
  capName: "user-management",
70298
70600
  capScope: "system",
@@ -70347,12 +70649,6 @@ Object.freeze({
70347
70649
  addonId: null,
70348
70650
  access: "delete"
70349
70651
  },
70350
- "userManagement.revokeScopedToken": {
70351
- capName: "user-management",
70352
- capScope: "system",
70353
- addonId: null,
70354
- access: "delete"
70355
- },
70356
70652
  "userManagement.setupTotp": {
70357
70653
  capName: "user-management",
70358
70654
  capScope: "system",
@@ -70383,12 +70679,6 @@ Object.freeze({
70383
70679
  addonId: null,
70384
70680
  access: "view"
70385
70681
  },
70386
- "userManagement.validateScopedToken": {
70387
- capName: "user-management",
70388
- capScope: "system",
70389
- addonId: null,
70390
- access: "view"
70391
- },
70392
70682
  "userManagement.verifyTotp": {
70393
70683
  capName: "user-management",
70394
70684
  capScope: "system",
@@ -71902,6 +72192,11 @@ Object.freeze({
71902
72192
  form: "single",
71903
72193
  optional: false
71904
72194
  }],
72195
+ "logDestination.read": [{
72196
+ name: "deviceId",
72197
+ form: "single",
72198
+ optional: true
72199
+ }],
71905
72200
  "mediaPlayer.getStatus": [{
71906
72201
  name: "deviceId",
71907
72202
  form: "single",