@capybara-hq/kernel 0.1.0-rc.77 → 0.1.0-rc.78

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 (228) hide show
  1. package/bootstrap.json +6 -6
  2. package/dist/admin/outbox-dead.service.js +4 -1
  3. package/dist/agents/admin-agents.js +2 -0
  4. package/dist/agents/agent-lookup.js +4 -0
  5. package/dist/agents/agent-profile.service.js +3 -0
  6. package/dist/agents/agents.service.js +7 -0
  7. package/dist/agents/org-templates.js +1 -0
  8. package/dist/agents/pending-connector-requests.js +6 -0
  9. package/dist/agents/pending-connectors.service.js +2 -0
  10. package/dist/agents/readiness.service.d.ts +9 -3
  11. package/dist/agents/readiness.service.js +3 -3
  12. package/dist/agents/templates.js +1 -0
  13. package/dist/background/finish.js +3 -0
  14. package/dist/background/stop.js +2 -0
  15. package/dist/background/store.js +44 -0
  16. package/dist/background/tasks.service.js +3 -2
  17. package/dist/background/wake-rules.js +1 -0
  18. package/dist/catalog/admin-catalog.controller.d.ts +6 -0
  19. package/dist/catalog/admin-catalog.controller.js +13 -0
  20. package/dist/catalog/catalog-content.d.ts +6 -0
  21. package/dist/catalog/catalog-content.js +1 -0
  22. package/dist/catalog/catalog-items.js +4 -0
  23. package/dist/catalog/catalog-scope.service.js +4 -1
  24. package/dist/catalog/component-promotion.js +2 -0
  25. package/dist/catalog/component-scope.controller.d.ts +9 -15
  26. package/dist/catalog/component-scope.controller.js +14 -9
  27. package/dist/catalog/component-scope.service.js +5 -0
  28. package/dist/catalog/component-state.js +2 -0
  29. package/dist/catalog/marketplaces.service.d.ts +6 -1
  30. package/dist/catalog/marketplaces.service.js +8 -3
  31. package/dist/catalog/org-catalog.controller.d.ts +9 -0
  32. package/dist/catalog/org-catalog.controller.js +18 -0
  33. package/dist/catalog/org-catalog.schemas.d.ts +2 -4
  34. package/dist/catalog/org-catalog.schemas.js +2 -3
  35. package/dist/catalog/org-catalog.service.d.ts +10 -1
  36. package/dist/catalog/org-catalog.service.js +34 -23
  37. package/dist/catalog/org-extension-switch.d.ts +3 -10
  38. package/dist/catalog/org-extension-switch.js +14 -60
  39. package/dist/catalog/org-extension.controller.d.ts +6 -7
  40. package/dist/catalog/org-extension.controller.js +4 -4
  41. package/dist/catalog/org-extension.schemas.d.ts +1 -2
  42. package/dist/catalog/org-extension.schemas.js +1 -3
  43. package/dist/catalog/owned-items.js +10 -1
  44. package/dist/catalog/ownership.js +2 -0
  45. package/dist/catalog/plugin-import.js +8 -0
  46. package/dist/catalog/plugin-install.d.ts +1 -4
  47. package/dist/catalog/plugin-install.js +11 -12
  48. package/dist/catalog/plugin-upgrade.js +4 -1
  49. package/dist/catalog/request-rules.js +6 -0
  50. package/dist/catalog/requests.service.js +4 -0
  51. package/dist/catalog/scope-orgs.js +1 -0
  52. package/dist/catalog/scope-sync.d.ts +8 -5
  53. package/dist/catalog/scope-sync.js +21 -23
  54. package/dist/catalog/unshare.js +3 -0
  55. package/dist/channels/connections.service.js +1 -0
  56. package/dist/channels/inbound.js +1 -0
  57. package/dist/channels/jobs.js +1 -0
  58. package/dist/channels/outbound.js +6 -0
  59. package/dist/channels/supervisor.js +1 -0
  60. package/dist/channels/threads.js +1 -0
  61. package/dist/client/client-reports.service.js +1 -0
  62. package/dist/config/fields.js +20 -4
  63. package/dist/conversations/access.js +1 -0
  64. package/dist/conversations/attachments.service.js +16 -4
  65. package/dist/conversations/conversations.service.js +17 -3
  66. package/dist/conversations/event-log.js +2 -0
  67. package/dist/conversations/events.d.ts +1 -0
  68. package/dist/conversations/events.js +3 -1
  69. package/dist/conversations/files.js +3 -2
  70. package/dist/conversations/permission-profiles.service.js +1 -0
  71. package/dist/conversations/prompt-suggestions.js +2 -0
  72. package/dist/conversations/queue.js +8 -0
  73. package/dist/conversations/queue.service.js +6 -2
  74. package/dist/conversations/source.js +2 -0
  75. package/dist/conversations/titles.js +10 -2
  76. package/dist/conversations/tree.js +6 -0
  77. package/dist/db/kernel-schema.d.ts +3 -1
  78. package/dist/devices/conversation-devices.js +3 -0
  79. package/dist/devices/device-projects.service.js +2 -0
  80. package/dist/devices/devices.service.js +5 -0
  81. package/dist/devices/legacy-cleanup.job.js +5 -2
  82. package/dist/dial-in/handlers.js +2 -0
  83. package/dist/dial-in/machines.js +11 -2
  84. package/dist/dial-in/targets.d.ts +0 -2
  85. package/dist/dial-in/targets.js +0 -10
  86. package/dist/errors.d.ts +0 -1
  87. package/dist/errors.js +0 -1
  88. package/dist/evals/budget.js +14 -1
  89. package/dist/evals/run-replay.js +4 -0
  90. package/dist/evals/runs.service.js +13 -7
  91. package/dist/evals/sets.service.js +23 -8
  92. package/dist/evals/trajectory.service.d.ts +1 -1
  93. package/dist/evals/trajectory.service.js +1 -0
  94. package/dist/evals/worker.js +5 -1
  95. package/dist/extensions/admin-ops.js +1 -0
  96. package/dist/extensions/admin-view.js +3 -1
  97. package/dist/extensions/bootstrap-packages.d.ts +12 -1
  98. package/dist/extensions/bootstrap-packages.js +49 -9
  99. package/dist/extensions/bootstrap.d.ts +17 -2
  100. package/dist/extensions/bootstrap.js +41 -9
  101. package/dist/extensions/config-json-schema.d.ts +2 -2
  102. package/dist/extensions/config-json-schema.js +1 -3
  103. package/dist/extensions/deployment-config.d.ts +5 -3
  104. package/dist/extensions/deployment-config.js +3 -3
  105. package/dist/extensions/effective-config.d.ts +8 -7
  106. package/dist/extensions/effective-config.js +8 -7
  107. package/dist/extensions/enabled.js +1 -0
  108. package/dist/extensions/host.d.ts +4 -3
  109. package/dist/extensions/host.js +11 -12
  110. package/dist/extensions/instance.d.ts +1 -1
  111. package/dist/extensions/instance.js +17 -2
  112. package/dist/extensions/org-config.d.ts +35 -97
  113. package/dist/extensions/org-config.js +48 -315
  114. package/dist/extensions/org-levels.d.ts +22 -9
  115. package/dist/extensions/org-levels.js +100 -20
  116. package/dist/extensions/org-overrides.d.ts +14 -15
  117. package/dist/extensions/org-overrides.js +20 -20
  118. package/dist/extensions/package.js +1 -1
  119. package/dist/extensions/permission-set.d.ts +1 -3
  120. package/dist/extensions/permission-set.js +3 -7
  121. package/dist/extensions/permission-view.d.ts +3 -1
  122. package/dist/extensions/permission-view.js +5 -4
  123. package/dist/extensions/plugin-icons.d.ts +72 -1
  124. package/dist/extensions/plugin-icons.js +194 -2
  125. package/dist/extensions/point-defaults.d.ts +17 -18
  126. package/dist/extensions/point-defaults.js +25 -28
  127. package/dist/identity/accounts.js +6 -0
  128. package/dist/identity/api-tokens.js +8 -0
  129. package/dist/infra/outbox/outbox.dispatcher.js +4 -1
  130. package/dist/infra/outbox/outbox.service.js +2 -0
  131. package/dist/orgs/directory-sync.d.ts +9 -6
  132. package/dist/orgs/directory-sync.js +15 -12
  133. package/dist/orgs/invitations.service.js +2 -0
  134. package/dist/orgs/members.service.js +2 -0
  135. package/dist/orgs/offboarding.js +2 -0
  136. package/dist/packages/npm.d.ts +9 -1
  137. package/dist/packages/npm.js +37 -5
  138. package/dist/platform/exclusions.js +20 -0
  139. package/dist/platform/ops/admin-items.ops.js +1 -0
  140. package/dist/platform/ops/agents.ops.js +1 -0
  141. package/dist/platform/ops/extensions.ops.d.ts +6 -8
  142. package/dist/platform/ops/extensions.ops.js +18 -97
  143. package/dist/platform/ops/org-plugins.ops.d.ts +3 -6
  144. package/dist/platform/ops/org-plugins.ops.js +14 -65
  145. package/dist/platform/ops/outbox.ops.js +1 -0
  146. package/dist/platform/ops/person-inputs.d.ts +0 -4
  147. package/dist/platform/ops/person-inputs.js +0 -8
  148. package/dist/platform/ops/plugins.ops.d.ts +4 -1
  149. package/dist/platform/ops/plugins.ops.js +27 -34
  150. package/dist/platform/person-fields.d.ts +1 -1
  151. package/dist/platform/person-fields.js +1 -1
  152. package/dist/platform/sealed-reveals.js +2 -0
  153. package/dist/push/recipients.js +9 -2
  154. package/dist/runtime/permission-context.service.js +1 -0
  155. package/dist/runtime/plugin-context.service.js +1 -0
  156. package/dist/runtime/project/knowledge.service.js +1 -0
  157. package/dist/runtime/run-context.service.js +1 -0
  158. package/dist/runtime/run-deletion.js +4 -0
  159. package/dist/runtime/run-execution.js +2 -0
  160. package/dist/runtime/run-finish.js +3 -0
  161. package/dist/runtime/run-jobs.js +3 -0
  162. package/dist/runtime/run-orphan-check.job.js +7 -0
  163. package/dist/runtime/run-queue.js +21 -2
  164. package/dist/runtime/run-worker.js +5 -0
  165. package/dist/runtime/step-log.js +1 -0
  166. package/dist/runtime/subagents/child.js +2 -0
  167. package/dist/runtime/subagents/deliveries.js +3 -0
  168. package/dist/runtime/subagents/dispatch.js +5 -1
  169. package/dist/runtime/subagents/messages.js +2 -0
  170. package/dist/runtime/subagents/org-agents.d.ts +1 -1
  171. package/dist/runtime/subagents/org-agents.js +2 -1
  172. package/dist/runtime/usage-report-jobs.js +1 -0
  173. package/dist/runtime/usage-report.js +3 -0
  174. package/dist/runtime/waits.js +5 -0
  175. package/dist/sandbox/cloud-permission-snapshot.js +9 -3
  176. package/dist/sandbox/device-reports.js +3 -0
  177. package/dist/sandbox/legacy-retirement.js +5 -1
  178. package/dist/sandbox/managed-device-context.js +1 -0
  179. package/dist/sandbox/modes.d.ts +5 -2
  180. package/dist/sandbox/modes.js +8 -4
  181. package/dist/sandbox/network-grants.js +2 -0
  182. package/dist/sandbox/operation-intents.js +58 -0
  183. package/dist/sandbox/operation-reconcile.job.js +2 -0
  184. package/dist/sandbox/permission-authority-lock.js +12 -6
  185. package/dist/sandbox/permission-call-grants.js +6 -0
  186. package/dist/sandbox/permission-ceiling-writes.js +5 -0
  187. package/dist/sandbox/permission-config-publication.js +5 -0
  188. package/dist/sandbox/permission-instance-writes.js +4 -0
  189. package/dist/sandbox/permission-runtime-reports.js +10 -1
  190. package/dist/sandbox/permission-transitions.js +3 -0
  191. package/dist/sandbox/review/review.service.js +8 -5
  192. package/dist/sandbox/sandbox.service.d.ts +14 -0
  193. package/dist/sandbox/sandbox.service.js +195 -29
  194. package/dist/sandbox/unreachable.js +4 -1
  195. package/dist/schedules/fire.js +9 -3
  196. package/dist/schedules/pause.js +2 -0
  197. package/dist/schedules/run-tracker.js +16 -1
  198. package/dist/schedules/scheduled-tasks.service.js +4 -2
  199. package/dist/schedules/store.js +8 -0
  200. package/dist/schedules/unattended.js +4 -0
  201. package/dist/setup/setup-checks.service.d.ts +1 -10
  202. package/dist/setup/setup-checks.service.js +19 -29
  203. package/dist/shares/share-open.service.js +1 -0
  204. package/dist/shares/shares.service.js +2 -0
  205. package/dist/skills/agent-skills.service.d.ts +1 -1
  206. package/dist/skills/agent-skills.service.js +13 -2
  207. package/dist/skills/catalog.js +3 -0
  208. package/dist/skills/changes.service.js +10 -2
  209. package/dist/skills/conversation-catalog.js +1 -0
  210. package/dist/skills/skills.service.js +4 -0
  211. package/dist/tools/approvals.service.js +40 -0
  212. package/dist/tools/builtins/schedules.js +11 -6
  213. package/dist/tools/builtins/web/fetch.js +1 -1
  214. package/dist/tools/builtins/web/search.js +1 -1
  215. package/dist/tools/connector-account-policies.js +3 -0
  216. package/dist/tools/connectors.controller.d.ts +20 -8
  217. package/dist/tools/connectors.controller.js +30 -12
  218. package/dist/tools/connectors.service.d.ts +8 -0
  219. package/dist/tools/connectors.service.js +21 -1
  220. package/dist/tools/drift.js +5 -0
  221. package/dist/tools/git-push-policy.js +3 -0
  222. package/dist/tools/oauth/flow.js +1 -0
  223. package/dist/tools/outputs.js +2 -0
  224. package/dist/tools/permission-approval-jobs.js +3 -0
  225. package/dist/tools/pipeline.js +2 -0
  226. package/dist/tools/policy.js +3 -0
  227. package/dist/tools/questions.service.js +13 -0
  228. package/package.json +3 -3
