@capybara-hq/kernel 0.1.0-rc.142 → 0.1.0-rc.144

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 (238) hide show
  1. package/dist/admin/admin-agents.controller.d.ts +3 -5
  2. package/dist/admin/admin-agents.controller.js +1 -1
  3. package/dist/admin/admin-connectors.controller.d.ts +3 -5
  4. package/dist/admin/admin-connectors.controller.js +1 -1
  5. package/dist/admin/admin-items.schemas.d.ts +6 -6
  6. package/dist/admin/admin-items.schemas.js +5 -9
  7. package/dist/admin/admin.controller.d.ts +18 -12
  8. package/dist/admin/admin.controller.js +29 -15
  9. package/dist/admin/admin.schemas.d.ts +12 -3
  10. package/dist/admin/admin.schemas.js +17 -6
  11. package/dist/agents/admin-agents.d.ts +10 -8
  12. package/dist/agents/admin-agents.js +13 -9
  13. package/dist/agents/agents.module.js +3 -0
  14. package/dist/agents/agents.service.js +1 -1
  15. package/dist/agents/org-templates.d.ts +3 -1
  16. package/dist/agents/org-templates.js +7 -3
  17. package/dist/agents/pending-connector-requests.d.ts +10 -4
  18. package/dist/agents/pending-connector-requests.js +29 -7
  19. package/dist/automations/automations.controller.d.ts +9 -5
  20. package/dist/automations/automations.controller.js +21 -4
  21. package/dist/automations/automations.schemas.d.ts +19 -0
  22. package/dist/automations/automations.schemas.js +9 -0
  23. package/dist/automations/automations.service.d.ts +25 -8
  24. package/dist/automations/automations.service.js +40 -34
  25. package/dist/automations/events/acceptance.d.ts +6 -1
  26. package/dist/automations/events/acceptance.js +30 -11
  27. package/dist/automations/store.d.ts +17 -0
  28. package/dist/automations/store.js +35 -0
  29. package/dist/catalog/admin-catalog.controller.d.ts +64 -2
  30. package/dist/catalog/admin-catalog.controller.js +17 -0
  31. package/dist/catalog/catalog-import.module.js +3 -0
  32. package/dist/catalog/catalog-scope.service.d.ts +3 -1
  33. package/dist/catalog/catalog-scope.service.js +11 -7
  34. package/dist/catalog/catalog.module.js +3 -0
  35. package/dist/catalog/catalog.service.d.ts +3 -1
  36. package/dist/catalog/catalog.service.js +8 -4
  37. package/dist/catalog/cli.js +2 -2
  38. package/dist/catalog/component-promotion.d.ts +3 -1
  39. package/dist/catalog/component-promotion.js +7 -3
  40. package/dist/catalog/component-scope.service.d.ts +3 -1
  41. package/dist/catalog/component-scope.service.js +7 -3
  42. package/dist/catalog/enable-requests.d.ts +10 -8
  43. package/dist/catalog/enable-requests.js +40 -21
  44. package/dist/catalog/marketplaces.service.d.ts +1 -1
  45. package/dist/catalog/owned-items.d.ts +3 -1
  46. package/dist/catalog/owned-items.js +13 -9
  47. package/dist/catalog/platform-components.d.ts +6 -1
  48. package/dist/catalog/platform-components.js +9 -3
  49. package/dist/catalog/plugin-connectors.d.ts +8 -4
  50. package/dist/catalog/plugin-connectors.js +12 -6
  51. package/dist/catalog/plugin-import.d.ts +3 -1
  52. package/dist/catalog/plugin-import.js +14 -5
  53. package/dist/catalog/plugin-install.d.ts +3 -1
  54. package/dist/catalog/plugin-install.js +8 -4
  55. package/dist/catalog/plugin-package.js +2 -1
  56. package/dist/catalog/plugin-upgrade.d.ts +3 -1
  57. package/dist/catalog/plugin-upgrade.js +8 -4
  58. package/dist/catalog/request-hints.d.ts +19 -0
  59. package/dist/catalog/request-hints.js +34 -0
  60. package/dist/catalog/request-rules.d.ts +9 -5
  61. package/dist/catalog/request-rules.js +16 -9
  62. package/dist/catalog/requests.service.d.ts +3 -1
  63. package/dist/catalog/requests.service.js +28 -9
  64. package/dist/catalog/scope-orgs.d.ts +2 -1
  65. package/dist/catalog/scope-orgs.js +2 -2
  66. package/dist/catalog/scope-sync.d.ts +3 -1
  67. package/dist/catalog/scope-sync.js +12 -2
  68. package/dist/catalog/scope-writer.d.ts +6 -3
  69. package/dist/catalog/scope-writer.js +28 -10
  70. package/dist/catalog/unshare.d.ts +3 -2
  71. package/dist/catalog/unshare.js +4 -4
  72. package/dist/client/client-access.service.js +29 -1
  73. package/dist/config/schema.d.ts +12 -0
  74. package/dist/config/schema.js +56 -0
  75. package/dist/ctx/create-ctx.d.ts +2 -19
  76. package/dist/ctx/create-ctx.js +3 -93
  77. package/dist/ctx/durable-relay.d.ts +2 -5
  78. package/dist/ctx/durable-relay.js +56 -29
  79. package/dist/db/extension-handoff-schema.js +5 -0
  80. package/dist/db/kernel-schema.d.ts +74 -0
  81. package/dist/db/migrator.js +36 -0
  82. package/dist/erasure/account-batches.js +2 -0
  83. package/dist/erasure/account-residual.js +1 -0
  84. package/dist/erasure/org-catalog.js +8 -3
  85. package/dist/erasure/org-rules.js +1 -0
  86. package/dist/evals/evals.schemas.d.ts +15 -5
  87. package/dist/evals/evals.schemas.js +17 -10
  88. package/dist/evals/runs.controller.d.ts +4 -12
  89. package/dist/evals/runs.controller.js +14 -11
  90. package/dist/evals/runs.service.d.ts +29 -25
  91. package/dist/evals/runs.service.js +73 -61
  92. package/dist/evals/trajectory.controller.d.ts +10 -6
  93. package/dist/evals/trajectory.controller.js +11 -4
  94. package/dist/evals/trajectory.service.d.ts +17 -9
  95. package/dist/evals/trajectory.service.js +52 -35
  96. package/dist/extensions/admin-ops.d.ts +6 -1
  97. package/dist/extensions/admin-ops.js +21 -7
  98. package/dist/extensions/blobs.d.ts +2 -0
  99. package/dist/extensions/blobs.js +11 -0
  100. package/dist/extensions/deployment-config.d.ts +6 -1
  101. package/dist/extensions/deployment-config.js +13 -2
  102. package/dist/extensions/enabled.d.ts +5 -0
  103. package/dist/extensions/extensions.module.js +3 -0
  104. package/dist/extensions/grant-epoch.d.ts +108 -0
  105. package/dist/extensions/grant-epoch.js +214 -0
  106. package/dist/extensions/host.d.ts +29 -9
  107. package/dist/extensions/host.js +148 -42
  108. package/dist/extensions/instance.d.ts +3 -3
  109. package/dist/extensions/instance.js +1 -1
  110. package/dist/extensions/isolated/authorization.d.ts +54 -2
  111. package/dist/extensions/isolated/authorization.js +148 -35
  112. package/dist/extensions/isolated/child-session.js +0 -1
  113. package/dist/extensions/isolated/revision.js +1 -1
  114. package/dist/extensions/org-config.d.ts +3 -1
  115. package/dist/extensions/org-config.js +13 -4
  116. package/dist/extensions/org-overrides.d.ts +6 -1
  117. package/dist/extensions/org-overrides.js +13 -2
  118. package/dist/extensions/package-digest.job.d.ts +34 -0
  119. package/dist/extensions/package-digest.job.js +121 -0
  120. package/dist/extensions/package.js +10 -6
  121. package/dist/extensions/permission-set.d.ts +14 -78
  122. package/dist/extensions/permission-set.js +17 -143
  123. package/dist/extensions/permission-view.d.ts +13 -1
  124. package/dist/extensions/permission-view.js +20 -0
  125. package/dist/extensions/registry.js +4 -1
  126. package/dist/extensions/resolve.d.ts +7 -8
  127. package/dist/extensions/resolve.js +7 -8
  128. package/dist/extensions/revision-approvals.d.ts +167 -0
  129. package/dist/extensions/revision-approvals.js +353 -0
  130. package/dist/extensions/revision-grants.d.ts +197 -0
  131. package/dist/extensions/revision-grants.js +584 -0
  132. package/dist/extensions/state.module.js +12 -1
  133. package/dist/identity/accounts.d.ts +10 -4
  134. package/dist/identity/accounts.js +18 -5
  135. package/dist/inbox/inbox-items.service.d.ts +6 -1
  136. package/dist/inbox/inbox-items.service.js +29 -10
  137. package/dist/inbox/inbox.module.js +3 -0
  138. package/dist/inbox/inbox.service.d.ts +3 -1
  139. package/dist/inbox/inbox.service.js +9 -2
  140. package/dist/inbox/org-notices.d.ts +4 -3
  141. package/dist/inbox/org-notices.js +9 -6
  142. package/dist/inbox/platform-inbox.service.d.ts +3 -1
  143. package/dist/inbox/platform-inbox.service.js +11 -3
  144. package/dist/inbox/platform-notices.d.ts +3 -2
  145. package/dist/inbox/platform-notices.js +10 -4
  146. package/dist/infra/config/kernel-config.service.js +4 -1
  147. package/dist/infra/database/extension-effect-key-lock.js +7 -0
  148. package/dist/infra/paging/paged-read.d.ts +34 -4
  149. package/dist/infra/paging/paged-read.js +38 -1
  150. package/dist/invalidation/audiences.d.ts +32 -0
  151. package/dist/invalidation/audiences.js +43 -0
  152. package/dist/invalidation/hints.d.ts +6 -0
  153. package/dist/invalidation/hints.js +7 -1
  154. package/dist/invalidation/invalidation-hints.d.ts +12 -1
  155. package/dist/invalidation/invalidation-hints.js +46 -5
  156. package/dist/invalidation/invalidation-hints.module.d.ts +2 -0
  157. package/dist/invalidation/invalidation-hints.module.js +4 -1
  158. package/dist/invalidation/me-stream.d.ts +1 -11
  159. package/dist/invalidation/me-stream.js +12 -41
  160. package/dist/invalidation/org-intent-bridge.d.ts +18 -0
  161. package/dist/invalidation/org-intent-bridge.js +46 -0
  162. package/dist/models/enablement.d.ts +3 -1
  163. package/dist/models/enablement.js +25 -5
  164. package/dist/orgs/invitations.controller.d.ts +4 -7
  165. package/dist/orgs/invitations.controller.js +8 -5
  166. package/dist/orgs/invitations.service.d.ts +17 -3
  167. package/dist/orgs/invitations.service.js +35 -13
  168. package/dist/orgs/members.service.d.ts +35 -0
  169. package/dist/orgs/members.service.js +52 -3
  170. package/dist/orgs/offboarding.d.ts +3 -1
  171. package/dist/orgs/offboarding.js +7 -3
  172. package/dist/orgs/orgs.controller.d.ts +11 -4
  173. package/dist/orgs/orgs.controller.js +25 -5
  174. package/dist/orgs/orgs.module.js +3 -0
  175. package/dist/orgs/orgs.schemas.d.ts +14 -0
  176. package/dist/orgs/orgs.schemas.js +19 -2
  177. package/dist/orgs/orgs.service.d.ts +24 -2
  178. package/dist/orgs/orgs.service.js +47 -4
  179. package/dist/orgs/security-settings.service.d.ts +14 -6
  180. package/dist/orgs/security-settings.service.js +18 -13
  181. package/dist/orgs/settings.controller.d.ts +7 -4
  182. package/dist/platform/exclusions.js +15 -0
  183. package/dist/platform/ops/accounts.ops.js +7 -16
  184. package/dist/platform/ops/admin-items.ops.js +7 -7
  185. package/dist/platform/ops/automations.ops.js +6 -4
  186. package/dist/platform/ops/evals.ops.js +30 -15
  187. package/dist/platform/ops/org-settings.ops.js +2 -2
  188. package/dist/platform/ops/orgs.ops.js +44 -27
  189. package/dist/push/delivery.d.ts +3 -1
  190. package/dist/push/delivery.js +7 -3
  191. package/dist/push/push-processor.js +8 -1
  192. package/dist/roles/worker.module.js +3 -0
  193. package/dist/runtime/step-log.d.ts +1 -1
  194. package/dist/runtime/step-log.js +5 -4
  195. package/dist/runtime/stream-limit.d.ts +13 -0
  196. package/dist/runtime/stream-limit.js +40 -0
  197. package/dist/runtime/stream.controller.d.ts +2 -0
  198. package/dist/runtime/stream.controller.js +2 -0
  199. package/dist/runtime/stream.d.ts +1 -0
  200. package/dist/runtime/stream.js +15 -6
  201. package/dist/sandbox/permission-authority.module.js +6 -1
  202. package/dist/sandbox/permission-transitions.d.ts +3 -1
  203. package/dist/sandbox/permission-transitions.js +17 -2
  204. package/dist/setup/kernel-checks.d.ts +3 -3
  205. package/dist/setup/kernel-checks.js +4 -4
  206. package/dist/setup/setup-check-registry.d.ts +16 -5
  207. package/dist/setup/setup-check-registry.js +11 -3
  208. package/dist/setup/setup-checks.service.d.ts +1 -2
  209. package/dist/setup/setup-checks.service.js +7 -6
  210. package/dist/skills/agent-skills.service.d.ts +6 -1
  211. package/dist/skills/agent-skills.service.js +12 -3
  212. package/dist/skills/changes.service.d.ts +6 -1
  213. package/dist/skills/changes.service.js +11 -3
  214. package/dist/skills/conversation-catalog.d.ts +3 -0
  215. package/dist/skills/conversation-catalog.js +2 -0
  216. package/dist/skills/skills.module.js +3 -0
  217. package/dist/skills/skills.service.d.ts +3 -1
  218. package/dist/skills/skills.service.js +8 -4
  219. package/dist/tools/admin-connectors.d.ts +10 -8
  220. package/dist/tools/admin-connectors.js +12 -10
  221. package/dist/tools/approvals.service.d.ts +12 -1
  222. package/dist/tools/approvals.service.js +36 -9
  223. package/dist/tools/builtins/automations.d.ts +1 -1
  224. package/dist/tools/builtins/automations.js +1 -1
  225. package/dist/tools/connectors.service.d.ts +3 -1
  226. package/dist/tools/connectors.service.js +29 -7
  227. package/dist/tools/tools.module.js +3 -0
  228. package/dist/ui/admin-ui.controller.d.ts +3 -1
  229. package/dist/ui/admin-ui.controller.js +3 -1
  230. package/dist/ui/ui-stream.d.ts +2 -0
  231. package/dist/ui/ui-stream.js +20 -6
  232. package/dist/ui/views.controller.d.ts +4 -2
  233. package/dist/ui/views.controller.js +4 -2
  234. package/package.json +3 -3
  235. package/src/migrations/0234_extension_grant_epoch.sql +141 -0
  236. package/src/migrations/0235_extension_revision_grants.sql +166 -0
  237. package/src/migrations/0236_paged_table_idx.sql +33 -0
  238. package/src/migrations/0237_extension_handoff_health.sql +18 -0
