ft-scout 9.5.2 → 9.5.4

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,4 +1,4 @@
1
- export type SubagentRole = 'architect' | 'coder' | 'tester' | 'reviewer' | 'general';
1
+ export type SubagentRole = 'architect' | 'coder' | 'tester' | 'reviewer' | 'operator' | 'researcher' | 'crossapp' | 'general';
2
2
  export interface SubagentTaskRequest {
3
3
  role: SubagentRole;
4
4
  task: string;
@@ -16,6 +16,65 @@ export interface SubagentTaskResult {
16
16
  stepsUsed: number;
17
17
  error?: string;
18
18
  }
19
+ export interface TeamSwarmResult {
20
+ success: boolean;
21
+ summary: string;
22
+ architectOutput?: string;
23
+ coderOutput?: string;
24
+ testerOutput?: string;
25
+ modifiedFiles: string[];
26
+ totalStepsUsed: number;
27
+ error?: string;
28
+ }
29
+ export interface CrossAppSwarmResult {
30
+ success: boolean;
31
+ summary: string;
32
+ sourceApp?: string;
33
+ targetApp?: string;
34
+ researcherOutput?: string;
35
+ operatorOutput?: string;
36
+ verifierOutput?: string;
37
+ modifiedFiles: string[];
38
+ totalStepsUsed: number;
39
+ error?: string;
40
+ }
41
+ export interface ParsedMention {
42
+ role: SubagentRole | 'team' | 'crossapp' | null;
43
+ task: string;
44
+ isMention: boolean;
45
+ }
46
+ /**
47
+ * Extracts candidate source and target apps from a cross-app task string.
48
+ */
49
+ export declare function extractAppPair(task: string): {
50
+ source: string;
51
+ target: string;
52
+ };
53
+ /**
54
+ * Heuristically detects if a prompt requests cross-app automation
55
+ * e.g., "from chrome to vscode", "scrape web and update app", "between figma and code"
56
+ */
57
+ export declare function isCrossAppIntent(input: string): boolean;
58
+ /**
59
+ * Global mutex for desktop input focus.
60
+ * Ensures concurrent subagents do not collide on physical mouse/keyboard focus
61
+ * when interacting with native desktop applications.
62
+ */
63
+ export declare class AppFocusMutex {
64
+ private static instance;
65
+ private currentLockHolder;
66
+ private queue;
67
+ static getInstance(): AppFocusMutex;
68
+ acquire(holderId: string): Promise<() => void>;
69
+ release(holderId: string): void;
70
+ isLocked(): boolean;
71
+ }
72
+ /**
73
+ * Parses Grok & Strawberry-style @mentions from user prompts
74
+ * e.g. "@architect review schema", "@coder fix auth", "@tester run tests", "@team build snake game",
75
+ * "@operator open notepad", "@researcher scrape docs", "@crossapp from chrome to vscode"
76
+ */
77
+ export declare function parseMentionedRole(input: string): ParsedMention;
19
78
  export declare class SubagentManager {
20
79
  private static instance;
21
80
  private activeDelegations;
@@ -25,5 +84,23 @@ export declare class SubagentManager {
25
84
  */
26
85
  delegate(req: SubagentTaskRequest): Promise<SubagentTaskResult>;
27
86
  getActiveDelegationsCount(): number;
87
+ /**
88
+ * Run a coordinated multi-agent team swarm relay (Architect -> Coder -> Tester)
89
+ * Inspired by Grok bot multi-perspective collaboration in one session.
90
+ */
91
+ runTeamSwarm(task: string, options?: {
92
+ tier?: string;
93
+ context?: string;
94
+ }): Promise<TeamSwarmResult>;
95
+ /**
96
+ * Run a coordinated Cross-App & Multi-Window Swarm Relay (Strawberry-style)
97
+ * e.g., Researcher Agent (Browser/Web DOM extraction) -> Operator Agent (Desktop App/Editor injection) -> Verifier Agent
98
+ */
99
+ runCrossAppSwarm(task: string, options?: {
100
+ tier?: string;
101
+ context?: string;
102
+ sourceApp?: string;
103
+ targetApp?: string;
104
+ }): Promise<CrossAppSwarmResult>;
28
105
  }
29
106
  //# sourceMappingURL=subagentManager.d.ts.map
@@ -1,11 +1,152 @@
1
1
  import chalk from 'chalk';
2
2
  import path from 'path';
3
3
  import { AgentExecutionLoop } from '../agentEngine.js';
4
+ /**
5
+ * Extracts candidate source and target apps from a cross-app task string.
6
+ */
7
+ export function extractAppPair(task) {
8
+ const lower = task.toLowerCase();
9
+ let source = 'Browser';
10
+ let target = 'VS Code / Codebase';
11
+ if (lower.includes('chrome'))
12
+ source = 'Chrome';
13
+ else if (lower.includes('figma'))
14
+ source = 'Figma';
15
+ else if (lower.includes('github'))
16
+ source = 'GitHub';
17
+ else if (lower.includes('edge'))
18
+ source = 'Edge';
19
+ else if (lower.includes('docs') || lower.includes('website'))
20
+ source = 'Web Docs';
21
+ if (lower.includes('vscode') || lower.includes('vs code'))
22
+ target = 'VS Code';
23
+ else if (lower.includes('notepad'))
24
+ target = 'Notepad';
25
+ else if (lower.includes('slack'))
26
+ target = 'Slack';
27
+ else if (lower.includes('discord'))
28
+ target = 'Discord';
29
+ else if (lower.includes('terminal'))
30
+ target = 'Terminal';
31
+ else if (lower.includes('excel'))
32
+ target = 'Excel';
33
+ return { source, target };
34
+ }
35
+ /**
36
+ * Heuristically detects if a prompt requests cross-app automation
37
+ * e.g., "from chrome to vscode", "scrape web and update app", "between figma and code"
38
+ */
39
+ export function isCrossAppIntent(input) {
40
+ const lower = input.toLowerCase();
41
+ const appKeywords = [
42
+ 'browser', 'chrome', 'edge', 'firefox', 'web', 'website', 'url', 'figma',
43
+ 'vscode', 'vs code', 'notepad', 'slack', 'discord', 'terminal', 'excel',
44
+ 'calc', 'calculator', 'desktop', 'window', 'app', 'application'
45
+ ];
46
+ const bridgeKeywords = [
47
+ 'from', 'to', 'between', 'copy from', 'paste to', 'paste into',
48
+ 'extract from', 'transfer', 'scrape and update', 'switch to', 'open and copy',
49
+ 'across apps', 'multiple apps'
50
+ ];
51
+ let appCount = 0;
52
+ for (const app of appKeywords) {
53
+ if (lower.includes(app)) {
54
+ appCount++;
55
+ if (appCount >= 2)
56
+ break;
57
+ }
58
+ }
59
+ const hasBridge = bridgeKeywords.some(b => lower.includes(b));
60
+ return appCount >= 2 && hasBridge;
61
+ }
62
+ /**
63
+ * Global mutex for desktop input focus.
64
+ * Ensures concurrent subagents do not collide on physical mouse/keyboard focus
65
+ * when interacting with native desktop applications.
66
+ */
67
+ export class AppFocusMutex {
68
+ static instance = null;
69
+ currentLockHolder = null;
70
+ queue = [];
71
+ static getInstance() {
72
+ if (!AppFocusMutex.instance) {
73
+ AppFocusMutex.instance = new AppFocusMutex();
74
+ }
75
+ return AppFocusMutex.instance;
76
+ }
77
+ async acquire(holderId) {
78
+ if (!this.currentLockHolder) {
79
+ this.currentLockHolder = holderId;
80
+ return () => this.release(holderId);
81
+ }
82
+ await new Promise((resolve) => {
83
+ this.queue.push({ id: holderId, resolve });
84
+ });
85
+ this.currentLockHolder = holderId;
86
+ return () => this.release(holderId);
87
+ }
88
+ release(holderId) {
89
+ if (this.currentLockHolder === holderId) {
90
+ this.currentLockHolder = null;
91
+ const next = this.queue.shift();
92
+ if (next) {
93
+ this.currentLockHolder = next.id;
94
+ next.resolve();
95
+ }
96
+ }
97
+ }
98
+ isLocked() {
99
+ return this.currentLockHolder !== null;
100
+ }
101
+ }
102
+ /**
103
+ * Parses Grok & Strawberry-style @mentions from user prompts
104
+ * e.g. "@architect review schema", "@coder fix auth", "@tester run tests", "@team build snake game",
105
+ * "@operator open notepad", "@researcher scrape docs", "@crossapp from chrome to vscode"
106
+ */
107
+ export function parseMentionedRole(input) {
108
+ const trimmed = input.trim();
109
+ const mentionMatch = trimmed.match(/^@([a-zA-Z0-9_\-]+)\b\s*(.*)$/s);
110
+ if (!mentionMatch) {
111
+ return { role: null, task: input, isMention: false };
112
+ }
113
+ const tag = mentionMatch[1]?.toLowerCase() || '';
114
+ const task = (mentionMatch[2] || '').trim();
115
+ if (tag === 'team' || tag === 'swarm' || tag === 'all') {
116
+ return { role: 'team', task, isMention: true };
117
+ }
118
+ if (tag === 'crossapp' || tag === 'bridge' || tag === 'multi' || tag === 'strawberry') {
119
+ return { role: 'crossapp', task, isMention: true };
120
+ }
121
+ if (tag === 'desktop') {
122
+ return { role: 'operator', task, isMention: true };
123
+ }
124
+ if (tag === 'browser' || tag === 'web') {
125
+ return { role: 'researcher', task, isMention: true };
126
+ }
127
+ const validRoles = [
128
+ 'architect',
129
+ 'coder',
130
+ 'tester',
131
+ 'reviewer',
132
+ 'operator',
133
+ 'researcher',
134
+ 'crossapp',
135
+ 'general',
136
+ ];
137
+ if (validRoles.includes(tag)) {
138
+ return { role: tag, task, isMention: true };
139
+ }
140
+ return { role: null, task: input, isMention: false };
141
+ }
4
142
  const ROLE_PROMPTS = {
5
143
  architect: 'You are Scout Subagent ARCHITECT. Your specialty is high-level software architecture, system decomposition, modular design, component hierarchy, API contract design, and technical feasibility analysis. Analyze code structure, identify architectural bottlenecks, and construct robust system designs.',
6
144
  coder: 'You are Scout Subagent CODER. Your specialty is surgical code implementation, bug fixing, refactoring, and adding new features. Write clean, idiomatic, fully-typed code adhering to the project conventions.',
7
145
  tester: 'You are Scout Subagent TESTER. Your specialty is test engineering, writing comprehensive unit and integration tests, diagnosing test failures, and covering edge cases.',
8
146
  reviewer: 'You are Scout Subagent REVIEWER. Your specialty is code review, security audits, diff verification, performance analysis, and identifying regressions or anti-patterns in the codebase.',
147
+ operator: 'You are Scout Subagent OPERATOR. Your specialty is native desktop application control, window management, GUI inspection, and operating local software (VS Code, Notepad, Figma, Terminal, Slack, etc.). Use switchWindow, openApplication, inspectUI, and desktop automation tools safely with precise focus management.',
148
+ researcher: 'You are Scout Subagent RESEARCHER. Your specialty is autonomous web navigation, browser automation, documentation scraping, and extracting data from web pages, local assets (HTML/CSS), and APIs using browser and workspace inspection tools (read_file, browser_navigate, browser_click, extract_content). Extract structured insights for downstream agents autonomously without asking the user.',
149
+ crossapp: 'You are Scout Subagent CROSSAPP. Your specialty is orchestrating multi-application workflows, bridging data between web browsers, local desktop applications, and codebase editors with safe window switching.',
9
150
  general: 'You are Scout Subagent GENERAL. Execute the assigned task efficiently and autonomously.',
10
151
  };
11
152
  export class SubagentManager {
@@ -34,7 +175,6 @@ export class SubagentManager {
34
175
  }
35
176
  const role = req.role in ROLE_PROMPTS ? req.role : 'general';
36
177
  const roleDirective = ROLE_PROMPTS[role];
37
- const maxSteps = Math.min(req.maxSteps || 10, 20);
38
178
  console.log(chalk.magenta.bold(`\n🤖 [Subagent Swarm ➔ ${role.toUpperCase()}]: ${chalk.white(req.task)}`));
39
179
  if (req.context) {
40
180
  console.log(chalk.dim(` Context: ${req.context.slice(0, 120)}${req.context.length > 120 ? '...' : ''}`));
@@ -43,7 +183,7 @@ export class SubagentManager {
43
183
  try {
44
184
  const options = {
45
185
  autoApprove: true,
46
- maxSteps,
186
+ maxSteps: req.maxSteps,
47
187
  tier: req.tier || 'pro',
48
188
  };
49
189
  const subAgent = new AgentExecutionLoop(options);
@@ -59,7 +199,9 @@ ${req.context ? `[ADDITIONAL CONTEXT]\n${req.context}\n` : ''}
59
199
  [EXECUTION INSTRUCTIONS]
60
200
  1. Focus strictly on your assigned role and goal.
61
201
  2. Complete the necessary tool calls (reading, writing, editing, searching, testing) directly.
62
- 3. Call task_completed with a concise, professional summary of what you did and your key findings.
202
+ 3. You have full access to workspace files and directories. Inspect local files using read_file or list_dir instead of asking the user.
203
+ 4. Do NOT call ask_user — execute autonomously.
204
+ 5. Call task_completed with a concise, professional summary of what you did and your key findings.
63
205
  `.trim();
64
206
  const execResult = await subAgent.executeGoal(scopedGoal);
65
207
  const modifiedFiles = subAgent.getModifiedFiles();
@@ -92,5 +234,135 @@ ${req.context ? `[ADDITIONAL CONTEXT]\n${req.context}\n` : ''}
92
234
  getActiveDelegationsCount() {
93
235
  return this.activeDelegations;
94
236
  }
237
+ /**
238
+ * Run a coordinated multi-agent team swarm relay (Architect -> Coder -> Tester)
239
+ * Inspired by Grok bot multi-perspective collaboration in one session.
240
+ */
241
+ async runTeamSwarm(task, options) {
242
+ console.log(chalk.bold.magenta('\n╔════════════════════════════════════════════════════════════════════╗'));
243
+ console.log(chalk.bold.magenta('║ 🚀 MULTI-AGENT SWARM SESSION: TEAM COLLABORATION ║'));
244
+ console.log(chalk.bold.magenta('╚════════════════════════════════════════════════════════════════════╝\n'));
245
+ const tier = options?.tier || 'pro';
246
+ const allModifiedFiles = new Set();
247
+ let totalSteps = 0;
248
+ // Stage 1: Architect Plan
249
+ console.log(chalk.cyan.bold('\n🏛️ [@ARCHITECT Phase: Blueprint & System Design]'));
250
+ const architectRes = await this.delegate({
251
+ role: 'architect',
252
+ task: `Analyze the repository and create an actionable architectural design blueprint for this goal: "${task}". Specify modules to touch and engineering approach.`,
253
+ context: options?.context,
254
+ tier,
255
+ });
256
+ totalSteps += architectRes.stepsUsed;
257
+ architectRes.modifiedFiles.forEach((f) => allModifiedFiles.add(f));
258
+ // Stage 2: Coder Implementation
259
+ console.log(chalk.green.bold('\n💻 [@CODER Phase: Surgical Code Implementation]'));
260
+ const coderRes = await this.delegate({
261
+ role: 'coder',
262
+ task: `Execute and implement the necessary code changes based on this goal: "${task}". Follow the Architect blueprint.`,
263
+ context: `Architect Blueprint:\n${architectRes.summary}\n\nOriginal Task Context:\n${options?.context || ''}`,
264
+ tier,
265
+ });
266
+ totalSteps += coderRes.stepsUsed;
267
+ coderRes.modifiedFiles.forEach((f) => allModifiedFiles.add(f));
268
+ // Stage 3: Tester Verification
269
+ console.log(chalk.yellow.bold('\n🧪 [@TESTER Phase: Verification & Quality Assurance]'));
270
+ const testerRes = await this.delegate({
271
+ role: 'tester',
272
+ task: `Verify the changes made for "${task}". Run tests/build if available, verify syntax, and report edge cases.`,
273
+ context: `Modified files: ${Array.from(allModifiedFiles).join(', ')}\nCoder implementation notes:\n${coderRes.summary}`,
274
+ tier,
275
+ });
276
+ totalSteps += testerRes.stepsUsed;
277
+ testerRes.modifiedFiles.forEach((f) => allModifiedFiles.add(f));
278
+ const overallSuccess = coderRes.success || architectRes.success;
279
+ const summary = [
280
+ `### 🏛️ Architect Blueprint`,
281
+ architectRes.summary,
282
+ `### 💻 Coder Implementation`,
283
+ coderRes.summary,
284
+ `### 🧪 Tester Verification`,
285
+ testerRes.summary,
286
+ ].join('\n\n');
287
+ return {
288
+ success: overallSuccess,
289
+ summary,
290
+ architectOutput: architectRes.summary,
291
+ coderOutput: coderRes.summary,
292
+ testerOutput: testerRes.summary,
293
+ modifiedFiles: Array.from(allModifiedFiles),
294
+ totalStepsUsed: totalSteps,
295
+ };
296
+ }
297
+ /**
298
+ * Run a coordinated Cross-App & Multi-Window Swarm Relay (Strawberry-style)
299
+ * e.g., Researcher Agent (Browser/Web DOM extraction) -> Operator Agent (Desktop App/Editor injection) -> Verifier Agent
300
+ */
301
+ async runCrossAppSwarm(task, options) {
302
+ console.log(chalk.bold.cyan('\n╔════════════════════════════════════════════════════════════════════╗'));
303
+ console.log(chalk.bold.cyan('║ 🌐 MULTI-AGENT SWARM SESSION: CROSS-APP STRAWBERRY RELAY ║'));
304
+ console.log(chalk.bold.cyan('╚════════════════════════════════════════════════════════════════════╝\n'));
305
+ const tier = options?.tier || 'pro';
306
+ const allModifiedFiles = new Set();
307
+ let totalSteps = 0;
308
+ // Auto-detect source & target applications if not provided
309
+ let sourceApp = options?.sourceApp;
310
+ let targetApp = options?.targetApp;
311
+ if (!sourceApp || !targetApp) {
312
+ const detected = extractAppPair(task);
313
+ sourceApp = sourceApp || detected.source;
314
+ targetApp = targetApp || detected.target;
315
+ }
316
+ // Stage 1: Researcher Agent (Browser / Source App Data Extraction)
317
+ console.log(chalk.blue.bold(`\n🌐 [@RESEARCHER Phase: Source Data Extraction from ${sourceApp}]`));
318
+ const researcherRes = await this.delegate({
319
+ role: 'researcher',
320
+ task: `Extract, scrape, or investigate data, documentation, or design tokens for this goal: "${task}". Extract clean, structured findings.`,
321
+ context: options?.context,
322
+ tier,
323
+ });
324
+ totalSteps += researcherRes.stepsUsed;
325
+ researcherRes.modifiedFiles.forEach((f) => allModifiedFiles.add(f));
326
+ // Stage 2: Operator / Coder Agent (Target App / Editor Implementation)
327
+ console.log(chalk.green.bold(`\n💻 [@OPERATOR Phase: Desktop Application & Code Injection into ${targetApp}]`));
328
+ const operatorRes = await this.delegate({
329
+ role: 'operator',
330
+ task: `Apply, input, or integrate the extracted data into ${targetApp} for goal: "${task}".`,
331
+ context: `Extracted Data from Source (${sourceApp}):\n${researcherRes.summary}\n\nTask Context:\n${options?.context || ''}`,
332
+ tier,
333
+ });
334
+ totalSteps += operatorRes.stepsUsed;
335
+ operatorRes.modifiedFiles.forEach((f) => allModifiedFiles.add(f));
336
+ // Stage 3: Verifier Phase
337
+ console.log(chalk.yellow.bold('\n🧪 [@TESTER Phase: Cross-App State & Syntax Verification]'));
338
+ const verifierRes = await this.delegate({
339
+ role: 'tester',
340
+ task: `Verify the cross-application workflow results for: "${task}". Check syntax, build integrity, and confirm state.`,
341
+ context: `Modified files: ${Array.from(allModifiedFiles).join(', ')}\nOperator summary:\n${operatorRes.summary}`,
342
+ tier,
343
+ });
344
+ totalSteps += verifierRes.stepsUsed;
345
+ verifierRes.modifiedFiles.forEach((f) => allModifiedFiles.add(f));
346
+ const overallSuccess = operatorRes.success || researcherRes.success;
347
+ const summary = [
348
+ `### 🌐 Researcher (Source: ${sourceApp})`,
349
+ researcherRes.summary,
350
+ `### 💻 Operator (Target: ${targetApp})`,
351
+ operatorRes.summary,
352
+ `### 🧪 Verifier`,
353
+ verifierRes.summary,
354
+ ].join('\n\n');
355
+ return {
356
+ success: overallSuccess,
357
+ summary,
358
+ sourceApp,
359
+ targetApp,
360
+ researcherOutput: researcherRes.summary,
361
+ operatorOutput: operatorRes.summary,
362
+ verifierOutput: verifierRes.summary,
363
+ modifiedFiles: Array.from(allModifiedFiles),
364
+ totalStepsUsed: totalSteps,
365
+ };
366
+ }
95
367
  }
96
368
  //# sourceMappingURL=subagentManager.js.map
package/bin/src/index.js CHANGED
@@ -38,13 +38,13 @@ program
38
38
  .name('scout')
39
39
  .alias('ft')
40
40
  .description('FrontTerrain The Onboarding Co-Pilot for New Codebases')
41
- .version('9.5.2');
41
+ .version('9.5.4');
42
42
  // Header UI on execution with FrontTerrain proprietary logo & version auto-checker
43
43
  program.hook('preAction', async (_thisCommand, actionCommand) => {
44
- intro(renderBranding('9.5.2'));
44
+ intro(renderBranding('9.5.4'));
45
45
  const cmdName = actionCommand ? actionCommand.name() : '';
46
46
  if (cmdName !== 'upgrade') {
47
- await checkForUpdates('9.5.2');
47
+ await checkForUpdates('9.5.4');
48
48
  }
49
49
  // Auth Guard: enforce authentication for all commands except login, signup, upgrade, help, dashboard, auth, status, plan, mcp, switch, accounts
50
50
  const EXEMPT_COMMANDS = ['login', 'signin', 'signup', 'register', 'upgrade', 'help', 'dashboard', 'web-ui', 'gui', 'auth', 'status', 'quota', 'usage', 'credits', 'plan', 'pricing', 'subscribe', 'mcp', 'switch', 'accounts', 'account'];
@@ -185,7 +185,7 @@ program
185
185
  .option('-a, --add <idea>', 'Evaluate feasibility & generate step-by-step roadmap for a feature idea')
186
186
  .option('-v, --verify <cmd>', 'Custom verification command (e.g. "npm test" or "npm run build")')
187
187
  .option('-m, --max-retries <number>', 'Maximum self-healing attempt iterations (default 3)')
188
- .option('--steps <number>', 'Maximum autonomous execution steps (default 30)')
188
+ .option('--steps <number>', 'Maximum autonomous execution steps (optional limit)')
189
189
  .option('-y, --yes', 'Automatically retain changes without prompting for review')
190
190
  .option('-l, --lang <language>', 'Language for AI teardowns, explanations, and summaries')
191
191
  .option('--resume <taskId>', 'Resume an existing autonomous task by ID from .ft/tasks/')
@@ -265,7 +265,7 @@ program
265
265
  .command('upgrade')
266
266
  .description('Check for updates and auto-upgrade Scout to the latest version')
267
267
  .action(async () => {
268
- await checkForUpdates('9.5.2', true);
268
+ await checkForUpdates('9.5.4', true);
269
269
  outro(chalk.cyan('Upgrade check complete.'));
270
270
  });
271
271
  program
@@ -37,7 +37,7 @@ export class MCPClient {
37
37
  },
38
38
  clientInfo: {
39
39
  name: 'scout',
40
- version: '9.5.2',
40
+ version: '9.5.4',
41
41
  },
42
42
  };
43
43
  const result = await this.transport.sendRequest('initialize', initParams, timeoutMs);
@@ -1,5 +1,5 @@
1
1
  import chalk from 'chalk';
2
- export function renderBranding(version = '9.5.2') {
2
+ export function renderBranding(version = '9.5.4') {
3
3
  const logo = chalk.cyan.bold(' ███████╗████████╗') + ' ' + chalk.cyan.bold('███████╗ ██████╗ ██████╗ ██╗ ██╗████████╗') + '\n' +
4
4
  chalk.cyan.bold(' ██╔════╝╚══██╔══╝') + ' ' + chalk.cyan.bold('██╔════╝ ██╔════╝██╔═══██╗ ██║ ██║╚══██╔══╝') + '\n' +
5
5
  chalk.cyan.bold(' █████╗ ██║ ') + ' ' + chalk.cyan.bold(' ███████╗ ██║ ██║ ██║ ██║ ██║ ██║ ') + '\n' +
@@ -58,7 +58,7 @@ export interface TaskCompletedUIParams {
58
58
  }
59
59
  /**
60
60
  * Renders Claude Code-style Step Banner:
61
- * ╭── ● Step 2/10 ── Scout Operating ──────────── ⏱ 1.2s • 3,250 tok • PRO ─╮
61
+ * ╭── ● Step 2 ── Scout Operating ──────────── ⏱ 1.2s • 3,250 tok • PRO ─╮
62
62
  */
63
63
  export declare function renderStepHeader(telemetry: StepTelemetry): void;
64
64
  /**
@@ -98,4 +98,34 @@ export declare function renderToolResult(params: ToolResultUIParams): void;
98
98
  * ╰────────────────────────────────────────────────────────────────────────╯
99
99
  */
100
100
  export declare function renderTaskCompletedCard(params: TaskCompletedUIParams): void;
101
+ export interface TeamSwarmCardParams {
102
+ objective: string;
103
+ architectSummary?: string | undefined;
104
+ coderSummary?: string | undefined;
105
+ testerSummary?: string | undefined;
106
+ modifiedFiles: string[];
107
+ totalSteps: number;
108
+ durationMs: number;
109
+ tier?: string | undefined;
110
+ }
111
+ /**
112
+ * Renders Claude Code-style Multi-Agent Swarm Collaborative Completion Card (Grok Bot Relay)
113
+ */
114
+ export declare function renderTeamSwarmCard(params: TeamSwarmCardParams): void;
115
+ export interface CrossAppSwarmCardParams {
116
+ objective: string;
117
+ sourceApp?: string | undefined;
118
+ targetApp?: string | undefined;
119
+ researcherSummary?: string | undefined;
120
+ operatorSummary?: string | undefined;
121
+ verifierSummary?: string | undefined;
122
+ modifiedFiles: string[];
123
+ totalSteps: number;
124
+ durationMs: number;
125
+ tier?: string | undefined;
126
+ }
127
+ /**
128
+ * Renders Claude Code-style Cross-App Multi-Agent Swarm Collaborative Completion Card (Strawberry-style)
129
+ */
130
+ export declare function renderCrossAppSwarmCard(params: CrossAppSwarmCardParams): void;
101
131
  //# sourceMappingURL=claudeUI.d.ts.map
@@ -10,14 +10,12 @@ function hr(char = '─', len) {
10
10
  }
11
11
  /**
12
12
  * Renders Claude Code-style Step Banner:
13
- * ╭── ● Step 2/10 ── Scout Operating ──────────── ⏱ 1.2s • 3,250 tok • PRO ─╮
13
+ * ╭── ● Step 2 ── Scout Operating ──────────── ⏱ 1.2s • 3,250 tok • PRO ─╮
14
14
  */
15
15
  export function renderStepHeader(telemetry) {
16
16
  const width = getTerminalWidth();
17
17
  const elapsedSecs = ((Date.now() - telemetry.startTimeMs) / 1000).toFixed(1);
18
- const stepsText = Number.isFinite(telemetry.maxSteps)
19
- ? `Step ${telemetry.step}/${telemetry.maxSteps}`
20
- : `Step ${telemetry.step}`;
18
+ const stepsText = `Step ${telemetry.step}`;
21
19
  const stepBadge = chalk.bold.cyan(`● ${stepsText}`);
22
20
  const statusText = chalk.dim('Scout Operating');
23
21
  const timeText = chalk.dim(`⏱ ${elapsedSecs}s`);
@@ -401,4 +399,140 @@ export function renderTaskCompletedCard(params) {
401
399
  console.log(chalk.cyan('╰' + '─'.repeat(width) + '╯'));
402
400
  console.log();
403
401
  }
402
+ /**
403
+ * Renders Claude Code-style Multi-Agent Swarm Collaborative Completion Card (Grok Bot Relay)
404
+ */
405
+ export function renderTeamSwarmCard(params) {
406
+ const width = Math.min(getTerminalWidth(), 88);
407
+ const stripAnsi = (str) => str.replace(/\u001B\[\d+m/g, '');
408
+ const padLine = (content, visibleLen) => {
409
+ const spaces = Math.max(0, width - 4 - visibleLen);
410
+ return `${chalk.magenta('│')} ${content}${' '.repeat(spaces)} ${chalk.magenta('│')}`;
411
+ };
412
+ console.log();
413
+ console.log(chalk.magenta('╭' + '─'.repeat(width) + '╮'));
414
+ const header = `${chalk.bold.yellow('🚀')} ${chalk.bold.white('MULTI-AGENT SWARM COMPLETED (TEAM RELAY)')}`;
415
+ console.log(padLine(header, stripAnsi(header).length));
416
+ console.log(chalk.magenta('├' + '─'.repeat(width) + '┤'));
417
+ const objText = `${chalk.bold.cyan('🎯 Objective:')} ${chalk.white(params.objective.slice(0, width - 20))}`;
418
+ console.log(padLine(objText, stripAnsi(objText).length));
419
+ console.log(padLine('', 0));
420
+ if (params.architectSummary) {
421
+ const archTitle = `${chalk.bold.cyan('🏛️ Architect Plan:')}`;
422
+ console.log(padLine(archTitle, stripAnsi(archTitle).length));
423
+ const line = params.architectSummary.split('\n')[0] || 'Architecture plan drafted.';
424
+ const archLine = ` ${chalk.dim(line.slice(0, width - 15))}`;
425
+ console.log(padLine(archLine, stripAnsi(archLine).length));
426
+ }
427
+ if (params.coderSummary) {
428
+ const coderTitle = `${chalk.bold.green('💻 Coder Implementation:')}`;
429
+ console.log(padLine(coderTitle, stripAnsi(coderTitle).length));
430
+ const line = params.coderSummary.split('\n')[0] || 'Changes implemented.';
431
+ const coderLine = ` ${chalk.dim(line.slice(0, width - 15))}`;
432
+ console.log(padLine(coderLine, stripAnsi(coderLine).length));
433
+ }
434
+ if (params.testerSummary) {
435
+ const testTitle = `${chalk.bold.yellow('🧪 Tester Verification:')}`;
436
+ console.log(padLine(testTitle, stripAnsi(testTitle).length));
437
+ const line = params.testerSummary.split('\n')[0] || 'Verification complete.';
438
+ const testLine = ` ${chalk.dim(line.slice(0, width - 15))}`;
439
+ console.log(padLine(testLine, stripAnsi(testLine).length));
440
+ }
441
+ console.log(padLine('', 0));
442
+ const filesTitle = `${chalk.bold.blue('📁 Modified Files')} (${params.modifiedFiles.length}):`;
443
+ console.log(padLine(filesTitle, stripAnsi(filesTitle).length));
444
+ if (params.modifiedFiles.length === 0) {
445
+ const noFiles = chalk.dim(' (No files modified)');
446
+ console.log(padLine(noFiles, stripAnsi(noFiles).length));
447
+ }
448
+ else {
449
+ for (const file of params.modifiedFiles.slice(0, 5)) {
450
+ const fileLine = ` ${chalk.green('•')} ${chalk.cyan(file)}`;
451
+ console.log(padLine(fileLine, stripAnsi(fileLine).length));
452
+ }
453
+ if (params.modifiedFiles.length > 5) {
454
+ const moreFiles = chalk.dim(` ... and ${params.modifiedFiles.length - 5} more files`);
455
+ console.log(padLine(moreFiles, stripAnsi(moreFiles).length));
456
+ }
457
+ }
458
+ console.log(padLine('', 0));
459
+ const durationSec = (params.durationMs / 1000).toFixed(1);
460
+ const metrics = `⏱ ${chalk.yellow(`${durationSec}s`)} • Steps: ${chalk.yellow(params.totalSteps)} • Relay: Architect ➔ Coder ➔ Tester`;
461
+ console.log(padLine(metrics, stripAnsi(metrics).length));
462
+ const tier = (params.tier || 'pro').toUpperCase();
463
+ const tierLine = `🛡️ Tier: ${chalk.bold.magenta(tier)} (Multi-Agent Swarm Swappable)`;
464
+ console.log(padLine(tierLine, stripAnsi(tierLine).length));
465
+ console.log(chalk.magenta('╰' + '─'.repeat(width) + '╯'));
466
+ console.log();
467
+ }
468
+ /**
469
+ * Renders Claude Code-style Cross-App Multi-Agent Swarm Collaborative Completion Card (Strawberry-style)
470
+ */
471
+ export function renderCrossAppSwarmCard(params) {
472
+ const width = Math.min(getTerminalWidth(), 88);
473
+ const stripAnsi = (str) => str.replace(/\u001B\[\d+m/g, '');
474
+ const padLine = (content, visibleLen) => {
475
+ const spaces = Math.max(0, width - 4 - visibleLen);
476
+ return `${chalk.cyan('│')} ${content}${' '.repeat(spaces)} ${chalk.cyan('│')}`;
477
+ };
478
+ console.log();
479
+ console.log(chalk.cyan('╭' + '─'.repeat(width) + '╮'));
480
+ const header = `${chalk.bold.yellow('🌐')} ${chalk.bold.white('CROSS-APP MULTI-AGENT SWARM (STRAWBERRY RELAY)')}`;
481
+ console.log(padLine(header, stripAnsi(header).length));
482
+ console.log(chalk.cyan('├' + '─'.repeat(width) + '┤'));
483
+ const objText = `${chalk.bold.cyan('🎯 Objective:')} ${chalk.white(params.objective.slice(0, width - 20))}`;
484
+ console.log(padLine(objText, stripAnsi(objText).length));
485
+ const source = params.sourceApp || 'Browser';
486
+ const target = params.targetApp || 'VS Code';
487
+ const flowText = `${chalk.bold.yellow('🔄 Flow:')} ${chalk.blue(source)} ➔ ${chalk.dim('Data Pipe')} ➔ ${chalk.green(target)} ➔ ${chalk.yellow('Verifier')}`;
488
+ console.log(padLine(flowText, stripAnsi(flowText).length));
489
+ console.log(padLine('', 0));
490
+ if (params.researcherSummary) {
491
+ const title = `${chalk.bold.blue(`🌐 Researcher (${source}):`)}`;
492
+ console.log(padLine(title, stripAnsi(title).length));
493
+ const line = params.researcherSummary.split('\n')[0] || 'Extracted data from source.';
494
+ const subLine = ` ${chalk.dim(line.slice(0, width - 15))}`;
495
+ console.log(padLine(subLine, stripAnsi(subLine).length));
496
+ }
497
+ if (params.operatorSummary) {
498
+ const title = `${chalk.bold.green(`💻 Operator (${target}):`)}`;
499
+ console.log(padLine(title, stripAnsi(title).length));
500
+ const line = params.operatorSummary.split('\n')[0] || 'Injected changes into target.';
501
+ const subLine = ` ${chalk.dim(line.slice(0, width - 15))}`;
502
+ console.log(padLine(subLine, stripAnsi(subLine).length));
503
+ }
504
+ if (params.verifierSummary) {
505
+ const title = `${chalk.bold.yellow('🧪 Verifier:')}`;
506
+ console.log(padLine(title, stripAnsi(title).length));
507
+ const line = params.verifierSummary.split('\n')[0] || 'Verification completed.';
508
+ const subLine = ` ${chalk.dim(line.slice(0, width - 15))}`;
509
+ console.log(padLine(subLine, stripAnsi(subLine).length));
510
+ }
511
+ console.log(padLine('', 0));
512
+ const filesTitle = `${chalk.bold.blue('📁 Modified Files')} (${params.modifiedFiles.length}):`;
513
+ console.log(padLine(filesTitle, stripAnsi(filesTitle).length));
514
+ if (params.modifiedFiles.length === 0) {
515
+ const noFiles = chalk.dim(' (No files modified)');
516
+ console.log(padLine(noFiles, stripAnsi(noFiles).length));
517
+ }
518
+ else {
519
+ for (const file of params.modifiedFiles.slice(0, 5)) {
520
+ const fileLine = ` ${chalk.green('•')} ${chalk.cyan(file)}`;
521
+ console.log(padLine(fileLine, stripAnsi(fileLine).length));
522
+ }
523
+ if (params.modifiedFiles.length > 5) {
524
+ const moreFiles = chalk.dim(` ... and ${params.modifiedFiles.length - 5} more files`);
525
+ console.log(padLine(moreFiles, stripAnsi(moreFiles).length));
526
+ }
527
+ }
528
+ console.log(padLine('', 0));
529
+ const durationSec = (params.durationMs / 1000).toFixed(1);
530
+ const metrics = `⏱ ${chalk.yellow(`${durationSec}s`)} • Steps: ${chalk.yellow(params.totalSteps)} • Apps: ${chalk.blue(source)} ➔ ${chalk.green(target)}`;
531
+ console.log(padLine(metrics, stripAnsi(metrics).length));
532
+ const tier = (params.tier || 'pro').toUpperCase();
533
+ const tierLine = `🛡️ Tier: ${chalk.bold.magenta(tier)} (Cross-App Multi-Agent Swarm)`;
534
+ console.log(padLine(tierLine, stripAnsi(tierLine).length));
535
+ console.log(chalk.cyan('╰' + '─'.repeat(width) + '╯'));
536
+ console.log();
537
+ }
404
538
  //# sourceMappingURL=claudeUI.js.map