@camstack/addon-provider-reolink 1.2.191 → 1.2.192

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 +165 -102
  2. package/dist/addon.mjs +165 -102
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -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-yKL5gfrH.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).
@@ -7838,9 +7838,9 @@ function normalizeAddonInitResult(result) {
7838
7838
  return result;
7839
7839
  }
7840
7840
  /**
7841
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7842
- * and validates them (`share-token.service.ts` builds its enum from this
7843
- * list); a data plane names the kinds it ACCEPTS in `share`.
7841
+ * The share-view scope kinds a share-link token can carry. The hub mints
7842
+ * and validates them (`ShareViewGrantSchema` builds its
7843
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7844
7844
  */
7845
7845
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7846
7846
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -13144,7 +13144,7 @@ var ConvertResultSchema = object({
13144
13144
  * `super_admin` — collapsed onto the single boolean because every
13145
13145
  * non-admin caller is governed by the same scope-check rules; the
13146
13146
  * distinction was only ever used to route role-specific procedures
13147
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
13147
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
13148
13148
  * with `isAdmin: false` + an explicit scope list.
13149
13149
  */
13150
13150
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -13333,10 +13333,12 @@ var AddonRoutesScopeSchema = object({
13333
13333
  type: literal("addon-routes"),
13334
13334
  access: array(MethodAccessSchema).min(1)
13335
13335
  });
13336
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
13336
13337
  var CredentialScopeSchema = union([
13337
13338
  literal("*"),
13338
13339
  ShareViewScopeSchema,
13339
13340
  AddonRoutesScopeSchema,
13341
+ PreferencesSelfScopeSchema,
13340
13342
  TokenScopeSchema
13341
13343
  ]);
13342
13344
  object({
@@ -13345,6 +13347,55 @@ object({
13345
13347
  jti: string().min(16),
13346
13348
  scopes: array(CredentialScopeSchema).min(1)
13347
13349
  });
13350
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
13351
+ /** A namespace's value: a JSON object, opaque to the hub. */
13352
+ var PreferenceValueSchema = record(string(), unknown());
13353
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
13354
+ /** A stored row, as the owner reads it. */
13355
+ var PreferenceRowSchema = object({
13356
+ namespace: PreferenceNamespaceSchema,
13357
+ value: PreferenceValueSchema,
13358
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
13359
+ revision: number().int().positive(),
13360
+ updatedAt: number().int(),
13361
+ /** The client id the last writer sent; `null` when it sent none. */
13362
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
13363
+ });
13364
+ object({
13365
+ /** Absent: every namespace the caller holds. */
13366
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
13367
+ object({ rows: array(PreferenceRowSchema) });
13368
+ object({
13369
+ namespace: PreferenceNamespaceSchema,
13370
+ value: PreferenceValueSchema,
13371
+ /**
13372
+ * The revision the edit was based on. Absent: last write wins. `0`: the
13373
+ * namespace must not exist yet. Any other value that is not the current
13374
+ * revision answers `conflict` and writes nothing.
13375
+ */
13376
+ baseRevision: number().int().nonnegative().optional(),
13377
+ deviceId: PreferenceDeviceIdSchema.optional()
13378
+ });
13379
+ discriminatedUnion("status", [object({
13380
+ status: literal("saved"),
13381
+ row: PreferenceRowSchema
13382
+ }), object({
13383
+ status: literal("conflict"),
13384
+ current: PreferenceRowSchema.nullable()
13385
+ })]);
13386
+ object({ namespace: PreferenceNamespaceSchema });
13387
+ object({
13388
+ /** `false` when the namespace did not exist. */
13389
+ deleted: boolean() });
13390
+ object({
13391
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
13392
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
13393
+ object({
13394
+ /** Every row whose revision differs from the client's, and every row it did not list. */
13395
+ rows: array(PreferenceRowSchema),
13396
+ /** Namespaces the client listed that no longer exist. */
13397
+ deleted: array(PreferenceNamespaceSchema)
13398
+ });
13348
13399
  _enum(["new-session", "step-up"]);
13349
13400
  /** The languages the hub's app landing pages are written in (D858). */
13350
13401
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -40653,38 +40704,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
40653
40704
  auth: "admin",
40654
40705
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40655
40706
  });
40707
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
40708
+ /** What a model (or, by default, every model of a kind) can do. */
40709
+ var LlmModelFeaturesSchema = object({
40710
+ vision: boolean(),
40711
+ tools: boolean(),
40712
+ streaming: boolean()
40713
+ });
40714
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
40715
+ var LlmModelInfoSchema = object({
40716
+ id: string(),
40717
+ label: string().optional(),
40718
+ contextLength: number().int().positive().optional(),
40719
+ features: LlmModelFeaturesSchema.partial().optional()
40720
+ });
40656
40721
  /**
40657
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
40658
- * methods concat-fan across providers; single-row methods route to ONE
40659
- * provider by the `addonId` in the call input (the notification-output
40660
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
40661
- * (hub-placed); the cap stays open for future providers.
40662
- *
40663
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
40664
- * `apiKey` is a password field — providers REDACT it on read and merge on
40665
- * write; a stored key NEVER round-trips to a client.
40722
+ * The provider-specific part of a profile, validated by the provider that owns
40723
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
40724
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
40725
+ * keychain, never in the row, and reads back as the redaction marker.
40666
40726
  */
40667
- var LlmProfileKindSchema = _enum([
40668
- "openai-compatible",
40669
- "openai",
40670
- "anthropic",
40671
- "google",
40672
- "managed-local",
40673
- "apple-foundation"
40674
- ]);
40727
+ var LlmProviderConfigSchema = record(string(), unknown());
40675
40728
  var LlmProfileSchema = object({
40676
40729
  id: string(),
40677
40730
  name: string(),
40731
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
40678
40732
  kind: LlmProfileKindSchema,
40679
40733
  /** Stamped by the provider — keeps the fanned catalog routable. */
40680
40734
  addonId: string(),
40681
40735
  enabled: boolean(),
40682
40736
  /** Vendor model id, or the managed runtime's loaded model. */
40683
40737
  model: string(),
40684
- /** Required for openai-compatible; override for cloud kinds. */
40685
- baseUrl: string().optional(),
40686
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
40687
- apiKey: string().optional(),
40688
40738
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
40689
40739
  * degraded to text — that shipped once and produced a confident answer to a
40690
40740
  * question about a picture nobody sent. */
@@ -40692,15 +40742,11 @@ var LlmProfileSchema = object({
40692
40742
  temperature: number().min(0).max(2).optional(),
40693
40743
  /** Nucleus sampling. Every wire we speak has it. */
40694
40744
  topP: number().min(0).max(1).optional(),
40695
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
40696
- * wire does, and the client drops it there (measured: the request body gets
40697
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
40698
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
40745
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
40746
+ * field in its editor only when its descriptor lists it in `profileFields`. */
40699
40747
  topK: number().int().positive().optional(),
40700
40748
  maxTokens: number().int().positive().optional(),
40701
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
40702
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
40703
- * the model with, so it is the one field that changes a PROCESS. */
40749
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
40704
40750
  contextLength: number().int().positive().optional(),
40705
40751
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
40706
40752
  * two system prompts fighting is worse than either alone). */
@@ -40726,16 +40772,37 @@ var LlmProfileSchema = object({
40726
40772
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
40727
40773
  * `true` here buys the wiring, not behaviour, until tools are registered. */
40728
40774
  toolsEnabled: boolean().default(false),
40729
- extraHeaders: record(string(), string()).optional(),
40730
- /** kind === 'managed-local' only (spec §4). */
40731
- runtime: ManagedRuntimeConfigSchema.optional(),
40732
- /**
40733
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
40734
- * to configure (no key, no URL, no download; `model` is `apple-system`).
40735
- * `supportsVision` on such a row is stamped by the provider from the node's
40736
- * reported `imageInput`, never taken from the operator (D62).
40737
- */
40738
- appleFoundation: object({ nodeId: string() }).optional()
40775
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
40776
+ providerConfig: LlmProviderConfigSchema.default({})
40777
+ });
40778
+ /**
40779
+ * The common profile fields a kind's editor offers. The editor owns how each
40780
+ * one is drawn; the provider says which of them mean something on its wire.
40781
+ */
40782
+ var LlmProfileFieldSchema = _enum([
40783
+ "temperature",
40784
+ "topP",
40785
+ "topK",
40786
+ "maxTokens",
40787
+ "contextLength",
40788
+ "systemPrompt",
40789
+ "timeoutMs",
40790
+ "connectTimeoutMs",
40791
+ "firstTokenTimeoutMs",
40792
+ "idleTimeoutMs",
40793
+ "retry",
40794
+ "toolsEnabled"
40795
+ ]);
40796
+ /**
40797
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
40798
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
40799
+ * picker: that widget owns the model choice.
40800
+ */
40801
+ var LlmProviderWidgetSchema = object({
40802
+ id: string(),
40803
+ placement: _enum(["connection", "model"]),
40804
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
40805
+ requires: array(string()).optional()
40739
40806
  });
40740
40807
  /** ConfigUISchema tree passed through untyped on the wire (the
40741
40808
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -40744,11 +40811,56 @@ var ConfigSchemaPassthrough$3 = unknown();
40744
40811
  var LlmProfileKindDescriptorSchema = object({
40745
40812
  kind: LlmProfileKindSchema,
40746
40813
  label: string(),
40814
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
40747
40815
  icon: string(),
40748
40816
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
40749
40817
  addonId: string(),
40750
- configSchema: ConfigSchemaPassthrough$3
40818
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
40819
+ connectionSchema: ConfigSchemaPassthrough$3,
40820
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
40821
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
40822
+ /** The kind's defaults; a model from `listModels` may override any of them. */
40823
+ features: LlmModelFeaturesSchema,
40824
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
40825
+ visionEditable: boolean(),
40826
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
40827
+ modelCatalog: _enum([
40828
+ "fetch",
40829
+ "static",
40830
+ "none"
40831
+ ]),
40832
+ staticModels: array(LlmModelInfoSchema).optional(),
40833
+ /** The common fields that mean something on this kind's wire. */
40834
+ profileFields: array(LlmProfileFieldSchema),
40835
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
40751
40836
  });
40837
+ /**
40838
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
40839
+ * (the editor's form); with `profileId` too, a secret the draft leaves
40840
+ * untouched (absent or the redaction marker) is resolved server-side from the
40841
+ * stored profile — the browser never receives it.
40842
+ */
40843
+ var LlmListModelsInputSchema = object({
40844
+ addonId: string(),
40845
+ kind: LlmProfileKindSchema,
40846
+ profileId: string().optional(),
40847
+ connection: LlmProviderConfigSchema.optional()
40848
+ });
40849
+ var LlmListModelsErrorCodeSchema = _enum([
40850
+ "auth",
40851
+ "network",
40852
+ "unsupported",
40853
+ "invalid"
40854
+ ]);
40855
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
40856
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
40857
+ ok: literal(true),
40858
+ models: array(LlmModelInfoSchema)
40859
+ }), object({
40860
+ ok: literal(false),
40861
+ code: LlmListModelsErrorCodeSchema,
40862
+ message: string()
40863
+ })]);
40752
40864
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
40753
40865
  var LlmDefaultSchema = object({
40754
40866
  selector: LlmDefaultSelectorSchema,
@@ -40848,7 +40960,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
40848
40960
  kind: "mutation",
40849
40961
  auth: "admin",
40850
40962
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40851
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
40963
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
40964
+ kind: "mutation",
40965
+ auth: "admin"
40966
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
40852
40967
  selector: LlmDefaultSelectorSchema,
40853
40968
  profileId: string().nullable()
40854
40969
  }), _void(), {
@@ -65849,26 +65964,6 @@ var ApiKeySummarySchema = object({
65849
65964
  createdAt: number(),
65850
65965
  lastUsedAt: number().optional()
65851
65966
  });
65852
- var ScopedTokenSummarySchema = object({
65853
- id: string(),
65854
- userId: string(),
65855
- name: string(),
65856
- tokenPrefix: string(),
65857
- scopes: array(TokenScopeSchema),
65858
- expiresAt: number().nullish(),
65859
- lastUsedAt: number().nullish(),
65860
- createdAt: number()
65861
- });
65862
- var CreateScopedTokenInputSchema = object({
65863
- userId: string(),
65864
- name: string(),
65865
- scopes: array(TokenScopeSchema),
65866
- expiresAt: number().optional()
65867
- });
65868
- var CreateScopedTokenResultSchema = object({
65869
- token: string(),
65870
- record: ScopedTokenSummarySchema
65871
- });
65872
65967
  var OauthSessionSummarySchema = object({
65873
65968
  id: string(),
65874
65969
  userId: string(),
@@ -65890,11 +65985,11 @@ var TotpStatusSchema = object({
65890
65985
  confirmedAt: number().nullable()
65891
65986
  });
65892
65987
  /**
65893
- * user-management — singleton capability for user accounts, API keys,
65894
- * and scoped tokens.
65988
+ * user-management — singleton capability for user accounts and the
65989
+ * legacy API-key rows.
65895
65990
  *
65896
65991
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
65897
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
65992
+ * — the subset check on `setUserScopes` is moot
65898
65993
  * because non-admins never reach these. If/when we open non-admin
65899
65994
  * delegation, structural caller-scope subset check goes inside the
65900
65995
  * provider.
@@ -65951,15 +66046,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
65951
66046
  kind: "mutation",
65952
66047
  auth: "admin",
65953
66048
  access: "delete"
65954
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
65955
- kind: "mutation",
65956
- auth: "admin",
65957
- access: "create"
65958
- }), method(object({ id: string() }), object({ success: literal(true) }), {
65959
- kind: "mutation",
65960
- auth: "admin",
65961
- access: "delete"
65962
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
66049
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
65963
66050
  kind: "mutation",
65964
66051
  auth: "admin",
65965
66052
  access: "create"
@@ -72064,7 +72151,7 @@ Object.freeze({
72064
72151
  capName: "llm",
72065
72152
  capScope: "system",
72066
72153
  addonId: null,
72067
- access: "view"
72154
+ access: "create"
72068
72155
  },
72069
72156
  "llm.listNodeModels": {
72070
72157
  capName: "llm",
@@ -76728,12 +76815,6 @@ Object.freeze({
76728
76815
  addonId: null,
76729
76816
  access: "create"
76730
76817
  },
76731
- "userManagement.createScopedToken": {
76732
- capName: "user-management",
76733
- capScope: "system",
76734
- addonId: null,
76735
- access: "create"
76736
- },
76737
76818
  "userManagement.createUser": {
76738
76819
  capName: "user-management",
76739
76820
  capScope: "system",
@@ -76782,12 +76863,6 @@ Object.freeze({
76782
76863
  addonId: null,
76783
76864
  access: "view"
76784
76865
  },
76785
- "userManagement.listScopedTokens": {
76786
- capName: "user-management",
76787
- capScope: "system",
76788
- addonId: null,
76789
- access: "view"
76790
- },
76791
76866
  "userManagement.listUsers": {
76792
76867
  capName: "user-management",
76793
76868
  capScope: "system",
@@ -76842,12 +76917,6 @@ Object.freeze({
76842
76917
  addonId: null,
76843
76918
  access: "delete"
76844
76919
  },
76845
- "userManagement.revokeScopedToken": {
76846
- capName: "user-management",
76847
- capScope: "system",
76848
- addonId: null,
76849
- access: "delete"
76850
- },
76851
76920
  "userManagement.setupTotp": {
76852
76921
  capName: "user-management",
76853
76922
  capScope: "system",
@@ -76878,12 +76947,6 @@ Object.freeze({
76878
76947
  addonId: null,
76879
76948
  access: "view"
76880
76949
  },
76881
- "userManagement.validateScopedToken": {
76882
- capName: "user-management",
76883
- capScope: "system",
76884
- addonId: null,
76885
- access: "view"
76886
- },
76887
76950
  "userManagement.verifyTotp": {
76888
76951
  capName: "user-management",
76889
76952
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -5443,7 +5443,7 @@ var ZodIssueCode = {
5443
5443
  var ZodFirstPartyTypeKind;
5444
5444
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5445
5445
  //#endregion
5446
- //#region ../types/dist/sleep-BxjU_fJM.mjs
5446
+ //#region ../types/dist/sleep-yKL5gfrH.mjs
5447
5447
  /**
5448
5448
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5449
5449
  * window to float samples (D455).
@@ -7830,9 +7830,9 @@ function normalizeAddonInitResult(result) {
7830
7830
  return result;
7831
7831
  }
7832
7832
  /**
7833
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7834
- * and validates them (`share-token.service.ts` builds its enum from this
7835
- * list); a data plane names the kinds it ACCEPTS in `share`.
7833
+ * The share-view scope kinds a share-link token can carry. The hub mints
7834
+ * and validates them (`ShareViewGrantSchema` builds its
7835
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7836
7836
  */
7837
7837
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7838
7838
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -13136,7 +13136,7 @@ var ConvertResultSchema = object({
13136
13136
  * `super_admin` — collapsed onto the single boolean because every
13137
13137
  * non-admin caller is governed by the same scope-check rules; the
13138
13138
  * distinction was only ever used to route role-specific procedures
13139
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
13139
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
13140
13140
  * with `isAdmin: false` + an explicit scope list.
13141
13141
  */
13142
13142
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -13325,10 +13325,12 @@ var AddonRoutesScopeSchema = object({
13325
13325
  type: literal("addon-routes"),
13326
13326
  access: array(MethodAccessSchema).min(1)
13327
13327
  });
13328
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
13328
13329
  var CredentialScopeSchema = union([
13329
13330
  literal("*"),
13330
13331
  ShareViewScopeSchema,
13331
13332
  AddonRoutesScopeSchema,
13333
+ PreferencesSelfScopeSchema,
13332
13334
  TokenScopeSchema
13333
13335
  ]);
13334
13336
  object({
@@ -13337,6 +13339,55 @@ object({
13337
13339
  jti: string().min(16),
13338
13340
  scopes: array(CredentialScopeSchema).min(1)
13339
13341
  });
13342
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
13343
+ /** A namespace's value: a JSON object, opaque to the hub. */
13344
+ var PreferenceValueSchema = record(string(), unknown());
13345
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
13346
+ /** A stored row, as the owner reads it. */
13347
+ var PreferenceRowSchema = object({
13348
+ namespace: PreferenceNamespaceSchema,
13349
+ value: PreferenceValueSchema,
13350
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
13351
+ revision: number().int().positive(),
13352
+ updatedAt: number().int(),
13353
+ /** The client id the last writer sent; `null` when it sent none. */
13354
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
13355
+ });
13356
+ object({
13357
+ /** Absent: every namespace the caller holds. */
13358
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
13359
+ object({ rows: array(PreferenceRowSchema) });
13360
+ object({
13361
+ namespace: PreferenceNamespaceSchema,
13362
+ value: PreferenceValueSchema,
13363
+ /**
13364
+ * The revision the edit was based on. Absent: last write wins. `0`: the
13365
+ * namespace must not exist yet. Any other value that is not the current
13366
+ * revision answers `conflict` and writes nothing.
13367
+ */
13368
+ baseRevision: number().int().nonnegative().optional(),
13369
+ deviceId: PreferenceDeviceIdSchema.optional()
13370
+ });
13371
+ discriminatedUnion("status", [object({
13372
+ status: literal("saved"),
13373
+ row: PreferenceRowSchema
13374
+ }), object({
13375
+ status: literal("conflict"),
13376
+ current: PreferenceRowSchema.nullable()
13377
+ })]);
13378
+ object({ namespace: PreferenceNamespaceSchema });
13379
+ object({
13380
+ /** `false` when the namespace did not exist. */
13381
+ deleted: boolean() });
13382
+ object({
13383
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
13384
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
13385
+ object({
13386
+ /** Every row whose revision differs from the client's, and every row it did not list. */
13387
+ rows: array(PreferenceRowSchema),
13388
+ /** Namespaces the client listed that no longer exist. */
13389
+ deleted: array(PreferenceNamespaceSchema)
13390
+ });
13340
13391
  _enum(["new-session", "step-up"]);
13341
13392
  /** The languages the hub's app landing pages are written in (D858). */
13342
13393
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -40645,38 +40696,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
40645
40696
  auth: "admin",
40646
40697
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40647
40698
  });
40699
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
40700
+ /** What a model (or, by default, every model of a kind) can do. */
40701
+ var LlmModelFeaturesSchema = object({
40702
+ vision: boolean(),
40703
+ tools: boolean(),
40704
+ streaming: boolean()
40705
+ });
40706
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
40707
+ var LlmModelInfoSchema = object({
40708
+ id: string(),
40709
+ label: string().optional(),
40710
+ contextLength: number().int().positive().optional(),
40711
+ features: LlmModelFeaturesSchema.partial().optional()
40712
+ });
40648
40713
  /**
40649
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
40650
- * methods concat-fan across providers; single-row methods route to ONE
40651
- * provider by the `addonId` in the call input (the notification-output
40652
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
40653
- * (hub-placed); the cap stays open for future providers.
40654
- *
40655
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
40656
- * `apiKey` is a password field — providers REDACT it on read and merge on
40657
- * write; a stored key NEVER round-trips to a client.
40714
+ * The provider-specific part of a profile, validated by the provider that owns
40715
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
40716
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
40717
+ * keychain, never in the row, and reads back as the redaction marker.
40658
40718
  */
40659
- var LlmProfileKindSchema = _enum([
40660
- "openai-compatible",
40661
- "openai",
40662
- "anthropic",
40663
- "google",
40664
- "managed-local",
40665
- "apple-foundation"
40666
- ]);
40719
+ var LlmProviderConfigSchema = record(string(), unknown());
40667
40720
  var LlmProfileSchema = object({
40668
40721
  id: string(),
40669
40722
  name: string(),
40723
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
40670
40724
  kind: LlmProfileKindSchema,
40671
40725
  /** Stamped by the provider — keeps the fanned catalog routable. */
40672
40726
  addonId: string(),
40673
40727
  enabled: boolean(),
40674
40728
  /** Vendor model id, or the managed runtime's loaded model. */
40675
40729
  model: string(),
40676
- /** Required for openai-compatible; override for cloud kinds. */
40677
- baseUrl: string().optional(),
40678
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
40679
- apiKey: string().optional(),
40680
40730
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
40681
40731
  * degraded to text — that shipped once and produced a confident answer to a
40682
40732
  * question about a picture nobody sent. */
@@ -40684,15 +40734,11 @@ var LlmProfileSchema = object({
40684
40734
  temperature: number().min(0).max(2).optional(),
40685
40735
  /** Nucleus sampling. Every wire we speak has it. */
40686
40736
  topP: number().min(0).max(1).optional(),
40687
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
40688
- * wire does, and the client drops it there (measured: the request body gets
40689
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
40690
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
40737
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
40738
+ * field in its editor only when its descriptor lists it in `profileFields`. */
40691
40739
  topK: number().int().positive().optional(),
40692
40740
  maxTokens: number().int().positive().optional(),
40693
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
40694
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
40695
- * the model with, so it is the one field that changes a PROCESS. */
40741
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
40696
40742
  contextLength: number().int().positive().optional(),
40697
40743
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
40698
40744
  * two system prompts fighting is worse than either alone). */
@@ -40718,16 +40764,37 @@ var LlmProfileSchema = object({
40718
40764
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
40719
40765
  * `true` here buys the wiring, not behaviour, until tools are registered. */
40720
40766
  toolsEnabled: boolean().default(false),
40721
- extraHeaders: record(string(), string()).optional(),
40722
- /** kind === 'managed-local' only (spec §4). */
40723
- runtime: ManagedRuntimeConfigSchema.optional(),
40724
- /**
40725
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
40726
- * to configure (no key, no URL, no download; `model` is `apple-system`).
40727
- * `supportsVision` on such a row is stamped by the provider from the node's
40728
- * reported `imageInput`, never taken from the operator (D62).
40729
- */
40730
- appleFoundation: object({ nodeId: string() }).optional()
40767
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
40768
+ providerConfig: LlmProviderConfigSchema.default({})
40769
+ });
40770
+ /**
40771
+ * The common profile fields a kind's editor offers. The editor owns how each
40772
+ * one is drawn; the provider says which of them mean something on its wire.
40773
+ */
40774
+ var LlmProfileFieldSchema = _enum([
40775
+ "temperature",
40776
+ "topP",
40777
+ "topK",
40778
+ "maxTokens",
40779
+ "contextLength",
40780
+ "systemPrompt",
40781
+ "timeoutMs",
40782
+ "connectTimeoutMs",
40783
+ "firstTokenTimeoutMs",
40784
+ "idleTimeoutMs",
40785
+ "retry",
40786
+ "toolsEnabled"
40787
+ ]);
40788
+ /**
40789
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
40790
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
40791
+ * picker: that widget owns the model choice.
40792
+ */
40793
+ var LlmProviderWidgetSchema = object({
40794
+ id: string(),
40795
+ placement: _enum(["connection", "model"]),
40796
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
40797
+ requires: array(string()).optional()
40731
40798
  });
40732
40799
  /** ConfigUISchema tree passed through untyped on the wire (the
40733
40800
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -40736,11 +40803,56 @@ var ConfigSchemaPassthrough$3 = unknown();
40736
40803
  var LlmProfileKindDescriptorSchema = object({
40737
40804
  kind: LlmProfileKindSchema,
40738
40805
  label: string(),
40806
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
40739
40807
  icon: string(),
40740
40808
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
40741
40809
  addonId: string(),
40742
- configSchema: ConfigSchemaPassthrough$3
40810
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
40811
+ connectionSchema: ConfigSchemaPassthrough$3,
40812
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
40813
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
40814
+ /** The kind's defaults; a model from `listModels` may override any of them. */
40815
+ features: LlmModelFeaturesSchema,
40816
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
40817
+ visionEditable: boolean(),
40818
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
40819
+ modelCatalog: _enum([
40820
+ "fetch",
40821
+ "static",
40822
+ "none"
40823
+ ]),
40824
+ staticModels: array(LlmModelInfoSchema).optional(),
40825
+ /** The common fields that mean something on this kind's wire. */
40826
+ profileFields: array(LlmProfileFieldSchema),
40827
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
40743
40828
  });
40829
+ /**
40830
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
40831
+ * (the editor's form); with `profileId` too, a secret the draft leaves
40832
+ * untouched (absent or the redaction marker) is resolved server-side from the
40833
+ * stored profile — the browser never receives it.
40834
+ */
40835
+ var LlmListModelsInputSchema = object({
40836
+ addonId: string(),
40837
+ kind: LlmProfileKindSchema,
40838
+ profileId: string().optional(),
40839
+ connection: LlmProviderConfigSchema.optional()
40840
+ });
40841
+ var LlmListModelsErrorCodeSchema = _enum([
40842
+ "auth",
40843
+ "network",
40844
+ "unsupported",
40845
+ "invalid"
40846
+ ]);
40847
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
40848
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
40849
+ ok: literal(true),
40850
+ models: array(LlmModelInfoSchema)
40851
+ }), object({
40852
+ ok: literal(false),
40853
+ code: LlmListModelsErrorCodeSchema,
40854
+ message: string()
40855
+ })]);
40744
40856
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
40745
40857
  var LlmDefaultSchema = object({
40746
40858
  selector: LlmDefaultSelectorSchema,
@@ -40840,7 +40952,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
40840
40952
  kind: "mutation",
40841
40953
  auth: "admin",
40842
40954
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40843
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
40955
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
40956
+ kind: "mutation",
40957
+ auth: "admin"
40958
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
40844
40959
  selector: LlmDefaultSelectorSchema,
40845
40960
  profileId: string().nullable()
40846
40961
  }), _void(), {
@@ -65841,26 +65956,6 @@ var ApiKeySummarySchema = object({
65841
65956
  createdAt: number(),
65842
65957
  lastUsedAt: number().optional()
65843
65958
  });
65844
- var ScopedTokenSummarySchema = object({
65845
- id: string(),
65846
- userId: string(),
65847
- name: string(),
65848
- tokenPrefix: string(),
65849
- scopes: array(TokenScopeSchema),
65850
- expiresAt: number().nullish(),
65851
- lastUsedAt: number().nullish(),
65852
- createdAt: number()
65853
- });
65854
- var CreateScopedTokenInputSchema = object({
65855
- userId: string(),
65856
- name: string(),
65857
- scopes: array(TokenScopeSchema),
65858
- expiresAt: number().optional()
65859
- });
65860
- var CreateScopedTokenResultSchema = object({
65861
- token: string(),
65862
- record: ScopedTokenSummarySchema
65863
- });
65864
65959
  var OauthSessionSummarySchema = object({
65865
65960
  id: string(),
65866
65961
  userId: string(),
@@ -65882,11 +65977,11 @@ var TotpStatusSchema = object({
65882
65977
  confirmedAt: number().nullable()
65883
65978
  });
65884
65979
  /**
65885
- * user-management — singleton capability for user accounts, API keys,
65886
- * and scoped tokens.
65980
+ * user-management — singleton capability for user accounts and the
65981
+ * legacy API-key rows.
65887
65982
  *
65888
65983
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
65889
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
65984
+ * — the subset check on `setUserScopes` is moot
65890
65985
  * because non-admins never reach these. If/when we open non-admin
65891
65986
  * delegation, structural caller-scope subset check goes inside the
65892
65987
  * provider.
@@ -65943,15 +66038,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
65943
66038
  kind: "mutation",
65944
66039
  auth: "admin",
65945
66040
  access: "delete"
65946
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
65947
- kind: "mutation",
65948
- auth: "admin",
65949
- access: "create"
65950
- }), method(object({ id: string() }), object({ success: literal(true) }), {
65951
- kind: "mutation",
65952
- auth: "admin",
65953
- access: "delete"
65954
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
66041
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
65955
66042
  kind: "mutation",
65956
66043
  auth: "admin",
65957
66044
  access: "create"
@@ -72056,7 +72143,7 @@ Object.freeze({
72056
72143
  capName: "llm",
72057
72144
  capScope: "system",
72058
72145
  addonId: null,
72059
- access: "view"
72146
+ access: "create"
72060
72147
  },
72061
72148
  "llm.listNodeModels": {
72062
72149
  capName: "llm",
@@ -76720,12 +76807,6 @@ Object.freeze({
76720
76807
  addonId: null,
76721
76808
  access: "create"
76722
76809
  },
76723
- "userManagement.createScopedToken": {
76724
- capName: "user-management",
76725
- capScope: "system",
76726
- addonId: null,
76727
- access: "create"
76728
- },
76729
76810
  "userManagement.createUser": {
76730
76811
  capName: "user-management",
76731
76812
  capScope: "system",
@@ -76774,12 +76855,6 @@ Object.freeze({
76774
76855
  addonId: null,
76775
76856
  access: "view"
76776
76857
  },
76777
- "userManagement.listScopedTokens": {
76778
- capName: "user-management",
76779
- capScope: "system",
76780
- addonId: null,
76781
- access: "view"
76782
- },
76783
76858
  "userManagement.listUsers": {
76784
76859
  capName: "user-management",
76785
76860
  capScope: "system",
@@ -76834,12 +76909,6 @@ Object.freeze({
76834
76909
  addonId: null,
76835
76910
  access: "delete"
76836
76911
  },
76837
- "userManagement.revokeScopedToken": {
76838
- capName: "user-management",
76839
- capScope: "system",
76840
- addonId: null,
76841
- access: "delete"
76842
- },
76843
76912
  "userManagement.setupTotp": {
76844
76913
  capName: "user-management",
76845
76914
  capScope: "system",
@@ -76870,12 +76939,6 @@ Object.freeze({
76870
76939
  addonId: null,
76871
76940
  access: "view"
76872
76941
  },
76873
- "userManagement.validateScopedToken": {
76874
- capName: "user-management",
76875
- capScope: "system",
76876
- addonId: null,
76877
- access: "view"
76878
- },
76879
76942
  "userManagement.verifyTotp": {
76880
76943
  capName: "user-management",
76881
76944
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-reolink",
3
- "version": "1.2.191",
3
+ "version": "1.2.192",
4
4
  "description": "Reolink camera device provider addon for CamStack — native Baichuan protocol",
5
5
  "keywords": [
6
6
  "camstack",