harnessed 4.15.0 → 4.15.1
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/cli.mjs +269 -47
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, mkdirSync, renameSync, writeFileSync, readFileSync, readdirSync } from 'fs';
|
|
2
|
+
import { existsSync, mkdirSync, renameSync, writeFileSync, readFileSync, readdirSync, statSync } from 'fs';
|
|
3
3
|
import { homedir } from 'os';
|
|
4
4
|
import { join, dirname, resolve, sep, relative } from 'path';
|
|
5
5
|
import { Type } from '@sinclair/typebox';
|
|
@@ -38,7 +38,7 @@ var init_package = __esm({
|
|
|
38
38
|
"package.json"() {
|
|
39
39
|
package_default = {
|
|
40
40
|
name: "harnessed",
|
|
41
|
-
version: "4.15.
|
|
41
|
+
version: "4.15.1",
|
|
42
42
|
description: "AI coding harness package manager + composition orchestrator",
|
|
43
43
|
type: "module",
|
|
44
44
|
license: "Apache-2.0",
|
|
@@ -4411,6 +4411,86 @@ var init_breakLoop = __esm({
|
|
|
4411
4411
|
LOOP_THRESHOLD = 3;
|
|
4412
4412
|
}
|
|
4413
4413
|
});
|
|
4414
|
+
function realWhere(name) {
|
|
4415
|
+
try {
|
|
4416
|
+
if (typeof spawnSync !== "function") return [];
|
|
4417
|
+
const r = spawnSync("where", [name], { encoding: "utf8" });
|
|
4418
|
+
if (!r || r.status !== 0) return [];
|
|
4419
|
+
return (r.stdout ?? "").split(/\r?\n/).map((s) => s.trim()).filter((s) => s.length > 0);
|
|
4420
|
+
} catch {
|
|
4421
|
+
return [];
|
|
4422
|
+
}
|
|
4423
|
+
}
|
|
4424
|
+
function realExists(p6) {
|
|
4425
|
+
try {
|
|
4426
|
+
return existsSync(p6);
|
|
4427
|
+
} catch {
|
|
4428
|
+
return false;
|
|
4429
|
+
}
|
|
4430
|
+
}
|
|
4431
|
+
function defaultDeps() {
|
|
4432
|
+
return {
|
|
4433
|
+
platform: process.platform,
|
|
4434
|
+
env: process.env,
|
|
4435
|
+
where: realWhere,
|
|
4436
|
+
exists: realExists
|
|
4437
|
+
};
|
|
4438
|
+
}
|
|
4439
|
+
function resolveBash(deps) {
|
|
4440
|
+
if (cache2) return cache2;
|
|
4441
|
+
cache2 = compute({ ...defaultDeps(), ...deps });
|
|
4442
|
+
return cache2;
|
|
4443
|
+
}
|
|
4444
|
+
function compute(d) {
|
|
4445
|
+
if (d.platform !== "win32") {
|
|
4446
|
+
return { path: null, source: "path", reason: "not-applicable" };
|
|
4447
|
+
}
|
|
4448
|
+
const envBash = d.env.HARNESSED_BASH;
|
|
4449
|
+
if (envBash && envBash.trim().length > 0) {
|
|
4450
|
+
return { path: envBash.trim(), source: "env" };
|
|
4451
|
+
}
|
|
4452
|
+
const pathLines = d.where("bash");
|
|
4453
|
+
const first = pathLines[0];
|
|
4454
|
+
const wslOnPath = first && WSL_STUB_RE.test(first) ? first : void 0;
|
|
4455
|
+
if (first && !WSL_STUB_RE.test(first)) {
|
|
4456
|
+
return { path: first, source: "path" };
|
|
4457
|
+
}
|
|
4458
|
+
const gitFirst = d.where("git")[0];
|
|
4459
|
+
if (gitFirst && /git\.exe$/i.test(gitFirst)) {
|
|
4460
|
+
const root = dirname(dirname(gitFirst));
|
|
4461
|
+
for (const cand of [join(root, "bin", "bash.exe"), join(root, "usr", "bin", "bash.exe")]) {
|
|
4462
|
+
if (d.exists(cand)) return { path: cand, source: "git-derived", wslOnPath };
|
|
4463
|
+
}
|
|
4464
|
+
}
|
|
4465
|
+
const bases = [
|
|
4466
|
+
d.env.ProgramFiles,
|
|
4467
|
+
d.env.ProgramW6432,
|
|
4468
|
+
d.env["ProgramFiles(x86)"],
|
|
4469
|
+
d.env.LOCALAPPDATA ? join(d.env.LOCALAPPDATA, "Programs") : void 0
|
|
4470
|
+
];
|
|
4471
|
+
for (const base of bases) {
|
|
4472
|
+
if (!base) continue;
|
|
4473
|
+
for (const cand of [
|
|
4474
|
+
join(base, "Git", "bin", "bash.exe"),
|
|
4475
|
+
join(base, "Git", "usr", "bin", "bash.exe")
|
|
4476
|
+
]) {
|
|
4477
|
+
if (d.exists(cand)) return { path: cand, source: "standard-location", wslOnPath };
|
|
4478
|
+
}
|
|
4479
|
+
}
|
|
4480
|
+
const laterNonWsl = pathLines.find((l) => !WSL_STUB_RE.test(l));
|
|
4481
|
+
if (laterNonWsl) return { path: laterNonWsl, source: "path", wslOnPath };
|
|
4482
|
+
if (pathLines.length > 0) {
|
|
4483
|
+
return { path: null, source: "path", reason: "wsl-only", wslOnPath: first };
|
|
4484
|
+
}
|
|
4485
|
+
return { path: "bash", source: "path-fallback" };
|
|
4486
|
+
}
|
|
4487
|
+
var WSL_STUB_RE, cache2;
|
|
4488
|
+
var init_resolveBash = __esm({
|
|
4489
|
+
"src/installers/lib/resolveBash.ts"() {
|
|
4490
|
+
WSL_STUB_RE = /[\\/]windows[\\/](system32|sysnative|syswow64)[\\/]bash\.exe$/i;
|
|
4491
|
+
cache2 = null;
|
|
4492
|
+
}
|
|
4493
|
+
});
|
|
4414
4494
|
function checkNodeVersion() {
|
|
4415
4495
|
const v = process.versions.node;
|
|
4416
4496
|
const major = Number.parseInt(v.split(".")[0] ?? "0", 10);
|
|
@@ -4424,7 +4504,7 @@ function checkNodeVersion() {
|
|
|
4424
4504
|
async function checkMcpScope() {
|
|
4425
4505
|
if (detectPlatform().id !== "claude") {
|
|
4426
4506
|
return {
|
|
4427
|
-
name: "mcp scope
|
|
4507
|
+
name: "mcp scope",
|
|
4428
4508
|
status: "pass",
|
|
4429
4509
|
message: "skipped (claude-only check)"
|
|
4430
4510
|
};
|
|
@@ -4437,25 +4517,23 @@ async function checkMcpScope() {
|
|
|
4437
4517
|
projectExists = true;
|
|
4438
4518
|
} catch {
|
|
4439
4519
|
}
|
|
4440
|
-
let
|
|
4520
|
+
let userCount = 0;
|
|
4441
4521
|
try {
|
|
4442
4522
|
const raw = await readFile(userClaude, "utf8");
|
|
4443
4523
|
const parsed = JSON.parse(raw);
|
|
4444
|
-
|
|
4524
|
+
userCount = parsed.mcpServers ? Object.keys(parsed.mcpServers).length : 0;
|
|
4445
4525
|
} catch {
|
|
4446
4526
|
}
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
};
|
|
4454
|
-
}
|
|
4527
|
+
const parts = [];
|
|
4528
|
+
if (userCount > 0)
|
|
4529
|
+
parts.push(
|
|
4530
|
+
`${userCount} user-scope server(s) (~/.claude.json \u2014 harnessed default since v3.0.2)`
|
|
4531
|
+
);
|
|
4532
|
+
if (projectExists) parts.push("project .mcp.json present");
|
|
4455
4533
|
return {
|
|
4456
|
-
name: "mcp scope
|
|
4534
|
+
name: "mcp scope",
|
|
4457
4535
|
status: "pass",
|
|
4458
|
-
message:
|
|
4536
|
+
message: parts.length > 0 ? parts.join("; ") : "no MCP servers installed"
|
|
4459
4537
|
};
|
|
4460
4538
|
}
|
|
4461
4539
|
function checkJq() {
|
|
@@ -4471,13 +4549,25 @@ function checkJq() {
|
|
|
4471
4549
|
const fix = process.platform === "win32" ? "winget install jqlang.jq (or: scoop install jq)" : process.platform === "darwin" ? "brew install jq" : "apt-get install jq (or: dnf install jq)";
|
|
4472
4550
|
return { name: "jq present", status: "fail", message: "jq not found in PATH", fix };
|
|
4473
4551
|
}
|
|
4552
|
+
function sanitizeToolOutput(raw, cap = 60) {
|
|
4553
|
+
const first = raw.split(/\r?\n/)[0] ?? "";
|
|
4554
|
+
const printable = first.replace(/[^\x20-\x7E]/g, "").trim();
|
|
4555
|
+
return printable.length > 0 ? printable.slice(0, cap) : "(unreadable output)";
|
|
4556
|
+
}
|
|
4474
4557
|
function checkWinBash() {
|
|
4475
4558
|
if (process.platform !== "win32") {
|
|
4476
4559
|
return { name: "bash flavor (win)", status: "pass", message: "skipped (non-Windows)" };
|
|
4477
4560
|
}
|
|
4478
|
-
const
|
|
4479
|
-
|
|
4480
|
-
|
|
4561
|
+
const r = resolveBash();
|
|
4562
|
+
if (r.path === null) {
|
|
4563
|
+
return {
|
|
4564
|
+
name: "bash flavor (win)",
|
|
4565
|
+
status: "fail",
|
|
4566
|
+
message: `only the WSL stub is on PATH (${sanitizeToolOutput(r.wslOnPath ?? "")}) \u2014 harnessed verify/install cmds cannot run`,
|
|
4567
|
+
fix: "install Git for Windows (https://git-scm.com/download/win), reorder PATH so Git Bash precedes WSL bash.exe, or set HARNESSED_BASH to a Git Bash path"
|
|
4568
|
+
};
|
|
4569
|
+
}
|
|
4570
|
+
if (r.source === "path-fallback") {
|
|
4481
4571
|
return {
|
|
4482
4572
|
name: "bash flavor (win)",
|
|
4483
4573
|
status: "fail",
|
|
@@ -4485,21 +4575,24 @@ function checkWinBash() {
|
|
|
4485
4575
|
fix: "install Git for Windows (Git Bash) and ensure it is on PATH"
|
|
4486
4576
|
};
|
|
4487
4577
|
}
|
|
4488
|
-
|
|
4489
|
-
const distro = (probe.stdout ?? "").trim();
|
|
4490
|
-
if (distro.length > 0) {
|
|
4578
|
+
if (r.wslOnPath) {
|
|
4491
4579
|
return {
|
|
4492
4580
|
name: "bash flavor (win)",
|
|
4493
|
-
status: "
|
|
4494
|
-
message: `
|
|
4581
|
+
status: "warn",
|
|
4582
|
+
message: `PATH-first bash is the WSL stub (${sanitizeToolOutput(r.wslOnPath)}); harnessed resolved Git Bash at ${r.path} \u2014 but OTHER tools (e.g. ralph-loop plugin forks) may still hit WSL`,
|
|
4495
4583
|
fix: "reorder PATH so Git Bash precedes WSL bash.exe (Settings \u2192 System \u2192 Environment Variables)"
|
|
4496
4584
|
};
|
|
4497
4585
|
}
|
|
4498
|
-
return {
|
|
4586
|
+
return {
|
|
4587
|
+
name: "bash flavor (win)",
|
|
4588
|
+
status: "pass",
|
|
4589
|
+
message: `${r.path} (Git Bash / native, via ${r.source})`
|
|
4590
|
+
};
|
|
4499
4591
|
}
|
|
4500
4592
|
var init_check_builtin = __esm({
|
|
4501
4593
|
"src/cli/lib/check-builtin.ts"() {
|
|
4502
4594
|
init_platform();
|
|
4595
|
+
init_resolveBash();
|
|
4503
4596
|
}
|
|
4504
4597
|
});
|
|
4505
4598
|
|
|
@@ -4513,7 +4606,23 @@ function probeOne(cmd) {
|
|
|
4513
4606
|
const r = spawnSync(finder, [cmd], { encoding: "utf8" });
|
|
4514
4607
|
return r.status === 0 && (r.stdout?.trim().length ?? 0) > 0;
|
|
4515
4608
|
}
|
|
4516
|
-
function
|
|
4609
|
+
function gstackSkillsDirInstalled(exists) {
|
|
4610
|
+
for (const dir of harnessSkillsDirs()) {
|
|
4611
|
+
const root = join(dir, "gstack");
|
|
4612
|
+
if (exists(join(root, "office-hours", "SKILL.md")) || exists(join(root, "skills", "office-hours.md"))) {
|
|
4613
|
+
return root;
|
|
4614
|
+
}
|
|
4615
|
+
}
|
|
4616
|
+
return null;
|
|
4617
|
+
}
|
|
4618
|
+
function probeGstackPrefix(deps) {
|
|
4619
|
+
const exists = deps?.exists ?? ((p6) => {
|
|
4620
|
+
try {
|
|
4621
|
+
return existsSync(p6);
|
|
4622
|
+
} catch {
|
|
4623
|
+
return false;
|
|
4624
|
+
}
|
|
4625
|
+
});
|
|
4517
4626
|
const hasGstack = probeOne("gstack-office-hours");
|
|
4518
4627
|
const hasBare = probeOne("office-hours");
|
|
4519
4628
|
if (hasGstack && !hasBare) {
|
|
@@ -4529,14 +4638,23 @@ function probeGstackPrefix() {
|
|
|
4529
4638
|
fix: `edit .harnessed/config.json manually: '{"gstack_prefix":"gstack-"}' OR '{"gstack_prefix":""}'`
|
|
4530
4639
|
};
|
|
4531
4640
|
}
|
|
4641
|
+
const skillsRoot = gstackSkillsDirInstalled(exists);
|
|
4642
|
+
if (skillsRoot !== null) {
|
|
4643
|
+
return {
|
|
4644
|
+
status: "pass",
|
|
4645
|
+
prefix: "",
|
|
4646
|
+
detail: `gstack skills dir found (${skillsRoot})`
|
|
4647
|
+
};
|
|
4648
|
+
}
|
|
4532
4649
|
return {
|
|
4533
4650
|
status: "fail",
|
|
4534
|
-
detail: "neither gstack-office-hours nor office-hours found in PATH",
|
|
4535
|
-
fix: "install gstack: `
|
|
4651
|
+
detail: "neither gstack-office-hours nor office-hours found in PATH, and no gstack skills dir",
|
|
4652
|
+
fix: "install gstack: run `harnessed setup` (git-clones gstack into ~/.claude/skills/gstack) \u2014 see https://github.com/garrytan/gstack"
|
|
4536
4653
|
};
|
|
4537
4654
|
}
|
|
4538
4655
|
var init_probe_gstack = __esm({
|
|
4539
4656
|
"src/cli/lib/probe-gstack.ts"() {
|
|
4657
|
+
init_platform();
|
|
4540
4658
|
}
|
|
4541
4659
|
});
|
|
4542
4660
|
var AliasEntryV1, AliasesV1;
|
|
@@ -5465,6 +5583,56 @@ var init_ccHookAdd2 = __esm({
|
|
|
5465
5583
|
};
|
|
5466
5584
|
}
|
|
5467
5585
|
});
|
|
5586
|
+
function evalClause(clause, home) {
|
|
5587
|
+
const m = clause.match(CLAUSE_RE);
|
|
5588
|
+
if (!m?.[1] || !m[2]) return null;
|
|
5589
|
+
const flag = m[1];
|
|
5590
|
+
let p6 = m[2];
|
|
5591
|
+
if (UNSAFE_PATH_RE.test(p6)) return null;
|
|
5592
|
+
if (p6 === "~") p6 = home;
|
|
5593
|
+
else if (p6.startsWith("~/")) p6 = `${home}/${p6.slice(2)}`;
|
|
5594
|
+
else if (p6.startsWith("~")) return null;
|
|
5595
|
+
try {
|
|
5596
|
+
const st = statSync(p6);
|
|
5597
|
+
if (flag === "f") return st.isFile();
|
|
5598
|
+
if (flag === "d") return st.isDirectory();
|
|
5599
|
+
return true;
|
|
5600
|
+
} catch {
|
|
5601
|
+
return false;
|
|
5602
|
+
}
|
|
5603
|
+
}
|
|
5604
|
+
function evalTestChain(cmd, home = homedir()) {
|
|
5605
|
+
const trimmed = cmd.trim();
|
|
5606
|
+
if (trimmed.length === 0 || !trimmed.startsWith("test ")) return null;
|
|
5607
|
+
const parts = trimmed.split(/\s*(\|\||&&)\s*/);
|
|
5608
|
+
if (parts.length % 2 === 0) return null;
|
|
5609
|
+
let acc = null;
|
|
5610
|
+
let pendingOp = null;
|
|
5611
|
+
for (let i = 0; i < parts.length; i++) {
|
|
5612
|
+
const part = parts[i] ?? "";
|
|
5613
|
+
if (i % 2 === 1) {
|
|
5614
|
+
pendingOp = part;
|
|
5615
|
+
continue;
|
|
5616
|
+
}
|
|
5617
|
+
const v = evalClause(part, home);
|
|
5618
|
+
if (v === null) return null;
|
|
5619
|
+
if (acc === null) {
|
|
5620
|
+
acc = v;
|
|
5621
|
+
} else if (pendingOp === "||") {
|
|
5622
|
+
acc = acc || v;
|
|
5623
|
+
} else {
|
|
5624
|
+
acc = acc && v;
|
|
5625
|
+
}
|
|
5626
|
+
}
|
|
5627
|
+
return acc;
|
|
5628
|
+
}
|
|
5629
|
+
var CLAUSE_RE, UNSAFE_PATH_RE;
|
|
5630
|
+
var init_nativeTest = __esm({
|
|
5631
|
+
"src/installers/lib/nativeTest.ts"() {
|
|
5632
|
+
CLAUSE_RE = /^test\s+-(f|d|e)\s+(\S+)$/;
|
|
5633
|
+
UNSAFE_PATH_RE = /[|&;<>()*?"'`$={}[\]]/;
|
|
5634
|
+
}
|
|
5635
|
+
});
|
|
5468
5636
|
function expandTildeForWindows(cmd) {
|
|
5469
5637
|
const home = homedir().replace(/\\/g, "/");
|
|
5470
5638
|
return cmd.replace(/(^|[\s"'`(])~\//g, `$1${home}/`);
|
|
@@ -5485,6 +5653,11 @@ async function spawnCmd(ctx, cmd, args, timeoutMs, opts) {
|
|
|
5485
5653
|
}
|
|
5486
5654
|
};
|
|
5487
5655
|
}
|
|
5656
|
+
const joinedCmd = args.length > 0 ? `${cmd} ${args.join(" ")}` : cmd;
|
|
5657
|
+
const nativeResult = evalTestChain(joinedCmd);
|
|
5658
|
+
if (nativeResult !== null) {
|
|
5659
|
+
return { ok: true, exitCode: nativeResult ? 0 : 1, stdout: "", stderr: "" };
|
|
5660
|
+
}
|
|
5488
5661
|
const installCfg = ctx.manifest.spec.install;
|
|
5489
5662
|
const effectiveTimeoutMs = timeoutMs ?? DEFAULT_INSTALL_TIMEOUT_MS;
|
|
5490
5663
|
const env = { ...process.env, ...installCfg.env ?? {} };
|
|
@@ -5494,9 +5667,23 @@ async function spawnCmd(ctx, cmd, args, timeoutMs, opts) {
|
|
|
5494
5667
|
const stdio = ["ignore", "pipe", "pipe"];
|
|
5495
5668
|
if (process.platform === "win32") {
|
|
5496
5669
|
if (opts?.posixShell) {
|
|
5497
|
-
const
|
|
5670
|
+
const bash = resolveBash();
|
|
5671
|
+
if (bash.path === null) {
|
|
5672
|
+
return {
|
|
5673
|
+
ok: false,
|
|
5674
|
+
phase: "spawn",
|
|
5675
|
+
error: {
|
|
5676
|
+
file: ctx.manifest.metadata.name,
|
|
5677
|
+
path: "/spec/install/cmd",
|
|
5678
|
+
message: `the only \`bash\` on PATH is the WSL stub (${bash.wslOnPath ?? "C:\\Windows\\System32\\bash.exe"}) \u2014 it cannot run harnessed verify/install commands (WSL '~' is the Linux home, and distro-less stubs exit 1). Install Git for Windows (https://git-scm.com/download/win), reorder PATH so Git Bash precedes WSL bash.exe, or set HARNESSED_BASH to a Git Bash path, then re-run \`harnessed setup\`.`,
|
|
5679
|
+
line: null,
|
|
5680
|
+
column: null,
|
|
5681
|
+
keyword: "bash-missing"
|
|
5682
|
+
}
|
|
5683
|
+
};
|
|
5684
|
+
}
|
|
5498
5685
|
triedBash = true;
|
|
5499
|
-
child = spawn(
|
|
5686
|
+
child = spawn(bash.path, ["-c", joinedCmd], { cwd, env, windowsHide: true, stdio });
|
|
5500
5687
|
} else {
|
|
5501
5688
|
const expandedCmd = expandTildeForWindows(cmd);
|
|
5502
5689
|
const expandedArgs = args.map(expandTildeForWindows);
|
|
@@ -5508,8 +5695,7 @@ async function spawnCmd(ctx, cmd, args, timeoutMs, opts) {
|
|
|
5508
5695
|
});
|
|
5509
5696
|
}
|
|
5510
5697
|
} else {
|
|
5511
|
-
|
|
5512
|
-
child = spawn("/bin/sh", ["-c", joined], { cwd, env, stdio });
|
|
5698
|
+
child = spawn("/bin/sh", ["-c", joinedCmd], { cwd, env, stdio });
|
|
5513
5699
|
}
|
|
5514
5700
|
let stdout2 = "";
|
|
5515
5701
|
let stderr = "";
|
|
@@ -5528,7 +5714,10 @@ async function spawnCmd(ctx, cmd, args, timeoutMs, opts) {
|
|
|
5528
5714
|
error: {
|
|
5529
5715
|
file: ctx.manifest.metadata.name,
|
|
5530
5716
|
path: "/spec/install/cmd",
|
|
5531
|
-
|
|
5717
|
+
// v4.15.1 — fall back to stdout when stderr is empty (WSL stubs and
|
|
5718
|
+
// some CLIs write their error text to stdout; a bare trailing colon
|
|
5719
|
+
// read as "no reason" in user dogfood).
|
|
5720
|
+
message: `spawn timed out after ${effectiveTimeoutMs}ms (cmd: ${cmd}); partial output: ${(stderr || stdout2).slice(0, 200) || "(no output)"}`,
|
|
5532
5721
|
line: null,
|
|
5533
5722
|
column: null,
|
|
5534
5723
|
keyword: "spawn-timeout"
|
|
@@ -5561,6 +5750,8 @@ var DEFAULT_VERIFY_TIMEOUT_MS, DEFAULT_INSTALL_TIMEOUT_MS;
|
|
|
5561
5750
|
var init_spawn = __esm({
|
|
5562
5751
|
"src/installers/lib/spawn.ts"() {
|
|
5563
5752
|
init_security();
|
|
5753
|
+
init_nativeTest();
|
|
5754
|
+
init_resolveBash();
|
|
5564
5755
|
DEFAULT_VERIFY_TIMEOUT_MS = 15e3;
|
|
5565
5756
|
DEFAULT_INSTALL_TIMEOUT_MS = 3e5;
|
|
5566
5757
|
}
|
|
@@ -5916,6 +6107,17 @@ ${newEntry}
|
|
|
5916
6107
|
};
|
|
5917
6108
|
}
|
|
5918
6109
|
});
|
|
6110
|
+
|
|
6111
|
+
// src/installers/lib/verifyMessage.ts
|
|
6112
|
+
function formatVerifyFail(cmd, exitCode, expected, stdout2, stderr) {
|
|
6113
|
+
const cmdPart = cmd.length > 80 ? `${cmd.slice(0, 80)}\u2026` : cmd;
|
|
6114
|
+
const tail = stderr.trim().slice(0, 160) || stdout2.trim().slice(0, 160) || "(no output)";
|
|
6115
|
+
return `verify failed (exit ${exitCode} \u2260 expected ${expected}): \`${cmdPart}\` \u2014 ${tail}`;
|
|
6116
|
+
}
|
|
6117
|
+
var init_verifyMessage = __esm({
|
|
6118
|
+
"src/installers/lib/verifyMessage.ts"() {
|
|
6119
|
+
}
|
|
6120
|
+
});
|
|
5919
6121
|
function gitRevParseHead(cwd, timeoutMs = 1e4) {
|
|
5920
6122
|
return new Promise((resolve17) => {
|
|
5921
6123
|
const isWin = process.platform === "win32";
|
|
@@ -5975,6 +6177,7 @@ var init_gitCloneWithSetup2 = __esm({
|
|
|
5975
6177
|
init_preflight();
|
|
5976
6178
|
init_spawn();
|
|
5977
6179
|
init_state2();
|
|
6180
|
+
init_verifyMessage();
|
|
5978
6181
|
installGitCloneWithSetup = async (ctx) => {
|
|
5979
6182
|
const install = ctx.manifest.spec.install;
|
|
5980
6183
|
if (install.method !== "git-clone-with-setup") {
|
|
@@ -6108,7 +6311,8 @@ var init_gitCloneWithSetup2 = __esm({
|
|
|
6108
6311
|
error: err(
|
|
6109
6312
|
ctx,
|
|
6110
6313
|
"/spec/verify/cmd",
|
|
6111
|
-
|
|
6314
|
+
// v4.15.1 — unified verify-fail format (cmd + output tail; no dangling colon).
|
|
6315
|
+
formatVerifyFail(ctx.manifest.spec.verify.cmd, vr.exitCode, expected, vr.stdout, vr.stderr),
|
|
6112
6316
|
"verify-failed"
|
|
6113
6317
|
)
|
|
6114
6318
|
};
|
|
@@ -6487,6 +6691,7 @@ var init_npmCli2 = __esm({
|
|
|
6487
6691
|
init_preflight();
|
|
6488
6692
|
init_spawn();
|
|
6489
6693
|
init_state2();
|
|
6694
|
+
init_verifyMessage();
|
|
6490
6695
|
installNpmCli = async (ctx) => {
|
|
6491
6696
|
const install = ctx.manifest.spec.install;
|
|
6492
6697
|
if (install.method !== "npm-cli") {
|
|
@@ -6514,9 +6719,11 @@ var init_npmCli2 = __esm({
|
|
|
6514
6719
|
let level = detectLevel(install.cmd);
|
|
6515
6720
|
let cmd = install.cmd;
|
|
6516
6721
|
const plan = { files: [] };
|
|
6517
|
-
if (!ctx.opts.quiet)
|
|
6518
|
-
|
|
6519
|
-
|
|
6722
|
+
if (!ctx.opts.quiet) {
|
|
6723
|
+
process.stdout.write(renderDiff(plan, ctx));
|
|
6724
|
+
if (level === "L4")
|
|
6725
|
+
process.stdout.write(" (L4 system install \u2014 global PATH change; see cmd above)\n");
|
|
6726
|
+
}
|
|
6520
6727
|
const conf = await confirmAt(level, { ...ctx});
|
|
6521
6728
|
if (!conf.proceed) {
|
|
6522
6729
|
if (level === "L4" && conf.reason === "flag-missing" && !ctx.opts.nonInteractive) {
|
|
@@ -6572,7 +6779,8 @@ var init_npmCli2 = __esm({
|
|
|
6572
6779
|
error: err(
|
|
6573
6780
|
ctx,
|
|
6574
6781
|
"/spec/verify/cmd",
|
|
6575
|
-
|
|
6782
|
+
// v4.15.1 — unified verify-fail format (cmd + output tail; no dangling colon).
|
|
6783
|
+
formatVerifyFail(ctx.manifest.spec.verify.cmd, vr.exitCode, expected, vr.stdout, vr.stderr),
|
|
6576
6784
|
"verify-failed"
|
|
6577
6785
|
)
|
|
6578
6786
|
};
|
|
@@ -6594,6 +6802,7 @@ var init_npxSkillInstaller2 = __esm({
|
|
|
6594
6802
|
init_preflight();
|
|
6595
6803
|
init_spawn();
|
|
6596
6804
|
init_state2();
|
|
6805
|
+
init_verifyMessage();
|
|
6597
6806
|
installNpxSkillInstaller = async (ctx) => {
|
|
6598
6807
|
const install = ctx.manifest.spec.install;
|
|
6599
6808
|
if (install.method !== "npx-skill-installer") {
|
|
@@ -6711,7 +6920,8 @@ var init_npxSkillInstaller2 = __esm({
|
|
|
6711
6920
|
error: err(
|
|
6712
6921
|
ctx,
|
|
6713
6922
|
"/spec/verify/cmd",
|
|
6714
|
-
|
|
6923
|
+
// v4.15.1 — unified verify-fail format (cmd + output tail; no dangling colon).
|
|
6924
|
+
formatVerifyFail(ctx.manifest.spec.verify.cmd, vr.exitCode, expected, vr.stdout, vr.stderr),
|
|
6715
6925
|
"verify-failed"
|
|
6716
6926
|
)
|
|
6717
6927
|
};
|
|
@@ -6965,7 +7175,7 @@ var release_preflight_exports = {};
|
|
|
6965
7175
|
__export(release_preflight_exports, {
|
|
6966
7176
|
anyFailed: () => anyFailed,
|
|
6967
7177
|
collectPreflight: () => collectPreflight,
|
|
6968
|
-
defaultDeps: () =>
|
|
7178
|
+
defaultDeps: () => defaultDeps2
|
|
6969
7179
|
});
|
|
6970
7180
|
function unreleasedSection(changelog) {
|
|
6971
7181
|
const start = changelog.indexOf("## [Unreleased]");
|
|
@@ -7020,7 +7230,7 @@ function collectPreflight(deps) {
|
|
|
7020
7230
|
function anyFailed(checks) {
|
|
7021
7231
|
return checks.some((c) => c.status === "fail");
|
|
7022
7232
|
}
|
|
7023
|
-
function
|
|
7233
|
+
function defaultDeps2(cwd) {
|
|
7024
7234
|
let changelog = "";
|
|
7025
7235
|
let version = "";
|
|
7026
7236
|
try {
|
|
@@ -8686,8 +8896,8 @@ function registerReleasePreflight(program2) {
|
|
|
8686
8896
|
program2.command("release-preflight").description(
|
|
8687
8897
|
"Read-only release-readiness gate (CHANGELOG / version / git-clean / tag). Exits 1 if not ready."
|
|
8688
8898
|
).action(async () => {
|
|
8689
|
-
const { collectPreflight: collectPreflight2, anyFailed: anyFailed2, defaultDeps:
|
|
8690
|
-
const checks = collectPreflight2(
|
|
8899
|
+
const { collectPreflight: collectPreflight2, anyFailed: anyFailed2, defaultDeps: defaultDeps3 } = await Promise.resolve().then(() => (init_release_preflight(), release_preflight_exports));
|
|
8900
|
+
const checks = collectPreflight2(defaultDeps3(process.cwd()));
|
|
8691
8901
|
console.log("\n release preflight (read-only \u2014 nothing is pushed/published):\n");
|
|
8692
8902
|
for (const c of checks) {
|
|
8693
8903
|
const mark = c.status === "pass" ? "\u2713" : c.status === "warn" ? "\u26A0" : "\u2717";
|
|
@@ -9583,13 +9793,17 @@ function printGrouped(b, prefix = "") {
|
|
|
9583
9793
|
console.log(`
|
|
9584
9794
|
${prefix}${GROUP_LABELS[g] ?? g} (${entries.length})`);
|
|
9585
9795
|
const nameW = Math.max(...entries.map((e) => e.name.length), "component".length);
|
|
9586
|
-
|
|
9587
|
-
for (const e of entries) {
|
|
9796
|
+
const rows = entries.map((e) => {
|
|
9588
9797
|
const note2 = e.note && e.note.length > NOTE_MAX ? `${e.note.slice(0, NOTE_MAX)}\u2026` : e.note;
|
|
9589
9798
|
const line = ` ${GLYPHS[e.status] ?? " "} ${e.status.padEnd(18)} ${e.name.padEnd(nameW)}${note2 ? ` ${note2}` : ""}`;
|
|
9590
|
-
|
|
9591
|
-
|
|
9592
|
-
|
|
9799
|
+
return { status: e.status, line };
|
|
9800
|
+
});
|
|
9801
|
+
const sepW = Math.max(...rows.map((r) => r.line.length)) - 4;
|
|
9802
|
+
console.log(` ${"\u2014".repeat(sepW)}`);
|
|
9803
|
+
for (const r of rows) {
|
|
9804
|
+
if (r.status === "failed") console.error(r.line);
|
|
9805
|
+
else if (r.status === "kept-existing") console.warn(r.line);
|
|
9806
|
+
else console.log(r.line);
|
|
9593
9807
|
}
|
|
9594
9808
|
}
|
|
9595
9809
|
}
|
|
@@ -9727,6 +9941,8 @@ installing ${manifestPaths.length} upstream components (MCP serialized, rest par
|
|
|
9727
9941
|
initialValue: false
|
|
9728
9942
|
});
|
|
9729
9943
|
if (!isCancel6(ans) && ans === true) {
|
|
9944
|
+
console.log(`
|
|
9945
|
+
force-updating ${b.alreadyInstalled.length} plugin(s)...`);
|
|
9730
9946
|
const b2 = await runStepBInstall(manifestPaths, {
|
|
9731
9947
|
updateInstalled: true,
|
|
9732
9948
|
quiet: true,
|
|
@@ -9758,6 +9974,12 @@ Force-update pass complete: ${b2.installed.length} installed / ${b2.keptExisting
|
|
|
9758
9974
|
await runL4Rescue2(manifestPaths, b.skipped);
|
|
9759
9975
|
}
|
|
9760
9976
|
}
|
|
9977
|
+
if (b.failed.length > 0) {
|
|
9978
|
+
console.error(
|
|
9979
|
+
`
|
|
9980
|
+
${b.failed.length} component(s) failed \u2014 see the notes in the tables above; re-run \`harnessed setup\` to retry, or run \`harnessed doctor\` for environment diagnostics.`
|
|
9981
|
+
);
|
|
9982
|
+
}
|
|
9761
9983
|
console.log(
|
|
9762
9984
|
t("setup.complete", {
|
|
9763
9985
|
skills: skillsInstalled,
|