Skip to content

Commit de11d97

Browse files
committed
fix(agentsys-resolver): prefer the plugin's own vendored lib/
findAgentsysLib() only searched for an EXTERNAL agentsys install (CC marketplace, npm global, require.resolve, dev sibling). In bare CI none exist, so the 3 tests that actually resolve (findAgentsysLib + get()) threw 'agentsys/lib not found' and failed every PR's CI. But the sync still ships lib/binary/ (and the rest of the allowlist) into every plugin, so the resolver's OWN directory already satisfies the binary/index.js contract. Added __dirname as candidate 0: the plugin is now self-sufficient (works in CI, offline, no external install) and the external lookups remain as fallbacks for hosts that share a central agentsys. tests/agentsys-resolver.test.js: 7/7 pass (was 3 failing).
1 parent 93f299e commit de11d97

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/agentsys.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* were previously synced from agentsys via agent-core.
88
*
99
* Lookup order:
10+
* 0. __dirname (this plugin's own vendored lib/)
1011
* 1. ~/.claude/plugins/marketplaces/agentsys/lib (CC marketplace clone)
1112
* 2. <npm-global-root>/agentsys/lib (npm install -g agentsys)
1213
* 3. require.resolve('agentsys/lib/package.json') (project-local install)
@@ -56,6 +57,13 @@ function npmGlobalRoot() {
5657
function candidatePaths() {
5758
const home = os.homedir();
5859
const candidates = [
60+
// 0. This plugin's OWN vendored lib/. The sync still ships lib/binary/
61+
// (and friends) into every plugin, so the resolver's own directory
62+
// already satisfies the binary/index.js contract. Preferring it means
63+
// the plugin is self-sufficient - works in bare CI and offline, with no
64+
// external agentsys install - and the external lookups below stay as
65+
// fallbacks for hosts that intentionally share a central agentsys.
66+
__dirname,
5967
path.join(home, '.claude', 'plugins', 'marketplaces', 'agentsys', 'lib'),
6068
];
6169

0 commit comments

Comments
 (0)