specweave 1.0.474 → 1.0.475
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.
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Refresh SpecWeave Plugins
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* When Claude Code CLI is available and supports plugin commands, uses the
|
|
5
|
+
* native `claude plugin install` flow for proper marketplace registration,
|
|
6
|
+
* settings enablement, and scope management.
|
|
7
|
+
*
|
|
8
|
+
* Falls back to direct file copy into .claude/skills/ when Claude CLI is
|
|
9
|
+
* unavailable (e.g. Cursor, Windsurf, or other non-Claude tools).
|
|
6
10
|
*
|
|
7
11
|
* @since 1.0.279
|
|
8
12
|
* @updated 1.0.535 - Migrated from CLI-based install to direct file copy
|
|
13
|
+
* @updated 1.0.475 - Restored native Claude CLI install when available
|
|
9
14
|
*/
|
|
10
15
|
export interface RefreshPluginsOptions {
|
|
11
16
|
verbose?: boolean;
|
|
@@ -14,7 +19,11 @@ export interface RefreshPluginsOptions {
|
|
|
14
19
|
all?: boolean;
|
|
15
20
|
}
|
|
16
21
|
/**
|
|
17
|
-
* Refresh plugins
|
|
22
|
+
* Refresh plugins using the best available installation method.
|
|
23
|
+
*
|
|
24
|
+
* When Claude Code CLI is available, uses native `claude plugin install` for
|
|
25
|
+
* proper marketplace registration, scope management, and settings enablement.
|
|
26
|
+
* Falls back to direct file copy when CLI is unavailable.
|
|
18
27
|
*
|
|
19
28
|
* Always installs all plugins. Uses hash comparison to skip unchanged ones.
|
|
20
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-plugins.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/refresh-plugins.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"refresh-plugins.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/refresh-plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAsBH,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yEAAyE;IACzE,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAoDD;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAsF9F"}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Refresh SpecWeave Plugins
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* When Claude Code CLI is available and supports plugin commands, uses the
|
|
5
|
+
* native `claude plugin install` flow for proper marketplace registration,
|
|
6
|
+
* settings enablement, and scope management.
|
|
7
|
+
*
|
|
8
|
+
* Falls back to direct file copy into .claude/skills/ when Claude CLI is
|
|
9
|
+
* unavailable (e.g. Cursor, Windsurf, or other non-Claude tools).
|
|
6
10
|
*
|
|
7
11
|
* @since 1.0.279
|
|
8
12
|
* @updated 1.0.535 - Migrated from CLI-based install to direct file copy
|
|
13
|
+
* @updated 1.0.475 - Restored native Claude CLI install when available
|
|
9
14
|
*/
|
|
10
15
|
import chalk from 'chalk';
|
|
11
16
|
import * as fs from 'fs';
|
|
12
17
|
import * as path from 'path';
|
|
13
18
|
import { consoleLogger as logger } from '../../utils/logger.js';
|
|
14
19
|
import { getDirname } from '../../utils/esm-helpers.js';
|
|
15
|
-
import { copyPluginSkillsToProject, findSpecweaveRoot, } from '../../utils/plugin-copier.js';
|
|
20
|
+
import { copyPluginSkillsToProject, installPlugin, findSpecweaveRoot, } from '../../utils/plugin-copier.js';
|
|
16
21
|
import { getProjectRoot } from '../../utils/find-project-root.js';
|
|
22
|
+
import { detectClaudeCli } from '../../utils/claude-cli-detector.js';
|
|
23
|
+
import { enablePluginsInSettings } from '../helpers/init/claude-plugin-enabler.js';
|
|
17
24
|
const __dirname = getDirname(import.meta.url);
|
|
18
25
|
// ---------------------------------------------------------------------------
|
|
19
26
|
// Helpers
|
|
@@ -56,13 +63,25 @@ function getAvailablePlugins(marketplacePath) {
|
|
|
56
63
|
// Main command
|
|
57
64
|
// ---------------------------------------------------------------------------
|
|
58
65
|
/**
|
|
59
|
-
* Refresh plugins
|
|
66
|
+
* Refresh plugins using the best available installation method.
|
|
67
|
+
*
|
|
68
|
+
* When Claude Code CLI is available, uses native `claude plugin install` for
|
|
69
|
+
* proper marketplace registration, scope management, and settings enablement.
|
|
70
|
+
* Falls back to direct file copy when CLI is unavailable.
|
|
60
71
|
*
|
|
61
72
|
* Always installs all plugins. Uses hash comparison to skip unchanged ones.
|
|
62
73
|
*/
|
|
63
74
|
export async function refreshPluginsCommand(options = {}) {
|
|
75
|
+
// Step 0: Detect Claude CLI for native install support
|
|
76
|
+
const cliStatus = detectClaudeCli();
|
|
77
|
+
const useNativeCli = cliStatus.available && cliStatus.pluginCommandsWork;
|
|
64
78
|
console.log(chalk.blue.bold('\n SpecWeave Plugin Refresh'));
|
|
65
|
-
|
|
79
|
+
if (useNativeCli) {
|
|
80
|
+
console.log(chalk.blue.bold(` Mode: native Claude CLI (claude plugin install)\n`));
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
console.log(chalk.blue.bold(` Mode: direct copy to .claude/skills/\n`));
|
|
84
|
+
}
|
|
66
85
|
// Step 1: Find specweave root
|
|
67
86
|
const specweaveRoot = resolveSpecweaveRoot();
|
|
68
87
|
if (!specweaveRoot) {
|
|
@@ -81,21 +100,24 @@ export async function refreshPluginsCommand(options = {}) {
|
|
|
81
100
|
console.log(chalk.gray(` Found ${allPlugins.length} plugins in marketplace.json`));
|
|
82
101
|
// Step 3: Determine project root
|
|
83
102
|
const projectRoot = getProjectRoot();
|
|
84
|
-
// Step 4: Process each plugin
|
|
103
|
+
// Step 4: Process each plugin
|
|
85
104
|
let installed = 0;
|
|
86
105
|
let skipped = 0;
|
|
87
106
|
let failed = 0;
|
|
107
|
+
const installedPluginNames = [];
|
|
88
108
|
for (const plugin of allPlugins) {
|
|
89
|
-
const result =
|
|
90
|
-
force: options.force
|
|
91
|
-
|
|
109
|
+
const result = useNativeCli
|
|
110
|
+
? installPlugin(plugin.name, specweaveRoot, { force: options.force })
|
|
111
|
+
: copyPluginSkillsToProject(plugin.name, specweaveRoot, projectRoot, { force: options.force });
|
|
92
112
|
if (result.success && result.skipped) {
|
|
93
113
|
console.log(chalk.green(` ✓ ${plugin.name}: active`));
|
|
94
114
|
skipped++;
|
|
115
|
+
installedPluginNames.push(plugin.name);
|
|
95
116
|
}
|
|
96
117
|
else if (result.success) {
|
|
97
118
|
console.log(chalk.green(` + ${plugin.name}: installed`));
|
|
98
119
|
installed++;
|
|
120
|
+
installedPluginNames.push(plugin.name);
|
|
99
121
|
}
|
|
100
122
|
else {
|
|
101
123
|
console.log(chalk.red(` ✗ ${plugin.name}: failed`));
|
|
@@ -105,6 +127,13 @@ export async function refreshPluginsCommand(options = {}) {
|
|
|
105
127
|
failed++;
|
|
106
128
|
}
|
|
107
129
|
}
|
|
130
|
+
// Step 4b: Enable plugins in Claude Code settings (native mode only)
|
|
131
|
+
if (useNativeCli && installedPluginNames.length > 0) {
|
|
132
|
+
const enabled = enablePluginsInSettings(installedPluginNames);
|
|
133
|
+
if (enabled) {
|
|
134
|
+
logger.debug('Enabled plugins in ~/.claude/settings.json');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
108
137
|
// Step 5: Summary
|
|
109
138
|
console.log('');
|
|
110
139
|
console.log(chalk.blue.bold(' Summary'));
|
|
@@ -117,7 +146,12 @@ export async function refreshPluginsCommand(options = {}) {
|
|
|
117
146
|
if (installed === 0 && skipped === 0 && failed === 0) {
|
|
118
147
|
console.log(chalk.gray(' No plugins processed'));
|
|
119
148
|
}
|
|
120
|
-
|
|
149
|
+
if (useNativeCli) {
|
|
150
|
+
console.log(chalk.gray(` Location: ~/.claude/plugins/cache/ (native)`));
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
console.log(chalk.gray(` Location: .claude/skills/ (project-local)`));
|
|
154
|
+
}
|
|
121
155
|
console.log('');
|
|
122
156
|
}
|
|
123
157
|
//# sourceMappingURL=refresh-plugins.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-plugins.js","sourceRoot":"","sources":["../../../../src/cli/commands/refresh-plugins.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"refresh-plugins.js","sourceRoot":"","sources":["../../../../src/cli/commands/refresh-plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAEnF,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAoB9C,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;GAEG;AACH,SAAS,oBAAoB;IAC3B,MAAM,QAAQ,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC9C,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE9B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,C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,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specweave",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.475",
|
|
4
4
|
"description": "100+ domain-expert AI skills — PM, Architect, Frontend, QA, Security and more. Skills learn your team's patterns permanently. Spec-first planning, autonomous execution, multi-agent teams, synced to GitHub/JIRA. Claude Code, Cursor, Copilot & more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|