@capybara-hq/kernel 0.1.0-rc.146 → 0.1.0-rc.147
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/dist/admin/extensions.controller.d.ts +0 -11
- package/dist/admin/extensions.controller.js +0 -28
- package/dist/admin/health.service.d.ts +25 -1
- package/dist/admin/health.service.js +50 -18
- package/dist/audit/full-access.d.ts +78 -0
- package/dist/audit/full-access.js +283 -0
- package/dist/automations/automations.service.d.ts +1 -0
- package/dist/automations/automations.service.js +3 -1
- package/dist/automations/calendar.js +3 -1
- package/dist/automations/grant-rules.d.ts +2 -1
- package/dist/automations/grant-rules.js +8 -1
- package/dist/automations/unattended.d.ts +13 -1
- package/dist/automations/unattended.js +13 -1
- package/dist/catalog/admin-catalog.controller.d.ts +8 -0
- package/dist/catalog/admin-catalog.controller.js +8 -2
- package/dist/catalog/admin-catalog.schemas.d.ts +10 -0
- package/dist/catalog/admin-catalog.schemas.js +8 -1
- package/dist/catalog/catalog-content.d.ts +6 -0
- package/dist/catalog/catalog-scope.service.d.ts +22 -2
- package/dist/catalog/catalog-scope.service.js +27 -3
- package/dist/catalog/catalog.service.js +19 -2
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/catalog/org-catalog.service.d.ts +8 -1
- package/dist/catalog/org-catalog.service.js +36 -3
- package/dist/catalog/platform-components.js +3 -2
- package/dist/catalog/platform-import-update.d.ts +2 -0
- package/dist/catalog/platform-import-update.js +8 -1
- package/dist/catalog/plugin-connectors.d.ts +11 -0
- package/dist/catalog/plugin-connectors.js +33 -0
- package/dist/catalog/plugin-import.d.ts +35 -15
- package/dist/catalog/plugin-import.js +110 -35
- package/dist/catalog/plugin-install.js +6 -0
- package/dist/catalog/provenance.d.ts +2 -0
- package/dist/catalog/provenance.js +5 -1
- package/dist/config/auto-approve.d.ts +16 -0
- package/dist/config/auto-approve.js +24 -0
- package/dist/config/capacity-presets.d.ts +243 -0
- package/dist/config/capacity-presets.js +195 -0
- package/dist/config/env.d.ts +2 -1
- package/dist/config/env.js +6 -1
- package/dist/config/load.js +15 -0
- package/dist/config/schema.d.ts +46 -9
- package/dist/config/schema.js +154 -30
- package/dist/ctx/net.d.ts +5 -1
- package/dist/ctx/net.js +62 -12
- package/dist/db/kernel-schema.d.ts +31 -0
- package/dist/db/migrator.js +0 -36
- package/dist/dial-in/routes.js +1 -1
- package/dist/erasure/org-batches.js +1 -6
- package/dist/erasure/org-catalog.js +6 -2
- package/dist/erasure/org-rules.js +1 -0
- package/dist/erasure/org-worker.js +0 -13
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +6 -0
- package/dist/extensions/admin-ops.d.ts +14 -1
- package/dist/extensions/admin-ops.js +30 -3
- package/dist/extensions/admin-view.d.ts +21 -1
- package/dist/extensions/admin-view.js +43 -0
- package/dist/extensions/bootstrap-packages.d.ts +5 -0
- package/dist/extensions/bootstrap-packages.js +1 -1
- package/dist/extensions/bootstrap-review.d.ts +251 -0
- package/dist/extensions/bootstrap-review.js +676 -0
- package/dist/extensions/bootstrap.d.ts +21 -1
- package/dist/extensions/bootstrap.js +72 -2
- package/dist/extensions/cli.d.ts +6 -0
- package/dist/extensions/cli.js +4 -0
- package/dist/extensions/enabled.d.ts +3 -0
- package/dist/extensions/extensions.module.js +9 -0
- package/dist/extensions/full-access-disclosure.d.ts +15 -0
- package/dist/extensions/full-access-disclosure.js +57 -0
- package/dist/extensions/grant-epoch.d.ts +5 -0
- package/dist/extensions/grant-epoch.js +9 -0
- package/dist/extensions/host.d.ts +71 -2
- package/dist/extensions/host.js +293 -27
- package/dist/extensions/installs.d.ts +18 -0
- package/dist/extensions/installs.js +28 -0
- package/dist/extensions/isolated/admission.d.ts +17 -2
- package/dist/extensions/isolated/admission.js +15 -7
- package/dist/extensions/isolated/authorization.d.ts +8 -2
- package/dist/extensions/isolated/authorization.js +11 -3
- package/dist/extensions/isolated/broker.d.ts +3 -0
- package/dist/extensions/isolated/broker.js +50 -14
- package/dist/extensions/isolated/configured-package.d.ts +5 -0
- package/dist/extensions/isolated/configured-package.js +2 -0
- package/dist/extensions/isolated/lanes.d.ts +44 -3
- package/dist/extensions/isolated/lanes.js +263 -80
- package/dist/extensions/isolated/metrics.d.ts +146 -0
- package/dist/extensions/isolated/metrics.js +304 -0
- package/dist/extensions/isolated/revision.d.ts +7 -1
- package/dist/extensions/isolated/revision.js +26 -5
- package/dist/extensions/isolated/rpc.d.ts +5 -0
- package/dist/extensions/isolated/rpc.js +7 -2
- package/dist/extensions/isolated/sandbox.d.ts +23 -0
- package/dist/extensions/isolated/sandbox.js +50 -0
- package/dist/extensions/isolated/status.d.ts +79 -0
- package/dist/extensions/isolated/status.js +216 -0
- package/dist/extensions/isolated/tier.d.ts +127 -2
- package/dist/extensions/isolated/tier.js +266 -7
- package/dist/extensions/isolated/usage.d.ts +134 -0
- package/dist/extensions/isolated/usage.js +322 -0
- package/dist/extensions/lifecycle.d.ts +42 -2
- package/dist/extensions/lifecycle.js +100 -4
- package/dist/extensions/org-config.js +11 -0
- package/dist/extensions/package.d.ts +14 -0
- package/dist/extensions/package.js +23 -0
- package/dist/extensions/permissions.controller.d.ts +35 -0
- package/dist/extensions/permissions.controller.js +98 -0
- package/dist/extensions/permissions.schemas.d.ts +288 -0
- package/dist/extensions/permissions.schemas.js +96 -0
- package/dist/extensions/permissions.service.d.ts +116 -0
- package/dist/extensions/permissions.service.js +428 -0
- package/dist/extensions/realm-retirement.d.ts +65 -0
- package/dist/extensions/realm-retirement.js +150 -0
- package/dist/extensions/revision-approvals.d.ts +58 -3
- package/dist/extensions/revision-approvals.js +135 -14
- package/dist/extensions/revision-review.d.ts +144 -0
- package/dist/extensions/revision-review.js +297 -0
- package/dist/extensions/revocation.js +3 -0
- package/dist/extensions/state.module.js +12 -0
- package/dist/git/run-end.d.ts +35 -7
- package/dist/git/run-end.js +87 -38
- package/dist/http/api.module.js +2 -0
- package/dist/identity/audit.d.ts +2 -1
- package/dist/identity/audit.js +4 -17
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/infra/config/kernel-config.service.d.ts +6 -0
- package/dist/infra/config/kernel-config.service.js +21 -0
- package/dist/infra/outbox/registry.d.ts +13 -0
- package/dist/infra/outbox/registry.js +8 -0
- package/dist/lifecycle/kernel-lifecycle.d.ts +25 -1
- package/dist/lifecycle/kernel-lifecycle.js +73 -18
- package/dist/net/private-endpoint-preflight.d.ts +159 -0
- package/dist/net/private-endpoint-preflight.js +417 -0
- package/dist/net/private-endpoints.d.ts +68 -0
- package/dist/net/private-endpoints.js +164 -0
- package/dist/net/public-address.d.ts +14 -0
- package/dist/net/public-address.js +15 -1
- package/dist/net/safe-fetch.d.ts +2 -1
- package/dist/net/safe-fetch.js +10 -3
- package/dist/overrides.d.ts +4 -0
- package/dist/overrides.js +2 -0
- package/dist/packages/official-publisher.d.ts +26 -1
- package/dist/packages/official-publisher.js +48 -1
- package/dist/packages/provenance.d.ts +11 -0
- package/dist/packages/provenance.js +24 -0
- package/dist/platform/exclusions.js +4 -4
- package/dist/platform/ops/automations.ops.js +1 -1
- package/dist/platform/ops/catalog-admin.ops.js +25 -4
- package/dist/platform/ops/extension-permissions.ops.d.ts +11 -0
- package/dist/platform/ops/extension-permissions.ops.js +159 -0
- package/dist/platform/platform-ops.module.d.ts +2 -1
- package/dist/platform/platform-ops.module.js +2 -0
- package/dist/platform/route-schemas.js +2 -0
- package/dist/retention/purge-batch.js +10 -14
- package/dist/runtime/maintenance.d.ts +4 -2
- package/dist/runtime/maintenance.js +16 -3
- package/dist/runtime/run-finish.d.ts +3 -3
- package/dist/runtime/run-finish.js +7 -3
- package/dist/sandbox/permission-availability.d.ts +17 -2
- package/dist/sandbox/permission-availability.js +22 -1
- package/dist/sandbox/permission-facts.js +7 -1
- package/dist/tools/builtins/sandbox/common.js +2 -0
- package/dist/tools/pipeline.d.ts +2 -1
- package/dist/tools/pipeline.js +7 -2
- package/package.json +4 -3
- package/src/migrations/0238_extension_usage.sql +40 -0
- package/src/migrations/0239_extension_replica_isolation.sql +28 -0
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export type { PluginConfirmResult, PluginReview } from "./catalog/plugin-import.
|
|
|
6
6
|
export { type PluginPackage, PluginPackageError, type ReadPluginPackageOptions, readPluginPackage, } from "./catalog/plugin-package.js";
|
|
7
7
|
export { classifyPublisherEvidence, normalizePublisherIdentity, type PublisherEvidence, type PublisherEvidenceOutcome, refClass, samePublisher, } from "./catalog/provenance.js";
|
|
8
8
|
export { gatewayReplicasKey } from "./channels/supervisor.js";
|
|
9
|
+
export { autoApproveRefusal, isOfficialImage, OFFICIAL_IMAGE_MARKER, } from "./config/auto-approve.js";
|
|
10
|
+
export { CAPACITY_PRESETS, type CapacityConfig, type CapacityPreset, type IsolatedCapacity, resolveCapacity, } from "./config/capacity-presets.js";
|
|
9
11
|
export { envName, renderConfigDocs } from "./config/docs.js";
|
|
10
12
|
export { envOverrides } from "./config/env.js";
|
|
11
13
|
export { type ConfigField, changedPaths, configFields, secretValues } from "./config/fields.js";
|
|
@@ -37,6 +39,7 @@ export { type BootstrapEntryResult, BootstrapFailedError, type BootstrapFailure,
|
|
|
37
39
|
export { BootstrapExtraMismatchError, type ExtraManifestTraces, hasExtraManifestTraces, loadBootstrapManifest, type MergedBootstrapManifest, mergeBootstrapManifests, missingExtraManifestMessage, readBootstrapExtraManifest, } from "./extensions/bootstrap-extra.js";
|
|
38
40
|
export { BOOTSTRAP_MANIFEST_FILE, bootstrapManifestSha256, readBootstrapManifest, } from "./extensions/bootstrap-manifest.js";
|
|
39
41
|
export { type BootstrapGitPlugin, type BootstrapResolveOptions, readBootstrapGitPlugin, resolveBootstrapPackages, } from "./extensions/bootstrap-packages.js";
|
|
42
|
+
export { type ApprovalVia, BOOTSTRAP_REVIEW_CONTRACT, type BootstrapApproval, type BootstrapEntryStatus, type BootstrapReview, type BootstrapReviewEntry, BootstrapReviewError, BootstrapReviewService, type BootstrapRevisionInput, type BootstrapStartGate, bootstrapBatchHash, bootstrapPinInputs, bootstrapRevisionDisplay, freshBootstrapReview, integrityHex, } from "./extensions/bootstrap-review.js";
|
|
40
43
|
export { type ExtensionCli, openExtensionCli } from "./extensions/cli.js";
|
|
41
44
|
export { DEPLOYMENT_SECRETS_ORG, type DeploymentConfigField, type DeploymentConfigView, ExtensionDeploymentConfigService, mergeDeploymentConfig, PLUGIN_DEPLOYMENT_CONFIG_TOPIC, readStoredDeploymentConfig, type SecretEntry, } from "./extensions/deployment-config.js";
|
|
42
45
|
export { CONFIG_SCHEMA_UNSUPPORTED_KEY, describeExecution, type ExecutionDecision, type ExecutionInput, executionDecision, fullAccessKeys, HOST_NO_ISOLATION_KEY, type HostIsolation, type RealmPlacement, } from "./extensions/execution-realm.js";
|
|
@@ -53,6 +56,7 @@ export { type AdminExtensionView, type DeploymentExtensionStatus, isSensitivePer
|
|
|
53
56
|
export { ExtensionRegistry } from "./extensions/registry.js";
|
|
54
57
|
export { ExtensionResolveError, resolveExtensions } from "./extensions/resolve.js";
|
|
55
58
|
export { fullAccessPurpose, grantPurposeRows, REVIEW_CONTRACT_VERSION, type ReviewDisplay, type ReviewInput, reviewDisplay, revisionReviewHash, } from "./extensions/review-hash.js";
|
|
59
|
+
export { type ApprovalScope, ExtensionRevisionGrants, type NewRevisionGrant, type PurposeRow, type RevisionGrant, type RevisionIdentity, } from "./extensions/revision-grants.js";
|
|
56
60
|
export { type ExtensionLoadStatus, type ExtensionSource, newReplicaId, type PendingReason, ReplicaStatusStore, } from "./extensions/sources.js";
|
|
57
61
|
export { syncPackage } from "./extensions/sync.js";
|
|
58
62
|
export type { KernelHttp, KernelHttpApp } from "./http/app.js";
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,8 @@ export { GitSourceError, readGitTree, } from "./catalog/git-source.js";
|
|
|
6
6
|
export { PluginPackageError, readPluginPackage, } from "./catalog/plugin-package.js";
|
|
7
7
|
export { classifyPublisherEvidence, normalizePublisherIdentity, refClass, samePublisher, } from "./catalog/provenance.js";
|
|
8
8
|
export { gatewayReplicasKey } from "./channels/supervisor.js";
|
|
9
|
+
export { autoApproveRefusal, isOfficialImage, OFFICIAL_IMAGE_MARKER, } from "./config/auto-approve.js";
|
|
10
|
+
export { CAPACITY_PRESETS, resolveCapacity, } from "./config/capacity-presets.js";
|
|
9
11
|
export { envName, renderConfigDocs } from "./config/docs.js";
|
|
10
12
|
export { envOverrides } from "./config/env.js";
|
|
11
13
|
export { changedPaths, configFields, secretValues } from "./config/fields.js";
|
|
@@ -36,6 +38,7 @@ export { BootstrapFailedError, BootstrapService, } from "./extensions/bootstrap.
|
|
|
36
38
|
export { BootstrapExtraMismatchError, hasExtraManifestTraces, loadBootstrapManifest, mergeBootstrapManifests, missingExtraManifestMessage, readBootstrapExtraManifest, } from "./extensions/bootstrap-extra.js";
|
|
37
39
|
export { BOOTSTRAP_MANIFEST_FILE, bootstrapManifestSha256, readBootstrapManifest, } from "./extensions/bootstrap-manifest.js";
|
|
38
40
|
export { readBootstrapGitPlugin, resolveBootstrapPackages, } from "./extensions/bootstrap-packages.js";
|
|
41
|
+
export { BOOTSTRAP_REVIEW_CONTRACT, BootstrapReviewError, BootstrapReviewService, bootstrapBatchHash, bootstrapPinInputs, bootstrapRevisionDisplay, freshBootstrapReview, integrityHex, } from "./extensions/bootstrap-review.js";
|
|
39
42
|
export { openExtensionCli } from "./extensions/cli.js";
|
|
40
43
|
export { DEPLOYMENT_SECRETS_ORG, ExtensionDeploymentConfigService, mergeDeploymentConfig, PLUGIN_DEPLOYMENT_CONFIG_TOPIC, readStoredDeploymentConfig, } from "./extensions/deployment-config.js";
|
|
41
44
|
export { CONFIG_SCHEMA_UNSUPPORTED_KEY, describeExecution, executionDecision, fullAccessKeys, HOST_NO_ISOLATION_KEY, } from "./extensions/execution-realm.js";
|
|
@@ -52,6 +55,7 @@ export { isSensitivePermissionKey, permissionGroups, permissionKeyItems, reviewH
|
|
|
52
55
|
export { ExtensionRegistry } from "./extensions/registry.js";
|
|
53
56
|
export { ExtensionResolveError, resolveExtensions } from "./extensions/resolve.js";
|
|
54
57
|
export { fullAccessPurpose, grantPurposeRows, REVIEW_CONTRACT_VERSION, reviewDisplay, revisionReviewHash, } from "./extensions/review-hash.js";
|
|
58
|
+
export { ExtensionRevisionGrants, } from "./extensions/revision-grants.js";
|
|
55
59
|
export { newReplicaId, ReplicaStatusStore, } from "./extensions/sources.js";
|
|
56
60
|
export { syncPackage } from "./extensions/sync.js";
|
|
57
61
|
export { AccountsModule, AccountsService } from "./identity/accounts.js";
|
|
@@ -14,6 +14,12 @@ export declare class KernelConfigService {
|
|
|
14
14
|
private readonly env;
|
|
15
15
|
private readonly listeners;
|
|
16
16
|
constructor(input: KernelConfigInput, log: KernelLogger);
|
|
17
|
+
/**
|
|
18
|
+
* Fields whose invalid value fell back (capacity to its preset, `metrics.*` to its default) and
|
|
19
|
+
* unknown capacity keys that were dropped while the config was parsed: never fatal, never
|
|
20
|
+
* silent. Logged at startup and after each reload that produced any.
|
|
21
|
+
*/
|
|
22
|
+
private warnFallbacks;
|
|
17
23
|
get(): KernelConfig;
|
|
18
24
|
/**
|
|
19
25
|
* Where the current value of a field without a schema default comes from: `env` when an
|
|
@@ -8,6 +8,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
8
8
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
9
|
};
|
|
10
10
|
import { Inject, Injectable } from "@nestjs/common";
|
|
11
|
+
import { CAPACITY_HOT_PATHS, takeConfigFallbacks } from "../../config/capacity-presets.js";
|
|
11
12
|
import { envOverrides } from "../../config/env.js";
|
|
12
13
|
import { changedPaths, configFields, getPath, secretValues, setPath } from "../../config/fields.js";
|
|
13
14
|
import { resolveConfig } from "../../config/load.js";
|
|
@@ -104,6 +105,11 @@ const HOT_APPLIERS = {
|
|
|
104
105
|
// The sharing switches are read live at every share create, open and settings read.
|
|
105
106
|
"sharing.external": () => { },
|
|
106
107
|
"sharing.maxExpiryDays": () => { },
|
|
108
|
+
// The isolated extension host resolves its capacity on every admission and lane start.
|
|
109
|
+
...Object.fromEntries(CAPACITY_HOT_PATHS.map((path) => [path, () => { }])),
|
|
110
|
+
// The isolation metrics read the org label bounds at every label refresh.
|
|
111
|
+
"metrics.orgLabelMinMembers": () => { },
|
|
112
|
+
"metrics.orgLabelMaxOrgs": () => { },
|
|
107
113
|
};
|
|
108
114
|
/**
|
|
109
115
|
* The hot fields the permission configuration publication covers: a change to any of them is
|
|
@@ -136,6 +142,18 @@ let KernelConfigService = class KernelConfigService {
|
|
|
136
142
|
this.env = input.env ?? process.env;
|
|
137
143
|
log.setLevel(input.config.log.level);
|
|
138
144
|
log.addSecrets(secretValues(KernelConfigSchema, input.config));
|
|
145
|
+
this.warnFallbacks();
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Fields whose invalid value fell back (capacity to its preset, `metrics.*` to its default) and
|
|
149
|
+
* unknown capacity keys that were dropped while the config was parsed: never fatal, never
|
|
150
|
+
* silent. Logged at startup and after each reload that produced any.
|
|
151
|
+
*/
|
|
152
|
+
warnFallbacks() {
|
|
153
|
+
const keys = takeConfigFallbacks();
|
|
154
|
+
if (keys.length > 0) {
|
|
155
|
+
this.log.warn("invalid config values fell back to their preset or default", { keys });
|
|
156
|
+
}
|
|
139
157
|
}
|
|
140
158
|
get() {
|
|
141
159
|
return this.current;
|
|
@@ -173,6 +191,9 @@ let KernelConfigService = class KernelConfigService {
|
|
|
173
191
|
log.error("config reload rejected; keeping current config", { error: errMsg(e) });
|
|
174
192
|
return;
|
|
175
193
|
}
|
|
194
|
+
finally {
|
|
195
|
+
this.warnFallbacks();
|
|
196
|
+
}
|
|
176
197
|
log.addSecrets(secretValues(KernelConfigSchema, next));
|
|
177
198
|
const changed = changedPaths(KernelConfigSchema, this.current, next);
|
|
178
199
|
if (changed.length === 0)
|
|
@@ -163,6 +163,19 @@ export declare const OUTBOX_JOBS: {
|
|
|
163
163
|
readonly removeOnFail: true;
|
|
164
164
|
};
|
|
165
165
|
};
|
|
166
|
+
readonly "git-fetch-audit": {
|
|
167
|
+
readonly queue: "cap-kernel-maintenance";
|
|
168
|
+
readonly idempotent: "Writes the run's git.fetch rows only when it has none yet, then drops its counters; a repeat finds rows or no counters";
|
|
169
|
+
readonly processedIn: "packages/kernel/src/runtime/maintenance.ts";
|
|
170
|
+
readonly opts: {
|
|
171
|
+
readonly attempts: 5;
|
|
172
|
+
readonly backoff: {
|
|
173
|
+
readonly type: "exponential";
|
|
174
|
+
readonly delay: 5000;
|
|
175
|
+
};
|
|
176
|
+
readonly removeOnComplete: true;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
166
179
|
readonly "permission-approval-recheck": {
|
|
167
180
|
readonly queue: "cap-kernel-maintenance";
|
|
168
181
|
readonly idempotent: "Reads the current revision and resumes only waiting runs without another pending wait; queued runs are unchanged.";
|
|
@@ -134,6 +134,14 @@ export const OUTBOX_JOBS = {
|
|
|
134
134
|
removeOnFail: true,
|
|
135
135
|
},
|
|
136
136
|
},
|
|
137
|
+
// `git/run-end.ts` GIT_FETCH_AUDIT_JOB: owed by a run's terminal transaction when the run counted
|
|
138
|
+
// git fetches (`RunFinish`), under `gitFetchAuditJobId`
|
|
139
|
+
"git-fetch-audit": {
|
|
140
|
+
queue: "cap-kernel-maintenance",
|
|
141
|
+
idempotent: "Writes the run's git.fetch rows only when it has none yet, then drops its counters; a repeat finds rows or no counters",
|
|
142
|
+
processedIn: "packages/kernel/src/runtime/maintenance.ts",
|
|
143
|
+
opts: { attempts: 5, backoff: { type: "exponential", delay: 5000 }, removeOnComplete: true },
|
|
144
|
+
},
|
|
137
145
|
"permission-approval-recheck": {
|
|
138
146
|
queue: "cap-kernel-maintenance",
|
|
139
147
|
idempotent: "Reads the current revision and resumes only waiting runs without another pending wait; queued runs are unchanged.",
|
|
@@ -15,8 +15,11 @@ import { type ExtensionDbIdentity } from "../db/extension-db.js";
|
|
|
15
15
|
import { ExtensionBlobs } from "../extensions/blobs.js";
|
|
16
16
|
import { BootstrapService } from "../extensions/bootstrap.js";
|
|
17
17
|
import { BootstrapDefaultsService } from "../extensions/bootstrap-defaults.js";
|
|
18
|
+
import { BootstrapReviewService } from "../extensions/bootstrap-review.js";
|
|
18
19
|
import { ExtensionHost } from "../extensions/host.js";
|
|
19
20
|
import { ExtensionInstalls } from "../extensions/installs.js";
|
|
21
|
+
import { ReplicaIsolationStore } from "../extensions/isolated/status.js";
|
|
22
|
+
import { type ReviewedGrants } from "../extensions/isolated/tier.js";
|
|
20
23
|
import { ExtensionLifecycle } from "../extensions/lifecycle.js";
|
|
21
24
|
import { ExtensionRegistry } from "../extensions/registry.js";
|
|
22
25
|
import { ExtensionRevocations } from "../extensions/revocation.js";
|
|
@@ -88,6 +91,7 @@ export declare class KernelLifecycle implements OnApplicationBootstrap, BeforeAp
|
|
|
88
91
|
private readonly replicaStatus;
|
|
89
92
|
private readonly bootstrap;
|
|
90
93
|
private readonly bootstrapDefaults;
|
|
94
|
+
private readonly bootstrapReview;
|
|
91
95
|
private readonly marketplaces;
|
|
92
96
|
private readonly pluginImport;
|
|
93
97
|
private readonly pluginUpdater;
|
|
@@ -101,6 +105,15 @@ export declare class KernelLifecycle implements OnApplicationBootstrap, BeforeAp
|
|
|
101
105
|
private readonly presence;
|
|
102
106
|
private readonly worker?;
|
|
103
107
|
private readonly gateway?;
|
|
108
|
+
/**
|
|
109
|
+
* The human-reviewed grant of an exact revision (`ExtensionRevisionApprovals`, plan task 1.3a):
|
|
110
|
+
* admits a proofless official revision under pin-only (#1368) and places an extra-manifest
|
|
111
|
+
* pin under its reviewed full-access grant (#1371). Absent where the extension state module is
|
|
112
|
+
* not loaded, which keeps the pin-only refusal and leaves an extra pin isolated.
|
|
113
|
+
*/
|
|
114
|
+
private readonly reviewedGrants?;
|
|
115
|
+
/** This replica's isolation row, removed on a clean stop (plan task 1.4j). */
|
|
116
|
+
private readonly isolationStatus?;
|
|
104
117
|
/** The startup config (hot fields are read through the config service). */
|
|
105
118
|
private readonly config;
|
|
106
119
|
/** Set when the application was never set up completely: shutdown only releases connections. */
|
|
@@ -117,7 +130,18 @@ export declare class KernelLifecycle implements OnApplicationBootstrap, BeforeAp
|
|
|
117
130
|
private bootstrapPackages;
|
|
118
131
|
/** The merged bootstrap manifest, read once per start. */
|
|
119
132
|
private mergedManifest;
|
|
120
|
-
constructor(permissionConfig: PermissionConfigPublication, accounts: AccountsService, configService: KernelConfigService, log: KernelLogger, options: KernelAppOptions, pool: Kysely<any>, redis: Redis, kdb: KernelDb, shutdown: GracefulShutdown, host: ExtensionHost, extensionDbIdentity: ExtensionDbIdentity, registry: ExtensionRegistry, installs: ExtensionInstalls, blobs: ExtensionBlobs, extensionLifecycle: ExtensionLifecycle, revocations: ExtensionRevocations, replicaStatus: ReplicaStatusStore, bootstrap: BootstrapService, bootstrapDefaults: BootstrapDefaultsService, marketplaces: MarketplacesService, pluginImport: PluginImport, pluginUpdater: PlatformPluginUpdater, platformComponents: PlatformComponents, bus: Pick<ExtensionContext["bus"], "publish" | "subscribe">, usageReport: UsageReporter, titles: TitleQueue, suggestions: PromptSuggestionQueue, channelJobs: ChannelJobs, channelOutbound: ChannelOutbound, presence: ReplicaPresence, worker?: WorkerRole | undefined, gateway?: GatewayRole | undefined
|
|
133
|
+
constructor(permissionConfig: PermissionConfigPublication, accounts: AccountsService, configService: KernelConfigService, log: KernelLogger, options: KernelAppOptions, pool: Kysely<any>, redis: Redis, kdb: KernelDb, shutdown: GracefulShutdown, host: ExtensionHost, extensionDbIdentity: ExtensionDbIdentity, registry: ExtensionRegistry, installs: ExtensionInstalls, blobs: ExtensionBlobs, extensionLifecycle: ExtensionLifecycle, revocations: ExtensionRevocations, replicaStatus: ReplicaStatusStore, bootstrap: BootstrapService, bootstrapDefaults: BootstrapDefaultsService, bootstrapReview: BootstrapReviewService, marketplaces: MarketplacesService, pluginImport: PluginImport, pluginUpdater: PlatformPluginUpdater, platformComponents: PlatformComponents, bus: Pick<ExtensionContext["bus"], "publish" | "subscribe">, usageReport: UsageReporter, titles: TitleQueue, suggestions: PromptSuggestionQueue, channelJobs: ChannelJobs, channelOutbound: ChannelOutbound, presence: ReplicaPresence, worker?: WorkerRole | undefined, gateway?: GatewayRole | undefined,
|
|
134
|
+
/**
|
|
135
|
+
* The human-reviewed grant of an exact revision (`ExtensionRevisionApprovals`, plan task 1.3a):
|
|
136
|
+
* admits a proofless official revision under pin-only (#1368) and places an extra-manifest
|
|
137
|
+
* pin under its reviewed full-access grant (#1371). Absent where the extension state module is
|
|
138
|
+
* not loaded, which keeps the pin-only refusal and leaves an extra pin isolated.
|
|
139
|
+
*/
|
|
140
|
+
reviewedGrants?: ReviewedGrants | undefined,
|
|
141
|
+
/** This replica's isolation row, removed on a clean stop (plan task 1.4j). */
|
|
142
|
+
isolationStatus?: Pick<ReplicaIsolationStore, "remove"> | undefined);
|
|
143
|
+
/** Pin-only admission of proofless official revisions, once the reviewed-grant lookup exists. */
|
|
144
|
+
private pinOnlyAdmission;
|
|
121
145
|
/** The kernel HTTP application (set up by `buildKernelApp` before `init()`). */
|
|
122
146
|
get http(): KernelHttpApp;
|
|
123
147
|
attachHttp(http: KernelHttpApp): void;
|
|
@@ -14,6 +14,7 @@ import { MarketplacesService } from "../catalog/marketplaces.service.js";
|
|
|
14
14
|
import { PlatformComponents } from "../catalog/platform-components.js";
|
|
15
15
|
import { PluginImport } from "../catalog/plugin-import.js";
|
|
16
16
|
import { PlatformPluginUpdater } from "../catalog/plugin-upgrade.js";
|
|
17
|
+
import { officialPublisherProofMode } from "../catalog/publisher-policy.js";
|
|
17
18
|
import { ChannelJobs } from "../channels/jobs.js";
|
|
18
19
|
import { ChannelOutbound } from "../channels/outbound.js";
|
|
19
20
|
import { PromptSuggestionQueue } from "../conversations/prompt-suggestions.js";
|
|
@@ -23,9 +24,11 @@ import { ExtensionBlobs } from "../extensions/blobs.js";
|
|
|
23
24
|
import { BootstrapFailedError, BootstrapService, } from "../extensions/bootstrap.js";
|
|
24
25
|
import { BootstrapDefaultsService } from "../extensions/bootstrap-defaults.js";
|
|
25
26
|
import { BootstrapExtraMismatchError, hasExtraManifestTraces, loadBootstrapManifest, missingExtraManifestMessage, syncExtraMarketplaces, } from "../extensions/bootstrap-extra.js";
|
|
27
|
+
import { BootstrapReviewService } from "../extensions/bootstrap-review.js";
|
|
26
28
|
import { ExtensionHost } from "../extensions/host.js";
|
|
27
29
|
import { ExtensionInstalls } from "../extensions/installs.js";
|
|
28
|
-
import {
|
|
30
|
+
import { ReplicaIsolationStore } from "../extensions/isolated/status.js";
|
|
31
|
+
import { installedExtensionTier, REVIEWED_GRANTS, } from "../extensions/isolated/tier.js";
|
|
29
32
|
import { ExtensionLifecycle } from "../extensions/lifecycle.js";
|
|
30
33
|
import { ensureMigrated } from "../extensions/migrate-lock.js";
|
|
31
34
|
import { ExtensionRegistry } from "../extensions/registry.js";
|
|
@@ -111,6 +114,7 @@ let KernelLifecycle = class KernelLifecycle {
|
|
|
111
114
|
replicaStatus;
|
|
112
115
|
bootstrap;
|
|
113
116
|
bootstrapDefaults;
|
|
117
|
+
bootstrapReview;
|
|
114
118
|
marketplaces;
|
|
115
119
|
pluginImport;
|
|
116
120
|
pluginUpdater;
|
|
@@ -124,6 +128,8 @@ let KernelLifecycle = class KernelLifecycle {
|
|
|
124
128
|
presence;
|
|
125
129
|
worker;
|
|
126
130
|
gateway;
|
|
131
|
+
reviewedGrants;
|
|
132
|
+
isolationStatus;
|
|
127
133
|
/** The startup config (hot fields are read through the config service). */
|
|
128
134
|
config;
|
|
129
135
|
/** Set when the application was never set up completely: shutdown only releases connections. */
|
|
@@ -142,14 +148,23 @@ let KernelLifecycle = class KernelLifecycle {
|
|
|
142
148
|
mergedManifest;
|
|
143
149
|
constructor(permissionConfig, accounts, configService, log, options,
|
|
144
150
|
// biome-ignore lint/suspicious/noExplicitAny: the pool carries no schema types
|
|
145
|
-
pool, redis, kdb, shutdown, host, extensionDbIdentity, registry, installs, blobs, extensionLifecycle, revocations, replicaStatus, bootstrap, bootstrapDefaults, marketplaces, pluginImport, pluginUpdater, platformComponents, bus,
|
|
151
|
+
pool, redis, kdb, shutdown, host, extensionDbIdentity, registry, installs, blobs, extensionLifecycle, revocations, replicaStatus, bootstrap, bootstrapDefaults, bootstrapReview, marketplaces, pluginImport, pluginUpdater, platformComponents, bus,
|
|
146
152
|
// the producers closed on every role (their consumers are the worker role's)
|
|
147
153
|
usageReport, titles, suggestions, channelJobs, channelOutbound,
|
|
148
154
|
// this process's presence beat, on every role (admin overview spec §5.1)
|
|
149
155
|
presence,
|
|
150
156
|
// The role modules' parts: a role module is imported only when `roles` names it, so each is
|
|
151
157
|
// present exactly when its role is (checked at the start)
|
|
152
|
-
worker, gateway
|
|
158
|
+
worker, gateway,
|
|
159
|
+
/**
|
|
160
|
+
* The human-reviewed grant of an exact revision (`ExtensionRevisionApprovals`, plan task 1.3a):
|
|
161
|
+
* admits a proofless official revision under pin-only (#1368) and places an extra-manifest
|
|
162
|
+
* pin under its reviewed full-access grant (#1371). Absent where the extension state module is
|
|
163
|
+
* not loaded, which keeps the pin-only refusal and leaves an extra pin isolated.
|
|
164
|
+
*/
|
|
165
|
+
reviewedGrants,
|
|
166
|
+
/** This replica's isolation row, removed on a clean stop (plan task 1.4j). */
|
|
167
|
+
isolationStatus) {
|
|
153
168
|
this.permissionConfig = permissionConfig;
|
|
154
169
|
this.accounts = accounts;
|
|
155
170
|
this.configService = configService;
|
|
@@ -169,6 +184,7 @@ let KernelLifecycle = class KernelLifecycle {
|
|
|
169
184
|
this.replicaStatus = replicaStatus;
|
|
170
185
|
this.bootstrap = bootstrap;
|
|
171
186
|
this.bootstrapDefaults = bootstrapDefaults;
|
|
187
|
+
this.bootstrapReview = bootstrapReview;
|
|
172
188
|
this.marketplaces = marketplaces;
|
|
173
189
|
this.pluginImport = pluginImport;
|
|
174
190
|
this.pluginUpdater = pluginUpdater;
|
|
@@ -182,8 +198,20 @@ let KernelLifecycle = class KernelLifecycle {
|
|
|
182
198
|
this.presence = presence;
|
|
183
199
|
this.worker = worker;
|
|
184
200
|
this.gateway = gateway;
|
|
201
|
+
this.reviewedGrants = reviewedGrants;
|
|
202
|
+
this.isolationStatus = isolationStatus;
|
|
185
203
|
this.config = configService.get();
|
|
186
204
|
}
|
|
205
|
+
/** Pin-only admission of proofless official revisions, once the reviewed-grant lookup exists. */
|
|
206
|
+
pinOnlyAdmission() {
|
|
207
|
+
const grants = this.reviewedGrants;
|
|
208
|
+
if (!grants)
|
|
209
|
+
return undefined;
|
|
210
|
+
return {
|
|
211
|
+
mode: () => officialPublisherProofMode(this.kdb.db),
|
|
212
|
+
reviewedGrant: (revision) => grants.reviewedGrant(revision),
|
|
213
|
+
};
|
|
214
|
+
}
|
|
187
215
|
/** The kernel HTTP application (set up by `buildKernelApp` before `init()`). */
|
|
188
216
|
get http() {
|
|
189
217
|
if (!this.httpApp)
|
|
@@ -299,7 +327,10 @@ let KernelLifecycle = class KernelLifecycle {
|
|
|
299
327
|
config: config.extensions,
|
|
300
328
|
installs: {
|
|
301
329
|
desired: () => this.installs.desired(),
|
|
302
|
-
tier: (d, verifyBytes) => installedExtensionTier(d, () => this.manifest(), this.blobs, verifyBytes),
|
|
330
|
+
tier: (d, verifyBytes) => installedExtensionTier(d, () => this.manifest(), this.blobs, verifyBytes, this.pinOnlyAdmission(),
|
|
331
|
+
// #1371: the extra pin's own grant, from the same reviewed-grant lookup as pin-only
|
|
332
|
+
// admission (extraPinTier still rechecks a live human-made grant covering the server)
|
|
333
|
+
this.reviewedGrants),
|
|
303
334
|
sync: (d) => syncPackage(cfg().extensionHost.dir, d.name, d.sha256, this.blobs, {
|
|
304
335
|
maxBytes: cfg().packages.maxBytes,
|
|
305
336
|
}),
|
|
@@ -353,6 +384,22 @@ let KernelLifecycle = class KernelLifecycle {
|
|
|
353
384
|
await this.extensionLifecycle.reconcile("bootstrap");
|
|
354
385
|
this.checkpoint();
|
|
355
386
|
}
|
|
387
|
+
// The bootstrap review's start gate (shadow mode until plan task 1.5a): a matching
|
|
388
|
+
// `bootstrap.approvedReviews` preseed and `autoApprove` grant the batch; a missing required
|
|
389
|
+
// approval is logged with the batch hash and the command, and never refuses the start
|
|
390
|
+
const reviewed = await this.bootstrapReview.atStart({
|
|
391
|
+
manifest: opts.bootstrap !== undefined && !mismatch ? await this.manifest() : undefined,
|
|
392
|
+
dir: opts.bootstrap?.dir,
|
|
393
|
+
declared: !opts[KERNEL_FIXTURE_TRUST],
|
|
394
|
+
resolveFrom: opts.resolveFrom,
|
|
395
|
+
});
|
|
396
|
+
this.checkpoint();
|
|
397
|
+
if (reviewed !== undefined && reviewed.granted > 0) {
|
|
398
|
+
// Grants made now (a preseed, autoApprove) reach admission in this start: an extra-manifest
|
|
399
|
+
// pin's tier reads them (#1371)
|
|
400
|
+
await this.extensionLifecycle.reconcile("bootstrap-review");
|
|
401
|
+
this.checkpoint();
|
|
402
|
+
}
|
|
356
403
|
// The extra manifest's defaults (the platform default theme), at every start whether or not
|
|
357
404
|
// the step ran in it (compose's `init` usually ran it): its themes exist only once the second
|
|
358
405
|
// pass imported them. A no-op once applied or once a super admin chose; never fails the start
|
|
@@ -575,6 +622,9 @@ let KernelLifecycle = class KernelLifecycle {
|
|
|
575
622
|
await within("plugins", this.host.close(), STOP_BUDGET_MS.plugins);
|
|
576
623
|
// 删掉本副本的加载状态行(尽力而为;崩溃副本心跳过期的行由 reconcile 清理)
|
|
577
624
|
await within("plugin-status", this.replicaStatus.removeAll(), 1_000);
|
|
625
|
+
if (this.isolationStatus) {
|
|
626
|
+
await within("isolation-status", this.isolationStatus.remove(this.replicaStatus.replicaId), 1_000);
|
|
627
|
+
}
|
|
578
628
|
}
|
|
579
629
|
};
|
|
580
630
|
KernelLifecycle = __decorate([
|
|
@@ -598,20 +648,25 @@ KernelLifecycle = __decorate([
|
|
|
598
648
|
__param(16, Inject(ReplicaStatusStore)),
|
|
599
649
|
__param(17, Inject(BootstrapService)),
|
|
600
650
|
__param(18, Inject(BootstrapDefaultsService)),
|
|
601
|
-
__param(19, Inject(
|
|
602
|
-
__param(20, Inject(
|
|
603
|
-
__param(21, Inject(
|
|
604
|
-
__param(22, Inject(
|
|
605
|
-
__param(23, Inject(
|
|
606
|
-
__param(24, Inject(
|
|
607
|
-
__param(25, Inject(
|
|
608
|
-
__param(26, Inject(
|
|
609
|
-
__param(27, Inject(
|
|
610
|
-
__param(28, Inject(
|
|
611
|
-
__param(29, Inject(
|
|
612
|
-
__param(30,
|
|
613
|
-
__param(30, Inject(WorkerRole)),
|
|
651
|
+
__param(19, Inject(BootstrapReviewService)),
|
|
652
|
+
__param(20, Inject(MarketplacesService)),
|
|
653
|
+
__param(21, Inject(PluginImport)),
|
|
654
|
+
__param(22, Inject(PlatformPluginUpdater)),
|
|
655
|
+
__param(23, Inject(PlatformComponents)),
|
|
656
|
+
__param(24, Inject(KERNEL_BUS)),
|
|
657
|
+
__param(25, Inject(UsageReporter)),
|
|
658
|
+
__param(26, Inject(TitleQueue)),
|
|
659
|
+
__param(27, Inject(PromptSuggestionQueue)),
|
|
660
|
+
__param(28, Inject(ChannelJobs)),
|
|
661
|
+
__param(29, Inject(ChannelOutbound)),
|
|
662
|
+
__param(30, Inject(ReplicaPresence)),
|
|
614
663
|
__param(31, Optional()),
|
|
615
|
-
__param(31, Inject(
|
|
664
|
+
__param(31, Inject(WorkerRole)),
|
|
665
|
+
__param(32, Optional()),
|
|
666
|
+
__param(32, Inject(GatewayRole)),
|
|
667
|
+
__param(33, Optional()),
|
|
668
|
+
__param(33, Inject(REVIEWED_GRANTS)),
|
|
669
|
+
__param(34, Optional()),
|
|
670
|
+
__param(34, Inject(ReplicaIsolationStore))
|
|
616
671
|
], KernelLifecycle);
|
|
617
672
|
export { KernelLifecycle };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type { KernelConfig } from "../config/schema.js";
|
|
2
|
+
import type { KernelSchemaDb } from "../db/kernel-schema.js";
|
|
3
|
+
import { type LookupFn } from "./public-address.js";
|
|
4
|
+
/**
|
|
5
|
+
* The preflight for bootstrap pins that reach a platform-configured endpoint through `ctx.net`
|
|
6
|
+
* (extension permission model plan P1.2b). Such a pin, upgraded to its `ctx.net` build while its
|
|
7
|
+
* platform endpoint is private and no `net.privateEndpoints` alias grants that origin to it, loses
|
|
8
|
+
* its endpoint (storage, for object-store-s3). The bootstrap step (`capybara bootstrap`, the
|
|
9
|
+
* compose `init` container, a starting kernel) checks before it obtains or writes anything: a
|
|
10
|
+
* warning while the pinned version still uses the global fetch, a refusal once it is the `ctx.net`
|
|
11
|
+
* build, so init stops before the swap. The admin health overview reports the same gaps.
|
|
12
|
+
*/
|
|
13
|
+
export type BrokeredEndpointPin = {
|
|
14
|
+
/** The bootstrap pin's plugin name. */
|
|
15
|
+
plugin: string;
|
|
16
|
+
/** The alias name a deployment adds for it (the compose files ship it). */
|
|
17
|
+
alias: string;
|
|
18
|
+
/** The methods its requests use at the endpoint; the alias must admit them all. */
|
|
19
|
+
methods: readonly string[];
|
|
20
|
+
/**
|
|
21
|
+
* The URL the plugin's requests go to (origin and the path they start with), from its
|
|
22
|
+
* effective deployment config; undefined when no platform endpoint is configured (a public
|
|
23
|
+
* vendor default).
|
|
24
|
+
*/
|
|
25
|
+
target: (config: Readonly<Record<string, unknown>>) => URL | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The first version that reaches the endpoint through `ctx.net`; undefined until it is released.
|
|
28
|
+
* The PR moving the pin to that build sets it, which turns the warning into a refusal.
|
|
29
|
+
*/
|
|
30
|
+
ctxNetFrom: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Where object-store-s3's requests go, as the AWS SDK builds them: path style
|
|
34
|
+
* (`<endpoint>/<bucket>/<key>`) with `forcePathStyle` or an IP-literal endpoint, otherwise
|
|
35
|
+
* virtual-hosted (`<bucket>.<endpoint host>/<key>`, another origin).
|
|
36
|
+
*/
|
|
37
|
+
export declare function s3Target(config: Readonly<Record<string, unknown>>): URL | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Optional provider (a test seam, `KernelAppOptions.overrides`; the kernel never provides it):
|
|
40
|
+
* the brokered pins the bootstrap preflight checks instead of {@link BROKERED_ENDPOINT_PINS}.
|
|
41
|
+
*/
|
|
42
|
+
export declare const BROKERED_ENDPOINT_PINS_SEAM: unique symbol;
|
|
43
|
+
export declare const BROKERED_ENDPOINT_PINS: readonly BrokeredEndpointPin[];
|
|
44
|
+
export declare const PRIVATE_ENDPOINTS_DOC = "docs/deploy/upgrade.md#private-endpoints-for-plugin-egress";
|
|
45
|
+
/**
|
|
46
|
+
* Why `ctx.net` would refuse the pin's requests: no alias for a private origin (`missing`), an
|
|
47
|
+
* alias whose path prefix or methods do not admit them (`narrow`), an alias whose origin resolves
|
|
48
|
+
* to an address it may not reach (`address`: loopback without `allowLoopback`, link-local,
|
|
49
|
+
* metadata, the Engine's port), or the host does not resolve where the check runs (`unresolved`).
|
|
50
|
+
*/
|
|
51
|
+
export type PrivateEndpointGapKind = "missing" | "narrow" | "address" | "unresolved";
|
|
52
|
+
/** A brokered pin whose platform endpoint `ctx.net` would not admit (or cannot be checked). */
|
|
53
|
+
export type PrivateEndpointGap = {
|
|
54
|
+
plugin: string;
|
|
55
|
+
version: string;
|
|
56
|
+
kind: PrivateEndpointGapKind;
|
|
57
|
+
/** The origin the plugin's requests go to (for S3 without path style: the bucket's host). */
|
|
58
|
+
origin: string;
|
|
59
|
+
/** The alias to add (`missing`, `unresolved`) or to change (`narrow`, `address`). */
|
|
60
|
+
alias: string;
|
|
61
|
+
/**
|
|
62
|
+
* The version reaches the endpoint through `ctx.net` (the gap applies now, not after an upgrade);
|
|
63
|
+
* null when the kernel cannot tell (a URL field found by the generic scan).
|
|
64
|
+
*/
|
|
65
|
+
ctxNet: boolean | null;
|
|
66
|
+
/** The config field holding the URL (the generic scan), e.g. `endpoints[0].baseUrl`. */
|
|
67
|
+
field?: string;
|
|
68
|
+
/** `ctxNet` and the gap is certain (not `unresolved`): the endpoint is unreachable. */
|
|
69
|
+
blocking: boolean;
|
|
70
|
+
/** English, actionable: what to change and where it is documented. */
|
|
71
|
+
message: string;
|
|
72
|
+
/** The environment variables that fix it, one per line; empty when no setting can. */
|
|
73
|
+
env: string;
|
|
74
|
+
};
|
|
75
|
+
/** Whether `version` is `pin`'s `ctx.net` build. */
|
|
76
|
+
export declare function routesThroughCtxNet(pin: BrokeredEndpointPin, version: string): boolean;
|
|
77
|
+
/** The environment variables that add `alias` for `origin`, granted to `plugin`, one per line. */
|
|
78
|
+
export declare function aliasEnvLines(alias: string, origin: string, plugin: string): string;
|
|
79
|
+
/** The env variables and file form that add `alias` for `origin`, granted to `plugin`. */
|
|
80
|
+
export declare function aliasConfigHint(alias: string, origin: string, plugin: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* The gaps of the given pins (`{ name, version }`: a bootstrap manifest's entries, or the
|
|
83
|
+
* installed versions): for each brokered pin present, where its requests go (`pin.target` over
|
|
84
|
+
* its effective deployment config: `extensionConfig` from file / env / Nacos over the config
|
|
85
|
+
* stored in PG) when `ctx.net` would not admit them ({@link verdictFor}). A certain gap blocks the
|
|
86
|
+
* pin's `ctx.net` build; a host that does not resolve where the check runs is only a warning (the
|
|
87
|
+
* check cannot tell; the runtime refusal then names the alias).
|
|
88
|
+
*/
|
|
89
|
+
export declare function privateEndpointGaps(o: {
|
|
90
|
+
config: Pick<KernelConfig, "net" | "extensionConfig"> & {
|
|
91
|
+
extensionHost?: Pick<KernelConfig["extensionHost"], "isolation">;
|
|
92
|
+
};
|
|
93
|
+
pins: readonly {
|
|
94
|
+
name: string;
|
|
95
|
+
version: string;
|
|
96
|
+
}[];
|
|
97
|
+
storedConfig: (plugin: string) => Promise<Readonly<Record<string, unknown>> | undefined>;
|
|
98
|
+
lookup?: LookupFn;
|
|
99
|
+
/** Defaults to {@link BROKERED_ENDPOINT_PINS}. */
|
|
100
|
+
brokered?: readonly BrokeredEndpointPin[];
|
|
101
|
+
}): Promise<PrivateEndpointGap[]>;
|
|
102
|
+
/**
|
|
103
|
+
* The URL values of `value` that the deployment JSON Schema declares as URLs (`format: "uri"` or
|
|
104
|
+
* `"url"`, as `z.url()` emits), with their paths: through `properties`, `items`, `prefixItems`,
|
|
105
|
+
* `additionalProperties`, local `$ref`s and `anyOf` / `oneOf` / `allOf` branches.
|
|
106
|
+
*/
|
|
107
|
+
export declare function urlFields(schema: unknown, value: unknown, root?: unknown, path?: string, depth?: number): {
|
|
108
|
+
path: string;
|
|
109
|
+
url: string;
|
|
110
|
+
}[];
|
|
111
|
+
/** An enabled extension as the generic scan reads it. */
|
|
112
|
+
export type ScannedExtension = {
|
|
113
|
+
name: string;
|
|
114
|
+
version: string;
|
|
115
|
+
/** Its deployment config JSON Schema (`configSchemas.deployment`). */
|
|
116
|
+
schema: unknown;
|
|
117
|
+
/** Its deployment config stored in PG (non-secret fields), if any. */
|
|
118
|
+
stored: Readonly<Record<string, unknown>> | undefined;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* The generic platform URL check (warnings only, never a refusal): every URL field of an enabled
|
|
122
|
+
* extension's effective platform deployment config (file / env / Nacos over PG) that `ctx.net`
|
|
123
|
+
* would refuse for a request made outside an organization: a private or loopback address or plain
|
|
124
|
+
* http without an admitting alias, an alias that does not admit it, or a host that does not
|
|
125
|
+
* resolve here. `configUrlFetch` sends the platform's own value there (SDK), and the kernel's copy
|
|
126
|
+
* of the SDK serves already installed plugins too, so the gap may apply from this kernel release.
|
|
127
|
+
* Plugins the brokered check covers ({@link BROKERED_ENDPOINT_PINS}) are skipped. One gap per
|
|
128
|
+
* plugin and origin.
|
|
129
|
+
*/
|
|
130
|
+
export declare function platformUrlGaps(o: {
|
|
131
|
+
config: Pick<KernelConfig, "net" | "extensionConfig"> & {
|
|
132
|
+
extensionHost?: Pick<KernelConfig["extensionHost"], "isolation">;
|
|
133
|
+
};
|
|
134
|
+
extensions: readonly ScannedExtension[];
|
|
135
|
+
lookup?: LookupFn;
|
|
136
|
+
skip?: readonly string[];
|
|
137
|
+
}): Promise<PrivateEndpointGap[]>;
|
|
138
|
+
/**
|
|
139
|
+
* The enabled extensions installed from packages (`extension_installs` with `desired_state =
|
|
140
|
+
* 'enabled'`), with their deployment config schema and the config stored in PG.
|
|
141
|
+
*/
|
|
142
|
+
export declare function enabledExtensionsForScan(db: KernelSchemaDb): Promise<ScannedExtension[]>;
|
|
143
|
+
/** The bootstrap step refused: a brokered pin's private endpoint has no alias (see the header). */
|
|
144
|
+
export declare class PrivateEndpointMissingError extends Error {
|
|
145
|
+
readonly gaps: readonly PrivateEndpointGap[];
|
|
146
|
+
constructor(gaps: readonly PrivateEndpointGap[]);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The deployment config of a plugin stored in PG (`extension_deployment_configs`, saved by a super
|
|
150
|
+
* admin), without its secret fields (they live in `capybara.secrets` and are never read here);
|
|
151
|
+
* undefined when none is stored.
|
|
152
|
+
*/
|
|
153
|
+
export declare function storedDeploymentConfig(db: KernelSchemaDb, plugin: string): Promise<Readonly<Record<string, unknown>> | undefined>;
|
|
154
|
+
/**
|
|
155
|
+
* The deployment's private endpoint gaps: the installed brokered pins ({@link privateEndpointGaps})
|
|
156
|
+
* and every URL field of an enabled extension ({@link platformUrlGaps}). Resolves their hosts.
|
|
157
|
+
* Read by the admin health and the isolation status (plan task 1.4j).
|
|
158
|
+
*/
|
|
159
|
+
export declare function readDeploymentPrivateEndpointGaps(db: KernelSchemaDb, config: KernelConfig): Promise<PrivateEndpointGap[]>;
|