ft-scout 9.5.1 → 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.
- package/README.md +36 -18
- package/bin/src/commands/agent.d.ts +41 -0
- package/bin/src/commands/agent.js +155 -19
- package/bin/src/commands/audit.d.ts +2 -0
- package/bin/src/commands/authCommand.d.ts +2 -0
- package/bin/src/commands/benchmark.d.ts +20 -0
- package/bin/src/commands/benchmark.js +120 -97
- package/bin/src/commands/brief.d.ts +4 -0
- package/bin/src/commands/checkpoint.d.ts +7 -0
- package/bin/src/commands/configCommand.d.ts +7 -0
- package/bin/src/commands/dashboard.d.ts +5 -0
- package/bin/src/commands/history.d.ts +2 -0
- package/bin/src/commands/init.d.ts +8 -0
- package/bin/src/commands/login.d.ts +10 -0
- package/bin/src/commands/logout.d.ts +6 -0
- package/bin/src/commands/mcp.d.ts +49 -0
- package/bin/src/commands/owners.d.ts +2 -0
- package/bin/src/commands/plan.d.ts +2 -0
- package/bin/src/commands/pr.d.ts +11 -0
- package/bin/src/commands/quota.d.ts +2 -0
- package/bin/src/commands/recommend.d.ts +5 -0
- package/bin/src/commands/risky.d.ts +10 -0
- package/bin/src/commands/setup.d.ts +2 -0
- package/bin/src/commands/signup.d.ts +8 -0
- package/bin/src/commands/switchCommand.d.ts +3 -0
- package/bin/src/commands/undo.d.ts +2 -0
- package/bin/src/commands/watch.d.ts +12 -0
- package/bin/src/commands/web.d.ts +8 -0
- package/bin/src/discovery/config.d.ts +10 -0
- package/bin/src/discovery/display.d.ts +3 -0
- package/bin/src/discovery/messages.d.ts +4 -0
- package/bin/src/discovery/signals.d.ts +16 -0
- package/bin/src/engine/actionVerifier.d.ts +69 -0
- package/bin/src/engine/agentEngine.d.ts +110 -0
- package/bin/src/engine/agentEngine.js +12 -14
- package/bin/src/engine/agentState.d.ts +154 -0
- package/bin/src/engine/browser/browserController.d.ts +155 -0
- package/bin/src/engine/browser/index.d.ts +2 -0
- package/bin/src/engine/checkpoints/checkpointManager.d.ts +48 -0
- package/bin/src/engine/computer/computerController.d.ts +130 -0
- package/bin/src/engine/computer/computerController.js +8 -0
- package/bin/src/engine/computer/computerDiagnostic.d.ts +31 -0
- package/bin/src/engine/computer/index.d.ts +4 -0
- package/bin/src/engine/computer/mockComputer.d.ts +62 -0
- package/bin/src/engine/computer/operatorHud.d.ts +30 -0
- package/bin/src/engine/git.d.ts +20 -0
- package/bin/src/engine/llm.d.ts +92 -0
- package/bin/src/engine/planner.d.ts +21 -0
- package/bin/src/engine/runtime/agentRuntime.d.ts +111 -0
- package/bin/src/engine/runtime/agentRuntime.js +3 -6
- package/bin/src/engine/runtime/index.d.ts +2 -0
- package/bin/src/engine/safety.d.ts +55 -0
- package/bin/src/engine/scanners.d.ts +2 -0
- package/bin/src/engine/subagents/subagentManager.d.ts +106 -0
- package/bin/src/engine/subagents/subagentManager.js +275 -3
- package/bin/src/engine/toolRegistry.d.ts +38 -0
- package/bin/src/engine/verifier.d.ts +47 -0
- package/bin/src/engine/voiceEngine.d.ts +26 -0
- package/bin/src/engine/web.d.ts +22 -0
- package/bin/src/engine/workspace/agentWorkspace.d.ts +112 -0
- package/bin/src/engine/workspace/index.d.ts +2 -0
- package/bin/src/index.d.ts +2 -0
- package/bin/src/index.js +5 -5
- package/bin/src/mcp/client.d.ts +62 -0
- package/bin/src/mcp/client.js +1 -1
- package/bin/src/mcp/cloudSync.d.ts +19 -0
- package/bin/src/mcp/discovery.d.ts +22 -0
- package/bin/src/mcp/health.d.ts +13 -0
- package/bin/src/mcp/index.d.ts +16 -0
- package/bin/src/mcp/manager.d.ts +113 -0
- package/bin/src/mcp/permissions.d.ts +18 -0
- package/bin/src/mcp/persistence.d.ts +44 -0
- package/bin/src/mcp/persistence.js +8 -1
- package/bin/src/mcp/recovery.d.ts +19 -0
- package/bin/src/mcp/telemetry.d.ts +15 -0
- package/bin/src/mcp/toolRouter.d.ts +23 -0
- package/bin/src/mcp/transport.d.ts +60 -0
- package/bin/src/mcp/types.d.ts +130 -0
- package/bin/src/server/server.d.ts +6 -0
- package/bin/src/utils/admin.d.ts +84 -0
- package/bin/src/utils/auditLogger.d.ts +18 -0
- package/bin/src/utils/auth.d.ts +132 -0
- package/bin/src/utils/branding.d.ts +2 -0
- package/bin/src/utils/branding.js +1 -1
- package/bin/src/utils/claudeUI.d.ts +131 -0
- package/bin/src/utils/claudeUI.js +138 -4
- package/bin/src/utils/config.d.ts +46 -0
- package/bin/src/utils/email.d.ts +36 -0
- package/bin/src/utils/firebaseAuth.d.ts +19 -0
- package/bin/src/utils/holoseneAuth.d.ts +18 -0
- package/bin/src/utils/interruptHandler.d.ts +32 -0
- package/bin/src/utils/language.d.ts +13 -0
- package/bin/src/utils/logger.d.ts +2 -0
- package/bin/src/utils/markdown.d.ts +19 -0
- package/bin/src/utils/payment.d.ts +81 -0
- package/bin/src/utils/pricing.d.ts +26 -0
- package/bin/src/utils/pricing.js +0 -1
- package/bin/src/utils/qrBridge.d.ts +33 -0
- package/bin/src/utils/qrBridge.js +1 -1
- package/bin/src/utils/razorpay.d.ts +48 -0
- package/bin/src/utils/rules.d.ts +24 -0
- package/bin/src/utils/session.d.ts +32 -0
- package/bin/src/utils/updateCheck.d.ts +3 -0
- package/package.json +17 -7
- package/.firebase/hosting.d2Vi.cache +0 -16
- package/.firebaserc +0 -14
- package/.mcp-config.json +0 -19
- package/.mft-mcp-config.json +0 -29
- package/.scoutrules +0 -13
- package/.test-ft/mcp_activity.json +0 -23
- package/.test-ft/mcp_credentials.enc +0 -1
- package/.test-ft/mcp_servers.json +0 -1
- package/bin/src/commands/agent.d.ts.map +0 -1
- package/bin/src/commands/agent.js.map +0 -1
- package/bin/src/commands/audit.d.ts.map +0 -1
- package/bin/src/commands/audit.js.map +0 -1
- package/bin/src/commands/authCommand.d.ts.map +0 -1
- package/bin/src/commands/authCommand.js.map +0 -1
- package/bin/src/commands/benchmark.d.ts.map +0 -1
- package/bin/src/commands/benchmark.js.map +0 -1
- package/bin/src/commands/brief.d.ts.map +0 -1
- package/bin/src/commands/brief.js.map +0 -1
- package/bin/src/commands/checkpoint.d.ts.map +0 -1
- package/bin/src/commands/checkpoint.js.map +0 -1
- package/bin/src/commands/configCommand.d.ts.map +0 -1
- package/bin/src/commands/configCommand.js.map +0 -1
- package/bin/src/commands/dashboard.d.ts.map +0 -1
- package/bin/src/commands/dashboard.js.map +0 -1
- package/bin/src/commands/history.d.ts.map +0 -1
- package/bin/src/commands/history.js.map +0 -1
- package/bin/src/commands/init.d.ts.map +0 -1
- package/bin/src/commands/init.js.map +0 -1
- package/bin/src/commands/login.d.ts.map +0 -1
- package/bin/src/commands/login.js.map +0 -1
- package/bin/src/commands/logout.d.ts.map +0 -1
- package/bin/src/commands/logout.js.map +0 -1
- package/bin/src/commands/mcp.d.ts.map +0 -1
- package/bin/src/commands/mcp.js.map +0 -1
- package/bin/src/commands/owners.d.ts.map +0 -1
- package/bin/src/commands/owners.js.map +0 -1
- package/bin/src/commands/plan.d.ts.map +0 -1
- package/bin/src/commands/plan.js.map +0 -1
- package/bin/src/commands/pr.d.ts.map +0 -1
- package/bin/src/commands/pr.js.map +0 -1
- package/bin/src/commands/quota.d.ts.map +0 -1
- package/bin/src/commands/quota.js.map +0 -1
- package/bin/src/commands/recommend.d.ts.map +0 -1
- package/bin/src/commands/recommend.js.map +0 -1
- package/bin/src/commands/risky.d.ts.map +0 -1
- package/bin/src/commands/risky.js.map +0 -1
- package/bin/src/commands/setup.d.ts.map +0 -1
- package/bin/src/commands/setup.js.map +0 -1
- package/bin/src/commands/signup.d.ts.map +0 -1
- package/bin/src/commands/signup.js.map +0 -1
- package/bin/src/commands/switchCommand.d.ts.map +0 -1
- package/bin/src/commands/switchCommand.js.map +0 -1
- package/bin/src/commands/undo.d.ts.map +0 -1
- package/bin/src/commands/undo.js.map +0 -1
- package/bin/src/commands/watch.d.ts.map +0 -1
- package/bin/src/commands/watch.js.map +0 -1
- package/bin/src/commands/web.d.ts.map +0 -1
- package/bin/src/commands/web.js.map +0 -1
- package/bin/src/discovery/config.d.ts.map +0 -1
- package/bin/src/discovery/config.js.map +0 -1
- package/bin/src/discovery/display.d.ts.map +0 -1
- package/bin/src/discovery/display.js.map +0 -1
- package/bin/src/discovery/messages.d.ts.map +0 -1
- package/bin/src/discovery/messages.js.map +0 -1
- package/bin/src/discovery/signals.d.ts.map +0 -1
- package/bin/src/discovery/signals.js.map +0 -1
- package/bin/src/engine/actionVerifier.d.ts.map +0 -1
- package/bin/src/engine/actionVerifier.js.map +0 -1
- package/bin/src/engine/agentEngine.d.ts.map +0 -1
- package/bin/src/engine/agentEngine.js.map +0 -1
- package/bin/src/engine/agentState.d.ts.map +0 -1
- package/bin/src/engine/agentState.js.map +0 -1
- package/bin/src/engine/browser/browserController.d.ts.map +0 -1
- package/bin/src/engine/browser/browserController.js.map +0 -1
- package/bin/src/engine/browser/index.d.ts.map +0 -1
- package/bin/src/engine/browser/index.js.map +0 -1
- package/bin/src/engine/checkpoints/checkpointManager.d.ts.map +0 -1
- package/bin/src/engine/checkpoints/checkpointManager.js.map +0 -1
- package/bin/src/engine/computer/computerController.d.ts.map +0 -1
- package/bin/src/engine/computer/computerController.js.map +0 -1
- package/bin/src/engine/computer/computerDiagnostic.d.ts.map +0 -1
- package/bin/src/engine/computer/computerDiagnostic.js.map +0 -1
- package/bin/src/engine/computer/index.d.ts.map +0 -1
- package/bin/src/engine/computer/index.js.map +0 -1
- package/bin/src/engine/computer/mockComputer.d.ts.map +0 -1
- package/bin/src/engine/computer/mockComputer.js.map +0 -1
- package/bin/src/engine/computer/operatorHud.d.ts.map +0 -1
- package/bin/src/engine/computer/operatorHud.js.map +0 -1
- package/bin/src/engine/computer/scout_driver.exe +0 -0
- package/bin/src/engine/git.d.ts.map +0 -1
- package/bin/src/engine/git.js.map +0 -1
- package/bin/src/engine/llm.d.ts.map +0 -1
- package/bin/src/engine/llm.js.map +0 -1
- package/bin/src/engine/planner.d.ts.map +0 -1
- package/bin/src/engine/planner.js.map +0 -1
- package/bin/src/engine/runtime/agentRuntime.d.ts.map +0 -1
- package/bin/src/engine/runtime/agentRuntime.js.map +0 -1
- package/bin/src/engine/runtime/index.d.ts.map +0 -1
- package/bin/src/engine/runtime/index.js.map +0 -1
- package/bin/src/engine/safety.d.ts.map +0 -1
- package/bin/src/engine/safety.js.map +0 -1
- package/bin/src/engine/scanners.d.ts.map +0 -1
- package/bin/src/engine/scanners.js.map +0 -1
- package/bin/src/engine/scoutAudioRecorder.cs +0 -215
- package/bin/src/engine/scout_audio_recorder.exe +0 -0
- package/bin/src/engine/subagents/subagentManager.d.ts.map +0 -1
- package/bin/src/engine/subagents/subagentManager.js.map +0 -1
- package/bin/src/engine/toolRegistry.d.ts.map +0 -1
- package/bin/src/engine/toolRegistry.js.map +0 -1
- package/bin/src/engine/verifier.d.ts.map +0 -1
- package/bin/src/engine/verifier.js.map +0 -1
- package/bin/src/engine/voiceEngine.d.ts.map +0 -1
- package/bin/src/engine/voiceEngine.js.map +0 -1
- package/bin/src/engine/web.d.ts.map +0 -1
- package/bin/src/engine/web.js.map +0 -1
- package/bin/src/engine/workspace/agentWorkspace.d.ts.map +0 -1
- package/bin/src/engine/workspace/agentWorkspace.js.map +0 -1
- package/bin/src/engine/workspace/index.d.ts.map +0 -1
- package/bin/src/engine/workspace/index.js.map +0 -1
- package/bin/src/index.d.ts.map +0 -1
- package/bin/src/index.js.map +0 -1
- package/bin/src/mcp/client.d.ts.map +0 -1
- package/bin/src/mcp/client.js.map +0 -1
- package/bin/src/mcp/cloudSync.d.ts.map +0 -1
- package/bin/src/mcp/cloudSync.js.map +0 -1
- package/bin/src/mcp/discovery.d.ts.map +0 -1
- package/bin/src/mcp/discovery.js.map +0 -1
- package/bin/src/mcp/health.d.ts.map +0 -1
- package/bin/src/mcp/health.js.map +0 -1
- package/bin/src/mcp/index.d.ts.map +0 -1
- package/bin/src/mcp/index.js.map +0 -1
- package/bin/src/mcp/manager.d.ts.map +0 -1
- package/bin/src/mcp/manager.js.map +0 -1
- package/bin/src/mcp/permissions.d.ts.map +0 -1
- package/bin/src/mcp/permissions.js.map +0 -1
- package/bin/src/mcp/persistence.d.ts.map +0 -1
- package/bin/src/mcp/persistence.js.map +0 -1
- package/bin/src/mcp/recovery.d.ts.map +0 -1
- package/bin/src/mcp/recovery.js.map +0 -1
- package/bin/src/mcp/telemetry.d.ts.map +0 -1
- package/bin/src/mcp/telemetry.js.map +0 -1
- package/bin/src/mcp/toolRouter.d.ts.map +0 -1
- package/bin/src/mcp/toolRouter.js.map +0 -1
- package/bin/src/mcp/transport.d.ts.map +0 -1
- package/bin/src/mcp/transport.js.map +0 -1
- package/bin/src/mcp/types.d.ts.map +0 -1
- package/bin/src/mcp/types.js.map +0 -1
- package/bin/src/server/server.d.ts.map +0 -1
- package/bin/src/server/server.js.map +0 -1
- package/bin/src/utils/admin.d.ts.map +0 -1
- package/bin/src/utils/admin.js.map +0 -1
- package/bin/src/utils/auditLogger.d.ts.map +0 -1
- package/bin/src/utils/auditLogger.js.map +0 -1
- package/bin/src/utils/auth.d.ts.map +0 -1
- package/bin/src/utils/auth.js.map +0 -1
- package/bin/src/utils/branding.d.ts.map +0 -1
- package/bin/src/utils/branding.js.map +0 -1
- package/bin/src/utils/claudeUI.d.ts.map +0 -1
- package/bin/src/utils/claudeUI.js.map +0 -1
- package/bin/src/utils/config.d.ts.map +0 -1
- package/bin/src/utils/config.js.map +0 -1
- package/bin/src/utils/email.d.ts.map +0 -1
- package/bin/src/utils/email.js.map +0 -1
- package/bin/src/utils/firebaseAuth.d.ts.map +0 -1
- package/bin/src/utils/firebaseAuth.js.map +0 -1
- package/bin/src/utils/holoseneAuth.d.ts.map +0 -1
- package/bin/src/utils/holoseneAuth.js.map +0 -1
- package/bin/src/utils/interruptHandler.d.ts.map +0 -1
- package/bin/src/utils/interruptHandler.js.map +0 -1
- package/bin/src/utils/language.d.ts.map +0 -1
- package/bin/src/utils/language.js.map +0 -1
- package/bin/src/utils/logger.d.ts.map +0 -1
- package/bin/src/utils/logger.js.map +0 -1
- package/bin/src/utils/markdown.d.ts.map +0 -1
- package/bin/src/utils/markdown.js.map +0 -1
- package/bin/src/utils/payment.d.ts.map +0 -1
- package/bin/src/utils/payment.js.map +0 -1
- package/bin/src/utils/pricing.d.ts.map +0 -1
- package/bin/src/utils/pricing.js.map +0 -1
- package/bin/src/utils/qrBridge.d.ts.map +0 -1
- package/bin/src/utils/qrBridge.js.map +0 -1
- package/bin/src/utils/razorpay.d.ts.map +0 -1
- package/bin/src/utils/razorpay.js.map +0 -1
- package/bin/src/utils/rules.d.ts.map +0 -1
- package/bin/src/utils/rules.js.map +0 -1
- package/bin/src/utils/session.d.ts.map +0 -1
- package/bin/src/utils/session.js.map +0 -1
- package/bin/src/utils/updateCheck.d.ts.map +0 -1
- package/bin/src/utils/updateCheck.js.map +0 -1
- package/downloads/invoice-2026-03.pdf +0 -1
- package/firebase.json +0 -74
- package/front-terrain-cli-1.0.0.tgz +0 -0
- package/web/ScoutFavicon.png +0 -0
- package/web/ScoutOGImage.png +0 -0
- package/web/app.js +0 -4510
- package/web/ft-logo.png +0 -0
- package/web/og-image.png +0 -0
- package/web/robots.txt +0 -24
- package/web/site.webmanifest +0 -16
- package/web/sitemap-tryscout.xml +0 -47
- package/web/sitemap.xml +0 -47
- package/web/styles.css +0 -3436
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# scout (FrontTerrain CLI v9.5.
|
|
1
|
+
# scout (FrontTerrain CLI v9.5.4)
|
|
2
2
|
|
|
3
3
|
**FrontTerrain (`scout`)** The Autonomous AI Principal Software Engineer & Codebase Co-Pilot in your terminal.
|
|
4
4
|
|
|
@@ -11,14 +11,16 @@ Scout executes autonomous multi-step engineering loops, builds complete projects
|
|
|
11
11
|
Install globally using npm:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install -g scout@latest
|
|
14
|
+
npm install -g ft-scout@latest
|
|
15
|
+
# Or run instantly without installation:
|
|
16
|
+
npx -y ft-scout@latest
|
|
15
17
|
```
|
|
16
18
|
|
|
17
19
|
---
|
|
18
20
|
|
|
19
21
|
## Quick Start & Commands
|
|
20
22
|
|
|
21
|
-
Once installed, use `scout` in any project directory:
|
|
23
|
+
Once installed, use `scout` or `ft-scout` in any project directory:
|
|
22
24
|
|
|
23
25
|
### Autonomous Computer-Use Operator & AI Agent Sessions
|
|
24
26
|
|
|
@@ -32,12 +34,8 @@ scout goal "Refactor database query logic" -y
|
|
|
32
34
|
### Interactive Scout Agent Session (Persistent operator loop with Slash Commands & full tool execution)
|
|
33
35
|
scout agent
|
|
34
36
|
|
|
35
|
-
# Optional voice interaction flags:
|
|
36
|
-
scout agent -V # Launch with Audio Voice mode (Microphone STT)
|
|
37
|
-
scout agent --voice
|
|
38
|
-
|
|
39
37
|
# Inside session:
|
|
40
|
-
# Slash commands: /help /checkpoint /rollback /checkpoints /hud /delegate /
|
|
38
|
+
# Slash commands: /help /checkpoint /rollback /checkpoints /hud /delegate /tree /stats /test /explain /export /diff /undo /clear /history /exit
|
|
41
39
|
|
|
42
40
|
# Generate and create a new source code file
|
|
43
41
|
scout agent --create src/utils/math.ts "Create helper functions for sum, average, and array chunking"
|
|
@@ -450,16 +448,14 @@ Scout is built for uninterrupted autonomy across multiple LLM providers:
|
|
|
450
448
|
|
|
451
449
|
---
|
|
452
450
|
|
|
453
|
-
##
|
|
451
|
+
## Intelligent Multi-Model Fallback & High-Resilience Engine
|
|
454
452
|
|
|
455
|
-
|
|
453
|
+
Scout features a multi-tiered, latency-optimized model failover pipeline tested against live endpoints:
|
|
456
454
|
|
|
457
|
-
1. **
|
|
458
|
-
2. **
|
|
459
|
-
3. **
|
|
460
|
-
4. **
|
|
461
|
-
- High-accuracy in-terminal speech-to-text powered by `whisper-1` with automatic Voice Activity Detection (VAD) and technical vocabulary hints.
|
|
462
|
-
5. **Conversational Co-Pilot Persona**: Instant spoken acknowledgment (e.g., *"On it! Opening Chrome for you."*) and warm conversational completion summaries rather than dry robotic execution logs.
|
|
455
|
+
1. **Ultra-Fast Primary Execution (`nvidia/nemotron-3.5-bolt-e4b`)**: Sub-second execution (~600–800ms) with zero reasoning bottleneck, ideal for instant code modifications and rapid tool invocations.
|
|
456
|
+
2. **Deep Reasoning MoE Fallback (`nvidia/nemotron-3.5-lightning-30b-a3b` & `nvidia/nemotron-3-ultra-550b-a55b`)**: 30B MoE and 550B flagship reasoning engines for complex multi-file architectural tasks.
|
|
457
|
+
3. **Bring Your Own Key (BYOK) Multi-Provider**: Seamlessly plug in Gemini (`gemini-2.5-flash`, `gemini-2.0-flash`) or OpenAI (`gpt-4o-mini`, `gpt-4o`) via `scout config --byok` or environment keys.
|
|
458
|
+
4. **Autonomous Reasoning Fallback Extractor**: If a deep-reasoning model emits tokens under `reasoning_content` without terminal markdown formatting, Scout's internal LLM proxy automatically extracts and forwards the solution payload without failing the step.
|
|
463
459
|
|
|
464
460
|
---
|
|
465
461
|
|
|
@@ -473,8 +469,6 @@ Inside an active `scout agent` interactive session, type any slash command to tr
|
|
|
473
469
|
- `/checkpoints` List all available time-machine checkpoints.
|
|
474
470
|
- `/hud [on|off]` Toggle the Visual Operator HUD desktop aura overlay & click beacons.
|
|
475
471
|
- `/delegate <role> <task>` Delegate a task to an autonomous specialist subagent swarm (`architect`, `coder`, `tester`, `reviewer`).
|
|
476
|
-
- `/voice` Activate microphone Speech-to-Text (STT) listener to speak your prompt into CLI.
|
|
477
|
-
- `/speak <text>` Display entered text feedback directly in terminal.
|
|
478
472
|
- `/tree [dir]` Render an interactive visual directory tree of any workspace folder.
|
|
479
473
|
- `/status` or `/stats` View real-time session telemetry (steps executed, tool call count, modified files, elapsed time, branch info).
|
|
480
474
|
- `/test [cmd]` Auto-detect and run project verification test suite directly inside session context.
|
|
@@ -488,6 +482,30 @@ Inside an active `scout agent` interactive session, type any slash command to tr
|
|
|
488
482
|
|
|
489
483
|
---
|
|
490
484
|
|
|
485
|
+
## 👥 Grok-Style Multi-Agent Personas & Team Swarm (@mentions)
|
|
486
|
+
|
|
487
|
+
Seamlessly collaborate with specialized autonomous subagent personas inside any interactive session or direct CLI goal using simple `@mentions`:
|
|
488
|
+
|
|
489
|
+
```bash
|
|
490
|
+
# Direct specialist personas:
|
|
491
|
+
scout agent "@architect Design a modular caching layer with Redis and memory fallback"
|
|
492
|
+
scout agent "@coder Implement JWT verification middleware in src/auth.ts"
|
|
493
|
+
scout agent "@tester Write unit tests for payment webhook handling and verify edge cases"
|
|
494
|
+
scout agent "@reviewer Audit uncommitted git diff for security vulnerabilities"
|
|
495
|
+
|
|
496
|
+
# Collaborative Grok-Style Team Swarm Relay:
|
|
497
|
+
scout agent "@team Refactor user onboarding flow and verify with automated tests"
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
Inside an active interactive `scout agent` session:
|
|
501
|
+
- `@architect <task>`: Decomposes systems, defines data models, schema, and API contracts.
|
|
502
|
+
- `@coder <task>`: Executes surgical code implementations, bug fixes, and refactoring.
|
|
503
|
+
- `@tester <task>`: Writes and executes test suites, diagnoses failures, and guards regressions.
|
|
504
|
+
- `@reviewer <task>`: Audits code quality, diffs, security boundaries, and anti-patterns.
|
|
505
|
+
- `@team <task>` or `@swarm <task>`: Launches a 3-stage collaborative relay (**Architect** blueprint ➔ **Coder** implementation ➔ **Tester** validation) concluded with a consolidated Claude Code-style team completion card.
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
491
509
|
## ⚡ Supercharged Engineering Capabilities
|
|
492
510
|
|
|
493
511
|
### 1. 🎯 Live Visual Operator HUD
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface ScannedIssue {
|
|
2
|
+
id: number;
|
|
3
|
+
title: string;
|
|
4
|
+
file: string;
|
|
5
|
+
severity: 'high' | 'medium' | 'low';
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function saveScanReport(issues: ScannedIssue[]): void;
|
|
9
|
+
export declare function loadScanReport(): ScannedIssue[];
|
|
10
|
+
export interface AgentOptions {
|
|
11
|
+
goal?: string | undefined;
|
|
12
|
+
create?: string | undefined;
|
|
13
|
+
file?: string | undefined;
|
|
14
|
+
issue?: string | number | undefined;
|
|
15
|
+
run?: string | string[] | undefined;
|
|
16
|
+
scan?: boolean | undefined;
|
|
17
|
+
add?: string | undefined;
|
|
18
|
+
plan?: string | undefined;
|
|
19
|
+
verifyCmd?: string | undefined;
|
|
20
|
+
maxRetries?: number | undefined;
|
|
21
|
+
steps?: number | undefined;
|
|
22
|
+
maxSteps?: number | undefined;
|
|
23
|
+
lang?: string | undefined;
|
|
24
|
+
native?: boolean | undefined;
|
|
25
|
+
yes?: boolean | undefined;
|
|
26
|
+
voice?: boolean | undefined;
|
|
27
|
+
resume?: string | undefined;
|
|
28
|
+
}
|
|
29
|
+
export declare function extractCreateTargetFiles(rawGoal: string): string[];
|
|
30
|
+
export declare function extractCreateTargetFile(rawGoal: string): string | undefined;
|
|
31
|
+
export interface ParsedUserIntent {
|
|
32
|
+
cleanGoal: string;
|
|
33
|
+
intentType: 'question' | 'create' | 'modify' | 'scan' | 'plan' | 'run';
|
|
34
|
+
targetFile?: string | undefined;
|
|
35
|
+
targetFiles?: string[] | undefined;
|
|
36
|
+
}
|
|
37
|
+
export declare function parseUserPromptIntent(rawGoal: string, filesList: string[]): ParsedUserIntent;
|
|
38
|
+
export declare function findTargetFilesFromPrompt(userPrompt: string, specifiedFile: string | undefined, filesList: string[]): string[];
|
|
39
|
+
export declare function getAgentGoalInput(placeholderStr: string): Promise<string | symbol>;
|
|
40
|
+
export declare function handleAgent(goalInput?: string, options?: AgentOptions): Promise<void>;
|
|
41
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -13,8 +13,9 @@ import { consumeCredit, checkTierAccess, loadAuthConfig, isProOrHigher } from '.
|
|
|
13
13
|
import { handleUndo } from './undo.js';
|
|
14
14
|
import { handleCheckpoint, handleRollback, handleListCheckpoints } from './checkpoint.js';
|
|
15
15
|
import { OperatorHud } from '../engine/computer/operatorHud.js';
|
|
16
|
-
import { SubagentManager } from '../engine/subagents/subagentManager.js';
|
|
16
|
+
import { SubagentManager, parseMentionedRole, isCrossAppIntent } from '../engine/subagents/subagentManager.js';
|
|
17
17
|
import { AgentExecutionLoop, buildDirectoryTree, AGENT_TOOLS } from '../engine/agentEngine.js';
|
|
18
|
+
import { renderTeamSwarmCard, renderCrossAppSwarmCard } from '../utils/claudeUI.js';
|
|
18
19
|
import { verifyAndSelfHealFiles, executeSmartCommand, runProjectVerification } from '../engine/verifier.js';
|
|
19
20
|
import { speakText, listenSpeechToText, cleanTextForSpeech } from '../engine/voiceEngine.js';
|
|
20
21
|
import { exec } from 'child_process';
|
|
@@ -518,29 +519,18 @@ ${chalk.cyan('/exit')} - Exit session
|
|
|
518
519
|
- \`/undo\`: Revert last file modifications.
|
|
519
520
|
- \`/history\`: View recent Scout action logs.
|
|
520
521
|
- \`/plan\`: Generate implementation roadmap.
|
|
521
|
-
- \`/voice\`: Speak goal into microphone (STT).
|
|
522
|
-
- \`/speak <text>\`: Speak text out loud (TTS).
|
|
523
522
|
- \`/exit\`: End Scout Agent session.
|
|
523
|
+
|
|
524
|
+
### 👥 Multi-Agent Personas & Grok-Style @Mentions
|
|
525
|
+
- \`@architect <task>\`: System decomposition, modular design, schema & API contracts.
|
|
526
|
+
- \`@coder <task>\`: Surgical implementation, bug fixing, refactoring, and feature builds.
|
|
527
|
+
- \`@tester <task>\`: Test engineering, writing tests, diagnosing failures, regression checks.
|
|
528
|
+
- \`@reviewer <task>\`: Code review, security audits, diff inspection, and anti-patterns.
|
|
529
|
+
- \`@team <task>\` or \`@swarm <task>\`: Coordinated multi-agent relay (Architect ➔ Coder ➔ Tester).
|
|
524
530
|
`.trim();
|
|
525
531
|
safeNote(renderMarkdown(helpText), ' Scout Slash Commands & Tools');
|
|
526
532
|
continue;
|
|
527
533
|
}
|
|
528
|
-
if (trimmedInput.toLowerCase().startsWith('/speak')) {
|
|
529
|
-
safeNote(chalk.yellow('TTS audio speech synthesis has been removed from Scout. Text output is displayed directly in the terminal.'), ' Scout Voice TTS');
|
|
530
|
-
continue;
|
|
531
|
-
}
|
|
532
|
-
if (trimmedInput.toLowerCase() === '/voice') {
|
|
533
|
-
safeNote(chalk.cyan(' Listening to your microphone via browser Web Speech API... Speak your goal clearly!'), ' Scout Voice STT');
|
|
534
|
-
const transcript = await listenSpeechToText();
|
|
535
|
-
if (transcript && transcript.trim()) {
|
|
536
|
-
safeNote(` Voice Received: "${chalk.bold.green(transcript.trim())}"`, ' Scout STT Transcript');
|
|
537
|
-
trimmedInput = transcript.trim();
|
|
538
|
-
}
|
|
539
|
-
else {
|
|
540
|
-
safeNote(chalk.yellow('No speech transcript detected or listener timed out.'), ' Scout Voice STT');
|
|
541
|
-
continue;
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
534
|
if (trimmedInput.toLowerCase() === '/tasks') {
|
|
545
535
|
const tasks = agentLoop.getStateManager().listSavedTasks();
|
|
546
536
|
if (tasks.length === 0) {
|
|
@@ -798,6 +788,85 @@ ${history.slice(0, 15).map(h => `- [${h.timestamp}] ${h.command}: ${h.descriptio
|
|
|
798
788
|
`\n*Steps Used: ${res.stepsUsed}*`, res.success ? ' Subagent Swarm Completed' : '️ Subagent Error');
|
|
799
789
|
continue;
|
|
800
790
|
}
|
|
791
|
+
// Grok & Strawberry-style @mentions parser (@architect, @coder, @tester, @reviewer, @operator, @researcher, @crossapp, @team)
|
|
792
|
+
const mention = parseMentionedRole(trimmedInput);
|
|
793
|
+
if (mention.isMention && mention.role) {
|
|
794
|
+
const subagentMgr = SubagentManager.getInstance();
|
|
795
|
+
if (mention.role === 'team') {
|
|
796
|
+
if (!mention.task) {
|
|
797
|
+
safeNote(chalk.yellow('Usage: @team <complex task description to execute in swarm relay>'), ' Team Swarm');
|
|
798
|
+
continue;
|
|
799
|
+
}
|
|
800
|
+
const startTime = Date.now();
|
|
801
|
+
const swarmRes = await subagentMgr.runTeamSwarm(mention.task, { tier: userTier });
|
|
802
|
+
const elapsed = Date.now() - startTime;
|
|
803
|
+
renderTeamSwarmCard({
|
|
804
|
+
objective: mention.task,
|
|
805
|
+
architectSummary: swarmRes.architectOutput,
|
|
806
|
+
coderSummary: swarmRes.coderOutput,
|
|
807
|
+
testerSummary: swarmRes.testerOutput,
|
|
808
|
+
modifiedFiles: swarmRes.modifiedFiles,
|
|
809
|
+
totalSteps: swarmRes.totalStepsUsed,
|
|
810
|
+
durationMs: elapsed,
|
|
811
|
+
tier: userTier,
|
|
812
|
+
});
|
|
813
|
+
continue;
|
|
814
|
+
}
|
|
815
|
+
else if (mention.role === 'crossapp') {
|
|
816
|
+
if (!mention.task) {
|
|
817
|
+
safeNote(chalk.yellow('Usage: @crossapp <cross-app task, e.g. from Chrome to VS Code>'), ' Cross-App Swarm');
|
|
818
|
+
continue;
|
|
819
|
+
}
|
|
820
|
+
const startTime = Date.now();
|
|
821
|
+
const crossRes = await subagentMgr.runCrossAppSwarm(mention.task, { tier: userTier });
|
|
822
|
+
const elapsed = Date.now() - startTime;
|
|
823
|
+
renderCrossAppSwarmCard({
|
|
824
|
+
objective: mention.task,
|
|
825
|
+
sourceApp: crossRes.sourceApp,
|
|
826
|
+
targetApp: crossRes.targetApp,
|
|
827
|
+
researcherSummary: crossRes.researcherOutput,
|
|
828
|
+
operatorSummary: crossRes.operatorOutput,
|
|
829
|
+
verifierSummary: crossRes.verifierOutput,
|
|
830
|
+
modifiedFiles: crossRes.modifiedFiles,
|
|
831
|
+
totalSteps: crossRes.totalStepsUsed,
|
|
832
|
+
durationMs: elapsed,
|
|
833
|
+
tier: userTier,
|
|
834
|
+
});
|
|
835
|
+
continue;
|
|
836
|
+
}
|
|
837
|
+
else {
|
|
838
|
+
if (!mention.task) {
|
|
839
|
+
safeNote(chalk.yellow(`Usage: @${mention.role} <task description>`), ` Specialist @${mention.role}`);
|
|
840
|
+
continue;
|
|
841
|
+
}
|
|
842
|
+
const res = await subagentMgr.delegate({ role: mention.role, task: mention.task, tier: userTier });
|
|
843
|
+
safeNote(`### Specialist [@${res.role.toUpperCase()}] Result\n${res.summary}\n\n` +
|
|
844
|
+
(res.modifiedFiles.length > 0 ? `### Modified Files\n${res.modifiedFiles.map(f => ` • \`${f}\``).join('\n')}\n` : '') +
|
|
845
|
+
`\n*Steps Used: ${res.stepsUsed}*`, res.success ? ` Specialist [@${res.role.toUpperCase()}] Completed` : '️ Subagent Error');
|
|
846
|
+
continue;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
// Auto-detect natural cross-app goals in interactive session
|
|
850
|
+
if (!mention.isMention && isCrossAppIntent(trimmedInput)) {
|
|
851
|
+
console.log(chalk.cyan.bold('\n🌐 [Auto-Detected Cross-App Workflow]: Launching Strawberry-style Multi-Agent Relay across apps...'));
|
|
852
|
+
const subagentMgr = SubagentManager.getInstance();
|
|
853
|
+
const startTime = Date.now();
|
|
854
|
+
const crossRes = await subagentMgr.runCrossAppSwarm(trimmedInput, { tier: userTier });
|
|
855
|
+
const elapsed = Date.now() - startTime;
|
|
856
|
+
renderCrossAppSwarmCard({
|
|
857
|
+
objective: trimmedInput,
|
|
858
|
+
sourceApp: crossRes.sourceApp,
|
|
859
|
+
targetApp: crossRes.targetApp,
|
|
860
|
+
researcherSummary: crossRes.researcherOutput,
|
|
861
|
+
operatorSummary: crossRes.operatorOutput,
|
|
862
|
+
verifierSummary: crossRes.verifierOutput,
|
|
863
|
+
modifiedFiles: crossRes.modifiedFiles,
|
|
864
|
+
totalSteps: crossRes.totalStepsUsed,
|
|
865
|
+
durationMs: elapsed,
|
|
866
|
+
tier: userTier,
|
|
867
|
+
});
|
|
868
|
+
continue;
|
|
869
|
+
}
|
|
801
870
|
rawGoal = trimmedInput;
|
|
802
871
|
}
|
|
803
872
|
if (!rawGoal || !rawGoal.trim()) {
|
|
@@ -1126,6 +1195,73 @@ ${filePreviews}
|
|
|
1126
1195
|
}
|
|
1127
1196
|
}
|
|
1128
1197
|
}
|
|
1198
|
+
// Grok & Strawberry-style @mentions direct execution from CLI argument
|
|
1199
|
+
const directMention = parseMentionedRole(finalGoal);
|
|
1200
|
+
if (directMention.isMention && directMention.role) {
|
|
1201
|
+
const subagentMgr = SubagentManager.getInstance();
|
|
1202
|
+
if (directMention.role === 'team') {
|
|
1203
|
+
const startTime = Date.now();
|
|
1204
|
+
const swarmRes = await subagentMgr.runTeamSwarm(directMention.task, { tier: userTier });
|
|
1205
|
+
const elapsed = Date.now() - startTime;
|
|
1206
|
+
renderTeamSwarmCard({
|
|
1207
|
+
objective: directMention.task,
|
|
1208
|
+
architectSummary: swarmRes.architectOutput,
|
|
1209
|
+
coderSummary: swarmRes.coderOutput,
|
|
1210
|
+
testerSummary: swarmRes.testerOutput,
|
|
1211
|
+
modifiedFiles: swarmRes.modifiedFiles,
|
|
1212
|
+
totalSteps: swarmRes.totalStepsUsed,
|
|
1213
|
+
durationMs: elapsed,
|
|
1214
|
+
tier: userTier,
|
|
1215
|
+
});
|
|
1216
|
+
return;
|
|
1217
|
+
}
|
|
1218
|
+
else if (directMention.role === 'crossapp') {
|
|
1219
|
+
const startTime = Date.now();
|
|
1220
|
+
const crossRes = await subagentMgr.runCrossAppSwarm(directMention.task, { tier: userTier });
|
|
1221
|
+
const elapsed = Date.now() - startTime;
|
|
1222
|
+
renderCrossAppSwarmCard({
|
|
1223
|
+
objective: directMention.task,
|
|
1224
|
+
sourceApp: crossRes.sourceApp,
|
|
1225
|
+
targetApp: crossRes.targetApp,
|
|
1226
|
+
researcherSummary: crossRes.researcherOutput,
|
|
1227
|
+
operatorSummary: crossRes.operatorOutput,
|
|
1228
|
+
verifierSummary: crossRes.verifierOutput,
|
|
1229
|
+
modifiedFiles: crossRes.modifiedFiles,
|
|
1230
|
+
totalSteps: crossRes.totalStepsUsed,
|
|
1231
|
+
durationMs: elapsed,
|
|
1232
|
+
tier: userTier,
|
|
1233
|
+
});
|
|
1234
|
+
return;
|
|
1235
|
+
}
|
|
1236
|
+
else {
|
|
1237
|
+
const res = await subagentMgr.delegate({ role: directMention.role, task: directMention.task, tier: userTier });
|
|
1238
|
+
safeNote(`### Specialist [@${res.role.toUpperCase()}] Result\n${res.summary}\n\n` +
|
|
1239
|
+
(res.modifiedFiles.length > 0 ? `### Modified Files\n${res.modifiedFiles.map(f => ` • \`${f}\``).join('\n')}\n` : '') +
|
|
1240
|
+
`\n*Steps Used: ${res.stepsUsed}*`, res.success ? ` Specialist [@${res.role.toUpperCase()}] Completed` : '️ Subagent Error');
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
// Auto-detect natural cross-app goals in CLI argument
|
|
1245
|
+
if (!directMention.isMention && isCrossAppIntent(finalGoal)) {
|
|
1246
|
+
console.log(chalk.cyan.bold('\n🌐 [Auto-Detected Cross-App Workflow]: Launching Strawberry-style Multi-Agent Relay across apps...'));
|
|
1247
|
+
const subagentMgr = SubagentManager.getInstance();
|
|
1248
|
+
const startTime = Date.now();
|
|
1249
|
+
const crossRes = await subagentMgr.runCrossAppSwarm(finalGoal, { tier: userTier });
|
|
1250
|
+
const elapsed = Date.now() - startTime;
|
|
1251
|
+
renderCrossAppSwarmCard({
|
|
1252
|
+
objective: finalGoal,
|
|
1253
|
+
sourceApp: crossRes.sourceApp,
|
|
1254
|
+
targetApp: crossRes.targetApp,
|
|
1255
|
+
researcherSummary: crossRes.researcherOutput,
|
|
1256
|
+
operatorSummary: crossRes.operatorOutput,
|
|
1257
|
+
verifierSummary: crossRes.verifierOutput,
|
|
1258
|
+
modifiedFiles: crossRes.modifiedFiles,
|
|
1259
|
+
totalSteps: crossRes.totalStepsUsed,
|
|
1260
|
+
durationMs: elapsed,
|
|
1261
|
+
tier: userTier,
|
|
1262
|
+
});
|
|
1263
|
+
return;
|
|
1264
|
+
}
|
|
1129
1265
|
// Standard Agent Goal Execution: Pre-scan & identify target files ONLY if goal is a code modification task
|
|
1130
1266
|
const hasModificationIntent = /\b(fix|edit|modify|update|refactor|patch|change|debug|error|bug|issue|solve|repair)\b/i.test(finalGoal) &&
|
|
1131
1267
|
!/\b(lookup|look\s*up|who|what|why|where|how|explain|describe|tell|status|check|github|mcp|open|launch)\b/i.test(finalGoal);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface BenchmarkTarget {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
provider: 'NVIDIA' | 'Google' | 'OpenAI' | 'BYOK';
|
|
5
|
+
apiKeyEnv: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const BENCHMARK_MODELS: BenchmarkTarget[];
|
|
8
|
+
export interface BenchmarkResult {
|
|
9
|
+
model: string;
|
|
10
|
+
label: string;
|
|
11
|
+
provider: string;
|
|
12
|
+
configured: boolean;
|
|
13
|
+
latencyMs: number;
|
|
14
|
+
tokens: number;
|
|
15
|
+
tokensPerSec: number;
|
|
16
|
+
status: '200_OK' | 'skipped_no_key' | 'error';
|
|
17
|
+
error?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function handleBenchmark(): Promise<BenchmarkResult[]>;
|
|
20
|
+
//# sourceMappingURL=benchmark.d.ts.map
|
|
@@ -2,129 +2,152 @@ import fs from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { spinner } from '@clack/prompts';
|
|
5
|
+
import { getClientForModel } from '../engine/llm.js';
|
|
5
6
|
import { loadAuthConfig } from '../utils/auth.js';
|
|
6
|
-
import { loadContext } from '../utils/config.js';
|
|
7
|
-
import OpenAI from 'openai';
|
|
8
7
|
const FT_DIR = path.join(process.cwd(), '.ft', 'scout');
|
|
9
8
|
const BENCHMARK_DIR = path.join(FT_DIR);
|
|
10
9
|
const BENCHMARK_FILE = path.join(BENCHMARK_DIR, 'benchmark.json');
|
|
11
|
-
const
|
|
12
|
-
{
|
|
13
|
-
{
|
|
14
|
-
{
|
|
15
|
-
{
|
|
10
|
+
export const BENCHMARK_MODELS = [
|
|
11
|
+
{ id: 'nvidia/nemotron-3.5-bolt-e4b', label: 'Nemotron 3.5 Bolt (Primary)', provider: 'NVIDIA', apiKeyEnv: 'NVIDIA_API_KEY' },
|
|
12
|
+
{ id: 'nvidia/nemotron-3.5-lightning-30b-a3b', label: 'Nemotron 3.5 Lightning 30B', provider: 'NVIDIA', apiKeyEnv: 'NVIDIA_API_KEY' },
|
|
13
|
+
{ id: 'nvidia/nemotron-3-ultra-550b-a55b', label: 'Nemotron 3 Ultra 550B', provider: 'NVIDIA', apiKeyEnv: 'NVIDIA_API_KEY' },
|
|
14
|
+
{ id: 'gemini-2.5-flash', label: 'Gemini 2.5 Flash', provider: 'Google', apiKeyEnv: 'GEMINI_API_KEY' },
|
|
15
|
+
{ id: 'gpt-4o-mini', label: 'GPT-4o Mini', provider: 'OpenAI', apiKeyEnv: 'OPENAI_API_KEY' },
|
|
16
16
|
];
|
|
17
|
-
async function
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
async function measureLatency(modelName, apiKey) {
|
|
34
|
-
if (!apiKey) {
|
|
35
|
-
return { tokens: 0, latencyMs: 0 };
|
|
17
|
+
async function measureModelPerformance(target) {
|
|
18
|
+
const auth = loadAuthConfig();
|
|
19
|
+
const hasKey = Boolean(process.env[target.apiKeyEnv] ||
|
|
20
|
+
process.env.NVCF_API_KEY ||
|
|
21
|
+
(auth.byokEnabled && auth.customApiKey));
|
|
22
|
+
if (!hasKey) {
|
|
23
|
+
return {
|
|
24
|
+
model: target.id,
|
|
25
|
+
label: target.label,
|
|
26
|
+
provider: target.provider,
|
|
27
|
+
configured: false,
|
|
28
|
+
latencyMs: 0,
|
|
29
|
+
tokens: 0,
|
|
30
|
+
tokensPerSec: 0,
|
|
31
|
+
status: 'skipped_no_key',
|
|
32
|
+
};
|
|
36
33
|
}
|
|
37
34
|
const startTime = Date.now();
|
|
38
35
|
try {
|
|
39
|
-
const client =
|
|
40
|
-
// Send a minimal completion request to measure latency
|
|
36
|
+
const client = getClientForModel(target.id);
|
|
41
37
|
const completion = await client.chat.completions.create({
|
|
42
|
-
model:
|
|
43
|
-
messages: [{ role: 'user', content: '
|
|
44
|
-
max_tokens:
|
|
45
|
-
temperature: 0,
|
|
38
|
+
model: target.id,
|
|
39
|
+
messages: [{ role: 'user', content: 'Explain recursion in one concise sentence.' }],
|
|
40
|
+
max_tokens: 35,
|
|
41
|
+
temperature: 0.2,
|
|
46
42
|
});
|
|
47
43
|
const latencyMs = Date.now() - startTime;
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
44
|
+
const msg = completion.choices?.[0]?.message;
|
|
45
|
+
const content = msg?.content || msg?.reasoning_content || '';
|
|
46
|
+
const tokens = completion.usage?.completion_tokens || Math.max(1, Math.round(content.split(/\s+/).length * 1.3));
|
|
47
|
+
const tokensPerSec = latencyMs > 0 ? Math.round(tokens / (latencyMs / 1000)) : 0;
|
|
48
|
+
return {
|
|
49
|
+
model: target.id,
|
|
50
|
+
label: target.label,
|
|
51
|
+
provider: target.provider,
|
|
52
|
+
configured: true,
|
|
53
|
+
latencyMs,
|
|
54
|
+
tokens,
|
|
55
|
+
tokensPerSec,
|
|
56
|
+
status: '200_OK',
|
|
57
|
+
};
|
|
51
58
|
}
|
|
52
|
-
catch (
|
|
53
|
-
|
|
54
|
-
return {
|
|
59
|
+
catch (err) {
|
|
60
|
+
const latencyMs = Date.now() - startTime;
|
|
61
|
+
return {
|
|
62
|
+
model: target.id,
|
|
63
|
+
label: target.label,
|
|
64
|
+
provider: target.provider,
|
|
65
|
+
configured: true,
|
|
66
|
+
latencyMs,
|
|
67
|
+
tokens: 0,
|
|
68
|
+
tokensPerSec: 0,
|
|
69
|
+
status: 'error',
|
|
70
|
+
error: err.message?.slice(0, 80) || 'Unknown error',
|
|
71
|
+
};
|
|
55
72
|
}
|
|
56
73
|
}
|
|
57
74
|
export async function handleBenchmark() {
|
|
58
|
-
const context = loadContext();
|
|
59
|
-
const authConfig = loadAuthConfig();
|
|
60
|
-
// Ensure .ft/scout directory exists
|
|
61
75
|
if (!fs.existsSync(BENCHMARK_DIR)) {
|
|
62
76
|
fs.mkdirSync(BENCHMARK_DIR, { recursive: true });
|
|
63
77
|
}
|
|
64
|
-
|
|
65
|
-
|
|
78
|
+
console.log(chalk.bold.cyan('\n╔════════════════════════════════════════════════════════════════════╗'));
|
|
79
|
+
console.log(chalk.bold.cyan('║ ⚡ FRONTTERRAIN SCOUT: LLM PERFORMANCE BENCHMARK ║'));
|
|
80
|
+
console.log(chalk.bold.cyan('╚════════════════════════════════════════════════════════════════════╝\n'));
|
|
81
|
+
const bSpinner = spinner();
|
|
82
|
+
bSpinner.start('Benchmarking latency and token throughput across model hierarchy...');
|
|
66
83
|
const results = [];
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
for (const target of BENCHMARK_MODELS) {
|
|
85
|
+
bSpinner.message(`Pinging ${target.label} [${target.provider}]...`);
|
|
86
|
+
const res = await measureModelPerformance(target);
|
|
87
|
+
results.push(res);
|
|
88
|
+
}
|
|
89
|
+
bSpinner.stop('Benchmark measurements completed.');
|
|
90
|
+
// Render Claude Code-style Rich Table
|
|
91
|
+
console.log();
|
|
92
|
+
const width = 84;
|
|
93
|
+
console.log(chalk.cyan('╭' + '─'.repeat(width) + '╮'));
|
|
94
|
+
console.log(`${chalk.cyan('│')} ${chalk.bold.white('MODEL / PROVIDER'.padEnd(32))} ` +
|
|
95
|
+
`${chalk.bold.cyan('LATENCY'.padEnd(12))} ` +
|
|
96
|
+
`${chalk.bold.yellow('SPEED'.padEnd(14))} ` +
|
|
97
|
+
`${chalk.bold.green('STATUS'.padEnd(18))} ${chalk.cyan('│')}`);
|
|
98
|
+
console.log(chalk.cyan('├' + '─'.repeat(width) + '┤'));
|
|
99
|
+
for (const r of results) {
|
|
100
|
+
const nameCol = chalk.bold(r.label.slice(0, 31).padEnd(32));
|
|
101
|
+
const latencyCol = r.status === '200_OK'
|
|
102
|
+
? chalk.cyan(`${r.latencyMs}ms`.padEnd(12))
|
|
103
|
+
: chalk.dim('—'.padEnd(12));
|
|
104
|
+
const speedCol = r.status === '200_OK'
|
|
105
|
+
? chalk.yellow(`${r.tokensPerSec} tok/s`.padEnd(14))
|
|
106
|
+
: chalk.dim('—'.padEnd(14));
|
|
107
|
+
let statusCol = '';
|
|
108
|
+
if (r.status === '200_OK') {
|
|
109
|
+
statusCol = chalk.bold.green('✔ 200 OK'.padEnd(18));
|
|
80
110
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
latencyMs,
|
|
89
|
-
tokensPerSec,
|
|
90
|
-
status: 'completed',
|
|
91
|
-
});
|
|
111
|
+
else if (r.status === 'skipped_no_key') {
|
|
112
|
+
statusCol = chalk.dim('○ No API Key'.padEnd(18));
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
statusCol = chalk.bold.red('✖ Quota/Error'.padEnd(18));
|
|
116
|
+
}
|
|
117
|
+
console.log(`${chalk.cyan('│')} ${nameCol} ${latencyCol} ${speedCol} ${statusCol} ${chalk.cyan('│')}`);
|
|
92
118
|
}
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
const
|
|
96
|
-
? Math.round(
|
|
119
|
+
console.log(chalk.cyan('├' + '─'.repeat(width) + '┤'));
|
|
120
|
+
const activeModels = results.filter(r => r.status === '200_OK');
|
|
121
|
+
const avgLatency = activeModels.length > 0
|
|
122
|
+
? Math.round(activeModels.reduce((acc, r) => acc + r.latencyMs, 0) / activeModels.length)
|
|
123
|
+
: 0;
|
|
124
|
+
const avgSpeed = activeModels.length > 0
|
|
125
|
+
? Math.round(activeModels.reduce((acc, r) => acc + r.tokensPerSec, 0) / activeModels.length)
|
|
97
126
|
: 0;
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
chalk.
|
|
101
|
-
''
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
`Status: ${statusColor(r.status)}`,
|
|
110
|
-
'',
|
|
111
|
-
].join(' | ');
|
|
112
|
-
}),
|
|
113
|
-
'',
|
|
114
|
-
chalk.bold.green(`Average Tokens/sec: ${avgTokensPerSec}`),
|
|
115
|
-
'',
|
|
116
|
-
];
|
|
117
|
-
benchmarkSpinner.stop('Benchmark complete.');
|
|
118
|
-
// Output formatted table to terminal
|
|
119
|
-
console.log(tableLines.join('\n'));
|
|
127
|
+
const bestModel = [...activeModels].sort((a, b) => a.latencyMs - b.latencyMs)[0];
|
|
128
|
+
const summaryLine = `⚡ Active: ${chalk.green(activeModels.length + '/' + results.length)} • ` +
|
|
129
|
+
`Avg Latency: ${chalk.cyan(avgLatency + 'ms')} • ` +
|
|
130
|
+
`Avg Speed: ${chalk.yellow(avgSpeed + ' tok/s')} • ` +
|
|
131
|
+
`Fastest: ${chalk.bold.green(bestModel ? bestModel.label.split(' ')[0] : 'N/A')}`;
|
|
132
|
+
const stripAnsi = (str) => str.replace(/\u001B\[\d+m/g, '');
|
|
133
|
+
const visibleLen = stripAnsi(summaryLine).length;
|
|
134
|
+
const padSpaces = Math.max(0, width - 4 - visibleLen);
|
|
135
|
+
console.log(`${chalk.cyan('│')} ${summaryLine}${' '.repeat(padSpaces)} ${chalk.cyan('│')}`);
|
|
136
|
+
console.log(chalk.cyan('╰' + '─'.repeat(width) + '╯'));
|
|
137
|
+
console.log();
|
|
120
138
|
// Save JSON benchmark results
|
|
121
139
|
const benchmarkData = {
|
|
122
140
|
timestamp: new Date().toISOString(),
|
|
123
141
|
models: results,
|
|
124
|
-
|
|
142
|
+
summary: {
|
|
143
|
+
activeCount: activeModels.length,
|
|
144
|
+
averageLatencyMs: avgLatency,
|
|
145
|
+
averageTokensPerSec: avgSpeed,
|
|
146
|
+
fastestModel: bestModel?.model || null,
|
|
147
|
+
},
|
|
125
148
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
149
|
+
fs.writeFileSync(BENCHMARK_FILE, JSON.stringify(benchmarkData, null, 2), 'utf-8');
|
|
150
|
+
console.log(chalk.dim(`Telemetry benchmark saved to ${BENCHMARK_FILE}`));
|
|
151
|
+
return results;
|
|
129
152
|
}
|
|
130
153
|
//# sourceMappingURL=benchmark.js.map
|