@@ -0,0 +1,197 @@
1
+ import { KernelDb } from "../infra/database/kernel-db.js";
2
+ import { TransactionHost } from "../infra/database/transaction-host.js";
3
+ /**
4
+ * Revision grants (extension permission model spec 2026-12-04, "Revision grants and enforcement
5
+ * cutover"; plan task 1.2a): the store of admin approvals, each bound to one exact package
6
+ * revision, and of the approved and candidate revision of each install.
7
+ *
8
+ * A revision can be reviewed again after its grant was revoked or retired: each review is a new
9
+ * generation, older generations stay as history, and at most one generation is live.
10
+ *
11
+ * Shadow mode until plan task 1.5a: grants are written and read here, but admission still follows
12
+ * the legacy permission snapshots and nothing refuses on account of a grant. Every write changes a
13
+ * table with the grant epoch trigger (migration 0234), so replicas see the change within the
14
+ * revocation bound once the grant check reads these tables.
15
+ */
16
+ /** An exact package revision. `sha512` is the lowercase hex digest of the package archive. */
17
+ export interface RevisionIdentity {
18
+ plugin: string;
19
+ version: string;
20
+ sha512: string;
21
+ }
22
+ export type RevisionGrantState = "approved" | "partially_revoked" | "revoked" | "retired";
23
+ /** How a grant was made. */
24
+ export type GrantSource = "review" | "operator_config" | "operator_cli" | "auto" | "continuity";
25
+ /** The approving authority a grant exercises; continuity carries its source grant's. */
26
+ export type GrantAuthority = "super_admin" | "operator" | "auto";
27
+ export type PublisherEvidence = "verified" | "pin_only" | "none";
28
+ export type ExecutionRealm = "server" | "browser" | "device";
29
+ export type ApprovalScope = {
30
+ mode: "all" | "optional";
31
+ } | {
32
+ mode: "named";
33
+ orgs: readonly string[];
34
+ };
35
+ export declare const EXECUTION_REALMS: readonly ExecutionRealm[];
36
+ /** The kernel-generated permission key of full access in one realm, revocable on its own. */
37
+ export declare function fullAccessKey(realm: ExecutionRealm): string;
38
+ /** One reviewed permission row with its bilingual purpose. */
39
+ export interface PurposeRow {
40
+ key: string;
41
+ zh: string;
42
+ en: string;
43
+ }
44
+ export interface PublisherIdentity {
45
+ issuer: string;
46
+ identity: string;
47
+ repository?: string;
48
+ workflow?: string;
49
+ }
50
+ export interface NewRevisionGrant {
51
+ revision: RevisionIdentity;
52
+ /** Exactly one row per canonical key, the key set of the reviewed surface. */
53
+ purposes: readonly PurposeRow[];
54
+ /**
55
+ * Full-access realms granted, each with the forcing keys it covers. Each realm needs its
56
+ * {@link fullAccessKey} among the purposes, and that key needs a realm here.
57
+ */
58
+ realms?: Partial<Record<ExecutionRealm, readonly string[]>>;
59
+ reviewHash: string;
60
+ approvalScope: ApprovalScope;
61
+ source: GrantSource;
62
+ publisher: {
63
+ evidence: "verified";
64
+ identity: PublisherIdentity;
65
+ } | {
66
+ evidence: "pin_only" | "none";
67
+ };
68
+ /** The revision whose live grant this one continues; required with source `continuity` only. */
69
+ continuedFrom?: RevisionIdentity;
70
+ approvedBy: string | null;
71
+ }
72
+ export interface RevisionGrant {
73
+ revision: RevisionIdentity;
74
+ generation: number;
75
+ keys: string[];
76
+ purposes: PurposeRow[];
77
+ purposesDigest: string;
78
+ realms: Partial<Record<ExecutionRealm, string[]>>;
79
+ reviewHash: string;
80
+ approvalScope: ApprovalScope;
81
+ source: GrantSource;
82
+ authority: GrantAuthority;
83
+ publisher: PublisherIdentity | null;
84
+ publisherEvidence: PublisherEvidence;
85
+ continuedFrom: (RevisionIdentity & {
86
+ generation: number;
87
+ }) | null;
88
+ state: RevisionGrantState;
89
+ disabledKeys: string[];
90
+ retiredKeys: string[];
91
+ retiredForcing: Partial<Record<ExecutionRealm, string[]>>;
92
+ approvedBy: string | null;
93
+ approvedAt: Date;
94
+ stateChangedBy: string | null;
95
+ stateChangedAt: Date | null;
96
+ }
97
+ /** The serving surface of a live grant: its keys minus the revoked and the retired ones. */
98
+ export declare function effectiveKeys(grant: Pick<RevisionGrant, "keys" | "disabledKeys" | "retiredKeys">): string[];
99
+ /**
100
+ * The full-access realms a live grant still covers, each with its remaining forcing keys: a realm
101
+ * whose key was revoked or retired, or whose forcing keys were all retired, is gone.
102
+ */
103
+ export declare function effectiveRealms(grant: RevisionGrant): Partial<Record<ExecutionRealm, string[]>>;
104
+ export declare function isLive(state: RevisionGrantState): boolean;
105
+ export type RevisionGrantErrorCode = "invalid" | "conflict" | "not_found" | "terminal" | "unknown_keys" | "not_live" | "not_continuous";
106
+ export declare class RevisionGrantError extends Error {
107
+ readonly code: RevisionGrantErrorCode;
108
+ constructor(code: RevisionGrantErrorCode, message: string);
109
+ }
110
+ /** sha256 hex of the canonical encoding of the purpose rows, sorted by key. */
111
+ export declare function purposesDigest(purposes: readonly PurposeRow[]): string;
112
+ /** What a continuation proposes: compared with the live source grant by {@link continuityProblem}. */
113
+ export interface ContinuationCandidate {
114
+ purposes: readonly PurposeRow[];
115
+ realms: Partial<Record<ExecutionRealm, readonly string[]>>;
116
+ approvalScope: ApprovalScope;
117
+ publisher: NewRevisionGrant["publisher"];
118
+ }
119
+ /**
120
+ * The spec's continuity conditions against a live source grant; the reason the candidate is not a
121
+ * continuation, or undefined when it is. The continued surface is a subset of what still serves,
122
+ * with identical purposes, no wider org scope, full access only where the source still covers it,
123
+ * and the same verified publisher. A partially revoked source never resurrects its revoked or
124
+ * retired keys. The store checks it under the source's share lock; the shadow decisions use it to
125
+ * report why a revision would wait for review.
126
+ */
127
+ export declare function continuityProblem(source: RevisionGrant, candidate: ContinuationCandidate): string | undefined;
128
+ /** The revision grants and the approved / candidate revision of each install (PG). */
129
+ export declare class ExtensionRevisionGrants {
130
+ private readonly kdb;
131
+ readonly txHost: TransactionHost;
132
+ constructor(kdb: KernelDb, txHost: TransactionHost);
133
+ private get db();
134
+ /**
135
+ * Records an approval for one exact revision as a new generation. Recording the same review
136
+ * while that grant is approved returns it; any other review while a grant is live is a
137
+ * conflict. After a revocation or retirement a new review opens the next generation. Two
138
+ * replicas recording at once end in the same outcome: the loser re-reads the winner's row.
139
+ */
140
+ record(input: NewRevisionGrant): Promise<RevisionGrant>;
141
+ /** The newest generation of a revision's grant in any state, or undefined. */
142
+ get(revision: RevisionIdentity): Promise<RevisionGrant | undefined>;
143
+ /** The live (approved or partially revoked) grant of a revision, or undefined. */
144
+ live(revision: RevisionIdentity): Promise<RevisionGrant | undefined>;
145
+ /** Every generation of a revision's grant, oldest first. */
146
+ history(revision: RevisionIdentity): Promise<RevisionGrant[]>;
147
+ /** Every grant of a plugin, newest approval first. */
148
+ forPlugin(plugin: string): Promise<RevisionGrant[]>;
149
+ /**
150
+ * Revokes keys of a live grant (partial revocation; `execution.full-access:<realm>` revokes one
151
+ * realm). Revoking every key that is not retired revokes the grant. The reviewed rows stay;
152
+ * only `disabled_keys` grows.
153
+ */
154
+ revokeKeys(revision: RevisionIdentity, keys: readonly string[], actor: string | null): Promise<RevisionGrant>;
155
+ /** Revokes a live grant entirely. */
156
+ revoke(revision: RevisionIdentity, actor: string | null): Promise<RevisionGrant>;
157
+ /**
158
+ * Retires a live grant whose revision is superseded as a whole. Retirement is not revocation,
159
+ * and nothing revives it automatically; a new review opens the next generation.
160
+ */
161
+ retire(revision: RevisionIdentity, actor: string | null): Promise<RevisionGrant>;
162
+ /**
163
+ * Retires keys of a live grant that are no longer needed; the grant stays live. Retiring every
164
+ * key leaves an approved revision with an empty surface, which is valid: a package may declare
165
+ * no permissions at all. Retire the whole grant with {@link retire} when the revision goes.
166
+ */
167
+ retireKeys(revision: RevisionIdentity, keys: readonly string[], actor: string | null): Promise<RevisionGrant>;
168
+ /**
169
+ * Retires one forcing key of a full-access realm (the supervisor became available, so
170
+ * `host.no-isolation` no longer applies). When no forcing key of the realm remains, its
171
+ * `execution.full-access:<realm>` key is retired too; the rest of the grant stays live.
172
+ */
173
+ retireForcing(revision: RevisionIdentity, realm: ExecutionRealm, forcingKey: string, actor: string | null): Promise<RevisionGrant>;
174
+ /** The approved (with its grant generation) and candidate revision of an install. */
175
+ installRevisions(plugin: string): Promise<{
176
+ approved: (RevisionIdentity & {
177
+ generation: number;
178
+ }) | undefined;
179
+ candidate: RevisionIdentity | undefined;
180
+ }>;
181
+ /** Sets or clears the candidate revision of an install; a candidate needs no grant. */
182
+ setCandidate(plugin: string, candidate: RevisionIdentity | null): Promise<void>;
183
+ /**
184
+ * Makes a revision the approved one of its install, under its live grant's generation (rechecked
185
+ * under the grant's row lock). The candidate is cleared in the same statement only if it is
186
+ * this revision, so a candidate another request set meanwhile survives.
187
+ */
188
+ promote(revision: RevisionIdentity): Promise<void>;
189
+ private sameReview;
190
+ private checkKeys;
191
+ private update;
192
+ private requireLive;
193
+ /** The live generation, optionally locked for this transaction (callers run inside one). */
194
+ private liveRow;
195
+ private select;
196
+ private withOrgs;
197
+ }