@camstack/addon-provider-onvif 1.2.132 → 1.2.134

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
@@ -5418,7 +5418,7 @@ var ZodIssueCode = {
5418
5418
  var ZodFirstPartyTypeKind;
5419
5419
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5420
5420
  //#endregion
5421
- //#region ../types/dist/sleep-BxjU_fJM.mjs
5421
+ //#region ../types/dist/sleep-BSuCCFjf.mjs
5422
5422
  /**
5423
5423
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5424
5424
  * window to float samples (D455).
@@ -7801,9 +7801,9 @@ function normalizeAddonInitResult(result) {
7801
7801
  return result;
7802
7802
  }
7803
7803
  /**
7804
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7805
- * and validates them (`share-token.service.ts` builds its enum from this
7806
- * list); a data plane names the kinds it ACCEPTS in `share`.
7804
+ * The share-view scope kinds a share-link token can carry. The hub mints
7805
+ * and validates them (`ShareViewGrantSchema` builds its
7806
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7807
7807
  */
7808
7808
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7809
7809
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -12422,7 +12422,7 @@ var ConvertResultSchema = object({
12422
12422
  * `super_admin` — collapsed onto the single boolean because every
12423
12423
  * non-admin caller is governed by the same scope-check rules; the
12424
12424
  * distinction was only ever used to route role-specific procedures
12425
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12425
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
12426
12426
  * with `isAdmin: false` + an explicit scope list.
12427
12427
  */
12428
12428
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -12611,10 +12611,12 @@ var AddonRoutesScopeSchema = object({
12611
12611
  type: literal("addon-routes"),
12612
12612
  access: array(MethodAccessSchema).min(1)
12613
12613
  });
12614
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
12614
12615
  var CredentialScopeSchema = union([
12615
12616
  literal("*"),
12616
12617
  ShareViewScopeSchema,
12617
12618
  AddonRoutesScopeSchema,
12619
+ PreferencesSelfScopeSchema,
12618
12620
  TokenScopeSchema
12619
12621
  ]);
12620
12622
  object({
@@ -12623,6 +12625,55 @@ object({
12623
12625
  jti: string().min(16),
12624
12626
  scopes: array(CredentialScopeSchema).min(1)
12625
12627
  });
12628
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
12629
+ /** A namespace's value: a JSON object, opaque to the hub. */
12630
+ var PreferenceValueSchema = record(string(), unknown());
12631
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
12632
+ /** A stored row, as the owner reads it. */
12633
+ var PreferenceRowSchema = object({
12634
+ namespace: PreferenceNamespaceSchema,
12635
+ value: PreferenceValueSchema,
12636
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
12637
+ revision: number().int().positive(),
12638
+ updatedAt: number().int(),
12639
+ /** The client id the last writer sent; `null` when it sent none. */
12640
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
12641
+ });
12642
+ object({
12643
+ /** Absent: every namespace the caller holds. */
12644
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
12645
+ object({ rows: array(PreferenceRowSchema) });
12646
+ object({
12647
+ namespace: PreferenceNamespaceSchema,
12648
+ value: PreferenceValueSchema,
12649
+ /**
12650
+ * The revision the edit was based on. Absent: last write wins. `0`: the
12651
+ * namespace must not exist yet. Any other value that is not the current
12652
+ * revision answers `conflict` and writes nothing.
12653
+ */
12654
+ baseRevision: number().int().nonnegative().optional(),
12655
+ deviceId: PreferenceDeviceIdSchema.optional()
12656
+ });
12657
+ discriminatedUnion("status", [object({
12658
+ status: literal("saved"),
12659
+ row: PreferenceRowSchema
12660
+ }), object({
12661
+ status: literal("conflict"),
12662
+ current: PreferenceRowSchema.nullable()
12663
+ })]);
12664
+ object({ namespace: PreferenceNamespaceSchema });
12665
+ object({
12666
+ /** `false` when the namespace did not exist. */
12667
+ deleted: boolean() });
12668
+ object({
12669
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
12670
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
12671
+ object({
12672
+ /** Every row whose revision differs from the client's, and every row it did not list. */
12673
+ rows: array(PreferenceRowSchema),
12674
+ /** Namespaces the client listed that no longer exist. */
12675
+ deleted: array(PreferenceNamespaceSchema)
12676
+ });
12626
12677
  _enum(["new-session", "step-up"]);
12627
12678
  /** The languages the hub's app landing pages are written in (D858). */
12628
12679
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -16770,7 +16821,19 @@ var DeviceHistorySubjectSchema = discriminatedUnion("kind", [object({
16770
16821
  kind: literal("node"),
16771
16822
  nodeId: string().min(1)
16772
16823
  })]);
16824
+ /**
16825
+ * `enum` stores a STATE as the ordinal of its value in the series' value list
16826
+ * (`DeviceHistorySeriesInfo.values`, append-only, so an ordinal never changes
16827
+ * meaning); a rollup keeps the time spent in each state (`states`).
16828
+ */
16773
16829
  var DeviceHistoryKindSchema = _enum([
16830
+ "gauge",
16831
+ "counter",
16832
+ "boolean",
16833
+ "enum"
16834
+ ]);
16835
+ /** What a PRODUCER may declare. `enum` is cap-only: its value list is the cap field's. */
16836
+ var DeviceHistoryProducerKindSchema = _enum([
16774
16837
  "gauge",
16775
16838
  "counter",
16776
16839
  "boolean"
@@ -16807,7 +16870,13 @@ var SeriesInfoSchema = object({
16807
16870
  /** `null` is unknown (a `unitFrom` series whose device does not state a unit right now), never a guess. */
16808
16871
  unit: string().nullable(),
16809
16872
  displayName: string(),
16810
- source: _enum(["cap", "addon"]),
16873
+ source: _enum([
16874
+ "cap",
16875
+ "addon",
16876
+ "derived"
16877
+ ]),
16878
+ /** `enum`: the value of each ordinal (index = ordinal); `null` for every other kind. */
16879
+ values: array(string()).readonly().nullable(),
16811
16880
  firstTs: number(),
16812
16881
  lastTs: number()
16813
16882
  });
@@ -16821,17 +16890,31 @@ var QueryPointSchema = object({
16821
16890
  twMean: number().nullable(),
16822
16891
  min: number(),
16823
16892
  max: number(),
16824
- /** `null` is unknown, never zero (D393). */
16825
- last: number().nullable()
16893
+ /** `null` is unknown, never zero (D393). For an `enum` series: the ordinal of {@link state}. */
16894
+ last: number().nullable(),
16895
+ /**
16896
+ * The increase over the point: a `counter`'s growth since the previous point
16897
+ * or bucket (a drop is a reset, counted from zero), and for
16898
+ * {@link DEVICE_HISTORY_ENERGY_KEY} the kWh used in the bucket. `null` for
16899
+ * every other kind, and when it cannot be known.
16900
+ */
16901
+ delta: number().nullable(),
16902
+ /** `enum`: the state in force at the end of the point (the name of `last`); `null` otherwise. */
16903
+ state: string().nullable(),
16904
+ /** `enum` rollup: milliseconds spent in each state inside the bucket; `null` for raw points and other kinds. */
16905
+ states: record(string(), number()).nullable()
16826
16906
  });
16827
16907
  var QuerySeriesSchema = object({
16828
16908
  scope: string(),
16829
16909
  /** The last point STRICTLY BEFORE `from` in the chosen tier, so a step chart can start at the held value. */
16830
16910
  before: object({
16831
16911
  t: number(),
16832
- value: number().nullable()
16912
+ value: number().nullable(),
16913
+ state: string().nullable()
16833
16914
  }).nullable(),
16834
- points: array(QueryPointSchema).readonly()
16915
+ points: array(QueryPointSchema).readonly(),
16916
+ /** A derived key: the stored key its points were computed from; `null` for a stored series. */
16917
+ derivedFrom: string().nullable()
16835
16918
  });
16836
16919
  /** The window part of a query, shared by the device and node forms. */
16837
16920
  var QueryWindowShape = {
@@ -16847,6 +16930,23 @@ var QueryResultSchema = object({
16847
16930
  series: array(QuerySeriesSchema).readonly(),
16848
16931
  truncated: boolean()
16849
16932
  });
16933
+ /** One read of a batch: a device's key or a node's key (exactly one subject). */
16934
+ var QueryManyItemSchema = union([object({
16935
+ deviceId: number().int(),
16936
+ key: string(),
16937
+ scope: string().optional()
16938
+ }), object({
16939
+ forNodeId: string().min(1),
16940
+ key: string(),
16941
+ scope: string().optional()
16942
+ })]);
16943
+ var QueryManyEntrySchema = discriminatedUnion("ok", [object({
16944
+ ok: literal(true),
16945
+ result: QueryResultSchema
16946
+ }), object({
16947
+ ok: literal(false),
16948
+ error: string()
16949
+ })]);
16850
16950
  var TierStatusSchema = object({
16851
16951
  tier: DeviceHistoryResolutionSchema,
16852
16952
  /** `null` until the first background count answered. */
@@ -16902,16 +17002,22 @@ var DeviceHistoryStatusSchema = object({
16902
17002
  lastRefreshAt: number().nullable()
16903
17003
  })
16904
17004
  });
16905
- method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ nodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
17005
+ method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ forNodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
16906
17006
  deviceId: number().int(),
16907
17007
  ...QueryWindowShape
16908
17008
  }), QueryResultSchema), method(object({
16909
- nodeId: string().min(1),
17009
+ forNodeId: string().min(1),
16910
17010
  ...QueryWindowShape
16911
17011
  }), QueryResultSchema, { auth: "admin" }), method(object({
17012
+ items: array(QueryManyItemSchema).min(1).max(24),
17013
+ from: QueryWindowShape.from,
17014
+ to: QueryWindowShape.to,
17015
+ resolution: QueryWindowShape.resolution,
17016
+ maxPoints: QueryWindowShape.maxPoints
17017
+ }), object({ results: array(QueryManyEntrySchema).readonly() }), { auth: "admin" }), method(object({
16912
17018
  name: string().regex(/^[a-z0-9-]+$/),
16913
17019
  subjectKind: _enum(["device", "node"]),
16914
- kind: DeviceHistoryKindSchema,
17020
+ kind: DeviceHistoryProducerKindSchema,
16915
17021
  unit: string().optional(),
16916
17022
  displayName: string().min(1),
16917
17023
  ingest: _enum(["points", "buckets"])
@@ -39695,38 +39801,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
39695
39801
  auth: "admin",
39696
39802
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
39697
39803
  });
39804
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
39805
+ /** What a model (or, by default, every model of a kind) can do. */
39806
+ var LlmModelFeaturesSchema = object({
39807
+ vision: boolean(),
39808
+ tools: boolean(),
39809
+ streaming: boolean()
39810
+ });
39811
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
39812
+ var LlmModelInfoSchema = object({
39813
+ id: string(),
39814
+ label: string().optional(),
39815
+ contextLength: number().int().positive().optional(),
39816
+ features: LlmModelFeaturesSchema.partial().optional()
39817
+ });
39698
39818
  /**
39699
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
39700
- * methods concat-fan across providers; single-row methods route to ONE
39701
- * provider by the `addonId` in the call input (the notification-output
39702
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
39703
- * (hub-placed); the cap stays open for future providers.
39704
- *
39705
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
39706
- * `apiKey` is a password field — providers REDACT it on read and merge on
39707
- * write; a stored key NEVER round-trips to a client.
39819
+ * The provider-specific part of a profile, validated by the provider that owns
39820
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
39821
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
39822
+ * keychain, never in the row, and reads back as the redaction marker.
39708
39823
  */
39709
- var LlmProfileKindSchema = _enum([
39710
- "openai-compatible",
39711
- "openai",
39712
- "anthropic",
39713
- "google",
39714
- "managed-local",
39715
- "apple-foundation"
39716
- ]);
39824
+ var LlmProviderConfigSchema = record(string(), unknown());
39717
39825
  var LlmProfileSchema = object({
39718
39826
  id: string(),
39719
39827
  name: string(),
39828
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
39720
39829
  kind: LlmProfileKindSchema,
39721
39830
  /** Stamped by the provider — keeps the fanned catalog routable. */
39722
39831
  addonId: string(),
39723
39832
  enabled: boolean(),
39724
39833
  /** Vendor model id, or the managed runtime's loaded model. */
39725
39834
  model: string(),
39726
- /** Required for openai-compatible; override for cloud kinds. */
39727
- baseUrl: string().optional(),
39728
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
39729
- apiKey: string().optional(),
39730
39835
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
39731
39836
  * degraded to text — that shipped once and produced a confident answer to a
39732
39837
  * question about a picture nobody sent. */
@@ -39734,15 +39839,11 @@ var LlmProfileSchema = object({
39734
39839
  temperature: number().min(0).max(2).optional(),
39735
39840
  /** Nucleus sampling. Every wire we speak has it. */
39736
39841
  topP: number().min(0).max(1).optional(),
39737
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
39738
- * wire does, and the client drops it there (measured: the request body gets
39739
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
39740
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
39842
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
39843
+ * field in its editor only when its descriptor lists it in `profileFields`. */
39741
39844
  topK: number().int().positive().optional(),
39742
39845
  maxTokens: number().int().positive().optional(),
39743
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
39744
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
39745
- * the model with, so it is the one field that changes a PROCESS. */
39846
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
39746
39847
  contextLength: number().int().positive().optional(),
39747
39848
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
39748
39849
  * two system prompts fighting is worse than either alone). */
@@ -39768,16 +39869,37 @@ var LlmProfileSchema = object({
39768
39869
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
39769
39870
  * `true` here buys the wiring, not behaviour, until tools are registered. */
39770
39871
  toolsEnabled: boolean().default(false),
39771
- extraHeaders: record(string(), string()).optional(),
39772
- /** kind === 'managed-local' only (spec §4). */
39773
- runtime: ManagedRuntimeConfigSchema.optional(),
39774
- /**
39775
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
39776
- * to configure (no key, no URL, no download; `model` is `apple-system`).
39777
- * `supportsVision` on such a row is stamped by the provider from the node's
39778
- * reported `imageInput`, never taken from the operator (D62).
39779
- */
39780
- appleFoundation: object({ nodeId: string() }).optional()
39872
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
39873
+ providerConfig: LlmProviderConfigSchema.default({})
39874
+ });
39875
+ /**
39876
+ * The common profile fields a kind's editor offers. The editor owns how each
39877
+ * one is drawn; the provider says which of them mean something on its wire.
39878
+ */
39879
+ var LlmProfileFieldSchema = _enum([
39880
+ "temperature",
39881
+ "topP",
39882
+ "topK",
39883
+ "maxTokens",
39884
+ "contextLength",
39885
+ "systemPrompt",
39886
+ "timeoutMs",
39887
+ "connectTimeoutMs",
39888
+ "firstTokenTimeoutMs",
39889
+ "idleTimeoutMs",
39890
+ "retry",
39891
+ "toolsEnabled"
39892
+ ]);
39893
+ /**
39894
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
39895
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
39896
+ * picker: that widget owns the model choice.
39897
+ */
39898
+ var LlmProviderWidgetSchema = object({
39899
+ id: string(),
39900
+ placement: _enum(["connection", "model"]),
39901
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
39902
+ requires: array(string()).optional()
39781
39903
  });
39782
39904
  /** ConfigUISchema tree passed through untyped on the wire (the
39783
39905
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -39786,11 +39908,56 @@ var ConfigSchemaPassthrough$3 = unknown();
39786
39908
  var LlmProfileKindDescriptorSchema = object({
39787
39909
  kind: LlmProfileKindSchema,
39788
39910
  label: string(),
39911
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
39789
39912
  icon: string(),
39790
39913
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
39791
39914
  addonId: string(),
39792
- configSchema: ConfigSchemaPassthrough$3
39915
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
39916
+ connectionSchema: ConfigSchemaPassthrough$3,
39917
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
39918
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
39919
+ /** The kind's defaults; a model from `listModels` may override any of them. */
39920
+ features: LlmModelFeaturesSchema,
39921
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
39922
+ visionEditable: boolean(),
39923
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
39924
+ modelCatalog: _enum([
39925
+ "fetch",
39926
+ "static",
39927
+ "none"
39928
+ ]),
39929
+ staticModels: array(LlmModelInfoSchema).optional(),
39930
+ /** The common fields that mean something on this kind's wire. */
39931
+ profileFields: array(LlmProfileFieldSchema),
39932
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
39933
+ });
39934
+ /**
39935
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
39936
+ * (the editor's form); with `profileId` too, a secret the draft leaves
39937
+ * untouched (absent or the redaction marker) is resolved server-side from the
39938
+ * stored profile — the browser never receives it.
39939
+ */
39940
+ var LlmListModelsInputSchema = object({
39941
+ addonId: string(),
39942
+ kind: LlmProfileKindSchema,
39943
+ profileId: string().optional(),
39944
+ connection: LlmProviderConfigSchema.optional()
39793
39945
  });
39946
+ var LlmListModelsErrorCodeSchema = _enum([
39947
+ "auth",
39948
+ "network",
39949
+ "unsupported",
39950
+ "invalid"
39951
+ ]);
39952
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
39953
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
39954
+ ok: literal(true),
39955
+ models: array(LlmModelInfoSchema)
39956
+ }), object({
39957
+ ok: literal(false),
39958
+ code: LlmListModelsErrorCodeSchema,
39959
+ message: string()
39960
+ })]);
39794
39961
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
39795
39962
  var LlmDefaultSchema = object({
39796
39963
  selector: LlmDefaultSelectorSchema,
@@ -39890,7 +40057,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
39890
40057
  kind: "mutation",
39891
40058
  auth: "admin",
39892
40059
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
39893
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
40060
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
40061
+ kind: "mutation",
40062
+ auth: "admin"
40063
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
39894
40064
  selector: LlmDefaultSelectorSchema,
39895
40065
  profileId: string().nullable()
39896
40066
  }), _void(), {
@@ -40058,14 +40228,106 @@ var LogEntrySchema = object({
40058
40228
  meta: record(string(), unknown()).optional(),
40059
40229
  tags: record(string(), string()).optional()
40060
40230
  });
40061
- method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
40062
- scope: array(string()).optional(),
40231
+ /**
40232
+ * A history READ against one destination (D898).
40233
+ *
40234
+ * Every filter is applied by the PROVIDER, before the limit — a filter the
40235
+ * browser applied after the limit is what made a rare device's lines
40236
+ * unreachable behind a busy one's. `before` / `after` are cursors the provider
40237
+ * minted (opaque to everyone else): a file position for the rotated files, a
40238
+ * nanosecond timestamp for Loki.
40239
+ *
40240
+ * A read is BOUNDED by `budgetMs`: a filter that matches nothing on a 30-day
40241
+ * store answers `done: false` with the cursor it reached and the bytes it
40242
+ * scanned, and the caller decides whether to go on. That is what makes a long
40243
+ * scan show progress and stop when asked — `cancelRead` ends the slice in
40244
+ * flight, and not asking for the next slice ends the scan.
40245
+ */
40246
+ var LogReadQuerySchema = object({
40247
+ /** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
40248
+ requestId: string().min(1).max(64).optional(),
40249
+ /** The device the line is about (`tags.deviceId`, numeric). */
40250
+ deviceId: number().int().optional(),
40251
+ /**
40252
+ * The emitting addon — bare manifest id; `@<version>` / `::<sub>` suffixes
40253
+ * match. Not `addonId`: a cap router reads that name as "which provider".
40254
+ */
40255
+ fromAddonId: string().min(1).max(200).optional(),
40256
+ /**
40257
+ * The emitting node: matches the agent that emitted the line, the node
40258
+ * itself, or a worker under it (`<agent>/<runner>`) — the `agentId`
40259
+ * semantics of `matchesLogTags`. Not `nodeId`: a cap router reads that
40260
+ * name as "which node's provider".
40261
+ */
40262
+ fromNodeId: string().min(1).max(200).optional(),
40263
+ /** Any other tag, exact match (AND). */
40264
+ tags: record(string(), union([string(), number()])).optional(),
40265
+ /** Severity FLOOR: this level and above. */
40063
40266
  level: LogLevelSchema.optional(),
40064
- since: date().optional(),
40065
- until: date().optional(),
40066
- limit: number().optional(),
40067
- tags: record(string(), string()).optional()
40068
- }), array(LogEntrySchema).readonly());
40267
+ /** Case-insensitive substring over message, scope, tag values and meta values. */
40268
+ text: string().min(1).max(200).optional(),
40269
+ /** Epoch ms, inclusive. */
40270
+ since: number().optional(),
40271
+ /** Epoch ms, inclusive. */
40272
+ until: number().optional(),
40273
+ /** Older than this cursor (exclusive). Absent with `after` absent ⇒ from the newest. */
40274
+ before: string().min(1).max(1024).optional(),
40275
+ /** Newer than this cursor (exclusive). */
40276
+ after: string().min(1).max(1024).optional(),
40277
+ limit: number().int().min(1).max(1e3).optional(),
40278
+ /** Wall-clock bound of this slice. The provider caps it. */
40279
+ budgetMs: number().int().min(50).max(1e4).optional()
40280
+ });
40281
+ var LogReadResultSchema = object({
40282
+ /** Newest first. */
40283
+ entries: array(object({
40284
+ /** `<bootId>.<seq>` minted by the emitting LogManager — the dedupe key. */
40285
+ id: string().optional(),
40286
+ /** Epoch ms. */
40287
+ timestamp: number(),
40288
+ level: LogLevelSchema,
40289
+ scope: string().optional(),
40290
+ message: string(),
40291
+ tags: record(string(), union([string(), number()])).optional(),
40292
+ meta: record(string(), unknown()).optional()
40293
+ })),
40294
+ /** Pass as `before` for the next older page; null when nothing older exists. */
40295
+ nextBefore: string().nullable(),
40296
+ /** Pass as `after` to read what arrived since; null when unknown. */
40297
+ nextAfter: string().nullable(),
40298
+ /** Bytes this slice read (files) or received (remote). Progress, not a promise. */
40299
+ scannedBytes: number().int().nonnegative(),
40300
+ /**
40301
+ * True when the scan in this direction reached the end of the store.
40302
+ * False with fewer than `limit` entries means the budget ran out first —
40303
+ * call again with `nextBefore` to go on.
40304
+ */
40305
+ done: boolean(),
40306
+ /** True when `cancelRead` ended this slice early. */
40307
+ cancelled: boolean().optional()
40308
+ });
40309
+ var LogReadCapabilitiesSchema = object({
40310
+ /** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
40311
+ readable: boolean(),
40312
+ /** Why not, when `readable` is false — rendered next to the source. */
40313
+ reason: string().nullable(),
40314
+ /** Filters the provider applies itself. A false one is applied by nobody. */
40315
+ filters: object({
40316
+ deviceId: boolean(),
40317
+ addonId: boolean(),
40318
+ nodeId: boolean(),
40319
+ tags: boolean(),
40320
+ level: boolean(),
40321
+ text: boolean(),
40322
+ timeRange: boolean()
40323
+ }),
40324
+ /** How far back the store reaches, when the provider knows (days). */
40325
+ retentionDays: number().nullable()
40326
+ });
40327
+ 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() }), {
40328
+ kind: "mutation",
40329
+ auth: "admin"
40330
+ });
40069
40331
  /**
40070
40332
  * `login-method` — collection cap through which auth addons contribute
40071
40333
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -42621,6 +42883,33 @@ var NcRuleTargetSchema = object({
42621
42883
  params: record(string(), unknown()).optional()
42622
42884
  });
42623
42885
  /**
42886
+ * WHAT THE NOTIFICATION'S PICTURE IS (D897) — the ONE media choice of a rule.
42887
+ *
42888
+ * Every mode starts from the same CLEAN source frame of the trigger moment
42889
+ * (keyFrame → sceneFrame → lastSceneFrame, narrowed to the trigger instant and
42890
+ * to the zone that fired the rule) and renders it once at send time:
42891
+ * - `scene-boxes` — the whole scene, the subject outlined thick in the accent
42892
+ * colour and every OTHER track visible at that instant outlined thin, each
42893
+ * labelled with class and confidence ("dog 87%").
42894
+ * - `crop` — the subject cut out of that frame around its box at that instant.
42895
+ * - `clean` — the whole scene with nothing drawn on it.
42896
+ * - `none` — no picture.
42897
+ *
42898
+ * A mode that cannot be honoured (no box at that instant, a photograph with no
42899
+ * tracked subject) ships `clean` and names the reason in the log, per camera.
42900
+ * It replaces the `attach` × `frame` × `zoneCrop` triple, which let one rule
42901
+ * ship a crop on one event and a boxed scene on the next depending on which
42902
+ * stored kind had landed.
42903
+ */
42904
+ var NcMediaImageSchema = _enum([
42905
+ "scene-boxes",
42906
+ "crop",
42907
+ "clean",
42908
+ "none"
42909
+ ]);
42910
+ /**
42911
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
42912
+ *
42624
42913
  * Media attachment policy (P1 still-image subset).
42625
42914
  * - `best` — the best AVAILABLE subject image at dispatch time (D-3).
42626
42915
  * - `best-matching` — the media that explains WHY the rule fired: a rule
@@ -42634,6 +42923,8 @@ var NcRuleTargetSchema = object({
42634
42923
  * - `none` — no attachment.
42635
42924
  */
42636
42925
  /**
42926
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
42927
+ *
42637
42928
  * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
42638
42929
  * conflate it with the selection strategy and betray the request: asking for
42639
42930
  * the clean scene frame on an object-event owner used to start at
@@ -42662,16 +42953,29 @@ var NcMediaFrameSchema = _enum([
42662
42953
  */
42663
42954
  var NcLinkedCameraModeSchema = _enum(["mosaic", "each"]);
42664
42955
  var NcMediaPolicySchema = object({
42956
+ /**
42957
+ * The picture — see {@link NcMediaImageSchema}. Absent on a rule nobody has
42958
+ * saved since D897: `normalizeNcMediaPolicy` derives it from the legacy
42959
+ * triple below, at load and at every write, and the store keeps only this.
42960
+ */
42961
+ image: NcMediaImageSchema.optional(),
42962
+ /**
42963
+ * Draw the zone that FIRED the rule on the picture (`scene-boxes` / `clean`;
42964
+ * a `crop` never shows it). Valid only on a rule whose trigger is a zone —
42965
+ * `conditions.zones` or an occupancy zone — and refused on save otherwise.
42966
+ * Replaces `zoneCrop`.
42967
+ */
42968
+ showTriggerZone: boolean().optional(),
42969
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
42665
42970
  attach: _enum([
42666
42971
  "best",
42667
42972
  "best-matching",
42668
42973
  "keyFrame",
42669
42974
  "none"
42670
- ]).default("best"),
42671
- /** What the still shows. Absent = `cropped` (the historical `best` shape). */
42975
+ ]).optional(),
42976
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
42672
42977
  frame: NcMediaFrameSchema.optional(),
42673
- /** Crop the attached still to the rule's condition-zone bbox (padded) —
42674
- * "show me the ZONE", not the whole scene or the subject crop. */
42978
+ /** @deprecated D897 — folded into `image: 'clean'` + `showTriggerZone` on save. */
42675
42979
  zoneCrop: boolean().optional(),
42676
42980
  /**
42677
42981
  * Also attach a short GIF cut from the stream broker's clip ring around the
@@ -42843,7 +43147,9 @@ var NcRuleInputSchema = object({
42843
43147
  * targets.
42844
43148
  */
42845
43149
  targetUsers: array(string()).optional(),
42846
- media: NcMediaPolicySchema.default({ attach: "best" }),
43150
+ /** Absent = the kind's default picture (`resolveNcMediaImage`): the subject crop for a
43151
+ * detection, the clean scene for a sensor or a sound. Set explicitly on save (D897). */
43152
+ media: NcMediaPolicySchema.default({}),
42847
43153
  throttle: NcThrottleSchema.default({
42848
43154
  cooldownSec: 60,
42849
43155
  scope: "rule-device"
@@ -43780,13 +44086,37 @@ var NcAlarmModeOpeningsSchema = object({
43780
44086
  /** Covered devices whose state could not be read (D49): neither open nor closed. */
43781
44087
  unknown: array(number().int())
43782
44088
  });
44089
+ /**
44090
+ * One alarm INPUT — a (rule, device) pair — the operator bypassed until the
44091
+ * next disarm ("Bypass this input until disarm" on a trigger notification, or
44092
+ * `nc.bypassAlarmInput`). Reported so an armed alarm with a silenced input
44093
+ * never looks fully armed (D62: off must never look like broken).
44094
+ */
44095
+ var NcAlarmInputBypassViewSchema = object({
44096
+ ruleId: string(),
44097
+ /** The rule's current name (its frozen name when the rule is gone). */
44098
+ ruleName: string(),
44099
+ /** The input: the sensor of the match, else its camera. */
44100
+ deviceId: number().int(),
44101
+ /** The input's current name. */
44102
+ name: string(),
44103
+ /** When it was bypassed (ms epoch). */
44104
+ since: number(),
44105
+ /** Triggers from this input dropped since. */
44106
+ dropped: number().int().min(0)
44107
+ });
43783
44108
  var NcAlarmLiveSchema = object({
43784
44109
  state: AlarmStateSchema,
43785
44110
  /** The mode being armed into (exit delay) or held; null when disarmed. */
43786
44111
  targetMode: AlarmArmModeSchema.nullable(),
43787
44112
  availableModes: array(AlarmArmModeSchema),
43788
44113
  openings: array(NcAlarmModeOpeningsSchema),
43789
- exclusions: array(NcAlarmExclusionViewSchema)
44114
+ exclusions: array(NcAlarmExclusionViewSchema),
44115
+ /**
44116
+ * Inputs bypassed for the rest of this arm session; cleared on disarm.
44117
+ * Defaulted so an older hub answer still parses (as "none known").
44118
+ */
44119
+ bypassedInputs: array(NcAlarmInputBypassViewSchema).default([])
43790
44120
  });
43791
44121
  var NcAlarmConfigSchema = object({
43792
44122
  /**
@@ -61081,26 +61411,6 @@ var ApiKeySummarySchema = object({
61081
61411
  createdAt: number(),
61082
61412
  lastUsedAt: number().optional()
61083
61413
  });
61084
- var ScopedTokenSummarySchema = object({
61085
- id: string(),
61086
- userId: string(),
61087
- name: string(),
61088
- tokenPrefix: string(),
61089
- scopes: array(TokenScopeSchema),
61090
- expiresAt: number().nullish(),
61091
- lastUsedAt: number().nullish(),
61092
- createdAt: number()
61093
- });
61094
- var CreateScopedTokenInputSchema = object({
61095
- userId: string(),
61096
- name: string(),
61097
- scopes: array(TokenScopeSchema),
61098
- expiresAt: number().optional()
61099
- });
61100
- var CreateScopedTokenResultSchema = object({
61101
- token: string(),
61102
- record: ScopedTokenSummarySchema
61103
- });
61104
61414
  var OauthSessionSummarySchema = object({
61105
61415
  id: string(),
61106
61416
  userId: string(),
@@ -61122,11 +61432,11 @@ var TotpStatusSchema = object({
61122
61432
  confirmedAt: number().nullable()
61123
61433
  });
61124
61434
  /**
61125
- * user-management — singleton capability for user accounts, API keys,
61126
- * and scoped tokens.
61435
+ * user-management — singleton capability for user accounts and the
61436
+ * legacy API-key rows.
61127
61437
  *
61128
61438
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
61129
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
61439
+ * — the subset check on `setUserScopes` is moot
61130
61440
  * because non-admins never reach these. If/when we open non-admin
61131
61441
  * delegation, structural caller-scope subset check goes inside the
61132
61442
  * provider.
@@ -61183,15 +61493,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
61183
61493
  kind: "mutation",
61184
61494
  auth: "admin",
61185
61495
  access: "delete"
61186
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
61187
- kind: "mutation",
61188
- auth: "admin",
61189
- access: "create"
61190
- }), method(object({ id: string() }), object({ success: literal(true) }), {
61191
- kind: "mutation",
61192
- auth: "admin",
61193
- access: "delete"
61194
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
61496
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
61195
61497
  kind: "mutation",
61196
61498
  auth: "admin",
61197
61499
  access: "create"
@@ -66172,7 +66474,7 @@ Object.freeze({
66172
66474
  capName: "llm",
66173
66475
  capScope: "system",
66174
66476
  addonId: null,
66175
- access: "view"
66477
+ access: "create"
66176
66478
  },
66177
66479
  "llm.listNodeModels": {
66178
66480
  capName: "llm",
@@ -66474,7 +66776,19 @@ Object.freeze({
66474
66776
  addonId: null,
66475
66777
  access: "view"
66476
66778
  },
66477
- "logDestination.query": {
66779
+ "logDestination.cancelRead": {
66780
+ capName: "log-destination",
66781
+ capScope: "system",
66782
+ addonId: null,
66783
+ access: "create"
66784
+ },
66785
+ "logDestination.describeRead": {
66786
+ capName: "log-destination",
66787
+ capScope: "system",
66788
+ addonId: null,
66789
+ access: "view"
66790
+ },
66791
+ "logDestination.read": {
66478
66792
  capName: "log-destination",
66479
66793
  capScope: "system",
66480
66794
  addonId: null,
@@ -70836,12 +71150,6 @@ Object.freeze({
70836
71150
  addonId: null,
70837
71151
  access: "create"
70838
71152
  },
70839
- "userManagement.createScopedToken": {
70840
- capName: "user-management",
70841
- capScope: "system",
70842
- addonId: null,
70843
- access: "create"
70844
- },
70845
71153
  "userManagement.createUser": {
70846
71154
  capName: "user-management",
70847
71155
  capScope: "system",
@@ -70890,12 +71198,6 @@ Object.freeze({
70890
71198
  addonId: null,
70891
71199
  access: "view"
70892
71200
  },
70893
- "userManagement.listScopedTokens": {
70894
- capName: "user-management",
70895
- capScope: "system",
70896
- addonId: null,
70897
- access: "view"
70898
- },
70899
71201
  "userManagement.listUsers": {
70900
71202
  capName: "user-management",
70901
71203
  capScope: "system",
@@ -70950,12 +71252,6 @@ Object.freeze({
70950
71252
  addonId: null,
70951
71253
  access: "delete"
70952
71254
  },
70953
- "userManagement.revokeScopedToken": {
70954
- capName: "user-management",
70955
- capScope: "system",
70956
- addonId: null,
70957
- access: "delete"
70958
- },
70959
71255
  "userManagement.setupTotp": {
70960
71256
  capName: "user-management",
70961
71257
  capScope: "system",
@@ -70986,12 +71282,6 @@ Object.freeze({
70986
71282
  addonId: null,
70987
71283
  access: "view"
70988
71284
  },
70989
- "userManagement.validateScopedToken": {
70990
- capName: "user-management",
70991
- capScope: "system",
70992
- addonId: null,
70993
- access: "view"
70994
- },
70995
71285
  "userManagement.verifyTotp": {
70996
71286
  capName: "user-management",
70997
71287
  capScope: "system",
@@ -72571,6 +72861,11 @@ Object.freeze({
72571
72861
  form: "single",
72572
72862
  optional: false
72573
72863
  }],
72864
+ "logDestination.read": [{
72865
+ name: "deviceId",
72866
+ form: "single",
72867
+ optional: true
72868
+ }],
72574
72869
  "mediaPlayer.getStatus": [{
72575
72870
  name: "deviceId",
72576
72871
  form: "single",