@camstack/addon-export-google 0.1.96 → 0.1.98

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.
@@ -5492,7 +5492,7 @@ var ZodIssueCode = {
5492
5492
  var ZodFirstPartyTypeKind;
5493
5493
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5494
5494
  //#endregion
5495
- //#region ../types/dist/sleep-BxjU_fJM.mjs
5495
+ //#region ../types/dist/sleep-BSuCCFjf.mjs
5496
5496
  /**
5497
5497
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5498
5498
  * window to float samples (D455).
@@ -7875,9 +7875,9 @@ function normalizeAddonInitResult(result) {
7875
7875
  return result;
7876
7876
  }
7877
7877
  /**
7878
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7879
- * and validates them (`share-token.service.ts` builds its enum from this
7880
- * list); a data plane names the kinds it ACCEPTS in `share`.
7878
+ * The share-view scope kinds a share-link token can carry. The hub mints
7879
+ * and validates them (`ShareViewGrantSchema` builds its
7880
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7881
7881
  */
7882
7882
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7883
7883
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -12642,7 +12642,7 @@ function scopesAllowDeviceCap(scopes, access) {
12642
12642
  * `super_admin` — collapsed onto the single boolean because every
12643
12643
  * non-admin caller is governed by the same scope-check rules; the
12644
12644
  * distinction was only ever used to route role-specific procedures
12645
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12645
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
12646
12646
  * with `isAdmin: false` + an explicit scope list.
12647
12647
  */
12648
12648
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -12831,10 +12831,12 @@ var AddonRoutesScopeSchema = object({
12831
12831
  type: literal("addon-routes"),
12832
12832
  access: array(MethodAccessSchema).min(1)
12833
12833
  });
12834
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
12834
12835
  var CredentialScopeSchema = union([
12835
12836
  literal("*"),
12836
12837
  ShareViewScopeSchema,
12837
12838
  AddonRoutesScopeSchema,
12839
+ PreferencesSelfScopeSchema,
12838
12840
  TokenScopeSchema
12839
12841
  ]);
12840
12842
  object({
@@ -12843,6 +12845,55 @@ object({
12843
12845
  jti: string().min(16),
12844
12846
  scopes: array(CredentialScopeSchema).min(1)
12845
12847
  });
12848
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
12849
+ /** A namespace's value: a JSON object, opaque to the hub. */
12850
+ var PreferenceValueSchema = record(string(), unknown());
12851
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
12852
+ /** A stored row, as the owner reads it. */
12853
+ var PreferenceRowSchema = object({
12854
+ namespace: PreferenceNamespaceSchema,
12855
+ value: PreferenceValueSchema,
12856
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
12857
+ revision: number().int().positive(),
12858
+ updatedAt: number().int(),
12859
+ /** The client id the last writer sent; `null` when it sent none. */
12860
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
12861
+ });
12862
+ object({
12863
+ /** Absent: every namespace the caller holds. */
12864
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
12865
+ object({ rows: array(PreferenceRowSchema) });
12866
+ object({
12867
+ namespace: PreferenceNamespaceSchema,
12868
+ value: PreferenceValueSchema,
12869
+ /**
12870
+ * The revision the edit was based on. Absent: last write wins. `0`: the
12871
+ * namespace must not exist yet. Any other value that is not the current
12872
+ * revision answers `conflict` and writes nothing.
12873
+ */
12874
+ baseRevision: number().int().nonnegative().optional(),
12875
+ deviceId: PreferenceDeviceIdSchema.optional()
12876
+ });
12877
+ discriminatedUnion("status", [object({
12878
+ status: literal("saved"),
12879
+ row: PreferenceRowSchema
12880
+ }), object({
12881
+ status: literal("conflict"),
12882
+ current: PreferenceRowSchema.nullable()
12883
+ })]);
12884
+ object({ namespace: PreferenceNamespaceSchema });
12885
+ object({
12886
+ /** `false` when the namespace did not exist. */
12887
+ deleted: boolean() });
12888
+ object({
12889
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
12890
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
12891
+ object({
12892
+ /** Every row whose revision differs from the client's, and every row it did not list. */
12893
+ rows: array(PreferenceRowSchema),
12894
+ /** Namespaces the client listed that no longer exist. */
12895
+ deleted: array(PreferenceNamespaceSchema)
12896
+ });
12846
12897
  _enum(["new-session", "step-up"]);
12847
12898
  /** The languages the hub's app landing pages are written in (D858). */
12848
12899
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -17009,7 +17060,19 @@ var DeviceHistorySubjectSchema = discriminatedUnion("kind", [object({
17009
17060
  kind: literal("node"),
17010
17061
  nodeId: string().min(1)
17011
17062
  })]);
17063
+ /**
17064
+ * `enum` stores a STATE as the ordinal of its value in the series' value list
17065
+ * (`DeviceHistorySeriesInfo.values`, append-only, so an ordinal never changes
17066
+ * meaning); a rollup keeps the time spent in each state (`states`).
17067
+ */
17012
17068
  var DeviceHistoryKindSchema = _enum([
17069
+ "gauge",
17070
+ "counter",
17071
+ "boolean",
17072
+ "enum"
17073
+ ]);
17074
+ /** What a PRODUCER may declare. `enum` is cap-only: its value list is the cap field's. */
17075
+ var DeviceHistoryProducerKindSchema = _enum([
17013
17076
  "gauge",
17014
17077
  "counter",
17015
17078
  "boolean"
@@ -17046,7 +17109,13 @@ var SeriesInfoSchema = object({
17046
17109
  /** `null` is unknown (a `unitFrom` series whose device does not state a unit right now), never a guess. */
17047
17110
  unit: string().nullable(),
17048
17111
  displayName: string(),
17049
- source: _enum(["cap", "addon"]),
17112
+ source: _enum([
17113
+ "cap",
17114
+ "addon",
17115
+ "derived"
17116
+ ]),
17117
+ /** `enum`: the value of each ordinal (index = ordinal); `null` for every other kind. */
17118
+ values: array(string()).readonly().nullable(),
17050
17119
  firstTs: number(),
17051
17120
  lastTs: number()
17052
17121
  });
@@ -17060,17 +17129,31 @@ var QueryPointSchema = object({
17060
17129
  twMean: number().nullable(),
17061
17130
  min: number(),
17062
17131
  max: number(),
17063
- /** `null` is unknown, never zero (D393). */
17064
- last: number().nullable()
17132
+ /** `null` is unknown, never zero (D393). For an `enum` series: the ordinal of {@link state}. */
17133
+ last: number().nullable(),
17134
+ /**
17135
+ * The increase over the point: a `counter`'s growth since the previous point
17136
+ * or bucket (a drop is a reset, counted from zero), and for
17137
+ * {@link DEVICE_HISTORY_ENERGY_KEY} the kWh used in the bucket. `null` for
17138
+ * every other kind, and when it cannot be known.
17139
+ */
17140
+ delta: number().nullable(),
17141
+ /** `enum`: the state in force at the end of the point (the name of `last`); `null` otherwise. */
17142
+ state: string().nullable(),
17143
+ /** `enum` rollup: milliseconds spent in each state inside the bucket; `null` for raw points and other kinds. */
17144
+ states: record(string(), number()).nullable()
17065
17145
  });
17066
17146
  var QuerySeriesSchema = object({
17067
17147
  scope: string(),
17068
17148
  /** The last point STRICTLY BEFORE `from` in the chosen tier, so a step chart can start at the held value. */
17069
17149
  before: object({
17070
17150
  t: number(),
17071
- value: number().nullable()
17151
+ value: number().nullable(),
17152
+ state: string().nullable()
17072
17153
  }).nullable(),
17073
- points: array(QueryPointSchema).readonly()
17154
+ points: array(QueryPointSchema).readonly(),
17155
+ /** A derived key: the stored key its points were computed from; `null` for a stored series. */
17156
+ derivedFrom: string().nullable()
17074
17157
  });
17075
17158
  /** The window part of a query, shared by the device and node forms. */
17076
17159
  var QueryWindowShape = {
@@ -17086,6 +17169,23 @@ var QueryResultSchema = object({
17086
17169
  series: array(QuerySeriesSchema).readonly(),
17087
17170
  truncated: boolean()
17088
17171
  });
17172
+ /** One read of a batch: a device's key or a node's key (exactly one subject). */
17173
+ var QueryManyItemSchema = union([object({
17174
+ deviceId: number().int(),
17175
+ key: string(),
17176
+ scope: string().optional()
17177
+ }), object({
17178
+ forNodeId: string().min(1),
17179
+ key: string(),
17180
+ scope: string().optional()
17181
+ })]);
17182
+ var QueryManyEntrySchema = discriminatedUnion("ok", [object({
17183
+ ok: literal(true),
17184
+ result: QueryResultSchema
17185
+ }), object({
17186
+ ok: literal(false),
17187
+ error: string()
17188
+ })]);
17089
17189
  var TierStatusSchema = object({
17090
17190
  tier: DeviceHistoryResolutionSchema,
17091
17191
  /** `null` until the first background count answered. */
@@ -17141,16 +17241,22 @@ var DeviceHistoryStatusSchema = object({
17141
17241
  lastRefreshAt: number().nullable()
17142
17242
  })
17143
17243
  });
17144
- method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ nodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
17244
+ method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ forNodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
17145
17245
  deviceId: number().int(),
17146
17246
  ...QueryWindowShape
17147
17247
  }), QueryResultSchema), method(object({
17148
- nodeId: string().min(1),
17248
+ forNodeId: string().min(1),
17149
17249
  ...QueryWindowShape
17150
17250
  }), QueryResultSchema, { auth: "admin" }), method(object({
17251
+ items: array(QueryManyItemSchema).min(1).max(24),
17252
+ from: QueryWindowShape.from,
17253
+ to: QueryWindowShape.to,
17254
+ resolution: QueryWindowShape.resolution,
17255
+ maxPoints: QueryWindowShape.maxPoints
17256
+ }), object({ results: array(QueryManyEntrySchema).readonly() }), { auth: "admin" }), method(object({
17151
17257
  name: string().regex(/^[a-z0-9-]+$/),
17152
17258
  subjectKind: _enum(["device", "node"]),
17153
- kind: DeviceHistoryKindSchema,
17259
+ kind: DeviceHistoryProducerKindSchema,
17154
17260
  unit: string().optional(),
17155
17261
  displayName: string().min(1),
17156
17262
  ingest: _enum(["points", "buckets"])
@@ -39765,38 +39871,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
39765
39871
  auth: "admin",
39766
39872
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
39767
39873
  });
39874
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
39875
+ /** What a model (or, by default, every model of a kind) can do. */
39876
+ var LlmModelFeaturesSchema = object({
39877
+ vision: boolean(),
39878
+ tools: boolean(),
39879
+ streaming: boolean()
39880
+ });
39881
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
39882
+ var LlmModelInfoSchema = object({
39883
+ id: string(),
39884
+ label: string().optional(),
39885
+ contextLength: number().int().positive().optional(),
39886
+ features: LlmModelFeaturesSchema.partial().optional()
39887
+ });
39768
39888
  /**
39769
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
39770
- * methods concat-fan across providers; single-row methods route to ONE
39771
- * provider by the `addonId` in the call input (the notification-output
39772
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
39773
- * (hub-placed); the cap stays open for future providers.
39774
- *
39775
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
39776
- * `apiKey` is a password field — providers REDACT it on read and merge on
39777
- * write; a stored key NEVER round-trips to a client.
39889
+ * The provider-specific part of a profile, validated by the provider that owns
39890
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
39891
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
39892
+ * keychain, never in the row, and reads back as the redaction marker.
39778
39893
  */
39779
- var LlmProfileKindSchema = _enum([
39780
- "openai-compatible",
39781
- "openai",
39782
- "anthropic",
39783
- "google",
39784
- "managed-local",
39785
- "apple-foundation"
39786
- ]);
39894
+ var LlmProviderConfigSchema = record(string(), unknown());
39787
39895
  var LlmProfileSchema = object({
39788
39896
  id: string(),
39789
39897
  name: string(),
39898
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
39790
39899
  kind: LlmProfileKindSchema,
39791
39900
  /** Stamped by the provider — keeps the fanned catalog routable. */
39792
39901
  addonId: string(),
39793
39902
  enabled: boolean(),
39794
39903
  /** Vendor model id, or the managed runtime's loaded model. */
39795
39904
  model: string(),
39796
- /** Required for openai-compatible; override for cloud kinds. */
39797
- baseUrl: string().optional(),
39798
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
39799
- apiKey: string().optional(),
39800
39905
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
39801
39906
  * degraded to text — that shipped once and produced a confident answer to a
39802
39907
  * question about a picture nobody sent. */
@@ -39804,15 +39909,11 @@ var LlmProfileSchema = object({
39804
39909
  temperature: number().min(0).max(2).optional(),
39805
39910
  /** Nucleus sampling. Every wire we speak has it. */
39806
39911
  topP: number().min(0).max(1).optional(),
39807
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
39808
- * wire does, and the client drops it there (measured: the request body gets
39809
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
39810
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
39912
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
39913
+ * field in its editor only when its descriptor lists it in `profileFields`. */
39811
39914
  topK: number().int().positive().optional(),
39812
39915
  maxTokens: number().int().positive().optional(),
39813
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
39814
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
39815
- * the model with, so it is the one field that changes a PROCESS. */
39916
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
39816
39917
  contextLength: number().int().positive().optional(),
39817
39918
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
39818
39919
  * two system prompts fighting is worse than either alone). */
@@ -39838,16 +39939,37 @@ var LlmProfileSchema = object({
39838
39939
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
39839
39940
  * `true` here buys the wiring, not behaviour, until tools are registered. */
39840
39941
  toolsEnabled: boolean().default(false),
39841
- extraHeaders: record(string(), string()).optional(),
39842
- /** kind === 'managed-local' only (spec §4). */
39843
- runtime: ManagedRuntimeConfigSchema.optional(),
39844
- /**
39845
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
39846
- * to configure (no key, no URL, no download; `model` is `apple-system`).
39847
- * `supportsVision` on such a row is stamped by the provider from the node's
39848
- * reported `imageInput`, never taken from the operator (D62).
39849
- */
39850
- appleFoundation: object({ nodeId: string() }).optional()
39942
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
39943
+ providerConfig: LlmProviderConfigSchema.default({})
39944
+ });
39945
+ /**
39946
+ * The common profile fields a kind's editor offers. The editor owns how each
39947
+ * one is drawn; the provider says which of them mean something on its wire.
39948
+ */
39949
+ var LlmProfileFieldSchema = _enum([
39950
+ "temperature",
39951
+ "topP",
39952
+ "topK",
39953
+ "maxTokens",
39954
+ "contextLength",
39955
+ "systemPrompt",
39956
+ "timeoutMs",
39957
+ "connectTimeoutMs",
39958
+ "firstTokenTimeoutMs",
39959
+ "idleTimeoutMs",
39960
+ "retry",
39961
+ "toolsEnabled"
39962
+ ]);
39963
+ /**
39964
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
39965
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
39966
+ * picker: that widget owns the model choice.
39967
+ */
39968
+ var LlmProviderWidgetSchema = object({
39969
+ id: string(),
39970
+ placement: _enum(["connection", "model"]),
39971
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
39972
+ requires: array(string()).optional()
39851
39973
  });
39852
39974
  /** ConfigUISchema tree passed through untyped on the wire (the
39853
39975
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -39856,11 +39978,56 @@ var ConfigSchemaPassthrough$3 = unknown();
39856
39978
  var LlmProfileKindDescriptorSchema = object({
39857
39979
  kind: LlmProfileKindSchema,
39858
39980
  label: string(),
39981
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
39859
39982
  icon: string(),
39860
39983
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
39861
39984
  addonId: string(),
39862
- configSchema: ConfigSchemaPassthrough$3
39985
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
39986
+ connectionSchema: ConfigSchemaPassthrough$3,
39987
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
39988
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
39989
+ /** The kind's defaults; a model from `listModels` may override any of them. */
39990
+ features: LlmModelFeaturesSchema,
39991
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
39992
+ visionEditable: boolean(),
39993
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
39994
+ modelCatalog: _enum([
39995
+ "fetch",
39996
+ "static",
39997
+ "none"
39998
+ ]),
39999
+ staticModels: array(LlmModelInfoSchema).optional(),
40000
+ /** The common fields that mean something on this kind's wire. */
40001
+ profileFields: array(LlmProfileFieldSchema),
40002
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
40003
+ });
40004
+ /**
40005
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
40006
+ * (the editor's form); with `profileId` too, a secret the draft leaves
40007
+ * untouched (absent or the redaction marker) is resolved server-side from the
40008
+ * stored profile — the browser never receives it.
40009
+ */
40010
+ var LlmListModelsInputSchema = object({
40011
+ addonId: string(),
40012
+ kind: LlmProfileKindSchema,
40013
+ profileId: string().optional(),
40014
+ connection: LlmProviderConfigSchema.optional()
39863
40015
  });
40016
+ var LlmListModelsErrorCodeSchema = _enum([
40017
+ "auth",
40018
+ "network",
40019
+ "unsupported",
40020
+ "invalid"
40021
+ ]);
40022
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
40023
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
40024
+ ok: literal(true),
40025
+ models: array(LlmModelInfoSchema)
40026
+ }), object({
40027
+ ok: literal(false),
40028
+ code: LlmListModelsErrorCodeSchema,
40029
+ message: string()
40030
+ })]);
39864
40031
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
39865
40032
  var LlmDefaultSchema = object({
39866
40033
  selector: LlmDefaultSelectorSchema,
@@ -39960,7 +40127,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
39960
40127
  kind: "mutation",
39961
40128
  auth: "admin",
39962
40129
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
39963
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
40130
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
40131
+ kind: "mutation",
40132
+ auth: "admin"
40133
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
39964
40134
  selector: LlmDefaultSelectorSchema,
39965
40135
  profileId: string().nullable()
39966
40136
  }), _void(), {
@@ -40128,14 +40298,106 @@ var LogEntrySchema = object({
40128
40298
  meta: record(string(), unknown()).optional(),
40129
40299
  tags: record(string(), string()).optional()
40130
40300
  });
40131
- method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
40132
- scope: array(string()).optional(),
40301
+ /**
40302
+ * A history READ against one destination (D898).
40303
+ *
40304
+ * Every filter is applied by the PROVIDER, before the limit — a filter the
40305
+ * browser applied after the limit is what made a rare device's lines
40306
+ * unreachable behind a busy one's. `before` / `after` are cursors the provider
40307
+ * minted (opaque to everyone else): a file position for the rotated files, a
40308
+ * nanosecond timestamp for Loki.
40309
+ *
40310
+ * A read is BOUNDED by `budgetMs`: a filter that matches nothing on a 30-day
40311
+ * store answers `done: false` with the cursor it reached and the bytes it
40312
+ * scanned, and the caller decides whether to go on. That is what makes a long
40313
+ * scan show progress and stop when asked — `cancelRead` ends the slice in
40314
+ * flight, and not asking for the next slice ends the scan.
40315
+ */
40316
+ var LogReadQuerySchema = object({
40317
+ /** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
40318
+ requestId: string().min(1).max(64).optional(),
40319
+ /** The device the line is about (`tags.deviceId`, numeric). */
40320
+ deviceId: number().int().optional(),
40321
+ /**
40322
+ * The emitting addon — bare manifest id; `@<version>` / `::<sub>` suffixes
40323
+ * match. Not `addonId`: a cap router reads that name as "which provider".
40324
+ */
40325
+ fromAddonId: string().min(1).max(200).optional(),
40326
+ /**
40327
+ * The emitting node: matches the agent that emitted the line, the node
40328
+ * itself, or a worker under it (`<agent>/<runner>`) — the `agentId`
40329
+ * semantics of `matchesLogTags`. Not `nodeId`: a cap router reads that
40330
+ * name as "which node's provider".
40331
+ */
40332
+ fromNodeId: string().min(1).max(200).optional(),
40333
+ /** Any other tag, exact match (AND). */
40334
+ tags: record(string(), union([string(), number()])).optional(),
40335
+ /** Severity FLOOR: this level and above. */
40133
40336
  level: LogLevelSchema.optional(),
40134
- since: date().optional(),
40135
- until: date().optional(),
40136
- limit: number().optional(),
40137
- tags: record(string(), string()).optional()
40138
- }), array(LogEntrySchema).readonly());
40337
+ /** Case-insensitive substring over message, scope, tag values and meta values. */
40338
+ text: string().min(1).max(200).optional(),
40339
+ /** Epoch ms, inclusive. */
40340
+ since: number().optional(),
40341
+ /** Epoch ms, inclusive. */
40342
+ until: number().optional(),
40343
+ /** Older than this cursor (exclusive). Absent with `after` absent ⇒ from the newest. */
40344
+ before: string().min(1).max(1024).optional(),
40345
+ /** Newer than this cursor (exclusive). */
40346
+ after: string().min(1).max(1024).optional(),
40347
+ limit: number().int().min(1).max(1e3).optional(),
40348
+ /** Wall-clock bound of this slice. The provider caps it. */
40349
+ budgetMs: number().int().min(50).max(1e4).optional()
40350
+ });
40351
+ var LogReadResultSchema = object({
40352
+ /** Newest first. */
40353
+ entries: array(object({
40354
+ /** `<bootId>.<seq>` minted by the emitting LogManager — the dedupe key. */
40355
+ id: string().optional(),
40356
+ /** Epoch ms. */
40357
+ timestamp: number(),
40358
+ level: LogLevelSchema,
40359
+ scope: string().optional(),
40360
+ message: string(),
40361
+ tags: record(string(), union([string(), number()])).optional(),
40362
+ meta: record(string(), unknown()).optional()
40363
+ })),
40364
+ /** Pass as `before` for the next older page; null when nothing older exists. */
40365
+ nextBefore: string().nullable(),
40366
+ /** Pass as `after` to read what arrived since; null when unknown. */
40367
+ nextAfter: string().nullable(),
40368
+ /** Bytes this slice read (files) or received (remote). Progress, not a promise. */
40369
+ scannedBytes: number().int().nonnegative(),
40370
+ /**
40371
+ * True when the scan in this direction reached the end of the store.
40372
+ * False with fewer than `limit` entries means the budget ran out first —
40373
+ * call again with `nextBefore` to go on.
40374
+ */
40375
+ done: boolean(),
40376
+ /** True when `cancelRead` ended this slice early. */
40377
+ cancelled: boolean().optional()
40378
+ });
40379
+ var LogReadCapabilitiesSchema = object({
40380
+ /** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
40381
+ readable: boolean(),
40382
+ /** Why not, when `readable` is false — rendered next to the source. */
40383
+ reason: string().nullable(),
40384
+ /** Filters the provider applies itself. A false one is applied by nobody. */
40385
+ filters: object({
40386
+ deviceId: boolean(),
40387
+ addonId: boolean(),
40388
+ nodeId: boolean(),
40389
+ tags: boolean(),
40390
+ level: boolean(),
40391
+ text: boolean(),
40392
+ timeRange: boolean()
40393
+ }),
40394
+ /** How far back the store reaches, when the provider knows (days). */
40395
+ retentionDays: number().nullable()
40396
+ });
40397
+ 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() }), {
40398
+ kind: "mutation",
40399
+ auth: "admin"
40400
+ });
40139
40401
  /**
40140
40402
  * `login-method` — collection cap through which auth addons contribute
40141
40403
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -42691,6 +42953,33 @@ var NcRuleTargetSchema = object({
42691
42953
  params: record(string(), unknown()).optional()
42692
42954
  });
42693
42955
  /**
42956
+ * WHAT THE NOTIFICATION'S PICTURE IS (D897) — the ONE media choice of a rule.
42957
+ *
42958
+ * Every mode starts from the same CLEAN source frame of the trigger moment
42959
+ * (keyFrame → sceneFrame → lastSceneFrame, narrowed to the trigger instant and
42960
+ * to the zone that fired the rule) and renders it once at send time:
42961
+ * - `scene-boxes` — the whole scene, the subject outlined thick in the accent
42962
+ * colour and every OTHER track visible at that instant outlined thin, each
42963
+ * labelled with class and confidence ("dog 87%").
42964
+ * - `crop` — the subject cut out of that frame around its box at that instant.
42965
+ * - `clean` — the whole scene with nothing drawn on it.
42966
+ * - `none` — no picture.
42967
+ *
42968
+ * A mode that cannot be honoured (no box at that instant, a photograph with no
42969
+ * tracked subject) ships `clean` and names the reason in the log, per camera.
42970
+ * It replaces the `attach` × `frame` × `zoneCrop` triple, which let one rule
42971
+ * ship a crop on one event and a boxed scene on the next depending on which
42972
+ * stored kind had landed.
42973
+ */
42974
+ var NcMediaImageSchema = _enum([
42975
+ "scene-boxes",
42976
+ "crop",
42977
+ "clean",
42978
+ "none"
42979
+ ]);
42980
+ /**
42981
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
42982
+ *
42694
42983
  * Media attachment policy (P1 still-image subset).
42695
42984
  * - `best` — the best AVAILABLE subject image at dispatch time (D-3).
42696
42985
  * - `best-matching` — the media that explains WHY the rule fired: a rule
@@ -42704,6 +42993,8 @@ var NcRuleTargetSchema = object({
42704
42993
  * - `none` — no attachment.
42705
42994
  */
42706
42995
  /**
42996
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
42997
+ *
42707
42998
  * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
42708
42999
  * conflate it with the selection strategy and betray the request: asking for
42709
43000
  * the clean scene frame on an object-event owner used to start at
@@ -42732,16 +43023,29 @@ var NcMediaFrameSchema = _enum([
42732
43023
  */
42733
43024
  var NcLinkedCameraModeSchema = _enum(["mosaic", "each"]);
42734
43025
  var NcMediaPolicySchema = object({
43026
+ /**
43027
+ * The picture — see {@link NcMediaImageSchema}. Absent on a rule nobody has
43028
+ * saved since D897: `normalizeNcMediaPolicy` derives it from the legacy
43029
+ * triple below, at load and at every write, and the store keeps only this.
43030
+ */
43031
+ image: NcMediaImageSchema.optional(),
43032
+ /**
43033
+ * Draw the zone that FIRED the rule on the picture (`scene-boxes` / `clean`;
43034
+ * a `crop` never shows it). Valid only on a rule whose trigger is a zone —
43035
+ * `conditions.zones` or an occupancy zone — and refused on save otherwise.
43036
+ * Replaces `zoneCrop`.
43037
+ */
43038
+ showTriggerZone: boolean().optional(),
43039
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
42735
43040
  attach: _enum([
42736
43041
  "best",
42737
43042
  "best-matching",
42738
43043
  "keyFrame",
42739
43044
  "none"
42740
- ]).default("best"),
42741
- /** What the still shows. Absent = `cropped` (the historical `best` shape). */
43045
+ ]).optional(),
43046
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
42742
43047
  frame: NcMediaFrameSchema.optional(),
42743
- /** Crop the attached still to the rule's condition-zone bbox (padded) —
42744
- * "show me the ZONE", not the whole scene or the subject crop. */
43048
+ /** @deprecated D897 — folded into `image: 'clean'` + `showTriggerZone` on save. */
42745
43049
  zoneCrop: boolean().optional(),
42746
43050
  /**
42747
43051
  * Also attach a short GIF cut from the stream broker's clip ring around the
@@ -42913,7 +43217,9 @@ var NcRuleInputSchema = object({
42913
43217
  * targets.
42914
43218
  */
42915
43219
  targetUsers: array(string()).optional(),
42916
- media: NcMediaPolicySchema.default({ attach: "best" }),
43220
+ /** Absent = the kind's default picture (`resolveNcMediaImage`): the subject crop for a
43221
+ * detection, the clean scene for a sensor or a sound. Set explicitly on save (D897). */
43222
+ media: NcMediaPolicySchema.default({}),
42917
43223
  throttle: NcThrottleSchema.default({
42918
43224
  cooldownSec: 60,
42919
43225
  scope: "rule-device"
@@ -43850,13 +44156,37 @@ var NcAlarmModeOpeningsSchema = object({
43850
44156
  /** Covered devices whose state could not be read (D49): neither open nor closed. */
43851
44157
  unknown: array(number().int())
43852
44158
  });
44159
+ /**
44160
+ * One alarm INPUT — a (rule, device) pair — the operator bypassed until the
44161
+ * next disarm ("Bypass this input until disarm" on a trigger notification, or
44162
+ * `nc.bypassAlarmInput`). Reported so an armed alarm with a silenced input
44163
+ * never looks fully armed (D62: off must never look like broken).
44164
+ */
44165
+ var NcAlarmInputBypassViewSchema = object({
44166
+ ruleId: string(),
44167
+ /** The rule's current name (its frozen name when the rule is gone). */
44168
+ ruleName: string(),
44169
+ /** The input: the sensor of the match, else its camera. */
44170
+ deviceId: number().int(),
44171
+ /** The input's current name. */
44172
+ name: string(),
44173
+ /** When it was bypassed (ms epoch). */
44174
+ since: number(),
44175
+ /** Triggers from this input dropped since. */
44176
+ dropped: number().int().min(0)
44177
+ });
43853
44178
  var NcAlarmLiveSchema = object({
43854
44179
  state: AlarmStateSchema,
43855
44180
  /** The mode being armed into (exit delay) or held; null when disarmed. */
43856
44181
  targetMode: AlarmArmModeSchema.nullable(),
43857
44182
  availableModes: array(AlarmArmModeSchema),
43858
44183
  openings: array(NcAlarmModeOpeningsSchema),
43859
- exclusions: array(NcAlarmExclusionViewSchema)
44184
+ exclusions: array(NcAlarmExclusionViewSchema),
44185
+ /**
44186
+ * Inputs bypassed for the rest of this arm session; cleared on disarm.
44187
+ * Defaulted so an older hub answer still parses (as "none known").
44188
+ */
44189
+ bypassedInputs: array(NcAlarmInputBypassViewSchema).default([])
43860
44190
  });
43861
44191
  var NcAlarmConfigSchema = object({
43862
44192
  /**
@@ -60990,26 +61320,6 @@ var ApiKeySummarySchema = object({
60990
61320
  createdAt: number(),
60991
61321
  lastUsedAt: number().optional()
60992
61322
  });
60993
- var ScopedTokenSummarySchema = object({
60994
- id: string(),
60995
- userId: string(),
60996
- name: string(),
60997
- tokenPrefix: string(),
60998
- scopes: array(TokenScopeSchema),
60999
- expiresAt: number().nullish(),
61000
- lastUsedAt: number().nullish(),
61001
- createdAt: number()
61002
- });
61003
- var CreateScopedTokenInputSchema = object({
61004
- userId: string(),
61005
- name: string(),
61006
- scopes: array(TokenScopeSchema),
61007
- expiresAt: number().optional()
61008
- });
61009
- var CreateScopedTokenResultSchema = object({
61010
- token: string(),
61011
- record: ScopedTokenSummarySchema
61012
- });
61013
61323
  var OauthSessionSummarySchema = object({
61014
61324
  id: string(),
61015
61325
  userId: string(),
@@ -61031,11 +61341,11 @@ var TotpStatusSchema = object({
61031
61341
  confirmedAt: number().nullable()
61032
61342
  });
61033
61343
  /**
61034
- * user-management — singleton capability for user accounts, API keys,
61035
- * and scoped tokens.
61344
+ * user-management — singleton capability for user accounts and the
61345
+ * legacy API-key rows.
61036
61346
  *
61037
61347
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
61038
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
61348
+ * — the subset check on `setUserScopes` is moot
61039
61349
  * because non-admins never reach these. If/when we open non-admin
61040
61350
  * delegation, structural caller-scope subset check goes inside the
61041
61351
  * provider.
@@ -61092,15 +61402,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
61092
61402
  kind: "mutation",
61093
61403
  auth: "admin",
61094
61404
  access: "delete"
61095
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
61096
- kind: "mutation",
61097
- auth: "admin",
61098
- access: "create"
61099
- }), method(object({ id: string() }), object({ success: literal(true) }), {
61100
- kind: "mutation",
61101
- auth: "admin",
61102
- access: "delete"
61103
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
61405
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
61104
61406
  kind: "mutation",
61105
61407
  auth: "admin",
61106
61408
  access: "create"
@@ -65256,7 +65558,7 @@ Object.freeze({
65256
65558
  capName: "llm",
65257
65559
  capScope: "system",
65258
65560
  addonId: null,
65259
- access: "view"
65561
+ access: "create"
65260
65562
  },
65261
65563
  "llm.listNodeModels": {
65262
65564
  capName: "llm",
@@ -65558,7 +65860,19 @@ Object.freeze({
65558
65860
  addonId: null,
65559
65861
  access: "view"
65560
65862
  },
65561
- "logDestination.query": {
65863
+ "logDestination.cancelRead": {
65864
+ capName: "log-destination",
65865
+ capScope: "system",
65866
+ addonId: null,
65867
+ access: "create"
65868
+ },
65869
+ "logDestination.describeRead": {
65870
+ capName: "log-destination",
65871
+ capScope: "system",
65872
+ addonId: null,
65873
+ access: "view"
65874
+ },
65875
+ "logDestination.read": {
65562
65876
  capName: "log-destination",
65563
65877
  capScope: "system",
65564
65878
  addonId: null,
@@ -69920,12 +70234,6 @@ Object.freeze({
69920
70234
  addonId: null,
69921
70235
  access: "create"
69922
70236
  },
69923
- "userManagement.createScopedToken": {
69924
- capName: "user-management",
69925
- capScope: "system",
69926
- addonId: null,
69927
- access: "create"
69928
- },
69929
70237
  "userManagement.createUser": {
69930
70238
  capName: "user-management",
69931
70239
  capScope: "system",
@@ -69974,12 +70282,6 @@ Object.freeze({
69974
70282
  addonId: null,
69975
70283
  access: "view"
69976
70284
  },
69977
- "userManagement.listScopedTokens": {
69978
- capName: "user-management",
69979
- capScope: "system",
69980
- addonId: null,
69981
- access: "view"
69982
- },
69983
70285
  "userManagement.listUsers": {
69984
70286
  capName: "user-management",
69985
70287
  capScope: "system",
@@ -70034,12 +70336,6 @@ Object.freeze({
70034
70336
  addonId: null,
70035
70337
  access: "delete"
70036
70338
  },
70037
- "userManagement.revokeScopedToken": {
70038
- capName: "user-management",
70039
- capScope: "system",
70040
- addonId: null,
70041
- access: "delete"
70042
- },
70043
70339
  "userManagement.setupTotp": {
70044
70340
  capName: "user-management",
70045
70341
  capScope: "system",
@@ -70070,12 +70366,6 @@ Object.freeze({
70070
70366
  addonId: null,
70071
70367
  access: "view"
70072
70368
  },
70073
- "userManagement.validateScopedToken": {
70074
- capName: "user-management",
70075
- capScope: "system",
70076
- addonId: null,
70077
- access: "view"
70078
- },
70079
70369
  "userManagement.verifyTotp": {
70080
70370
  capName: "user-management",
70081
70371
  capScope: "system",
@@ -71589,6 +71879,11 @@ Object.freeze({
71589
71879
  form: "single",
71590
71880
  optional: false
71591
71881
  }],
71882
+ "logDestination.read": [{
71883
+ name: "deviceId",
71884
+ form: "single",
71885
+ optional: true
71886
+ }],
71592
71887
  "mediaPlayer.getStatus": [{
71593
71888
  name: "deviceId",
71594
71889
  form: "single",