superpowers-manager 0.5.1 → 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.
- package/README.md +13 -11
- package/dist/cli.js +9 -14
- package/dist/commands/install.js +18 -9
- package/dist/commands/mutation.js +7 -0
- package/dist/commands/prepare.js +5 -51
- package/dist/commands/probe.js +8 -10
- package/dist/commands/uninstall.js +2 -2
- package/dist/effective-selection.js +3 -3
- package/dist/harnesses/codex/adapter.js +336 -457
- package/dist/harnesses/codex/compatibility.js +2 -17
- package/dist/harnesses/codex/generated-plugin.js +1 -1
- package/dist/harnesses/codex/harness.js +45 -272
- package/dist/harnesses/codex/hooks.js +1 -1
- package/dist/harnesses/codex/json.js +6 -2
- package/dist/harnesses/codex/lifecycle.js +110 -54
- package/dist/harnesses/codex/manifest-overlay.js +22 -17
- package/dist/harnesses/codex/marketplace.js +148 -0
- package/dist/harnesses/codex/paths.js +97 -0
- package/dist/harnesses/codex/prepare.js +34 -2
- package/dist/harnesses/codex/presentation.js +10 -17
- package/dist/harnesses/codex/publication.js +520 -0
- package/dist/harnesses/codex/recovery.js +338 -0
- package/dist/harnesses/codex/state.js +131 -0
- package/dist/harnesses/codex/stored-state.js +249 -0
- package/dist/provenance.js +3 -3
- package/dist/python-json-format.js +0 -69
- package/dist/python-json.js +2 -27
- package/dist/python-text.js +9 -69
- package/dist/validator.js +35 -72
- package/node_modules/smol-toml/LICENSE +24 -0
- package/node_modules/smol-toml/README.md +418 -0
- package/node_modules/smol-toml/dist/date.d.ts +41 -0
- package/node_modules/smol-toml/dist/date.js +127 -0
- package/node_modules/smol-toml/dist/error.d.ts +38 -0
- package/node_modules/smol-toml/dist/error.js +63 -0
- package/node_modules/smol-toml/dist/extract.js +69 -0
- package/node_modules/smol-toml/dist/index.cjs +734 -0
- package/node_modules/smol-toml/dist/index.d.ts +43 -0
- package/node_modules/smol-toml/dist/index.js +33 -0
- package/node_modules/smol-toml/dist/parse.d.ts +36 -0
- package/node_modules/smol-toml/dist/parse.js +149 -0
- package/node_modules/smol-toml/dist/primitive.js +238 -0
- package/node_modules/smol-toml/dist/stringify.d.ts +31 -0
- package/node_modules/smol-toml/dist/stringify.js +181 -0
- package/node_modules/smol-toml/dist/struct.js +179 -0
- package/node_modules/smol-toml/dist/util.d.ts +38 -0
- package/node_modules/smol-toml/dist/util.js +89 -0
- package/node_modules/smol-toml/package.json +68 -0
- package/package.json +10 -2
- package/dist/selection-state-cli.js +0 -85
- package/dist/upstream-cli.js +0 -110
package/dist/upstream-cli.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { realpathSync } from "node:fs";
|
|
2
|
-
import { oneLine, parseFlags, UsageError } from "./cli-arguments.js";
|
|
3
|
-
import { COMMIT_INPUT_RE, TAG_RE } from "./domain/refs.js";
|
|
4
|
-
import { fetchExactCommit, gitSafeSource, resolveExactTag, resolveRef, verifyRawCommit, } from "./upstream.js";
|
|
5
|
-
import { manifestVersionForRef } from "./upstream-version.js";
|
|
6
|
-
const COMMAND_FLAGS = {
|
|
7
|
-
"resolve-ref": ["source", "ref"],
|
|
8
|
-
"resolve-exact-tag": ["source", "ref"],
|
|
9
|
-
"verify-raw-commit": ["source", "commit", "workspace-parent"],
|
|
10
|
-
"fetch-exact-commit": ["source", "commit", "repository", "workspace-parent"],
|
|
11
|
-
"manifest-version": [
|
|
12
|
-
"requested-ref",
|
|
13
|
-
"resolution-kind",
|
|
14
|
-
"resolved-ref",
|
|
15
|
-
"commit",
|
|
16
|
-
],
|
|
17
|
-
"pin-kind": ["ref"],
|
|
18
|
-
"safe-source": ["source"],
|
|
19
|
-
};
|
|
20
|
-
const RESOLUTION_KINDS = [
|
|
21
|
-
"latest-release",
|
|
22
|
-
"tag",
|
|
23
|
-
"ref",
|
|
24
|
-
"raw-commit",
|
|
25
|
-
];
|
|
26
|
-
function parseResolutionKind(value) {
|
|
27
|
-
const found = RESOLUTION_KINDS.find((kind) => kind === value);
|
|
28
|
-
if (found === undefined) {
|
|
29
|
-
throw new UsageError(`unknown resolution kind: ${value}`);
|
|
30
|
-
}
|
|
31
|
-
return found;
|
|
32
|
-
}
|
|
33
|
-
function parseCommand(argv) {
|
|
34
|
-
const [name, ...rest] = argv;
|
|
35
|
-
if (name === undefined)
|
|
36
|
-
throw new UsageError("a subcommand is required");
|
|
37
|
-
if (!Object.hasOwn(COMMAND_FLAGS, name)) {
|
|
38
|
-
throw new UsageError(`unknown subcommand: ${name}`);
|
|
39
|
-
}
|
|
40
|
-
const command = name;
|
|
41
|
-
return { name: command, flags: parseFlags(rest, COMMAND_FLAGS[command]) };
|
|
42
|
-
}
|
|
43
|
-
async function dispatch({ name, flags }) {
|
|
44
|
-
if (name === "resolve-ref") {
|
|
45
|
-
const resolution = await resolveRef(flags.source, flags.ref);
|
|
46
|
-
process.stdout.write(`${resolution.kind} ${resolution.ref} ${resolution.commit}\n`);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (name === "resolve-exact-tag") {
|
|
50
|
-
process.stdout.write(`${await resolveExactTag(flags.source, flags.ref)}\n`);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (name === "verify-raw-commit") {
|
|
54
|
-
const commit = await verifyRawCommit(flags.source, flags.commit, flags["workspace-parent"]);
|
|
55
|
-
process.stdout.write(`${commit}\n`);
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (name === "fetch-exact-commit") {
|
|
59
|
-
await fetchExactCommit(flags.source, flags.commit, flags.repository, flags["workspace-parent"]);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (name === "manifest-version") {
|
|
63
|
-
const version = manifestVersionForRef({
|
|
64
|
-
requestedRef: flags["requested-ref"],
|
|
65
|
-
resolutionKind: parseResolutionKind(flags["resolution-kind"]),
|
|
66
|
-
resolvedRef: flags["resolved-ref"],
|
|
67
|
-
commit: flags.commit,
|
|
68
|
-
});
|
|
69
|
-
process.stdout.write(`${version}\n`);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (name === "pin-kind") {
|
|
73
|
-
const kind = TAG_RE.test(flags.ref)
|
|
74
|
-
? "tag"
|
|
75
|
-
: COMMIT_INPUT_RE.test(flags.ref)
|
|
76
|
-
? "raw-commit"
|
|
77
|
-
: "none";
|
|
78
|
-
process.stdout.write(`${kind}\n`);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (name === "safe-source") {
|
|
82
|
-
process.stdout.write(`${gitSafeSource(flags.source)}\n`);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const unreachable = name;
|
|
86
|
-
throw new Error(`unhandled subcommand: ${String(unreachable)}`);
|
|
87
|
-
}
|
|
88
|
-
export async function runUpstreamCli(argv) {
|
|
89
|
-
let command;
|
|
90
|
-
try {
|
|
91
|
-
command = parseCommand(argv);
|
|
92
|
-
}
|
|
93
|
-
catch (cause) {
|
|
94
|
-
process.stderr.write(`usage: upstream-cli <subcommand> [options]\n`);
|
|
95
|
-
process.stderr.write(`error: ${oneLine(cause)}\n`);
|
|
96
|
-
return 2;
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
await dispatch(command);
|
|
100
|
-
return 0;
|
|
101
|
-
}
|
|
102
|
-
catch (cause) {
|
|
103
|
-
process.stderr.write(`error: ${oneLine(cause)}\n`);
|
|
104
|
-
return cause instanceof UsageError ? 2 : 1;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
const entry = process.argv[1];
|
|
108
|
-
if (entry !== undefined && import.meta.filename === realpathSync(entry)) {
|
|
109
|
-
process.exitCode = await runUpstreamCli(process.argv.slice(2));
|
|
110
|
-
}
|