@camstack/addon-smtp-nodemailer 1.2.125 → 1.2.127

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.
@@ -5451,7 +5451,7 @@ var ZodIssueCode = {
5451
5451
  var ZodFirstPartyTypeKind;
5452
5452
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5453
5453
  //#endregion
5454
- //#region ../types/dist/sleep-BxjU_fJM.mjs
5454
+ //#region ../types/dist/sleep-BSuCCFjf.mjs
5455
5455
  /**
5456
5456
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5457
5457
  * window to float samples (D455).
@@ -7834,9 +7834,9 @@ function normalizeAddonInitResult(result) {
7834
7834
  return result;
7835
7835
  }
7836
7836
  /**
7837
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7838
- * and validates them (`share-token.service.ts` builds its enum from this
7839
- * list); a data plane names the kinds it ACCEPTS in `share`.
7837
+ * The share-view scope kinds a share-link token can carry. The hub mints
7838
+ * and validates them (`ShareViewGrantSchema` builds its
7839
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7840
7840
  */
7841
7841
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7842
7842
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -12445,7 +12445,7 @@ var ConvertResultSchema = object({
12445
12445
  * `super_admin` — collapsed onto the single boolean because every
12446
12446
  * non-admin caller is governed by the same scope-check rules; the
12447
12447
  * distinction was only ever used to route role-specific procedures
12448
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12448
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
12449
12449
  * with `isAdmin: false` + an explicit scope list.
12450
12450
  */
12451
12451
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -12634,10 +12634,12 @@ var AddonRoutesScopeSchema = object({
12634
12634
  type: literal("addon-routes"),
12635
12635
  access: array(MethodAccessSchema).min(1)
12636
12636
  });
12637
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
12637
12638
  var CredentialScopeSchema = union([
12638
12639
  literal("*"),
12639
12640
  ShareViewScopeSchema,
12640
12641
  AddonRoutesScopeSchema,
12642
+ PreferencesSelfScopeSchema,
12641
12643
  TokenScopeSchema
12642
12644
  ]);
12643
12645
  object({
@@ -12646,6 +12648,55 @@ object({
12646
12648
  jti: string().min(16),
12647
12649
  scopes: array(CredentialScopeSchema).min(1)
12648
12650
  });
12651
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
12652
+ /** A namespace's value: a JSON object, opaque to the hub. */
12653
+ var PreferenceValueSchema = record(string(), unknown());
12654
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
12655
+ /** A stored row, as the owner reads it. */
12656
+ var PreferenceRowSchema = object({
12657
+ namespace: PreferenceNamespaceSchema,
12658
+ value: PreferenceValueSchema,
12659
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
12660
+ revision: number().int().positive(),
12661
+ updatedAt: number().int(),
12662
+ /** The client id the last writer sent; `null` when it sent none. */
12663
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
12664
+ });
12665
+ object({
12666
+ /** Absent: every namespace the caller holds. */
12667
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
12668
+ object({ rows: array(PreferenceRowSchema) });
12669
+ object({
12670
+ namespace: PreferenceNamespaceSchema,
12671
+ value: PreferenceValueSchema,
12672
+ /**
12673
+ * The revision the edit was based on. Absent: last write wins. `0`: the
12674
+ * namespace must not exist yet. Any other value that is not the current
12675
+ * revision answers `conflict` and writes nothing.
12676
+ */
12677
+ baseRevision: number().int().nonnegative().optional(),
12678
+ deviceId: PreferenceDeviceIdSchema.optional()
12679
+ });
12680
+ discriminatedUnion("status", [object({
12681
+ status: literal("saved"),
12682
+ row: PreferenceRowSchema
12683
+ }), object({
12684
+ status: literal("conflict"),
12685
+ current: PreferenceRowSchema.nullable()
12686
+ })]);
12687
+ object({ namespace: PreferenceNamespaceSchema });
12688
+ object({
12689
+ /** `false` when the namespace did not exist. */
12690
+ deleted: boolean() });
12691
+ object({
12692
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
12693
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
12694
+ object({
12695
+ /** Every row whose revision differs from the client's, and every row it did not list. */
12696
+ rows: array(PreferenceRowSchema),
12697
+ /** Namespaces the client listed that no longer exist. */
12698
+ deleted: array(PreferenceNamespaceSchema)
12699
+ });
12649
12700
  _enum(["new-session", "step-up"]);
12650
12701
  /** The languages the hub's app landing pages are written in (D858). */
12651
12702
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -16793,7 +16844,19 @@ var DeviceHistorySubjectSchema = discriminatedUnion("kind", [object({
16793
16844
  kind: literal("node"),
16794
16845
  nodeId: string().min(1)
16795
16846
  })]);
16847
+ /**
16848
+ * `enum` stores a STATE as the ordinal of its value in the series' value list
16849
+ * (`DeviceHistorySeriesInfo.values`, append-only, so an ordinal never changes
16850
+ * meaning); a rollup keeps the time spent in each state (`states`).
16851
+ */
16796
16852
  var DeviceHistoryKindSchema = _enum([
16853
+ "gauge",
16854
+ "counter",
16855
+ "boolean",
16856
+ "enum"
16857
+ ]);
16858
+ /** What a PRODUCER may declare. `enum` is cap-only: its value list is the cap field's. */
16859
+ var DeviceHistoryProducerKindSchema = _enum([
16797
16860
  "gauge",
16798
16861
  "counter",
16799
16862
  "boolean"
@@ -16830,7 +16893,13 @@ var SeriesInfoSchema = object({
16830
16893
  /** `null` is unknown (a `unitFrom` series whose device does not state a unit right now), never a guess. */
16831
16894
  unit: string().nullable(),
16832
16895
  displayName: string(),
16833
- source: _enum(["cap", "addon"]),
16896
+ source: _enum([
16897
+ "cap",
16898
+ "addon",
16899
+ "derived"
16900
+ ]),
16901
+ /** `enum`: the value of each ordinal (index = ordinal); `null` for every other kind. */
16902
+ values: array(string()).readonly().nullable(),
16834
16903
  firstTs: number(),
16835
16904
  lastTs: number()
16836
16905
  });
@@ -16844,17 +16913,31 @@ var QueryPointSchema = object({
16844
16913
  twMean: number().nullable(),
16845
16914
  min: number(),
16846
16915
  max: number(),
16847
- /** `null` is unknown, never zero (D393). */
16848
- last: number().nullable()
16916
+ /** `null` is unknown, never zero (D393). For an `enum` series: the ordinal of {@link state}. */
16917
+ last: number().nullable(),
16918
+ /**
16919
+ * The increase over the point: a `counter`'s growth since the previous point
16920
+ * or bucket (a drop is a reset, counted from zero), and for
16921
+ * {@link DEVICE_HISTORY_ENERGY_KEY} the kWh used in the bucket. `null` for
16922
+ * every other kind, and when it cannot be known.
16923
+ */
16924
+ delta: number().nullable(),
16925
+ /** `enum`: the state in force at the end of the point (the name of `last`); `null` otherwise. */
16926
+ state: string().nullable(),
16927
+ /** `enum` rollup: milliseconds spent in each state inside the bucket; `null` for raw points and other kinds. */
16928
+ states: record(string(), number()).nullable()
16849
16929
  });
16850
16930
  var QuerySeriesSchema = object({
16851
16931
  scope: string(),
16852
16932
  /** The last point STRICTLY BEFORE `from` in the chosen tier, so a step chart can start at the held value. */
16853
16933
  before: object({
16854
16934
  t: number(),
16855
- value: number().nullable()
16935
+ value: number().nullable(),
16936
+ state: string().nullable()
16856
16937
  }).nullable(),
16857
- points: array(QueryPointSchema).readonly()
16938
+ points: array(QueryPointSchema).readonly(),
16939
+ /** A derived key: the stored key its points were computed from; `null` for a stored series. */
16940
+ derivedFrom: string().nullable()
16858
16941
  });
16859
16942
  /** The window part of a query, shared by the device and node forms. */
16860
16943
  var QueryWindowShape = {
@@ -16870,6 +16953,23 @@ var QueryResultSchema = object({
16870
16953
  series: array(QuerySeriesSchema).readonly(),
16871
16954
  truncated: boolean()
16872
16955
  });
16956
+ /** One read of a batch: a device's key or a node's key (exactly one subject). */
16957
+ var QueryManyItemSchema = union([object({
16958
+ deviceId: number().int(),
16959
+ key: string(),
16960
+ scope: string().optional()
16961
+ }), object({
16962
+ forNodeId: string().min(1),
16963
+ key: string(),
16964
+ scope: string().optional()
16965
+ })]);
16966
+ var QueryManyEntrySchema = discriminatedUnion("ok", [object({
16967
+ ok: literal(true),
16968
+ result: QueryResultSchema
16969
+ }), object({
16970
+ ok: literal(false),
16971
+ error: string()
16972
+ })]);
16873
16973
  var TierStatusSchema = object({
16874
16974
  tier: DeviceHistoryResolutionSchema,
16875
16975
  /** `null` until the first background count answered. */
@@ -16925,16 +17025,22 @@ var DeviceHistoryStatusSchema = object({
16925
17025
  lastRefreshAt: number().nullable()
16926
17026
  })
16927
17027
  });
16928
- method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ nodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
17028
+ method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly()), method(object({ forNodeId: string().min(1) }), array(SeriesInfoSchema).readonly(), { auth: "admin" }), method(object({
16929
17029
  deviceId: number().int(),
16930
17030
  ...QueryWindowShape
16931
17031
  }), QueryResultSchema), method(object({
16932
- nodeId: string().min(1),
17032
+ forNodeId: string().min(1),
16933
17033
  ...QueryWindowShape
16934
17034
  }), QueryResultSchema, { auth: "admin" }), method(object({
17035
+ items: array(QueryManyItemSchema).min(1).max(24),
17036
+ from: QueryWindowShape.from,
17037
+ to: QueryWindowShape.to,
17038
+ resolution: QueryWindowShape.resolution,
17039
+ maxPoints: QueryWindowShape.maxPoints
17040
+ }), object({ results: array(QueryManyEntrySchema).readonly() }), { auth: "admin" }), method(object({
16935
17041
  name: string().regex(/^[a-z0-9-]+$/),
16936
17042
  subjectKind: _enum(["device", "node"]),
16937
- kind: DeviceHistoryKindSchema,
17043
+ kind: DeviceHistoryProducerKindSchema,
16938
17044
  unit: string().optional(),
16939
17045
  displayName: string().min(1),
16940
17046
  ingest: _enum(["points", "buckets"])
@@ -39524,38 +39630,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
39524
39630
  auth: "admin",
39525
39631
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
39526
39632
  });
39633
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
39634
+ /** What a model (or, by default, every model of a kind) can do. */
39635
+ var LlmModelFeaturesSchema = object({
39636
+ vision: boolean(),
39637
+ tools: boolean(),
39638
+ streaming: boolean()
39639
+ });
39640
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
39641
+ var LlmModelInfoSchema = object({
39642
+ id: string(),
39643
+ label: string().optional(),
39644
+ contextLength: number().int().positive().optional(),
39645
+ features: LlmModelFeaturesSchema.partial().optional()
39646
+ });
39527
39647
  /**
39528
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
39529
- * methods concat-fan across providers; single-row methods route to ONE
39530
- * provider by the `addonId` in the call input (the notification-output
39531
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
39532
- * (hub-placed); the cap stays open for future providers.
39533
- *
39534
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
39535
- * `apiKey` is a password field — providers REDACT it on read and merge on
39536
- * write; a stored key NEVER round-trips to a client.
39648
+ * The provider-specific part of a profile, validated by the provider that owns
39649
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
39650
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
39651
+ * keychain, never in the row, and reads back as the redaction marker.
39537
39652
  */
39538
- var LlmProfileKindSchema = _enum([
39539
- "openai-compatible",
39540
- "openai",
39541
- "anthropic",
39542
- "google",
39543
- "managed-local",
39544
- "apple-foundation"
39545
- ]);
39653
+ var LlmProviderConfigSchema = record(string(), unknown());
39546
39654
  var LlmProfileSchema = object({
39547
39655
  id: string(),
39548
39656
  name: string(),
39657
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
39549
39658
  kind: LlmProfileKindSchema,
39550
39659
  /** Stamped by the provider — keeps the fanned catalog routable. */
39551
39660
  addonId: string(),
39552
39661
  enabled: boolean(),
39553
39662
  /** Vendor model id, or the managed runtime's loaded model. */
39554
39663
  model: string(),
39555
- /** Required for openai-compatible; override for cloud kinds. */
39556
- baseUrl: string().optional(),
39557
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
39558
- apiKey: string().optional(),
39559
39664
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
39560
39665
  * degraded to text — that shipped once and produced a confident answer to a
39561
39666
  * question about a picture nobody sent. */
@@ -39563,15 +39668,11 @@ var LlmProfileSchema = object({
39563
39668
  temperature: number().min(0).max(2).optional(),
39564
39669
  /** Nucleus sampling. Every wire we speak has it. */
39565
39670
  topP: number().min(0).max(1).optional(),
39566
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
39567
- * wire does, and the client drops it there (measured: the request body gets
39568
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
39569
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
39671
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
39672
+ * field in its editor only when its descriptor lists it in `profileFields`. */
39570
39673
  topK: number().int().positive().optional(),
39571
39674
  maxTokens: number().int().positive().optional(),
39572
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
39573
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
39574
- * the model with, so it is the one field that changes a PROCESS. */
39675
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
39575
39676
  contextLength: number().int().positive().optional(),
39576
39677
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
39577
39678
  * two system prompts fighting is worse than either alone). */
@@ -39597,16 +39698,37 @@ var LlmProfileSchema = object({
39597
39698
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
39598
39699
  * `true` here buys the wiring, not behaviour, until tools are registered. */
39599
39700
  toolsEnabled: boolean().default(false),
39600
- extraHeaders: record(string(), string()).optional(),
39601
- /** kind === 'managed-local' only (spec §4). */
39602
- runtime: ManagedRuntimeConfigSchema.optional(),
39603
- /**
39604
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
39605
- * to configure (no key, no URL, no download; `model` is `apple-system`).
39606
- * `supportsVision` on such a row is stamped by the provider from the node's
39607
- * reported `imageInput`, never taken from the operator (D62).
39608
- */
39609
- appleFoundation: object({ nodeId: string() }).optional()
39701
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
39702
+ providerConfig: LlmProviderConfigSchema.default({})
39703
+ });
39704
+ /**
39705
+ * The common profile fields a kind's editor offers. The editor owns how each
39706
+ * one is drawn; the provider says which of them mean something on its wire.
39707
+ */
39708
+ var LlmProfileFieldSchema = _enum([
39709
+ "temperature",
39710
+ "topP",
39711
+ "topK",
39712
+ "maxTokens",
39713
+ "contextLength",
39714
+ "systemPrompt",
39715
+ "timeoutMs",
39716
+ "connectTimeoutMs",
39717
+ "firstTokenTimeoutMs",
39718
+ "idleTimeoutMs",
39719
+ "retry",
39720
+ "toolsEnabled"
39721
+ ]);
39722
+ /**
39723
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
39724
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
39725
+ * picker: that widget owns the model choice.
39726
+ */
39727
+ var LlmProviderWidgetSchema = object({
39728
+ id: string(),
39729
+ placement: _enum(["connection", "model"]),
39730
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
39731
+ requires: array(string()).optional()
39610
39732
  });
39611
39733
  /** ConfigUISchema tree passed through untyped on the wire (the
39612
39734
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -39615,11 +39737,56 @@ var ConfigSchemaPassthrough$3 = unknown();
39615
39737
  var LlmProfileKindDescriptorSchema = object({
39616
39738
  kind: LlmProfileKindSchema,
39617
39739
  label: string(),
39740
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
39618
39741
  icon: string(),
39619
39742
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
39620
39743
  addonId: string(),
39621
- configSchema: ConfigSchemaPassthrough$3
39744
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
39745
+ connectionSchema: ConfigSchemaPassthrough$3,
39746
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
39747
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
39748
+ /** The kind's defaults; a model from `listModels` may override any of them. */
39749
+ features: LlmModelFeaturesSchema,
39750
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
39751
+ visionEditable: boolean(),
39752
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
39753
+ modelCatalog: _enum([
39754
+ "fetch",
39755
+ "static",
39756
+ "none"
39757
+ ]),
39758
+ staticModels: array(LlmModelInfoSchema).optional(),
39759
+ /** The common fields that mean something on this kind's wire. */
39760
+ profileFields: array(LlmProfileFieldSchema),
39761
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
39762
+ });
39763
+ /**
39764
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
39765
+ * (the editor's form); with `profileId` too, a secret the draft leaves
39766
+ * untouched (absent or the redaction marker) is resolved server-side from the
39767
+ * stored profile — the browser never receives it.
39768
+ */
39769
+ var LlmListModelsInputSchema = object({
39770
+ addonId: string(),
39771
+ kind: LlmProfileKindSchema,
39772
+ profileId: string().optional(),
39773
+ connection: LlmProviderConfigSchema.optional()
39622
39774
  });
39775
+ var LlmListModelsErrorCodeSchema = _enum([
39776
+ "auth",
39777
+ "network",
39778
+ "unsupported",
39779
+ "invalid"
39780
+ ]);
39781
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
39782
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
39783
+ ok: literal(true),
39784
+ models: array(LlmModelInfoSchema)
39785
+ }), object({
39786
+ ok: literal(false),
39787
+ code: LlmListModelsErrorCodeSchema,
39788
+ message: string()
39789
+ })]);
39623
39790
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
39624
39791
  var LlmDefaultSchema = object({
39625
39792
  selector: LlmDefaultSelectorSchema,
@@ -39719,7 +39886,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
39719
39886
  kind: "mutation",
39720
39887
  auth: "admin",
39721
39888
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
39722
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
39889
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
39890
+ kind: "mutation",
39891
+ auth: "admin"
39892
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
39723
39893
  selector: LlmDefaultSelectorSchema,
39724
39894
  profileId: string().nullable()
39725
39895
  }), _void(), {
@@ -39887,14 +40057,106 @@ var LogEntrySchema = object({
39887
40057
  meta: record(string(), unknown()).optional(),
39888
40058
  tags: record(string(), string()).optional()
39889
40059
  });
39890
- method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
39891
- scope: array(string()).optional(),
40060
+ /**
40061
+ * A history READ against one destination (D898).
40062
+ *
40063
+ * Every filter is applied by the PROVIDER, before the limit — a filter the
40064
+ * browser applied after the limit is what made a rare device's lines
40065
+ * unreachable behind a busy one's. `before` / `after` are cursors the provider
40066
+ * minted (opaque to everyone else): a file position for the rotated files, a
40067
+ * nanosecond timestamp for Loki.
40068
+ *
40069
+ * A read is BOUNDED by `budgetMs`: a filter that matches nothing on a 30-day
40070
+ * store answers `done: false` with the cursor it reached and the bytes it
40071
+ * scanned, and the caller decides whether to go on. That is what makes a long
40072
+ * scan show progress and stop when asked — `cancelRead` ends the slice in
40073
+ * flight, and not asking for the next slice ends the scan.
40074
+ */
40075
+ var LogReadQuerySchema = object({
40076
+ /** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
40077
+ requestId: string().min(1).max(64).optional(),
40078
+ /** The device the line is about (`tags.deviceId`, numeric). */
40079
+ deviceId: number().int().optional(),
40080
+ /**
40081
+ * The emitting addon — bare manifest id; `@<version>` / `::<sub>` suffixes
40082
+ * match. Not `addonId`: a cap router reads that name as "which provider".
40083
+ */
40084
+ fromAddonId: string().min(1).max(200).optional(),
40085
+ /**
40086
+ * The emitting node: matches the agent that emitted the line, the node
40087
+ * itself, or a worker under it (`<agent>/<runner>`) — the `agentId`
40088
+ * semantics of `matchesLogTags`. Not `nodeId`: a cap router reads that
40089
+ * name as "which node's provider".
40090
+ */
40091
+ fromNodeId: string().min(1).max(200).optional(),
40092
+ /** Any other tag, exact match (AND). */
40093
+ tags: record(string(), union([string(), number()])).optional(),
40094
+ /** Severity FLOOR: this level and above. */
39892
40095
  level: LogLevelSchema.optional(),
39893
- since: date().optional(),
39894
- until: date().optional(),
39895
- limit: number().optional(),
39896
- tags: record(string(), string()).optional()
39897
- }), array(LogEntrySchema).readonly());
40096
+ /** Case-insensitive substring over message, scope, tag values and meta values. */
40097
+ text: string().min(1).max(200).optional(),
40098
+ /** Epoch ms, inclusive. */
40099
+ since: number().optional(),
40100
+ /** Epoch ms, inclusive. */
40101
+ until: number().optional(),
40102
+ /** Older than this cursor (exclusive). Absent with `after` absent ⇒ from the newest. */
40103
+ before: string().min(1).max(1024).optional(),
40104
+ /** Newer than this cursor (exclusive). */
40105
+ after: string().min(1).max(1024).optional(),
40106
+ limit: number().int().min(1).max(1e3).optional(),
40107
+ /** Wall-clock bound of this slice. The provider caps it. */
40108
+ budgetMs: number().int().min(50).max(1e4).optional()
40109
+ });
40110
+ var LogReadResultSchema = object({
40111
+ /** Newest first. */
40112
+ entries: array(object({
40113
+ /** `<bootId>.<seq>` minted by the emitting LogManager — the dedupe key. */
40114
+ id: string().optional(),
40115
+ /** Epoch ms. */
40116
+ timestamp: number(),
40117
+ level: LogLevelSchema,
40118
+ scope: string().optional(),
40119
+ message: string(),
40120
+ tags: record(string(), union([string(), number()])).optional(),
40121
+ meta: record(string(), unknown()).optional()
40122
+ })),
40123
+ /** Pass as `before` for the next older page; null when nothing older exists. */
40124
+ nextBefore: string().nullable(),
40125
+ /** Pass as `after` to read what arrived since; null when unknown. */
40126
+ nextAfter: string().nullable(),
40127
+ /** Bytes this slice read (files) or received (remote). Progress, not a promise. */
40128
+ scannedBytes: number().int().nonnegative(),
40129
+ /**
40130
+ * True when the scan in this direction reached the end of the store.
40131
+ * False with fewer than `limit` entries means the budget ran out first —
40132
+ * call again with `nextBefore` to go on.
40133
+ */
40134
+ done: boolean(),
40135
+ /** True when `cancelRead` ended this slice early. */
40136
+ cancelled: boolean().optional()
40137
+ });
40138
+ var LogReadCapabilitiesSchema = object({
40139
+ /** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
40140
+ readable: boolean(),
40141
+ /** Why not, when `readable` is false — rendered next to the source. */
40142
+ reason: string().nullable(),
40143
+ /** Filters the provider applies itself. A false one is applied by nobody. */
40144
+ filters: object({
40145
+ deviceId: boolean(),
40146
+ addonId: boolean(),
40147
+ nodeId: boolean(),
40148
+ tags: boolean(),
40149
+ level: boolean(),
40150
+ text: boolean(),
40151
+ timeRange: boolean()
40152
+ }),
40153
+ /** How far back the store reaches, when the provider knows (days). */
40154
+ retentionDays: number().nullable()
40155
+ });
40156
+ 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() }), {
40157
+ kind: "mutation",
40158
+ auth: "admin"
40159
+ });
39898
40160
  /**
39899
40161
  * `login-method` — collection cap through which auth addons contribute
39900
40162
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -42450,6 +42712,33 @@ var NcRuleTargetSchema = object({
42450
42712
  params: record(string(), unknown()).optional()
42451
42713
  });
42452
42714
  /**
42715
+ * WHAT THE NOTIFICATION'S PICTURE IS (D897) — the ONE media choice of a rule.
42716
+ *
42717
+ * Every mode starts from the same CLEAN source frame of the trigger moment
42718
+ * (keyFrame → sceneFrame → lastSceneFrame, narrowed to the trigger instant and
42719
+ * to the zone that fired the rule) and renders it once at send time:
42720
+ * - `scene-boxes` — the whole scene, the subject outlined thick in the accent
42721
+ * colour and every OTHER track visible at that instant outlined thin, each
42722
+ * labelled with class and confidence ("dog 87%").
42723
+ * - `crop` — the subject cut out of that frame around its box at that instant.
42724
+ * - `clean` — the whole scene with nothing drawn on it.
42725
+ * - `none` — no picture.
42726
+ *
42727
+ * A mode that cannot be honoured (no box at that instant, a photograph with no
42728
+ * tracked subject) ships `clean` and names the reason in the log, per camera.
42729
+ * It replaces the `attach` × `frame` × `zoneCrop` triple, which let one rule
42730
+ * ship a crop on one event and a boxed scene on the next depending on which
42731
+ * stored kind had landed.
42732
+ */
42733
+ var NcMediaImageSchema = _enum([
42734
+ "scene-boxes",
42735
+ "crop",
42736
+ "clean",
42737
+ "none"
42738
+ ]);
42739
+ /**
42740
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
42741
+ *
42453
42742
  * Media attachment policy (P1 still-image subset).
42454
42743
  * - `best` — the best AVAILABLE subject image at dispatch time (D-3).
42455
42744
  * - `best-matching` — the media that explains WHY the rule fired: a rule
@@ -42463,6 +42752,8 @@ var NcRuleTargetSchema = object({
42463
42752
  * - `none` — no attachment.
42464
42753
  */
42465
42754
  /**
42755
+ * @deprecated Read only by `normalizeNcMediaPolicy` (D897) — see {@link NcMediaImageSchema}.
42756
+ *
42466
42757
  * WHAT THE PICTURE SHOWS — chosen explicitly, because the implicit ladders
42467
42758
  * conflate it with the selection strategy and betray the request: asking for
42468
42759
  * the clean scene frame on an object-event owner used to start at
@@ -42491,16 +42782,29 @@ var NcMediaFrameSchema = _enum([
42491
42782
  */
42492
42783
  var NcLinkedCameraModeSchema = _enum(["mosaic", "each"]);
42493
42784
  var NcMediaPolicySchema = object({
42785
+ /**
42786
+ * The picture — see {@link NcMediaImageSchema}. Absent on a rule nobody has
42787
+ * saved since D897: `normalizeNcMediaPolicy` derives it from the legacy
42788
+ * triple below, at load and at every write, and the store keeps only this.
42789
+ */
42790
+ image: NcMediaImageSchema.optional(),
42791
+ /**
42792
+ * Draw the zone that FIRED the rule on the picture (`scene-boxes` / `clean`;
42793
+ * a `crop` never shows it). Valid only on a rule whose trigger is a zone —
42794
+ * `conditions.zones` or an occupancy zone — and refused on save otherwise.
42795
+ * Replaces `zoneCrop`.
42796
+ */
42797
+ showTriggerZone: boolean().optional(),
42798
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
42494
42799
  attach: _enum([
42495
42800
  "best",
42496
42801
  "best-matching",
42497
42802
  "keyFrame",
42498
42803
  "none"
42499
- ]).default("best"),
42500
- /** What the still shows. Absent = `cropped` (the historical `best` shape). */
42804
+ ]).optional(),
42805
+ /** @deprecated D897 — accepted from an editor that predates `image`, folded into it on save. */
42501
42806
  frame: NcMediaFrameSchema.optional(),
42502
- /** Crop the attached still to the rule's condition-zone bbox (padded) —
42503
- * "show me the ZONE", not the whole scene or the subject crop. */
42807
+ /** @deprecated D897 — folded into `image: 'clean'` + `showTriggerZone` on save. */
42504
42808
  zoneCrop: boolean().optional(),
42505
42809
  /**
42506
42810
  * Also attach a short GIF cut from the stream broker's clip ring around the
@@ -42672,7 +42976,9 @@ var NcRuleInputSchema = object({
42672
42976
  * targets.
42673
42977
  */
42674
42978
  targetUsers: array(string()).optional(),
42675
- media: NcMediaPolicySchema.default({ attach: "best" }),
42979
+ /** Absent = the kind's default picture (`resolveNcMediaImage`): the subject crop for a
42980
+ * detection, the clean scene for a sensor or a sound. Set explicitly on save (D897). */
42981
+ media: NcMediaPolicySchema.default({}),
42676
42982
  throttle: NcThrottleSchema.default({
42677
42983
  cooldownSec: 60,
42678
42984
  scope: "rule-device"
@@ -43609,13 +43915,37 @@ var NcAlarmModeOpeningsSchema = object({
43609
43915
  /** Covered devices whose state could not be read (D49): neither open nor closed. */
43610
43916
  unknown: array(number().int())
43611
43917
  });
43918
+ /**
43919
+ * One alarm INPUT — a (rule, device) pair — the operator bypassed until the
43920
+ * next disarm ("Bypass this input until disarm" on a trigger notification, or
43921
+ * `nc.bypassAlarmInput`). Reported so an armed alarm with a silenced input
43922
+ * never looks fully armed (D62: off must never look like broken).
43923
+ */
43924
+ var NcAlarmInputBypassViewSchema = object({
43925
+ ruleId: string(),
43926
+ /** The rule's current name (its frozen name when the rule is gone). */
43927
+ ruleName: string(),
43928
+ /** The input: the sensor of the match, else its camera. */
43929
+ deviceId: number().int(),
43930
+ /** The input's current name. */
43931
+ name: string(),
43932
+ /** When it was bypassed (ms epoch). */
43933
+ since: number(),
43934
+ /** Triggers from this input dropped since. */
43935
+ dropped: number().int().min(0)
43936
+ });
43612
43937
  var NcAlarmLiveSchema = object({
43613
43938
  state: AlarmStateSchema,
43614
43939
  /** The mode being armed into (exit delay) or held; null when disarmed. */
43615
43940
  targetMode: AlarmArmModeSchema.nullable(),
43616
43941
  availableModes: array(AlarmArmModeSchema),
43617
43942
  openings: array(NcAlarmModeOpeningsSchema),
43618
- exclusions: array(NcAlarmExclusionViewSchema)
43943
+ exclusions: array(NcAlarmExclusionViewSchema),
43944
+ /**
43945
+ * Inputs bypassed for the rest of this arm session; cleared on disarm.
43946
+ * Defaulted so an older hub answer still parses (as "none known").
43947
+ */
43948
+ bypassedInputs: array(NcAlarmInputBypassViewSchema).default([])
43619
43949
  });
43620
43950
  var NcAlarmConfigSchema = object({
43621
43951
  /**
@@ -60727,26 +61057,6 @@ var ApiKeySummarySchema = object({
60727
61057
  createdAt: number(),
60728
61058
  lastUsedAt: number().optional()
60729
61059
  });
60730
- var ScopedTokenSummarySchema = object({
60731
- id: string(),
60732
- userId: string(),
60733
- name: string(),
60734
- tokenPrefix: string(),
60735
- scopes: array(TokenScopeSchema),
60736
- expiresAt: number().nullish(),
60737
- lastUsedAt: number().nullish(),
60738
- createdAt: number()
60739
- });
60740
- var CreateScopedTokenInputSchema = object({
60741
- userId: string(),
60742
- name: string(),
60743
- scopes: array(TokenScopeSchema),
60744
- expiresAt: number().optional()
60745
- });
60746
- var CreateScopedTokenResultSchema = object({
60747
- token: string(),
60748
- record: ScopedTokenSummarySchema
60749
- });
60750
61060
  var OauthSessionSummarySchema = object({
60751
61061
  id: string(),
60752
61062
  userId: string(),
@@ -60768,11 +61078,11 @@ var TotpStatusSchema = object({
60768
61078
  confirmedAt: number().nullable()
60769
61079
  });
60770
61080
  /**
60771
- * user-management — singleton capability for user accounts, API keys,
60772
- * and scoped tokens.
61081
+ * user-management — singleton capability for user accounts and the
61082
+ * legacy API-key rows.
60773
61083
  *
60774
61084
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
60775
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
61085
+ * — the subset check on `setUserScopes` is moot
60776
61086
  * because non-admins never reach these. If/when we open non-admin
60777
61087
  * delegation, structural caller-scope subset check goes inside the
60778
61088
  * provider.
@@ -60829,15 +61139,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
60829
61139
  kind: "mutation",
60830
61140
  auth: "admin",
60831
61141
  access: "delete"
60832
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
60833
- kind: "mutation",
60834
- auth: "admin",
60835
- access: "create"
60836
- }), method(object({ id: string() }), object({ success: literal(true) }), {
60837
- kind: "mutation",
60838
- auth: "admin",
60839
- access: "delete"
60840
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
61142
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
60841
61143
  kind: "mutation",
60842
61144
  auth: "admin",
60843
61145
  access: "create"
@@ -64993,7 +65295,7 @@ Object.freeze({
64993
65295
  capName: "llm",
64994
65296
  capScope: "system",
64995
65297
  addonId: null,
64996
- access: "view"
65298
+ access: "create"
64997
65299
  },
64998
65300
  "llm.listNodeModels": {
64999
65301
  capName: "llm",
@@ -65295,7 +65597,19 @@ Object.freeze({
65295
65597
  addonId: null,
65296
65598
  access: "view"
65297
65599
  },
65298
- "logDestination.query": {
65600
+ "logDestination.cancelRead": {
65601
+ capName: "log-destination",
65602
+ capScope: "system",
65603
+ addonId: null,
65604
+ access: "create"
65605
+ },
65606
+ "logDestination.describeRead": {
65607
+ capName: "log-destination",
65608
+ capScope: "system",
65609
+ addonId: null,
65610
+ access: "view"
65611
+ },
65612
+ "logDestination.read": {
65299
65613
  capName: "log-destination",
65300
65614
  capScope: "system",
65301
65615
  addonId: null,
@@ -69657,12 +69971,6 @@ Object.freeze({
69657
69971
  addonId: null,
69658
69972
  access: "create"
69659
69973
  },
69660
- "userManagement.createScopedToken": {
69661
- capName: "user-management",
69662
- capScope: "system",
69663
- addonId: null,
69664
- access: "create"
69665
- },
69666
69974
  "userManagement.createUser": {
69667
69975
  capName: "user-management",
69668
69976
  capScope: "system",
@@ -69711,12 +70019,6 @@ Object.freeze({
69711
70019
  addonId: null,
69712
70020
  access: "view"
69713
70021
  },
69714
- "userManagement.listScopedTokens": {
69715
- capName: "user-management",
69716
- capScope: "system",
69717
- addonId: null,
69718
- access: "view"
69719
- },
69720
70022
  "userManagement.listUsers": {
69721
70023
  capName: "user-management",
69722
70024
  capScope: "system",
@@ -69771,12 +70073,6 @@ Object.freeze({
69771
70073
  addonId: null,
69772
70074
  access: "delete"
69773
70075
  },
69774
- "userManagement.revokeScopedToken": {
69775
- capName: "user-management",
69776
- capScope: "system",
69777
- addonId: null,
69778
- access: "delete"
69779
- },
69780
70076
  "userManagement.setupTotp": {
69781
70077
  capName: "user-management",
69782
70078
  capScope: "system",
@@ -69807,12 +70103,6 @@ Object.freeze({
69807
70103
  addonId: null,
69808
70104
  access: "view"
69809
70105
  },
69810
- "userManagement.validateScopedToken": {
69811
- capName: "user-management",
69812
- capScope: "system",
69813
- addonId: null,
69814
- access: "view"
69815
- },
69816
70106
  "userManagement.verifyTotp": {
69817
70107
  capName: "user-management",
69818
70108
  capScope: "system",
@@ -71326,6 +71616,11 @@ Object.freeze({
71326
71616
  form: "single",
71327
71617
  optional: false
71328
71618
  }],
71619
+ "logDestination.read": [{
71620
+ name: "deviceId",
71621
+ form: "single",
71622
+ optional: true
71623
+ }],
71329
71624
  "mediaPlayer.getStatus": [{
71330
71625
  name: "deviceId",
71331
71626
  form: "single",