@przeprogramowani/10x-cli 1.18.0 → 1.19.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/index.mjs +41 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10173,7 +10173,7 @@ var cac = (name = "") => new CAC(name);
|
|
|
10173
10173
|
// package.json
|
|
10174
10174
|
var package_default = {
|
|
10175
10175
|
name: "@przeprogramowani/10x-cli",
|
|
10176
|
-
version: "1.
|
|
10176
|
+
version: "1.19.0",
|
|
10177
10177
|
description: "Open-source CLI for 10xDevs course content",
|
|
10178
10178
|
repository: {
|
|
10179
10179
|
type: "git",
|
|
@@ -11448,6 +11448,7 @@ function topDetectedProfile(signals) {
|
|
|
11448
11448
|
var TEMPLATE_REPO_URL = "https://github.com/przeprogramowani/10x-bench-kit";
|
|
11449
11449
|
var SHARED_ROOT_FILES = ["AGENTS.md"];
|
|
11450
11450
|
var PLACEHOLDER_BASE_REPO = "demo-app";
|
|
11451
|
+
var BASE_REPOS_DIR = ".repos";
|
|
11451
11452
|
function registerBenchKitCommand(cli) {
|
|
11452
11453
|
cli.command("bench-kit <action> [dir]", "Manage a benchmark instance (actions: init, update)").option("--template-version <tag>", "Template tag to install (default: latest)").option("--tool <id>", `Agent tool for skill placement (${Object.keys(PROFILES).join(", ")})`).option("--yes", "Run non-interactively, accepting defaults").example("10x bench-kit init my-benchmark").example("10x bench-kit init my-benchmark --template-version v0.1.0").example("10x bench-kit update").action(async (action, dir, options) => {
|
|
11453
11454
|
const ctx = resolveContext(options);
|
|
@@ -11516,6 +11517,21 @@ async function runBenchKitInit(ctx, dirArg, options, deps = defaultDeps) {
|
|
|
11516
11517
|
}
|
|
11517
11518
|
}
|
|
11518
11519
|
}
|
|
11520
|
+
let baseRepoClone = "skipped";
|
|
11521
|
+
if (baseRepo !== null) {
|
|
11522
|
+
ensureIgnored(targetDir, `${BASE_REPOS_DIR}/`);
|
|
11523
|
+
const cloneDest = join4(targetDir, BASE_REPOS_DIR, baseRepo.name);
|
|
11524
|
+
verbose(ctx, `cloning base repo into ${BASE_REPOS_DIR}/${baseRepo.name}`);
|
|
11525
|
+
const cloned = await deps.cloneBaseRepo(baseRepo, cloneDest);
|
|
11526
|
+
if (cloned.ok) {
|
|
11527
|
+
baseRepoClone = "cloned";
|
|
11528
|
+
} else {
|
|
11529
|
+
baseRepoClone = "failed";
|
|
11530
|
+
rmSync3(cloneDest, { recursive: true, force: true });
|
|
11531
|
+
verbose(ctx, `base repo clone failed (${cloned.error.trim().split(`
|
|
11532
|
+
`).pop() ?? ""})`);
|
|
11533
|
+
}
|
|
11534
|
+
}
|
|
11519
11535
|
const runnerDeps = await installRunnerDependencies(ctx, deps, targetDir);
|
|
11520
11536
|
const manifest = {
|
|
11521
11537
|
templateVersion,
|
|
@@ -11540,6 +11556,11 @@ async function runBenchKitInit(ctx, dirArg, options, deps = defaultDeps) {
|
|
|
11540
11556
|
`Agent skills installed for ${toolName} under ${skillRootFor(toolId)}/.`,
|
|
11541
11557
|
baseRepo === null ? "No product repo detected here — add your base repos to bench.config.yaml." : `Registered '${baseRepo.name}' (${baseRepo.url}) as the first base repo in bench.config.yaml.`,
|
|
11542
11558
|
...demoTasksPinned > 0 ? [`Pinned the demo task to ${baseRepo?.headCommit.slice(0, 12)} (current HEAD of the base repo).`] : [],
|
|
11559
|
+
...baseRepoClone === "cloned" ? [
|
|
11560
|
+
`Cloned '${baseRepo?.name}' into ${BASE_REPOS_DIR}/${baseRepo?.name}/ — local working copy for the authoring skills (gitignored).`
|
|
11561
|
+
] : baseRepoClone === "failed" ? [
|
|
11562
|
+
`Base repo clone failed — run 'git clone ${baseRepo?.url} ${BASE_REPOS_DIR}/${baseRepo?.name}' yourself.`
|
|
11563
|
+
] : [],
|
|
11543
11564
|
...runnerDeps === "failed" ? ["Runner dependencies did not install — run 'npm ci --prefix .bench-kit/runner' yourself."] : runnerDeps === "installed" ? ["Runner dependencies installed (.bench-kit/runner/node_modules)."] : [],
|
|
11544
11565
|
committed ? "Initialized a fresh git repository with an initial commit." : "Initialized a fresh git repository (initial commit skipped — commit the files yourself).",
|
|
11545
11566
|
"Next: wire up secrets, then run 'bench validate' before the first run."
|
|
@@ -11554,6 +11575,7 @@ async function runBenchKitInit(ctx, dirArg, options, deps = defaultDeps) {
|
|
|
11554
11575
|
skillRoot: skillRootFor(toolId),
|
|
11555
11576
|
filesCopied: copied + skills.added,
|
|
11556
11577
|
baseRepo,
|
|
11578
|
+
baseRepoClone,
|
|
11557
11579
|
demoTasksPinned,
|
|
11558
11580
|
runnerDeps,
|
|
11559
11581
|
gitInitialized: !repair,
|
|
@@ -11843,6 +11865,18 @@ function toHttpsUrl(url) {
|
|
|
11843
11865
|
return `https://${ssh[1]}/${ssh[2]}`;
|
|
11844
11866
|
return null;
|
|
11845
11867
|
}
|
|
11868
|
+
function ensureIgnored(dir, entry) {
|
|
11869
|
+
const file = join4(dir, ".gitignore");
|
|
11870
|
+
const current = existsSync4(file) ? readFileSync3(file, "utf8") : "";
|
|
11871
|
+
if (current.split(`
|
|
11872
|
+
`).some((line) => line.trim() === entry))
|
|
11873
|
+
return;
|
|
11874
|
+
const prefix = current === "" || current.endsWith(`
|
|
11875
|
+
`) ? current : `${current}
|
|
11876
|
+
`;
|
|
11877
|
+
writeFileSync3(file, `${prefix}${entry}
|
|
11878
|
+
`);
|
|
11879
|
+
}
|
|
11846
11880
|
var PLACEHOLDER_COMMIT = /^0{40}$/;
|
|
11847
11881
|
async function pinPlaceholderTasks(tasksDir, repo) {
|
|
11848
11882
|
if (!existsSync4(tasksDir) || !/^[0-9a-f]{40}$/.test(repo.headCommit))
|
|
@@ -11947,6 +11981,12 @@ var defaultDeps = {
|
|
|
11947
11981
|
return null;
|
|
11948
11982
|
return { rootDir, name: basename(rootDir), url, headCommit };
|
|
11949
11983
|
},
|
|
11984
|
+
async cloneBaseRepo(repo, destDir) {
|
|
11985
|
+
const clone = await run("git", ["clone", "--quiet", repo.rootDir, destDir]);
|
|
11986
|
+
if (!clone.ok)
|
|
11987
|
+
return { ok: false, error: clone.error };
|
|
11988
|
+
return run("git", ["-C", destDir, "remote", "set-url", "origin", repo.url]);
|
|
11989
|
+
},
|
|
11950
11990
|
async remoteReachable(url) {
|
|
11951
11991
|
const result = await run("git", ["ls-remote", "--heads", url], undefined, {
|
|
11952
11992
|
GIT_TERMINAL_PROMPT: "0"
|