@cloudhal/mcp-server 0.0.0-stage → 0.1.0
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/LICENSE +202 -0
- package/README.md +18 -2
- package/dist/src/analytics-reports.d.ts +164 -0
- package/dist/src/analytics-reports.js +632 -0
- package/dist/src/analytics-tools.d.ts +4 -0
- package/dist/src/analytics-tools.js +597 -0
- package/dist/src/asset-tools.d.ts +5 -0
- package/dist/src/asset-tools.js +685 -0
- package/dist/src/body-tools.d.ts +46 -0
- package/dist/src/body-tools.js +708 -0
- package/dist/src/changes.d.ts +10 -0
- package/dist/src/changes.js +112 -0
- package/dist/src/chrome-tools.d.ts +8 -0
- package/dist/src/chrome-tools.js +207 -0
- package/dist/src/comment-tools.d.ts +9 -0
- package/dist/src/comment-tools.js +743 -0
- package/dist/src/comments.d.ts +184 -0
- package/dist/src/comments.js +408 -0
- package/dist/src/common.d.ts +258 -0
- package/dist/src/common.js +488 -0
- package/dist/src/content-shared.d.ts +50 -0
- package/dist/src/content-shared.js +102 -0
- package/dist/src/design-tools.d.ts +9 -0
- package/dist/src/design-tools.js +349 -0
- package/dist/src/elevation-tools.d.ts +3 -0
- package/dist/src/elevation-tools.js +331 -0
- package/dist/src/entry-terms.d.ts +14 -0
- package/dist/src/entry-terms.js +51 -0
- package/dist/src/entry-tools.d.ts +4 -0
- package/dist/src/entry-tools.js +442 -0
- package/dist/src/http.d.ts +48 -0
- package/dist/src/http.js +101 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.js +10 -0
- package/dist/src/menu-tools.d.ts +41 -0
- package/dist/src/menu-tools.js +1058 -0
- package/dist/src/page-tools.d.ts +5 -0
- package/dist/src/page-tools.js +311 -0
- package/dist/src/preview-doc.d.ts +9 -0
- package/dist/src/preview-doc.js +56 -0
- package/dist/src/preview-view.d.ts +19 -0
- package/dist/src/preview-view.js +71 -0
- package/dist/src/publish-tools.d.ts +10 -0
- package/dist/src/publish-tools.js +248 -0
- package/dist/src/render/cdp.d.ts +29 -0
- package/dist/src/render/cdp.js +190 -0
- package/dist/src/render/checks/components.d.ts +5 -0
- package/dist/src/render/checks/components.js +95 -0
- package/dist/src/render/checks/content.d.ts +5 -0
- package/dist/src/render/checks/content.js +63 -0
- package/dist/src/render/checks/contrast.d.ts +5 -0
- package/dist/src/render/checks/contrast.js +72 -0
- package/dist/src/render/checks/index.d.ts +1 -0
- package/dist/src/render/checks/index.js +29 -0
- package/dist/src/render/checks/layout.d.ts +5 -0
- package/dist/src/render/checks/layout.js +44 -0
- package/dist/src/render/checks/motion.d.ts +5 -0
- package/dist/src/render/checks/motion.js +66 -0
- package/dist/src/render/checks/navigation.d.ts +5 -0
- package/dist/src/render/checks/navigation.js +78 -0
- package/dist/src/render/checks/prelude.d.ts +1 -0
- package/dist/src/render/checks/prelude.js +64 -0
- package/dist/src/render/limiter.d.ts +11 -0
- package/dist/src/render/limiter.js +29 -0
- package/dist/src/render/page.d.ts +19 -0
- package/dist/src/render/page.js +135 -0
- package/dist/src/render/types.d.ts +89 -0
- package/dist/src/render/types.js +140 -0
- package/dist/src/render-tools.d.ts +14 -0
- package/dist/src/render-tools.js +314 -0
- package/dist/src/render.d.ts +14 -0
- package/dist/src/render.js +33 -0
- package/dist/src/schedule-tools.d.ts +2 -0
- package/dist/src/schedule-tools.js +1596 -0
- package/dist/src/schedules.d.ts +292 -0
- package/dist/src/schedules.js +890 -0
- package/dist/src/schema-transforms.d.ts +14 -0
- package/dist/src/schema-transforms.js +50 -0
- package/dist/src/search-tools.d.ts +2 -0
- package/dist/src/search-tools.js +112 -0
- package/dist/src/server-approvals.d.ts +51 -0
- package/dist/src/server-approvals.js +273 -0
- package/dist/src/server-call.d.ts +28 -0
- package/dist/src/server-call.js +259 -0
- package/dist/src/server-instructions.d.ts +4 -0
- package/dist/src/server-instructions.js +74 -0
- package/dist/src/server-resources.d.ts +4 -0
- package/dist/src/server-resources.js +83 -0
- package/dist/src/server-schema.d.ts +20 -0
- package/dist/src/server-schema.js +82 -0
- package/dist/src/server.d.ts +80 -0
- package/dist/src/server.js +135 -0
- package/dist/src/stdio.d.ts +9 -0
- package/dist/src/stdio.js +18 -0
- package/dist/src/surface-tools.d.ts +4 -0
- package/dist/src/surface-tools.js +357 -0
- package/dist/src/taxonomy-tools.d.ts +16 -0
- package/dist/src/taxonomy-tools.js +1433 -0
- package/dist/src/terms.d.ts +47 -0
- package/dist/src/terms.js +271 -0
- package/dist/src/tools.d.ts +39 -0
- package/dist/src/tools.js +511 -0
- package/dist/src/translation-tools.d.ts +3 -0
- package/dist/src/translation-tools.js +422 -0
- package/package.json +86 -3
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schedules for agents and the REST API (RFC-0008 §10–§14): the deployment's schedule store, its
|
|
3
|
+
* ticker and core-ts's `ReleaseService` (pinning, scheduling, "Publish now"), "own" for releases, who may
|
|
4
|
+
* approve one, the views and the calendar, release requests and their carry-out, automation runs
|
|
5
|
+
* (the open run of an automation key, taint and budgets) and the scheduler's run-time re-check of
|
|
6
|
+
* approvals (`createReleaseApprovalCheck`). Shared by the MCP schedule tools (`schedule-tools.ts`)
|
|
7
|
+
* and `@cloudhal/api`'s schedule routes.
|
|
8
|
+
*/
|
|
9
|
+
import { type AgentMode, type Approval, type ApprovalCause, type ApprovalStore, checkAutoRelease, type OwnershipResolver, type Principal, type ReleaseItemRisk, type Role } from "@cloudhal/agent-runtime";
|
|
10
|
+
import type { Actor, Automation, AutomationJob, NodeRef, Release, ReleaseApproval, ReleaseNodeKind, ReleaseWhen, ScheduleRun, Site } from "@cloudhal/core-contracts";
|
|
11
|
+
import { type SiteGraphStore } from "@cloudhal/core-ts";
|
|
12
|
+
import { type ReleasePurger, ReleaseService, type SchedulerControl } from "@cloudhal/core-ts/releases";
|
|
13
|
+
import { type ApprovalVerdict, type RunTaintState, type StoredReleaseItem } from "@cloudhal/schedules";
|
|
14
|
+
import type { ReleaseRecord, SqlScheduleStore } from "@cloudhal/schedules/sql";
|
|
15
|
+
/** What a deployment provides for schedules (RFC-0008 §16). */
|
|
16
|
+
export interface SchedulesDeps {
|
|
17
|
+
readonly store: SqlScheduleStore;
|
|
18
|
+
/** `false` when the deployment turned schedules off. Default true. */
|
|
19
|
+
readonly available?: boolean | undefined;
|
|
20
|
+
/** `CLOUDHAL_AUTOMATIONS=off` → false: automations stop, releases and gates go on (§11.6). */
|
|
21
|
+
readonly automationsEnabled?: boolean | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The deployment's ticker (`ApiDeps.scheduler`): its mode for `/api/instance` and
|
|
24
|
+
* `/api/scheduler`, and `poke` when something becomes due sooner (a release scheduled, approved or
|
|
25
|
+
* moved, a window opened; §8.3).
|
|
26
|
+
*/
|
|
27
|
+
readonly scheduler?: SchedulerControl | undefined;
|
|
28
|
+
/** "Publish now" purges the live site's cache like a tick does (absent: nothing is cached). */
|
|
29
|
+
readonly purge?: ReleasePurger | undefined;
|
|
30
|
+
/** New versions one call may pin (§6.1 step 4; Workers Free: 20, the default). */
|
|
31
|
+
readonly maxNewBodies?: number | undefined;
|
|
32
|
+
}
|
|
33
|
+
/** True when the deployment serves schedules. */
|
|
34
|
+
export declare const schedulesAvailable: (deps: SchedulesDeps | undefined) => deps is SchedulesDeps;
|
|
35
|
+
/** core-ts's `ReleaseService` over this graph, with the deployment's ticker and purge. */
|
|
36
|
+
export declare function releaseService(deps: SchedulesDeps, graph: SiteGraphStore, now?: () => Date): ReleaseService;
|
|
37
|
+
/** Tells the ticker something is due at `at` (never throws, never awaited by callers' answers). */
|
|
38
|
+
export declare function poke(deps: SchedulesDeps, at: string | undefined): void;
|
|
39
|
+
/** The person approving on a local server without people (stdio, `bypass`, a confirmed elicitation). */
|
|
40
|
+
export declare const LOCAL_PERSON: Readonly<{
|
|
41
|
+
id: "user_localdev01";
|
|
42
|
+
name: "Local developer";
|
|
43
|
+
}>;
|
|
44
|
+
/** Metadata keys on releases (Release.metadata, strings only). */
|
|
45
|
+
export declare const RELEASE_META: {
|
|
46
|
+
/** The agent's note on a proposal (≤ 500, plain). */
|
|
47
|
+
readonly note: "cloudhal.note";
|
|
48
|
+
/** A gate-only reduction (set_embargo on a live node): re-checked without the mode rule. */
|
|
49
|
+
readonly reduce: "cloudhal.reduce";
|
|
50
|
+
/**
|
|
51
|
+
* The mode the agent worked in when it scheduled a gate-only reduction with its key's (`auto`)
|
|
52
|
+
* approval (`plan` … `auto`): such a release is not an `auto`-mode publish, so Studio labels it
|
|
53
|
+
* by this mode ("Hidden by an agent in EDITS mode"), not as "Automatic".
|
|
54
|
+
*/
|
|
55
|
+
readonly mode: "cloudhal.mode";
|
|
56
|
+
/** The tool or route that made the release. */
|
|
57
|
+
readonly source: "cloudhal.source";
|
|
58
|
+
};
|
|
59
|
+
/** A node of the working copy by kind and id (undefined when it is gone). */
|
|
60
|
+
export declare function workingNode(graph: SiteGraphStore, kind: string, id: string): Promise<{
|
|
61
|
+
id: string;
|
|
62
|
+
siteId?: string;
|
|
63
|
+
rev: number;
|
|
64
|
+
} | undefined>;
|
|
65
|
+
/** The live snapshot's node refs (empty when nothing is live yet). */
|
|
66
|
+
export declare function liveRefs(graph: SiteGraphStore, site: Site): Promise<NodeRef[]>;
|
|
67
|
+
/** A node version's body: the working copy when it is that version, else the snapshot blob. */
|
|
68
|
+
export declare function nodeVersion<T = unknown>(graph: SiteGraphStore, ref: Pick<NodeRef, "id" | "kind" | "rev" | "hash">): Promise<T | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* The `rl1:` a one-node request is bound to before any release exists (`schedule_unpublish`,
|
|
71
|
+
* `lift_embargo`): the node's working and live versions, so any change voids the request.
|
|
72
|
+
*/
|
|
73
|
+
export declare function nodeBinding(graph: SiteGraphStore, site: Site, nodeId: string): Promise<string>;
|
|
74
|
+
/** The items as the low-risk check sees them (§10.3). */
|
|
75
|
+
export declare function releaseRisk(items: readonly Pick<StoredReleaseItem, "item" | "deps">[], corrects?: ReadonlySet<string>): ReleaseItemRisk[];
|
|
76
|
+
/** RFC-0019 §2.4: the release's articles whose target adds a correction to the live version. */
|
|
77
|
+
export declare function releaseCorrections(graph: SiteGraphStore, items: readonly Pick<StoredReleaseItem, "item">[]): Promise<Set<string>>;
|
|
78
|
+
/** A release removes content or carries an expiry: canceling it keeps content up (§12 `cancel_schedule`). */
|
|
79
|
+
export declare function removesContent(graph: SiteGraphStore, record: Pick<ReleaseRecord, "items">): Promise<boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* Whether every item is `person`'s own (RFC-0005 §4, `ownOnlyChangeSet`'s rule): entries whose
|
|
82
|
+
* author is the person or one of their agents, plus new assets those entries use. Undefined when
|
|
83
|
+
* own-only, else why not.
|
|
84
|
+
*/
|
|
85
|
+
export declare function notOwnRelease(graph: SiteGraphStore, ownership: OwnershipResolver, person: string | undefined, items: readonly Pick<StoredReleaseItem, "item" | "deps">[]): Promise<string | undefined>;
|
|
86
|
+
/**
|
|
87
|
+
* May this principal approve these items now (§10.4, §10.6)? `releases:publish`, or
|
|
88
|
+
* `releases:publish:own` with own-only items. Without a membership source a person may.
|
|
89
|
+
*/
|
|
90
|
+
export declare function approvalProblem(graph: SiteGraphStore, ownership: OwnershipResolver, principal: Pick<Principal, "scopes" | "person" | "actor">, items: readonly Pick<StoredReleaseItem, "item" | "deps">[]): Promise<string | undefined>;
|
|
91
|
+
/** A person's approval as the contract stores it (a staff person, never an agent). */
|
|
92
|
+
export declare function personApproval(principal: Pick<Principal, "actor" | "person">, at: string, extra?: {
|
|
93
|
+
executeAt?: string;
|
|
94
|
+
approvalId?: string;
|
|
95
|
+
}): ReleaseApproval;
|
|
96
|
+
/** When a scheduled release becomes due (`on-approval`: now). */
|
|
97
|
+
export declare function executeAtOf(when: ReleaseWhen | undefined, now: string): string | undefined;
|
|
98
|
+
export interface AutoVerdict {
|
|
99
|
+
ok: boolean;
|
|
100
|
+
/** Why not, in words (the agent reads it). */
|
|
101
|
+
reason?: string;
|
|
102
|
+
windowEnds: string;
|
|
103
|
+
check: ReturnType<typeof checkAutoRelease>;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The `auto` path of a release (§10.3, §10.7): the key's effective mode is `auto` (never inside a
|
|
107
|
+
* tainted run — such calls never get here), the items are low risk, the key holds
|
|
108
|
+
* `releases:publish` (own-only items with `:own`), and the release runs before the window ends.
|
|
109
|
+
*/
|
|
110
|
+
export declare function autoReleaseVerdict(graph: SiteGraphStore, ownership: OwnershipResolver, principal: Principal, items: readonly Pick<StoredReleaseItem, "item" | "deps">[], executeAt: string, now: Date): Promise<AutoVerdict>;
|
|
111
|
+
/** How long an agent's release request may wait (§10.5): until the release's time, ≤ 30 days. */
|
|
112
|
+
export declare function requestExpiry(when: ReleaseWhen | undefined, now: Date, agent: boolean): {
|
|
113
|
+
expiresAt?: string;
|
|
114
|
+
problem?: string;
|
|
115
|
+
};
|
|
116
|
+
/** The `input` of a release request: what the carry-out reads back (and Studio shows). */
|
|
117
|
+
export interface ReleaseRequestInput {
|
|
118
|
+
siteId: string;
|
|
119
|
+
releaseId: string;
|
|
120
|
+
when: ReleaseWhen | null;
|
|
121
|
+
[key: string]: unknown;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Moves a release to `awaiting_approval` and files one request bound to its `rl1:` hash and
|
|
125
|
+
* `when` (§10.4): `args_hash` covers `approvalArgs(releaseId, when)`, the request expires at the
|
|
126
|
+
* release's time. A release already awaiting approval keeps waiting under the new request (the old
|
|
127
|
+
* one is closed). Returns the request.
|
|
128
|
+
*/
|
|
129
|
+
export declare function requestRelease(input: {
|
|
130
|
+
deps: SchedulesDeps;
|
|
131
|
+
approvals: ApprovalStore;
|
|
132
|
+
record: ReleaseRecord;
|
|
133
|
+
when: ReleaseWhen;
|
|
134
|
+
tool: string;
|
|
135
|
+
actor: Actor;
|
|
136
|
+
prompt: string;
|
|
137
|
+
cause: ApprovalCause;
|
|
138
|
+
mode?: AgentMode | undefined;
|
|
139
|
+
runId?: string | undefined;
|
|
140
|
+
now: Date;
|
|
141
|
+
extra?: Record<string, unknown>;
|
|
142
|
+
}): Promise<{
|
|
143
|
+
release: Release;
|
|
144
|
+
request: Approval;
|
|
145
|
+
}>;
|
|
146
|
+
/** A release request that cannot be filed (too far ahead for an agent). */
|
|
147
|
+
export declare class ScheduleRequestError extends Error {
|
|
148
|
+
readonly name = "ScheduleRequestError";
|
|
149
|
+
}
|
|
150
|
+
/** Whether a request's `when` is the release's current one (§10.4: the time is in `args_hash`). */
|
|
151
|
+
export declare function sameWhen(a: ReleaseWhen | null | undefined, b: ReleaseWhen | undefined): boolean;
|
|
152
|
+
export type ApprovalState = "none" | "pending" | "approved" | "auto" | "denied" | "expired";
|
|
153
|
+
export declare function approvalState(r: Release): ApprovalState;
|
|
154
|
+
export interface ReleaseItemView {
|
|
155
|
+
nodeId: string;
|
|
156
|
+
nodeKind: ReleaseNodeKind;
|
|
157
|
+
kind: "set" | "remove";
|
|
158
|
+
title: string | null;
|
|
159
|
+
path: string | null;
|
|
160
|
+
pinnedRev: number | null;
|
|
161
|
+
liveRev: number | null;
|
|
162
|
+
/** Added because a target uses it (§6.1 step 2). */
|
|
163
|
+
closure: boolean;
|
|
164
|
+
/** Other non-terminal releases with this node (D15). */
|
|
165
|
+
overlaps: string[];
|
|
166
|
+
}
|
|
167
|
+
export interface ReleaseView extends Release {
|
|
168
|
+
executeAt: string | null;
|
|
169
|
+
approvalState: ApprovalState;
|
|
170
|
+
view: {
|
|
171
|
+
items: ReleaseItemView[];
|
|
172
|
+
closureAdded: string[];
|
|
173
|
+
/** Nodes held by this release (locked against edits, §6.2). */
|
|
174
|
+
lockedNodes: string[];
|
|
175
|
+
request?: {
|
|
176
|
+
id: string;
|
|
177
|
+
status: Approval["status"];
|
|
178
|
+
actor: Actor;
|
|
179
|
+
expiresAt: string;
|
|
180
|
+
createdAt: string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/** A release with its items' titles and paths, overlaps, locks and the request (§12 `get_release`). */
|
|
185
|
+
export declare function releaseView(deps: SchedulesDeps, graph: SiteGraphStore, record: ReleaseRecord, approvals?: ApprovalStore): Promise<ReleaseView>;
|
|
186
|
+
export interface CalendarItem {
|
|
187
|
+
/** `rel_…`, `gate:<nodeId>:from|until` or `occ:<automationId>:<at>`. */
|
|
188
|
+
id: string;
|
|
189
|
+
kind: "release" | "gate" | "automation";
|
|
190
|
+
at: string;
|
|
191
|
+
title: string;
|
|
192
|
+
target: {
|
|
193
|
+
nodeIds?: string[];
|
|
194
|
+
nodeId?: string;
|
|
195
|
+
automationId?: string;
|
|
196
|
+
releaseId?: string;
|
|
197
|
+
};
|
|
198
|
+
origin: "person" | "agent";
|
|
199
|
+
approval: ApprovalState;
|
|
200
|
+
state: string;
|
|
201
|
+
overlaps?: string[];
|
|
202
|
+
}
|
|
203
|
+
export interface CalendarQuery {
|
|
204
|
+
from: string;
|
|
205
|
+
to: string;
|
|
206
|
+
types?: readonly ("release" | "gate" | "automation")[];
|
|
207
|
+
states?: readonly string[];
|
|
208
|
+
origin?: "person" | "agent";
|
|
209
|
+
approval?: ApprovalState;
|
|
210
|
+
q?: string;
|
|
211
|
+
collection?: string;
|
|
212
|
+
/** Items to skip (the cursor). */
|
|
213
|
+
offset?: number;
|
|
214
|
+
limit?: number;
|
|
215
|
+
}
|
|
216
|
+
/** At most 62 days per calendar query (§12). */
|
|
217
|
+
export declare const CALENDAR_MAX_DAYS = 62;
|
|
218
|
+
export declare const CALENDAR_MAX_ITEMS = 200;
|
|
219
|
+
/**
|
|
220
|
+
* Calendar items (§4.5, §12): releases, gates and automation occurrences between `from` and `to`,
|
|
221
|
+
* a view built from state (nothing stored). Sorted by time, then id.
|
|
222
|
+
*/
|
|
223
|
+
export declare function calendarItems(deps: SchedulesDeps, graph: SiteGraphStore, siteId: string, query: CalendarQuery): Promise<{
|
|
224
|
+
items: CalendarItem[];
|
|
225
|
+
nextCursor?: string;
|
|
226
|
+
}>;
|
|
227
|
+
/** Anomaly counters kept on the run's `counts` (§11.4 item 6). */
|
|
228
|
+
export declare const RUN_COUNTS: {
|
|
229
|
+
readonly reduce: "reduce-calls";
|
|
230
|
+
readonly refusals: "refusals";
|
|
231
|
+
};
|
|
232
|
+
/** An automation key's open run, as one call sees it. */
|
|
233
|
+
export interface RunContext {
|
|
234
|
+
run: ScheduleRun;
|
|
235
|
+
automation: Automation & {
|
|
236
|
+
job: Extract<AutomationJob, {
|
|
237
|
+
kind: "agent-task";
|
|
238
|
+
}>;
|
|
239
|
+
};
|
|
240
|
+
state: RunTaintState;
|
|
241
|
+
}
|
|
242
|
+
export declare function taintStateOf(run: ScheduleRun): RunTaintState;
|
|
243
|
+
/**
|
|
244
|
+
* The principal an automation key works as inside its run (§11.2, §11.4): the mode is the key's,
|
|
245
|
+
* capped by the automation's `modeCap` (never `bypass`); an automation that reads untrusted text
|
|
246
|
+
* loses its write scopes on every call.
|
|
247
|
+
*/
|
|
248
|
+
export declare function runPrincipal(principal: Principal, automation: RunContext["automation"]): Principal;
|
|
249
|
+
export type RunResolution = {
|
|
250
|
+
kind: "none";
|
|
251
|
+
} | {
|
|
252
|
+
kind: "run";
|
|
253
|
+
run: RunContext;
|
|
254
|
+
principal: Principal;
|
|
255
|
+
} | {
|
|
256
|
+
kind: "outside";
|
|
257
|
+
message: string;
|
|
258
|
+
automation?: Automation;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Resolves an automation key's call (§11.2): its automation (active, its own key, schedules and
|
|
262
|
+
* automations on) and its open run. `none` for other principals.
|
|
263
|
+
*/
|
|
264
|
+
export declare function resolveRun(deps: SchedulesDeps | undefined, principal: Principal, now: Date): Promise<RunResolution>;
|
|
265
|
+
/** Who is who now, for the re-check at run time. */
|
|
266
|
+
export interface ReleaseRightsSource {
|
|
267
|
+
/** A staff person's current role by actor id (`user_…`); undefined when they left. */
|
|
268
|
+
role(personId: string): Promise<Role | undefined>;
|
|
269
|
+
/** An agent key's state now; undefined when it was revoked or its creator left. */
|
|
270
|
+
key?(keyId: string): Promise<{
|
|
271
|
+
mode: AgentMode;
|
|
272
|
+
creatorRole: Role;
|
|
273
|
+
} | undefined>;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* `checkApproval` for `runDue` / `createScheduler` (§10.6), after `baseApprovalVerdict`:
|
|
277
|
+
* - a person's approval holds while the approver is still a member who could approve it now
|
|
278
|
+
* (`releases:publish`, or `:own` with own-only items), else `approval_lost`;
|
|
279
|
+
* - an `auto` approval holds while the key exists, its creator is a member and its effective mode
|
|
280
|
+
* (for an automation's key: capped by the automation's current `modeCap`) is still `auto`
|
|
281
|
+
* (`creator_removed`, `auto_window_ended`); a gate-only reduction
|
|
282
|
+
* (`cloudhal.reduce`) skips the mode rule — any mode that may edit may hide;
|
|
283
|
+
* - without a rights source (no membership: local, tests) every approval holds.
|
|
284
|
+
*/
|
|
285
|
+
export declare function createReleaseApprovalCheck(input: {
|
|
286
|
+
graph: SiteGraphStore;
|
|
287
|
+
store: SqlScheduleStore;
|
|
288
|
+
ownership: OwnershipResolver;
|
|
289
|
+
rights?: ReleaseRightsSource | undefined;
|
|
290
|
+
}): (release: Release, now: Date) => Promise<ApprovalVerdict>;
|
|
291
|
+
/** Releases whose state a person may still change (not running, not finished). */
|
|
292
|
+
export declare function editable(r: Release): boolean;
|