@camstack/addon-waste-collections 0.1.11 → 0.1.12

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.
@@ -5554,7 +5554,7 @@ var ZodIssueCode = {
5554
5554
  var ZodFirstPartyTypeKind;
5555
5555
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5556
5556
  //#endregion
5557
- //#region ../types/dist/sleep-BxjU_fJM.mjs
5557
+ //#region ../types/dist/sleep-yKL5gfrH.mjs
5558
5558
  /**
5559
5559
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5560
5560
  * window to float samples (D455).
@@ -7947,9 +7947,9 @@ function normalizeAddonInitResult(result) {
7947
7947
  return result;
7948
7948
  }
7949
7949
  /**
7950
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7951
- * and validates them (`share-token.service.ts` builds its enum from this
7952
- * list); a data plane names the kinds it ACCEPTS in `share`.
7950
+ * The share-view scope kinds a share-link token can carry. The hub mints
7951
+ * and validates them (`ShareViewGrantSchema` builds its
7952
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7953
7953
  */
7954
7954
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7955
7955
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -12846,7 +12846,7 @@ var ConvertResultSchema = object({
12846
12846
  * `super_admin` — collapsed onto the single boolean because every
12847
12847
  * non-admin caller is governed by the same scope-check rules; the
12848
12848
  * distinction was only ever used to route role-specific procedures
12849
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12849
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
12850
12850
  * with `isAdmin: false` + an explicit scope list.
12851
12851
  */
12852
12852
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -13035,10 +13035,12 @@ var AddonRoutesScopeSchema = object({
13035
13035
  type: literal("addon-routes"),
13036
13036
  access: array(MethodAccessSchema).min(1)
13037
13037
  });
13038
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
13038
13039
  var CredentialScopeSchema = union([
13039
13040
  literal("*"),
13040
13041
  ShareViewScopeSchema,
13041
13042
  AddonRoutesScopeSchema,
13043
+ PreferencesSelfScopeSchema,
13042
13044
  TokenScopeSchema
13043
13045
  ]);
13044
13046
  object({
@@ -13047,6 +13049,55 @@ object({
13047
13049
  jti: string().min(16),
13048
13050
  scopes: array(CredentialScopeSchema).min(1)
13049
13051
  });
13052
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
13053
+ /** A namespace's value: a JSON object, opaque to the hub. */
13054
+ var PreferenceValueSchema = record(string(), unknown());
13055
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
13056
+ /** A stored row, as the owner reads it. */
13057
+ var PreferenceRowSchema = object({
13058
+ namespace: PreferenceNamespaceSchema,
13059
+ value: PreferenceValueSchema,
13060
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
13061
+ revision: number().int().positive(),
13062
+ updatedAt: number().int(),
13063
+ /** The client id the last writer sent; `null` when it sent none. */
13064
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
13065
+ });
13066
+ object({
13067
+ /** Absent: every namespace the caller holds. */
13068
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
13069
+ object({ rows: array(PreferenceRowSchema) });
13070
+ object({
13071
+ namespace: PreferenceNamespaceSchema,
13072
+ value: PreferenceValueSchema,
13073
+ /**
13074
+ * The revision the edit was based on. Absent: last write wins. `0`: the
13075
+ * namespace must not exist yet. Any other value that is not the current
13076
+ * revision answers `conflict` and writes nothing.
13077
+ */
13078
+ baseRevision: number().int().nonnegative().optional(),
13079
+ deviceId: PreferenceDeviceIdSchema.optional()
13080
+ });
13081
+ discriminatedUnion("status", [object({
13082
+ status: literal("saved"),
13083
+ row: PreferenceRowSchema
13084
+ }), object({
13085
+ status: literal("conflict"),
13086
+ current: PreferenceRowSchema.nullable()
13087
+ })]);
13088
+ object({ namespace: PreferenceNamespaceSchema });
13089
+ object({
13090
+ /** `false` when the namespace did not exist. */
13091
+ deleted: boolean() });
13092
+ object({
13093
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
13094
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
13095
+ object({
13096
+ /** Every row whose revision differs from the client's, and every row it did not list. */
13097
+ rows: array(PreferenceRowSchema),
13098
+ /** Namespaces the client listed that no longer exist. */
13099
+ deleted: array(PreferenceNamespaceSchema)
13100
+ });
13050
13101
  _enum(["new-session", "step-up"]);
13051
13102
  /** The languages the hub's app landing pages are written in (D858). */
13052
13103
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -39925,38 +39976,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
39925
39976
  auth: "admin",
39926
39977
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
39927
39978
  });
39979
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
39980
+ /** What a model (or, by default, every model of a kind) can do. */
39981
+ var LlmModelFeaturesSchema = object({
39982
+ vision: boolean(),
39983
+ tools: boolean(),
39984
+ streaming: boolean()
39985
+ });
39986
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
39987
+ var LlmModelInfoSchema = object({
39988
+ id: string(),
39989
+ label: string().optional(),
39990
+ contextLength: number().int().positive().optional(),
39991
+ features: LlmModelFeaturesSchema.partial().optional()
39992
+ });
39928
39993
  /**
39929
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
39930
- * methods concat-fan across providers; single-row methods route to ONE
39931
- * provider by the `addonId` in the call input (the notification-output
39932
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
39933
- * (hub-placed); the cap stays open for future providers.
39934
- *
39935
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
39936
- * `apiKey` is a password field — providers REDACT it on read and merge on
39937
- * write; a stored key NEVER round-trips to a client.
39994
+ * The provider-specific part of a profile, validated by the provider that owns
39995
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
39996
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
39997
+ * keychain, never in the row, and reads back as the redaction marker.
39938
39998
  */
39939
- var LlmProfileKindSchema = _enum([
39940
- "openai-compatible",
39941
- "openai",
39942
- "anthropic",
39943
- "google",
39944
- "managed-local",
39945
- "apple-foundation"
39946
- ]);
39999
+ var LlmProviderConfigSchema = record(string(), unknown());
39947
40000
  var LlmProfileSchema = object({
39948
40001
  id: string(),
39949
40002
  name: string(),
40003
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
39950
40004
  kind: LlmProfileKindSchema,
39951
40005
  /** Stamped by the provider — keeps the fanned catalog routable. */
39952
40006
  addonId: string(),
39953
40007
  enabled: boolean(),
39954
40008
  /** Vendor model id, or the managed runtime's loaded model. */
39955
40009
  model: string(),
39956
- /** Required for openai-compatible; override for cloud kinds. */
39957
- baseUrl: string().optional(),
39958
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
39959
- apiKey: string().optional(),
39960
40010
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
39961
40011
  * degraded to text — that shipped once and produced a confident answer to a
39962
40012
  * question about a picture nobody sent. */
@@ -39964,15 +40014,11 @@ var LlmProfileSchema = object({
39964
40014
  temperature: number().min(0).max(2).optional(),
39965
40015
  /** Nucleus sampling. Every wire we speak has it. */
39966
40016
  topP: number().min(0).max(1).optional(),
39967
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
39968
- * wire does, and the client drops it there (measured: the request body gets
39969
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
39970
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
40017
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
40018
+ * field in its editor only when its descriptor lists it in `profileFields`. */
39971
40019
  topK: number().int().positive().optional(),
39972
40020
  maxTokens: number().int().positive().optional(),
39973
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
39974
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
39975
- * the model with, so it is the one field that changes a PROCESS. */
40021
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
39976
40022
  contextLength: number().int().positive().optional(),
39977
40023
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
39978
40024
  * two system prompts fighting is worse than either alone). */
@@ -39998,16 +40044,37 @@ var LlmProfileSchema = object({
39998
40044
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
39999
40045
  * `true` here buys the wiring, not behaviour, until tools are registered. */
40000
40046
  toolsEnabled: boolean().default(false),
40001
- extraHeaders: record(string(), string()).optional(),
40002
- /** kind === 'managed-local' only (spec §4). */
40003
- runtime: ManagedRuntimeConfigSchema.optional(),
40004
- /**
40005
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
40006
- * to configure (no key, no URL, no download; `model` is `apple-system`).
40007
- * `supportsVision` on such a row is stamped by the provider from the node's
40008
- * reported `imageInput`, never taken from the operator (D62).
40009
- */
40010
- appleFoundation: object({ nodeId: string() }).optional()
40047
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
40048
+ providerConfig: LlmProviderConfigSchema.default({})
40049
+ });
40050
+ /**
40051
+ * The common profile fields a kind's editor offers. The editor owns how each
40052
+ * one is drawn; the provider says which of them mean something on its wire.
40053
+ */
40054
+ var LlmProfileFieldSchema = _enum([
40055
+ "temperature",
40056
+ "topP",
40057
+ "topK",
40058
+ "maxTokens",
40059
+ "contextLength",
40060
+ "systemPrompt",
40061
+ "timeoutMs",
40062
+ "connectTimeoutMs",
40063
+ "firstTokenTimeoutMs",
40064
+ "idleTimeoutMs",
40065
+ "retry",
40066
+ "toolsEnabled"
40067
+ ]);
40068
+ /**
40069
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
40070
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
40071
+ * picker: that widget owns the model choice.
40072
+ */
40073
+ var LlmProviderWidgetSchema = object({
40074
+ id: string(),
40075
+ placement: _enum(["connection", "model"]),
40076
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
40077
+ requires: array(string()).optional()
40011
40078
  });
40012
40079
  /** ConfigUISchema tree passed through untyped on the wire (the
40013
40080
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -40016,11 +40083,56 @@ var ConfigSchemaPassthrough$3 = unknown();
40016
40083
  var LlmProfileKindDescriptorSchema = object({
40017
40084
  kind: LlmProfileKindSchema,
40018
40085
  label: string(),
40086
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
40019
40087
  icon: string(),
40020
40088
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
40021
40089
  addonId: string(),
40022
- configSchema: ConfigSchemaPassthrough$3
40090
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
40091
+ connectionSchema: ConfigSchemaPassthrough$3,
40092
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
40093
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
40094
+ /** The kind's defaults; a model from `listModels` may override any of them. */
40095
+ features: LlmModelFeaturesSchema,
40096
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
40097
+ visionEditable: boolean(),
40098
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
40099
+ modelCatalog: _enum([
40100
+ "fetch",
40101
+ "static",
40102
+ "none"
40103
+ ]),
40104
+ staticModels: array(LlmModelInfoSchema).optional(),
40105
+ /** The common fields that mean something on this kind's wire. */
40106
+ profileFields: array(LlmProfileFieldSchema),
40107
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
40023
40108
  });
40109
+ /**
40110
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
40111
+ * (the editor's form); with `profileId` too, a secret the draft leaves
40112
+ * untouched (absent or the redaction marker) is resolved server-side from the
40113
+ * stored profile — the browser never receives it.
40114
+ */
40115
+ var LlmListModelsInputSchema = object({
40116
+ addonId: string(),
40117
+ kind: LlmProfileKindSchema,
40118
+ profileId: string().optional(),
40119
+ connection: LlmProviderConfigSchema.optional()
40120
+ });
40121
+ var LlmListModelsErrorCodeSchema = _enum([
40122
+ "auth",
40123
+ "network",
40124
+ "unsupported",
40125
+ "invalid"
40126
+ ]);
40127
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
40128
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
40129
+ ok: literal(true),
40130
+ models: array(LlmModelInfoSchema)
40131
+ }), object({
40132
+ ok: literal(false),
40133
+ code: LlmListModelsErrorCodeSchema,
40134
+ message: string()
40135
+ })]);
40024
40136
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
40025
40137
  var LlmDefaultSchema = object({
40026
40138
  selector: LlmDefaultSelectorSchema,
@@ -40120,7 +40232,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
40120
40232
  kind: "mutation",
40121
40233
  auth: "admin",
40122
40234
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40123
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
40235
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
40236
+ kind: "mutation",
40237
+ auth: "admin"
40238
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
40124
40239
  selector: LlmDefaultSelectorSchema,
40125
40240
  profileId: string().nullable()
40126
40241
  }), _void(), {
@@ -61125,26 +61240,6 @@ var ApiKeySummarySchema = object({
61125
61240
  createdAt: number(),
61126
61241
  lastUsedAt: number().optional()
61127
61242
  });
61128
- var ScopedTokenSummarySchema = object({
61129
- id: string(),
61130
- userId: string(),
61131
- name: string(),
61132
- tokenPrefix: string(),
61133
- scopes: array(TokenScopeSchema),
61134
- expiresAt: number().nullish(),
61135
- lastUsedAt: number().nullish(),
61136
- createdAt: number()
61137
- });
61138
- var CreateScopedTokenInputSchema = object({
61139
- userId: string(),
61140
- name: string(),
61141
- scopes: array(TokenScopeSchema),
61142
- expiresAt: number().optional()
61143
- });
61144
- var CreateScopedTokenResultSchema = object({
61145
- token: string(),
61146
- record: ScopedTokenSummarySchema
61147
- });
61148
61243
  var OauthSessionSummarySchema = object({
61149
61244
  id: string(),
61150
61245
  userId: string(),
@@ -61166,11 +61261,11 @@ var TotpStatusSchema = object({
61166
61261
  confirmedAt: number().nullable()
61167
61262
  });
61168
61263
  /**
61169
- * user-management — singleton capability for user accounts, API keys,
61170
- * and scoped tokens.
61264
+ * user-management — singleton capability for user accounts and the
61265
+ * legacy API-key rows.
61171
61266
  *
61172
61267
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
61173
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
61268
+ * — the subset check on `setUserScopes` is moot
61174
61269
  * because non-admins never reach these. If/when we open non-admin
61175
61270
  * delegation, structural caller-scope subset check goes inside the
61176
61271
  * provider.
@@ -61227,15 +61322,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
61227
61322
  kind: "mutation",
61228
61323
  auth: "admin",
61229
61324
  access: "delete"
61230
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
61231
- kind: "mutation",
61232
- auth: "admin",
61233
- access: "create"
61234
- }), method(object({ id: string() }), object({ success: literal(true) }), {
61235
- kind: "mutation",
61236
- auth: "admin",
61237
- access: "delete"
61238
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
61325
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
61239
61326
  kind: "mutation",
61240
61327
  auth: "admin",
61241
61328
  access: "create"
@@ -65391,7 +65478,7 @@ Object.freeze({
65391
65478
  capName: "llm",
65392
65479
  capScope: "system",
65393
65480
  addonId: null,
65394
- access: "view"
65481
+ access: "create"
65395
65482
  },
65396
65483
  "llm.listNodeModels": {
65397
65484
  capName: "llm",
@@ -70055,12 +70142,6 @@ Object.freeze({
70055
70142
  addonId: null,
70056
70143
  access: "create"
70057
70144
  },
70058
- "userManagement.createScopedToken": {
70059
- capName: "user-management",
70060
- capScope: "system",
70061
- addonId: null,
70062
- access: "create"
70063
- },
70064
70145
  "userManagement.createUser": {
70065
70146
  capName: "user-management",
70066
70147
  capScope: "system",
@@ -70109,12 +70190,6 @@ Object.freeze({
70109
70190
  addonId: null,
70110
70191
  access: "view"
70111
70192
  },
70112
- "userManagement.listScopedTokens": {
70113
- capName: "user-management",
70114
- capScope: "system",
70115
- addonId: null,
70116
- access: "view"
70117
- },
70118
70193
  "userManagement.listUsers": {
70119
70194
  capName: "user-management",
70120
70195
  capScope: "system",
@@ -70169,12 +70244,6 @@ Object.freeze({
70169
70244
  addonId: null,
70170
70245
  access: "delete"
70171
70246
  },
70172
- "userManagement.revokeScopedToken": {
70173
- capName: "user-management",
70174
- capScope: "system",
70175
- addonId: null,
70176
- access: "delete"
70177
- },
70178
70247
  "userManagement.setupTotp": {
70179
70248
  capName: "user-management",
70180
70249
  capScope: "system",
@@ -70205,12 +70274,6 @@ Object.freeze({
70205
70274
  addonId: null,
70206
70275
  access: "view"
70207
70276
  },
70208
- "userManagement.validateScopedToken": {
70209
- capName: "user-management",
70210
- capScope: "system",
70211
- addonId: null,
70212
- access: "view"
70213
- },
70214
70277
  "userManagement.verifyTotp": {
70215
70278
  capName: "user-management",
70216
70279
  capScope: "system",
@@ -5550,7 +5550,7 @@ var ZodIssueCode = {
5550
5550
  var ZodFirstPartyTypeKind;
5551
5551
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5552
5552
  //#endregion
5553
- //#region ../types/dist/sleep-BxjU_fJM.mjs
5553
+ //#region ../types/dist/sleep-yKL5gfrH.mjs
5554
5554
  /**
5555
5555
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5556
5556
  * window to float samples (D455).
@@ -7943,9 +7943,9 @@ function normalizeAddonInitResult(result) {
7943
7943
  return result;
7944
7944
  }
7945
7945
  /**
7946
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7947
- * and validates them (`share-token.service.ts` builds its enum from this
7948
- * list); a data plane names the kinds it ACCEPTS in `share`.
7946
+ * The share-view scope kinds a share-link token can carry. The hub mints
7947
+ * and validates them (`ShareViewGrantSchema` builds its
7948
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7949
7949
  */
7950
7950
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7951
7951
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -12842,7 +12842,7 @@ var ConvertResultSchema = object({
12842
12842
  * `super_admin` — collapsed onto the single boolean because every
12843
12843
  * non-admin caller is governed by the same scope-check rules; the
12844
12844
  * distinction was only ever used to route role-specific procedures
12845
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12845
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
12846
12846
  * with `isAdmin: false` + an explicit scope list.
12847
12847
  */
12848
12848
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -13031,10 +13031,12 @@ var AddonRoutesScopeSchema = object({
13031
13031
  type: literal("addon-routes"),
13032
13032
  access: array(MethodAccessSchema).min(1)
13033
13033
  });
13034
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
13034
13035
  var CredentialScopeSchema = union([
13035
13036
  literal("*"),
13036
13037
  ShareViewScopeSchema,
13037
13038
  AddonRoutesScopeSchema,
13039
+ PreferencesSelfScopeSchema,
13038
13040
  TokenScopeSchema
13039
13041
  ]);
13040
13042
  object({
@@ -13043,6 +13045,55 @@ object({
13043
13045
  jti: string().min(16),
13044
13046
  scopes: array(CredentialScopeSchema).min(1)
13045
13047
  });
13048
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
13049
+ /** A namespace's value: a JSON object, opaque to the hub. */
13050
+ var PreferenceValueSchema = record(string(), unknown());
13051
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
13052
+ /** A stored row, as the owner reads it. */
13053
+ var PreferenceRowSchema = object({
13054
+ namespace: PreferenceNamespaceSchema,
13055
+ value: PreferenceValueSchema,
13056
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
13057
+ revision: number().int().positive(),
13058
+ updatedAt: number().int(),
13059
+ /** The client id the last writer sent; `null` when it sent none. */
13060
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
13061
+ });
13062
+ object({
13063
+ /** Absent: every namespace the caller holds. */
13064
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
13065
+ object({ rows: array(PreferenceRowSchema) });
13066
+ object({
13067
+ namespace: PreferenceNamespaceSchema,
13068
+ value: PreferenceValueSchema,
13069
+ /**
13070
+ * The revision the edit was based on. Absent: last write wins. `0`: the
13071
+ * namespace must not exist yet. Any other value that is not the current
13072
+ * revision answers `conflict` and writes nothing.
13073
+ */
13074
+ baseRevision: number().int().nonnegative().optional(),
13075
+ deviceId: PreferenceDeviceIdSchema.optional()
13076
+ });
13077
+ discriminatedUnion("status", [object({
13078
+ status: literal("saved"),
13079
+ row: PreferenceRowSchema
13080
+ }), object({
13081
+ status: literal("conflict"),
13082
+ current: PreferenceRowSchema.nullable()
13083
+ })]);
13084
+ object({ namespace: PreferenceNamespaceSchema });
13085
+ object({
13086
+ /** `false` when the namespace did not exist. */
13087
+ deleted: boolean() });
13088
+ object({
13089
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
13090
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
13091
+ object({
13092
+ /** Every row whose revision differs from the client's, and every row it did not list. */
13093
+ rows: array(PreferenceRowSchema),
13094
+ /** Namespaces the client listed that no longer exist. */
13095
+ deleted: array(PreferenceNamespaceSchema)
13096
+ });
13046
13097
  _enum(["new-session", "step-up"]);
13047
13098
  /** The languages the hub's app landing pages are written in (D858). */
13048
13099
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -39921,38 +39972,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
39921
39972
  auth: "admin",
39922
39973
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
39923
39974
  });
39975
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
39976
+ /** What a model (or, by default, every model of a kind) can do. */
39977
+ var LlmModelFeaturesSchema = object({
39978
+ vision: boolean(),
39979
+ tools: boolean(),
39980
+ streaming: boolean()
39981
+ });
39982
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
39983
+ var LlmModelInfoSchema = object({
39984
+ id: string(),
39985
+ label: string().optional(),
39986
+ contextLength: number().int().positive().optional(),
39987
+ features: LlmModelFeaturesSchema.partial().optional()
39988
+ });
39924
39989
  /**
39925
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
39926
- * methods concat-fan across providers; single-row methods route to ONE
39927
- * provider by the `addonId` in the call input (the notification-output
39928
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
39929
- * (hub-placed); the cap stays open for future providers.
39930
- *
39931
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
39932
- * `apiKey` is a password field — providers REDACT it on read and merge on
39933
- * write; a stored key NEVER round-trips to a client.
39990
+ * The provider-specific part of a profile, validated by the provider that owns
39991
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
39992
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
39993
+ * keychain, never in the row, and reads back as the redaction marker.
39934
39994
  */
39935
- var LlmProfileKindSchema = _enum([
39936
- "openai-compatible",
39937
- "openai",
39938
- "anthropic",
39939
- "google",
39940
- "managed-local",
39941
- "apple-foundation"
39942
- ]);
39995
+ var LlmProviderConfigSchema = record(string(), unknown());
39943
39996
  var LlmProfileSchema = object({
39944
39997
  id: string(),
39945
39998
  name: string(),
39999
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
39946
40000
  kind: LlmProfileKindSchema,
39947
40001
  /** Stamped by the provider — keeps the fanned catalog routable. */
39948
40002
  addonId: string(),
39949
40003
  enabled: boolean(),
39950
40004
  /** Vendor model id, or the managed runtime's loaded model. */
39951
40005
  model: string(),
39952
- /** Required for openai-compatible; override for cloud kinds. */
39953
- baseUrl: string().optional(),
39954
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
39955
- apiKey: string().optional(),
39956
40006
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
39957
40007
  * degraded to text — that shipped once and produced a confident answer to a
39958
40008
  * question about a picture nobody sent. */
@@ -39960,15 +40010,11 @@ var LlmProfileSchema = object({
39960
40010
  temperature: number().min(0).max(2).optional(),
39961
40011
  /** Nucleus sampling. Every wire we speak has it. */
39962
40012
  topP: number().min(0).max(1).optional(),
39963
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
39964
- * wire does, and the client drops it there (measured: the request body gets
39965
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
39966
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
40013
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
40014
+ * field in its editor only when its descriptor lists it in `profileFields`. */
39967
40015
  topK: number().int().positive().optional(),
39968
40016
  maxTokens: number().int().positive().optional(),
39969
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
39970
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
39971
- * the model with, so it is the one field that changes a PROCESS. */
40017
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
39972
40018
  contextLength: number().int().positive().optional(),
39973
40019
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
39974
40020
  * two system prompts fighting is worse than either alone). */
@@ -39994,16 +40040,37 @@ var LlmProfileSchema = object({
39994
40040
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
39995
40041
  * `true` here buys the wiring, not behaviour, until tools are registered. */
39996
40042
  toolsEnabled: boolean().default(false),
39997
- extraHeaders: record(string(), string()).optional(),
39998
- /** kind === 'managed-local' only (spec §4). */
39999
- runtime: ManagedRuntimeConfigSchema.optional(),
40000
- /**
40001
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
40002
- * to configure (no key, no URL, no download; `model` is `apple-system`).
40003
- * `supportsVision` on such a row is stamped by the provider from the node's
40004
- * reported `imageInput`, never taken from the operator (D62).
40005
- */
40006
- appleFoundation: object({ nodeId: string() }).optional()
40043
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
40044
+ providerConfig: LlmProviderConfigSchema.default({})
40045
+ });
40046
+ /**
40047
+ * The common profile fields a kind's editor offers. The editor owns how each
40048
+ * one is drawn; the provider says which of them mean something on its wire.
40049
+ */
40050
+ var LlmProfileFieldSchema = _enum([
40051
+ "temperature",
40052
+ "topP",
40053
+ "topK",
40054
+ "maxTokens",
40055
+ "contextLength",
40056
+ "systemPrompt",
40057
+ "timeoutMs",
40058
+ "connectTimeoutMs",
40059
+ "firstTokenTimeoutMs",
40060
+ "idleTimeoutMs",
40061
+ "retry",
40062
+ "toolsEnabled"
40063
+ ]);
40064
+ /**
40065
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
40066
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
40067
+ * picker: that widget owns the model choice.
40068
+ */
40069
+ var LlmProviderWidgetSchema = object({
40070
+ id: string(),
40071
+ placement: _enum(["connection", "model"]),
40072
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
40073
+ requires: array(string()).optional()
40007
40074
  });
40008
40075
  /** ConfigUISchema tree passed through untyped on the wire (the
40009
40076
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -40012,11 +40079,56 @@ var ConfigSchemaPassthrough$3 = unknown();
40012
40079
  var LlmProfileKindDescriptorSchema = object({
40013
40080
  kind: LlmProfileKindSchema,
40014
40081
  label: string(),
40082
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
40015
40083
  icon: string(),
40016
40084
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
40017
40085
  addonId: string(),
40018
- configSchema: ConfigSchemaPassthrough$3
40086
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
40087
+ connectionSchema: ConfigSchemaPassthrough$3,
40088
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
40089
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
40090
+ /** The kind's defaults; a model from `listModels` may override any of them. */
40091
+ features: LlmModelFeaturesSchema,
40092
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
40093
+ visionEditable: boolean(),
40094
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
40095
+ modelCatalog: _enum([
40096
+ "fetch",
40097
+ "static",
40098
+ "none"
40099
+ ]),
40100
+ staticModels: array(LlmModelInfoSchema).optional(),
40101
+ /** The common fields that mean something on this kind's wire. */
40102
+ profileFields: array(LlmProfileFieldSchema),
40103
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
40019
40104
  });
40105
+ /**
40106
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
40107
+ * (the editor's form); with `profileId` too, a secret the draft leaves
40108
+ * untouched (absent or the redaction marker) is resolved server-side from the
40109
+ * stored profile — the browser never receives it.
40110
+ */
40111
+ var LlmListModelsInputSchema = object({
40112
+ addonId: string(),
40113
+ kind: LlmProfileKindSchema,
40114
+ profileId: string().optional(),
40115
+ connection: LlmProviderConfigSchema.optional()
40116
+ });
40117
+ var LlmListModelsErrorCodeSchema = _enum([
40118
+ "auth",
40119
+ "network",
40120
+ "unsupported",
40121
+ "invalid"
40122
+ ]);
40123
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
40124
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
40125
+ ok: literal(true),
40126
+ models: array(LlmModelInfoSchema)
40127
+ }), object({
40128
+ ok: literal(false),
40129
+ code: LlmListModelsErrorCodeSchema,
40130
+ message: string()
40131
+ })]);
40020
40132
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
40021
40133
  var LlmDefaultSchema = object({
40022
40134
  selector: LlmDefaultSelectorSchema,
@@ -40116,7 +40228,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
40116
40228
  kind: "mutation",
40117
40229
  auth: "admin",
40118
40230
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40119
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
40231
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
40232
+ kind: "mutation",
40233
+ auth: "admin"
40234
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
40120
40235
  selector: LlmDefaultSelectorSchema,
40121
40236
  profileId: string().nullable()
40122
40237
  }), _void(), {
@@ -61121,26 +61236,6 @@ var ApiKeySummarySchema = object({
61121
61236
  createdAt: number(),
61122
61237
  lastUsedAt: number().optional()
61123
61238
  });
61124
- var ScopedTokenSummarySchema = object({
61125
- id: string(),
61126
- userId: string(),
61127
- name: string(),
61128
- tokenPrefix: string(),
61129
- scopes: array(TokenScopeSchema),
61130
- expiresAt: number().nullish(),
61131
- lastUsedAt: number().nullish(),
61132
- createdAt: number()
61133
- });
61134
- var CreateScopedTokenInputSchema = object({
61135
- userId: string(),
61136
- name: string(),
61137
- scopes: array(TokenScopeSchema),
61138
- expiresAt: number().optional()
61139
- });
61140
- var CreateScopedTokenResultSchema = object({
61141
- token: string(),
61142
- record: ScopedTokenSummarySchema
61143
- });
61144
61239
  var OauthSessionSummarySchema = object({
61145
61240
  id: string(),
61146
61241
  userId: string(),
@@ -61162,11 +61257,11 @@ var TotpStatusSchema = object({
61162
61257
  confirmedAt: number().nullable()
61163
61258
  });
61164
61259
  /**
61165
- * user-management — singleton capability for user accounts, API keys,
61166
- * and scoped tokens.
61260
+ * user-management — singleton capability for user accounts and the
61261
+ * legacy API-key rows.
61167
61262
  *
61168
61263
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
61169
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
61264
+ * — the subset check on `setUserScopes` is moot
61170
61265
  * because non-admins never reach these. If/when we open non-admin
61171
61266
  * delegation, structural caller-scope subset check goes inside the
61172
61267
  * provider.
@@ -61223,15 +61318,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
61223
61318
  kind: "mutation",
61224
61319
  auth: "admin",
61225
61320
  access: "delete"
61226
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
61227
- kind: "mutation",
61228
- auth: "admin",
61229
- access: "create"
61230
- }), method(object({ id: string() }), object({ success: literal(true) }), {
61231
- kind: "mutation",
61232
- auth: "admin",
61233
- access: "delete"
61234
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
61321
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
61235
61322
  kind: "mutation",
61236
61323
  auth: "admin",
61237
61324
  access: "create"
@@ -65387,7 +65474,7 @@ Object.freeze({
65387
65474
  capName: "llm",
65388
65475
  capScope: "system",
65389
65476
  addonId: null,
65390
- access: "view"
65477
+ access: "create"
65391
65478
  },
65392
65479
  "llm.listNodeModels": {
65393
65480
  capName: "llm",
@@ -70051,12 +70138,6 @@ Object.freeze({
70051
70138
  addonId: null,
70052
70139
  access: "create"
70053
70140
  },
70054
- "userManagement.createScopedToken": {
70055
- capName: "user-management",
70056
- capScope: "system",
70057
- addonId: null,
70058
- access: "create"
70059
- },
70060
70141
  "userManagement.createUser": {
70061
70142
  capName: "user-management",
70062
70143
  capScope: "system",
@@ -70105,12 +70186,6 @@ Object.freeze({
70105
70186
  addonId: null,
70106
70187
  access: "view"
70107
70188
  },
70108
- "userManagement.listScopedTokens": {
70109
- capName: "user-management",
70110
- capScope: "system",
70111
- addonId: null,
70112
- access: "view"
70113
- },
70114
70189
  "userManagement.listUsers": {
70115
70190
  capName: "user-management",
70116
70191
  capScope: "system",
@@ -70165,12 +70240,6 @@ Object.freeze({
70165
70240
  addonId: null,
70166
70241
  access: "delete"
70167
70242
  },
70168
- "userManagement.revokeScopedToken": {
70169
- capName: "user-management",
70170
- capScope: "system",
70171
- addonId: null,
70172
- access: "delete"
70173
- },
70174
70243
  "userManagement.setupTotp": {
70175
70244
  capName: "user-management",
70176
70245
  capScope: "system",
@@ -70201,12 +70270,6 @@ Object.freeze({
70201
70270
  addonId: null,
70202
70271
  access: "view"
70203
70272
  },
70204
- "userManagement.validateScopedToken": {
70205
- capName: "user-management",
70206
- capScope: "system",
70207
- addonId: null,
70208
- access: "view"
70209
- },
70210
70273
  "userManagement.verifyTotp": {
70211
70274
  capName: "user-management",
70212
70275
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-waste-collections",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Waste collection schedules via the vendored HACS waste_collection_schedule Python core — full source catalog as calendar-source.",
5
5
  "keywords": [
6
6
  "camstack",