fix(3571): load configuration manifests after install (#3572)

* fix(3571): load configuration manifests after install

* test(3571): simplify missing manifest check
This commit is contained in:
Maxim Brashenko
2026-05-16 07:03:03 +05:00
committed by GitHub
parent 6a2bf05de7
commit 79ea076daa
5 changed files with 206 additions and 27 deletions

View File

@@ -8425,26 +8425,35 @@ function install(isGlobal, runtime = 'claude', options = {}) {
failures.push('get-shit-done');
}
// #3288 — Copy sdk/shared/model-catalog.json into the get-shit-done payload
// at the co-located path that model-catalog.cjs resolves first:
// get-shit-done/bin/shared/model-catalog.json
// #3288 / #3571 — Copy sdk/shared manifests into the get-shit-done payload
// at the co-located path that CJS modules resolve first:
// get-shit-done/bin/shared/*.json
//
// The install copies get-shit-done/ but NOT sdk/ — the CJS module's legacy
// path (3 levels up → sdk/shared/) therefore resolves to a non-existent
// location in every post-install layout. Copying the catalog alongside the
// CJS files ensures require() succeeds without needing sdk/ to exist.
const modelCatalogSrc = path.join(src, 'sdk', 'shared', 'model-catalog.json');
const modelCatalogDest = path.join(skillDest, 'bin', 'shared', 'model-catalog.json');
if (fs.existsSync(modelCatalogSrc)) {
fs.mkdirSync(path.dirname(modelCatalogDest), { recursive: true });
fs.copyFileSync(modelCatalogSrc, modelCatalogDest);
if (verifyFileInstalled(modelCatalogDest, 'get-shit-done/bin/shared/model-catalog.json')) {
console.log(` ${green}✓${reset} Installed get-shit-done/bin/shared/model-catalog.json`);
// The install copies get-shit-done/ but NOT sdk/ — CJS modules' legacy
// source-repo paths (3 levels up → sdk/shared/) therefore resolve to a
// non-existent location in every post-install layout. Copying these shared
// files alongside the CJS files ensures require() succeeds without needing
// sdk/ to exist.
const sharedPayloadFiles = [
'model-catalog.json',
'config-defaults.manifest.json',
'config-schema.manifest.json',
];
for (const fileName of sharedPayloadFiles) {
const sharedSrc = path.join(src, 'sdk', 'shared', fileName);
const sharedDest = path.join(skillDest, 'bin', 'shared', fileName);
const displayPath = `get-shit-done/bin/shared/${fileName}`;
if (fs.existsSync(sharedSrc)) {
fs.mkdirSync(path.dirname(sharedDest), { recursive: true });
fs.copyFileSync(sharedSrc, sharedDest);
if (verifyFileInstalled(sharedDest, displayPath)) {
console.log(` ${green}✓${reset} Installed ${displayPath}`);
} else {
failures.push(displayPath);
}
} else {
failures.push('get-shit-done/bin/shared/model-catalog.json');
failures.push(`sdk/shared/${fileName} (source missing)`);
}
} else {
failures.push('sdk/shared/model-catalog.json (source missing)');
}
// Copy agents to agents directory.