harnessed 5.0.14 → 5.0.15
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/CHANGELOG.md +14 -0
- package/bin/harnessed-update-reminder-worker.mjs +1 -1
- package/bin/harnessed-update-reminder.mjs +1 -1
- package/dist/cli.mjs +167 -32
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/schemas/index.mjs +3 -0
- package/dist/schemas/index.mjs.map +1 -1
- package/manifests/skill-packs/design-taste-frontend.yaml +9 -0
- package/manifests/skill-packs/gsd.yaml +10 -3
- package/manifests/tools/playwright-test.yaml +8 -0
- package/manifests/tools/webapp-testing.yaml +8 -0
- package/package.json +1 -1
- package/schemas/manifest.v1.schema.json +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [5.0.15] - 2026-11-09
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- `harnessed setup` can now update the components it installed, instead of refusing every one of them. Since v5.0.0 the force-update pass refused to replace anything whose existing source it could not prove: a skill pack, a marketplace plugin or a cloned checkout was kept exactly as it was, and the summary then told the user to re-run setup later — advice that could never work, because the same proof would fail again. The refusal itself was right; what was missing was the other half, a way to prove ownership. A skill pack now refreshes when its manifest declares the footprint it owns and every existing entry in that footprint passes the manifest's own marker check; a marketplace plugin refreshes when the host's plugin registry holds it under the exact qualified identity the install command installs (`name@marketplace`), which is the same source the official `claude plugin install` upgrades from; a cloned component refreshes when the checkout's git origin is the URL the manifest clones from. Everything that does not prove out is still refused: an undeclared source, a look-alike directory carrying somebody else's marker, a plugin registered under a different marketplace, a checkout whose origin points elsewhere, a pack whose declaration does not cover every skill it claims to install.
|
|
13
|
+
- A force update no longer fails on the ownership receipt it writes itself. The receipt records the paths an install created, so a refresh — which creates nothing new — had nothing to record, and the install failed on its own empty receipt. An authorized refresh now records the footprint it just proved, which is what it owns.
|
|
14
|
+
- The GSD pack's ownership declaration now matches what the pack actually ships. Its marker demanded the literal text `gsd-core` from every skill, agent and command it owns, and nine of its own skills plus four of its own agents never contain that text — so the declaration proved nothing and the pack was refused exactly like an undeclared one. The marker is now the artifact's own `gsd-` identity, which every file the declaration admits carries on both hosts.
|
|
15
|
+
- The update summary no longer promises a retry that cannot succeed. A component kept because its source is not provably ours is now reported as such, with the upstream tool named as the way to update it; the "re-run setup later" hint is kept only for the failures a retry can actually fix.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Global npm tools (`ctx7`, `playwright-cli`) now take part in the force-update pass. They were excluded from it because a global npm install is a system-scope change and the system-scope gate asked for a flag the force pass never passes — so those two tools could never be updated by harnessed at all. The force pass is an explicit request to update the components that are already installed, and `npm install -g <pkg>` is the official upgrade path of a globally installed CLI: it writes into the npm global prefix, which is scoped per package name rather than a shared namespace. The force pass therefore runs that command for those components, and the confirmation prompt names them and the scope change before it starts. A tool the force pass upgraded is not offered a second time by the L4 rescue. The normal install pass is unchanged — installing a global tool still needs the explicit system-scope opt-in, and the documented `harnessed setup --system --non-interactive --update-installed` path still works as before.
|
|
20
|
+
- The manifest ownership contract learned a fifth root. A skill the `skills` CLI installs without `--global` lives in `~/.agents/skills` and is linked into the host's skills directory, and the link was deliberately invisible to the ownership check, because a link can point anywhere. The ownership roots now include `agents-skills`, so a manifest can declare the real files of such a pack; the `design-taste-frontend` pack does exactly that.
|
|
21
|
+
|
|
8
22
|
## [5.0.14] - 2026-11-09
|
|
9
23
|
|
|
10
24
|
### Fixed
|
|
@@ -65,7 +65,7 @@ var init_package = __esm({
|
|
|
65
65
|
'package.json'() {
|
|
66
66
|
package_default = {
|
|
67
67
|
name: 'harnessed',
|
|
68
|
-
version: '5.0.
|
|
68
|
+
version: '5.0.15',
|
|
69
69
|
description: 'AI coding harness package manager + composition orchestrator',
|
|
70
70
|
type: 'module',
|
|
71
71
|
license: 'Apache-2.0',
|
|
@@ -14,7 +14,7 @@ var init_package = __esm({
|
|
|
14
14
|
'package.json'() {
|
|
15
15
|
package_default = {
|
|
16
16
|
name: 'harnessed',
|
|
17
|
-
version: '5.0.
|
|
17
|
+
version: '5.0.15',
|
|
18
18
|
description: 'AI coding harness package manager + composition orchestrator',
|
|
19
19
|
type: 'module',
|
|
20
20
|
license: 'Apache-2.0',
|
package/dist/cli.mjs
CHANGED
|
@@ -42,7 +42,7 @@ var init_package = __esm({
|
|
|
42
42
|
"package.json"() {
|
|
43
43
|
package_default = {
|
|
44
44
|
name: "harnessed",
|
|
45
|
-
version: "5.0.
|
|
45
|
+
version: "5.0.15",
|
|
46
46
|
description: "AI coding harness package manager + composition orchestrator",
|
|
47
47
|
type: "module",
|
|
48
48
|
license: "Apache-2.0",
|
|
@@ -2799,6 +2799,9 @@ var init_spec = __esm({
|
|
|
2799
2799
|
);
|
|
2800
2800
|
OwnershipRoot = Type.Union([
|
|
2801
2801
|
Type.Literal("platform-skills"),
|
|
2802
|
+
// Phase 85 — the `skills` CLI installs into ~/.agents/skills by default and
|
|
2803
|
+
// links it into the host skills dir; the real files live here.
|
|
2804
|
+
Type.Literal("agents-skills"),
|
|
2802
2805
|
Type.Literal("native-home"),
|
|
2803
2806
|
Type.Literal("host-agents"),
|
|
2804
2807
|
Type.Literal("host-commands")
|
|
@@ -16914,7 +16917,10 @@ var init_ccPluginMarketplace2 = __esm({
|
|
|
16914
16917
|
const selectedPlugin = ctx.hostContext ? parseCmd(install.cmd)?.pluginAtMkt : void 0;
|
|
16915
16918
|
const existingPlugin = ctx.hostContext && selectedPlugin ? await isPluginRegistered(selectedPlugin.split("@")[0] ?? selectedPlugin, ctx.hostContext) : false;
|
|
16916
16919
|
const conflictingPlugin = ctx.hostContext && selectedPlugin && existingPlugin ? !await isPluginRegistered(selectedPlugin, ctx.hostContext) : false;
|
|
16917
|
-
|
|
16920
|
+
const qualifiedProven = Boolean(
|
|
16921
|
+
ctx.hostContext && existingPlugin && selectedPlugin && await isPluginRegistered(selectedPlugin, ctx.hostContext)
|
|
16922
|
+
);
|
|
16923
|
+
if (conflictingPlugin || ctx.hostContext && ctx.opts.updateInstalled && !qualifiedProven && (existingPlugin || await isAlreadyInstalled(ctx, { honorUpdateFlag: false }))) {
|
|
16918
16924
|
return {
|
|
16919
16925
|
ok: false,
|
|
16920
16926
|
phase: "preflight",
|
|
@@ -16929,7 +16935,7 @@ var init_ccPluginMarketplace2 = __esm({
|
|
|
16929
16935
|
}
|
|
16930
16936
|
};
|
|
16931
16937
|
}
|
|
16932
|
-
if (existingPlugin || await isAlreadyInstalled(ctx)) {
|
|
16938
|
+
if (existingPlugin && !(ctx.opts.updateInstalled && qualifiedProven) || await isAlreadyInstalled(ctx)) {
|
|
16933
16939
|
if (ctx.hostContext) {
|
|
16934
16940
|
const parsed2 = parseCmd(install.cmd);
|
|
16935
16941
|
if (!parsed2)
|
|
@@ -17891,6 +17897,52 @@ function unprovenCloneTarget(ctx) {
|
|
|
17891
17897
|
}
|
|
17892
17898
|
};
|
|
17893
17899
|
}
|
|
17900
|
+
function normalizeGitUrl(url) {
|
|
17901
|
+
return url.replace(/\/+$/, "").replace(/\.git$/, "");
|
|
17902
|
+
}
|
|
17903
|
+
function extractCloneUrl(cmd) {
|
|
17904
|
+
const m = cmd.match(/\bgit\s+clone\s+((?:-{1,2}[\w-]+(?:\s+\S+)?\s+)*)(\S+)/);
|
|
17905
|
+
return m?.[2] ?? null;
|
|
17906
|
+
}
|
|
17907
|
+
function externalWriteTargets(cmd, destRaw) {
|
|
17908
|
+
const dest = destRaw.replace(/\/+$/, "");
|
|
17909
|
+
const inside = (target) => {
|
|
17910
|
+
const normalized2 = target.replace(/\/+$/, "");
|
|
17911
|
+
return normalized2 === dest || normalized2.startsWith(`${dest}/`);
|
|
17912
|
+
};
|
|
17913
|
+
const out = [];
|
|
17914
|
+
for (const segment of cmd.split(/\s*(?:&&|\|\||;|\|)\s*/)) {
|
|
17915
|
+
const tokens = segment.split(/\s+/).filter(Boolean);
|
|
17916
|
+
for (let index = 0; index < tokens.length; index++) {
|
|
17917
|
+
const token2 = tokens[index];
|
|
17918
|
+
if (token2 === "rm") {
|
|
17919
|
+
let next = index + 1;
|
|
17920
|
+
while (next < tokens.length && tokens[next].startsWith("-")) next++;
|
|
17921
|
+
const target = tokens[next];
|
|
17922
|
+
if (target && !inside(target)) out.push(target);
|
|
17923
|
+
index = next;
|
|
17924
|
+
continue;
|
|
17925
|
+
}
|
|
17926
|
+
if (token2 === "cp" || token2 === "mv" || token2 === "rsync") {
|
|
17927
|
+
const target = tokens[tokens.length - 1];
|
|
17928
|
+
if (target && target !== token2 && !inside(target)) out.push(target);
|
|
17929
|
+
index = tokens.length;
|
|
17930
|
+
}
|
|
17931
|
+
}
|
|
17932
|
+
}
|
|
17933
|
+
return out;
|
|
17934
|
+
}
|
|
17935
|
+
async function cloneOriginProven(checkoutDir, cmdUrl) {
|
|
17936
|
+
if (!cmdUrl) return false;
|
|
17937
|
+
try {
|
|
17938
|
+
const config = await readFile(join(checkoutDir, ".git", "config"), "utf8");
|
|
17939
|
+
const section = config.match(/\[remote "origin"\]([^[]*)/);
|
|
17940
|
+
const url = section?.[1]?.match(/url\s*=\s*(\S+)/)?.[1];
|
|
17941
|
+
return url !== void 0 && normalizeGitUrl(url) === normalizeGitUrl(cmdUrl);
|
|
17942
|
+
} catch {
|
|
17943
|
+
return false;
|
|
17944
|
+
}
|
|
17945
|
+
}
|
|
17894
17946
|
function isSelfCleaningCloneCmd(cmd) {
|
|
17895
17947
|
const parsed = extractRawCloneDest(cmd);
|
|
17896
17948
|
if (!parsed) return false;
|
|
@@ -17958,7 +18010,8 @@ var init_gitCloneWithSetup2 = __esm({
|
|
|
17958
18010
|
};
|
|
17959
18011
|
}
|
|
17960
18012
|
const cloneTarget = extractCloneTarget(install.cmd, ctx.hostContext?.userHome);
|
|
17961
|
-
|
|
18013
|
+
const parsedDest = extractRawCloneDest(install.cmd);
|
|
18014
|
+
if (!cloneTarget || !parsedDest) {
|
|
17962
18015
|
return {
|
|
17963
18016
|
ok: false,
|
|
17964
18017
|
phase: "preflight",
|
|
@@ -18004,9 +18057,15 @@ var init_gitCloneWithSetup2 = __esm({
|
|
|
18004
18057
|
}
|
|
18005
18058
|
}
|
|
18006
18059
|
const plainClone = /^\s*git\s+clone\s+[^;&|<>`$\r\n]+$/.test(install.cmd);
|
|
18007
|
-
|
|
18008
|
-
|
|
18009
|
-
|
|
18060
|
+
const originProven = await cloneOriginProven(
|
|
18061
|
+
resolve(install.cwd ?? ctx.cwd, cloneTarget),
|
|
18062
|
+
extractCloneUrl(install.cmd)
|
|
18063
|
+
);
|
|
18064
|
+
const footprintBounded = externalWriteTargets(install.cmd, parsedDest.raw).length === 0;
|
|
18065
|
+
const installedSignal = existingTarget || (ctx.hostContext && ctx.opts.updateInstalled ? await isAlreadyInstalled(ctx, { honorUpdateFlag: false }) : false);
|
|
18066
|
+
const refreshAuthorized = ctx.opts.updateInstalled && installedSignal && originProven && footprintBounded;
|
|
18067
|
+
if (ctx.hostContext && ctx.opts.updateInstalled && !refreshAuthorized) {
|
|
18068
|
+
if (!plainClone || installedSignal) return unprovenCloneTarget(ctx);
|
|
18010
18069
|
}
|
|
18011
18070
|
if (await isAlreadyInstalled(ctx)) {
|
|
18012
18071
|
const verifyFailure2 = await verifyInstalled(ctx);
|
|
@@ -18020,7 +18079,7 @@ var init_gitCloneWithSetup2 = __esm({
|
|
|
18020
18079
|
);
|
|
18021
18080
|
return { ok: true, alreadyInstalled: true, backupId: "noop-idempotent" };
|
|
18022
18081
|
}
|
|
18023
|
-
if (existingTarget) return unprovenCloneTarget(ctx);
|
|
18082
|
+
if (existingTarget && !refreshAuthorized) return unprovenCloneTarget(ctx);
|
|
18024
18083
|
const name = ctx.manifest.metadata.name;
|
|
18025
18084
|
const plan = {
|
|
18026
18085
|
files: [
|
|
@@ -19083,6 +19142,8 @@ function declaredRootPath(ctx, root) {
|
|
|
19083
19142
|
if (!host) return void 0;
|
|
19084
19143
|
const roots = {
|
|
19085
19144
|
"platform-skills": host.platform.skillsDir,
|
|
19145
|
+
// Phase 85 — the `skills` CLI's default install root.
|
|
19146
|
+
"agents-skills": join(host.userHome, ".agents", "skills"),
|
|
19086
19147
|
"native-home": host.nativeHome,
|
|
19087
19148
|
"host-agents": join(host.nativeHome, "agents"),
|
|
19088
19149
|
"host-commands": host.platform.commandsDir
|
|
@@ -19404,7 +19465,13 @@ function isResource(value) {
|
|
|
19404
19465
|
const resource = value;
|
|
19405
19466
|
const selector = resource.selector;
|
|
19406
19467
|
const marker = resource.marker;
|
|
19407
|
-
const roots = [
|
|
19468
|
+
const roots = [
|
|
19469
|
+
"platform-skills",
|
|
19470
|
+
"agents-skills",
|
|
19471
|
+
"native-home",
|
|
19472
|
+
"host-agents",
|
|
19473
|
+
"host-commands"
|
|
19474
|
+
];
|
|
19408
19475
|
const hasNames = Array.isArray(selector?.names) && selector.names.length > 0 && new Set(selector.names).size === selector.names.length && selector.names.every((name) => typeof name === "string" && name.length > 0);
|
|
19409
19476
|
const hasPrefix = typeof selector?.prefix === "string" && selector.prefix.length > 0;
|
|
19410
19477
|
return roots.includes(resource.root) && (resource.kind === "file" || resource.kind === "directory") && Boolean(hasNames) !== Boolean(hasPrefix) && typeof marker?.contains === "string" && marker.contains.length > 0 && (resource.kind === "file" ? marker.path === void 0 || isSafeMarkerPath(marker.path) : typeof marker.path === "string" && isSafeMarkerPath(marker.path));
|
|
@@ -19423,6 +19490,9 @@ function rootPath(ctx, root) {
|
|
|
19423
19490
|
if (!host) return null;
|
|
19424
19491
|
const roots = {
|
|
19425
19492
|
"platform-skills": host.platform.skillsDir,
|
|
19493
|
+
// Phase 85 — the `skills` CLI's default install root (the real files of a
|
|
19494
|
+
// host-skills-dir symlink live here).
|
|
19495
|
+
"agents-skills": join(host.userHome, ".agents", "skills"),
|
|
19426
19496
|
"native-home": host.nativeHome,
|
|
19427
19497
|
"host-agents": join(host.nativeHome, "agents"),
|
|
19428
19498
|
"host-commands": host.platform.commandsDir
|
|
@@ -19437,6 +19507,13 @@ function selected(resource, name) {
|
|
|
19437
19507
|
const { names, prefix } = resource.selector;
|
|
19438
19508
|
return Boolean(names?.includes(name) || prefix?.length && name.startsWith(prefix));
|
|
19439
19509
|
}
|
|
19510
|
+
function declaredCoversSkillNames(ctx, names) {
|
|
19511
|
+
const claimed = (names ?? []).filter((name) => name.length > 0);
|
|
19512
|
+
if (claimed.length === 0) return true;
|
|
19513
|
+
const resources = resourcesFor(ctx);
|
|
19514
|
+
if (resources.length === 0) return false;
|
|
19515
|
+
return claimed.every((name) => resources.some((resource) => selected(resource, name)));
|
|
19516
|
+
}
|
|
19440
19517
|
async function regularMarker(candidate, canonicalCandidate, resource) {
|
|
19441
19518
|
const markerRelativePath = resource.marker.path;
|
|
19442
19519
|
if (resource.kind === "directory" && !markerRelativePath) return false;
|
|
@@ -19607,13 +19684,19 @@ var init_npmCli2 = __esm({
|
|
|
19607
19684
|
}
|
|
19608
19685
|
const managesSkillOwnership = isSkillOwnershipManaged(ctx.manifest);
|
|
19609
19686
|
const ownershipCandidateSnapshot = managesSkillOwnership ? await snapshotDeclaredOwnership(ctx) : void 0;
|
|
19610
|
-
const
|
|
19611
|
-
|
|
19612
|
-
);
|
|
19687
|
+
const ownershipResources = ctx.manifest.spec.ownership?.resources;
|
|
19688
|
+
const usesDeclaredOwnership = Array.isArray(ownershipResources) && ownershipResources.length > 0;
|
|
19689
|
+
const declaredSnapshot = ownershipCandidateSnapshot ?? (usesDeclaredOwnership ? await snapshotDeclaredOwnership(ctx) : void 0);
|
|
19690
|
+
const declaredProven = usesDeclaredOwnership && // Phase 85 — every skill the manifest claims to install must be declared,
|
|
19691
|
+
// or the declaration does not bound what a refresh may overwrite.
|
|
19692
|
+
declaredCoversSkillNames(ctx, install.installs_skills) && declaredSnapshot !== void 0 && await (async () => {
|
|
19693
|
+
const discovered = await discoverDeclaredOwnership(ctx);
|
|
19694
|
+
return declaredSnapshot.paths.every((path) => discovered.paths.includes(path));
|
|
19695
|
+
})();
|
|
19613
19696
|
let existingPackTarget = false;
|
|
19614
19697
|
if (ctx.hostContext && (ctx.manifest.spec.component_type !== "cli-binary" || install.installs_skills !== void 0)) {
|
|
19615
19698
|
if (usesDeclaredOwnership) {
|
|
19616
|
-
existingPackTarget = (
|
|
19699
|
+
existingPackTarget = (declaredSnapshot?.paths.length ?? 0) > 0;
|
|
19617
19700
|
} else {
|
|
19618
19701
|
const names = [ctx.manifest.metadata.name, ...install.installs_skills ?? []];
|
|
19619
19702
|
if (names.some((name) => !/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(name)))
|
|
@@ -19634,7 +19717,7 @@ var init_npmCli2 = __esm({
|
|
|
19634
19717
|
existingPackTarget = true;
|
|
19635
19718
|
}
|
|
19636
19719
|
}
|
|
19637
|
-
if (ctx.opts.updateInstalled && !
|
|
19720
|
+
if (ctx.opts.updateInstalled && !declaredProven) return unprovenPackTarget(ctx);
|
|
19638
19721
|
}
|
|
19639
19722
|
if (await isAlreadyInstalled(ctx)) {
|
|
19640
19723
|
const verifyFailure2 = await verifyInstalled(ctx, { neutralCwd: true });
|
|
@@ -19648,7 +19731,8 @@ var init_npmCli2 = __esm({
|
|
|
19648
19731
|
);
|
|
19649
19732
|
return { ok: true, alreadyInstalled: true, backupId: "noop-idempotent" };
|
|
19650
19733
|
}
|
|
19651
|
-
if (existingPackTarget
|
|
19734
|
+
if (existingPackTarget && !(ctx.opts.updateInstalled && declaredProven))
|
|
19735
|
+
return unprovenPackTarget(ctx);
|
|
19652
19736
|
let level = detectLevel(install.cmd);
|
|
19653
19737
|
let cmd = install.cmd;
|
|
19654
19738
|
const plan = { files: [] };
|
|
@@ -19718,9 +19802,10 @@ var init_npmCli2 = __esm({
|
|
|
19718
19802
|
try {
|
|
19719
19803
|
if (usesDeclaredOwnership) {
|
|
19720
19804
|
const discovered = await discoverDeclaredOwnership(ctx);
|
|
19805
|
+
const refreshAuthorized = ctx.opts.updateInstalled && declaredProven;
|
|
19721
19806
|
await writeDeclaredOwnershipReceipt(ctx, {
|
|
19722
19807
|
roots: discovered.roots,
|
|
19723
|
-
paths: discovered.paths.filter((path) => !pathSnapshot.has(path))
|
|
19808
|
+
paths: refreshAuthorized ? discovered.paths : discovered.paths.filter((path) => !pathSnapshot.has(path))
|
|
19724
19809
|
});
|
|
19725
19810
|
} else {
|
|
19726
19811
|
const afterPaths = await declaredSkillPaths(ctx, skillRoots);
|
|
@@ -19885,6 +19970,12 @@ var init_npxSkillInstaller2 = __esm({
|
|
|
19885
19970
|
] : [getSkillsDir()];
|
|
19886
19971
|
const primaryActiveSkillsDir = activeSkillsDirs[0] ?? getSkillsDir();
|
|
19887
19972
|
const ownershipCandidateSnapshot = await snapshotDeclaredOwnership(ctx);
|
|
19973
|
+
const declaredProven = usesDeclaredOwnership && // Phase 85 — every skill the manifest claims to install must be declared,
|
|
19974
|
+
// or the declaration does not bound what a refresh may overwrite.
|
|
19975
|
+
declaredCoversSkillNames(ctx, install.installs_skills) && await (async () => {
|
|
19976
|
+
const discovered = await discoverDeclaredOwnership(ctx);
|
|
19977
|
+
return ownershipCandidateSnapshot.paths.every((path) => discovered.paths.includes(path));
|
|
19978
|
+
})();
|
|
19888
19979
|
let anyExistingTarget = false;
|
|
19889
19980
|
if (ctx.hostContext) {
|
|
19890
19981
|
if (usesDeclaredOwnership) {
|
|
@@ -19912,12 +20003,12 @@ var init_npxSkillInstaller2 = __esm({
|
|
|
19912
20003
|
}
|
|
19913
20004
|
}
|
|
19914
20005
|
}
|
|
19915
|
-
if (ctx.opts.updateInstalled && (!singleSkill || anyExistingTarget || await isAlreadyInstalled(ctx, { honorUpdateFlag: false })))
|
|
20006
|
+
if (ctx.opts.updateInstalled && !declaredProven && (!singleSkill || anyExistingTarget || await isAlreadyInstalled(ctx, { honorUpdateFlag: false })))
|
|
19916
20007
|
return unprovenSkillTarget(ctx);
|
|
19917
20008
|
}
|
|
19918
20009
|
const activeTargetExists = await activeSkillPresent(activeSkillsDirs, activeTargetNames);
|
|
19919
20010
|
const alreadyInstalled = ctx.hostContext ? !ctx.opts.dryRun && activeTargetExists : await isAlreadyInstalled(ctx);
|
|
19920
|
-
if (alreadyInstalled) {
|
|
20011
|
+
if (alreadyInstalled && !(ctx.opts.updateInstalled && declaredProven)) {
|
|
19921
20012
|
const verifyFailure2 = await verifyInstalled(ctx, { neutralCwd: true });
|
|
19922
20013
|
if (verifyFailure2) return verifyFailure2;
|
|
19923
20014
|
await recordObservedInstall(
|
|
@@ -20018,9 +20109,10 @@ var init_npxSkillInstaller2 = __esm({
|
|
|
20018
20109
|
try {
|
|
20019
20110
|
if (usesDeclaredOwnership) {
|
|
20020
20111
|
const discovered = await discoverDeclaredOwnership(ctx);
|
|
20112
|
+
const refreshAuthorized = ctx.opts.updateInstalled && declaredProven;
|
|
20021
20113
|
await writeDeclaredOwnershipReceipt(ctx, {
|
|
20022
20114
|
roots: discovered.roots,
|
|
20023
|
-
paths: discovered.paths.filter((path) => !pathSnapshot.has(path))
|
|
20115
|
+
paths: refreshAuthorized ? discovered.paths : discovered.paths.filter((path) => !pathSnapshot.has(path))
|
|
20024
20116
|
});
|
|
20025
20117
|
} else {
|
|
20026
20118
|
const afterPaths = await declaredSkillPaths(ctx, skillRoots);
|
|
@@ -25751,6 +25843,10 @@ async function warnIfAgentTeamsMissing() {
|
|
|
25751
25843
|
async function scanWorkflowsWithSkill(workflowsDir, entries) {
|
|
25752
25844
|
return scanWorkflowsNested(workflowsDir, entries);
|
|
25753
25845
|
}
|
|
25846
|
+
function isGlobalNpmInstall(plan) {
|
|
25847
|
+
if (effectiveInstallMethod(plan) !== "npm-cli") return false;
|
|
25848
|
+
return /\bnpm\s+install\s+-g\b/.test(plan.manifest.spec.install.cmd);
|
|
25849
|
+
}
|
|
25754
25850
|
async function runStepBInstall(manifestPaths, runOpts = {}) {
|
|
25755
25851
|
const hostContext = runOpts.hostContext ?? captureHostInstallContext();
|
|
25756
25852
|
const opts = {
|
|
@@ -25765,6 +25861,7 @@ async function runStepBInstall(manifestPaths, runOpts = {}) {
|
|
|
25765
25861
|
};
|
|
25766
25862
|
const start = Date.now();
|
|
25767
25863
|
const componentTypes = {};
|
|
25864
|
+
const globalNpmComponents = [];
|
|
25768
25865
|
const failureKeywords = {};
|
|
25769
25866
|
const total = manifestPaths.length;
|
|
25770
25867
|
let done = 0;
|
|
@@ -25799,12 +25896,18 @@ async function runStepBInstall(manifestPaths, runOpts = {}) {
|
|
|
25799
25896
|
}
|
|
25800
25897
|
const plan = resolveComponentPlan(v.manifest, hostContext, "install");
|
|
25801
25898
|
componentTypes[v.manifest.metadata.name] = installGroupForPlan(plan);
|
|
25899
|
+
if (isGlobalNpmInstall(plan)) globalNpmComponents.push(v.manifest.metadata.name);
|
|
25802
25900
|
valid.push({ manifest: v.manifest, plan });
|
|
25803
25901
|
}
|
|
25804
|
-
const runOne = async (manifest) => {
|
|
25902
|
+
const runOne = async (manifest, plan) => {
|
|
25805
25903
|
const name = manifest.metadata.name;
|
|
25806
25904
|
try {
|
|
25807
|
-
const
|
|
25905
|
+
const forceSystem = runOpts.forceSystemScope === true && plan !== void 0 && isGlobalNpmInstall(plan);
|
|
25906
|
+
const r = await runInstall(
|
|
25907
|
+
manifest,
|
|
25908
|
+
forceSystem ? { ...opts, system: true } : opts,
|
|
25909
|
+
hostContext
|
|
25910
|
+
);
|
|
25808
25911
|
if ("aborted" in r) {
|
|
25809
25912
|
const reason = r.reason === "harness-mismatch" ? `harness-mismatch \u2014 claude-only install method (no ${hostContext.hostId} equivalent)` : r.reason === "level-flag-missing" && runOpts.updateInstalled === true ? `L4 system-scope \u2014 excluded from force-update; update manually: \`${manifest.spec.install.cmd}\`` : r.reason;
|
|
25810
25913
|
return emit({ status: "skipped", name, reason });
|
|
@@ -25822,12 +25925,12 @@ async function runStepBInstall(manifestPaths, runOpts = {}) {
|
|
|
25822
25925
|
const rest = valid.filter((v) => !MCP_METHODS.has(effectiveInstallMethod(v.plan)));
|
|
25823
25926
|
const runMcpSerial = async () => {
|
|
25824
25927
|
const out = [];
|
|
25825
|
-
for (const { manifest } of mcp) out.push(await runOne(manifest));
|
|
25928
|
+
for (const { manifest, plan } of mcp) out.push(await runOne(manifest, plan));
|
|
25826
25929
|
return out;
|
|
25827
25930
|
};
|
|
25828
25931
|
const [mcpEntries, restSettled] = await Promise.all([
|
|
25829
25932
|
runMcpSerial(),
|
|
25830
|
-
Promise.allSettled(rest.map(({ manifest }) => runOne(manifest)))
|
|
25933
|
+
Promise.allSettled(rest.map(({ manifest, plan }) => runOne(manifest, plan)))
|
|
25831
25934
|
]);
|
|
25832
25935
|
const restEntries = restSettled.map(
|
|
25833
25936
|
(s) => s.status === "fulfilled" ? s.value : { status: "failed", name: "?", reason: String(s.reason) }
|
|
@@ -25849,7 +25952,8 @@ async function runStepBInstall(manifestPaths, runOpts = {}) {
|
|
|
25849
25952
|
failed: failed2,
|
|
25850
25953
|
failureKeywords,
|
|
25851
25954
|
elapsedMs: Date.now() - start,
|
|
25852
|
-
componentTypes
|
|
25955
|
+
componentTypes,
|
|
25956
|
+
globalNpmComponents
|
|
25853
25957
|
};
|
|
25854
25958
|
}
|
|
25855
25959
|
async function reclassifyForceUpdateFailures(firstPass, forcePass, probe) {
|
|
@@ -25861,7 +25965,7 @@ async function reclassifyForceUpdateFailures(firstPass, forcePass, probe) {
|
|
|
25861
25965
|
const name = (m?.[1] ?? entry).trim();
|
|
25862
25966
|
if (priorlyInstalled.has(name)) {
|
|
25863
25967
|
if (forcePass.failureKeywords?.[name] === "update-unsupported") {
|
|
25864
|
-
keptExisting.push({ name, reason: m?.[2]?.trim() ?? "" });
|
|
25968
|
+
keptExisting.push({ name, reason: m?.[2]?.trim() ?? "", retryable: false });
|
|
25865
25969
|
continue;
|
|
25866
25970
|
}
|
|
25867
25971
|
let present = false;
|
|
@@ -25871,7 +25975,7 @@ async function reclassifyForceUpdateFailures(firstPass, forcePass, probe) {
|
|
|
25871
25975
|
present = false;
|
|
25872
25976
|
}
|
|
25873
25977
|
if (present) {
|
|
25874
|
-
keptExisting.push({ name, reason: m?.[2]?.trim() ?? "" });
|
|
25978
|
+
keptExisting.push({ name, reason: m?.[2]?.trim() ?? "", retryable: true });
|
|
25875
25979
|
continue;
|
|
25876
25980
|
}
|
|
25877
25981
|
}
|
|
@@ -26761,7 +26865,11 @@ installing ${manifestPaths.length} upstream components (MCP serialized, rest par
|
|
|
26761
26865
|
}
|
|
26762
26866
|
if (retained) {
|
|
26763
26867
|
b.keptExisting ??= [];
|
|
26764
|
-
b.keptExisting.push({
|
|
26868
|
+
b.keptExisting.push({
|
|
26869
|
+
name,
|
|
26870
|
+
reason: match?.[2]?.trim() ?? "",
|
|
26871
|
+
retryable: b.failureKeywords?.[name] !== "update-unsupported"
|
|
26872
|
+
});
|
|
26765
26873
|
} else failed2.push(entry);
|
|
26766
26874
|
}
|
|
26767
26875
|
b.failed = failed2;
|
|
@@ -26777,14 +26885,17 @@ installing ${manifestPaths.length} upstream components (MCP serialized, rest par
|
|
|
26777
26885
|
})
|
|
26778
26886
|
);
|
|
26779
26887
|
printGrouped(b);
|
|
26888
|
+
let forceInstalledNames = [];
|
|
26780
26889
|
if (!forceFirstPass && !dryRun && raw.nonInteractive !== true && b.alreadyInstalled.length > 0) {
|
|
26781
26890
|
const isTty = process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
26782
26891
|
if (isTty) {
|
|
26783
26892
|
const { confirm: confirm6, isCancel: isCancel8 } = await import('@clack/prompts');
|
|
26784
26893
|
const mcpExcluded = b.alreadyInstalled.filter((n) => b.componentTypes[n] === "mcp-tool");
|
|
26785
26894
|
const exclusionNote = mcpExcluded.length > 0 ? ` (${mcpExcluded.length} MCP server(s) excluded \u2014 they ignore force-update: ${mcpExcluded.join(", ")})` : "";
|
|
26895
|
+
const globalNpm = b.globalNpmComponents ?? [];
|
|
26896
|
+
const systemNote = globalNpm.length > 0 ? ` (${globalNpm.join(", ")} will be installed/upgraded in system scope via the official \`npm install -g\` command)` : "";
|
|
26786
26897
|
const ans = await confirm6({
|
|
26787
|
-
message: `Update ${b.alreadyInstalled.length} already-installed plugin(s) listed above?${exclusionNote}`,
|
|
26898
|
+
message: `Update ${b.alreadyInstalled.length} already-installed plugin(s) listed above?${exclusionNote}${systemNote}`,
|
|
26788
26899
|
initialValue: false
|
|
26789
26900
|
});
|
|
26790
26901
|
if (!isCancel8(ans) && ans === true) {
|
|
@@ -26794,6 +26905,11 @@ force-updating ${b.alreadyInstalled.length} plugin(s)...`);
|
|
|
26794
26905
|
hostContext: setupContext,
|
|
26795
26906
|
updateInstalled: true,
|
|
26796
26907
|
system: raw.system === true,
|
|
26908
|
+
// Phase 85 — the force pass upgrades global npm tools with the
|
|
26909
|
+
// official command (`npm install -g <pkg>`). The user already
|
|
26910
|
+
// confirmed this pass; the L4 gate does not apply to the official
|
|
26911
|
+
// npm upgrade path.
|
|
26912
|
+
forceSystemScope: true,
|
|
26797
26913
|
quiet: true,
|
|
26798
26914
|
onProgress: progress.onProgress
|
|
26799
26915
|
});
|
|
@@ -26807,12 +26923,23 @@ force-updating ${b.alreadyInstalled.length} plugin(s)...`);
|
|
|
26807
26923
|
`
|
|
26808
26924
|
Force-update pass complete: ${b2.installed.length} installed / ${b2.keptExisting.length} kept-existing / ${b2.alreadyInstalled.length} still-already-installed (MCP) / ${b2.skipped.length} skipped / ${b2.failed.length} failed [parallel ${stepB2Ms}s]`
|
|
26809
26925
|
);
|
|
26926
|
+
forceInstalledNames = b2.installed;
|
|
26810
26927
|
printGrouped(b2, "[force-update] ");
|
|
26811
26928
|
if (b2.keptExisting.length > 0) {
|
|
26812
|
-
|
|
26813
|
-
|
|
26814
|
-
|
|
26815
|
-
|
|
26929
|
+
const blocked = b2.keptExisting.filter((entry) => entry.retryable === false);
|
|
26930
|
+
const retryable = b2.keptExisting.filter((entry) => entry.retryable !== false);
|
|
26931
|
+
if (retryable.length > 0) {
|
|
26932
|
+
console.warn(
|
|
26933
|
+
`
|
|
26934
|
+
${retryable.length} plugin(s) kept their existing version \u2014 refresh failed but the prior install is still usable. Re-run \`harnessed setup\` later to retry the update.`
|
|
26935
|
+
);
|
|
26936
|
+
}
|
|
26937
|
+
if (blocked.length > 0) {
|
|
26938
|
+
console.warn(
|
|
26939
|
+
`
|
|
26940
|
+
${blocked.length} component(s) kept their existing version \u2014 harnessed refuses to replace them (existing source or write footprint not provably ours). Update them with their upstream tool: ${blocked.map((entry) => entry.name).join(", ")}`
|
|
26941
|
+
);
|
|
26942
|
+
}
|
|
26816
26943
|
}
|
|
26817
26944
|
mergeStepBResults(b, b2);
|
|
26818
26945
|
}
|
|
@@ -27019,6 +27146,14 @@ Force-update pass complete: ${b2.installed.length} installed / ${b2.keptExisting
|
|
|
27019
27146
|
setupFailures.push(userLangResult.message);
|
|
27020
27147
|
}
|
|
27021
27148
|
}
|
|
27149
|
+
if (forceInstalledNames.length > 0) {
|
|
27150
|
+
const upgraded = new Set(forceInstalledNames);
|
|
27151
|
+
b.skipped = b.skipped.filter((entry) => !upgraded.has(entry.name));
|
|
27152
|
+
b.failed = b.failed.filter((failure) => {
|
|
27153
|
+
const name = failure.split(": ", 1)[0] ?? failure;
|
|
27154
|
+
return !upgraded.has(name);
|
|
27155
|
+
});
|
|
27156
|
+
}
|
|
27022
27157
|
let pendingNonInteractiveL4Repair = false;
|
|
27023
27158
|
const hasL4RepairCandidate = b.skipped.some((s) => s.reason === "level-flag-missing") || b.failed.some((failure) => {
|
|
27024
27159
|
const name = failure.split(": ", 1)[0] ?? failure;
|