@rulemetric/cli 0.4.0 → 0.5.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/dist/base-command.js +2 -2
- package/dist/{chunk-S56LOTGQ.js → chunk-7DIWBTB5.js} +2 -2
- package/dist/chunk-DUQGKWHJ.js +309 -0
- package/dist/chunk-DUQGKWHJ.js.map +7 -0
- package/dist/{chunk-2WWGG2A5.js → chunk-E32IADV3.js} +10 -9
- package/dist/chunk-E32IADV3.js.map +7 -0
- package/dist/{chunk-42A3HEEH.js → chunk-F5DPTXRC.js} +30 -2
- package/dist/{chunk-42A3HEEH.js.map → chunk-F5DPTXRC.js.map} +3 -3
- package/dist/{chunk-YEBBX4HQ.js → chunk-I4GHR6CY.js} +2 -2
- package/dist/{chunk-CROYS75W.js → chunk-LJ5OT5XN.js} +4 -4
- package/dist/{chunk-MTLAIJED.js → chunk-OWUS3HMA.js} +2 -2
- package/dist/{chunk-OGVORIFM.js → chunk-R56PH7YE.js} +11 -3
- package/dist/chunk-R56PH7YE.js.map +7 -0
- package/dist/{chunk-CLC7ZFH2.js → chunk-RYMK7FQL.js} +2 -2
- package/dist/{chunk-C7SRRSPA.js → chunk-VBOTWXJW.js} +2 -2
- package/dist/commands/antigravity/backfill.js +2 -2
- package/dist/commands/auth/create-key.js +2 -2
- package/dist/commands/auth/login.js +2 -2
- package/dist/commands/auth/logout.js +2 -2
- package/dist/commands/auth/revoke-key.js +2 -2
- package/dist/commands/auth/status.js +2 -2
- package/dist/commands/catalog/index.js +2 -2
- package/dist/commands/catalog/recommend.js +2 -2
- package/dist/commands/convert.js +2 -2
- package/dist/commands/converters.js +2 -2
- package/dist/commands/crons/list.js +2 -2
- package/dist/commands/crons/run.js +2 -2
- package/dist/commands/dashboard.js +2 -2
- package/dist/commands/eval-targets/create.js +2 -2
- package/dist/commands/eval-targets/list.js +2 -2
- package/dist/commands/evals/agent.js +11 -10
- package/dist/commands/evals/agent.js.map +2 -2
- package/dist/commands/evals/benchmark.js +2 -2
- package/dist/commands/evals/compare.js +2 -2
- package/dist/commands/evals/create.js +2 -2
- package/dist/commands/evals/optimize-description.js +2 -2
- package/dist/commands/evals/optimize.js +2 -2
- package/dist/commands/evals/run.js +2 -2
- package/dist/commands/gateway/ensure.js +2 -2
- package/dist/commands/hooks/install.js +2 -2
- package/dist/commands/hooks/run.js +2 -2
- package/dist/commands/hooks/uninstall.js +2 -2
- package/dist/commands/import.js +2 -2
- package/dist/commands/instructions/create.js +2 -2
- package/dist/commands/instructions/delete.js +2 -2
- package/dist/commands/instructions/fork.js +2 -2
- package/dist/commands/instructions/get.js +2 -2
- package/dist/commands/instructions/list.js +2 -2
- package/dist/commands/instructions/promote.js +2 -2
- package/dist/commands/instructions/pull.js +2 -2
- package/dist/commands/instructions/upstream.js +2 -2
- package/dist/commands/instructions/versions.js +2 -2
- package/dist/commands/launcher.js +2 -2
- package/dist/commands/org/current.js +2 -2
- package/dist/commands/org/list.js +2 -2
- package/dist/commands/org/switch.js +2 -2
- package/dist/commands/packs/add-instruction.js +2 -2
- package/dist/commands/packs/apply.js +2 -2
- package/dist/commands/packs/create.js +2 -2
- package/dist/commands/packs/fork.js +2 -2
- package/dist/commands/packs/get.js +2 -2
- package/dist/commands/packs/list.js +2 -2
- package/dist/commands/packs/remove-instruction.js +2 -2
- package/dist/commands/proxy/env.js +2 -2
- package/dist/commands/proxy/logs.js +2 -2
- package/dist/commands/proxy/restart.js +2 -2
- package/dist/commands/proxy/setup.js +2 -2
- package/dist/commands/proxy/start.js +2 -2
- package/dist/commands/proxy/status.js +2 -2
- package/dist/commands/proxy/stop.js +2 -2
- package/dist/commands/research/backfill.js +2 -2
- package/dist/commands/research/tail-transcript.js +2 -2
- package/dist/commands/service/install.js +2 -2
- package/dist/commands/service/status.js +2 -2
- package/dist/commands/service/uninstall.js +2 -2
- package/dist/commands/sessions/analyze.js +2 -2
- package/dist/commands/sessions/end.js +2 -2
- package/dist/commands/sessions/import.js +2 -2
- package/dist/commands/sessions/list.js +2 -2
- package/dist/commands/sessions/start.js +2 -2
- package/dist/commands/setup.js +146 -0
- package/dist/commands/setup.js.map +7 -0
- package/dist/commands/signals/report.js +2 -2
- package/dist/commands/skills/export-approved.js +2 -2
- package/dist/commands/skills/install.js +2 -2
- package/dist/commands/skills/list.js +2 -2
- package/dist/commands/skills/publish.js +2 -2
- package/dist/commands/skills/search.js +2 -2
- package/dist/commands/skills/update.js +2 -2
- package/dist/commands/suggestions/accept.js +2 -2
- package/dist/commands/suggestions/dismiss.js +2 -2
- package/dist/commands/suggestions/list.js +2 -2
- package/dist/commands/suggestions/refresh.js +2 -2
- package/dist/dashboard/Dashboard.js +11 -11
- package/dist/dashboard/launcher/LauncherOverlay.js +3 -3
- package/dist/lib/agent-loop.js +7 -7
- package/dist/lib/handlers/process-announcement.js +2 -2
- package/dist/lib/handlers/process-changelog.js +2 -2
- package/dist/lib/handlers/process-run-cleanup.js +2 -2
- package/dist/lib/handlers/process-session-goal.js +2 -2
- package/dist/lib/manual-tasks.js +2 -2
- package/dist/lib/setup-steps.js +26 -0
- package/dist/lib/setup-steps.js.map +7 -0
- package/dist/lib/version-check.js +3 -1
- package/oclif.manifest.json +1025 -964
- package/package.json +7 -7
- package/dist/chunk-2WWGG2A5.js.map +0 -7
- package/dist/chunk-OGVORIFM.js.map +0 -7
- /package/dist/{chunk-S56LOTGQ.js.map → chunk-7DIWBTB5.js.map} +0 -0
- /package/dist/{chunk-YEBBX4HQ.js.map → chunk-I4GHR6CY.js.map} +0 -0
- /package/dist/{chunk-CROYS75W.js.map → chunk-LJ5OT5XN.js.map} +0 -0
- /package/dist/{chunk-MTLAIJED.js.map → chunk-OWUS3HMA.js.map} +0 -0
- /package/dist/{chunk-CLC7ZFH2.js.map → chunk-RYMK7FQL.js.map} +0 -0
- /package/dist/{chunk-C7SRRSPA.js.map → chunk-VBOTWXJW.js.map} +0 -0
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
} from "../../chunk-FTJRMUID.js";
|
|
16
16
|
import {
|
|
17
17
|
BaseCommand
|
|
18
|
-
} from "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
18
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
19
|
+
import "../../chunk-R56PH7YE.js";
|
|
20
20
|
import "../../chunk-2AM54TUK.js";
|
|
21
21
|
import "../../chunk-EJOI2ZGU.js";
|
|
22
22
|
import "../../chunk-KZRFUXGF.js";
|
package/dist/commands/import.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../../chunk-7NYKWN7U.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
7
|
+
import "../../chunk-R56PH7YE.js";
|
|
8
8
|
import "../../chunk-2AM54TUK.js";
|
|
9
9
|
import {
|
|
10
10
|
apiDelete,
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
} from "../../chunk-BZDKEQKU.js";
|
|
8
8
|
import {
|
|
9
9
|
BaseCommand
|
|
10
|
-
} from "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
10
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
11
|
+
import "../../chunk-R56PH7YE.js";
|
|
12
12
|
import "../../chunk-2AM54TUK.js";
|
|
13
13
|
import {
|
|
14
14
|
apiGet
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
} from "../../chunk-BZDKEQKU.js";
|
|
6
6
|
import {
|
|
7
7
|
BaseCommand
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
9
|
+
import "../../chunk-R56PH7YE.js";
|
|
10
10
|
import "../../chunk-2AM54TUK.js";
|
|
11
11
|
import {
|
|
12
12
|
apiGet
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "../../chunk-BZDKEQKU.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseCommand
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
10
|
+
import "../../chunk-R56PH7YE.js";
|
|
11
11
|
import "../../chunk-2AM54TUK.js";
|
|
12
12
|
import {
|
|
13
13
|
apiGet
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
} from "../../chunk-BZDKEQKU.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseCommand
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
8
|
+
import "../../chunk-R56PH7YE.js";
|
|
9
9
|
import "../../chunk-2AM54TUK.js";
|
|
10
10
|
import {
|
|
11
11
|
apiGet
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
} from "../../chunk-BZDKEQKU.js";
|
|
6
6
|
import {
|
|
7
7
|
BaseCommand
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
9
|
+
import "../../chunk-R56PH7YE.js";
|
|
10
10
|
import "../../chunk-2AM54TUK.js";
|
|
11
11
|
import {
|
|
12
12
|
apiGet
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../../chunk-FTJRMUID.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
7
|
+
import "../../chunk-R56PH7YE.js";
|
|
8
8
|
import "../../chunk-2AM54TUK.js";
|
|
9
9
|
import "../../chunk-EJOI2ZGU.js";
|
|
10
10
|
import "../../chunk-KZRFUXGF.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
4
|
+
import "../../chunk-R56PH7YE.js";
|
|
5
5
|
import "../../chunk-2AM54TUK.js";
|
|
6
6
|
import "../../chunk-EJOI2ZGU.js";
|
|
7
7
|
import "../../chunk-KZRFUXGF.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
4
|
+
import "../../chunk-R56PH7YE.js";
|
|
5
5
|
import "../../chunk-2AM54TUK.js";
|
|
6
6
|
import "../../chunk-EJOI2ZGU.js";
|
|
7
7
|
import "../../chunk-KZRFUXGF.js";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../../chunk-ERPMDAO3.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
7
|
+
import "../../chunk-R56PH7YE.js";
|
|
8
8
|
import "../../chunk-2AM54TUK.js";
|
|
9
9
|
import "../../chunk-EJOI2ZGU.js";
|
|
10
10
|
import {
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../../chunk-ERPMDAO3.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
7
|
+
import "../../chunk-R56PH7YE.js";
|
|
8
8
|
import "../../chunk-2AM54TUK.js";
|
|
9
9
|
import "../../chunk-EJOI2ZGU.js";
|
|
10
10
|
import {
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "../../chunk-FTJRMUID.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseCommand
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
10
|
+
import "../../chunk-R56PH7YE.js";
|
|
11
11
|
import "../../chunk-2AM54TUK.js";
|
|
12
12
|
import "../../chunk-EJOI2ZGU.js";
|
|
13
13
|
import "../../chunk-KZRFUXGF.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
4
|
+
import "../../chunk-R56PH7YE.js";
|
|
5
5
|
import "../../chunk-2AM54TUK.js";
|
|
6
6
|
import "../../chunk-EJOI2ZGU.js";
|
|
7
7
|
import "../../chunk-KZRFUXGF.js";
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "../../chunk-WA4MWYRW.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseCommand
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
10
|
+
import "../../chunk-R56PH7YE.js";
|
|
11
11
|
import "../../chunk-2AM54TUK.js";
|
|
12
12
|
import "../../chunk-EJOI2ZGU.js";
|
|
13
13
|
import "../../chunk-KZRFUXGF.js";
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
} from "../../chunk-WA4MWYRW.js";
|
|
9
9
|
import {
|
|
10
10
|
BaseCommand
|
|
11
|
-
} from "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
11
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
12
|
+
import "../../chunk-R56PH7YE.js";
|
|
13
13
|
import "../../chunk-2AM54TUK.js";
|
|
14
14
|
import "../../chunk-EJOI2ZGU.js";
|
|
15
15
|
import "../../chunk-KZRFUXGF.js";
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
import "../../chunk-KRBQLMOP.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseCommand
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
8
|
+
import "../../chunk-R56PH7YE.js";
|
|
9
9
|
import {
|
|
10
10
|
bootstrapActiveOrg
|
|
11
11
|
} from "../../chunk-2AM54TUK.js";
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
import "../../chunk-KRBQLMOP.js";
|
|
5
5
|
import {
|
|
6
6
|
BaseCommand
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
8
|
+
import "../../chunk-R56PH7YE.js";
|
|
9
9
|
import "../../chunk-2AM54TUK.js";
|
|
10
10
|
import "../../chunk-EJOI2ZGU.js";
|
|
11
11
|
import "../../chunk-KZRFUXGF.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
4
|
+
import "../../chunk-R56PH7YE.js";
|
|
5
5
|
import "../../chunk-2AM54TUK.js";
|
|
6
6
|
import "../../chunk-EJOI2ZGU.js";
|
|
7
7
|
import "../../chunk-KZRFUXGF.js";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../../chunk-7NYKWN7U.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
7
|
+
import "../../chunk-R56PH7YE.js";
|
|
8
8
|
import "../../chunk-2AM54TUK.js";
|
|
9
9
|
import {
|
|
10
10
|
apiPost
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CORE_STEP_IDS,
|
|
3
|
+
STEPS,
|
|
4
|
+
computeStatus,
|
|
5
|
+
defaultContext,
|
|
6
|
+
getStep,
|
|
7
|
+
isStepId,
|
|
8
|
+
renderDiff
|
|
9
|
+
} from "../chunk-DUQGKWHJ.js";
|
|
10
|
+
import "../chunk-ANOWI23I.js";
|
|
11
|
+
import "../chunk-FTJRMUID.js";
|
|
12
|
+
import {
|
|
13
|
+
BaseCommand
|
|
14
|
+
} from "../chunk-7DIWBTB5.js";
|
|
15
|
+
import "../chunk-R56PH7YE.js";
|
|
16
|
+
import "../chunk-2AM54TUK.js";
|
|
17
|
+
import "../chunk-EJOI2ZGU.js";
|
|
18
|
+
import "../chunk-KZRFUXGF.js";
|
|
19
|
+
import "../chunk-EKJ2CABV.js";
|
|
20
|
+
import "../chunk-NSBPE2FW.js";
|
|
21
|
+
|
|
22
|
+
// src/commands/setup.ts
|
|
23
|
+
import { Args, Flags } from "@oclif/core";
|
|
24
|
+
import * as readline from "node:readline/promises";
|
|
25
|
+
var Setup = class _Setup extends BaseCommand {
|
|
26
|
+
static description = "Agentic, transparent setup: plan / show diffs / apply the four core onboarding steps";
|
|
27
|
+
static examples = [
|
|
28
|
+
"<%= config.bin %> setup # interactive walk (TTY)",
|
|
29
|
+
"<%= config.bin %> setup plan # read-only: every remaining artifact + diff",
|
|
30
|
+
"<%= config.bin %> setup hooks --show # print one step's diff",
|
|
31
|
+
"<%= config.bin %> setup hooks --apply # apply one step",
|
|
32
|
+
"<%= config.bin %> setup --json # machine-readable status (exit 0 iff complete)"
|
|
33
|
+
];
|
|
34
|
+
static args = {
|
|
35
|
+
target: Args.string({
|
|
36
|
+
description: `"plan" or a step id (${CORE_STEP_IDS.join(", ")})`,
|
|
37
|
+
required: false
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
static flags = {
|
|
41
|
+
json: Flags.boolean({ description: "Machine-readable output", default: false }),
|
|
42
|
+
show: Flags.boolean({ description: "Print the step diff (read-only)", default: false }),
|
|
43
|
+
apply: Flags.boolean({ description: "Apply the step", default: false })
|
|
44
|
+
};
|
|
45
|
+
async run() {
|
|
46
|
+
const { args, flags } = await this.parse(_Setup);
|
|
47
|
+
const ctx = defaultContext();
|
|
48
|
+
if (args.target === "plan") {
|
|
49
|
+
await this.runPlan(ctx, flags.json);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (args.target && isStepId(args.target)) {
|
|
53
|
+
if (flags.apply) {
|
|
54
|
+
await getStep(args.target).apply(ctx);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const plan = await getStep(args.target).plan(ctx);
|
|
58
|
+
this.printPlan(plan);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (args.target) {
|
|
62
|
+
this.error(`Unknown target "${args.target}". Use "plan" or one of: ${CORE_STEP_IDS.join(", ")}.`);
|
|
63
|
+
}
|
|
64
|
+
if (flags.json) {
|
|
65
|
+
const status = await computeStatus(ctx);
|
|
66
|
+
this.log(JSON.stringify(status, null, 2));
|
|
67
|
+
if (!status.coreComplete) this.exit(1);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
await this.runInteractive(ctx);
|
|
71
|
+
}
|
|
72
|
+
async runPlan(ctx, asJson) {
|
|
73
|
+
const status = await computeStatus(ctx);
|
|
74
|
+
const remaining = STEPS.filter(
|
|
75
|
+
(s) => !status.steps.find((st) => st.id === s.id)?.done
|
|
76
|
+
);
|
|
77
|
+
const plans = [];
|
|
78
|
+
for (const step of remaining) {
|
|
79
|
+
plans.push(await step.plan(ctx));
|
|
80
|
+
}
|
|
81
|
+
if (asJson) {
|
|
82
|
+
this.log(JSON.stringify({ ...status, plans }, null, 2));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (plans.length === 0) {
|
|
86
|
+
this.log("[OK] All core steps complete \u2014 nothing to install.");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this.log("The following steps would be applied:\n");
|
|
90
|
+
for (const plan of plans) {
|
|
91
|
+
this.printPlan(plan);
|
|
92
|
+
this.log("");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
printPlan(plan) {
|
|
96
|
+
this.log(`[..] ${plan.title} (${plan.id})`);
|
|
97
|
+
if (plan.command) this.log(` command: ${plan.command}`);
|
|
98
|
+
for (const artifact of plan.artifacts) {
|
|
99
|
+
this.log(` ${artifact.kind}: ${artifact.path}${artifact.masked ? " (secret masked)" : ""}`);
|
|
100
|
+
const diff = renderDiff(artifact.before, artifact.after);
|
|
101
|
+
for (const line of diff.split("\n")) {
|
|
102
|
+
this.log(` ${line}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async runInteractive(ctx) {
|
|
107
|
+
if (!process.stdin.isTTY) {
|
|
108
|
+
this.log("Not a TTY \u2014 interactive walk needs a terminal.");
|
|
109
|
+
this.log("Use one of:");
|
|
110
|
+
this.log(" rulemetric setup plan \u2014 see every remaining artifact + diff");
|
|
111
|
+
this.log(" rulemetric setup <step> --show \u2014 print one step diff");
|
|
112
|
+
this.log(" rulemetric setup <step> --apply \u2014 apply one step");
|
|
113
|
+
this.log(" rulemetric setup --json \u2014 machine-readable status");
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const status = await computeStatus(ctx);
|
|
117
|
+
const remaining = STEPS.filter(
|
|
118
|
+
(s) => !status.steps.find((st) => st.id === s.id)?.done
|
|
119
|
+
);
|
|
120
|
+
if (remaining.length === 0) {
|
|
121
|
+
this.log("[OK] All core steps complete.");
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
125
|
+
try {
|
|
126
|
+
for (const step of remaining) {
|
|
127
|
+
const plan = await step.plan(ctx);
|
|
128
|
+
this.printPlan(plan);
|
|
129
|
+
const answer = (await rl.question(`Apply "${plan.title}"? [y/N] `)).trim().toLowerCase();
|
|
130
|
+
if (answer === "y" || answer === "yes") {
|
|
131
|
+
await step.apply(ctx);
|
|
132
|
+
this.log(`[OK] Applied ${plan.title}.`);
|
|
133
|
+
} else {
|
|
134
|
+
this.log(`[..] Skipped ${plan.title}.`);
|
|
135
|
+
}
|
|
136
|
+
this.log("");
|
|
137
|
+
}
|
|
138
|
+
} finally {
|
|
139
|
+
rl.close();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
export {
|
|
144
|
+
Setup as default
|
|
145
|
+
};
|
|
146
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/setup.ts"],
|
|
4
|
+
"sourcesContent": ["import { Args, Flags } from '@oclif/core';\nimport * as readline from 'node:readline/promises';\nimport { BaseCommand } from '../base-command.js';\nimport {\n STEPS,\n CORE_STEP_IDS,\n getStep,\n isStepId,\n computeStatus,\n renderDiff,\n defaultContext,\n type SetupContext,\n type StepPlan,\n} from '../lib/setup-steps.js';\n\nexport default class Setup extends BaseCommand {\n static override description =\n 'Agentic, transparent setup: plan / show diffs / apply the four core onboarding steps';\n\n static override examples = [\n '<%= config.bin %> setup # interactive walk (TTY)',\n '<%= config.bin %> setup plan # read-only: every remaining artifact + diff',\n '<%= config.bin %> setup hooks --show # print one step\\'s diff',\n '<%= config.bin %> setup hooks --apply # apply one step',\n '<%= config.bin %> setup --json # machine-readable status (exit 0 iff complete)',\n ];\n\n static override args = {\n target: Args.string({\n description: `\"plan\" or a step id (${CORE_STEP_IDS.join(', ')})`,\n required: false,\n }),\n };\n\n static override flags = {\n json: Flags.boolean({ description: 'Machine-readable output', default: false }),\n show: Flags.boolean({ description: 'Print the step diff (read-only)', default: false }),\n apply: Flags.boolean({ description: 'Apply the step', default: false }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Setup);\n const ctx = defaultContext();\n\n if (args.target === 'plan') {\n await this.runPlan(ctx, flags.json);\n return;\n }\n\n if (args.target && isStepId(args.target)) {\n if (flags.apply) {\n await getStep(args.target).apply(ctx);\n return;\n }\n // Default for a named step is --show (read-only diff).\n const plan = await getStep(args.target).plan(ctx);\n this.printPlan(plan);\n return;\n }\n\n if (args.target) {\n this.error(`Unknown target \"${args.target}\". Use \"plan\" or one of: ${CORE_STEP_IDS.join(', ')}.`);\n }\n\n // No target.\n if (flags.json) {\n const status = await computeStatus(ctx);\n this.log(JSON.stringify(status, null, 2));\n if (!status.coreComplete) this.exit(1);\n return;\n }\n\n await this.runInteractive(ctx);\n }\n\n private async runPlan(ctx: SetupContext, asJson: boolean): Promise<void> {\n const status = await computeStatus(ctx);\n const remaining = STEPS.filter(\n (s) => !status.steps.find((st) => st.id === s.id)?.done,\n );\n const plans: StepPlan[] = [];\n for (const step of remaining) {\n // eslint-disable-next-line no-await-in-loop\n plans.push(await step.plan(ctx));\n }\n\n if (asJson) {\n this.log(JSON.stringify({ ...status, plans }, null, 2));\n return;\n }\n\n if (plans.length === 0) {\n this.log('[OK] All core steps complete \u2014 nothing to install.');\n return;\n }\n this.log('The following steps would be applied:\\n');\n for (const plan of plans) {\n this.printPlan(plan);\n this.log('');\n }\n }\n\n private printPlan(plan: StepPlan): void {\n this.log(`[..] ${plan.title} (${plan.id})`);\n if (plan.command) this.log(` command: ${plan.command}`);\n for (const artifact of plan.artifacts) {\n this.log(` ${artifact.kind}: ${artifact.path}${artifact.masked ? ' (secret masked)' : ''}`);\n const diff = renderDiff(artifact.before, artifact.after);\n for (const line of diff.split('\\n')) {\n this.log(` ${line}`);\n }\n }\n }\n\n private async runInteractive(ctx: SetupContext): Promise<void> {\n if (!process.stdin.isTTY) {\n this.log('Not a TTY \u2014 interactive walk needs a terminal.');\n this.log('Use one of:');\n this.log(' rulemetric setup plan \u2014 see every remaining artifact + diff');\n this.log(' rulemetric setup <step> --show \u2014 print one step diff');\n this.log(' rulemetric setup <step> --apply \u2014 apply one step');\n this.log(' rulemetric setup --json \u2014 machine-readable status');\n return;\n }\n\n const status = await computeStatus(ctx);\n const remaining = STEPS.filter(\n (s) => !status.steps.find((st) => st.id === s.id)?.done,\n );\n if (remaining.length === 0) {\n this.log('[OK] All core steps complete.');\n return;\n }\n\n const rl = readline.createInterface({ input: process.stdin, output: process.stdout });\n try {\n for (const step of remaining) {\n const plan = await step.plan(ctx);\n this.printPlan(plan);\n const answer = (await rl.question(`Apply \"${plan.title}\"? [y/N] `)).trim().toLowerCase();\n if (answer === 'y' || answer === 'yes') {\n await step.apply(ctx);\n this.log(`[OK] Applied ${plan.title}.`);\n } else {\n this.log(`[..] Skipped ${plan.title}.`);\n }\n this.log('');\n }\n } finally {\n rl.close();\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,aAAa;AAC5B,YAAY,cAAc;AAc1B,IAAqB,QAArB,MAAqB,eAAc,YAAY;AAAA,EAC7C,OAAgB,cACd;AAAA,EAEF,OAAgB,WAAW;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EAEA,OAAgB,OAAO;AAAA,IACrB,QAAQ,KAAK,OAAO;AAAA,MAClB,aAAa,wBAAwB,cAAc,KAAK,IAAI,CAAC;AAAA,MAC7D,UAAU;AAAA,IACZ,CAAC;AAAA,EACH;AAAA,EAEA,OAAgB,QAAQ;AAAA,IACtB,MAAM,MAAM,QAAQ,EAAE,aAAa,2BAA2B,SAAS,MAAM,CAAC;AAAA,IAC9E,MAAM,MAAM,QAAQ,EAAE,aAAa,mCAAmC,SAAS,MAAM,CAAC;AAAA,IACtF,OAAO,MAAM,QAAQ,EAAE,aAAa,kBAAkB,SAAS,MAAM,CAAC;AAAA,EACxE;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,EAAE,MAAM,MAAM,IAAI,MAAM,KAAK,MAAM,MAAK;AAC9C,UAAM,MAAM,eAAe;AAE3B,QAAI,KAAK,WAAW,QAAQ;AAC1B,YAAM,KAAK,QAAQ,KAAK,MAAM,IAA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AAM,GAAG;AACpB,eAAK,IAAI,gBAAgB,KAAK,KAAK,GAAG;AAAA,QACxC,OAAO;AACL,eAAK,IAAI,gBAAgB,KAAK,KAAK,GAAG;AAAA,QACxC;AACA,aAAK,IAAI,EAAE;AAAA,MACb;AAAA,IACF,UAAE;AACA,SAAG,MAAM;AAAA,IACX;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from "../../chunk-OQSQC7VB.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-7DIWBTB5.js";
|
|
7
|
+
import "../../chunk-R56PH7YE.js";
|
|
8
8
|
import "../../chunk-2AM54TUK.js";
|
|
9
9
|
import {
|
|
10
10
|
apiPost
|