@claude-flow/cli 3.36.0 → 3.38.0
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/.claude/agents/github/code-review-swarm.md +1 -1
- package/.claude/agents/github/issue-tracker.md +1 -1
- package/.claude/agents/github/pr-manager.md +1 -1
- package/.claude/agents/github/release-manager.md +2 -2
- package/.claude/agents/github/repo-architect.md +2 -2
- package/.claude/agents/github/workflow-automation.md +1 -1
- package/.claude/agents/optimization/benchmark-suite.md +8 -8
- package/.claude/agents/optimization/load-balancer.md +7 -7
- package/.claude/agents/optimization/performance-monitor.md +8 -8
- package/.claude/agents/optimization/resource-allocator.md +9 -9
- package/.claude/agents/optimization/topology-optimizer.md +8 -8
- package/.claude/commands/agents/README.md +4 -4
- package/.claude/commands/agents/agent-capabilities.md +1 -1
- package/.claude/commands/agents/agent-coordination.md +3 -3
- package/.claude/commands/agents/agent-types.md +2 -2
- package/.claude/commands/agents/health.md +10 -10
- package/.claude/commands/agents/list.md +8 -8
- package/.claude/commands/agents/logs.md +16 -16
- package/.claude/commands/agents/metrics.md +9 -9
- package/.claude/commands/agents/pool.md +10 -10
- package/.claude/commands/agents/spawn.md +35 -35
- package/.claude/commands/agents/status.md +9 -9
- package/.claude/commands/agents/stop.md +15 -15
- package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +1 -1
- package/.claude/commands/analysis/bottleneck-detect.md +5 -5
- package/.claude/commands/analysis/performance-report.md +4 -4
- package/.claude/commands/analysis/token-usage.md +4 -4
- package/.claude/commands/automation/auto-agent.md +5 -5
- package/.claude/commands/automation/self-healing.md +1 -1
- package/.claude/commands/automation/session-memory.md +1 -1
- package/.claude/commands/automation/smart-agents.md +1 -1
- package/.claude/commands/automation/smart-spawn.md +4 -4
- package/.claude/commands/automation/workflow-select.md +4 -4
- package/.claude/commands/claude-flow-help.md +1 -1
- package/.claude/commands/coordination/agent-spawn.md +4 -4
- package/.claude/commands/coordination/swarm-init.md +5 -5
- package/.claude/commands/coordination/task-orchestrate.md +4 -4
- package/.claude/commands/github/code-review.md +4 -4
- package/.claude/commands/github/github-swarm.md +5 -5
- package/.claude/commands/github/issue-triage.md +4 -4
- package/.claude/commands/github/pr-enhance.md +4 -4
- package/.claude/commands/github/release-manager.md +1 -1
- package/.claude/commands/github/repo-analyze.md +4 -4
- package/.claude/commands/github/repo-architect.md +2 -2
- package/.claude/commands/hive-mind/hive-mind-consensus.md +1 -1
- package/.claude/commands/hive-mind/hive-mind-init.md +3 -3
- package/.claude/commands/hive-mind/hive-mind-memory.md +1 -1
- package/.claude/commands/hive-mind/hive-mind-metrics.md +1 -1
- package/.claude/commands/hive-mind/hive-mind-resume.md +1 -1
- package/.claude/commands/hive-mind/hive-mind-sessions.md +1 -1
- package/.claude/commands/hive-mind/hive-mind-spawn.md +4 -4
- package/.claude/commands/hive-mind/hive-mind-status.md +1 -1
- package/.claude/commands/hive-mind/hive-mind-stop.md +1 -1
- package/.claude/commands/hive-mind/hive-mind-wizard.md +1 -1
- package/.claude/commands/hive-mind/hive-mind.md +4 -4
- package/.claude/commands/hooks/overview.md +1 -1
- package/.claude/commands/hooks/post-edit.md +6 -6
- package/.claude/commands/hooks/post-task.md +6 -6
- package/.claude/commands/hooks/pre-edit.md +6 -6
- package/.claude/commands/hooks/pre-task.md +6 -6
- package/.claude/commands/hooks/session-end.md +6 -6
- package/.claude/commands/hooks/setup.md +6 -6
- package/.claude/commands/memory/memory-persist.md +4 -4
- package/.claude/commands/memory/memory-search.md +4 -4
- package/.claude/commands/memory/memory-usage.md +4 -4
- package/.claude/commands/monitoring/agent-metrics.md +4 -4
- package/.claude/commands/monitoring/real-time-view.md +4 -4
- package/.claude/commands/monitoring/swarm-monitor.md +4 -4
- package/.claude/commands/optimization/auto-topology.md +2 -2
- package/.claude/commands/optimization/cache-manage.md +4 -4
- package/.claude/commands/optimization/parallel-execute.md +4 -4
- package/.claude/commands/optimization/parallel-execution.md +1 -1
- package/.claude/commands/optimization/topology-optimize.md +4 -4
- package/.claude/commands/sparc/analyzer.md +1 -1
- package/.claude/commands/sparc/architect.md +1 -1
- package/.claude/commands/sparc/ask.md +5 -5
- package/.claude/commands/sparc/batch-executor.md +1 -1
- package/.claude/commands/sparc/code.md +5 -5
- package/.claude/commands/sparc/coder.md +1 -1
- package/.claude/commands/sparc/debug.md +5 -5
- package/.claude/commands/sparc/debugger.md +1 -1
- package/.claude/commands/sparc/designer.md +1 -1
- package/.claude/commands/sparc/devops.md +5 -5
- package/.claude/commands/sparc/docs-writer.md +5 -5
- package/.claude/commands/sparc/documenter.md +1 -1
- package/.claude/commands/sparc/innovator.md +1 -1
- package/.claude/commands/sparc/integration.md +5 -5
- package/.claude/commands/sparc/mcp.md +5 -5
- package/.claude/commands/sparc/memory-manager.md +1 -1
- package/.claude/commands/sparc/optimizer.md +1 -1
- package/.claude/commands/sparc/orchestrator.md +8 -8
- package/.claude/commands/sparc/post-deployment-monitoring-mode.md +5 -5
- package/.claude/commands/sparc/refinement-optimization-mode.md +5 -5
- package/.claude/commands/sparc/researcher.md +1 -1
- package/.claude/commands/sparc/reviewer.md +1 -1
- package/.claude/commands/sparc/security-review.md +5 -5
- package/.claude/commands/sparc/sparc-modes.md +11 -11
- package/.claude/commands/sparc/sparc.md +5 -5
- package/.claude/commands/sparc/spec-pseudocode.md +5 -5
- package/.claude/commands/sparc/supabase-admin.md +5 -5
- package/.claude/commands/sparc/swarm-coordinator.md +1 -1
- package/.claude/commands/sparc/tdd.md +1 -1
- package/.claude/commands/sparc/tester.md +1 -1
- package/.claude/commands/sparc/tutorial.md +5 -5
- package/.claude/commands/sparc/workflow-manager.md +1 -1
- package/.claude/commands/sparc.md +6 -6
- package/.claude/commands/swarm/analysis.md +1 -1
- package/.claude/commands/swarm/development.md +1 -1
- package/.claude/commands/swarm/examples.md +3 -3
- package/.claude/commands/swarm/maintenance.md +1 -1
- package/.claude/commands/swarm/optimization.md +1 -1
- package/.claude/commands/swarm/research.md +1 -1
- package/.claude/commands/swarm/swarm-analysis.md +1 -1
- package/.claude/commands/swarm/swarm-background.md +1 -1
- package/.claude/commands/swarm/swarm-init.md +3 -3
- package/.claude/commands/swarm/swarm-modes.md +1 -1
- package/.claude/commands/swarm/swarm-monitor.md +1 -1
- package/.claude/commands/swarm/swarm-spawn.md +3 -3
- package/.claude/commands/swarm/swarm-status.md +1 -1
- package/.claude/commands/swarm/swarm-strategies.md +1 -1
- package/.claude/commands/swarm/testing.md +1 -1
- package/.claude/commands/training/model-update.md +4 -4
- package/.claude/commands/training/neural-patterns.md +12 -12
- package/.claude/commands/training/neural-train.md +8 -8
- package/.claude/commands/training/pattern-learn.md +4 -4
- package/.claude/commands/training/specialization.md +2 -2
- package/.claude/commands/workflows/development.md +3 -3
- package/.claude/commands/workflows/research.md +2 -2
- package/.claude/commands/workflows/workflow-create.md +4 -4
- package/.claude/commands/workflows/workflow-execute.md +4 -4
- package/.claude/commands/workflows/workflow-export.md +4 -4
- package/.claude/helpers/.helpers-version +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +1 -1
- package/.claude/helpers/github-setup.sh +4 -4
- package/.claude/helpers/helpers.manifest.json +3 -3
- package/.claude/helpers/quick-start.sh +4 -4
- package/.claude/helpers/setup-mcp.sh +1 -1
- package/.claude/helpers/statusline.cjs +0 -0
- package/.claude/settings.json +1 -1
- package/.claude/skills/dual-mode/dual-spawn.md +2 -2
- package/.claude/skills/github-multi-repo/SKILL.md +21 -21
- package/.claude/skills/github-release-management/SKILL.md +19 -19
- package/.claude/skills/hooks-automation/SKILL.md +107 -107
- package/.claude/skills/sparc-methodology/SKILL.md +26 -26
- package/.claude/skills/swarm-advanced/SKILL.md +3 -3
- package/catalog-manifest.json +2 -2
- package/dist/src/commands/migrate-agent-detection.d.ts +27 -0
- package/dist/src/commands/migrate-agent-detection.js +113 -0
- package/dist/src/commands/migrate.js +41 -3
- package/dist/src/commands/proxy-lifecycle.d.ts +19 -2
- package/dist/src/commands/proxy-lifecycle.js +49 -5
- package/dist/src/commands/proxy.js +184 -23
- package/dist/src/proxy/install.d.ts +26 -0
- package/dist/src/proxy/install.js +60 -19
- package/dist/src/proxy/lifecycle.d.ts +21 -4
- package/dist/src/proxy/lifecycle.js +38 -8
- package/package.json +2 -2
|
@@ -472,28 +472,28 @@ mcp__claude-flow__swarm_monitor {
|
|
|
472
472
|
|
|
473
473
|
```bash
|
|
474
474
|
# Execute specific mode
|
|
475
|
-
npx claude-flow sparc run <mode> "task description"
|
|
475
|
+
npx @claude-flow/cli@latest sparc run <mode> "task description"
|
|
476
476
|
|
|
477
477
|
# Use alpha features
|
|
478
478
|
npx claude-flow@alpha sparc run <mode> "task description"
|
|
479
479
|
|
|
480
480
|
# List all available modes
|
|
481
|
-
npx claude-flow sparc modes
|
|
481
|
+
npx @claude-flow/cli@latest sparc modes
|
|
482
482
|
|
|
483
483
|
# Get help for specific mode
|
|
484
|
-
npx claude-flow sparc help <mode>
|
|
484
|
+
npx @claude-flow/cli@latest sparc help <mode>
|
|
485
485
|
|
|
486
486
|
# Run with options
|
|
487
|
-
npx claude-flow sparc run <mode> "task" --parallel --monitor
|
|
487
|
+
npx @claude-flow/cli@latest sparc run <mode> "task" --parallel --monitor
|
|
488
488
|
|
|
489
489
|
# Execute TDD workflow
|
|
490
|
-
npx claude-flow sparc tdd "feature description"
|
|
490
|
+
npx @claude-flow/cli@latest sparc tdd "feature description"
|
|
491
491
|
|
|
492
492
|
# Batch execution
|
|
493
|
-
npx claude-flow sparc batch <mode1,mode2,mode3> "task"
|
|
493
|
+
npx @claude-flow/cli@latest sparc batch <mode1,mode2,mode3> "task"
|
|
494
494
|
|
|
495
495
|
# Pipeline execution
|
|
496
|
-
npx claude-flow sparc pipeline "task description"
|
|
496
|
+
npx @claude-flow/cli@latest sparc pipeline "task description"
|
|
497
497
|
```
|
|
498
498
|
|
|
499
499
|
### Method 3: Local Installation
|
|
@@ -911,58 +911,58 @@ mcp__claude-flow__sparc_mode {
|
|
|
911
911
|
|
|
912
912
|
```bash
|
|
913
913
|
# Step 1: Research and planning
|
|
914
|
-
npx claude-flow sparc run researcher "authentication patterns"
|
|
914
|
+
npx @claude-flow/cli@latest sparc run researcher "authentication patterns"
|
|
915
915
|
|
|
916
916
|
# Step 2: Architecture design
|
|
917
|
-
npx claude-flow sparc run architect "design auth system"
|
|
917
|
+
npx @claude-flow/cli@latest sparc run architect "design auth system"
|
|
918
918
|
|
|
919
919
|
# Step 3: TDD implementation
|
|
920
|
-
npx claude-flow sparc tdd "user authentication feature"
|
|
920
|
+
npx @claude-flow/cli@latest sparc tdd "user authentication feature"
|
|
921
921
|
|
|
922
922
|
# Step 4: Code review
|
|
923
|
-
npx claude-flow sparc run reviewer "review auth implementation"
|
|
923
|
+
npx @claude-flow/cli@latest sparc run reviewer "review auth implementation"
|
|
924
924
|
|
|
925
925
|
# Step 5: Documentation
|
|
926
|
-
npx claude-flow sparc run documenter "document auth API"
|
|
926
|
+
npx @claude-flow/cli@latest sparc run documenter "document auth API"
|
|
927
927
|
```
|
|
928
928
|
|
|
929
929
|
### Workflow 2: Bug Investigation
|
|
930
930
|
|
|
931
931
|
```bash
|
|
932
932
|
# Step 1: Analyze issue
|
|
933
|
-
npx claude-flow sparc run analyzer "investigate bug #456"
|
|
933
|
+
npx @claude-flow/cli@latest sparc run analyzer "investigate bug #456"
|
|
934
934
|
|
|
935
935
|
# Step 2: Debug systematically
|
|
936
|
-
npx claude-flow sparc run debugger "fix memory leak in service X"
|
|
936
|
+
npx @claude-flow/cli@latest sparc run debugger "fix memory leak in service X"
|
|
937
937
|
|
|
938
938
|
# Step 3: Create tests
|
|
939
|
-
npx claude-flow sparc run tester "regression tests for bug #456"
|
|
939
|
+
npx @claude-flow/cli@latest sparc run tester "regression tests for bug #456"
|
|
940
940
|
|
|
941
941
|
# Step 4: Review fix
|
|
942
|
-
npx claude-flow sparc run reviewer "validate bug fix"
|
|
942
|
+
npx @claude-flow/cli@latest sparc run reviewer "validate bug fix"
|
|
943
943
|
```
|
|
944
944
|
|
|
945
945
|
### Workflow 3: Performance Optimization
|
|
946
946
|
|
|
947
947
|
```bash
|
|
948
948
|
# Step 1: Profile performance
|
|
949
|
-
npx claude-flow sparc run analyzer "profile API response times"
|
|
949
|
+
npx @claude-flow/cli@latest sparc run analyzer "profile API response times"
|
|
950
950
|
|
|
951
951
|
# Step 2: Identify bottlenecks
|
|
952
|
-
npx claude-flow sparc run optimizer "optimize database queries"
|
|
952
|
+
npx @claude-flow/cli@latest sparc run optimizer "optimize database queries"
|
|
953
953
|
|
|
954
954
|
# Step 3: Implement improvements
|
|
955
|
-
npx claude-flow sparc run coder "implement caching layer"
|
|
955
|
+
npx @claude-flow/cli@latest sparc run coder "implement caching layer"
|
|
956
956
|
|
|
957
957
|
# Step 4: Benchmark results
|
|
958
|
-
npx claude-flow sparc run tester "performance benchmarks"
|
|
958
|
+
npx @claude-flow/cli@latest sparc run tester "performance benchmarks"
|
|
959
959
|
```
|
|
960
960
|
|
|
961
961
|
### Workflow 4: Complete Pipeline
|
|
962
962
|
|
|
963
963
|
```bash
|
|
964
964
|
# Execute full development pipeline
|
|
965
|
-
npx claude-flow sparc pipeline "e-commerce checkout feature"
|
|
965
|
+
npx @claude-flow/cli@latest sparc pipeline "e-commerce checkout feature"
|
|
966
966
|
|
|
967
967
|
# This automatically runs:
|
|
968
968
|
# 1. researcher - Gather requirements
|
|
@@ -1070,19 +1070,19 @@ mcp__claude-flow__token_usage {
|
|
|
1070
1070
|
|
|
1071
1071
|
```bash
|
|
1072
1072
|
# List modes
|
|
1073
|
-
npx claude-flow sparc modes
|
|
1073
|
+
npx @claude-flow/cli@latest sparc modes
|
|
1074
1074
|
|
|
1075
1075
|
# Run specific mode
|
|
1076
|
-
npx claude-flow sparc run <mode> "task"
|
|
1076
|
+
npx @claude-flow/cli@latest sparc run <mode> "task"
|
|
1077
1077
|
|
|
1078
1078
|
# TDD workflow
|
|
1079
|
-
npx claude-flow sparc tdd "feature"
|
|
1079
|
+
npx @claude-flow/cli@latest sparc tdd "feature"
|
|
1080
1080
|
|
|
1081
1081
|
# Full pipeline
|
|
1082
|
-
npx claude-flow sparc pipeline "task"
|
|
1082
|
+
npx @claude-flow/cli@latest sparc pipeline "task"
|
|
1083
1083
|
|
|
1084
1084
|
# Batch execution
|
|
1085
|
-
npx claude-flow sparc batch <modes> "task"
|
|
1085
|
+
npx @claude-flow/cli@latest sparc batch <modes> "task"
|
|
1086
1086
|
```
|
|
1087
1087
|
|
|
1088
1088
|
### Most Common MCP Calls
|
|
@@ -237,7 +237,7 @@ mcp__claude-flow__workflow_execute({
|
|
|
237
237
|
### CLI Fallback
|
|
238
238
|
```bash
|
|
239
239
|
# Quick research swarm
|
|
240
|
-
npx claude-flow swarm "research AI trends in 2025" \
|
|
240
|
+
npx @claude-flow/cli@latest swarm "research AI trends in 2025" \
|
|
241
241
|
--strategy research \
|
|
242
242
|
--mode distributed \
|
|
243
243
|
--max-agents 6 \
|
|
@@ -381,7 +381,7 @@ mcp__claude-flow__pipeline_create({
|
|
|
381
381
|
### CLI Fallback
|
|
382
382
|
```bash
|
|
383
383
|
# Quick development swarm
|
|
384
|
-
npx claude-flow swarm "build REST API with authentication" \
|
|
384
|
+
npx @claude-flow/cli@latest swarm "build REST API with authentication" \
|
|
385
385
|
--strategy development \
|
|
386
386
|
--mode hierarchical \
|
|
387
387
|
--monitor \
|
|
@@ -581,7 +581,7 @@ mcp__claude-flow__trend_analysis({
|
|
|
581
581
|
### CLI Fallback
|
|
582
582
|
```bash
|
|
583
583
|
# Quick testing swarm
|
|
584
|
-
npx claude-flow swarm "test application comprehensively" \
|
|
584
|
+
npx @claude-flow/cli@latest swarm "test application comprehensively" \
|
|
585
585
|
--strategy testing \
|
|
586
586
|
--mode star \
|
|
587
587
|
--parallel \
|
package/catalog-manifest.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface RemovedAgentMapping {
|
|
2
|
+
/** Basename as it shipped in the init template, e.g. "coder.md". */
|
|
3
|
+
basename: string;
|
|
4
|
+
/** Marketplace plugin id (name in .claude-plugin/marketplace.json) that now owns it. */
|
|
5
|
+
plugin: string;
|
|
6
|
+
}
|
|
7
|
+
export interface RemovedAgentGap {
|
|
8
|
+
agent: string;
|
|
9
|
+
plugin: string;
|
|
10
|
+
installCommand: string;
|
|
11
|
+
}
|
|
12
|
+
export interface DetectRemovedAgentGapsOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Override for the Claude Code plugin-registry home directory. Defaults to
|
|
15
|
+
* os.homedir(). Tests inject an isolated temp dir so results don't depend
|
|
16
|
+
* on whatever is actually installed on the machine running the suite.
|
|
17
|
+
*/
|
|
18
|
+
homeDir?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Returns one gap row per removed agent that is both missing from the
|
|
22
|
+
* project's .claude/agents/ tree and not covered by an installed owning
|
|
23
|
+
* plugin. Pure filesystem checks, no CLI version comparison (ADR-382 Part B
|
|
24
|
+
* scope note: a filesystem check is sufficient and accurate here).
|
|
25
|
+
*/
|
|
26
|
+
export declare function detectRemovedAgentGaps(cwd: string, removedAgents: RemovedAgentMapping[], options?: DetectRemovedAgentGapsOptions): RemovedAgentGap[];
|
|
27
|
+
//# sourceMappingURL=migrate-agent-detection.d.ts.map
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-382 Part B — the `ruflo migrate` mitigation ADR-128 promised and never
|
|
3
|
+
* shipped: detect the 9 forked agents ADR-128 Phase 2 deleted from the init
|
|
4
|
+
* template (each plugin is now canonical) and, when a project is missing one
|
|
5
|
+
* AND the owning plugin isn't installed, surface an install suggestion.
|
|
6
|
+
* See v3/docs/adr/ADR-382-init-scaffold-content-drift-remediation.md and
|
|
7
|
+
* https://github.com/ruvnet/ruflo/issues/2971.
|
|
8
|
+
*
|
|
9
|
+
* Kept in a sibling module (not migrate.ts) because migrate.ts is already
|
|
10
|
+
* near/over the 500-line budget — see CLAUDE.md file-size rule.
|
|
11
|
+
*/
|
|
12
|
+
import * as fs from 'fs';
|
|
13
|
+
import * as path from 'path';
|
|
14
|
+
import * as os from 'os';
|
|
15
|
+
/**
|
|
16
|
+
* Claude Code records every plugin install (marketplace-scoped, "user" or
|
|
17
|
+
* "project") in a single global file — ~/.claude/plugins/installed_plugins.json,
|
|
18
|
+
* keyed "<plugin>@<marketplace>". This is the only real on-disk signal for
|
|
19
|
+
* "is the owning plugin installed"; there is no per-project marker and no
|
|
20
|
+
* ruflo-side tracking for marketplace plugins (ruflo's own PluginManager
|
|
21
|
+
* manifest at .claude-flow/plugins/installed.json tracks a different,
|
|
22
|
+
* npm-package-based plugin system).
|
|
23
|
+
*/
|
|
24
|
+
function readInstalledPluginsRegistry(homeDir) {
|
|
25
|
+
const registryPath = path.join(homeDir, '.claude', 'plugins', 'installed_plugins.json');
|
|
26
|
+
try {
|
|
27
|
+
if (!fs.existsSync(registryPath))
|
|
28
|
+
return {};
|
|
29
|
+
const raw = fs.readFileSync(registryPath, 'utf-8');
|
|
30
|
+
const parsed = JSON.parse(raw);
|
|
31
|
+
if (parsed && typeof parsed === 'object' && parsed.plugins && typeof parsed.plugins === 'object') {
|
|
32
|
+
return parsed.plugins;
|
|
33
|
+
}
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function isPluginInstalled(pluginName, cwd, registry) {
|
|
41
|
+
const resolvedCwd = path.resolve(cwd);
|
|
42
|
+
const prefix = `${pluginName}@`;
|
|
43
|
+
for (const [key, entries] of Object.entries(registry)) {
|
|
44
|
+
if (!key.startsWith(prefix))
|
|
45
|
+
continue;
|
|
46
|
+
if (!Array.isArray(entries))
|
|
47
|
+
continue;
|
|
48
|
+
for (const entry of entries) {
|
|
49
|
+
if (entry?.scope === 'project') {
|
|
50
|
+
if (entry.projectPath && path.resolve(entry.projectPath) === resolvedCwd)
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
// "user" scope (or unspecified) applies to every project.
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
function agentFileExists(cwd, basename) {
|
|
62
|
+
const agentsDir = path.join(cwd, '.claude', 'agents');
|
|
63
|
+
return findBasename(agentsDir, basename, 0);
|
|
64
|
+
}
|
|
65
|
+
// .claude/agents/ is a shallow tree (category/[subcategory]/name.md); a small
|
|
66
|
+
// depth guard is enough to avoid pathological recursion without needing a
|
|
67
|
+
// real glob dependency for a two-or-three-level lookup.
|
|
68
|
+
const MAX_AGENT_DIR_DEPTH = 6;
|
|
69
|
+
function findBasename(dir, basename, depth) {
|
|
70
|
+
if (depth > MAX_AGENT_DIR_DEPTH)
|
|
71
|
+
return false;
|
|
72
|
+
let entries;
|
|
73
|
+
try {
|
|
74
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
for (const entry of entries) {
|
|
80
|
+
if (entry.isDirectory()) {
|
|
81
|
+
if (findBasename(path.join(dir, entry.name), basename, depth + 1))
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
else if (entry.isFile() && entry.name === basename) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns one gap row per removed agent that is both missing from the
|
|
92
|
+
* project's .claude/agents/ tree and not covered by an installed owning
|
|
93
|
+
* plugin. Pure filesystem checks, no CLI version comparison (ADR-382 Part B
|
|
94
|
+
* scope note: a filesystem check is sufficient and accurate here).
|
|
95
|
+
*/
|
|
96
|
+
export function detectRemovedAgentGaps(cwd, removedAgents, options = {}) {
|
|
97
|
+
const homeDir = options.homeDir ?? os.homedir();
|
|
98
|
+
const registry = readInstalledPluginsRegistry(homeDir);
|
|
99
|
+
const gaps = [];
|
|
100
|
+
for (const { basename, plugin } of removedAgents) {
|
|
101
|
+
if (agentFileExists(cwd, basename))
|
|
102
|
+
continue;
|
|
103
|
+
if (isPluginInstalled(plugin, cwd, registry))
|
|
104
|
+
continue;
|
|
105
|
+
gaps.push({
|
|
106
|
+
agent: basename,
|
|
107
|
+
plugin,
|
|
108
|
+
installCommand: `ruflo plugins install ${plugin}`,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return gaps;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=migrate-agent-detection.js.map
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { output } from '../output.js';
|
|
6
6
|
import * as fs from 'fs';
|
|
7
7
|
import * as path from 'path';
|
|
8
|
+
import { detectRemovedAgentGaps } from './migrate-agent-detection.js';
|
|
8
9
|
// Migration targets
|
|
9
10
|
const MIGRATION_TARGETS = [
|
|
10
11
|
{ value: 'config', label: 'Configuration', hint: 'Migrate configuration files' },
|
|
@@ -15,6 +16,21 @@ const MIGRATION_TARGETS = [
|
|
|
15
16
|
{ value: 'embeddings', label: 'Embeddings', hint: 'Migrate to ONNX with hyperbolic support' },
|
|
16
17
|
{ value: 'all', label: 'All', hint: 'Full migration' }
|
|
17
18
|
];
|
|
19
|
+
// ADR-128 Phase 2 deleted these 9 forked agents from the init template,
|
|
20
|
+
// making each plugin canonical — but ADR-128's own Consequences section
|
|
21
|
+
// promised "`ruflo migrate` should detect removed agents and print install
|
|
22
|
+
// suggestions," which never shipped until ADR-382 Part B (issue #2971).
|
|
23
|
+
const REMOVED_AGENTS = [
|
|
24
|
+
{ basename: 'coder.md', plugin: 'ruflo-core' },
|
|
25
|
+
{ basename: 'researcher.md', plugin: 'ruflo-core' },
|
|
26
|
+
{ basename: 'reviewer.md', plugin: 'ruflo-core' },
|
|
27
|
+
{ basename: 'tester.md', plugin: 'ruflo-testgen' },
|
|
28
|
+
{ basename: 'memory-specialist.md', plugin: 'ruflo-rag-memory' },
|
|
29
|
+
{ basename: 'security-auditor.md', plugin: 'ruflo-security-audit' },
|
|
30
|
+
{ basename: 'sparc-orchestrator.md', plugin: 'ruflo-sparc' },
|
|
31
|
+
{ basename: 'goal-planner.md', plugin: 'ruflo-goals' },
|
|
32
|
+
{ basename: 'adr-architect.md', plugin: 'ruflo-adr' },
|
|
33
|
+
];
|
|
18
34
|
// Status command
|
|
19
35
|
const statusCommand = {
|
|
20
36
|
name: 'status',
|
|
@@ -101,10 +117,13 @@ const statusCommand = {
|
|
|
101
117
|
if (migrationState) {
|
|
102
118
|
components.push({ component: 'Migration State', status: migrationState, migrationNeeded: 'no' });
|
|
103
119
|
}
|
|
120
|
+
// ADR-382 Part B: agents ADR-128 removed from the init template that are
|
|
121
|
+
// both missing from this project and not covered by an installed plugin.
|
|
122
|
+
const removedAgentGaps = detectRemovedAgentGaps(cwd, REMOVED_AGENTS);
|
|
104
123
|
// Display results
|
|
105
124
|
if (ctx.flags.format === 'json') {
|
|
106
|
-
output.printJson({ components, migrationState });
|
|
107
|
-
return { success: true, data: { components, migrationState } };
|
|
125
|
+
output.printJson({ components, migrationState, removedAgentGaps });
|
|
126
|
+
return { success: true, data: { components, migrationState, removedAgentGaps } };
|
|
108
127
|
}
|
|
109
128
|
output.writeln();
|
|
110
129
|
output.writeln(output.bold('Migration Status'));
|
|
@@ -130,7 +149,26 @@ const statusCommand = {
|
|
|
130
149
|
else {
|
|
131
150
|
output.printSuccess('No migration needed.');
|
|
132
151
|
}
|
|
133
|
-
|
|
152
|
+
if (removedAgentGaps.length > 0) {
|
|
153
|
+
output.writeln();
|
|
154
|
+
output.writeln(output.bold('Removed Agents (ADR-128)'));
|
|
155
|
+
output.printTable({
|
|
156
|
+
columns: [
|
|
157
|
+
{ key: 'agent', header: 'Agent', width: 24 },
|
|
158
|
+
{ key: 'plugin', header: 'Owning Plugin', width: 20 },
|
|
159
|
+
{ key: 'installCommand', header: 'Install', width: 34 }
|
|
160
|
+
],
|
|
161
|
+
data: removedAgentGaps.map(g => ({
|
|
162
|
+
agent: output.warning(g.agent),
|
|
163
|
+
plugin: g.plugin,
|
|
164
|
+
installCommand: output.dim(g.installCommand)
|
|
165
|
+
})),
|
|
166
|
+
border: false
|
|
167
|
+
});
|
|
168
|
+
output.writeln();
|
|
169
|
+
output.printInfo(`${removedAgentGaps.length} agent(s) removed by ADR-128 are missing from .claude/agents/ and not covered by an installed plugin.`);
|
|
170
|
+
}
|
|
171
|
+
return { success: true, data: { components, needsMigration, removedAgentGaps } };
|
|
134
172
|
}
|
|
135
173
|
};
|
|
136
174
|
// Run migration
|
|
@@ -7,13 +7,30 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { Command } from '../types.js';
|
|
9
9
|
import { type ProxyStatus } from '../proxy/lifecycle.js';
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Pinned and reviewed; later upgrades remain explicit commands.
|
|
12
|
+
*
|
|
13
|
+
* Keep this the single source of truth — interpolate it rather than writing
|
|
14
|
+
* the version into user-facing strings, or the pin silently drifts out of
|
|
15
|
+
* sync with the text that advertises it.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_PROXY_RELEASE = "0.7.3";
|
|
12
18
|
/**
|
|
13
19
|
* Human-oriented next steps for `ruflo proxy` and `ruflo proxy status`.
|
|
14
20
|
* Keep this independent of the command framework so the state-specific
|
|
15
21
|
* guidance has a small, direct regression-test surface.
|
|
16
22
|
*/
|
|
23
|
+
/**
|
|
24
|
+
* Lines shown when the binary on disk is an older release than the current
|
|
25
|
+
* pin — empty otherwise, including when the version is unknown (`null`),
|
|
26
|
+
* where the honest move is to say nothing rather than guess.
|
|
27
|
+
*
|
|
28
|
+
* Bumping `DEFAULT_PROXY_RELEASE` only ever changed what a *new* install
|
|
29
|
+
* gets. Someone who installed the previous pin has no reason to run
|
|
30
|
+
* `install` again and no signal that anything moved, so a fix that motivated
|
|
31
|
+
* a bump reaches exactly the people who never needed it. This is the signal.
|
|
32
|
+
*/
|
|
33
|
+
export declare function proxyUpdateGuidance(status: ProxyStatus): string[];
|
|
17
34
|
export declare function proxyConsoleGuidance(status: ProxyStatus): string[];
|
|
18
35
|
export declare function printProxyConsoleGuidance(status: ProxyStatus): void;
|
|
19
36
|
export declare const proxyLifecycleSubcommands: Command[];
|
|
@@ -11,8 +11,14 @@ import { installProxy, uninstallProxy } from '../proxy/install.js';
|
|
|
11
11
|
import { startForeground, startBackground, stopProxy, getProxyStatus, readProxyLogTail, watchProxyLog, ProxyNotInstalledError, ProxyAlreadyRunningError, } from '../proxy/lifecycle.js';
|
|
12
12
|
import { proxyTokenPath } from '../proxy/paths.js';
|
|
13
13
|
import { removeInjectedToken, startTokenRefreshPump } from '../proxy/token-bridge.js';
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Pinned and reviewed; later upgrades remain explicit commands.
|
|
16
|
+
*
|
|
17
|
+
* Keep this the single source of truth — interpolate it rather than writing
|
|
18
|
+
* the version into user-facing strings, or the pin silently drifts out of
|
|
19
|
+
* sync with the text that advertises it.
|
|
20
|
+
*/
|
|
21
|
+
export const DEFAULT_PROXY_RELEASE = '0.7.3';
|
|
16
22
|
const PROXY_COMMAND = 'npx ruflo@latest proxy';
|
|
17
23
|
const AUTH_COMMAND = 'npx ruflo@latest auth';
|
|
18
24
|
/**
|
|
@@ -20,6 +26,25 @@ const AUTH_COMMAND = 'npx ruflo@latest auth';
|
|
|
20
26
|
* Keep this independent of the command framework so the state-specific
|
|
21
27
|
* guidance has a small, direct regression-test surface.
|
|
22
28
|
*/
|
|
29
|
+
/**
|
|
30
|
+
* Lines shown when the binary on disk is an older release than the current
|
|
31
|
+
* pin — empty otherwise, including when the version is unknown (`null`),
|
|
32
|
+
* where the honest move is to say nothing rather than guess.
|
|
33
|
+
*
|
|
34
|
+
* Bumping `DEFAULT_PROXY_RELEASE` only ever changed what a *new* install
|
|
35
|
+
* gets. Someone who installed the previous pin has no reason to run
|
|
36
|
+
* `install` again and no signal that anything moved, so a fix that motivated
|
|
37
|
+
* a bump reaches exactly the people who never needed it. This is the signal.
|
|
38
|
+
*/
|
|
39
|
+
export function proxyUpdateGuidance(status) {
|
|
40
|
+
if (!status.installed || !status.version || status.version === DEFAULT_PROXY_RELEASE)
|
|
41
|
+
return [];
|
|
42
|
+
return [
|
|
43
|
+
'',
|
|
44
|
+
`An update is available — installed v${status.version}, current pin v${DEFAULT_PROXY_RELEASE}.`,
|
|
45
|
+
` ${PROXY_COMMAND} update Re-verify and replace with v${DEFAULT_PROXY_RELEASE}`,
|
|
46
|
+
];
|
|
47
|
+
}
|
|
23
48
|
export function proxyConsoleGuidance(status) {
|
|
24
49
|
if (!status.installed) {
|
|
25
50
|
return [
|
|
@@ -31,6 +56,7 @@ export function proxyConsoleGuidance(status) {
|
|
|
31
56
|
` ${PROXY_COMMAND} start --service`,
|
|
32
57
|
];
|
|
33
58
|
}
|
|
59
|
+
const update = proxyUpdateGuidance(status);
|
|
34
60
|
if (!status.running) {
|
|
35
61
|
return [
|
|
36
62
|
'',
|
|
@@ -39,6 +65,7 @@ export function proxyConsoleGuidance(status) {
|
|
|
39
65
|
'',
|
|
40
66
|
'Foreground mode (shows live logs; Ctrl+C stops it):',
|
|
41
67
|
` ${PROXY_COMMAND} start`,
|
|
68
|
+
...update,
|
|
42
69
|
'',
|
|
43
70
|
'Optional: enable Cognitum cloud routing (local-only is the default):',
|
|
44
71
|
` ${AUTH_COMMAND} login`,
|
|
@@ -50,6 +77,7 @@ export function proxyConsoleGuidance(status) {
|
|
|
50
77
|
'Meta Proxy is ready.',
|
|
51
78
|
` Logs: ${PROXY_COMMAND} logs`,
|
|
52
79
|
` Stop: ${PROXY_COMMAND} stop`,
|
|
80
|
+
...update,
|
|
53
81
|
'',
|
|
54
82
|
'Optional: enable Cognitum cloud routing (local-only is the default):',
|
|
55
83
|
` ${AUTH_COMMAND} login`,
|
|
@@ -122,10 +150,21 @@ const installSub = {
|
|
|
122
150
|
};
|
|
123
151
|
const updateSub = {
|
|
124
152
|
name: 'update',
|
|
125
|
-
description: 'Re-verify and replace the installed binary with
|
|
126
|
-
options: [
|
|
153
|
+
description: 'Re-verify and replace the installed binary with the pinned release (never automatic)',
|
|
154
|
+
options: [
|
|
155
|
+
// Defaults to the pin, matching `install`. `--release` was previously
|
|
156
|
+
// required, which meant the only in-product way to reach a newer binary
|
|
157
|
+
// was to already know its version number — so bumping the pin moved
|
|
158
|
+
// nothing for anyone who had already installed. Still never automatic:
|
|
159
|
+
// this runs only when a user types it.
|
|
160
|
+
{
|
|
161
|
+
name: 'release',
|
|
162
|
+
description: `Release version to install (default: ${DEFAULT_PROXY_RELEASE})`,
|
|
163
|
+
type: 'string',
|
|
164
|
+
},
|
|
165
|
+
],
|
|
127
166
|
action: async (ctx) => {
|
|
128
|
-
const version = typeof ctx.flags.release === 'string' ? ctx.flags.release :
|
|
167
|
+
const version = typeof ctx.flags.release === 'string' ? ctx.flags.release : DEFAULT_PROXY_RELEASE;
|
|
129
168
|
if (!version) {
|
|
130
169
|
output.printError('ruflo proxy update requires --release <x.y.z>');
|
|
131
170
|
return { success: false, exitCode: 1 };
|
|
@@ -212,6 +251,11 @@ const statusSub = {
|
|
|
212
251
|
}
|
|
213
252
|
output.writeln('Meta Proxy');
|
|
214
253
|
output.writeln(` Installation: ${status.installed ? 'ready' : 'not installed'}`);
|
|
254
|
+
if (status.installed) {
|
|
255
|
+
// "unknown" rather than an assumed version: the manifest is the only
|
|
256
|
+
// record of what was installed, and asking the binary would start it.
|
|
257
|
+
output.writeln(` Version: ${status.version ?? 'unknown (no install manifest)'}`);
|
|
258
|
+
}
|
|
215
259
|
output.writeln(` Process: ${status.running ? `running (pid ${status.pid})` : 'not running'}`);
|
|
216
260
|
if (status.stalePidFile)
|
|
217
261
|
output.writeln(' (a stale PID file was found and will be cleared on next start)');
|