harnessed 4.16.0 → 4.16.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 +132 -5
- 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
|
@@ -38,7 +38,7 @@ var init_package = __esm({
|
|
|
38
38
|
"package.json"() {
|
|
39
39
|
package_default = {
|
|
40
40
|
name: "harnessed",
|
|
41
|
-
version: "4.16.
|
|
41
|
+
version: "4.16.1",
|
|
42
42
|
description: "AI coding harness package manager + composition orchestrator",
|
|
43
43
|
type: "module",
|
|
44
44
|
license: "Apache-2.0",
|
|
@@ -4512,15 +4512,26 @@ function sanitizeOutputTail(raw, cap = 160) {
|
|
|
4512
4512
|
const printable = firstNonEmpty.replace(/[^\x20-\x7E]/g, "").trim();
|
|
4513
4513
|
return printable.length > 0 ? printable.slice(0, cap) : "(unreadable output)";
|
|
4514
4514
|
}
|
|
4515
|
+
function sanitizeOutputTailEnd(raw, cap = 300) {
|
|
4516
|
+
const lines = raw.split(/\r?\n/).map((l) => l.replace(/[^\x20-\x7E]/g, "").trim()).filter((l) => l.length > 0);
|
|
4517
|
+
if (lines.length === 0) return "(unreadable output)";
|
|
4518
|
+
let out = "";
|
|
4519
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
4520
|
+
const cand = out ? `${lines[i]} | ${out}` : lines[i];
|
|
4521
|
+
if (cand.length > cap) break;
|
|
4522
|
+
out = cand;
|
|
4523
|
+
}
|
|
4524
|
+
return out || `${lines[lines.length - 1].slice(0, cap)}\u2026`;
|
|
4525
|
+
}
|
|
4515
4526
|
function formatSpawnFail(label, exitCode, stdout2, stderr) {
|
|
4516
4527
|
const rawTail = stderr.trim() || stdout2.trim();
|
|
4517
|
-
const tail = rawTail.length > 0 ?
|
|
4528
|
+
const tail = rawTail.length > 0 ? sanitizeOutputTailEnd(rawTail, 300) : "(no output)";
|
|
4518
4529
|
return `${label} exited ${exitCode}: ${tail}`;
|
|
4519
4530
|
}
|
|
4520
4531
|
function formatVerifyFail(cmd, exitCode, expected, stdout2, stderr) {
|
|
4521
4532
|
const cmdPart = cmd.length > 80 ? `${cmd.slice(0, 80)}\u2026` : cmd;
|
|
4522
4533
|
const rawTail = stderr.trim() || stdout2.trim();
|
|
4523
|
-
const tail = rawTail.length > 0 ?
|
|
4534
|
+
const tail = rawTail.length > 0 ? sanitizeOutputTailEnd(rawTail, 160) : "(no output)";
|
|
4524
4535
|
return `verify failed (exit ${exitCode} \u2260 expected ${expected}): \`${cmdPart}\` \u2014 ${tail}`;
|
|
4525
4536
|
}
|
|
4526
4537
|
var init_verifyMessage = __esm({
|
|
@@ -5196,6 +5207,62 @@ var init_check_codegraph = __esm({
|
|
|
5196
5207
|
}
|
|
5197
5208
|
});
|
|
5198
5209
|
|
|
5210
|
+
// src/cli/lib/check-bun.ts
|
|
5211
|
+
var check_bun_exports = {};
|
|
5212
|
+
__export(check_bun_exports, {
|
|
5213
|
+
checkBun: () => checkBun
|
|
5214
|
+
});
|
|
5215
|
+
function realRun(finder) {
|
|
5216
|
+
try {
|
|
5217
|
+
if (typeof spawnSync !== "function") return null;
|
|
5218
|
+
const r = spawnSync(finder, ["bun"], { encoding: "utf8" });
|
|
5219
|
+
if (!r || r.error) return null;
|
|
5220
|
+
return { status: r.status, stdout: r.stdout ?? "" };
|
|
5221
|
+
} catch {
|
|
5222
|
+
return null;
|
|
5223
|
+
}
|
|
5224
|
+
}
|
|
5225
|
+
function checkBun(deps) {
|
|
5226
|
+
const platform = deps?.platform ?? process.platform;
|
|
5227
|
+
const run = deps?.run ?? realRun;
|
|
5228
|
+
const finder = platform === "win32" ? "where" : "which";
|
|
5229
|
+
const r = run(finder);
|
|
5230
|
+
if (r && r.status === 0 && r.stdout.trim().length > 0) {
|
|
5231
|
+
return {
|
|
5232
|
+
name: "bun present",
|
|
5233
|
+
status: "pass",
|
|
5234
|
+
message: r.stdout.split(/\r?\n/)[0]?.trim() ?? "bun found"
|
|
5235
|
+
};
|
|
5236
|
+
}
|
|
5237
|
+
const missing = {
|
|
5238
|
+
name: "bun present",
|
|
5239
|
+
status: "warn",
|
|
5240
|
+
message: "bun not found in PATH \u2014 gstack setup builds its browse binary with bun (gstack refresh will fail without it)"
|
|
5241
|
+
};
|
|
5242
|
+
if (platform === "win32") {
|
|
5243
|
+
return {
|
|
5244
|
+
...missing,
|
|
5245
|
+
fix: "winget install Oven-sh.Bun",
|
|
5246
|
+
install_commands: ["winget install Oven-sh.Bun"]
|
|
5247
|
+
};
|
|
5248
|
+
}
|
|
5249
|
+
if (platform === "darwin") {
|
|
5250
|
+
return {
|
|
5251
|
+
...missing,
|
|
5252
|
+
fix: "brew install oven-sh/bun/bun",
|
|
5253
|
+
install_commands: ["brew install oven-sh/bun/bun"]
|
|
5254
|
+
};
|
|
5255
|
+
}
|
|
5256
|
+
return {
|
|
5257
|
+
...missing,
|
|
5258
|
+
fix: "see https://bun.sh/docs/installation (curl -fsSL https://bun.sh/install | bash \u2014 review the script first)"
|
|
5259
|
+
};
|
|
5260
|
+
}
|
|
5261
|
+
var init_check_bun = __esm({
|
|
5262
|
+
"src/cli/lib/check-bun.ts"() {
|
|
5263
|
+
}
|
|
5264
|
+
});
|
|
5265
|
+
|
|
5199
5266
|
// src/cli/lib/version-check.ts
|
|
5200
5267
|
var version_check_exports = {};
|
|
5201
5268
|
__export(version_check_exports, {
|
|
@@ -5303,6 +5370,9 @@ var init_doctor_registry = __esm({
|
|
|
5303
5370
|
// Phase 18 — opt-in CodeGraph semantic-index detect (always 'pass'; absence of an
|
|
5304
5371
|
// optional tool is not a health failure).
|
|
5305
5372
|
async () => (await Promise.resolve().then(() => (init_check_codegraph(), check_codegraph_exports))).checkCodeGraph(process.cwd()),
|
|
5373
|
+
// v4.16.1 T3 — bun presence (warn-only): gstack's upstream setup hard-requires
|
|
5374
|
+
// bun; missing bun is THE gstack refresh-failure cause on user dogfood machines.
|
|
5375
|
+
async () => (await Promise.resolve().then(() => (init_check_bun(), check_bun_exports))).checkBun(),
|
|
5306
5376
|
// Phase 20 — "update available" version check ('warn' only when behind; 'pass'
|
|
5307
5377
|
// when current/ahead/npm-unreachable — fail-soft, never flips the summary).
|
|
5308
5378
|
async () => (await Promise.resolve().then(() => (init_check_update(), check_update_exports))).checkUpdate()
|
|
@@ -5625,6 +5695,57 @@ var init_ccHookAdd2 = __esm({
|
|
|
5625
5695
|
};
|
|
5626
5696
|
}
|
|
5627
5697
|
});
|
|
5698
|
+
function extractVerifyBinary(verifyCmd, fallback) {
|
|
5699
|
+
const token = verifyCmd?.trim().split(/\s+/)[0];
|
|
5700
|
+
if (token && BARE_BIN_RE.test(token) && !NON_COMPONENT_TOKENS.has(token)) return token;
|
|
5701
|
+
if (BARE_BIN_RE.test(fallback) && !NON_COMPONENT_TOKENS.has(fallback)) return fallback;
|
|
5702
|
+
return null;
|
|
5703
|
+
}
|
|
5704
|
+
function realRun2(finder, bin) {
|
|
5705
|
+
try {
|
|
5706
|
+
if (typeof spawnSync !== "function") return null;
|
|
5707
|
+
const r = spawnSync(finder, [bin], { encoding: "utf8" });
|
|
5708
|
+
if (!r || r.error) return null;
|
|
5709
|
+
return { status: r.status, stdout: r.stdout ?? "" };
|
|
5710
|
+
} catch {
|
|
5711
|
+
return null;
|
|
5712
|
+
}
|
|
5713
|
+
}
|
|
5714
|
+
function binaryOnPath(bin, deps) {
|
|
5715
|
+
const platform = process.platform;
|
|
5716
|
+
const run = realRun2;
|
|
5717
|
+
const finder = platform === "win32" ? "where" : "which";
|
|
5718
|
+
const r = run(finder, bin);
|
|
5719
|
+
if (!r || r.status !== 0) return false;
|
|
5720
|
+
return r.stdout.trim().length > 0;
|
|
5721
|
+
}
|
|
5722
|
+
var NON_COMPONENT_TOKENS, BARE_BIN_RE;
|
|
5723
|
+
var init_binaryProbe = __esm({
|
|
5724
|
+
"src/installers/lib/binaryProbe.ts"() {
|
|
5725
|
+
NON_COMPONENT_TOKENS = /* @__PURE__ */ new Set([
|
|
5726
|
+
"test",
|
|
5727
|
+
"grep",
|
|
5728
|
+
"ls",
|
|
5729
|
+
"cat",
|
|
5730
|
+
"echo",
|
|
5731
|
+
"command",
|
|
5732
|
+
"sh",
|
|
5733
|
+
"bash",
|
|
5734
|
+
"[",
|
|
5735
|
+
"npx",
|
|
5736
|
+
"npm",
|
|
5737
|
+
"node",
|
|
5738
|
+
"corepack",
|
|
5739
|
+
"pnpm",
|
|
5740
|
+
"yarn",
|
|
5741
|
+
"bun",
|
|
5742
|
+
"git",
|
|
5743
|
+
"claude",
|
|
5744
|
+
"codex"
|
|
5745
|
+
]);
|
|
5746
|
+
BARE_BIN_RE = /^[A-Za-z0-9][\w.@-]*$/;
|
|
5747
|
+
}
|
|
5748
|
+
});
|
|
5628
5749
|
function evalClause(clause, home) {
|
|
5629
5750
|
const m = clause.match(CLAUSE_RE);
|
|
5630
5751
|
if (!m?.[1] || !m[2]) return null;
|
|
@@ -5765,7 +5886,8 @@ async function spawnCmd(ctx, cmd, args, timeoutMs, opts) {
|
|
|
5765
5886
|
// some CLIs write their error text to stdout; a bare trailing colon
|
|
5766
5887
|
// read as "no reason" in user dogfood). v4.15.2 — sanitized (CP936
|
|
5767
5888
|
// mojibake was embedded verbatim in the ctx7 dogfood error).
|
|
5768
|
-
|
|
5889
|
+
// v4.16.1 T2 — tail-END biased (errors live at the end of output).
|
|
5890
|
+
message: `spawn timed out after ${effectiveTimeoutMs}ms (cmd: ${cmd}); partial output: ${(stderr || stdout2).trim() ? sanitizeOutputTailEnd(stderr || stdout2, 200) : "(no output)"}`,
|
|
5769
5891
|
line: null,
|
|
5770
5892
|
column: null,
|
|
5771
5893
|
keyword: "spawn-timeout"
|
|
@@ -5921,6 +6043,8 @@ async function detectNative(ctx) {
|
|
|
5921
6043
|
}
|
|
5922
6044
|
}
|
|
5923
6045
|
if (method === "npm-cli") {
|
|
6046
|
+
const bin = extractVerifyBinary(ctx.manifest.spec.verify?.cmd, name);
|
|
6047
|
+
if (bin && binaryOnPath(bin)) return true;
|
|
5924
6048
|
const skillDir = join(getSkillsDir(), name);
|
|
5925
6049
|
try {
|
|
5926
6050
|
await access(skillDir);
|
|
@@ -5955,6 +6079,7 @@ async function isAlreadyInstalled(ctx, opts = {}) {
|
|
|
5955
6079
|
var IDEMPOTENT_CHECK_TIMEOUT_MS, INSTALLED_INDICATORS;
|
|
5956
6080
|
var init_idempotent = __esm({
|
|
5957
6081
|
"src/installers/lib/idempotent.ts"() {
|
|
6082
|
+
init_binaryProbe();
|
|
5958
6083
|
init_platform();
|
|
5959
6084
|
init_readClaudeConfig();
|
|
5960
6085
|
init_spawn();
|
|
@@ -9882,7 +10007,9 @@ function printGrouped(b, prefix = "") {
|
|
|
9882
10007
|
else console.log(r.line);
|
|
9883
10008
|
}
|
|
9884
10009
|
for (const e of entries) {
|
|
9885
|
-
if (!e.full
|
|
10010
|
+
if (!e.full) continue;
|
|
10011
|
+
const shownNote = (e.note ?? "").slice(0, NOTE_MAX);
|
|
10012
|
+
if (shownNote.includes(e.full)) continue;
|
|
9886
10013
|
const full = e.full.length > 400 ? `${e.full.slice(0, 400)}\u2026` : e.full;
|
|
9887
10014
|
const line = ` \u21B3 ${e.name}: ${full}`;
|
|
9888
10015
|
if (e.status === "failed") console.error(line);
|