@@ -1,36 +1,29 @@
1
1
  import type { PluginScope } from "../catalog/scope.js";
2
- import { type Keyring } from "../ctx/secrets.js";
3
2
  import type { KernelSchemaDb } from "../db/kernel-schema.js";
4
3
  import { KernelDb } from "../infra/database/kernel-db.js";
5
4
  import { TransactionHost } from "../infra/database/transaction-host.js";
6
5
  import { KernelEvents } from "../infra/events/kernel-events.js";
7
- import type { KernelLogger } from "../log.js";
8
6
  import { OrgLock } from "../orgs/org-lock.js";
9
- import { type ConfigIssue, toIssues } from "./config-issues.js";
10
- import { type JsonSchema } from "./config-json-schema.js";
11
7
  import { EffectiveConfigs } from "./effective-config.js";
12
8
  import { ExtensionHost } from "./host.js";
13
9
  import { ExtensionInstalls } from "./installs.js";
14
10
  import { type DeploymentExtensionStatus, type PermissionGroup } from "./permission-view.js";
15
11
  import { ExtensionAvailability, type ExtensionUnavailableReason } from "./unavailable.js";
16
- export { type ConfigIssue, toIssues };
17
- /** 组织视角下一个已加载插件的状态;`config` 永远不含密钥字段,密钥只回显「是否已设置」。 */
12
+ /**
13
+ * An org's view of one extension: its state in the org, never a config value (an org's config is
14
+ * its copy of the overridable deployment fields, read through the overrides route).
15
+ */
18
16
  export interface OrgExtensionView {
19
17
  plugin: string;
20
18
  version: string;
21
19
  enabled: boolean;
22
- /** 插件是否声明了 `config.org`。 */
20
+ /**
21
+ * The org can configure it: its deployment schema has at least one org-overridable field (spec
22
+ * §5.4). False when unavailable.
23
+ */
23
24
  configurable: boolean;
24
- /** 已存的非密钥配置;未配置或不可配置时为 null。 */
25
- config: Record<string, unknown> | null;
26
- secrets: {
27
- path: string;
28
- set: boolean;
29
- }[];
30
25
  /** 插件要用的权限,按类别分组并标出敏感项(密钥、公开路由、工具、hook)。 */
31
26
  permissions: PermissionGroup[];
32
- /** `config.org` 的 JSON Schema(密钥字段带 `x-secret`);不可配置时为 null。 */
33
- orgConfigSchema: JsonSchema | null;
34
27
  /**
35
28
  * 插件此刻在部署上可用(已加载)。false:已安装但在部署上停用(或尚未加载),组织页显示「不可用」,
36
29
  * 组织的启用开关保留不变(不能修改),其余字段为空。
@@ -48,7 +41,7 @@ export interface OrgExtensionView {
48
41
  reason?: ExtensionUnavailableReason;
49
42
  /**
50
43
  * A required bootstrap plugin: enabled in every org (`enabled` is always true) and cannot be
51
- * disabled here (`extension.required`); its org config, when it has one, can still be set. An
44
+ * disabled here (`extension.required`); its overridable fields can still be copied. An
52
45
  * extension of a builtin plugin is enabled in every org as well (`enabled.ts`) without being
53
46
  * required: it is locked by its plugin (`switchable` false, `plugin.scope_locked`).
54
47
  */
@@ -67,16 +60,15 @@ export interface OrgExtensionView {
67
60
  overrideState: "following" | "copy" | "none";
68
61
  /**
69
62
  * The org must configure the extension before it works here (spec A §6): its effective config
70
- * is not valid, or a required org-only field is missing. Always false when unavailable.
63
+ * for the org is not valid. Always false when unavailable.
71
64
  */
72
65
  needsConfig: boolean;
73
66
  }
74
67
  /** The extension points an extension provides, from its permission list's `provides` group. */
75
68
  export declare function providesOf(view: Pick<OrgExtensionView, "permissions">): string[];
76
- /** `put` 的输入:`config` 中的密钥字段缺省 = 保留原值、`null` = 清除、其他值 = 新值。 */
69
+ /** The input of `put`: enablement only. */
77
70
  export interface OrgExtensionInput {
78
71
  enabled?: boolean | undefined;
79
- config?: Record<string, unknown> | undefined;
80
72
  /** Disable even when enabled dependents remain (default `extension.has_dependents`). */
81
73
  force?: boolean | undefined;
82
74
  }
@@ -96,7 +88,7 @@ export interface OrgExtensionPutOptions {
96
88
  approvedBy?: string;
97
89
  /**
98
90
  * For a plugin install: when the extension is already enabled under the org row lock, nothing is
99
- * written (no config change, no audit) and `skipped` is set to true. "Enabled before" and
91
+ * written (no audit) and `skipped` is set to true. "Enabled before" and
100
92
  * "enabled now" are decided under the lock, so a concurrent enable cannot race it. A caller that
101
93
  * records the extension in the same transaction (the catalog install, `put` joins its
102
94
  * transaction) reads `skipped` after `put` returns: no concurrent uninstall fits in between.
@@ -104,37 +96,19 @@ export interface OrgExtensionPutOptions {
104
96
  ifDisabled?: {
105
97
  skipped: boolean;
106
98
  };
107
- /**
108
- * Check the role and the config (the given `config`, or with `enabled: true` the stored one,
109
- * merged with the stored secrets, against the schema) and write nothing: lets a caller that must
110
- * do another write first fail without a side effect. The rules for newly enabling (catalog policy,
111
- * dependencies) are left to that write: the plugin install that enables it checks them.
112
- */
113
- validateOnly?: boolean;
114
99
  /** Merged into the audit detail (a Platform operation's `via: "agent"`). */
115
100
  auditDetail?: Record<string, unknown>;
116
101
  }
117
102
  /**
118
- * An org's stored config of a plugin no longer matches its org schema (e.g. after a plugin upgrade):
119
- * a known state, not a read error. The message names the plugin, the org and the failing paths,
120
- * never the values.
121
- */
122
- export declare class OrgConfigInvalidError extends Error {
123
- readonly plugin: string;
124
- readonly orgId: string;
125
- constructor(plugin: string, orgId: string, detail: string);
126
- }
127
- /**
128
- * Org-level extension config: enablement and the `config.org` config stored per org.
129
- * The non-secret part is stored in `capybara.extension_org_configs.config`; each secret field is
130
- * encrypted separately in `capybara.secrets` (namespace `kernel`, key `plugin-config:<plugin>:<path>`),
131
- * written in the same transaction as the config row.
103
+ * Org-level extension enablement (`capybara.extension_org_configs.enabled`) and the org's view of
104
+ * each extension. An org's config of an extension is its copy of the overridable deployment fields
105
+ * (`OrgOverrides`, `EffectiveConfigs`); the retired `config` column and the `plugin-config:` org
106
+ * secrets are neither read nor written (spec §5.4; dropped by a later contract migration).
132
107
  * No in-process state: every call reads PG, safe with multiple replicas.
133
108
  */
134
109
  export declare class OrgExtensionConfigs {
135
110
  private readonly kdb;
136
111
  readonly txHost: TransactionHost;
137
- private readonly keyring;
138
112
  private readonly host;
139
113
  /** The org row lock (orgs/org-lock.ts): joins the transaction. */
140
114
  private readonly orgLock;
@@ -142,50 +116,42 @@ export declare class OrgExtensionConfigs {
142
116
  private readonly installs;
143
117
  /** `extension.org-disabled` after a disable commits (channel connections drop at once). */
144
118
  private readonly events;
145
- /** Secret values handled (written or decrypted) are masked in the logs after the commit. */
146
- private readonly log;
147
119
  /** The effective deployment config of each org (spec A §6): read for `needsConfig`. */
148
120
  private readonly effective;
149
121
  /** Why an installed extension is not loaded (`status` / `reason` of the unavailable ones). */
150
122
  private readonly availability;
151
- /** Test seam only: a deterministic interleaving point after the config rows are read, before the secrets. */
152
- afterConfigRowRead: (() => Promise<void>) | undefined;
153
- constructor(kdb: KernelDb, txHost: TransactionHost, keyring: Keyring, host: ExtensionHost,
123
+ constructor(kdb: KernelDb, txHost: TransactionHost, host: ExtensionHost,
154
124
  /** The org row lock (orgs/org-lock.ts): joins the transaction. */
155
125
  orgLock: OrgLock,
156
126
  /** Install records (any desired state): the ones not loaded are listed unavailable (T14). */
157
127
  installs: ExtensionInstalls,
158
128
  /** `extension.org-disabled` after a disable commits (channel connections drop at once). */
159
129
  events: KernelEvents,
160
- /** Secret values handled (written or decrypted) are masked in the logs after the commit. */
161
- log: KernelLogger,
162
130
  /** The effective deployment config of each org (spec A §6): read for `needsConfig`. */
163
131
  effective: EffectiveConfigs,
164
132
  /** Why an installed extension is not loaded (`status` / `reason` of the unavailable ones). */
165
133
  availability: ExtensionAvailability);
166
134
  /** The kernel-schema handle of the current transaction. */
167
135
  private get db();
168
- /** 把一份组织配置里的密钥值登记到日志打码(无密钥时无操作);调用方须在事务提交后调用。 */
169
- private reportSecrets;
170
136
  /** After a write committed: a disabled extension's channel connections drop at once. */
171
137
  private afterPut;
172
138
  /**
173
- * The state of every loaded extension the org sees, in load order (no row: `enabled` false,
174
- * `config` null), then the installed extensions not loaded right now (disabled on the deployment
175
- * and the like) as `available: false`, sorted by name. The rows and secrets are read in a
176
- * `requires_new` snapshot on a second pool connection: never call it inside a transaction that
177
- * holds a pool connection (unlike {@link get}, it does not join one).
139
+ * The state of every loaded extension the org sees, in load order (no row: `enabled` false),
140
+ * then the installed extensions not loaded right now (disabled on the deployment and the like)
141
+ * as `available: false`, sorted by name. The rows are read in a `requires_new` snapshot on a
142
+ * second pool connection: never call it inside a transaction that holds a pool connection
143
+ * (unlike {@link get}, it does not join one).
178
144
  */
179
145
  list(orgId: string): Promise<OrgExtensionView[]>;
180
146
  /**
181
- * Fills `overrideState` and the platform half of `needsConfig` (spec A §6) for the views of
182
- * extensions with overridable fields (the others always run with the platform's config, which
147
+ * Fills `overrideState` and `needsConfig` (spec A §6: the effective config alone) for the views
148
+ * of extensions with overridable fields (the others always run with the platform's config, which
183
149
  * loaded valid). Reads the org's copy rows once and the effective config of each such extension.
184
150
  */
185
151
  private withLayers;
186
152
  /**
187
- * `REPEATABLE READ` read-only: the config rows and the secrets come from one snapshot. It is
188
- * `requires_new`: it always takes a second pool connection, so never call `list` inside a
153
+ * `REPEATABLE READ` read-only: the enablement rows and the plugin items come from one snapshot.
154
+ * It is `requires_new`: it always takes a second pool connection, so never call `list` inside a
189
155
  * transaction that holds one (a locked transaction waiting on the pool can starve it; `get`
190
156
  * joins the caller's transaction instead).
191
157
  */
@@ -206,15 +172,12 @@ export declare class OrgExtensionConfigs {
206
172
  itemId: string;
207
173
  }>;
208
174
  /**
209
- * Writes enablement and / or config. The actor's role is re-read under the org row lock (needs
175
+ * Writes enablement. The actor's role is re-read under the org row lock (needs
210
176
  * `org.extensions.manage`).
211
- * - Extension not loaded -> `extension.not_found`; `config` given but the extension has no
212
- * `config.org` -> `extension.no_org_config`; `enabled: false` for a required bootstrap plugin
213
- * -> `extension.required` (it stays enabled in every org; its config can still be written).
214
- * - Non-secret fields are replaced as a whole by the given value; secret fields keep the old value
215
- * when omitted, `null` clears, any other value is the new value.
216
- * - The merged full config (or, without `config`, the existing config when the result is enabled)
217
- * does not satisfy the schema -> `extension.config_invalid`.
177
+ * - Extension not loaded -> `extension.not_found`; `enabled: false` for a required bootstrap
178
+ * plugin -> `extension.required` (it stays enabled in every org).
179
+ * - Enabling never checks a config: an extension whose effective config is not valid for the org
180
+ * is enabled and reported `needsConfig` (spec A §6: it gets no org-bound call until then).
218
181
  */
219
182
  put(orgId: string, plugin: string, input: OrgExtensionInput,
220
183
  /** null: the kernel itself (the plugin scope sync installing a plugin), no role check. */
@@ -227,31 +190,14 @@ export declare class OrgExtensionConfigs {
227
190
  */
228
191
  private assertSwitchRules;
229
192
  /**
230
- * 读取并解密某插件在该组织下的完整配置(供运行时按组织构造插件实例)。
231
- * An always-on extension (a required bootstrap plugin, or its plugin is builtin: `enabled.ts`) is
232
- * enabled without a row (its stored config, or `{}`, is validated).
233
- * 无记录 → undefined;插件无 `config.org` 或已停用(`enabled=false`,不校验、不读密钥)时 `config` 为 null。
234
- * Inside a caller's transaction it joins that transaction (its connection and isolation, and it
235
- * sees the caller's uncommitted writes): the config row and its secrets are consistent there when
236
- * the caller holds the org row, as every writer of org configs and their secrets locks it first.
237
- * On its own it reads them in one `REPEATABLE READ` read-only snapshot.
238
- * A stored config that no longer matches the schema (e.g. after a plugin upgrade) throws
239
- * {@link OrgConfigInvalidError} (plugin, org ID and the failing paths, no values); other errors are
240
- * read errors.
193
+ * Whether `plugin` is enabled in the org: an always-on extension (a required bootstrap plugin, or
194
+ * its plugin is builtin: `enabled.ts`) is enabled without a row; no row otherwise -> undefined.
195
+ * Inside a caller's transaction it reads in that transaction (it sees the caller's uncommitted
196
+ * writes). The extension's config for the org is its effective config ({@link EffectiveConfigs}).
241
197
  */
242
198
  get(orgId: string, plugin: string): Promise<{
243
199
  enabled: boolean;
244
- config: unknown;
245
200
  } | undefined>;
246
- /**
247
- * On its own, `REPEATABLE READ` read-only: the config row and the secrets come from one snapshot.
248
- * Inside a caller's transaction it reads in that transaction instead (`required`; consistent when
249
- * the caller holds the org row, see {@link get}): a caller holding a
250
- * connection never waits for a second one from the pool (the device provider check runs inside
251
- * locked transactions; concurrent runs would starve the pool).
252
- */
253
- private getSnapshot;
254
- private decode;
255
201
  /**
256
202
  * 该组织里已启用、且所 requires 的按组织启用的能力只剩这个插件提供的插件(停用它会让它们失去依赖)。
257
203
  * 在调用方事务里读(应用卸载 / 回滚前判断是否保留;`mandatory`: the caller holds the org row lock).
@@ -277,14 +223,6 @@ export declare class OrgExtensionConfigs {
277
223
  private manifest;
278
224
  private permissionsOf;
279
225
  private view;
280
- /**
281
- * The org schema's form JSON Schema, a copy (`x-ui` stripped when its hints are invalid; the host
282
- * warns at load). Never throws: a hint conversion that throws serves the plain schema, or null
283
- * (one warning per schema on this replica), so one hand-made package cannot fail the org's list.
284
- */
285
- private formSchema;
286
- /** 该组织在 `kernel` 命名空间下已设置的插件配置密钥键(不解密)。 */
287
- private setSecretKeys;
288
226
  }
289
227
  /**
290
228
  * Whether the org may see `plugin` (a required bootstrap plugin always; else under its catalog