blogwright 0.4.0 → 0.6.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.
Files changed (56) hide show
  1. package/README.md +4 -1
  2. package/agent/agent-manifest.json +1 -1
  3. package/agent/server.js +2610 -616
  4. package/dist/adapters/node-dns.d.ts +20 -0
  5. package/dist/adapters/node-dns.js +49 -0
  6. package/dist/adapters/process-aws-login.d.ts +19 -0
  7. package/dist/adapters/process-aws-login.js +28 -0
  8. package/dist/agent-package.js +2 -3
  9. package/dist/artifacts.d.ts +73 -0
  10. package/dist/artifacts.js +218 -0
  11. package/dist/aws-session.d.ts +118 -0
  12. package/dist/aws-session.js +360 -0
  13. package/dist/bin.js +6 -2
  14. package/dist/cache-control.d.ts +66 -0
  15. package/dist/cache-control.js +176 -0
  16. package/dist/cli.d.ts +22 -3
  17. package/dist/cli.js +128 -31
  18. package/dist/commands.d.ts +41 -9
  19. package/dist/commands.js +135 -126
  20. package/dist/context.d.ts +42 -5
  21. package/dist/context.js +81 -19
  22. package/dist/deploy.d.ts +78 -6
  23. package/dist/deploy.js +136 -52
  24. package/dist/domains.d.ts +46 -0
  25. package/dist/domains.js +125 -0
  26. package/dist/init.d.ts +14 -2
  27. package/dist/init.js +145 -4
  28. package/dist/known-commands.d.ts +11 -9
  29. package/dist/known-commands.js +15 -9
  30. package/dist/live-release.d.ts +78 -0
  31. package/dist/live-release.js +159 -0
  32. package/dist/lock.d.ts +50 -0
  33. package/dist/lock.js +120 -0
  34. package/dist/nodes.d.ts +18 -0
  35. package/dist/nodes.js +721 -76
  36. package/dist/plugin-commands.d.ts +21 -0
  37. package/dist/plugin-commands.js +54 -3
  38. package/dist/plugins.d.ts +11 -9
  39. package/dist/plugins.js +29 -16
  40. package/dist/ports.d.ts +37 -1
  41. package/dist/releases.d.ts +54 -0
  42. package/dist/releases.js +527 -0
  43. package/dist/render.d.ts +18 -1
  44. package/dist/render.js +38 -6
  45. package/dist/repo.js +2 -3
  46. package/dist/rkey.d.ts +4 -3
  47. package/dist/rkey.js +4 -3
  48. package/dist/router-function.d.ts +24 -0
  49. package/dist/router-function.js +71 -0
  50. package/dist/serving.d.ts +28 -0
  51. package/dist/serving.js +47 -0
  52. package/dist/verify.d.ts +45 -0
  53. package/dist/verify.js +183 -0
  54. package/dist/whoami.d.ts +23 -0
  55. package/dist/whoami.js +88 -0
  56. package/package.json +8 -8
