@capybara-hq/kernel 0.1.0-rc.10 → 0.1.0-rc.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.
Files changed (106) hide show
  1. package/dist/admin/admin.schemas.d.ts +3 -0
  2. package/dist/agents/agents.schemas.d.ts +3 -0
  3. package/dist/agents/agents.service.js +11 -1
  4. package/dist/agents/definition.d.ts +1 -0
  5. package/dist/agents/definition.js +7 -3
  6. package/dist/agents/org-templates.js +4 -0
  7. package/dist/agents/pending-connectors.service.js +1 -1
  8. package/dist/catalog/catalog-content.d.ts +33 -1
  9. package/dist/catalog/catalog-content.js +65 -2
  10. package/dist/catalog/catalog-items.js +1 -0
  11. package/dist/catalog/catalog-scope.service.d.ts +29 -3
  12. package/dist/catalog/catalog-scope.service.js +82 -10
  13. package/dist/catalog/catalog.service.d.ts +7 -5
  14. package/dist/catalog/catalog.service.js +26 -5
  15. package/dist/catalog/claude/translate.js +3 -0
  16. package/dist/catalog/component-scope.controller.d.ts +18 -6
  17. package/dist/catalog/component-scope.controller.js +36 -13
  18. package/dist/catalog/component-scope.schemas.d.ts +4 -0
  19. package/dist/catalog/component-scope.service.d.ts +59 -9
  20. package/dist/catalog/component-scope.service.js +156 -27
  21. package/dist/catalog/component-state.d.ts +20 -3
  22. package/dist/catalog/component-state.js +40 -14
  23. package/dist/catalog/marketplaces.service.d.ts +1 -1
  24. package/dist/catalog/org-catalog.service.js +3 -0
  25. package/dist/catalog/owned-items.js +7 -0
  26. package/dist/catalog/platform-components.d.ts +23 -3
  27. package/dist/catalog/platform-components.js +118 -9
  28. package/dist/catalog/platform-migration.js +2 -1
  29. package/dist/catalog/plugin-import.d.ts +24 -4
  30. package/dist/catalog/plugin-import.js +41 -7
  31. package/dist/catalog/plugin-install.d.ts +20 -1
  32. package/dist/catalog/plugin-install.js +71 -1
  33. package/dist/catalog/plugin-package.d.ts +41 -4
  34. package/dist/catalog/plugin-package.js +127 -7
  35. package/dist/catalog/plugin-upgrade.d.ts +13 -2
  36. package/dist/catalog/plugin-upgrade.js +124 -6
  37. package/dist/catalog/unshare.js +1 -0
  38. package/dist/conversations/conversations.service.d.ts +9 -0
  39. package/dist/conversations/conversations.service.js +9 -2
  40. package/dist/conversations/events.d.ts +1 -0
  41. package/dist/db/kernel-schema.d.ts +54 -4
  42. package/dist/errors.d.ts +27 -0
  43. package/dist/errors.js +27 -0
  44. package/dist/http/api.module.js +7 -0
  45. package/dist/identity/accounts.d.ts +11 -4
  46. package/dist/identity/accounts.js +23 -10
  47. package/dist/identity/me.controller.d.ts +10 -10
  48. package/dist/identity/me.controller.js +8 -6
  49. package/dist/identity/me.schemas.d.ts +13 -3
  50. package/dist/identity/me.schemas.js +10 -2
  51. package/dist/identity/settings.d.ts +27 -0
  52. package/dist/identity/settings.js +64 -0
  53. package/dist/orgs/settings.service.d.ts +31 -0
  54. package/dist/orgs/settings.service.js +31 -1
  55. package/dist/platform/exclusions.js +26 -0
  56. package/dist/platform/operation.js +6 -2
  57. package/dist/platform/ops/admin.ops.d.ts +3 -1
  58. package/dist/platform/ops/admin.ops.js +25 -7
  59. package/dist/platform/ops/agents.ops.js +19 -6
  60. package/dist/platform/ops/components.ops.js +1 -0
  61. package/dist/platform/ops/org-settings.ops.d.ts +3 -1
  62. package/dist/platform/ops/org-settings.ops.js +33 -8
  63. package/dist/platform/ops/orgs.ops.js +1 -0
  64. package/dist/platform/ops/platform.ops.d.ts +3 -1
  65. package/dist/platform/ops/platform.ops.js +43 -16
  66. package/dist/platform/ops/themes.ops.d.ts +14 -0
  67. package/dist/platform/ops/themes.ops.js +47 -0
  68. package/dist/platform/platform-ops.module.d.ts +2 -1
  69. package/dist/platform/platform-ops.module.js +5 -0
  70. package/dist/platform/route-schemas.js +3 -0
  71. package/dist/runtime/subagents/definition.d.ts +3 -2
  72. package/dist/runtime/subagents/definition.js +2 -1
  73. package/dist/themes/render-css.d.ts +12 -0
  74. package/dist/themes/render-css.js +132 -0
  75. package/dist/themes/theme-delivery.service.d.ts +34 -0
  76. package/dist/themes/theme-delivery.service.js +111 -0
  77. package/dist/themes/theme-state.d.ts +95 -0
  78. package/dist/themes/theme-state.js +203 -0
  79. package/dist/themes/theme-usage.d.ts +61 -0
  80. package/dist/themes/theme-usage.js +98 -0
  81. package/dist/themes/themes-public.controller.d.ts +28 -0
  82. package/dist/themes/themes-public.controller.js +92 -0
  83. package/dist/themes/themes.controller.d.ts +13 -0
  84. package/dist/themes/themes.controller.js +38 -0
  85. package/dist/themes/themes.module.d.ts +3 -0
  86. package/dist/themes/themes.module.js +21 -0
  87. package/dist/themes/themes.schemas.d.ts +3 -0
  88. package/dist/themes/themes.schemas.js +2 -0
  89. package/dist/themes/themes.service.d.ts +50 -0
  90. package/dist/themes/themes.service.js +99 -0
  91. package/dist/tools/connector-account-policies.d.ts +51 -0
  92. package/dist/tools/connector-account-policies.js +165 -0
  93. package/dist/tools/connectors.controller.d.ts +35 -4
  94. package/dist/tools/connectors.controller.js +66 -7
  95. package/dist/tools/connectors.schemas.d.ts +11 -0
  96. package/dist/tools/connectors.schemas.js +11 -0
  97. package/dist/tools/connectors.service.d.ts +2 -0
  98. package/dist/tools/connectors.service.js +1 -0
  99. package/dist/tools/pipeline.d.ts +1 -1
  100. package/dist/tools/policy.d.ts +23 -1
  101. package/dist/tools/policy.js +99 -24
  102. package/dist/tools/tools.module.js +3 -0
  103. package/package.json +3 -3
  104. package/src/migrations/0102_themes.sql +64 -0
  105. package/src/migrations/0103_ui_theme_setting.sql +7 -0
  106. package/src/migrations/0104_connector_tool_account_policies.sql +16 -0
