specweave 1.0.564 → 1.0.565
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.
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Team CLI Command
|
|
3
3
|
*
|
|
4
4
|
* Launches Claude Code with native agent teams enabled.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Automatically creates a tmux session if not already in one,
|
|
6
|
+
* so agents get their own split panes.
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
|
-
* specweave team #
|
|
9
|
+
* specweave team # Auto-launches in tmux
|
|
10
10
|
* specweave team "Build auth system" # Launch with initial prompt
|
|
11
|
-
* specweave team --mode in-process #
|
|
11
|
+
* specweave team --mode in-process # Force in-process mode (no tmux)
|
|
12
12
|
*/
|
|
13
13
|
export interface TeamCommandOptions {
|
|
14
14
|
mode?: 'tmux' | 'in-process';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/team.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/team.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA0BD;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAiEf"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Team CLI Command
|
|
3
3
|
*
|
|
4
4
|
* Launches Claude Code with native agent teams enabled.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Automatically creates a tmux session if not already in one,
|
|
6
|
+
* so agents get their own split panes.
|
|
7
7
|
*
|
|
8
8
|
* Usage:
|
|
9
|
-
* specweave team #
|
|
9
|
+
* specweave team # Auto-launches in tmux
|
|
10
10
|
* specweave team "Build auth system" # Launch with initial prompt
|
|
11
|
-
* specweave team --mode in-process #
|
|
11
|
+
* specweave team --mode in-process # Force in-process mode (no tmux)
|
|
12
12
|
*/
|
|
13
13
|
import { spawn } from 'child_process';
|
|
14
14
|
import * as os from 'os';
|
|
@@ -26,40 +26,15 @@ function isToolAvailable(tool) {
|
|
|
26
26
|
return result.success;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Reconstruct CLI args for re-launching inside tmux.
|
|
30
30
|
*/
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return requestedMode;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// Priority 1: Check if already INSIDE a tmux session
|
|
42
|
-
const inTmux = !!process.env.TMUX;
|
|
43
|
-
if (inTmux) {
|
|
44
|
-
return 'tmux';
|
|
45
|
-
}
|
|
46
|
-
// Priority 2: Check for iTerm2 (it2 CLI) — Claude auto-detects iTerm2
|
|
47
|
-
const hasIt2 = isToolAvailable('it2');
|
|
48
|
-
if (hasIt2) {
|
|
49
|
-
return 'tmux';
|
|
50
|
-
}
|
|
51
|
-
// Priority 3: tmux is installed but not running — warn and fall back
|
|
52
|
-
const hasTmux = isToolAvailable('tmux');
|
|
53
|
-
if (hasTmux) {
|
|
54
|
-
console.log(chalk.yellow('tmux is installed but you are not inside a tmux session.'));
|
|
55
|
-
console.log(chalk.gray('Agents will run in-process (same pane). For split-pane views:'));
|
|
56
|
-
console.log(chalk.gray(' tmux new-session && specweave team'));
|
|
57
|
-
return 'in-process';
|
|
58
|
-
}
|
|
59
|
-
// Fallback: nothing available
|
|
60
|
-
console.log(chalk.yellow('Neither tmux nor iTerm2 (it2) found. Using in-process mode (less convenient).'));
|
|
61
|
-
console.log(chalk.gray('Install tmux: brew install tmux'));
|
|
62
|
-
return 'in-process';
|
|
31
|
+
function buildRelaunchArgs(description, options) {
|
|
32
|
+
const args = ['team', '--mode', 'tmux'];
|
|
33
|
+
if (options.noIncrement)
|
|
34
|
+
args.push('--no-increment');
|
|
35
|
+
if (description)
|
|
36
|
+
args.push(description);
|
|
37
|
+
return args;
|
|
63
38
|
}
|
|
64
39
|
/**
|
|
65
40
|
* Main team command handler
|
|
@@ -80,8 +55,10 @@ export async function handleTeamCommand(description, options) {
|
|
|
80
55
|
// Auto-fix settings.json env var (project-level + global)
|
|
81
56
|
enableAgentTeamsEnvVar(projectPath);
|
|
82
57
|
enableAgentTeamsEnvVar(os.homedir());
|
|
83
|
-
// Determine mode
|
|
84
|
-
const mode =
|
|
58
|
+
// Determine mode — may re-launch inside tmux (returns only if continuing)
|
|
59
|
+
const mode = resolveMode(description, options);
|
|
60
|
+
if (mode === null)
|
|
61
|
+
return; // re-launched inside tmux, parent exits via spawn handler
|
|
85
62
|
// Build args — interactive mode with optional initial prompt as positional arg
|
|
86
63
|
const args = ['--dangerously-skip-permissions', '--teammate-mode', mode];
|
|
87
64
|
// Build env
|
|
@@ -117,4 +94,58 @@ export async function handleTeamCommand(description, options) {
|
|
|
117
94
|
process.exit(code ?? 0);
|
|
118
95
|
});
|
|
119
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Resolve teammate mode, auto-launching tmux if needed.
|
|
99
|
+
*
|
|
100
|
+
* Returns the mode string to use, or null if the process was
|
|
101
|
+
* re-launched inside tmux (caller should exit).
|
|
102
|
+
*/
|
|
103
|
+
function resolveMode(description, options) {
|
|
104
|
+
// Explicit in-process — skip tmux entirely
|
|
105
|
+
if (options.mode === 'in-process') {
|
|
106
|
+
return 'in-process';
|
|
107
|
+
}
|
|
108
|
+
// Explicit tmux or invalid mode — validate
|
|
109
|
+
if (options.mode && options.mode !== 'tmux') {
|
|
110
|
+
console.log(chalk.yellow(`Unknown mode "${options.mode}". Valid modes: ${VALID_MODES.join(', ')}`));
|
|
111
|
+
console.log(chalk.gray('Falling back to auto-detection.'));
|
|
112
|
+
}
|
|
113
|
+
// Already inside tmux — use it directly
|
|
114
|
+
if (process.env.TMUX) {
|
|
115
|
+
return 'tmux';
|
|
116
|
+
}
|
|
117
|
+
// iTerm2 available — Claude auto-detects iTerm2 split panes
|
|
118
|
+
if (isToolAvailable('it2')) {
|
|
119
|
+
return 'tmux';
|
|
120
|
+
}
|
|
121
|
+
// tmux available but not in a session — auto-launch inside tmux
|
|
122
|
+
if (isToolAvailable('tmux')) {
|
|
123
|
+
console.log(chalk.cyan('Starting tmux session for agent split panes...'));
|
|
124
|
+
const sessionName = `sw-team-${Date.now()}`;
|
|
125
|
+
const relaunchArgs = buildRelaunchArgs(description, options);
|
|
126
|
+
const tmuxArgs = [
|
|
127
|
+
'new-session', '-s', sessionName, '--',
|
|
128
|
+
'specweave', ...relaunchArgs,
|
|
129
|
+
];
|
|
130
|
+
const child = spawn('tmux', tmuxArgs, {
|
|
131
|
+
stdio: 'inherit',
|
|
132
|
+
env: {
|
|
133
|
+
...process.env,
|
|
134
|
+
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: '1',
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
child.on('error', (err) => {
|
|
138
|
+
console.error(chalk.red(`Failed to start tmux: ${err.message}`));
|
|
139
|
+
process.exit(1);
|
|
140
|
+
});
|
|
141
|
+
child.on('exit', (code) => {
|
|
142
|
+
process.exit(code ?? 0);
|
|
143
|
+
});
|
|
144
|
+
return null; // Signal: re-launched, don't continue
|
|
145
|
+
}
|
|
146
|
+
// No tmux at all — in-process fallback with helpful note
|
|
147
|
+
console.log(chalk.yellow('tmux not found. Agents will run in-process (same pane).'));
|
|
148
|
+
console.log(chalk.gray('Install tmux for split-pane agent views: brew install tmux'));
|
|
149
|
+
return 'in-process';
|
|
150
|
+
}
|
|
120
151
|
//# sourceMappingURL=team.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../../../src/cli/commands/team.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAOhF,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,YAAY,CAAU,CAAC;AAEpD;;GAEG;AACH,SAAS,eAAe,CAAC,IAAY;IACnC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/D,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,SAAS,
|
|
1
|
+
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../../../src/cli/commands/team.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,g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1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "specweave",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.565",
|
|
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",
|