harnessed 4.32.2 → 4.32.4
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 +98 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/manifests/skill-packs/gsd.yaml +10 -7
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { existsSync, mkdirSync, renameSync, writeFileSync, readFileSync, readdirSync, realpathSync, mkdtempSync, utimesSync, rmSync, statSync } from 'fs';
|
|
3
3
|
import { homedir, tmpdir } from 'os';
|
|
4
|
-
import { join, resolve, dirname, basename, sep, isAbsolute, win32, relative } from 'path';
|
|
4
|
+
import { join, resolve, dirname, basename, sep, isAbsolute, win32, posix, relative } from 'path';
|
|
5
5
|
import { Type } from '@sinclair/typebox';
|
|
6
6
|
import { readFile, readdir, unlink, writeFile, stat, rm, cp, mkdir, access, rename, appendFile, copyFile, chmod } from 'fs/promises';
|
|
7
7
|
import { Value } from '@sinclair/typebox/value';
|
|
@@ -38,7 +38,7 @@ var init_package = __esm({
|
|
|
38
38
|
"package.json"() {
|
|
39
39
|
package_default = {
|
|
40
40
|
name: "harnessed",
|
|
41
|
-
version: "4.32.
|
|
41
|
+
version: "4.32.4",
|
|
42
42
|
description: "AI coding harness package manager + composition orchestrator",
|
|
43
43
|
type: "module",
|
|
44
44
|
license: "Apache-2.0",
|
|
@@ -6843,6 +6843,92 @@ var init_check_update = __esm({
|
|
|
6843
6843
|
}
|
|
6844
6844
|
});
|
|
6845
6845
|
|
|
6846
|
+
// src/cli/lib/check-install-channels.ts
|
|
6847
|
+
var check_install_channels_exports = {};
|
|
6848
|
+
__export(check_install_channels_exports, {
|
|
6849
|
+
checkInstallChannels: () => checkInstallChannels,
|
|
6850
|
+
detectInstallChannels: () => detectInstallChannels,
|
|
6851
|
+
dualChannelLines: () => dualChannelLines
|
|
6852
|
+
});
|
|
6853
|
+
function joinFor(platform) {
|
|
6854
|
+
return platform === "win32" ? win32.join : posix.join;
|
|
6855
|
+
}
|
|
6856
|
+
function realNpmPrefix() {
|
|
6857
|
+
try {
|
|
6858
|
+
if (typeof spawnSync !== "function") return null;
|
|
6859
|
+
const r = spawnSync("npm", ["prefix", "-g"], { encoding: "utf8", timeout: 5e3 });
|
|
6860
|
+
if (!r || r.error || r.status !== 0) return null;
|
|
6861
|
+
const out = (r.stdout ?? "").trim();
|
|
6862
|
+
return out.length > 0 ? out : null;
|
|
6863
|
+
} catch {
|
|
6864
|
+
return null;
|
|
6865
|
+
}
|
|
6866
|
+
}
|
|
6867
|
+
function binaryCandidate(platform, home, env) {
|
|
6868
|
+
const j = joinFor(platform);
|
|
6869
|
+
if (platform === "win32") {
|
|
6870
|
+
const local = env.LOCALAPPDATA ?? j(home, "AppData", "Local");
|
|
6871
|
+
return j(local, "harnessed", "bin", "harnessed.exe");
|
|
6872
|
+
}
|
|
6873
|
+
return j(home, ".local", "bin", "harnessed");
|
|
6874
|
+
}
|
|
6875
|
+
function npmCandidate(platform, prefix) {
|
|
6876
|
+
const j = joinFor(platform);
|
|
6877
|
+
return platform === "win32" ? j(prefix, "harnessed.cmd") : j(prefix, "bin", "harnessed");
|
|
6878
|
+
}
|
|
6879
|
+
function detectInstallChannels(deps) {
|
|
6880
|
+
const platform = deps?.platform ?? process.platform;
|
|
6881
|
+
const home = deps?.home ?? homedir();
|
|
6882
|
+
const env = deps?.env ?? process.env;
|
|
6883
|
+
const execPath = deps?.execPath ?? process.execPath;
|
|
6884
|
+
const exists = deps?.exists ?? existsSync;
|
|
6885
|
+
const npmPrefix = deps?.npmPrefix ?? realNpmPrefix;
|
|
6886
|
+
const running = deps?.running ?? (isCompiledRuntime() ? "binary" : "npm");
|
|
6887
|
+
const binCand = binaryCandidate(platform, home, env);
|
|
6888
|
+
const binaryPresent = running === "binary" || exists(binCand);
|
|
6889
|
+
const binaryPath = running === "binary" ? execPath : binaryPresent ? binCand : null;
|
|
6890
|
+
const prefix = npmPrefix();
|
|
6891
|
+
const npmCand = prefix ? npmCandidate(platform, prefix) : null;
|
|
6892
|
+
const npmPresent = running === "npm" || npmCand != null && exists(npmCand);
|
|
6893
|
+
const npmPath = npmCand != null && exists(npmCand) ? npmCand : null;
|
|
6894
|
+
return { binaryPath, npmPath, running, both: binaryPresent && npmPresent };
|
|
6895
|
+
}
|
|
6896
|
+
function dualChannelLines(r) {
|
|
6897
|
+
if (!r.both) return [];
|
|
6898
|
+
const bin = r.binaryPath ?? "the standalone binary";
|
|
6899
|
+
const npm = r.npmPath ?? "the npm-global package";
|
|
6900
|
+
return [
|
|
6901
|
+
"both harnessed install channels are present \u2014 a bare `harnessed` uses whichever",
|
|
6902
|
+
"is earlier on PATH, and updating one leaves the other stale:",
|
|
6903
|
+
` binary: ${bin}`,
|
|
6904
|
+
` npm: ${npm}`,
|
|
6905
|
+
`you are running the ${r.running} one. pick a single channel:`,
|
|
6906
|
+
" keep npm \u2192 update with `npm install -g harnessed@latest`; delete the binary + remove its bin dir from PATH",
|
|
6907
|
+
" keep binary \u2192 update with `harnessed update`; then `npm uninstall -g harnessed`"
|
|
6908
|
+
];
|
|
6909
|
+
}
|
|
6910
|
+
function checkInstallChannels(deps) {
|
|
6911
|
+
const r = detectInstallChannels(deps);
|
|
6912
|
+
if (!r.both) {
|
|
6913
|
+
return {
|
|
6914
|
+
name: "install channel",
|
|
6915
|
+
status: "pass",
|
|
6916
|
+
message: `single channel (${r.running})`
|
|
6917
|
+
};
|
|
6918
|
+
}
|
|
6919
|
+
return {
|
|
6920
|
+
name: "install channel",
|
|
6921
|
+
status: "warn",
|
|
6922
|
+
message: `both npm-global and standalone-binary harnessed are installed (running the ${r.running} one) \u2014 updating one leaves the other stale`,
|
|
6923
|
+
fix: `pick one: keep npm \u2192 'npm install -g harnessed@latest' + delete ${r.binaryPath ?? "the binary"} (and remove its bin dir from PATH); or keep binary \u2192 'harnessed update' + 'npm uninstall -g harnessed'`
|
|
6924
|
+
};
|
|
6925
|
+
}
|
|
6926
|
+
var init_check_install_channels = __esm({
|
|
6927
|
+
"src/cli/lib/check-install-channels.ts"() {
|
|
6928
|
+
init_assetsRoot();
|
|
6929
|
+
}
|
|
6930
|
+
});
|
|
6931
|
+
|
|
6846
6932
|
// src/cli/lib/doctor-registry.ts
|
|
6847
6933
|
var CHECKS;
|
|
6848
6934
|
var init_doctor_registry = __esm({
|
|
@@ -6883,7 +6969,10 @@ var init_doctor_registry = __esm({
|
|
|
6883
6969
|
async () => (await Promise.resolve().then(() => (init_check_skill_integrity(), check_skill_integrity_exports))).checkSkillIntegrity(),
|
|
6884
6970
|
// Phase 20 — "update available" version check ('warn' only when behind; 'pass'
|
|
6885
6971
|
// when current/ahead/npm-unreachable — fail-soft, never flips the summary).
|
|
6886
|
-
async () => (await Promise.resolve().then(() => (init_check_update(), check_update_exports))).checkUpdate()
|
|
6972
|
+
async () => (await Promise.resolve().then(() => (init_check_update(), check_update_exports))).checkUpdate(),
|
|
6973
|
+
// 4.32.4 — dual install-channel conflict (warn-only): npm-global + standalone
|
|
6974
|
+
// binary both present → ambiguous PATH resolution + stale-update trap.
|
|
6975
|
+
async () => (await Promise.resolve().then(() => (init_check_install_channels(), check_install_channels_exports))).checkInstallChannels()
|
|
6887
6976
|
];
|
|
6888
6977
|
}
|
|
6889
6978
|
});
|
|
@@ -13201,6 +13290,12 @@ ${b.failed.length} component(s) failed \u2014 see the notes in the tables above;
|
|
|
13201
13290
|
console.log(t("setup.bundled_summary"));
|
|
13202
13291
|
console.log(t("setup.bundled_location"));
|
|
13203
13292
|
console.log(t("setup.doctor_hint"));
|
|
13293
|
+
const { detectInstallChannels: detectInstallChannels2, dualChannelLines: dualChannelLines2 } = await Promise.resolve().then(() => (init_check_install_channels(), check_install_channels_exports));
|
|
13294
|
+
const channels = detectInstallChannels2();
|
|
13295
|
+
if (channels.both) {
|
|
13296
|
+
console.log("");
|
|
13297
|
+
for (const line of dualChannelLines2(channels)) console.log(line);
|
|
13298
|
+
}
|
|
13204
13299
|
if (!dryRun) {
|
|
13205
13300
|
const isTty = process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
13206
13301
|
const { runAutoInstall: runAutoInstall2 } = await Promise.resolve().then(() => (init_auto_install(), auto_install_exports));
|