claude-dev-env 8.109.7 → 8.109.8
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/bin/install-pstack-plugin.mjs +80 -14
- package/bin/install-pstack-plugin.test.mjs +111 -40
- package/bin/install.mjs +23 -20
- package/bin/install.test.mjs +22 -17
- package/package.json +1 -1
|
@@ -23,13 +23,16 @@ export const PSTACK_PLUGIN_SPEC = Object.freeze({
|
|
|
23
23
|
optOutVariable: PSTACK_PLUGIN_OPT_OUT_VARIABLE,
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
+
export const MODS_FRAMEWORK_MARKETPLACE_REPOSITORY = 'jl-cmd-projects/claude-mods-framework';
|
|
27
|
+
export const MODS_FRAMEWORK_MARKETPLACE_NAME = 'claude-mods-framework';
|
|
28
|
+
|
|
26
29
|
export const USAGE_WRAPUP_PLUGIN_SPEC = Object.freeze({
|
|
27
30
|
name: 'usage-wrapup',
|
|
28
31
|
label: 'Usage-wrapup',
|
|
29
|
-
marketplaceRepository:
|
|
30
|
-
marketplaceName:
|
|
31
|
-
sparsePaths: Object.freeze([
|
|
32
|
-
pluginIdentifier:
|
|
32
|
+
marketplaceRepository: MODS_FRAMEWORK_MARKETPLACE_REPOSITORY,
|
|
33
|
+
marketplaceName: MODS_FRAMEWORK_MARKETPLACE_NAME,
|
|
34
|
+
sparsePaths: Object.freeze([]),
|
|
35
|
+
pluginIdentifier: `usage-wrapup@${MODS_FRAMEWORK_MARKETPLACE_NAME}`,
|
|
33
36
|
hosts: Object.freeze(['claude']),
|
|
34
37
|
optOutFlag: '--no-usage-wrapup',
|
|
35
38
|
optOutVariable: 'CDE_INSTALL_USAGE_WRAPUP',
|
|
@@ -47,18 +50,79 @@ export const ALL_RETIRED_PLUGIN_SPECS = Object.freeze([
|
|
|
47
50
|
}),
|
|
48
51
|
]);
|
|
49
52
|
|
|
53
|
+
/**
|
|
54
|
+
* The usage-wrapup and subagent-models copies this repository once shipped.
|
|
55
|
+
* The mods framework marketplace now supplies each one, and an install
|
|
56
|
+
* removes an old copy only after its replacement installs, so a home that
|
|
57
|
+
* cannot reach that marketplace keeps the copy it has.
|
|
58
|
+
*/
|
|
59
|
+
export const ALL_REPLACED_PLUGIN_SPECS = Object.freeze([
|
|
60
|
+
Object.freeze({
|
|
61
|
+
name: 'usage-wrapup',
|
|
62
|
+
marketplaceName: 'claude-dev-env',
|
|
63
|
+
pluginIdentifier: 'usage-wrapup@claude-dev-env',
|
|
64
|
+
}),
|
|
65
|
+
Object.freeze({
|
|
66
|
+
name: 'subagent-models',
|
|
67
|
+
marketplaceName: 'claude-dev-env',
|
|
68
|
+
pluginIdentifier: 'subagent-models@claude-dev-env',
|
|
69
|
+
}),
|
|
70
|
+
]);
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Pick the old copies an install may remove now that its replacements are in.
|
|
74
|
+
*
|
|
75
|
+
* @param {ReadonlyArray<{name: string}>} allReplacedSpecs The old copies.
|
|
76
|
+
* @param {ReadonlyArray<{name: string}>} allInstalledSpecs The plugins the install wrote.
|
|
77
|
+
* @param {{status: string}} installOutcome The outcome of that install.
|
|
78
|
+
* @returns {Array<{name: string}>} Each old copy whose same-named replacement installed.
|
|
79
|
+
*/
|
|
80
|
+
export function replacedSpecsToRemove(allReplacedSpecs, allInstalledSpecs, installOutcome) {
|
|
81
|
+
if (installOutcome.status !== 'installed') return [];
|
|
82
|
+
const allInstalledNames = new Set(allInstalledSpecs.map(eachSpec => eachSpec.name));
|
|
83
|
+
return allReplacedSpecs.filter(eachSpec => allInstalledNames.has(eachSpec.name));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The shared drawer the usage-wrapup and subagent-models panes register
|
|
88
|
+
* through. It has no opt-out of its own, and it installs whenever a plugin
|
|
89
|
+
* that depends on it installs.
|
|
90
|
+
*/
|
|
91
|
+
export const DRAWER_CORE_PLUGIN_SPEC = Object.freeze({
|
|
92
|
+
name: 'drawer-core',
|
|
93
|
+
label: 'Drawer-core',
|
|
94
|
+
marketplaceRepository: MODS_FRAMEWORK_MARKETPLACE_REPOSITORY,
|
|
95
|
+
marketplaceName: MODS_FRAMEWORK_MARKETPLACE_NAME,
|
|
96
|
+
sparsePaths: Object.freeze([]),
|
|
97
|
+
pluginIdentifier: `drawer-core@${MODS_FRAMEWORK_MARKETPLACE_NAME}`,
|
|
98
|
+
hosts: Object.freeze(['claude']),
|
|
99
|
+
});
|
|
100
|
+
|
|
50
101
|
export const SUBAGENT_MODELS_PLUGIN_SPEC = Object.freeze({
|
|
51
102
|
name: 'subagent-models',
|
|
52
103
|
label: 'Subagent-models',
|
|
53
|
-
marketplaceRepository:
|
|
54
|
-
marketplaceName:
|
|
55
|
-
sparsePaths: Object.freeze([
|
|
56
|
-
pluginIdentifier:
|
|
104
|
+
marketplaceRepository: MODS_FRAMEWORK_MARKETPLACE_REPOSITORY,
|
|
105
|
+
marketplaceName: MODS_FRAMEWORK_MARKETPLACE_NAME,
|
|
106
|
+
sparsePaths: Object.freeze([]),
|
|
107
|
+
pluginIdentifier: `subagent-models@${MODS_FRAMEWORK_MARKETPLACE_NAME}`,
|
|
57
108
|
hosts: Object.freeze(['claude']),
|
|
58
109
|
optOutFlag: '--no-subagent-models',
|
|
59
110
|
optOutVariable: 'CDE_INSTALL_SUBAGENT_MODELS',
|
|
60
111
|
});
|
|
61
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Pick the mods framework plugins one install writes.
|
|
115
|
+
*
|
|
116
|
+
* @param {string[]} [argumentList] The installer's command-line arguments.
|
|
117
|
+
* @param {Record<string, string|undefined>} [environment] The process environment.
|
|
118
|
+
* @returns {Array<typeof DRAWER_CORE_PLUGIN_SPEC>} drawer-core first, then each plugin not opted out, or none when every plugin is opted out.
|
|
119
|
+
*/
|
|
120
|
+
export function modsFrameworkPluginSpecs(argumentList = process.argv.slice(2), environment = process.env) {
|
|
121
|
+
const allChosenSpecs = [USAGE_WRAPUP_PLUGIN_SPEC, SUBAGENT_MODELS_PLUGIN_SPEC]
|
|
122
|
+
.filter(eachSpec => shouldInstallMarketplacePlugin(eachSpec, argumentList, environment));
|
|
123
|
+
return allChosenSpecs.length === 0 ? [] : [DRAWER_CORE_PLUGIN_SPEC, ...allChosenSpecs];
|
|
124
|
+
}
|
|
125
|
+
|
|
62
126
|
/**
|
|
63
127
|
* Anthropic's security-guidance plugin, which reviews each edit, turn, and
|
|
64
128
|
* commit an agent makes for security problems.
|
|
@@ -529,11 +593,12 @@ export function installMarketplacePlugins(allSpecs, options = {}, dependencies =
|
|
|
529
593
|
/**
|
|
530
594
|
* Uninstall each retired plugin a Claude home still holds.
|
|
531
595
|
*
|
|
532
|
-
* A home holds a retired plugin when its plugin cache
|
|
533
|
-
* each such plugin the step runs `claude plugin uninstall
|
|
534
|
-
*
|
|
535
|
-
* folder
|
|
536
|
-
*
|
|
596
|
+
* A home holds a retired plugin when its plugin cache folder holds a version.
|
|
597
|
+
* For each such plugin the step runs `claude plugin uninstall`, deletes the
|
|
598
|
+
* cached versions Claude Code marked as orphaned, and deletes the plugin
|
|
599
|
+
* folder once no version is left. A home with no cached version runs no
|
|
600
|
+
* command, so a fresh install and a second update both leave the home as it
|
|
601
|
+
* stands. A missing `claude` command skips the step. A failed
|
|
537
602
|
* uninstall is recorded in `failedRemovals` with its detail, and its cached
|
|
538
603
|
* versions stay on disk.
|
|
539
604
|
*
|
|
@@ -555,7 +620,7 @@ export function removeRetiredMarketplacePlugins(allRetiredSpecs, options, depend
|
|
|
555
620
|
if (!options.claudeRoot) return { removedIdentifiers, removedVersionPaths, failedRemovals };
|
|
556
621
|
for (const eachSpec of allRetiredSpecs) {
|
|
557
622
|
const versionsDirectory = hostDefinition.orphanedVersionsDirectory(options.claudeRoot, eachSpec);
|
|
558
|
-
if (!existsSync(versionsDirectory)) continue;
|
|
623
|
+
if (!existsSync(versionsDirectory) || readdirSync(versionsDirectory).length === 0) continue;
|
|
559
624
|
const outcome = runCommand(
|
|
560
625
|
executable,
|
|
561
626
|
['plugin', hostDefinition.uninstallVerb, eachSpec.pluginIdentifier],
|
|
@@ -569,6 +634,7 @@ export function removeRetiredMarketplacePlugins(allRetiredSpecs, options, depend
|
|
|
569
634
|
}
|
|
570
635
|
removedIdentifiers.push(eachSpec.pluginIdentifier);
|
|
571
636
|
removedVersionPaths.push(...removeOrphanedPluginVersions(versionsDirectory));
|
|
637
|
+
if (readdirSync(versionsDirectory).length === 0) rmSync(versionsDirectory, { recursive: true, force: true });
|
|
572
638
|
}
|
|
573
639
|
return { removedIdentifiers, removedVersionPaths, failedRemovals };
|
|
574
640
|
}
|
|
@@ -7,7 +7,9 @@ import {
|
|
|
7
7
|
PSTACK_MARKETPLACE_REPOSITORY,
|
|
8
8
|
PSTACK_PLUGIN_HOSTS,
|
|
9
9
|
PSTACK_PLUGIN_IDENTIFIER,
|
|
10
|
+
ALL_REPLACED_PLUGIN_SPECS,
|
|
10
11
|
ALL_RETIRED_PLUGIN_SPECS,
|
|
12
|
+
DRAWER_CORE_PLUGIN_SPEC,
|
|
11
13
|
PSTACK_PLUGIN_SPEC,
|
|
12
14
|
SECURITY_GUIDANCE_PLUGIN_SPEC,
|
|
13
15
|
SUBAGENT_MODELS_PLUGIN_SPEC,
|
|
@@ -15,9 +17,11 @@ import {
|
|
|
15
17
|
hostCommandInvocation,
|
|
16
18
|
installMarketplacePlugins,
|
|
17
19
|
marketplacePluginsPlan,
|
|
20
|
+
modsFrameworkPluginSpecs,
|
|
18
21
|
removeOrphanedPluginVersions,
|
|
19
22
|
removeStaleMarketplaceClone,
|
|
20
23
|
removeRetiredMarketplacePlugins,
|
|
24
|
+
replacedSpecsToRemove,
|
|
21
25
|
restartNotice,
|
|
22
26
|
runHostCommand,
|
|
23
27
|
shouldInstallMarketplacePlugin,
|
|
@@ -111,11 +115,11 @@ test('a failed Claude refresh falls back to removing and adding the marketplace
|
|
|
111
115
|
const outcome = installMarketplacePlugins([USAGE_WRAPUP_PLUGIN_SPEC], { ...ROOTS, hosts: ['claude'] }, runner);
|
|
112
116
|
assert.equal(outcome.status, 'installed');
|
|
113
117
|
assert.deepEqual(runner.calls.map(call => call.commandArguments), [
|
|
114
|
-
['plugin', 'marketplace', 'add', 'jl-cmd-projects/claude-
|
|
115
|
-
['plugin', 'uninstall', 'usage-wrapup@claude-
|
|
116
|
-
['plugin', 'marketplace', 'remove', 'claude-
|
|
117
|
-
['plugin', 'marketplace', 'add', 'jl-cmd-projects/claude-
|
|
118
|
-
['plugin', 'install', 'usage-wrapup@claude-
|
|
118
|
+
['plugin', 'marketplace', 'add', 'jl-cmd-projects/claude-mods-framework'],
|
|
119
|
+
['plugin', 'uninstall', 'usage-wrapup@claude-mods-framework'],
|
|
120
|
+
['plugin', 'marketplace', 'remove', 'claude-mods-framework'],
|
|
121
|
+
['plugin', 'marketplace', 'add', 'jl-cmd-projects/claude-mods-framework'],
|
|
122
|
+
['plugin', 'install', 'usage-wrapup@claude-mods-framework'],
|
|
119
123
|
]);
|
|
120
124
|
});
|
|
121
125
|
|
|
@@ -336,13 +340,13 @@ test('a non-zero exit that is not command-not-found still reads as a failure', (
|
|
|
336
340
|
assert.match(outcome.hosts[0].warning, /rejected the catalog/);
|
|
337
341
|
});
|
|
338
342
|
|
|
339
|
-
test('the usage-wrapup plan adds
|
|
343
|
+
test('the usage-wrapup plan adds the mods framework marketplace and installs the plugin on Claude', () => {
|
|
340
344
|
const plan = marketplacePluginsPlan([USAGE_WRAPUP_PLUGIN_SPEC], 'claude');
|
|
341
345
|
assert.equal(plan.executable, 'claude');
|
|
342
346
|
assert.equal(plan.homeVariable, 'CLAUDE_CONFIG_DIR');
|
|
343
347
|
assert.deepEqual(plan.commands, [
|
|
344
|
-
['plugin', 'marketplace', 'add', 'jl-cmd-projects/claude-
|
|
345
|
-
['plugin', 'install', 'usage-wrapup@claude-
|
|
348
|
+
['plugin', 'marketplace', 'add', 'jl-cmd-projects/claude-mods-framework'],
|
|
349
|
+
['plugin', 'install', 'usage-wrapup@claude-mods-framework'],
|
|
346
350
|
]);
|
|
347
351
|
});
|
|
348
352
|
|
|
@@ -357,10 +361,10 @@ test('installing usage-wrapup runs only the Claude commands, inside the managed
|
|
|
357
361
|
assert.equal(outcome.status, 'installed');
|
|
358
362
|
assert.deepEqual(outcome.hosts.map(host => host.host), ['claude']);
|
|
359
363
|
assert.deepEqual(runner.calls.map(call => [call.executable, ...call.commandArguments]), [
|
|
360
|
-
['claude', 'plugin', 'marketplace', 'add', 'jl-cmd-projects/claude-
|
|
361
|
-
['claude', 'plugin', 'marketplace', 'update', 'claude-
|
|
362
|
-
['claude', 'plugin', 'install', 'usage-wrapup@claude-
|
|
363
|
-
['claude', 'plugin', 'update', 'usage-wrapup@claude-
|
|
364
|
+
['claude', 'plugin', 'marketplace', 'add', 'jl-cmd-projects/claude-mods-framework'],
|
|
365
|
+
['claude', 'plugin', 'marketplace', 'update', 'claude-mods-framework'],
|
|
366
|
+
['claude', 'plugin', 'install', 'usage-wrapup@claude-mods-framework'],
|
|
367
|
+
['claude', 'plugin', 'update', 'usage-wrapup@claude-mods-framework'],
|
|
364
368
|
]);
|
|
365
369
|
for (const call of runner.calls) {
|
|
366
370
|
assert.deepEqual(call.environment, { CLAUDE_CONFIG_DIR: ROOTS.claudeRoot });
|
|
@@ -391,39 +395,30 @@ test('the usage-wrapup opt-out flag and variable turn off only usage-wrapup', ()
|
|
|
391
395
|
);
|
|
392
396
|
});
|
|
393
397
|
|
|
394
|
-
for (const [
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
const marketplace = JSON.parse(readFileSync(
|
|
400
|
-
new URL('../../../.claude-plugin/marketplace.json', import.meta.url),
|
|
401
|
-
'utf8',
|
|
402
|
-
));
|
|
403
|
-
const [pluginName, marketplaceName] = spec.pluginIdentifier.split('@');
|
|
404
|
-
assert.equal(marketplace.name, marketplaceName);
|
|
405
|
-
const entry = marketplace.plugins.find(plugin => plugin.name === pluginName);
|
|
406
|
-
assert.ok(entry, `the marketplace lists ${pluginName}`);
|
|
407
|
-
assert.equal(entry.source, packageFolder);
|
|
408
|
-
assert.ok(spec.sparsePaths.includes(packageFolder.slice(2)), `the sparse checkout holds ${packageFolder}`);
|
|
398
|
+
for (const spec of [DRAWER_CORE_PLUGIN_SPEC, USAGE_WRAPUP_PLUGIN_SPEC, SUBAGENT_MODELS_PLUGIN_SPEC]) {
|
|
399
|
+
test(`${spec.name} comes from the whole mods framework marketplace`, () => {
|
|
400
|
+
assert.equal(spec.marketplaceRepository, 'jl-cmd-projects/claude-mods-framework');
|
|
401
|
+
assert.equal(spec.pluginIdentifier, `${spec.name}@claude-mods-framework`);
|
|
402
|
+
assert.deepEqual(spec.sparsePaths, []);
|
|
409
403
|
});
|
|
410
404
|
}
|
|
411
405
|
|
|
412
|
-
test('should add and update the
|
|
406
|
+
test('should add and update the mods framework marketplace once for drawer-core, usage-wrapup and subagent-models', () => {
|
|
413
407
|
const runner = recordingRunner();
|
|
414
|
-
const outcome = installMarketplacePlugins(
|
|
408
|
+
const outcome = installMarketplacePlugins(
|
|
409
|
+
[DRAWER_CORE_PLUGIN_SPEC, USAGE_WRAPUP_PLUGIN_SPEC, SUBAGENT_MODELS_PLUGIN_SPEC], ROOTS, runner,
|
|
410
|
+
);
|
|
415
411
|
assert.equal(outcome.status, 'installed');
|
|
416
412
|
assert.deepEqual(outcome.hosts.map(host => host.host), ['claude']);
|
|
417
413
|
assert.deepEqual(runner.calls.map(call => [call.executable, ...call.commandArguments]), [
|
|
418
|
-
[
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
],
|
|
422
|
-
['claude', 'plugin', '
|
|
423
|
-
['claude', 'plugin', '
|
|
424
|
-
['claude', 'plugin', '
|
|
425
|
-
['claude', 'plugin', 'update', '
|
|
426
|
-
['claude', 'plugin', 'update', 'subagent-models@claude-dev-env'],
|
|
414
|
+
['claude', 'plugin', 'marketplace', 'add', 'jl-cmd-projects/claude-mods-framework'],
|
|
415
|
+
['claude', 'plugin', 'marketplace', 'update', 'claude-mods-framework'],
|
|
416
|
+
['claude', 'plugin', 'install', 'drawer-core@claude-mods-framework'],
|
|
417
|
+
['claude', 'plugin', 'install', 'usage-wrapup@claude-mods-framework'],
|
|
418
|
+
['claude', 'plugin', 'install', 'subagent-models@claude-mods-framework'],
|
|
419
|
+
['claude', 'plugin', 'update', 'drawer-core@claude-mods-framework'],
|
|
420
|
+
['claude', 'plugin', 'update', 'usage-wrapup@claude-mods-framework'],
|
|
421
|
+
['claude', 'plugin', 'update', 'subagent-models@claude-mods-framework'],
|
|
427
422
|
]);
|
|
428
423
|
});
|
|
429
424
|
|
|
@@ -437,6 +432,57 @@ test('the repository marketplace no longer lists a retired plugin', () => {
|
|
|
437
432
|
assert.equal(allListedNames.includes(eachRetiredSpec.name), false, `${eachRetiredSpec.name} is retired`);
|
|
438
433
|
}
|
|
439
434
|
assert.deepEqual(ALL_RETIRED_PLUGIN_SPECS.map(spec => spec.pluginIdentifier), ['deepen-first-prompt@claude-dev-env']);
|
|
435
|
+
for (const eachReplacedSpec of ALL_REPLACED_PLUGIN_SPECS) {
|
|
436
|
+
assert.equal(allListedNames.includes(eachReplacedSpec.name), false, `${eachReplacedSpec.name} moved out`);
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
test('should remove each old copy whose mods framework replacement installed', () => {
|
|
441
|
+
assert.deepEqual(
|
|
442
|
+
replacedSpecsToRemove(
|
|
443
|
+
ALL_REPLACED_PLUGIN_SPECS,
|
|
444
|
+
[DRAWER_CORE_PLUGIN_SPEC, USAGE_WRAPUP_PLUGIN_SPEC, SUBAGENT_MODELS_PLUGIN_SPEC],
|
|
445
|
+
{ status: 'installed' },
|
|
446
|
+
).map(spec => spec.pluginIdentifier),
|
|
447
|
+
['usage-wrapup@claude-dev-env', 'subagent-models@claude-dev-env'],
|
|
448
|
+
);
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
test('should keep the old usage-wrapup copy when the install skipped usage-wrapup', () => {
|
|
452
|
+
assert.deepEqual(
|
|
453
|
+
replacedSpecsToRemove(
|
|
454
|
+
ALL_REPLACED_PLUGIN_SPECS,
|
|
455
|
+
[DRAWER_CORE_PLUGIN_SPEC, SUBAGENT_MODELS_PLUGIN_SPEC],
|
|
456
|
+
{ status: 'installed' },
|
|
457
|
+
).map(spec => spec.pluginIdentifier),
|
|
458
|
+
['subagent-models@claude-dev-env'],
|
|
459
|
+
);
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
for (const status of ['failed', 'skipped']) {
|
|
463
|
+
test(`should keep every old copy when the mods framework install ${status}`, () => {
|
|
464
|
+
assert.deepEqual(
|
|
465
|
+
replacedSpecsToRemove(
|
|
466
|
+
ALL_REPLACED_PLUGIN_SPECS,
|
|
467
|
+
[DRAWER_CORE_PLUGIN_SPEC, USAGE_WRAPUP_PLUGIN_SPEC, SUBAGENT_MODELS_PLUGIN_SPEC],
|
|
468
|
+
{ status },
|
|
469
|
+
),
|
|
470
|
+
[],
|
|
471
|
+
);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
test('a Claude home that holds the old subagent-models copy gets only that copy uninstalled', (context) => {
|
|
476
|
+
const claudeRoot = mkdtempSync(join(tmpdir(), 'retired-plugin-'));
|
|
477
|
+
context.after(() => rmSync(claudeRoot, { recursive: true, force: true }));
|
|
478
|
+
mkdirSync(join(claudeRoot, 'plugins', 'cache', 'claude-dev-env', 'subagent-models', '0.3.0'), { recursive: true });
|
|
479
|
+
mkdirSync(join(claudeRoot, 'plugins', 'cache', 'claude-mods-framework', 'usage-wrapup', '0.4.0'), { recursive: true });
|
|
480
|
+
const runner = recordingRunner();
|
|
481
|
+
const outcome = removeRetiredMarketplacePlugins(ALL_REPLACED_PLUGIN_SPECS, { claudeRoot, environment: {} }, runner);
|
|
482
|
+
assert.deepEqual(runner.calls.map(call => [call.executable, ...call.commandArguments]), [
|
|
483
|
+
['claude', 'plugin', 'uninstall', 'subagent-models@claude-dev-env'],
|
|
484
|
+
]);
|
|
485
|
+
assert.deepEqual(outcome.removedIdentifiers, ['subagent-models@claude-dev-env']);
|
|
440
486
|
});
|
|
441
487
|
|
|
442
488
|
test('a Claude home that holds a retired plugin gets it uninstalled and its orphaned versions deleted', (context) => {
|
|
@@ -456,6 +502,17 @@ test('a Claude home that holds a retired plugin gets it uninstalled and its orph
|
|
|
456
502
|
assert.deepEqual(runner.calls[0].environment, { CLAUDE_CONFIG_DIR: claudeRoot });
|
|
457
503
|
assert.deepEqual(outcome.removedIdentifiers, ['deepen-first-prompt@claude-dev-env']);
|
|
458
504
|
assert.equal(existsSync(orphanedVersion), false);
|
|
505
|
+
assert.equal(existsSync(versionsDirectory), false);
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
test('should run no command for a retired plugin whose cache folder holds no version', (context) => {
|
|
509
|
+
const claudeRoot = mkdtempSync(join(tmpdir(), 'retired-plugin-'));
|
|
510
|
+
context.after(() => rmSync(claudeRoot, { recursive: true, force: true }));
|
|
511
|
+
mkdirSync(join(claudeRoot, 'plugins', 'cache', 'claude-dev-env', 'subagent-models'), { recursive: true });
|
|
512
|
+
const runner = recordingRunner();
|
|
513
|
+
const outcome = removeRetiredMarketplacePlugins(ALL_REPLACED_PLUGIN_SPECS, { claudeRoot, environment: {} }, runner);
|
|
514
|
+
assert.deepEqual(runner.calls, []);
|
|
515
|
+
assert.deepEqual(outcome.failedRemovals, []);
|
|
459
516
|
});
|
|
460
517
|
|
|
461
518
|
test('a Claude home with no retired plugin runs no command', (context) => {
|
|
@@ -484,10 +541,24 @@ test('a failed retired plugin uninstall is reported as failed and keeps its cach
|
|
|
484
541
|
test('should refuse one plan for plugins from two marketplaces', () => {
|
|
485
542
|
assert.throws(
|
|
486
543
|
() => marketplacePluginsPlan([PSTACK_PLUGIN_SPEC, SUBAGENT_MODELS_PLUGIN_SPEC], 'claude'),
|
|
487
|
-
/subagent-models comes from jl-cmd-projects\/claude-
|
|
544
|
+
/subagent-models comes from jl-cmd-projects\/claude-mods-framework/,
|
|
488
545
|
);
|
|
489
546
|
});
|
|
490
547
|
|
|
548
|
+
for (const [optOutArguments, optOutEnvironment, expectedNames] of [
|
|
549
|
+
[[], {}, ['drawer-core', 'usage-wrapup', 'subagent-models']],
|
|
550
|
+
[['--no-subagent-models'], {}, ['drawer-core', 'usage-wrapup']],
|
|
551
|
+
[[], { CDE_INSTALL_USAGE_WRAPUP: '0' }, ['drawer-core', 'subagent-models']],
|
|
552
|
+
[['--no-usage-wrapup', '--no-subagent-models'], {}, []],
|
|
553
|
+
]) {
|
|
554
|
+
test(`should install drawer-core with each plugin that needs it for ${JSON.stringify([optOutArguments, optOutEnvironment])}`, () => {
|
|
555
|
+
assert.deepEqual(
|
|
556
|
+
modsFrameworkPluginSpecs(optOutArguments, optOutEnvironment).map(spec => spec.name),
|
|
557
|
+
expectedNames,
|
|
558
|
+
);
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
|
|
491
562
|
test('should turn off only subagent-models with its opt-out flag or variable', () => {
|
|
492
563
|
assert.equal(shouldInstallMarketplacePlugin(SUBAGENT_MODELS_PLUGIN_SPEC, [], {}), true);
|
|
493
564
|
assert.equal(shouldInstallMarketplacePlugin(SUBAGENT_MODELS_PLUGIN_SPEC, ['--no-subagent-models'], {}), false);
|
|
@@ -573,7 +644,7 @@ test('a held folder that was not searched adds no claim about what holds it', ()
|
|
|
573
644
|
|
|
574
645
|
test('should delete a half-made marketplace clone before the shared marketplace add', () => {
|
|
575
646
|
const claudeRoot = mkdtempSync(join(tmpdir(), 'cde-stale-clone-'));
|
|
576
|
-
const cloneDirectory = join(claudeRoot, 'plugins', 'marketplaces', 'jl-cmd-projects-claude-
|
|
647
|
+
const cloneDirectory = join(claudeRoot, 'plugins', 'marketplaces', 'jl-cmd-projects-claude-mods-framework..clone');
|
|
577
648
|
mkdirSync(join(cloneDirectory, '.git'), { recursive: true });
|
|
578
649
|
writeFileSync(join(cloneDirectory, '.git', 'shallow.lock'), '');
|
|
579
650
|
const allCloneStatesAtAdd = [];
|
package/bin/install.mjs
CHANGED
|
@@ -56,13 +56,14 @@ import {
|
|
|
56
56
|
ALL_CODEX_NATIVE_POST_TOOL_USE_HOOK_SCRIPT_NAMES,
|
|
57
57
|
} from './install-constants.mjs';
|
|
58
58
|
import {
|
|
59
|
+
ALL_REPLACED_PLUGIN_SPECS,
|
|
59
60
|
ALL_RETIRED_PLUGIN_SPECS,
|
|
60
61
|
PSTACK_PLUGIN_SPEC,
|
|
61
62
|
SECURITY_GUIDANCE_PLUGIN_SPEC,
|
|
62
|
-
SUBAGENT_MODELS_PLUGIN_SPEC,
|
|
63
|
-
USAGE_WRAPUP_PLUGIN_SPEC,
|
|
64
63
|
installMarketplacePlugins,
|
|
64
|
+
modsFrameworkPluginSpecs,
|
|
65
65
|
removeRetiredMarketplacePlugins,
|
|
66
|
+
replacedSpecsToRemove,
|
|
66
67
|
shouldInstallMarketplacePlugin,
|
|
67
68
|
} from './install-pstack-plugin.mjs';
|
|
68
69
|
import {
|
|
@@ -481,6 +482,17 @@ function printPluginHostOutcomes(allSpecs, pluginOutcome) {
|
|
|
481
482
|
}
|
|
482
483
|
}
|
|
483
484
|
|
|
485
|
+
function removeAndReportRetiredPlugins(allRetiredSpecs) {
|
|
486
|
+
const retiredPlugins = removeRetiredMarketplacePlugins(allRetiredSpecs, { claudeRoot: CLAUDE_HOME });
|
|
487
|
+
for (const eachIdentifier of retiredPlugins.removedIdentifiers) {
|
|
488
|
+
console.log(` Retired plugin uninstalled: ${eachIdentifier}`);
|
|
489
|
+
}
|
|
490
|
+
for (const eachFailure of retiredPlugins.failedRemovals) {
|
|
491
|
+
console.warn(` Warning: retired plugin ${eachFailure.pluginIdentifier} was not uninstalled: ${eachFailure.detail}`);
|
|
492
|
+
}
|
|
493
|
+
return retiredPlugins;
|
|
494
|
+
}
|
|
495
|
+
|
|
484
496
|
function printActionNeeded() {
|
|
485
497
|
if (allActionNeededLines.length === 0) return;
|
|
486
498
|
console.warn(`Action needed (${allActionNeededLines.length}):`);
|
|
@@ -3171,27 +3183,18 @@ function executeInstallPlanMutations(plan, transactionHelpers) {
|
|
|
3171
3183
|
if (retiredCursorHooksPath) {
|
|
3172
3184
|
console.log(` Retired first-task hook removed from ${retiredCursorHooksPath}`);
|
|
3173
3185
|
}
|
|
3174
|
-
|
|
3175
|
-
claudeRoot: CLAUDE_HOME,
|
|
3176
|
-
});
|
|
3177
|
-
summary.retiredPlugins = retiredPlugins;
|
|
3178
|
-
for (const eachIdentifier of retiredPlugins.removedIdentifiers) {
|
|
3179
|
-
console.log(` Retired plugin uninstalled: ${eachIdentifier}`);
|
|
3180
|
-
}
|
|
3181
|
-
for (const eachFailure of retiredPlugins.failedRemovals) {
|
|
3182
|
-
console.warn(` Warning: retired plugin ${eachFailure.pluginIdentifier} was not uninstalled: ${eachFailure.detail}`);
|
|
3183
|
-
}
|
|
3186
|
+
summary.retiredPlugins = removeAndReportRetiredPlugins(ALL_RETIRED_PLUGIN_SPECS);
|
|
3184
3187
|
}
|
|
3185
|
-
const
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
].filter(eachSpec => shouldInstallMarketplacePlugin(eachSpec));
|
|
3189
|
-
if (!selectedGroups && allRepositoryPluginSpecs.length > 0) {
|
|
3190
|
-
const repositoryPlugins = installMarketplacePlugins(allRepositoryPluginSpecs, {
|
|
3188
|
+
const allModsFrameworkPluginSpecs = modsFrameworkPluginSpecs();
|
|
3189
|
+
if (!selectedGroups && allModsFrameworkPluginSpecs.length > 0) {
|
|
3190
|
+
const modsFrameworkPlugins = installMarketplacePlugins(allModsFrameworkPluginSpecs, {
|
|
3191
3191
|
claudeRoot: CLAUDE_HOME,
|
|
3192
3192
|
});
|
|
3193
|
-
summary.
|
|
3194
|
-
printPluginHostOutcomes(
|
|
3193
|
+
summary.modsFrameworkPlugins = modsFrameworkPlugins;
|
|
3194
|
+
printPluginHostOutcomes(allModsFrameworkPluginSpecs, modsFrameworkPlugins);
|
|
3195
|
+
summary.replacedPlugins = removeAndReportRetiredPlugins(replacedSpecsToRemove(
|
|
3196
|
+
ALL_REPLACED_PLUGIN_SPECS, allModsFrameworkPluginSpecs, modsFrameworkPlugins,
|
|
3197
|
+
));
|
|
3195
3198
|
}
|
|
3196
3199
|
if (!selectedGroups && shouldInstallMarketplacePlugin(SECURITY_GUIDANCE_PLUGIN_SPEC)) {
|
|
3197
3200
|
const securityGuidancePlugin = installMarketplacePlugins([SECURITY_GUIDANCE_PLUGIN_SPEC], {
|
package/bin/install.test.mjs
CHANGED
|
@@ -3420,17 +3420,19 @@ test('a pstack install after a --no-pstack install seeds the Codex model sheet',
|
|
|
3420
3420
|
});
|
|
3421
3421
|
|
|
3422
3422
|
const USAGE_WRAPUP_CLAUDE_COMMANDS = Object.freeze([
|
|
3423
|
-
'claude plugin marketplace add jl-cmd-projects/claude-
|
|
3424
|
-
'claude plugin marketplace update claude-
|
|
3425
|
-
'claude plugin install
|
|
3426
|
-
'claude plugin
|
|
3423
|
+
'claude plugin marketplace add jl-cmd-projects/claude-mods-framework',
|
|
3424
|
+
'claude plugin marketplace update claude-mods-framework',
|
|
3425
|
+
'claude plugin install drawer-core@claude-mods-framework',
|
|
3426
|
+
'claude plugin install usage-wrapup@claude-mods-framework',
|
|
3427
|
+
'claude plugin update drawer-core@claude-mods-framework',
|
|
3428
|
+
'claude plugin update usage-wrapup@claude-mods-framework',
|
|
3427
3429
|
]);
|
|
3428
3430
|
|
|
3429
3431
|
function usageWrapupCommands(allRecordedCommands) {
|
|
3430
|
-
return allRecordedCommands.filter(eachCommand => eachCommand.includes('claude-
|
|
3432
|
+
return allRecordedCommands.filter(eachCommand => eachCommand.includes('claude-mods-framework'));
|
|
3431
3433
|
}
|
|
3432
3434
|
|
|
3433
|
-
test('a full install adds
|
|
3435
|
+
test('a full install adds the mods framework marketplace and installs usage-wrapup with drawer-core on Claude only', t => {
|
|
3434
3436
|
const sandbox = pstackPluginSandbox(t);
|
|
3435
3437
|
|
|
3436
3438
|
const installerOutput = runPstackInstaller(sandbox.homeDirectory, [], {
|
|
@@ -3498,16 +3500,18 @@ test('the help output names the usage-wrapup opt-out beside the pstack one', ()
|
|
|
3498
3500
|
assert.doesNotMatch(helpRun.stdout, /--no-deepen-first-prompt/);
|
|
3499
3501
|
});
|
|
3500
3502
|
|
|
3501
|
-
const
|
|
3502
|
-
'claude plugin marketplace add jl-cmd-projects/claude-
|
|
3503
|
-
'claude plugin marketplace update claude-
|
|
3504
|
-
'claude plugin install
|
|
3505
|
-
'claude plugin install
|
|
3506
|
-
'claude plugin
|
|
3507
|
-
'claude plugin update
|
|
3503
|
+
const MODS_FRAMEWORK_PLUGIN_CLAUDE_COMMANDS = Object.freeze([
|
|
3504
|
+
'claude plugin marketplace add jl-cmd-projects/claude-mods-framework',
|
|
3505
|
+
'claude plugin marketplace update claude-mods-framework',
|
|
3506
|
+
'claude plugin install drawer-core@claude-mods-framework',
|
|
3507
|
+
'claude plugin install usage-wrapup@claude-mods-framework',
|
|
3508
|
+
'claude plugin install subagent-models@claude-mods-framework',
|
|
3509
|
+
'claude plugin update drawer-core@claude-mods-framework',
|
|
3510
|
+
'claude plugin update usage-wrapup@claude-mods-framework',
|
|
3511
|
+
'claude plugin update subagent-models@claude-mods-framework',
|
|
3508
3512
|
]);
|
|
3509
3513
|
|
|
3510
|
-
test('should install subagent-models beside usage-wrapup with one marketplace add on a full install', t => {
|
|
3514
|
+
test('should install drawer-core and subagent-models beside usage-wrapup with one marketplace add on a full install', t => {
|
|
3511
3515
|
const sandbox = pstackPluginSandbox(t);
|
|
3512
3516
|
|
|
3513
3517
|
const installerOutput = runPstackInstaller(sandbox.homeDirectory, ['--no-pstack'], {
|
|
@@ -3516,9 +3520,10 @@ test('should install subagent-models beside usage-wrapup with one marketplace ad
|
|
|
3516
3520
|
CDE_INSTALL_SUBAGENT_MODELS: '1',
|
|
3517
3521
|
});
|
|
3518
3522
|
|
|
3519
|
-
assert.deepEqual(usageWrapupCommands(sandbox.recordedCommands()),
|
|
3523
|
+
assert.deepEqual(usageWrapupCommands(sandbox.recordedCommands()), MODS_FRAMEWORK_PLUGIN_CLAUDE_COMMANDS);
|
|
3520
3524
|
assert.match(installerOutput, /Usage-wrapup \(claude\): installed/);
|
|
3521
3525
|
assert.match(installerOutput, /Subagent-models \(claude\): installed/);
|
|
3526
|
+
assert.match(installerOutput, /Drawer-core \(claude\): installed/);
|
|
3522
3527
|
assert.doesNotMatch(installerOutput, /Deepen-first-prompt \(/);
|
|
3523
3528
|
});
|
|
3524
3529
|
|
|
@@ -3536,10 +3541,10 @@ for (const [caseName, extraArguments, environmentOverrides] of [
|
|
|
3536
3541
|
});
|
|
3537
3542
|
|
|
3538
3543
|
assert.equal(
|
|
3539
|
-
sandbox.recordedCommands().some(eachCommand => eachCommand.includes('subagent-models')),
|
|
3544
|
+
sandbox.recordedCommands().some(eachCommand => eachCommand.includes('subagent-models') || eachCommand.includes('drawer-core')),
|
|
3540
3545
|
false,
|
|
3541
3546
|
);
|
|
3542
|
-
assert.doesNotMatch(installerOutput, /Subagent-models \(/);
|
|
3547
|
+
assert.doesNotMatch(installerOutput, /Subagent-models \(|Drawer-core \(/);
|
|
3543
3548
|
});
|
|
3544
3549
|
}
|
|
3545
3550
|
|