@camstack/addon-google-services 0.2.13 → 0.2.14

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.
@@ -5551,7 +5551,7 @@ var ZodIssueCode = {
5551
5551
  var ZodFirstPartyTypeKind;
5552
5552
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5553
5553
  //#endregion
5554
- //#region ../types/dist/sleep-BxjU_fJM.mjs
5554
+ //#region ../types/dist/sleep-yKL5gfrH.mjs
5555
5555
  /**
5556
5556
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5557
5557
  * window to float samples (D455).
@@ -7934,9 +7934,9 @@ function normalizeAddonInitResult(result) {
7934
7934
  return result;
7935
7935
  }
7936
7936
  /**
7937
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7938
- * and validates them (`share-token.service.ts` builds its enum from this
7939
- * list); a data plane names the kinds it ACCEPTS in `share`.
7937
+ * The share-view scope kinds a share-link token can carry. The hub mints
7938
+ * and validates them (`ShareViewGrantSchema` builds its
7939
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7940
7940
  */
7941
7941
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7942
7942
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -12943,7 +12943,7 @@ var ConvertResultSchema = object({
12943
12943
  * `super_admin` — collapsed onto the single boolean because every
12944
12944
  * non-admin caller is governed by the same scope-check rules; the
12945
12945
  * distinction was only ever used to route role-specific procedures
12946
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12946
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
12947
12947
  * with `isAdmin: false` + an explicit scope list.
12948
12948
  */
12949
12949
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -13132,10 +13132,12 @@ var AddonRoutesScopeSchema = object({
13132
13132
  type: literal("addon-routes"),
13133
13133
  access: array(MethodAccessSchema).min(1)
13134
13134
  });
13135
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
13135
13136
  var CredentialScopeSchema = union([
13136
13137
  literal("*"),
13137
13138
  ShareViewScopeSchema,
13138
13139
  AddonRoutesScopeSchema,
13140
+ PreferencesSelfScopeSchema,
13139
13141
  TokenScopeSchema
13140
13142
  ]);
13141
13143
  object({
@@ -13144,6 +13146,55 @@ object({
13144
13146
  jti: string().min(16),
13145
13147
  scopes: array(CredentialScopeSchema).min(1)
13146
13148
  });
13149
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
13150
+ /** A namespace's value: a JSON object, opaque to the hub. */
13151
+ var PreferenceValueSchema = record(string(), unknown());
13152
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
13153
+ /** A stored row, as the owner reads it. */
13154
+ var PreferenceRowSchema = object({
13155
+ namespace: PreferenceNamespaceSchema,
13156
+ value: PreferenceValueSchema,
13157
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
13158
+ revision: number().int().positive(),
13159
+ updatedAt: number().int(),
13160
+ /** The client id the last writer sent; `null` when it sent none. */
13161
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
13162
+ });
13163
+ object({
13164
+ /** Absent: every namespace the caller holds. */
13165
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
13166
+ object({ rows: array(PreferenceRowSchema) });
13167
+ object({
13168
+ namespace: PreferenceNamespaceSchema,
13169
+ value: PreferenceValueSchema,
13170
+ /**
13171
+ * The revision the edit was based on. Absent: last write wins. `0`: the
13172
+ * namespace must not exist yet. Any other value that is not the current
13173
+ * revision answers `conflict` and writes nothing.
13174
+ */
13175
+ baseRevision: number().int().nonnegative().optional(),
13176
+ deviceId: PreferenceDeviceIdSchema.optional()
13177
+ });
13178
+ discriminatedUnion("status", [object({
13179
+ status: literal("saved"),
13180
+ row: PreferenceRowSchema
13181
+ }), object({
13182
+ status: literal("conflict"),
13183
+ current: PreferenceRowSchema.nullable()
13184
+ })]);
13185
+ object({ namespace: PreferenceNamespaceSchema });
13186
+ object({
13187
+ /** `false` when the namespace did not exist. */
13188
+ deleted: boolean() });
13189
+ object({
13190
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
13191
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
13192
+ object({
13193
+ /** Every row whose revision differs from the client's, and every row it did not list. */
13194
+ rows: array(PreferenceRowSchema),
13195
+ /** Namespaces the client listed that no longer exist. */
13196
+ deleted: array(PreferenceNamespaceSchema)
13197
+ });
13147
13198
  _enum(["new-session", "step-up"]);
13148
13199
  /** The languages the hub's app landing pages are written in (D858). */
13149
13200
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -40090,38 +40141,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
40090
40141
  auth: "admin",
40091
40142
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40092
40143
  });
40144
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
40145
+ /** What a model (or, by default, every model of a kind) can do. */
40146
+ var LlmModelFeaturesSchema = object({
40147
+ vision: boolean(),
40148
+ tools: boolean(),
40149
+ streaming: boolean()
40150
+ });
40151
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
40152
+ var LlmModelInfoSchema = object({
40153
+ id: string(),
40154
+ label: string().optional(),
40155
+ contextLength: number().int().positive().optional(),
40156
+ features: LlmModelFeaturesSchema.partial().optional()
40157
+ });
40093
40158
  /**
40094
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
40095
- * methods concat-fan across providers; single-row methods route to ONE
40096
- * provider by the `addonId` in the call input (the notification-output
40097
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
40098
- * (hub-placed); the cap stays open for future providers.
40099
- *
40100
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
40101
- * `apiKey` is a password field — providers REDACT it on read and merge on
40102
- * write; a stored key NEVER round-trips to a client.
40159
+ * The provider-specific part of a profile, validated by the provider that owns
40160
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
40161
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
40162
+ * keychain, never in the row, and reads back as the redaction marker.
40103
40163
  */
40104
- var LlmProfileKindSchema = _enum([
40105
- "openai-compatible",
40106
- "openai",
40107
- "anthropic",
40108
- "google",
40109
- "managed-local",
40110
- "apple-foundation"
40111
- ]);
40164
+ var LlmProviderConfigSchema = record(string(), unknown());
40112
40165
  var LlmProfileSchema = object({
40113
40166
  id: string(),
40114
40167
  name: string(),
40168
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
40115
40169
  kind: LlmProfileKindSchema,
40116
40170
  /** Stamped by the provider — keeps the fanned catalog routable. */
40117
40171
  addonId: string(),
40118
40172
  enabled: boolean(),
40119
40173
  /** Vendor model id, or the managed runtime's loaded model. */
40120
40174
  model: string(),
40121
- /** Required for openai-compatible; override for cloud kinds. */
40122
- baseUrl: string().optional(),
40123
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
40124
- apiKey: string().optional(),
40125
40175
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
40126
40176
  * degraded to text — that shipped once and produced a confident answer to a
40127
40177
  * question about a picture nobody sent. */
@@ -40129,15 +40179,11 @@ var LlmProfileSchema = object({
40129
40179
  temperature: number().min(0).max(2).optional(),
40130
40180
  /** Nucleus sampling. Every wire we speak has it. */
40131
40181
  topP: number().min(0).max(1).optional(),
40132
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
40133
- * wire does, and the client drops it there (measured: the request body gets
40134
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
40135
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
40182
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
40183
+ * field in its editor only when its descriptor lists it in `profileFields`. */
40136
40184
  topK: number().int().positive().optional(),
40137
40185
  maxTokens: number().int().positive().optional(),
40138
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
40139
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
40140
- * the model with, so it is the one field that changes a PROCESS. */
40186
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
40141
40187
  contextLength: number().int().positive().optional(),
40142
40188
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
40143
40189
  * two system prompts fighting is worse than either alone). */
@@ -40163,16 +40209,37 @@ var LlmProfileSchema = object({
40163
40209
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
40164
40210
  * `true` here buys the wiring, not behaviour, until tools are registered. */
40165
40211
  toolsEnabled: boolean().default(false),
40166
- extraHeaders: record(string(), string()).optional(),
40167
- /** kind === 'managed-local' only (spec §4). */
40168
- runtime: ManagedRuntimeConfigSchema.optional(),
40169
- /**
40170
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
40171
- * to configure (no key, no URL, no download; `model` is `apple-system`).
40172
- * `supportsVision` on such a row is stamped by the provider from the node's
40173
- * reported `imageInput`, never taken from the operator (D62).
40174
- */
40175
- appleFoundation: object({ nodeId: string() }).optional()
40212
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
40213
+ providerConfig: LlmProviderConfigSchema.default({})
40214
+ });
40215
+ /**
40216
+ * The common profile fields a kind's editor offers. The editor owns how each
40217
+ * one is drawn; the provider says which of them mean something on its wire.
40218
+ */
40219
+ var LlmProfileFieldSchema = _enum([
40220
+ "temperature",
40221
+ "topP",
40222
+ "topK",
40223
+ "maxTokens",
40224
+ "contextLength",
40225
+ "systemPrompt",
40226
+ "timeoutMs",
40227
+ "connectTimeoutMs",
40228
+ "firstTokenTimeoutMs",
40229
+ "idleTimeoutMs",
40230
+ "retry",
40231
+ "toolsEnabled"
40232
+ ]);
40233
+ /**
40234
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
40235
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
40236
+ * picker: that widget owns the model choice.
40237
+ */
40238
+ var LlmProviderWidgetSchema = object({
40239
+ id: string(),
40240
+ placement: _enum(["connection", "model"]),
40241
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
40242
+ requires: array(string()).optional()
40176
40243
  });
40177
40244
  /** ConfigUISchema tree passed through untyped on the wire (the
40178
40245
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -40181,11 +40248,56 @@ var ConfigSchemaPassthrough$3 = unknown();
40181
40248
  var LlmProfileKindDescriptorSchema = object({
40182
40249
  kind: LlmProfileKindSchema,
40183
40250
  label: string(),
40251
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
40184
40252
  icon: string(),
40185
40253
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
40186
40254
  addonId: string(),
40187
- configSchema: ConfigSchemaPassthrough$3
40255
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
40256
+ connectionSchema: ConfigSchemaPassthrough$3,
40257
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
40258
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
40259
+ /** The kind's defaults; a model from `listModels` may override any of them. */
40260
+ features: LlmModelFeaturesSchema,
40261
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
40262
+ visionEditable: boolean(),
40263
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
40264
+ modelCatalog: _enum([
40265
+ "fetch",
40266
+ "static",
40267
+ "none"
40268
+ ]),
40269
+ staticModels: array(LlmModelInfoSchema).optional(),
40270
+ /** The common fields that mean something on this kind's wire. */
40271
+ profileFields: array(LlmProfileFieldSchema),
40272
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
40188
40273
  });
40274
+ /**
40275
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
40276
+ * (the editor's form); with `profileId` too, a secret the draft leaves
40277
+ * untouched (absent or the redaction marker) is resolved server-side from the
40278
+ * stored profile — the browser never receives it.
40279
+ */
40280
+ var LlmListModelsInputSchema = object({
40281
+ addonId: string(),
40282
+ kind: LlmProfileKindSchema,
40283
+ profileId: string().optional(),
40284
+ connection: LlmProviderConfigSchema.optional()
40285
+ });
40286
+ var LlmListModelsErrorCodeSchema = _enum([
40287
+ "auth",
40288
+ "network",
40289
+ "unsupported",
40290
+ "invalid"
40291
+ ]);
40292
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
40293
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
40294
+ ok: literal(true),
40295
+ models: array(LlmModelInfoSchema)
40296
+ }), object({
40297
+ ok: literal(false),
40298
+ code: LlmListModelsErrorCodeSchema,
40299
+ message: string()
40300
+ })]);
40189
40301
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
40190
40302
  var LlmDefaultSchema = object({
40191
40303
  selector: LlmDefaultSelectorSchema,
@@ -40285,7 +40397,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
40285
40397
  kind: "mutation",
40286
40398
  auth: "admin",
40287
40399
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40288
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
40400
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
40401
+ kind: "mutation",
40402
+ auth: "admin"
40403
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
40289
40404
  selector: LlmDefaultSelectorSchema,
40290
40405
  profileId: string().nullable()
40291
40406
  }), _void(), {
@@ -61303,26 +61418,6 @@ var ApiKeySummarySchema = object({
61303
61418
  createdAt: number(),
61304
61419
  lastUsedAt: number().optional()
61305
61420
  });
61306
- var ScopedTokenSummarySchema = object({
61307
- id: string(),
61308
- userId: string(),
61309
- name: string(),
61310
- tokenPrefix: string(),
61311
- scopes: array(TokenScopeSchema),
61312
- expiresAt: number().nullish(),
61313
- lastUsedAt: number().nullish(),
61314
- createdAt: number()
61315
- });
61316
- var CreateScopedTokenInputSchema = object({
61317
- userId: string(),
61318
- name: string(),
61319
- scopes: array(TokenScopeSchema),
61320
- expiresAt: number().optional()
61321
- });
61322
- var CreateScopedTokenResultSchema = object({
61323
- token: string(),
61324
- record: ScopedTokenSummarySchema
61325
- });
61326
61421
  var OauthSessionSummarySchema = object({
61327
61422
  id: string(),
61328
61423
  userId: string(),
@@ -61344,11 +61439,11 @@ var TotpStatusSchema = object({
61344
61439
  confirmedAt: number().nullable()
61345
61440
  });
61346
61441
  /**
61347
- * user-management — singleton capability for user accounts, API keys,
61348
- * and scoped tokens.
61442
+ * user-management — singleton capability for user accounts and the
61443
+ * legacy API-key rows.
61349
61444
  *
61350
61445
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
61351
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
61446
+ * — the subset check on `setUserScopes` is moot
61352
61447
  * because non-admins never reach these. If/when we open non-admin
61353
61448
  * delegation, structural caller-scope subset check goes inside the
61354
61449
  * provider.
@@ -61405,15 +61500,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
61405
61500
  kind: "mutation",
61406
61501
  auth: "admin",
61407
61502
  access: "delete"
61408
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
61409
- kind: "mutation",
61410
- auth: "admin",
61411
- access: "create"
61412
- }), method(object({ id: string() }), object({ success: literal(true) }), {
61413
- kind: "mutation",
61414
- auth: "admin",
61415
- access: "delete"
61416
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
61503
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
61417
61504
  kind: "mutation",
61418
61505
  auth: "admin",
61419
61506
  access: "create"
@@ -65569,7 +65656,7 @@ Object.freeze({
65569
65656
  capName: "llm",
65570
65657
  capScope: "system",
65571
65658
  addonId: null,
65572
- access: "view"
65659
+ access: "create"
65573
65660
  },
65574
65661
  "llm.listNodeModels": {
65575
65662
  capName: "llm",
@@ -70233,12 +70320,6 @@ Object.freeze({
70233
70320
  addonId: null,
70234
70321
  access: "create"
70235
70322
  },
70236
- "userManagement.createScopedToken": {
70237
- capName: "user-management",
70238
- capScope: "system",
70239
- addonId: null,
70240
- access: "create"
70241
- },
70242
70323
  "userManagement.createUser": {
70243
70324
  capName: "user-management",
70244
70325
  capScope: "system",
@@ -70287,12 +70368,6 @@ Object.freeze({
70287
70368
  addonId: null,
70288
70369
  access: "view"
70289
70370
  },
70290
- "userManagement.listScopedTokens": {
70291
- capName: "user-management",
70292
- capScope: "system",
70293
- addonId: null,
70294
- access: "view"
70295
- },
70296
70371
  "userManagement.listUsers": {
70297
70372
  capName: "user-management",
70298
70373
  capScope: "system",
@@ -70347,12 +70422,6 @@ Object.freeze({
70347
70422
  addonId: null,
70348
70423
  access: "delete"
70349
70424
  },
70350
- "userManagement.revokeScopedToken": {
70351
- capName: "user-management",
70352
- capScope: "system",
70353
- addonId: null,
70354
- access: "delete"
70355
- },
70356
70425
  "userManagement.setupTotp": {
70357
70426
  capName: "user-management",
70358
70427
  capScope: "system",
@@ -70383,12 +70452,6 @@ Object.freeze({
70383
70452
  addonId: null,
70384
70453
  access: "view"
70385
70454
  },
70386
- "userManagement.validateScopedToken": {
70387
- capName: "user-management",
70388
- capScope: "system",
70389
- addonId: null,
70390
- access: "view"
70391
- },
70392
70455
  "userManagement.verifyTotp": {
70393
70456
  capName: "user-management",
70394
70457
  capScope: "system",
@@ -5547,7 +5547,7 @@ var ZodIssueCode = {
5547
5547
  var ZodFirstPartyTypeKind;
5548
5548
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5549
5549
  //#endregion
5550
- //#region ../types/dist/sleep-BxjU_fJM.mjs
5550
+ //#region ../types/dist/sleep-yKL5gfrH.mjs
5551
5551
  /**
5552
5552
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5553
5553
  * window to float samples (D455).
@@ -7930,9 +7930,9 @@ function normalizeAddonInitResult(result) {
7930
7930
  return result;
7931
7931
  }
7932
7932
  /**
7933
- * The share-view scope kinds a `csv_*` share token can carry. The hub mints
7934
- * and validates them (`share-token.service.ts` builds its enum from this
7935
- * list); a data plane names the kinds it ACCEPTS in `share`.
7933
+ * The share-view scope kinds a share-link token can carry. The hub mints
7934
+ * and validates them (`ShareViewGrantSchema` builds its
7935
+ * enum from this list); a data plane names the kinds it ACCEPTS in `share`.
7936
7936
  */
7937
7937
  var SHARE_VIEW_KINDS = ["grid-view", "events-view"];
7938
7938
  /** The wire shape of {@link PeerBytesTicket} — see the type for what it is. */
@@ -12939,7 +12939,7 @@ var ConvertResultSchema = object({
12939
12939
  * `super_admin` — collapsed onto the single boolean because every
12940
12940
  * non-admin caller is governed by the same scope-check rules; the
12941
12941
  * distinction was only ever used to route role-specific procedures
12942
- * which we no longer have. CLI / webhook integrations are `cst_*` tokens
12942
+ * which we no longer have. CLI / webhook integrations are tokens (`auth.mintToken`)
12943
12943
  * with `isAdmin: false` + an explicit scope list.
12944
12944
  */
12945
12945
  /** Per-method access flavour. Materialised on every cap method via codegen. */
@@ -13128,10 +13128,12 @@ var AddonRoutesScopeSchema = object({
13128
13128
  type: literal("addon-routes"),
13129
13129
  access: array(MethodAccessSchema).min(1)
13130
13130
  });
13131
+ var PreferencesSelfScopeSchema = object({ type: literal("preferences-self") });
13131
13132
  var CredentialScopeSchema = union([
13132
13133
  literal("*"),
13133
13134
  ShareViewScopeSchema,
13134
13135
  AddonRoutesScopeSchema,
13136
+ PreferencesSelfScopeSchema,
13135
13137
  TokenScopeSchema
13136
13138
  ]);
13137
13139
  object({
@@ -13140,6 +13142,55 @@ object({
13140
13142
  jti: string().min(16),
13141
13143
  scopes: array(CredentialScopeSchema).min(1)
13142
13144
  });
13145
+ var PreferenceNamespaceSchema = string().regex(/^[a-z][a-z0-9.-]{0,63}$/);
13146
+ /** A namespace's value: a JSON object, opaque to the hub. */
13147
+ var PreferenceValueSchema = record(string(), unknown());
13148
+ var PreferenceDeviceIdSchema = string().min(1).max(64);
13149
+ /** A stored row, as the owner reads it. */
13150
+ var PreferenceRowSchema = object({
13151
+ namespace: PreferenceNamespaceSchema,
13152
+ value: PreferenceValueSchema,
13153
+ /** Starts at 1, +1 on every write of this namespace. A delete ends the row and its count. */
13154
+ revision: number().int().positive(),
13155
+ updatedAt: number().int(),
13156
+ /** The client id the last writer sent; `null` when it sent none. */
13157
+ updatedByDevice: PreferenceDeviceIdSchema.nullable()
13158
+ });
13159
+ object({
13160
+ /** Absent: every namespace the caller holds. */
13161
+ namespaces: array(PreferenceNamespaceSchema).max(32).optional() });
13162
+ object({ rows: array(PreferenceRowSchema) });
13163
+ object({
13164
+ namespace: PreferenceNamespaceSchema,
13165
+ value: PreferenceValueSchema,
13166
+ /**
13167
+ * The revision the edit was based on. Absent: last write wins. `0`: the
13168
+ * namespace must not exist yet. Any other value that is not the current
13169
+ * revision answers `conflict` and writes nothing.
13170
+ */
13171
+ baseRevision: number().int().nonnegative().optional(),
13172
+ deviceId: PreferenceDeviceIdSchema.optional()
13173
+ });
13174
+ discriminatedUnion("status", [object({
13175
+ status: literal("saved"),
13176
+ row: PreferenceRowSchema
13177
+ }), object({
13178
+ status: literal("conflict"),
13179
+ current: PreferenceRowSchema.nullable()
13180
+ })]);
13181
+ object({ namespace: PreferenceNamespaceSchema });
13182
+ object({
13183
+ /** `false` when the namespace did not exist. */
13184
+ deleted: boolean() });
13185
+ object({
13186
+ /** The revision the client holds per namespace; a namespace it does not list is new to it. */
13187
+ revisionByNamespace: record(PreferenceNamespaceSchema, number().int().nonnegative()).refine((map) => Object.keys(map).length <= 32, { message: `at most 32 namespaces` }) });
13188
+ object({
13189
+ /** Every row whose revision differs from the client's, and every row it did not list. */
13190
+ rows: array(PreferenceRowSchema),
13191
+ /** Namespaces the client listed that no longer exist. */
13192
+ deleted: array(PreferenceNamespaceSchema)
13193
+ });
13143
13194
  _enum(["new-session", "step-up"]);
13144
13195
  /** The languages the hub's app landing pages are written in (D858). */
13145
13196
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -40086,38 +40137,37 @@ method(LlmRuntimeCompleteInputSchema, LlmGenerateResultSchema, {
40086
40137
  auth: "admin",
40087
40138
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40088
40139
  });
40140
+ var LlmProfileKindSchema = string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/, "a kind id is lower-case letters, digits and dashes");
40141
+ /** What a model (or, by default, every model of a kind) can do. */
40142
+ var LlmModelFeaturesSchema = object({
40143
+ vision: boolean(),
40144
+ tools: boolean(),
40145
+ streaming: boolean()
40146
+ });
40147
+ /** One model a provider offers. `features` overrides the kind's defaults, per field. */
40148
+ var LlmModelInfoSchema = object({
40149
+ id: string(),
40150
+ label: string().optional(),
40151
+ contextLength: number().int().positive().optional(),
40152
+ features: LlmModelFeaturesSchema.partial().optional()
40153
+ });
40089
40154
  /**
40090
- * `llm` — consumer-facing LLM surface (spec §1-§3). Collection-mode: array
40091
- * methods concat-fan across providers; single-row methods route to ONE
40092
- * provider by the `addonId` in the call input (the notification-output
40093
- * posture, notification-output.cap.ts:215-250). Provided by `addon-ai`
40094
- * (hub-placed); the cap stays open for future providers.
40095
- *
40096
- * Profiles are ROWS (data), not addons: one row = one usable model endpoint.
40097
- * `apiKey` is a password field — providers REDACT it on read and merge on
40098
- * write; a stored key NEVER round-trips to a client.
40155
+ * The provider-specific part of a profile, validated by the provider that owns
40156
+ * the kind (`upsertProfile` refuses what it does not accept). A field its
40157
+ * `connectionSchema` declares `type: 'password'` is a secret: it is held in the
40158
+ * keychain, never in the row, and reads back as the redaction marker.
40099
40159
  */
40100
- var LlmProfileKindSchema = _enum([
40101
- "openai-compatible",
40102
- "openai",
40103
- "anthropic",
40104
- "google",
40105
- "managed-local",
40106
- "apple-foundation"
40107
- ]);
40160
+ var LlmProviderConfigSchema = record(string(), unknown());
40108
40161
  var LlmProfileSchema = object({
40109
40162
  id: string(),
40110
40163
  name: string(),
40164
+ /** The provider-declared kind (`LlmProfileKindDescriptor.kind`). */
40111
40165
  kind: LlmProfileKindSchema,
40112
40166
  /** Stamped by the provider — keeps the fanned catalog routable. */
40113
40167
  addonId: string(),
40114
40168
  enabled: boolean(),
40115
40169
  /** Vendor model id, or the managed runtime's loaded model. */
40116
40170
  model: string(),
40117
- /** Required for openai-compatible; override for cloud kinds. */
40118
- baseUrl: string().optional(),
40119
- /** ConfigUISchema type:'password' — never round-trips (spec §5). */
40120
- apiKey: string().optional(),
40121
40171
  /** Vision on/off. A vision call against a `false` profile is REFUSED, never
40122
40172
  * degraded to text — that shipped once and produced a confident answer to a
40123
40173
  * question about a picture nobody sent. */
@@ -40125,15 +40175,11 @@ var LlmProfileSchema = object({
40125
40175
  temperature: number().min(0).max(2).optional(),
40126
40176
  /** Nucleus sampling. Every wire we speak has it. */
40127
40177
  topP: number().min(0).max(1).optional(),
40128
- /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
40129
- * wire does, and the client drops it there (measured: the request body gets
40130
- * `top_p` and no `top_k`). The profile editor hides the field wherever it
40131
- * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
40178
+ /** Top-k sampling. Carried only by the wires that have it — a kind offers the
40179
+ * field in its editor only when its descriptor lists it in `profileFields`. */
40132
40180
  topK: number().int().positive().optional(),
40133
40181
  maxTokens: number().int().positive().optional(),
40134
- /** Prompt context window. Advisory for cloud kinds (they enforce their own);
40135
- * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
40136
- * the model with, so it is the one field that changes a PROCESS. */
40182
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own). */
40137
40183
  contextLength: number().int().positive().optional(),
40138
40184
  /** Default system prompt. A caller's `system` REPLACES it (never appends —
40139
40185
  * two system prompts fighting is worse than either alone). */
@@ -40159,16 +40205,37 @@ var LlmProfileSchema = object({
40159
40205
  * library; the REGISTRY of callable tools is ours and is empty in v1, so a
40160
40206
  * `true` here buys the wiring, not behaviour, until tools are registered. */
40161
40207
  toolsEnabled: boolean().default(false),
40162
- extraHeaders: record(string(), string()).optional(),
40163
- /** kind === 'managed-local' only (spec §4). */
40164
- runtime: ManagedRuntimeConfigSchema.optional(),
40165
- /**
40166
- * kind === 'apple-foundation' only: WHERE it runs — the only thing there is
40167
- * to configure (no key, no URL, no download; `model` is `apple-system`).
40168
- * `supportsVision` on such a row is stamped by the provider from the node's
40169
- * reported `imageInput`, never taken from the operator (D62).
40170
- */
40171
- appleFoundation: object({ nodeId: string() }).optional()
40208
+ /** Everything the kind's provider owns (endpoint, key, node, runtime…). */
40209
+ providerConfig: LlmProviderConfigSchema.default({})
40210
+ });
40211
+ /**
40212
+ * The common profile fields a kind's editor offers. The editor owns how each
40213
+ * one is drawn; the provider says which of them mean something on its wire.
40214
+ */
40215
+ var LlmProfileFieldSchema = _enum([
40216
+ "temperature",
40217
+ "topP",
40218
+ "topK",
40219
+ "maxTokens",
40220
+ "contextLength",
40221
+ "systemPrompt",
40222
+ "timeoutMs",
40223
+ "connectTimeoutMs",
40224
+ "firstTokenTimeoutMs",
40225
+ "idleTimeoutMs",
40226
+ "retry",
40227
+ "toolsEnabled"
40228
+ ]);
40229
+ /**
40230
+ * A provider-drawn part of the editor, by a generic widget id the admin UI
40231
+ * registers (`ai/apple-node`). `placement: 'model'` replaces the generic model
40232
+ * picker: that widget owns the model choice.
40233
+ */
40234
+ var LlmProviderWidgetSchema = object({
40235
+ id: string(),
40236
+ placement: _enum(["connection", "model"]),
40237
+ /** `providerConfig` keys this widget must fill before the profile can be saved. */
40238
+ requires: array(string()).optional()
40172
40239
  });
40173
40240
  /** ConfigUISchema tree passed through untyped on the wire (the
40174
40241
  * notification-output `ConfigSchemaPassthrough` precedent at
@@ -40177,11 +40244,56 @@ var ConfigSchemaPassthrough$3 = unknown();
40177
40244
  var LlmProfileKindDescriptorSchema = object({
40178
40245
  kind: LlmProfileKindSchema,
40179
40246
  label: string(),
40247
+ /** A generic icon name (`cloud`, `plug`, `cpu`) — never a glyph or a logo. */
40180
40248
  icon: string(),
40181
40249
  /** Stamped by each provider so the concat-fanned catalog stays routable. */
40182
40250
  addonId: string(),
40183
- configSchema: ConfigSchemaPassthrough$3
40251
+ /** The provider's own fields (`providerConfig`); `password` fields are keychain-held. */
40252
+ connectionSchema: ConfigSchemaPassthrough$3,
40253
+ /** Provider fields that belong under "Advanced" (extra headers, runtime tuning). */
40254
+ advancedSchema: ConfigSchemaPassthrough$3.optional(),
40255
+ /** The kind's defaults; a model from `listModels` may override any of them. */
40256
+ features: LlmModelFeaturesSchema,
40257
+ /** `false` = the provider stamps `supportsVision` itself (from what a node reports). */
40258
+ visionEditable: boolean(),
40259
+ /** Where the model list comes from: `listModels`, `staticModels`, or nowhere. */
40260
+ modelCatalog: _enum([
40261
+ "fetch",
40262
+ "static",
40263
+ "none"
40264
+ ]),
40265
+ staticModels: array(LlmModelInfoSchema).optional(),
40266
+ /** The common fields that mean something on this kind's wire. */
40267
+ profileFields: array(LlmProfileFieldSchema),
40268
+ providerWidgets: array(LlmProviderWidgetSchema).optional()
40184
40269
  });
40270
+ /**
40271
+ * `listModels` input. `connection` is an UNSAVED draft of `providerConfig`
40272
+ * (the editor's form); with `profileId` too, a secret the draft leaves
40273
+ * untouched (absent or the redaction marker) is resolved server-side from the
40274
+ * stored profile — the browser never receives it.
40275
+ */
40276
+ var LlmListModelsInputSchema = object({
40277
+ addonId: string(),
40278
+ kind: LlmProfileKindSchema,
40279
+ profileId: string().optional(),
40280
+ connection: LlmProviderConfigSchema.optional()
40281
+ });
40282
+ var LlmListModelsErrorCodeSchema = _enum([
40283
+ "auth",
40284
+ "network",
40285
+ "unsupported",
40286
+ "invalid"
40287
+ ]);
40288
+ /** A RESULT, never a throw: "wrong key" is an answer the editor renders inline. */
40289
+ var LlmListModelsResultSchema = discriminatedUnion("ok", [object({
40290
+ ok: literal(true),
40291
+ models: array(LlmModelInfoSchema)
40292
+ }), object({
40293
+ ok: literal(false),
40294
+ code: LlmListModelsErrorCodeSchema,
40295
+ message: string()
40296
+ })]);
40185
40297
  var LlmDefaultSelectorSchema = union([object({ consumer: string() }), object({ purpose: _enum(["text", "vision"]) })]);
40186
40298
  var LlmDefaultSchema = object({
40187
40299
  selector: LlmDefaultSelectorSchema,
@@ -40281,7 +40393,10 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, {
40281
40393
  kind: "mutation",
40282
40394
  auth: "admin",
40283
40395
  timeoutMs: AI_CAP_TRANSPORT_TIMEOUT_MS
40284
- }), method(ProfileRefInputSchema, array(string())), method(object({}), array(LlmDefaultSchema)), method(object({
40396
+ }), method(LlmListModelsInputSchema, LlmListModelsResultSchema, {
40397
+ kind: "mutation",
40398
+ auth: "admin"
40399
+ }), method(object({}), array(LlmDefaultSchema)), method(object({
40285
40400
  selector: LlmDefaultSelectorSchema,
40286
40401
  profileId: string().nullable()
40287
40402
  }), _void(), {
@@ -61299,26 +61414,6 @@ var ApiKeySummarySchema = object({
61299
61414
  createdAt: number(),
61300
61415
  lastUsedAt: number().optional()
61301
61416
  });
61302
- var ScopedTokenSummarySchema = object({
61303
- id: string(),
61304
- userId: string(),
61305
- name: string(),
61306
- tokenPrefix: string(),
61307
- scopes: array(TokenScopeSchema),
61308
- expiresAt: number().nullish(),
61309
- lastUsedAt: number().nullish(),
61310
- createdAt: number()
61311
- });
61312
- var CreateScopedTokenInputSchema = object({
61313
- userId: string(),
61314
- name: string(),
61315
- scopes: array(TokenScopeSchema),
61316
- expiresAt: number().optional()
61317
- });
61318
- var CreateScopedTokenResultSchema = object({
61319
- token: string(),
61320
- record: ScopedTokenSummarySchema
61321
- });
61322
61417
  var OauthSessionSummarySchema = object({
61323
61418
  id: string(),
61324
61419
  userId: string(),
@@ -61340,11 +61435,11 @@ var TotpStatusSchema = object({
61340
61435
  confirmedAt: number().nullable()
61341
61436
  });
61342
61437
  /**
61343
- * user-management — singleton capability for user accounts, API keys,
61344
- * and scoped tokens.
61438
+ * user-management — singleton capability for user accounts and the
61439
+ * legacy API-key rows.
61345
61440
  *
61346
61441
  * v2 model: every method gated by `auth: 'admin'`. Admin-only delegation
61347
- * — the subset check on `setUserScopes` / `createScopedToken` is moot
61442
+ * — the subset check on `setUserScopes` is moot
61348
61443
  * because non-admins never reach these. If/when we open non-admin
61349
61444
  * delegation, structural caller-scope subset check goes inside the
61350
61445
  * provider.
@@ -61401,15 +61496,7 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
61401
61496
  kind: "mutation",
61402
61497
  auth: "admin",
61403
61498
  access: "delete"
61404
- }), method(CreateScopedTokenInputSchema, CreateScopedTokenResultSchema, {
61405
- kind: "mutation",
61406
- auth: "admin",
61407
- access: "create"
61408
- }), method(object({ id: string() }), object({ success: literal(true) }), {
61409
- kind: "mutation",
61410
- auth: "admin",
61411
- access: "delete"
61412
- }), method(object({ token: string() }), ScopedTokenSummarySchema.nullable(), { access: "view" }), method(object({ userId: string() }), array(ScopedTokenSummarySchema), { auth: "admin" }), method(object({ userId: string() }), TotpSetupResultSchema, {
61499
+ }), method(object({ userId: string() }), TotpSetupResultSchema, {
61413
61500
  kind: "mutation",
61414
61501
  auth: "admin",
61415
61502
  access: "create"
@@ -65565,7 +65652,7 @@ Object.freeze({
65565
65652
  capName: "llm",
65566
65653
  capScope: "system",
65567
65654
  addonId: null,
65568
- access: "view"
65655
+ access: "create"
65569
65656
  },
65570
65657
  "llm.listNodeModels": {
65571
65658
  capName: "llm",
@@ -70229,12 +70316,6 @@ Object.freeze({
70229
70316
  addonId: null,
70230
70317
  access: "create"
70231
70318
  },
70232
- "userManagement.createScopedToken": {
70233
- capName: "user-management",
70234
- capScope: "system",
70235
- addonId: null,
70236
- access: "create"
70237
- },
70238
70319
  "userManagement.createUser": {
70239
70320
  capName: "user-management",
70240
70321
  capScope: "system",
@@ -70283,12 +70364,6 @@ Object.freeze({
70283
70364
  addonId: null,
70284
70365
  access: "view"
70285
70366
  },
70286
- "userManagement.listScopedTokens": {
70287
- capName: "user-management",
70288
- capScope: "system",
70289
- addonId: null,
70290
- access: "view"
70291
- },
70292
70367
  "userManagement.listUsers": {
70293
70368
  capName: "user-management",
70294
70369
  capScope: "system",
@@ -70343,12 +70418,6 @@ Object.freeze({
70343
70418
  addonId: null,
70344
70419
  access: "delete"
70345
70420
  },
70346
- "userManagement.revokeScopedToken": {
70347
- capName: "user-management",
70348
- capScope: "system",
70349
- addonId: null,
70350
- access: "delete"
70351
- },
70352
70421
  "userManagement.setupTotp": {
70353
70422
  capName: "user-management",
70354
70423
  capScope: "system",
@@ -70379,12 +70448,6 @@ Object.freeze({
70379
70448
  addonId: null,
70380
70449
  access: "view"
70381
70450
  },
70382
- "userManagement.validateScopedToken": {
70383
- capName: "user-management",
70384
- capScope: "system",
70385
- addonId: null,
70386
- access: "view"
70387
- },
70388
70451
  "userManagement.verifyTotp": {
70389
70452
  capName: "user-management",
70390
70453
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-google-services",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "Google Services — Google brokers (OAuth2): Calendar as calendar-source, Gmail send as smtp-provider.",
5
5
  "keywords": [
6
6
  "camstack",