@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.
- package/bootstrap.json +6 -6
- package/dist/admin/outbox-dead.service.js +4 -1
- package/dist/agents/admin-agents.js +2 -0
- package/dist/agents/agent-lookup.js +4 -0
- package/dist/agents/agent-profile.service.js +3 -0
- package/dist/agents/agents.service.js +7 -0
- package/dist/agents/org-templates.js +1 -0
- package/dist/agents/pending-connector-requests.js +6 -0
- package/dist/agents/pending-connectors.service.js +2 -0
- package/dist/agents/readiness.service.d.ts +9 -3
- package/dist/agents/readiness.service.js +3 -3
- package/dist/agents/templates.js +1 -0
- package/dist/background/finish.js +3 -0
- package/dist/background/stop.js +2 -0
- package/dist/background/store.js +44 -0
- package/dist/background/tasks.service.js +3 -2
- package/dist/background/wake-rules.js +1 -0
- package/dist/catalog/admin-catalog.controller.d.ts +6 -0
- package/dist/catalog/admin-catalog.controller.js +13 -0
- package/dist/catalog/catalog-content.d.ts +6 -0
- package/dist/catalog/catalog-content.js +1 -0
- package/dist/catalog/catalog-items.js +4 -0
- package/dist/catalog/catalog-scope.service.js +4 -1
- package/dist/catalog/component-promotion.js +2 -0
- package/dist/catalog/component-scope.controller.d.ts +9 -15
- package/dist/catalog/component-scope.controller.js +14 -9
- package/dist/catalog/component-scope.service.js +5 -0
- package/dist/catalog/component-state.js +2 -0
- package/dist/catalog/marketplaces.service.d.ts +6 -1
- package/dist/catalog/marketplaces.service.js +8 -3
- package/dist/catalog/org-catalog.controller.d.ts +9 -0
- package/dist/catalog/org-catalog.controller.js +18 -0
- package/dist/catalog/org-catalog.schemas.d.ts +2 -4
- package/dist/catalog/org-catalog.schemas.js +2 -3
- package/dist/catalog/org-catalog.service.d.ts +10 -1
- package/dist/catalog/org-catalog.service.js +34 -23
- package/dist/catalog/org-extension-switch.d.ts +3 -10
- package/dist/catalog/org-extension-switch.js +14 -60
- package/dist/catalog/org-extension.controller.d.ts +6 -7
- package/dist/catalog/org-extension.controller.js +4 -4
- package/dist/catalog/org-extension.schemas.d.ts +1 -2
- package/dist/catalog/org-extension.schemas.js +1 -3
- package/dist/catalog/owned-items.js +10 -1
- package/dist/catalog/ownership.js +2 -0
- package/dist/catalog/plugin-import.js +8 -0
- package/dist/catalog/plugin-install.d.ts +1 -4
- package/dist/catalog/plugin-install.js +11 -12
- package/dist/catalog/plugin-upgrade.js +4 -1
- package/dist/catalog/request-rules.js +6 -0
- package/dist/catalog/requests.service.js +4 -0
- package/dist/catalog/scope-orgs.js +1 -0
- package/dist/catalog/scope-sync.d.ts +8 -5
- package/dist/catalog/scope-sync.js +21 -23
- package/dist/catalog/unshare.js +3 -0
- package/dist/channels/connections.service.js +1 -0
- package/dist/channels/inbound.js +1 -0
- package/dist/channels/jobs.js +1 -0
- package/dist/channels/outbound.js +6 -0
- package/dist/channels/supervisor.js +1 -0
- package/dist/channels/threads.js +1 -0
- package/dist/client/client-reports.service.js +1 -0
- package/dist/config/fields.js +20 -4
- package/dist/conversations/access.js +1 -0
- package/dist/conversations/attachments.service.js +16 -4
- package/dist/conversations/conversations.service.js +17 -3
- package/dist/conversations/event-log.js +2 -0
- package/dist/conversations/events.d.ts +1 -0
- package/dist/conversations/events.js +3 -1
- package/dist/conversations/files.js +3 -2
- package/dist/conversations/permission-profiles.service.js +1 -0
- package/dist/conversations/prompt-suggestions.js +2 -0
- package/dist/conversations/queue.js +8 -0
- package/dist/conversations/queue.service.js +6 -2
- package/dist/conversations/source.js +2 -0
- package/dist/conversations/titles.js +10 -2
- package/dist/conversations/tree.js +6 -0
- package/dist/db/kernel-schema.d.ts +3 -1
- package/dist/devices/conversation-devices.js +3 -0
- package/dist/devices/device-projects.service.js +2 -0
- package/dist/devices/devices.service.js +5 -0
- package/dist/devices/legacy-cleanup.job.js +5 -2
- package/dist/dial-in/handlers.js +2 -0
- package/dist/dial-in/machines.js +11 -2
- package/dist/dial-in/targets.d.ts +0 -2
- package/dist/dial-in/targets.js +0 -10
- package/dist/errors.d.ts +0 -1
- package/dist/errors.js +0 -1
- package/dist/evals/budget.js +14 -1
- package/dist/evals/run-replay.js +4 -0
- package/dist/evals/runs.service.js +13 -7
- package/dist/evals/sets.service.js +23 -8
- package/dist/evals/trajectory.service.d.ts +1 -1
- package/dist/evals/trajectory.service.js +1 -0
- package/dist/evals/worker.js +5 -1
- package/dist/extensions/admin-ops.js +1 -0
- package/dist/extensions/admin-view.js +3 -1
- package/dist/extensions/bootstrap-packages.d.ts +12 -1
- package/dist/extensions/bootstrap-packages.js +49 -9
- package/dist/extensions/bootstrap.d.ts +17 -2
- package/dist/extensions/bootstrap.js +41 -9
- package/dist/extensions/config-json-schema.d.ts +2 -2
- package/dist/extensions/config-json-schema.js +1 -3
- package/dist/extensions/deployment-config.d.ts +5 -3
- package/dist/extensions/deployment-config.js +3 -3
- package/dist/extensions/effective-config.d.ts +8 -7
- package/dist/extensions/effective-config.js +8 -7
- package/dist/extensions/enabled.js +1 -0
- package/dist/extensions/host.d.ts +4 -3
- package/dist/extensions/host.js +11 -12
- package/dist/extensions/instance.d.ts +1 -1
- package/dist/extensions/instance.js +17 -2
- package/dist/extensions/org-config.d.ts +35 -97
- package/dist/extensions/org-config.js +48 -315
- package/dist/extensions/org-levels.d.ts +22 -9
- package/dist/extensions/org-levels.js +100 -20
- package/dist/extensions/org-overrides.d.ts +14 -15
- package/dist/extensions/org-overrides.js +20 -20
- package/dist/extensions/package.js +1 -1
- package/dist/extensions/permission-set.d.ts +1 -3
- package/dist/extensions/permission-set.js +3 -7
- package/dist/extensions/permission-view.d.ts +3 -1
- package/dist/extensions/permission-view.js +5 -4
- package/dist/extensions/plugin-icons.d.ts +72 -1
- package/dist/extensions/plugin-icons.js +194 -2
- package/dist/extensions/point-defaults.d.ts +17 -18
- package/dist/extensions/point-defaults.js +25 -28
- package/dist/identity/accounts.js +6 -0
- package/dist/identity/api-tokens.js +8 -0
- package/dist/infra/outbox/outbox.dispatcher.js +4 -1
- package/dist/infra/outbox/outbox.service.js +2 -0
- package/dist/orgs/directory-sync.d.ts +9 -6
- package/dist/orgs/directory-sync.js +15 -12
- package/dist/orgs/invitations.service.js +2 -0
- package/dist/orgs/members.service.js +2 -0
- package/dist/orgs/offboarding.js +2 -0
- package/dist/packages/npm.d.ts +9 -1
- package/dist/packages/npm.js +37 -5
- package/dist/platform/exclusions.js +20 -0
- package/dist/platform/ops/admin-items.ops.js +1 -0
- package/dist/platform/ops/agents.ops.js +1 -0
- package/dist/platform/ops/extensions.ops.d.ts +6 -8
- package/dist/platform/ops/extensions.ops.js +18 -97
- package/dist/platform/ops/org-plugins.ops.d.ts +3 -6
- package/dist/platform/ops/org-plugins.ops.js +14 -65
- package/dist/platform/ops/outbox.ops.js +1 -0
- package/dist/platform/ops/person-inputs.d.ts +0 -4
- package/dist/platform/ops/person-inputs.js +0 -8
- package/dist/platform/ops/plugins.ops.d.ts +4 -1
- package/dist/platform/ops/plugins.ops.js +27 -34
- package/dist/platform/person-fields.d.ts +1 -1
- package/dist/platform/person-fields.js +1 -1
- package/dist/platform/sealed-reveals.js +2 -0
- package/dist/push/recipients.js +9 -2
- package/dist/runtime/permission-context.service.js +1 -0
- package/dist/runtime/plugin-context.service.js +1 -0
- package/dist/runtime/project/knowledge.service.js +1 -0
- package/dist/runtime/run-context.service.js +1 -0
- package/dist/runtime/run-deletion.js +4 -0
- package/dist/runtime/run-execution.js +2 -0
- package/dist/runtime/run-finish.js +3 -0
- package/dist/runtime/run-jobs.js +3 -0
- package/dist/runtime/run-orphan-check.job.js +7 -0
- package/dist/runtime/run-queue.js +21 -2
- package/dist/runtime/run-worker.js +5 -0
- package/dist/runtime/step-log.js +1 -0
- package/dist/runtime/subagents/child.js +2 -0
- package/dist/runtime/subagents/deliveries.js +3 -0
- package/dist/runtime/subagents/dispatch.js +5 -1
- package/dist/runtime/subagents/messages.js +2 -0
- package/dist/runtime/subagents/org-agents.d.ts +1 -1
- package/dist/runtime/subagents/org-agents.js +2 -1
- package/dist/runtime/usage-report-jobs.js +1 -0
- package/dist/runtime/usage-report.js +3 -0
- package/dist/runtime/waits.js +5 -0
- package/dist/sandbox/cloud-permission-snapshot.js +9 -3
- package/dist/sandbox/device-reports.js +3 -0
- package/dist/sandbox/legacy-retirement.js +5 -1
- package/dist/sandbox/managed-device-context.js +1 -0
- package/dist/sandbox/modes.d.ts +5 -2
- package/dist/sandbox/modes.js +8 -4
- package/dist/sandbox/network-grants.js +2 -0
- package/dist/sandbox/operation-intents.js +58 -0
- package/dist/sandbox/operation-reconcile.job.js +2 -0
- package/dist/sandbox/permission-authority-lock.js +12 -6
- package/dist/sandbox/permission-call-grants.js +6 -0
- package/dist/sandbox/permission-ceiling-writes.js +5 -0
- package/dist/sandbox/permission-config-publication.js +5 -0
- package/dist/sandbox/permission-instance-writes.js +4 -0
- package/dist/sandbox/permission-runtime-reports.js +10 -1
- package/dist/sandbox/permission-transitions.js +3 -0
- package/dist/sandbox/review/review.service.js +8 -5
- package/dist/sandbox/sandbox.service.d.ts +14 -0
- package/dist/sandbox/sandbox.service.js +195 -29
- package/dist/sandbox/unreachable.js +4 -1
- package/dist/schedules/fire.js +9 -3
- package/dist/schedules/pause.js +2 -0
- package/dist/schedules/run-tracker.js +16 -1
- package/dist/schedules/scheduled-tasks.service.js +4 -2
- package/dist/schedules/store.js +8 -0
- package/dist/schedules/unattended.js +4 -0
- package/dist/setup/setup-checks.service.d.ts +1 -10
- package/dist/setup/setup-checks.service.js +19 -29
- package/dist/shares/share-open.service.js +1 -0
- package/dist/shares/shares.service.js +2 -0
- package/dist/skills/agent-skills.service.d.ts +1 -1
- package/dist/skills/agent-skills.service.js +13 -2
- package/dist/skills/catalog.js +3 -0
- package/dist/skills/changes.service.js +10 -2
- package/dist/skills/conversation-catalog.js +1 -0
- package/dist/skills/skills.service.js +4 -0
- package/dist/tools/approvals.service.js +40 -0
- package/dist/tools/builtins/schedules.js +11 -6
- package/dist/tools/builtins/web/fetch.js +1 -1
- package/dist/tools/builtins/web/search.js +1 -1
- package/dist/tools/connector-account-policies.js +3 -0
- package/dist/tools/connectors.controller.d.ts +20 -8
- package/dist/tools/connectors.controller.js +30 -12
- package/dist/tools/connectors.service.d.ts +8 -0
- package/dist/tools/connectors.service.js +21 -1
- package/dist/tools/drift.js +5 -0
- package/dist/tools/git-push-policy.js +3 -0
- package/dist/tools/oauth/flow.js +1 -0
- package/dist/tools/outputs.js +2 -0
- package/dist/tools/permission-approval-jobs.js +3 -0
- package/dist/tools/pipeline.js +2 -0
- package/dist/tools/policy.js +3 -0
- package/dist/tools/questions.service.js +13 -0
- 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
|
-
|
|
17
|
-
|
|
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
|
-
/**
|
|
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
|
|
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
|
-
*
|
|
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
|
-
/**
|
|
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
|
|
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
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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`; `
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
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
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
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
|