@stigmer/cli 3.18.0-dev.20260918103812 → 3.18.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/commands/bootstrap.d.ts +3 -0
- package/commands/bootstrap.d.ts.map +1 -0
- package/commands/bootstrap.js +75 -0
- package/commands/bootstrap.js.map +1 -0
- package/commands/marketplace.d.ts.map +1 -1
- package/commands/marketplace.js +7 -7
- package/commands/marketplace.js.map +1 -1
- package/config/resolve.d.ts.map +1 -1
- package/config/resolve.js +8 -7
- package/config/resolve.js.map +1 -1
- package/local/bootstrap.d.ts +32 -13
- package/local/bootstrap.d.ts.map +1 -1
- package/local/bootstrap.js +105 -64
- package/local/bootstrap.js.map +1 -1
- package/local/daemon/launch.d.ts +1 -1
- package/local/daemon/launch.d.ts.map +1 -1
- package/local/paths.d.ts +1 -1
- package/local/paths.js +1 -1
- package/local/plugins/defaults.d.ts +27 -7
- package/local/plugins/defaults.d.ts.map +1 -1
- package/local/plugins/defaults.js +55 -28
- package/local/plugins/defaults.js.map +1 -1
- package/local/runtime/runtimes-install.d.ts.map +1 -1
- package/local/runtime/runtimes-install.js +7 -4
- package/local/runtime/runtimes-install.js.map +1 -1
- package/local/seedpack-retire.d.ts +63 -0
- package/local/seedpack-retire.d.ts.map +1 -0
- package/local/seedpack-retire.js +361 -0
- package/local/seedpack-retire.js.map +1 -0
- package/local/system-org.d.ts +15 -0
- package/local/system-org.d.ts.map +1 -0
- package/local/system-org.js +57 -0
- package/local/system-org.js.map +1 -0
- package/marketplace/config.d.ts +3 -1
- package/marketplace/config.d.ts.map +1 -1
- package/marketplace/config.js +24 -11
- package/marketplace/config.js.map +1 -1
- package/marketplace/github.d.ts +37 -0
- package/marketplace/github.d.ts.map +1 -1
- package/marketplace/github.js +70 -1
- package/marketplace/github.js.map +1 -1
- package/marketplace/install.d.ts +13 -6
- package/marketplace/install.d.ts.map +1 -1
- package/marketplace/install.js +63 -16
- package/marketplace/install.js.map +1 -1
- package/marketplace/official.js +4 -4
- package/marketplace/official.js.map +1 -1
- package/marketplace/render.d.ts.map +1 -1
- package/marketplace/render.js +10 -4
- package/marketplace/render.js.map +1 -1
- package/package.json +7 -7
- package/program.js +2 -2
- package/program.js.map +1 -1
- package/resources/apply/declarative.js +2 -2
- package/resources/apply/declarative.js.map +1 -1
- package/resources/plugin.d.ts.map +1 -1
- package/resources/plugin.js +12 -9
- package/resources/plugin.js.map +1 -1
- package/src/commands/bootstrap.test.ts +253 -0
- package/src/commands/bootstrap.ts +91 -0
- package/src/commands/install.test.ts +28 -9
- package/src/commands/marketplace.test.ts +28 -14
- package/src/commands/marketplace.ts +9 -7
- package/src/config/resolve.test.ts +2 -2
- package/src/config/resolve.ts +8 -7
- package/src/local/bootstrap.test.ts +110 -38
- package/src/local/bootstrap.ts +179 -89
- package/src/local/daemon/launch.ts +1 -1
- package/src/local/paths.ts +1 -1
- package/src/local/plugins/defaults.test.ts +46 -13
- package/src/local/plugins/defaults.ts +77 -34
- package/src/local/runtime/runtimes-install.test.ts +2 -0
- package/src/local/runtime/runtimes-install.ts +7 -4
- package/src/local/seedpack-retire.test.ts +499 -0
- package/src/local/seedpack-retire.ts +474 -0
- package/src/local/system-org.test.ts +124 -0
- package/src/local/system-org.ts +63 -0
- package/src/marketplace/__fixtures__/cursor-marketplace.ts +5 -2
- package/src/marketplace/config.test.ts +47 -22
- package/src/marketplace/config.ts +27 -12
- package/src/marketplace/github.test.ts +77 -1
- package/src/marketplace/github.ts +115 -1
- package/src/marketplace/install.test.ts +84 -17
- package/src/marketplace/install.ts +73 -15
- package/src/marketplace/official.ts +4 -4
- package/src/marketplace/read.test.ts +1 -1
- package/src/marketplace/render.ts +13 -4
- package/src/program.ts +2 -2
- package/src/resources/apply/declarative.integration.test.ts +2 -2
- package/src/resources/apply/declarative.ts +2 -2
- package/src/resources/connect/discover.test.ts +1 -1
- package/src/resources/plugin.ts +11 -10
- package/commands/seedpack.d.ts +0 -3
- package/commands/seedpack.d.ts.map +0 -1
- package/commands/seedpack.js +0 -98
- package/commands/seedpack.js.map +0 -1
- package/local/seedpack/apply.d.ts +0 -72
- package/local/seedpack/apply.d.ts.map +0 -1
- package/local/seedpack/apply.js +0 -145
- package/local/seedpack/apply.js.map +0 -1
- package/local/seedpack/content.d.ts +0 -61
- package/local/seedpack/content.d.ts.map +0 -1
- package/local/seedpack/content.js +0 -178
- package/local/seedpack/content.js.map +0 -1
- package/src/commands/seedpack.ts +0 -116
- package/src/local/seedpack/apply.test.ts +0 -287
- package/src/local/seedpack/apply.ts +0 -199
- package/src/local/seedpack/content.test.ts +0 -169
- package/src/local/seedpack/content.ts +0 -222
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/commands/bootstrap.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAQxD"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// `stigmer bootstrap` — make the configured backend a ready Stigmer: the
|
|
2
|
+
// system organization exists and the official marketplace's default plugins
|
|
3
|
+
// are installed into it, public. `stigmer up` does this for the local stack
|
|
4
|
+
// on its own; this verb is for every other shape (a raw self-hosted server
|
|
5
|
+
// behind docker-compose or Helm, the hosted platform's scheduled lane), and
|
|
6
|
+
// runs the very same two phases (local/bootstrap.ts), so "ready" has one
|
|
7
|
+
// meaning everywhere.
|
|
8
|
+
//
|
|
9
|
+
// Flagless on purpose. The org is the system org in every edition, and the
|
|
10
|
+
// defaults are idempotent by the server's digest, so there is nothing to
|
|
11
|
+
// force: a second run over a converged backend changes nothing and says so.
|
|
12
|
+
// The verb never deletes anything; a scheduled lane must be able to run it
|
|
13
|
+
// without that power.
|
|
14
|
+
//
|
|
15
|
+
// Exit is non-zero when any default failed to land, after the outcomes are
|
|
16
|
+
// rendered, so a lane's run is red for the right reason and a human reads
|
|
17
|
+
// what did and did not install. Heavy modules load lazily inside the action
|
|
18
|
+
// so `--help` stays fast.
|
|
19
|
+
import { ensureAuthenticated } from "../config/index.js";
|
|
20
|
+
import { CliExitError } from "../errors/cli-exit-error.js";
|
|
21
|
+
import { ExitCode } from "../errors/exit-codes.js";
|
|
22
|
+
import { CommandResult, renderResult } from "../output/index.js";
|
|
23
|
+
import { addResultFlags, resultFormat } from "./shared.js";
|
|
24
|
+
export function registerBootstrap(program) {
|
|
25
|
+
const bootstrap = program
|
|
26
|
+
.command("bootstrap")
|
|
27
|
+
.description("make the configured backend ready: ensure the system organization and install the default plugins")
|
|
28
|
+
.action((options) => runBootstrapCommand(options));
|
|
29
|
+
addResultFlags(bootstrap);
|
|
30
|
+
}
|
|
31
|
+
async function runBootstrapCommand(flags) {
|
|
32
|
+
const [{ connectBackend }, { bootstrapBackend }, { SYSTEM_ORG }] = await Promise.all([
|
|
33
|
+
import("../backend.js"),
|
|
34
|
+
import("../local/bootstrap.js"),
|
|
35
|
+
import("../local/system-org.js"),
|
|
36
|
+
]);
|
|
37
|
+
const client = connectBackend();
|
|
38
|
+
ensureAuthenticated(client.config);
|
|
39
|
+
const say = (line) => {
|
|
40
|
+
process.stderr.write(`${line}\n`);
|
|
41
|
+
};
|
|
42
|
+
const result = await bootstrapBackend(client.stigmer, say);
|
|
43
|
+
const failed = result.plugins.failed;
|
|
44
|
+
const out = failed.length === 0
|
|
45
|
+
? CommandResult.success("Backend is ready")
|
|
46
|
+
: CommandResult.warning(`Backend bootstrapped with ${failed.length} default plugin${failed.length === 1 ? "" : "s"} not installed`);
|
|
47
|
+
out
|
|
48
|
+
.addSection("System organization")
|
|
49
|
+
.field("Slug", SYSTEM_ORG)
|
|
50
|
+
.field("State", result.org);
|
|
51
|
+
const plugins = out.addSection("Default plugins");
|
|
52
|
+
for (const outcome of result.plugins.outcomes) {
|
|
53
|
+
switch (outcome.action) {
|
|
54
|
+
case "installed":
|
|
55
|
+
case "up-to-date":
|
|
56
|
+
plugins.field(outcome.name, outcome.action);
|
|
57
|
+
break;
|
|
58
|
+
case "failed":
|
|
59
|
+
plugins.field(outcome.name, `failed: ${outcome.error}`);
|
|
60
|
+
break;
|
|
61
|
+
default: {
|
|
62
|
+
const exhaustive = outcome;
|
|
63
|
+
throw new Error(`unhandled outcome ${String(exhaustive)}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (failed.length > 0) {
|
|
68
|
+
out.hint("Fix the cause named above and run 'stigmer bootstrap' again.");
|
|
69
|
+
}
|
|
70
|
+
renderResult(out, resultFormat(flags));
|
|
71
|
+
if (failed.length > 0) {
|
|
72
|
+
throw new CliExitError(`default plugin${failed.length === 1 ? "" : "s"} not installed: ${failed.join(", ")}`, ExitCode.General);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/commands/bootstrap.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,4EAA4E;AAC5E,yEAAyE;AACzE,sBAAsB;AACtB,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,4EAA4E;AAC5E,2EAA2E;AAC3E,sBAAsB;AACtB,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,4EAA4E;AAC5E,0BAA0B;AAG1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAoB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3D,MA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@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace.d.ts","sourceRoot":"","sources":["../../src/commands/marketplace.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"marketplace.d.ts","sourceRoot":"","sources":["../../src/commands/marketplace.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoC1D"}
|
package/commands/marketplace.js
CHANGED
|
@@ -15,26 +15,26 @@ import { addResultFlags, resultFormat } from "./shared.js";
|
|
|
15
15
|
export function registerMarketplace(program) {
|
|
16
16
|
const marketplace = program
|
|
17
17
|
.command("marketplace")
|
|
18
|
-
.description("manage the
|
|
18
|
+
.description("manage the sources the Marketplace installs from: the built-in catalogues and the ones you add");
|
|
19
19
|
const add = marketplace
|
|
20
20
|
.command("add <source>")
|
|
21
|
-
.description("add a
|
|
21
|
+
.description("add a source: a directory, a GitHub 'owner/repo[@ref]', or that repository's URL")
|
|
22
22
|
.option("--name <name>", "the name to install from (defaults to the name the marketplace file gives itself)")
|
|
23
23
|
.action((source, options) => runAdd(source, options));
|
|
24
24
|
addResultFlags(add);
|
|
25
25
|
const list = marketplace
|
|
26
26
|
.command("list")
|
|
27
|
-
.description("list the
|
|
27
|
+
.description("list the known sources, built in and added (offline)")
|
|
28
28
|
.action((options) => runList(options));
|
|
29
29
|
addResultFlags(list);
|
|
30
30
|
const show = marketplace
|
|
31
31
|
.command("show <name>")
|
|
32
|
-
.description("show the plugins a
|
|
32
|
+
.description("show the plugins a source offers (reads it)")
|
|
33
33
|
.action((name, options) => runShow(name, options));
|
|
34
34
|
addResultFlags(show);
|
|
35
35
|
const remove = marketplace
|
|
36
36
|
.command("remove <name>")
|
|
37
|
-
.description("remove
|
|
37
|
+
.description("remove an added source (installed plugins stay; a built-in cannot be removed)")
|
|
38
38
|
.action((name, options) => runRemove(name, options));
|
|
39
39
|
addResultFlags(remove);
|
|
40
40
|
}
|
|
@@ -58,7 +58,7 @@ async function runAdd(source, flags) {
|
|
|
58
58
|
};
|
|
59
59
|
});
|
|
60
60
|
m.addMarketplace(name, parsed);
|
|
61
|
-
const result = CommandResult.success(`Added
|
|
61
|
+
const result = CommandResult.success(`Added source '${name}' (${m.describeSource(parsed)}), offering ${offered} plugin${offered === 1 ? "" : "s"}`);
|
|
62
62
|
result.hint(`See what it offers with: stigmer marketplace show ${name}`);
|
|
63
63
|
result.hint(`Install from it with: stigmer install ${name}/<plugin>`);
|
|
64
64
|
renderResult(result.withData({ name, source: parsed, plugins: offered }), format);
|
|
@@ -87,7 +87,7 @@ async function runRemove(name, flags) {
|
|
|
87
87
|
const m = await import("../marketplace/index.js");
|
|
88
88
|
const { CommandResult } = await import("../output/index.js");
|
|
89
89
|
m.removeMarketplace(name);
|
|
90
|
-
const result = CommandResult.success(`Removed
|
|
90
|
+
const result = CommandResult.success(`Removed source '${name}'`);
|
|
91
91
|
result.hint("Plugins installed from it stay installed; remove one with: stigmer delete plugin <name>");
|
|
92
92
|
renderResult(result, format);
|
|
93
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace.js","sourceRoot":"","sources":["../../src/commands/marketplace.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,uEAAuE;AACvE,4EAA4E;AAC5E,0EAA0E;AAC1E,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,2EAA2E;AAC3E,6EAA6E;AAC7E,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AAGtE,OAAO,EAAoB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM3D,MAAM,UAAU,mBAAm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sources":["../../src/config/resolve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,MAAM,EAA8B,MAAM,aAAa,CAAC;AAKtE,wDAAwD;AACxD,eAAO,MAAM,yBAAyB,2BAA2B,CAAC;AAUlE;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAuBtD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAUnD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAiB5E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EACd,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAWR;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAQjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CASxD"}
|
package/config/resolve.js
CHANGED
|
@@ -7,18 +7,19 @@
|
|
|
7
7
|
// the OAuth token set, selfhost entries carry an endpoint + api_key.
|
|
8
8
|
import { CliExitError, ExitCode } from "../errors/index.js";
|
|
9
9
|
import { SERVER_PORT } from "../local/constants.js";
|
|
10
|
+
import { SYSTEM_ORG } from "../local/system-org.js";
|
|
10
11
|
import { activeBackend, isCloudMode } from "./config.js";
|
|
11
12
|
const DEFAULT_CLOUD_ENDPOINT = "api.stigmer.ai:443";
|
|
12
13
|
const DEFAULT_LOCAL_ENDPOINT = "localhost:7234";
|
|
13
14
|
/** Well-known URL for the Stigmer Cloud web console. */
|
|
14
15
|
export const DEFAULT_CLOUD_CONSOLE_URL = "https://app.stigmer.ai";
|
|
15
|
-
// Local mode is single-tenant: the
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
const DEFAULT_LOCAL_ORG =
|
|
16
|
+
// Local mode is single-tenant: the bootstrap `stigmer up` runs creates the
|
|
17
|
+
// system org and installs the default plugins into it, so bare-slug
|
|
18
|
+
// `get`/`run`/`apply` in local mode fall back to that org when nothing else
|
|
19
|
+
// is configured. The same holds for selfhost backends — they ARE the OSS
|
|
20
|
+
// server. Cloud mode has no implicit org — the caller must select one
|
|
21
|
+
// (flag/env/context/login).
|
|
22
|
+
const DEFAULT_LOCAL_ORG = SYSTEM_ORG;
|
|
22
23
|
/**
|
|
23
24
|
* Resolve the server endpoint.
|
|
24
25
|
* STIGMER_SERVER_ADDRESS (explicit override, any backend)
|
package/config/resolve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,6EAA6E;AAC7E,+EAA+E;AAC/E,EAAE;AACF,wEAAwE;AACxE,4EAA4E;AAC5E,qEAAqE;AAErE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAe,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AACpD,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AAEhD,wDAAwD;AACxD,MAAM,CAAC,MAAM,yBAAyB,GAAG,wBAAwB,CAAC;AAElE,
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,6EAA6E;AAC7E,+EAA+E;AAC/E,EAAE;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,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe;QAAE,OAAO;IACxC,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,aAAa;QAAE,OAAO;IAC/C,MAAM,IAAI,YAAY,CAAC,mBAAmB,EAAE,QAAQ,CAAC,IAAI,EAAE;QACzD,iBAAiB;QACjB,sBAAsB;KACvB,CAAC,CAAC;AACL,CAAC"}
|
package/local/bootstrap.d.ts
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
1
2
|
import type { BackendClient } from "../client/index.js";
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
import type { ResolveOfficialOptions } from "../marketplace/official.js";
|
|
4
|
+
import type { DefaultPluginsResult, InstallingVerb, PreparedDefault } from "./plugins/defaults.js";
|
|
5
|
+
import { type EnsureSystemOrgOutcome } from "./system-org.js";
|
|
4
6
|
export type Say = (line: string) => void;
|
|
5
|
-
/**
|
|
7
|
+
/** Everything phase 2 needs, gathered without a backend. */
|
|
8
|
+
export interface PreparedBootstrap {
|
|
9
|
+
readonly defaults: readonly PreparedDefault[];
|
|
10
|
+
}
|
|
11
|
+
export interface BootstrapResult {
|
|
12
|
+
readonly org: EnsureSystemOrgOutcome;
|
|
13
|
+
readonly plugins: DefaultPluginsResult;
|
|
14
|
+
}
|
|
15
|
+
export interface PrepareBootstrapOptions {
|
|
16
|
+
/** How the official tree is found (injectable for tests). */
|
|
17
|
+
readonly official?: ResolveOfficialOptions;
|
|
18
|
+
}
|
|
19
|
+
/** Phase 1. Throws when the catalogue cannot be resolved or a default cannot be prepared. */
|
|
20
|
+
export declare function prepareBootstrap(options?: PrepareBootstrapOptions): Promise<PreparedBootstrap>;
|
|
21
|
+
/**
|
|
22
|
+
* Phase 2. Throws when the system org cannot be ensured; a default that
|
|
23
|
+
* fails to land is reported in the result, not thrown, so the caller can
|
|
24
|
+
* name each one. `verb` is the command running this, stamped into each
|
|
25
|
+
* installed plugin's version message.
|
|
26
|
+
*/
|
|
27
|
+
export declare function runBootstrap(stigmer: Stigmer, prepared: PreparedBootstrap, say: Say, verb: InstallingVerb): Promise<BootstrapResult>;
|
|
28
|
+
/** Both phases, against the backend `stigmer` is bound to: what `stigmer bootstrap` runs. */
|
|
29
|
+
export declare function bootstrapBackend(stigmer: Stigmer, say: Say, options?: PrepareBootstrapOptions): Promise<BootstrapResult>;
|
|
30
|
+
/** Seams of the local bootstrap, injectable for tests; the defaults are the real phases over the real local client. */
|
|
6
31
|
export interface BootstrapDeps {
|
|
7
32
|
readonly client?: BackendClient;
|
|
8
|
-
readonly seedpack?: BootstrapStep;
|
|
9
|
-
readonly plugins?: BootstrapStep;
|
|
10
33
|
readonly say?: Say;
|
|
34
|
+
readonly prepare?: () => Promise<PreparedBootstrap>;
|
|
35
|
+
readonly retire?: (stigmer: Stigmer, home: string, say: Say) => Promise<void>;
|
|
36
|
+
readonly run?: (stigmer: Stigmer, prepared: PreparedBootstrap, say: Say) => Promise<BootstrapResult>;
|
|
11
37
|
}
|
|
38
|
+
/** What `stigmer up` does once the local server answers. Never throws past its own warnings. */
|
|
12
39
|
export declare function bootstrapLocalBackend(home: string, deps?: BootstrapDeps): Promise<void>;
|
|
13
|
-
/** Step 1. Idempotent via a content-hash marker, so repeated `up`s are cheap. */
|
|
14
|
-
export declare function applySeedpackBestEffort(client: BackendClient, home: string, say: Say): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Step 2. Runs even when step 1 warned: the plugins can only fail on their
|
|
17
|
-
* own terms (an org that does not exist fails the push, and the warning
|
|
18
|
-
* names the command that retries it).
|
|
19
|
-
*/
|
|
20
|
-
export declare function installDefaultPluginsBestEffort(client: BackendClient, _home: string, say: Say): Promise<void>;
|
|
21
40
|
//# sourceMappingURL=bootstrap.d.ts.map
|
package/local/bootstrap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/local/bootstrap.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AC,CAO1B;AAED,uHAAuH;AACvH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpD,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,QAAQ,CAAC,GAAG,CAAC,EAAE,CACb,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,iBAAiB,EAC3B,GAAG,EAAE,GAAG,KACL,OAAO,CAAC,eAAe,CAAC,CAAC;CAC/B;AAMD,gGAAgG;AAChG,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,aAAkB,GACvB,OAAO,CAAC,IAAI,CAAC,CAqDf"}
|
package/local/bootstrap.js
CHANGED
|
@@ -1,34 +1,120 @@
|
|
|
1
|
-
// What
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
1
|
+
// What makes a backend a ready Stigmer: the system org exists and the
|
|
2
|
+
// official marketplace's default plugins are installed into it, public.
|
|
3
|
+
// `stigmer up` runs this against the local server it just started;
|
|
4
|
+
// `stigmer bootstrap` runs the same two phases against whatever backend the
|
|
5
|
+
// CLI is pointed at, for a raw self-hosted server or the platform's daily
|
|
6
|
+
// lane. One definition, so a laptop, a container and the hosted platform
|
|
7
|
+
// cannot drift in what "ready" means.
|
|
5
8
|
//
|
|
6
|
-
//
|
|
7
|
-
// system agents, skills and workflows), content-hash idempotent;
|
|
8
|
-
// 2. the default plugins the official marketplace names, installed into the
|
|
9
|
-
// same org as public, idempotent by the server's own digest.
|
|
9
|
+
// Two phases, and the order matters (a third, `up`'s retire, follows them):
|
|
10
10
|
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
11
|
+
// 1. prepare: resolve the official marketplace (acquiring `@stigmer/plugins`
|
|
12
|
+
// at the CLI's version on a release's first run) and prepare every
|
|
13
|
+
// default. No backend is touched.
|
|
14
|
+
// 2. run: ensure the system org, then push the prepared defaults, each
|
|
15
|
+
// skipped when the backend already holds it at the same digest.
|
|
14
16
|
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
17
|
+
// `stigmer up` adds a third phase after them: retiring the seedpack an
|
|
18
|
+
// older release installed. That step deletes rows, so it runs only once
|
|
19
|
+
// every default has LANDED, not merely been prepared: the plugin push adopts
|
|
20
|
+
// the system-content rows it replaces in place (the seedpack's `assistant`
|
|
21
|
+
// keeps its id, its instances and every conversation bound to them), and a
|
|
22
|
+
// row that is now a plugin's member is never a candidate for the retire. A
|
|
23
|
+
// user who upgrades offline and cannot fetch the new catalogue, or whose
|
|
24
|
+
// backend refused a default, keeps the old rows for another day instead of
|
|
25
|
+
// losing them and getting nothing back. The retire lives here and not in
|
|
26
|
+
// `stigmer bootstrap` on purpose: a verb a scheduled lane runs against the
|
|
27
|
+
// platform must never be able to delete rows.
|
|
28
|
+
//
|
|
29
|
+
// Inside `up` every phase is best-effort with its own warning naming the
|
|
30
|
+
// retry, because the stack is already serving by the time any of them runs
|
|
31
|
+
// and a seeding failure must never tear it down. Both `up` shapes (detached
|
|
32
|
+
// and foreground) call this one function, and both seed the local server
|
|
33
|
+
// `up` just started, never the active backend context: a CLI pointed at
|
|
34
|
+
// cloud still gets its local stack seeded, and never has system resources
|
|
35
|
+
// applied to its cloud org. The client is pinned to a fresh local config
|
|
21
36
|
// (localhost:SERVER_PORT) with no auth, the trusted-local identity.
|
|
22
37
|
import { log } from "../logger.js";
|
|
23
38
|
import { dataDir } from "./paths.js";
|
|
39
|
+
import { SYSTEM_ORG } from "./system-org.js";
|
|
40
|
+
/** Phase 1. Throws when the catalogue cannot be resolved or a default cannot be prepared. */
|
|
41
|
+
export async function prepareBootstrap(options = {}) {
|
|
42
|
+
const { prepareDefaultPlugins } = await import("./plugins/defaults.js");
|
|
43
|
+
return { defaults: await prepareDefaultPlugins(options.official) };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Phase 2. Throws when the system org cannot be ensured; a default that
|
|
47
|
+
* fails to land is reported in the result, not thrown, so the caller can
|
|
48
|
+
* name each one. `verb` is the command running this, stamped into each
|
|
49
|
+
* installed plugin's version message.
|
|
50
|
+
*/
|
|
51
|
+
export async function runBootstrap(stigmer, prepared, say, verb) {
|
|
52
|
+
const [{ ensureSystemOrg }, { installPreparedDefaults }] = await Promise.all([import("./system-org.js"), import("./plugins/defaults.js")]);
|
|
53
|
+
const org = await ensureSystemOrg(stigmer);
|
|
54
|
+
if (org === "created")
|
|
55
|
+
say(`Created the '${SYSTEM_ORG}' organization`);
|
|
56
|
+
const plugins = await installPreparedDefaults({ stigmer, info: say, verb }, prepared.defaults, SYSTEM_ORG);
|
|
57
|
+
return { org, plugins };
|
|
58
|
+
}
|
|
59
|
+
/** Both phases, against the backend `stigmer` is bound to: what `stigmer bootstrap` runs. */
|
|
60
|
+
export async function bootstrapBackend(stigmer, say, options = {}) {
|
|
61
|
+
return runBootstrap(stigmer, await prepareBootstrap(options), say, "stigmer bootstrap");
|
|
62
|
+
}
|
|
24
63
|
const sayToStderr = (line) => {
|
|
25
64
|
process.stderr.write(`${line}\n`);
|
|
26
65
|
};
|
|
66
|
+
/** What `stigmer up` does once the local server answers. Never throws past its own warnings. */
|
|
27
67
|
export async function bootstrapLocalBackend(home, deps = {}) {
|
|
28
68
|
const client = deps.client ?? (await freshLocalClient());
|
|
29
69
|
const say = deps.say ?? sayToStderr;
|
|
30
|
-
|
|
31
|
-
|
|
70
|
+
let prepared;
|
|
71
|
+
try {
|
|
72
|
+
prepared = await (deps.prepare ?? prepareBootstrap)();
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
log.warn("bootstrap preparation failed", { error: String(err) });
|
|
76
|
+
say("Warning: could not prepare the default plugins, so the local backend was not bootstrapped and nothing was retired. Run 'stigmer up' again to retry.");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
let result;
|
|
80
|
+
try {
|
|
81
|
+
result = await (deps.run ?? runLocalBootstrap)(client.stigmer, prepared, say);
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
log.warn("bootstrap failed", { error: String(err) });
|
|
85
|
+
say("Warning: failed to bootstrap the local backend, so nothing was retired. Run 'stigmer up' again to retry.");
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
log.debug("bootstrap complete", {
|
|
89
|
+
org: result.org,
|
|
90
|
+
outcomes: result.plugins.outcomes,
|
|
91
|
+
});
|
|
92
|
+
if (result.plugins.failed.length > 0) {
|
|
93
|
+
for (const name of result.plugins.failed) {
|
|
94
|
+
say(`Warning: failed to install default plugin '${name}'. Run 'stigmer bootstrap' to retry.`);
|
|
95
|
+
}
|
|
96
|
+
say("Nothing was retired: the resources an older release installed stay until every default plugin is in place.");
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
await (deps.retire ?? retireSeedpack)(client.stigmer, home, say);
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
log.warn("seedpack retire failed", { error: String(err) });
|
|
104
|
+
say("Warning: failed to retire the resources an older release installed. Run 'stigmer up' again to retry.");
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Phase 2 in the seam's shape, naming the verb: everything this file's
|
|
108
|
+
// local bootstrap installs was installed by `stigmer up`.
|
|
109
|
+
function runLocalBootstrap(stigmer, prepared, say) {
|
|
110
|
+
return runBootstrap(stigmer, prepared, say, "stigmer up");
|
|
111
|
+
}
|
|
112
|
+
// The retire step in the shape the seam expects; the module is loaded only
|
|
113
|
+
// inside `up`, the one place a retire may run.
|
|
114
|
+
async function retireSeedpack(stigmer, home, say) {
|
|
115
|
+
const { retireSeedpack: retire, renderRetireReport } = await import("./seedpack-retire.js");
|
|
116
|
+
const result = await retire(stigmer, { markerDir: dataDir(home) });
|
|
117
|
+
renderRetireReport(result, say);
|
|
32
118
|
}
|
|
33
119
|
async function freshLocalClient() {
|
|
34
120
|
const [{ createBackendClient }, { getDefault }] = await Promise.all([
|
|
@@ -40,49 +126,4 @@ async function freshLocalClient() {
|
|
|
40
126
|
getAccessToken: () => null,
|
|
41
127
|
});
|
|
42
128
|
}
|
|
43
|
-
/** Step 1. Idempotent via a content-hash marker, so repeated `up`s are cheap. */
|
|
44
|
-
export async function applySeedpackBestEffort(client, home, say) {
|
|
45
|
-
try {
|
|
46
|
-
const { applySeedpack } = await import("./seedpack/apply.js");
|
|
47
|
-
const result = await applySeedpack({
|
|
48
|
-
controller: client.controller,
|
|
49
|
-
stigmer: client.stigmer,
|
|
50
|
-
info: say,
|
|
51
|
-
warn: say,
|
|
52
|
-
}, { markerDir: dataDir(home), home });
|
|
53
|
-
log.debug("seedpack bootstrap complete", {
|
|
54
|
-
applied: result.applied,
|
|
55
|
-
hash: result.hash,
|
|
56
|
-
org: result.org,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
catch (err) {
|
|
60
|
-
log.warn("seedpack bootstrap failed", { error: String(err) });
|
|
61
|
-
say("Warning: failed to apply system resources (seedpack). Run 'stigmer seedpack apply' to retry.");
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Step 2. Runs even when step 1 warned: the plugins can only fail on their
|
|
66
|
-
* own terms (an org that does not exist fails the push, and the warning
|
|
67
|
-
* names the command that retries it).
|
|
68
|
-
*/
|
|
69
|
-
export async function installDefaultPluginsBestEffort(client, _home, say) {
|
|
70
|
-
try {
|
|
71
|
-
const [{ installDefaultPlugins }, { resolveSeedpackOrg }] = await Promise.all([
|
|
72
|
-
import("./plugins/defaults.js"),
|
|
73
|
-
import("./seedpack/apply.js"),
|
|
74
|
-
]);
|
|
75
|
-
const result = await installDefaultPlugins({ stigmer: client.stigmer, info: say }, { org: resolveSeedpackOrg() });
|
|
76
|
-
log.debug("default plugins bootstrap complete", {
|
|
77
|
-
outcomes: result.outcomes,
|
|
78
|
-
});
|
|
79
|
-
for (const name of result.failed) {
|
|
80
|
-
say(`Warning: failed to install default plugin '${name}'. Run 'stigmer install ${name}' to retry.`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
catch (err) {
|
|
84
|
-
log.warn("default plugins bootstrap failed", { error: String(err) });
|
|
85
|
-
say("Warning: failed to install the default plugins. Run 'stigmer marketplace show stigmer' to see them and 'stigmer install <name>' to retry.");
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
129
|
//# sourceMappingURL=bootstrap.js.map
|
package/local/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/local/bootstrap.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/local/bootstrap.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,wEAAwE;AACxE,mEAAmE;AACnE,4EAA4E;AAC5E,0EAA0E;AAC1E,yEAAyE;AACzE,sCAAsC;AACtC,EAAE;AACF,4EAA4E;AAC5E,EAAE;AACF,+EAA+E;AAC/E,wEAAwE;AACxE,uCAAuC;AACvC,yEAAyE;AACzE,qEAAqE;AACrE,EAAE;AACF,uEAAuE;AACvE,wEAAwE;AACxE,6EAA6E;AAC7E,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,yEAAyE;AACzE,2EAA2E;AAC3E,yEAAyE;AACzE,2EAA2E;AAC3E,8CAA8C;AAC9C,EAAE;AACF,yEAAyE;AACzE,2EAA2E;AAC3E,4EAA4E;AAC5E,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0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K,UAAU,gBAAgB;IAC7B,MAAM,CAAC,EAAE,mBAAmB,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAClE,MAAM,CAAC,oBAAoB,CAAC;QAC5B,MAAM,CAAC,qBAAqB,CAAC;KAC9B,CAAC,CAAC;IACH,OAAO,mBAAmB,CAAC;QACzB,MAAM,EAAE,UAAU,EAAE;QACpB,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI;KAC3B,CAAC,CAAC;AACL,CAAC"}
|
package/local/daemon/launch.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface UpForegroundDeps {
|
|
|
12
12
|
runDaemon?: (deps: InternalDaemonDeps) => Promise<number>;
|
|
13
13
|
/** Resolves when the stack should shut down (default: the first SIGTERM/SIGINT). */
|
|
14
14
|
waitForShutdown?: () => Promise<void>;
|
|
15
|
-
/** Post-readiness bootstrap (default: `bootstrapLocalBackend
|
|
15
|
+
/** Post-readiness bootstrap (default: `bootstrapLocalBackend`: prepare the defaults, retire an older release's seedpack, ensure the org, install). */
|
|
16
16
|
bootstrap?: (home: string) => Promise<void>;
|
|
17
17
|
/** Receives each line the server and runner write (default: a `[component]`-prefixed stdout mirror). */
|
|
18
18
|
mirror?: OutputMirror;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../../src/local/daemon/launch.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,KAAK,kBAAkB,EAA4C,MAAM,cAAc,CAAC;AAUjG,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAUD,8EAA8E;AAC9E,wBAAsB,EAAE,CAAC,OAAO,GAAE,SAAc,EAAE,IAAI,GAAE,MAAkB,GAAG,OAAO,CAAC,IAAI,CA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AI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAyDD,kEAAkE;AAClE,wBAAsB,IAAI,CAAC,IAAI,GAAE,MAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAiCrE;AAED,qFAAqF;AACrF,wBAAsB,SAAS,CAAC,IAAI,GAAE,MAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ1E"}
|
package/local/paths.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare function artifactDir(home?: string): string;
|
|
|
19
19
|
export declare function binDir(home?: string): string;
|
|
20
20
|
/**
|
|
21
21
|
* Env var that relocates the acquired-runtimes root. The acquirers (server,
|
|
22
|
-
* runner,
|
|
22
|
+
* runner, the official plugin catalogue) keep their `<root>/<version>/node_modules/@stigmer/<pkg>`
|
|
23
23
|
* layout under it, so a root that already holds the packages is used as-is
|
|
24
24
|
* and nothing is downloaded. The all-in-one image bakes exactly that layout
|
|
25
25
|
* read-only off its data volume — a `stigmer up` whose first-run acquisitions
|
package/local/paths.js
CHANGED
|
@@ -40,7 +40,7 @@ export function binDir(home = homedir()) {
|
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* Env var that relocates the acquired-runtimes root. The acquirers (server,
|
|
43
|
-
* runner,
|
|
43
|
+
* runner, the official plugin catalogue) keep their `<root>/<version>/node_modules/@stigmer/<pkg>`
|
|
44
44
|
* layout under it, so a root that already holds the packages is used as-is
|
|
45
45
|
* and nothing is downloaded. The all-in-one image bakes exactly that layout
|
|
46
46
|
* read-only off its data volume — a `stigmer up` whose first-run acquisitions
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import { type Stigmer } from "@stigmer/sdk";
|
|
2
2
|
import { type ResolveOfficialOptions } from "../../marketplace/official.js";
|
|
3
|
+
import { type PreparedPluginPush } from "../../resources/plugin.js";
|
|
4
|
+
/**
|
|
5
|
+
* The command that ran the install, as the plugin's stored version message
|
|
6
|
+
* names it. Two verbs share the one bootstrap function, and a platform
|
|
7
|
+
* operator reading the row a year later must see which one wrote it.
|
|
8
|
+
*/
|
|
9
|
+
export type InstallingVerb = "stigmer up" | "stigmer bootstrap";
|
|
3
10
|
export interface DefaultPluginsDeps {
|
|
4
11
|
/** The client bound to the backend being bootstrapped. */
|
|
5
12
|
readonly stigmer: Stigmer;
|
|
6
13
|
/** Human progress lines (stderr). */
|
|
7
14
|
readonly info: (line: string) => void;
|
|
15
|
+
/** Stamped into each installed plugin's version message. */
|
|
16
|
+
readonly verb: InstallingVerb;
|
|
8
17
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly
|
|
12
|
-
|
|
13
|
-
readonly official?: ResolveOfficialOptions;
|
|
18
|
+
/** One default, ready to push: its marketplace name and the prepared archive. */
|
|
19
|
+
export interface PreparedDefault {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly push: PreparedPluginPush;
|
|
14
22
|
}
|
|
15
23
|
export type DefaultPluginOutcome = {
|
|
16
24
|
readonly name: string;
|
|
@@ -30,6 +38,18 @@ export interface DefaultPluginsResult {
|
|
|
30
38
|
/** The names that did not land, for the caller's warning. */
|
|
31
39
|
readonly failed: readonly string[];
|
|
32
40
|
}
|
|
33
|
-
/**
|
|
34
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Phase 1: every default the official marketplace names, prepared in the
|
|
43
|
+
* marketplace's order. Throws when the tree cannot be resolved, offers less
|
|
44
|
+
* than it lists (the library drops an entry it cannot install with a
|
|
45
|
+
* warning, which for a user's marketplace is `show`'s business and for ours
|
|
46
|
+
* is a broken release), or any default cannot be prepared; nothing is
|
|
47
|
+
* returned half-ready.
|
|
48
|
+
*/
|
|
49
|
+
export declare function prepareDefaultPlugins(official?: ResolveOfficialOptions): Promise<readonly PreparedDefault[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Phase 2: install the prepared defaults into `org`, skipping what the
|
|
52
|
+
* backend already holds. Best-effort per entry.
|
|
53
|
+
*/
|
|
54
|
+
export declare function installPreparedDefaults(deps: DefaultPluginsDeps, prepared: readonly PreparedDefault[], org: string): Promise<DefaultPluginsResult>;
|
|
35
55
|
//# sourceMappingURL=defaults.d.ts.map
|