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
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { type FileBackup } from '../../utils/config.js';
|
|
2
|
+
import { AgentWorkspace, type AgentWorkspaceData } from '../workspace/agentWorkspace.js';
|
|
3
|
+
import { type IComputerController } from '../computer/computerController.js';
|
|
4
|
+
import { type IBrowserController } from '../browser/index.js';
|
|
5
|
+
import { ActionVerifier } from '../actionVerifier.js';
|
|
6
|
+
import { ApprovalManager } from '../safety.js';
|
|
7
|
+
import { TaskPlanner } from '../planner.js';
|
|
8
|
+
import { UnifiedToolRegistry } from '../toolRegistry.js';
|
|
9
|
+
export interface AgentRuntimeOptions {
|
|
10
|
+
autoApprove?: boolean;
|
|
11
|
+
maxSteps?: number;
|
|
12
|
+
language?: string;
|
|
13
|
+
browserController?: IBrowserController;
|
|
14
|
+
computerController?: IComputerController;
|
|
15
|
+
workspaceDir?: string;
|
|
16
|
+
taskId?: string;
|
|
17
|
+
mockMode?: boolean;
|
|
18
|
+
tier?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface RuntimeExecutionResult {
|
|
21
|
+
success: boolean;
|
|
22
|
+
summary: string;
|
|
23
|
+
taskId: string;
|
|
24
|
+
stepsTaken: number;
|
|
25
|
+
modifiedFiles: string[];
|
|
26
|
+
status: AgentWorkspaceData['status'];
|
|
27
|
+
}
|
|
28
|
+
export declare class AgentRuntime {
|
|
29
|
+
private cwd;
|
|
30
|
+
private autoApprove;
|
|
31
|
+
private maxSteps;
|
|
32
|
+
private mockMode;
|
|
33
|
+
private language?;
|
|
34
|
+
private abortController;
|
|
35
|
+
private isCancelled;
|
|
36
|
+
private cancelReason?;
|
|
37
|
+
private workspace;
|
|
38
|
+
private computerController;
|
|
39
|
+
private browserController;
|
|
40
|
+
private actionVerifier;
|
|
41
|
+
private approvalManager;
|
|
42
|
+
private planner;
|
|
43
|
+
private toolRegistry;
|
|
44
|
+
private historyMessages;
|
|
45
|
+
private modifiedFiles;
|
|
46
|
+
private backups;
|
|
47
|
+
private totalToolCalls;
|
|
48
|
+
private currentStep;
|
|
49
|
+
private startTime;
|
|
50
|
+
private readFilesHistory;
|
|
51
|
+
private toolCallHistory;
|
|
52
|
+
private screenshotCount;
|
|
53
|
+
private userTier;
|
|
54
|
+
private static readonly MAX_SCREENSHOTS_IN_HISTORY;
|
|
55
|
+
private static readonly SCREENSHOT_MAX_DIMENSION;
|
|
56
|
+
constructor(options?: AgentRuntimeOptions);
|
|
57
|
+
isProOrEnterprise(): boolean;
|
|
58
|
+
getWorkspace(): AgentWorkspace;
|
|
59
|
+
getComputerController(): IComputerController;
|
|
60
|
+
getBrowserController(): IBrowserController;
|
|
61
|
+
getActionVerifier(): ActionVerifier;
|
|
62
|
+
getApprovalManager(): ApprovalManager;
|
|
63
|
+
getPlanner(): TaskPlanner;
|
|
64
|
+
getToolRegistry(): UnifiedToolRegistry;
|
|
65
|
+
cancel(reason?: string): void;
|
|
66
|
+
isTaskCancelled(): boolean;
|
|
67
|
+
getModifiedFiles(): string[];
|
|
68
|
+
getBackups(): FileBackup[];
|
|
69
|
+
getStats(): {
|
|
70
|
+
totalSteps: number;
|
|
71
|
+
totalToolCalls: number;
|
|
72
|
+
modifiedFilesCount: number;
|
|
73
|
+
elapsedMs: number;
|
|
74
|
+
taskId: string;
|
|
75
|
+
status: "cancelled" | "completed" | "executing" | "failed" | "paused" | "planning" | "recovering" | "running" | "waiting_approval";
|
|
76
|
+
};
|
|
77
|
+
resetContext(): void;
|
|
78
|
+
private buildSystemPrompt;
|
|
79
|
+
executeGoal(userGoal: string): Promise<RuntimeExecutionResult>;
|
|
80
|
+
executeTool(name: string, args: any): Promise<{
|
|
81
|
+
result: string;
|
|
82
|
+
screenshotBase64?: string | undefined;
|
|
83
|
+
screenshotSummary?: string | undefined;
|
|
84
|
+
}>;
|
|
85
|
+
dispatchTool(name: string, args: any): Promise<{
|
|
86
|
+
result: string;
|
|
87
|
+
screenshotBase64?: string | undefined;
|
|
88
|
+
screenshotSummary?: string | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
private dispatchComputerTool;
|
|
91
|
+
/**
|
|
92
|
+
* Read a screenshot file from disk, resize it to save tokens, and return as base64.
|
|
93
|
+
* Returns undefined if the file cannot be read.
|
|
94
|
+
*/
|
|
95
|
+
private readScreenshotAsBase64;
|
|
96
|
+
/**
|
|
97
|
+
* Capture a post-action screenshot automatically.
|
|
98
|
+
* This gives the model vision of what happened after a screen-modifying action.
|
|
99
|
+
* Includes a brief delay to let the UI settle.
|
|
100
|
+
*/
|
|
101
|
+
private capturePostActionScreenshot;
|
|
102
|
+
/**
|
|
103
|
+
* Remove old screenshot vision messages from history to prevent context overflow.
|
|
104
|
+
* Keeps only the most recent MAX_SCREENSHOTS_IN_HISTORY screenshots.
|
|
105
|
+
*/
|
|
106
|
+
private pruneOldScreenshots;
|
|
107
|
+
private dispatchBrowserTool;
|
|
108
|
+
private dispatchCoreTool;
|
|
109
|
+
private extractJsonToolCall;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=agentRuntime.d.ts.map
|
|
@@ -296,10 +296,7 @@ Action Rules:
|
|
|
296
296
|
userTier: this.userTier,
|
|
297
297
|
});
|
|
298
298
|
const stepSpinner = spinner();
|
|
299
|
-
|
|
300
|
-
? `Scout Operating (Step ${step})`
|
|
301
|
-
: `Scout Operating (Step ${step}/${this.maxSteps})`;
|
|
302
|
-
stepSpinner.start(chalk.cyan(stepText));
|
|
299
|
+
stepSpinner.start(chalk.cyan(`Scout Operating (Step ${step})`));
|
|
303
300
|
try {
|
|
304
301
|
let response;
|
|
305
302
|
const mcpRouting = getMCPManager().routeTools(userGoal);
|
|
@@ -569,8 +566,8 @@ Action Rules:
|
|
|
569
566
|
return {
|
|
570
567
|
success: false,
|
|
571
568
|
summary: Number.isFinite(this.maxSteps)
|
|
572
|
-
? `Reached
|
|
573
|
-
: `Task ended after ${step}
|
|
569
|
+
? `Reached step limit (${this.maxSteps}). Modified files: ${Array.from(this.modifiedFiles).join(', ')}`
|
|
570
|
+
: `Task ended after ${step} steps. Modified files: ${Array.from(this.modifiedFiles).join(', ')}`,
|
|
574
571
|
taskId,
|
|
575
572
|
stepsTaken: step,
|
|
576
573
|
modifiedFiles: Array.from(this.modifiedFiles),
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export type RiskLevel = 'low' | 'medium' | 'high' | 'critical' | 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
2
|
+
export type ActionRiskLevel = RiskLevel;
|
|
3
|
+
export interface ActionRiskAssessment {
|
|
4
|
+
level: 'low' | 'medium' | 'high' | 'critical';
|
|
5
|
+
requiresApproval: boolean;
|
|
6
|
+
reason: string;
|
|
7
|
+
details?: Record<string, any>;
|
|
8
|
+
}
|
|
9
|
+
export interface ApprovalRequest {
|
|
10
|
+
id: string;
|
|
11
|
+
taskId: string;
|
|
12
|
+
tool: string;
|
|
13
|
+
action?: string | undefined;
|
|
14
|
+
target?: string | undefined;
|
|
15
|
+
args: Record<string, any>;
|
|
16
|
+
risk: ActionRiskAssessment;
|
|
17
|
+
riskLevel?: string | undefined;
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
timestamp: string;
|
|
20
|
+
status: 'pending' | 'approved' | 'rejected' | 'auto_approved';
|
|
21
|
+
resolvedAt?: string | undefined;
|
|
22
|
+
reason?: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
export declare class RiskClassifier {
|
|
25
|
+
private sensitiveKeywords;
|
|
26
|
+
private destructiveCommands;
|
|
27
|
+
assessAction(tool: string, args?: Record<string, any>): ActionRiskAssessment;
|
|
28
|
+
classify(tool: string, args?: Record<string, any>): 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
29
|
+
}
|
|
30
|
+
export declare class ApprovalManager {
|
|
31
|
+
private static _instance;
|
|
32
|
+
static getInstance(): ApprovalManager;
|
|
33
|
+
private classifier;
|
|
34
|
+
private autoApprove;
|
|
35
|
+
private pendingRequests;
|
|
36
|
+
private approvalResolvers;
|
|
37
|
+
constructor(autoApprove?: boolean);
|
|
38
|
+
setAutoApprove(enabled: boolean): void;
|
|
39
|
+
isAutoApprove(): boolean;
|
|
40
|
+
checkAction(tool: string, args?: Record<string, any>): ActionRiskAssessment;
|
|
41
|
+
requestApproval(requestOrTaskId: string | {
|
|
42
|
+
action: string;
|
|
43
|
+
target?: string;
|
|
44
|
+
riskLevel?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
suggestedMitigation?: string;
|
|
47
|
+
taskId?: string;
|
|
48
|
+
args?: Record<string, any>;
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}, tool?: string, args?: Record<string, any>, assessment?: ActionRiskAssessment): Promise<any>;
|
|
51
|
+
submitDecision(requestId: string, approved: boolean): boolean;
|
|
52
|
+
resolveRequest(requestId: string, approved: boolean, reason?: string): boolean;
|
|
53
|
+
getPendingRequests(): ApprovalRequest[];
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=safety.d.ts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export type SubagentRole = 'architect' | 'coder' | 'tester' | 'reviewer' | 'operator' | 'researcher' | 'crossapp' | 'general';
|
|
2
|
+
export interface SubagentTaskRequest {
|
|
3
|
+
role: SubagentRole;
|
|
4
|
+
task: string;
|
|
5
|
+
context?: string | undefined;
|
|
6
|
+
maxSteps?: number | undefined;
|
|
7
|
+
depth?: number | undefined;
|
|
8
|
+
cwd?: string | undefined;
|
|
9
|
+
tier?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface SubagentTaskResult {
|
|
12
|
+
success: boolean;
|
|
13
|
+
role: SubagentRole;
|
|
14
|
+
summary: string;
|
|
15
|
+
modifiedFiles: string[];
|
|
16
|
+
stepsUsed: number;
|
|
17
|
+
error?: string;
|
|
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;
|
|
78
|
+
export declare class SubagentManager {
|
|
79
|
+
private static instance;
|
|
80
|
+
private activeDelegations;
|
|
81
|
+
static getInstance(): SubagentManager;
|
|
82
|
+
/**
|
|
83
|
+
* Delegate a scoped subtask to an autonomous specialist subagent.
|
|
84
|
+
*/
|
|
85
|
+
delegate(req: SubagentTaskRequest): Promise<SubagentTaskResult>;
|
|
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>;
|
|
105
|
+
}
|
|
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.
|
|
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
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ToolDefinition } from './agentEngine.js';
|
|
2
|
+
export interface ToolSelectionStrategyResult {
|
|
3
|
+
selectedTool: string;
|
|
4
|
+
level: 'api' | 'dom' | 'computer';
|
|
5
|
+
reason: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const BROWSER_AUTOMATION_TOOLS: ToolDefinition[];
|
|
8
|
+
export declare const COMPUTER_USE_TOOLS: ToolDefinition[];
|
|
9
|
+
export declare const SCRATCHPAD_TOOLS: ToolDefinition[];
|
|
10
|
+
export declare class UnifiedToolRegistry {
|
|
11
|
+
private toolsMap;
|
|
12
|
+
constructor();
|
|
13
|
+
getTool(name: string): ToolDefinition | undefined;
|
|
14
|
+
getAllTools(): ToolDefinition[];
|
|
15
|
+
registerMcpTool(toolDef: ToolDefinition): void;
|
|
16
|
+
unregisterMcpToolsForServer(serverId: string): void;
|
|
17
|
+
getMcpTools(): ToolDefinition[];
|
|
18
|
+
/**
|
|
19
|
+
* Get tools filtered by user subscription tier:
|
|
20
|
+
* - Free: Only basic developer tools (code editing, creating files/folders, running commands, reading files)
|
|
21
|
+
* - Pro / Enterprise: All tools including Scratchpad, Autonomous Computer Use, and Browser Automation
|
|
22
|
+
*/
|
|
23
|
+
getToolsForTier(tier?: string): ToolDefinition[];
|
|
24
|
+
getToolsForMode(mode: 'all' | 'workspace_only' | 'browser_only' | 'computer_only'): ToolDefinition[];
|
|
25
|
+
/**
|
|
26
|
+
* Tool selection strategy enforcing strict tool hierarchy:
|
|
27
|
+
* 1. DIRECT TOOL/API: If exact file/command operation is possible, PREFER API/TOOL (read_file, write_file, run_command)
|
|
28
|
+
* 2. STRUCTURED BROWSER/DOM: If web interaction is needed, PREFER DOM/BROWSER (browser_navigate, browser_click, browser_type)
|
|
29
|
+
* 3. COMPUTER/VISUAL INTERACTION: If desktop app / GUI control is required, USE COMPUTER ACTIONS (computer_screenshot, computer_click, computer_type, computer_open_app)
|
|
30
|
+
*/
|
|
31
|
+
selectOptimalTool(actionGoal: string, context?: {
|
|
32
|
+
hasBrowser?: boolean;
|
|
33
|
+
hasDOM?: boolean;
|
|
34
|
+
hasDesktopApp?: boolean;
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}): string;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=toolRegistry.d.ts.map
|