@@ -1,4 +1,5 @@
1
1
  import type { z } from "zod";
2
+ import { PluginIcons } from "../extensions/plugin-icons.js";
2
3
  import { type Principal } from "../identity/principal.js";
3
4
  import { type OrgContext } from "../orgs/org.guard.js";
4
5
  import { ComponentParams, ComponentDisabledSchema as DisabledBody, ComponentIdSchema as IdParams, ComponentListQuery as ListQuery, OrgComponentListQuery, ComponentScopePreviewSchema as PreviewBody, ComponentScopeSchema as ScopeBody, ComponentShownSchema as ShownBody, ComponentSwitchBody as SwitchBody, ComponentTemplateVersionSchema as TemplateVersionBody } from "./component-scope.schemas.js";
@@ -13,7 +14,8 @@ import { PlatformComponents, type UploadedComponentVersion } from "./platform-co
13
14
  export declare class AdminComponentsController {
14
15
  private readonly scope;
15
16
  private readonly components;
16
- constructor(scope: ComponentScopeService, components: PlatformComponents);
17
+ private readonly icons;
18
+ constructor(scope: ComponentScopeService, components: PlatformComponents, icons: PluginIcons);
17
19
  /**
18
20
  * Updates a platform skill on its own (spec §7.2): the skill package (zip) as the raw body
19
21
  * (`application/octet-stream`, at most `packages.maxBytes`). The package keeps the skill's name
@@ -26,9 +28,14 @@ export declare class AdminComponentsController {
26
28
  }): Promise<UploadedComponentVersion>;
27
29
  /** Updates a platform agent template on its own: `{ content }` is the template markdown file. */
28
30
  uploadAgentTemplateVersion(principal: Principal, p: z.infer<typeof IdParams>, body: z.infer<typeof TemplateVersionBody>): Promise<UploadedComponentVersion>;
29
- /** `GET ?kind=`: every platform component of the kind (plugin, owner, scope, version, orgs on). */
31
+ /**
32
+ * `GET ?kind=`: every platform component of the kind (plugin, owner, scope, version, orgs on),
33
+ * each with its display name and its plugin's icon (`icon`, the admin route; null without one).
34
+ */
30
35
  list(q: z.infer<typeof ListQuery>): Promise<{
31
- components: ComponentView[];
36
+ components: (ComponentView & {
37
+ icon: string | null;
38
+ })[];
32
39
  }>;
33
40
  /**
34
41
  * A component's versions, newest first: `{ versions: [{ version, catalogVersion, updatedOnOwn,
@@ -65,14 +72,19 @@ export declare class AdminComponentsController {
65
72
  */
66
73
  export declare class OrgComponentsController {
67
74
  private readonly scope;
68
- constructor(scope: ComponentScopeService);
75
+ private readonly icons;
76
+ constructor(scope: ComponentScopeService, icons: PluginIcons);
69
77
  /**
70
78
  * The platform components offered to the org (`?kind=`, `?itemId=`: only those; Task 10): each
71
79
  * with its state in the org (`on`, `locked` for `all`, the org's `switch`) and whether an org
72
- * admin may switch it. Members read it (the workspace pages are read-only for them).
80
+ * admin may switch it. Members read it (the workspace pages are read-only for them). Each has
81
+ * its display name and `icon`, its plugin's icon on the org's catalog route (null without one,
82
+ * or when the org's catalog does not show the plugin to the reader: the share gate holds).
73
83
  */
74
84
  list(org: OrgContext, q: z.infer<typeof OrgComponentListQuery>): Promise<{
75
- components: OrgOfferedComponentView[];
85
+ components: (OrgOfferedComponentView & {
86
+ icon: string | null;
87
+ })[];
76
88
  }>;
77
89
  setSwitch(principal: Principal, org: OrgContext, p: z.infer<typeof ComponentParams>, body: z.infer<typeof SwitchBody>): Promise<{
78
90
  component: OrgComponentView;
@@ -9,6 +9,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
9
9
  };
10
10
  import { Controller, Get, HttpCode, Inject, Post, Put, Req } from "@nestjs/common";
11
11
  import { ApiError } from "../errors.js";
12
+ import { orgIconScope, PluginIcons } from "../extensions/plugin-icons.js";
12
13
  import { CurrentPrincipal, patTokenId, requireUser, SuperAdmin, } from "../identity/principal.js";
13
14
  import { createZodDto } from "../infra/validation/create-zod-dto.js";
14
15
  import { ZBody, ZParam, ZQuery } from "../infra/validation/zod-params.js";
@@ -36,6 +37,16 @@ class ComponentShownBody extends createZodDto(ShownBody, "ComponentShownBody") {
36
37
  }
37
38
  class ComponentSwitchBody extends createZodDto(SwitchBody, "ComponentSwitchBody") {
38
39
  }
40
+ /**
41
+ * Each component with `icon`: its plugin's icon URL on the reader's route (null without one, for
42
+ * a component without a plugin, or when the reader may not see the plugin; maintainer decision
43
+ * 2026-11-09: a connector template without an icon of its own shows its plugin's).
44
+ */
45
+ async function withIcons(icons, rows, scope) {
46
+ const ids = rows.flatMap((r) => (r.itemId === null ? [] : [r.itemId]));
47
+ const urls = await icons.ofItems(ids, scope);
48
+ return rows.map((r) => ({ ...r, icon: r.itemId === null ? null : (urls.get(r.itemId) ?? null) }));
49
+ }
39
50
  const actorOpts = (actor) => {
40
51
  const tokenId = patTokenId(actor);
41
52
  return tokenId !== undefined ? { actorTokenId: tokenId } : {};
@@ -49,9 +60,11 @@ const actorOpts = (actor) => {
49
60
  let AdminComponentsController = class AdminComponentsController {
50
61
  scope;
51
62
  components;
52
- constructor(scope, components) {
63
+ icons;
64
+ constructor(scope, components, icons) {
53
65
  this.scope = scope;
54
66
  this.components = components;
67
+ this.icons = icons;
55
68
  }
56
69
  /**
57
70
  * Updates a platform skill on its own (spec §7.2): the skill package (zip) as the raw body
@@ -73,9 +86,14 @@ let AdminComponentsController = class AdminComponentsController {
73
86
  const actor = requireUser(principal);
74
87
  return this.components.uploadAgentTemplateVersion({ accountId: actor.account.id, ...actorOpts(actor) }, p.id, body.content);
75
88
  }
76
- /** `GET ?kind=`: every platform component of the kind (plugin, owner, scope, version, orgs on). */
89
+ /**
90
+ * `GET ?kind=`: every platform component of the kind (plugin, owner, scope, version, orgs on),
91
+ * each with its display name and its plugin's icon (`icon`, the admin route; null without one).
92
+ */
77
93
  async list(q) {
78
- return { components: await this.scope.list(q.kind) };
94
+ return {
95
+ components: await withIcons(this.icons, await this.scope.list(q.kind), { kind: "admin" }),
96
+ };
79
97
  }
80
98
  /**
81
99
  * A component's versions, newest first: `{ versions: [{ version, catalogVersion, updatedOnOwn,
@@ -178,7 +196,8 @@ AdminComponentsController = __decorate([
178
196
  Controller("api/v1/admin/components"),
179
197
  SuperAdmin(),
180
198
  __param(0, Inject(ComponentScopeService)),
181
- __param(1, Inject(PlatformComponents))
199
+ __param(1, Inject(PlatformComponents)),
200
+ __param(2, Inject(PluginIcons))
182
201
  ], AdminComponentsController);
183
202
  export { AdminComponentsController };
184
203
  /**
@@ -189,21 +208,24 @@ export { AdminComponentsController };
189
208
  */
190
209
  let OrgComponentsController = class OrgComponentsController {
191
210
  scope;
192
- constructor(scope) {
211
+ icons;
212
+ constructor(scope, icons) {
193
213
  this.scope = scope;
214
+ this.icons = icons;
194
215
  }
195
216
  /**
196
217
  * The platform components offered to the org (`?kind=`, `?itemId=`: only those; Task 10): each
197
218
  * with its state in the org (`on`, `locked` for `all`, the org's `switch`) and whether an org
198
- * admin may switch it. Members read it (the workspace pages are read-only for them).
219
+ * admin may switch it. Members read it (the workspace pages are read-only for them). Each has
220
+ * its display name and `icon`, its plugin's icon on the org's catalog route (null without one,
221
+ * or when the org's catalog does not show the plugin to the reader: the share gate holds).
199
222
  */
200
223
  async list(org, q) {
201
- return {
202
- components: await this.scope.orgList(org.orgId, {
203
- ...(q.kind !== undefined && { kind: q.kind }),
204
- ...(q.itemId !== undefined && { itemId: q.itemId }),
205
- }),
206
- };
224
+ const rows = await this.scope.orgList(org.orgId, {
225
+ ...(q.kind !== undefined && { kind: q.kind }),
226
+ ...(q.itemId !== undefined && { itemId: q.itemId }),
227
+ });
228
+ return { components: await withIcons(this.icons, rows, orgIconScope(org)) };
207
229
  }
208
230
  async setSwitch(principal, org, p, body) {
209
231
  const actor = requireUser(principal);
@@ -229,6 +251,7 @@ __decorate([
229
251
  ], OrgComponentsController.prototype, "setSwitch", null);
230
252
  OrgComponentsController = __decorate([
231
253
  Controller("api/v1/orgs/:orgId/components"),
232
- __param(0, Inject(ComponentScopeService))
254
+ __param(0, Inject(ComponentScopeService)),
255
+ __param(1, Inject(PluginIcons))
233
256
  ], OrgComponentsController);
234
257
  export { OrgComponentsController };
@@ -4,12 +4,14 @@ export declare const ComponentKindSchema: z.ZodEnum<{
4
4
  agent_template: "agent_template";
5
5
  connector_template: "connector_template";
6
6
  skill: "skill";
7
+ theme: "theme";
7
8
  }>;
8
9
  export declare const OrgComponentListQuery: z.ZodObject<{
9
10
  kind: z.ZodOptional<z.ZodEnum<{
10
11
  agent_template: "agent_template";
11
12
  connector_template: "connector_template";
12
13
  skill: "skill";
14
+ theme: "theme";
13
15
  }>>;
14
16
  itemId: z.ZodOptional<z.ZodString>;
15
17
  }, z.core.$strict>;
@@ -19,6 +21,7 @@ export declare const ComponentListQuery: z.ZodObject<{
19
21
  agent_template: "agent_template";
20
22
  connector_template: "connector_template";
21
23
  skill: "skill";
24
+ theme: "theme";
22
25
  }>;
23
26
  }, z.core.$strict>;
24
27
  export declare const ComponentParams: z.ZodObject<{
@@ -26,6 +29,7 @@ export declare const ComponentParams: z.ZodObject<{
26
29
  agent_template: "agent_template";
27
30
  connector_template: "connector_template";
28
31
  skill: "skill";
32
+ theme: "theme";
29
33
  }>;
30
34
  id: z.ZodString;
31
35
  }, z.core.$strip>;
@@ -1,8 +1,11 @@
1
+ import type { LocalizedName, ThemeScheme } from "@capybara-hq/plugin-sdk";
1
2
  import { ApiError } from "../errors.js";
2
3
  import { SuperAdminLock } from "../identity/super-admin.js";
3
4
  import { KernelDb } from "../infra/database/kernel-db.js";
4
5
  import { TransactionHost } from "../infra/database/transaction-host.js";
5
6
  import { OrgLock } from "../orgs/org-lock.js";
7
+ import { type ThemeSwatch } from "../themes/theme-state.js";
8
+ import { type ThemePreview } from "../themes/theme-usage.js";
6
9
  import type { ActorOpts } from "./catalog.service.js";
7
10
  import { ComponentPromotion } from "./component-promotion.js";
8
11
  import { type ComponentKind } from "./component-state.js";
@@ -38,7 +41,14 @@ export interface ComponentScopePreview {
38
41
  plugins: string[];
39
42
  /** An agent template's: the owner of each clashing template, in `skills`' order. */
40
43
  owners?: Owner[];
44
+ /** A theme's: the clashing themes on in the org (`skills` then empty). */
45
+ themes?: string[];
41
46
  }[];
47
+ /**
48
+ * A theme the change takes away from some orgs (themes spec §6): the orgs among them whose
49
+ * default it is and how many people picked it. Absent when no theme is taken away.
50
+ */
51
+ themes?: ThemePreview[];
42
52
  scopeHash: string;
43
53
  }
44
54
  /** A component's own scope (`orgs` only with `named`), a disable, or following its plugin again. */
@@ -58,7 +68,13 @@ export type ComponentTarget = {
58
68
  export interface ComponentView {
59
69
  kind: ComponentKind;
60
70
  id: string;
71
+ /** Skill or template name; a connector template's id (the file's base name). */
61
72
  name: string;
73
+ /** A connector template's localized display name (null: show `name`). */
74
+ displayName: {
75
+ zh: string;
76
+ en: string;
77
+ } | null;
62
78
  description: string | null;
63
79
  /** The plugin it came from (null: none). */
64
80
  plugin: string | null;
@@ -91,6 +107,11 @@ export interface ComponentView {
91
107
  * other scopes, builtin plugins and orgs' own rows.
92
108
  */
93
109
  offCount: number;
110
+ /** A theme: its name and swatches from its current version (absent for other kinds). */
111
+ theme?: {
112
+ name: LocalizedName;
113
+ swatches: Partial<Record<ThemeScheme, ThemeSwatch>>;
114
+ };
94
115
  }
95
116
  /** One version of a platform component (`GET admin/components/:kind/:id/versions`). */
96
117
  export interface ComponentVersionView {
@@ -111,7 +132,10 @@ export interface OrgComponentView {
111
132
  /** The org's switch (null: never switched). */
112
133
  switch: boolean | null;
113
134
  on: boolean;
114
- /** Of a builtin plugin: it cannot be switched off (an `all` one can, layering spec §4). */
135
+ /**
136
+ * Of a builtin plugin, or the platform default theme (themes spec §7): it cannot be switched off
137
+ * (an `all` one can, layering spec §4).
138
+ */
115
139
  locked: boolean;
116
140
  }
117
141
  /**
@@ -120,6 +144,11 @@ export interface OrgComponentView {
120
144
  * show with their switches. Never a component the org cannot see.
121
145
  */
122
146
  export interface OrgOfferedComponentView extends OrgComponentView {
147
+ /** A connector template's localized display name (null: show `name`). */
148
+ displayName: {
149
+ zh: string;
150
+ en: string;
151
+ } | null;
123
152
  description: string | null;
124
153
  itemId: string | null;
125
154
  version: string;
@@ -157,6 +186,11 @@ export type ComponentSwitchResult = {
157
186
  refs: string[];
158
187
  }[];
159
188
  connectorsKept: number;
189
+ /**
190
+ * A theme: whether it is the org's default and how many of its members picked it (themes
191
+ * spec §6). Absent for other kinds and for a theme nobody there chose.
192
+ */
193
+ themes?: ThemePreview[];
160
194
  };
161
195
  confirm: string;
162
196
  };
@@ -166,6 +200,8 @@ type AuditOpts = ActorOpts & {
166
200
  };
167
201
  /**
168
202
  * 409 `plugin.skill_conflict` listing the orgs whose own skills use a component's name (rule 10);
203
+ * for a theme 409 `theme.id_taken` listing the orgs where another theme with its id is on (details
204
+ * `[{ theme, orgId, themes, plugins }]`);
169
205
  * for an agent template 409 `agent_template.name_taken` listing the orgs that already use its
170
206
  * roster type (ruling P4-13; details `[{ orgId, type, templateId, owner }]`, one per clashing
171
207
  * template, `owner` as save-as names it).
@@ -181,10 +217,11 @@ export declare function nameConflictError(conflicts: ComponentScopePreview["conf
181
217
  * An org admin switches one component on or off in the org (only that component, rule 5); one of a
182
218
  * builtin plugin -> 409 `plugin.scope_locked` (an `all` one may go off, layering spec §4); switching
183
219
  * off something in use is previewed with its agents first.
184
- * Name clashes are checked for skills only: an org agent template always carries its plugin's
185
- * type, so one with a platform template's type is a copy of it. Components are resolved at read
186
- * time (skills/usable.ts, agents/templates.ts), so nothing is enqueued. Stateless, shared by every
187
- * replica.
220
+ * Name clashes are checked for skills, agent templates by their roster type, and themes by their
221
+ * id among the themes on in an org (themes spec §6). A change that would take the platform default
222
+ * theme away from an org is refused (409 `theme.platform_default`, themes spec §7). Components are
223
+ * resolved at read time (skills/usable.ts, agents/templates.ts), so nothing is enqueued.
224
+ * Stateless, shared by every replica.
188
225
  */
189
226
  export declare class ComponentScopeService {
190
227
  private readonly kdb;
@@ -203,7 +240,7 @@ export declare class ComponentScopeService {
203
240
  /**
204
241
  * What the admin routes act on (ruling P3-23): the platform component `id`, an org row the org
205
242
  * promoted already (its platform row), or an org's own row not promoted yet. A connector
206
- * template has no org rows; anything else -> 404 `component.not_found`.
243
+ * template or a theme has no org rows; anything else -> 404 `component.not_found`.
207
244
  */
208
245
  private resolve;
209
246
  /**
@@ -224,12 +261,13 @@ export declare class ComponentScopeService {
224
261
  /**
225
262
  * The org's copies of platform skills or agent templates linked without a pin (ruling B2), by
226
263
  * platform id: they resolve to it, so agents that select them use it (none for connector
227
- * templates).
264
+ * templates and themes).
228
265
  */
229
266
  private linkedCopies;
230
267
  /**
231
268
  * The orgs' own skills (org scope) and agent templates, not linked to a platform component
232
- * (ruling P2-11): listed read-only, on in their org only. Connector templates have none.
269
+ * (ruling P2-11): listed read-only, on in their org only. Connector templates have none; an
270
+ * org's own theme is a platform_themes row with its org as owner, listed with the platform ones.
233
271
  */
234
272
  private orgOwned;
235
273
  /** The preview of a scope change, a disable or a return to following the plugin (nothing written). */
@@ -257,7 +295,8 @@ export declare class ComponentScopeService {
257
295
  * The org admin's switch of one component (`PUT orgs/:orgId/components/:kind/:id/switch`): only
258
296
  * this component (rule 5). A component not offered to the org -> 404. On: refused while the
259
297
  * component or its plugin is disabled (`plugin.disabled`) or an own skill of the org has its name
260
- * (`plugin.skill_conflict`, rule 10). Off: of a builtin plugin -> `plugin.scope_locked`; while it
298
+ * (`plugin.skill_conflict`, rule 10; a theme: `theme.id_taken`). Off: the platform default theme
299
+ * while it is on -> `theme.platform_default`; of a builtin plugin -> `plugin.scope_locked`; while it
261
300
  * is on, without `confirm` the preview (agents that use it) and its hash are returned, with the
262
301
  * current hash the switch is written (a changed preview -> `plugin.switch_stale`).
263
302
  */
@@ -314,6 +353,17 @@ export declare class ComponentScopeService {
314
353
  * (an org row not promoted yet: `[owner]`), else read.
315
354
  */
316
355
  private targetOf;
356
+ /**
357
+ * 409 `theme.platform_default` when theme `c` is the platform default and `t` would leave it
358
+ * narrower than `all` or gone (themes spec §7), in the caller's transaction, before any write.
359
+ */
360
+ private assertKeepsPlatformDefault;
361
+ /**
362
+ * Theme `c`'s availability under `t`: gone when disabled (or its plugin is disabled or deleted
363
+ * while it follows it), else `all` when its effective scope (its own, or its plugin's; builtin:
364
+ * `all`) is `all`, else narrower.
365
+ */
366
+ private themeAfter;
317
367
  /** Live orgs (`only`: that one), sorted by id. */
318
368
  private liveOrgs;
319
369
  private on;