@@ -138,6 +138,8 @@ export interface PluginValues {
138
138
  hash?: string | undefined;
139
139
  id?: string | undefined;
140
140
  identifier?: string | undefined;
141
+ /** Session-level like `plain`: it shapes the context's credentials and is never forwarded. */
142
+ profile?: string | undefined;
141
143
  plain: boolean;
142
144
  refresh: boolean;
143
145
  yes: boolean;
@@ -258,6 +260,25 @@ export declare function genericLifecycleActions(plugin: Plugin<unknown>): {
258
260
  * return the SPI has nowhere to carry.
259
261
  */
260
262
  export declare function runPlugin(command: string, rest: string[], values: PluginValues, terminal: Terminal, logger: Logger, makeContext: (opts: ContextOptions) => Promise<OpsContext>, ports: Pick<Ports, 'fs' | 'loader'>): Promise<number>;
263
+ /**
264
+ * Run every installed plugin's `afterDeploy` hook (`blogwright-core`'s
265
+ * `plugin.ts`) once `deploy` has published the site - the one point at which
266
+ * a built-in command runs discovery, and only after its own work is done, so
267
+ * a deploy that fails never loads a plugin.
268
+ *
269
+ * Nothing here is fatal, at any step: the site is already live, so a
270
+ * discovery precondition failing, a plugin failing to load, a plugin's config
271
+ * block being refused, and a hook rejecting are each reported as one warning
272
+ * and the deploy still exits 0 - the same contract the pds sync has always
273
+ * had (`syncAfterDeploy`, `packages/pds/src/commands.ts`). One plugin's
274
+ * failure never stops the next plugin's hook.
275
+ *
276
+ * Each hook gets the same context a dispatched command does: the plugin's own
277
+ * block resolved through {@link resolvePluginConfig} and the scoped
278
+ * {@link toPluginContext}, so a hook reads `pluginConfig` and its own state
279
+ * exactly as its commands do.
280
+ */
281
+ export declare function runAfterDeployHooks(ops: OpsContext, ports: Pick<Ports, 'fs' | 'loader'>): Promise<void>;
261
282
  /**
262
283
  * What `add` and `remove` need beyond the `fs`/`loader` pair `list` runs on.
263
284
  * A single object rather than four more positional parameters, and every
@@ -134,8 +134,9 @@ const DEFAULT_ENV = 'production';
134
134
  * Flags forwarded into a plugin action's `args`, in this fixed order so the
135
135
  * rendered array is deterministic regardless of property-iteration order.
136
136
  * `env` is excluded - it is consumed as the environment override, never
137
- * forwarded as a data flag; `plain` and `help` are session-level concerns of
138
- * `main` itself, never a plugin action's business.
137
+ * forwarded as a data flag; `plain`, `profile` and `help` are session-level
138
+ * concerns of `main` itself, never a plugin action's business - a plugin sees
139
+ * the profile's effect through `ctx.clients`.
139
140
  */
140
141
  const FORWARDED_FLAGS = [
141
142
  'domain',
@@ -575,6 +576,7 @@ export async function runPlugin(command, rest, values, terminal, logger, makeCon
575
576
  configPath: values.config,
576
577
  domain: values.domain,
577
578
  endpointOverride: values.endpoint,
579
+ profile: values.profile,
578
580
  ports: { terminal, fs: ports.fs, loader: ports.loader },
579
581
  });
580
582
  // Validated BEFORE `toPluginContext`, which loads the plugin's own scoped
@@ -586,6 +588,54 @@ export async function runPlugin(command, rest, values, terminal, logger, makeCon
586
588
  await match.command.run(await toPluginContext(ctx, plugin.name, pluginConfig), args);
587
589
  return 0;
588
590
  }
591
+ /**
592
+ * Run every installed plugin's `afterDeploy` hook (`blogwright-core`'s
593
+ * `plugin.ts`) once `deploy` has published the site - the one point at which
594
+ * a built-in command runs discovery, and only after its own work is done, so
595
+ * a deploy that fails never loads a plugin.
596
+ *
597
+ * Nothing here is fatal, at any step: the site is already live, so a
598
+ * discovery precondition failing, a plugin failing to load, a plugin's config
599
+ * block being refused, and a hook rejecting are each reported as one warning
600
+ * and the deploy still exits 0 - the same contract the pds sync has always
601
+ * had (`syncAfterDeploy`, `packages/pds/src/commands.ts`). One plugin's
602
+ * failure never stops the next plugin's hook.
603
+ *
604
+ * Each hook gets the same context a dispatched command does: the plugin's own
605
+ * block resolved through {@link resolvePluginConfig} and the scoped
606
+ * {@link toPluginContext}, so a hook reads `pluginConfig` and its own state
607
+ * exactly as its commands do.
608
+ */
609
+ export async function runAfterDeployHooks(ops, ports) {
610
+ let plugins;
611
+ try {
612
+ const discovered = await discover(await findRepoRoot(ports.fs), cliPackageDir(), ports);
613
+ for (const failure of discovered.failures) {
614
+ ops.logger.warn(`${failure.packageName} could not be loaded, so no post-deploy step it adds ran ` +
615
+ `(deploy unaffected): ${failure.reason}`);
616
+ }
617
+ plugins = discovered.plugins;
618
+ }
619
+ catch (err) {
620
+ ops.logger.warn(`plugin discovery failed, so no plugin post-deploy step ran (deploy unaffected): ` +
621
+ err.message);
622
+ return;
623
+ }
624
+ for (const found of plugins) {
625
+ // Widened to `Plugin<unknown>` without a cast, exactly as `runPlugin` does.
626
+ const plugin = found;
627
+ if (typeof plugin.afterDeploy !== 'function')
628
+ continue;
629
+ try {
630
+ const pluginConfig = resolvePluginConfig(plugin, ops.configDocument);
631
+ await plugin.afterDeploy(await toPluginContext(ops, plugin.name, pluginConfig));
632
+ }
633
+ catch (err) {
634
+ ops.logger.warn(`plugin "${plugin.name}" post-deploy step failed (deploy unaffected): ` +
635
+ err.message);
636
+ }
637
+ }
638
+ }
589
639
  /*
590
640
  * TASK 17 - the built-in `plugin` namespace.
591
641
  *
@@ -594,7 +644,7 @@ export async function runPlugin(command, rest, values, terminal, logger, makeCon
594
644
  * can ever claim the name, and `cli.ts` dispatches it directly. It is
595
645
  * dispatched BEFORE `createContext` - beside the `init` branch, not from the
596
646
  * built-in `switch` - because `createContext` loads the environment's config
597
- * and calls `sts.getAccountId()`, neither of which holds on the repo this
647
+ * and calls `sts:GetCallerIdentity`, neither of which holds on the repo this
598
648
  * namespace exists to serve: `blogwright plugin list` on a checkout with no
599
649
  * `config/<env>.jsonc` and no AWS credentials would otherwise fail with `no
600
650
  * config found for environment "production"` instead of printing the
@@ -863,6 +913,7 @@ async function destroyBeforeRemoval(plugin, nodesOf, env, ports, terminal, deps)
863
913
  configPath: deps.values.config,
864
914
  domain: deps.values.domain,
865
915
  endpointOverride: deps.values.endpoint,
916
+ profile: deps.values.profile,
866
917
  ports: { terminal, fs: ports.fs, loader: ports.loader },
867
918
  });
868
919
  const pluginConfig = resolvePluginConfig(plugin, ops.configDocument);
package/dist/plugins.d.ts CHANGED
@@ -4,10 +4,12 @@
4
4
  * default export against core's `Plugin` contract.
5
5
  *
6
6
  * The candidate set is the UNION of two sources, each resolved from its own
7
- * directory - see `collectCandidates` below - because a consuming repo
8
- * depends on `blogwright`, not on `blogwright-pds`: scanning the consumer's
9
- * own `package.json` alone would never find a plugin bundled inside the CLI
10
- * itself.
7
+ * directory - see `collectCandidates` below - because a plugin listed in the
8
+ * CLI's own `dependencies` reaches a consuming repo that depends on
9
+ * `blogwright` alone, and scanning the consumer's `package.json` would never
10
+ * find it. The CLI bundles no plugin today - pds and analytics are both
11
+ * installed by the sites that use them (`blogwright plugin add`) - but the
12
+ * bundled half stays, and reads only `dependencies`, never `devDependencies`.
11
13
  *
12
14
  * Collect, never throw, for anything candidate-specific: a broken plugin -
13
15
  * one that fails to resolve, whose manifest is malformed, or whose default
@@ -37,17 +39,17 @@
37
39
  * now BREAK the namespace rather than merely shadow it. Task 29 deleted
38
40
  * `cli.ts`'s hardcoded `command === 'pds'` branch: there is no built-in
39
41
  * `pds` command left for a reservation to protect, and `blogwright pds
40
- * <action>` is answered by the bundled `blogwright-pds` package, which
41
- * declares the plugin name `pds` and is discovered here like any other
42
+ * <action>` is answered by the `blogwright-pds` package a site installs,
43
+ * which declares the plugin name `pds` and is discovered here like any other
42
44
  * plugin. Reserving the name would therefore aim
43
- * `resolveNamespaceCollisions` below at that bundled plugin itself: it would
45
+ * `resolveNamespaceCollisions` below at that plugin itself: it would
44
46
  * become a `failures` entry rather than an installed one, and the namespace
45
47
  * would stop working outright - `blogwright pds sync` exiting 1 with `no
46
48
  * built-in command or installed plugin claims "pds"`, `blogwright --help`
47
49
  * listing none of its six actions, and `blogwright plugin list` reporting it
48
50
  * as reserved for a built-in command that no longer exists. Verified by
49
- * adding `'pds'` to the set: discovery rejects the real bundled package and
50
- * this file's real-disk integration cases fail on exactly that reason
51
+ * adding `'pds'` to the set: discovery rejects the real installed package
52
+ * and this file's real-disk integration cases fail on exactly that reason
51
53
  * string. So the name stays unreserved on purpose, pinned by a test below.
52
54
  *
53
55
  * DECISION (task 13, record here for task 16 to find): a plugin's declared
package/dist/plugins.js CHANGED
@@ -4,10 +4,12 @@
4
4
  * default export against core's `Plugin` contract.
5
5
  *
6
6
  * The candidate set is the UNION of two sources, each resolved from its own
7
- * directory - see `collectCandidates` below - because a consuming repo
8
- * depends on `blogwright`, not on `blogwright-pds`: scanning the consumer's
9
- * own `package.json` alone would never find a plugin bundled inside the CLI
10
- * itself.
7
+ * directory - see `collectCandidates` below - because a plugin listed in the
8
+ * CLI's own `dependencies` reaches a consuming repo that depends on
9
+ * `blogwright` alone, and scanning the consumer's `package.json` would never
10
+ * find it. The CLI bundles no plugin today - pds and analytics are both
11
+ * installed by the sites that use them (`blogwright plugin add`) - but the
12
+ * bundled half stays, and reads only `dependencies`, never `devDependencies`.
11
13
  *
12
14
  * Collect, never throw, for anything candidate-specific: a broken plugin -
13
15
  * one that fails to resolve, whose manifest is malformed, or whose default
@@ -37,17 +39,17 @@
37
39
  * now BREAK the namespace rather than merely shadow it. Task 29 deleted
38
40
  * `cli.ts`'s hardcoded `command === 'pds'` branch: there is no built-in
39
41
  * `pds` command left for a reservation to protect, and `blogwright pds
40
- * <action>` is answered by the bundled `blogwright-pds` package, which
41
- * declares the plugin name `pds` and is discovered here like any other
42
+ * <action>` is answered by the `blogwright-pds` package a site installs,
43
+ * which declares the plugin name `pds` and is discovered here like any other
42
44
  * plugin. Reserving the name would therefore aim
43
- * `resolveNamespaceCollisions` below at that bundled plugin itself: it would
45
+ * `resolveNamespaceCollisions` below at that plugin itself: it would
44
46
  * become a `failures` entry rather than an installed one, and the namespace
45
47
  * would stop working outright - `blogwright pds sync` exiting 1 with `no
46
48
  * built-in command or installed plugin claims "pds"`, `blogwright --help`
47
49
  * listing none of its six actions, and `blogwright plugin list` reporting it
48
50
  * as reserved for a built-in command that no longer exists. Verified by
49
- * adding `'pds'` to the set: discovery rejects the real bundled package and
50
- * this file's real-disk integration cases fail on exactly that reason
51
+ * adding `'pds'` to the set: discovery rejects the real installed package
52
+ * and this file's real-disk integration cases fail on exactly that reason
51
53
  * string. So the name stays unreserved on purpose, pinned by a test below.
52
54
  *
53
55
  * DECISION (task 13, record here for task 16 to find): a plugin's declared
@@ -142,10 +144,10 @@ async function readDependencyManifest(fs, packageJsonPath, role) {
142
144
  }
143
145
  return parsed;
144
146
  }
145
- /** Every `dependencies`/`devDependencies` name starting with `blogwright-`, deduplicated and sorted. */
146
- function pluginDependencyNames(pkg) {
147
+ /** Every name starting with `blogwright-` in the given dependency maps, deduplicated and sorted. */
148
+ function pluginDependencyNames(pkg, fields = ['dependencies', 'devDependencies']) {
147
149
  const names = new Set();
148
- for (const deps of [pkg.dependencies, pkg.devDependencies]) {
150
+ for (const deps of fields.map((field) => pkg[field])) {
149
151
  if (!deps)
150
152
  continue;
151
153
  for (const name of Object.keys(deps)) {
@@ -158,7 +160,7 @@ function pluginDependencyNames(pkg) {
158
160
  /**
159
161
  * Build the candidate set: the consumer's own `blogwright-*` dependencies
160
162
  * (resolved from `repoRoot`) union the CLI's own bundled `blogwright-*`
161
- * dependencies (resolved from `cliPackageDir`). Both halves are required and
163
+ * `dependencies` (resolved from `cliPackageDir`). Both halves are required and
162
164
  * each is resolved from its own directory - see the module comment. Neither
163
165
  * `blogwright` nor `blogwright/package.json` is ever a candidate: the bare
164
166
  * name never matches the `blogwright-` prefix, so it is filtered out before
@@ -166,7 +168,7 @@ function pluginDependencyNames(pkg) {
166
168
  *
167
169
  * A package name present in BOTH manifests - e.g. a plugin `blogwright
168
170
  * plugin add` (task 18) pinned directly into the consuming repo, which
169
- * already sits in the CLI's own bundled dependencies too - is one installed
171
+ * also sits in the CLI's own bundled dependencies - is one installed
170
172
  * package, not two: it is deduped here, consumer half winning, so it is
171
173
  * probed exactly once. Without this, the same package would reach
172
174
  * `resolveNamespaceCollisions` as two `InstalledPlugin` entries sharing one
@@ -176,7 +178,10 @@ async function collectCandidates(ports, repoRoot, cliPackageDir) {
176
178
  const consumerPkg = await readDependencyManifest(ports.fs, join(repoRoot, 'package.json'), 'the consuming repo');
177
179
  const cliPkg = await readDependencyManifest(ports.fs, join(cliPackageDir, 'package.json'), "the CLI's own package");
178
180
  const consumerNames = pluginDependencyNames(consumerPkg);
179
- const consumerCandidates = consumerNames.map((packageName) => ({ packageName, fromDir: repoRoot }));
181
+ const consumerCandidates = consumerNames.map((packageName) => ({
182
+ packageName,
183
+ fromDir: repoRoot,
184
+ }));
180
185
  // The bundled half is NOT filtered against the consumer's names here. A name
181
186
  // in both manifests must still be probed from both directories, because a
182
187
  // consumer can DECLARE a plugin it cannot resolve - a pruned devDependency,
@@ -186,7 +191,15 @@ async function collectCandidates(ports, repoRoot, cliPackageDir) {
186
191
  // two-source union exists to prevent. `discover` instead skips the bundled
187
192
  // probe only once the consumer's has actually resolved, so the consumer still
188
193
  // wins wherever both work.
189
- const bundledCandidates = pluginDependencyNames(cliPkg).map((packageName) => ({ packageName, fromDir: cliPackageDir }));
194
+ //
195
+ // Only the CLI's `dependencies` are bundled: its `devDependencies` are never
196
+ // installed with a published CLI, and reading them would let this workspace
197
+ // discover a plugin (blogwright-pds, a CLI devDependency for its integration
198
+ // tests) that no consuming site gets without installing it.
199
+ const bundledCandidates = pluginDependencyNames(cliPkg, ['dependencies']).map((packageName) => ({
200
+ packageName,
201
+ fromDir: cliPackageDir,
202
+ }));
190
203
  return [...consumerCandidates, ...bundledCandidates];
191
204
  }
192
205
  /** Validate a raw `blogwright` field into a `PluginManifest`, or `undefined` when it does not hold. */
package/dist/ports.d.ts CHANGED
@@ -31,7 +31,7 @@ export interface AddPackageOptions {
31
31
  *
32
32
  * Deliberately NOT a member of {@link Ports}. Its only two callers -
33
33
  * `blogwright plugin add` and `plugin remove` - dispatch BEFORE any
34
- * `OpsContext` exists, and must: `createContext` calls `sts.getAccountId()`,
34
+ * `OpsContext` exists, and must: `createContext` calls `sts:GetCallerIdentity`,
35
35
  * while installing a plugin is what an operator does on a repo that has no
36
36
  * config and no credentials yet. A member of `Ports` is therefore unreachable
37
37
  * from the only code that wants this port, and every `deploy`, `status` and
@@ -103,11 +103,47 @@ export interface ModuleLoader {
103
103
  /** Import the module at `path`. The caller validates the result's shape at the boundary. */
104
104
  load(path: string): Promise<unknown>;
105
105
  }
106
+ /** How an `aws` sign-in command ended. */
107
+ export type AwsLoginResult = {
108
+ ok: true;
109
+ } | {
110
+ ok: false;
111
+ reason: 'not-installed';
112
+ } | {
113
+ ok: false;
114
+ reason: 'exit';
115
+ code: number;
116
+ };
117
+ /**
118
+ * Runs an AWS CLI sign-in (`aws sso login`, `aws login`) with the operator's
119
+ * terminal attached, so its browser or device-code prompts reach them.
120
+ * Blogwright never stores credentials itself; the AWS CLI writes its own cache.
121
+ */
122
+ export interface AwsLogin {
123
+ /** Run `aws` with `args` (without the leading `aws`) and report how it exited. */
124
+ run(args: readonly string[]): Promise<AwsLoginResult>;
125
+ }
106
126
  /** The ports domain code reaches side effects through; adapters are wired in createContext. */
127
+ /**
128
+ * DNS questions the multi-domain bootstrap asks. The real adapter queries the
129
+ * system resolver and falls back to public ones; it throws only when no
130
+ * resolver could answer at all.
131
+ */
132
+ export interface DnsPort {
133
+ /**
134
+ * An opaque fingerprint of the SOA record `name` answers with, or
135
+ * `undefined` when it has none. A resolver follows a CNAME when asked for
136
+ * SOA, so `www` aliased to an apex answers with the apex's record; callers
137
+ * compare fingerprints rather than treating any answer as "this is a zone".
138
+ */
139
+ soa(name: string): Promise<string | undefined>;
140
+ }
107
141
  export interface Ports {
108
142
  fs: FileSystem;
109
143
  vcs: Vcs;
110
144
  terminal: Terminal;
111
145
  ping: PingBuilder;
112
146
  loader: ModuleLoader;
147
+ awsLogin: AwsLogin;
148
+ dns: DnsPort;
113
149
  }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Release gating for static sites: `stage` builds once and publishes the
3
+ * output to `releases/<hash>/`, which nothing serves, and records its artifact
4
+ * manifest; `promote` copies those exact bytes into the live `site/` without
5
+ * rebuilding, invalidates what changed, and verifies the result against the
6
+ * manifest. The staged copy stays, so a later promotion of the same hash
7
+ * restores the same bytes - and `rollback <hash>` to a staged hash republishes
8
+ * it through the same checked copy instead of rebuilding.
9
+ */
10
+ import type { OpsContext } from './context.js';
11
+ import { type AfterDeploy } from './deploy.js';
12
+ import { type LockOptions } from './lock.js';
13
+ export interface StageOptions extends LockOptions {
14
+ /**
15
+ * Re-upload every file into the staged prefix, even content the previous
16
+ * stage of this hash already wrote, so metadata fixes reach the staged copy.
17
+ */
18
+ refresh?: boolean | undefined;
19
+ }
20
+ /** Build the working copy and publish it to `releases/<hash>/` for a later `promote`. */
21
+ export declare function stage(ctx: OpsContext, opts?: StageOptions): Promise<void>;
22
+ /**
23
+ * Run the post-deploy plugin steps after a `promote` or a `rollback` only when
24
+ * the working copy is the revision now live: they publish the working copy's
25
+ * content (the standard.site sync, for one), which matches the live site then
26
+ * and would not match a release built from another revision. Otherwise warn
27
+ * and skip them - whichever plugins are installed.
28
+ */
29
+ export declare function runAfterPublish(ctx: OpsContext, hash: string, afterDeploy: AfterDeploy): Promise<void>;
30
+ export interface PromoteOptions extends LockOptions {
31
+ /** Copy every file, not only those whose content differs from the live object. */
32
+ refresh?: boolean | undefined;
33
+ /** The post-deploy plugin steps; see {@link runAfterPublish}. */
34
+ afterDeploy: AfterDeploy;
35
+ }
36
+ /**
37
+ * Point production at a staged release without rebuilding: check the staged
38
+ * objects still match the recorded manifest, copy them into `site/`,
39
+ * invalidate the changed paths, and verify the live objects match too.
40
+ */
41
+ export declare function promote(ctx: OpsContext, hash: string, opts: PromoteOptions): Promise<void>;
42
+ /**
43
+ * `rollback <hash>`'s first choice in a static environment, run holding the
44
+ * environment lock: a hash with a staged release record is republished from
45
+ * its stored bytes, through the same checked copy `promote` makes, and the
46
+ * release that was live is printed beside the one restored. A record that
47
+ * cannot be read, or a staged copy that no longer matches it, refuses with
48
+ * nothing published - a quiet rebuild would publish bytes no review covered.
49
+ * Resolves `not-staged` when the hash has no staged release, for the caller
50
+ * to rebuild.
51
+ */
52
+ export declare function rollbackToStagedRelease(ctx: OpsContext, hash: string, opts?: {
53
+ refresh?: boolean | undefined;
54
+ }): Promise<'republished' | 'not-staged'>;