ft-scout 9.5.4 → 9.5.5
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 +1 -1
- package/bin/src/commands/agent.d.ts +5 -0
- package/bin/src/commands/agent.js +45 -3
- package/bin/src/commands/support.d.ts +9 -0
- package/bin/src/commands/support.js +227 -0
- package/bin/src/engine/agentEngine.js +96 -6
- package/bin/src/engine/computer/computerController.d.ts +6 -0
- package/bin/src/engine/computer/computerController.js +138 -104
- package/bin/src/engine/computer/scoutDriver.cs +84 -2
- package/bin/src/engine/llm.js +16 -0
- package/bin/src/engine/planner.js +64 -34
- package/bin/src/engine/runtime/agentRuntime.js +99 -0
- package/bin/src/engine/subagents/subagentManager.js +2 -2
- package/bin/src/index.js +26 -6
- package/bin/src/mcp/client.js +1 -1
- package/bin/src/server/server.js +136 -0
- package/bin/src/utils/branding.js +1 -1
- package/bin/src/utils/qrBridge.js +1 -1
- package/bin/src/utils/session.d.ts +5 -1
- package/bin/src/utils/session.js +36 -3
- package/bin/src/utils/support.d.ts +63 -0
- package/bin/src/utils/support.js +182 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,6 +35,11 @@ export interface ParsedUserIntent {
|
|
|
35
35
|
targetFiles?: string[] | undefined;
|
|
36
36
|
}
|
|
37
37
|
export declare function parseUserPromptIntent(rawGoal: string, filesList: string[]): ParsedUserIntent;
|
|
38
|
+
/**
|
|
39
|
+
* Detects if user prompt is requesting to redo/repeat the previous task
|
|
40
|
+
* e.g. "redo", "/redo", "redo the task", "retry", "repeat last task", "do it again"
|
|
41
|
+
*/
|
|
42
|
+
export declare function isRedoIntent(input: string): boolean;
|
|
38
43
|
export declare function findTargetFilesFromPrompt(userPrompt: string, specifiedFile: string | undefined, filesList: string[]): string[];
|
|
39
44
|
export declare function getAgentGoalInput(placeholderStr: string): Promise<string | symbol>;
|
|
40
45
|
export declare function handleAgent(goalInput?: string, options?: AgentOptions): Promise<void>;
|
|
@@ -6,6 +6,7 @@ import chalk from 'chalk';
|
|
|
6
6
|
import { simpleGit } from 'simple-git';
|
|
7
7
|
import { generateMultiCodeFix, identifyTargetFiles, analyzeCommandError, generateCodeScanReport, generateFeaturePlan, generateCodeFile, askRepoQuestion, getActiveModelInfo, } from '../engine/llm.js';
|
|
8
8
|
import { loadContext, recordHistoryAction, saveAgentSession, getDirectoryFiles } from '../utils/config.js';
|
|
9
|
+
import { getLastUserGoal } from '../utils/session.js';
|
|
9
10
|
import { renderMarkdown, safeNote } from '../utils/markdown.js';
|
|
10
11
|
import { normalizeLanguage } from '../utils/language.js';
|
|
11
12
|
import { createPullRequest } from '../engine/git.js';
|
|
@@ -18,6 +19,7 @@ import { AgentExecutionLoop, buildDirectoryTree, AGENT_TOOLS } from '../engine/a
|
|
|
18
19
|
import { renderTeamSwarmCard, renderCrossAppSwarmCard } from '../utils/claudeUI.js';
|
|
19
20
|
import { verifyAndSelfHealFiles, executeSmartCommand, runProjectVerification } from '../engine/verifier.js';
|
|
20
21
|
import { speakText, listenSpeechToText, cleanTextForSpeech } from '../engine/voiceEngine.js';
|
|
22
|
+
import { handleSupport } from './support.js';
|
|
21
23
|
import { exec } from 'child_process';
|
|
22
24
|
import { promisify } from 'util';
|
|
23
25
|
const execAsync = promisify(exec);
|
|
@@ -193,6 +195,14 @@ export function parseUserPromptIntent(rawGoal, filesList) {
|
|
|
193
195
|
}
|
|
194
196
|
return { cleanGoal: cleaned, intentType: 'question', targetFile, targetFiles };
|
|
195
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Detects if user prompt is requesting to redo/repeat the previous task
|
|
200
|
+
* e.g. "redo", "/redo", "redo the task", "retry", "repeat last task", "do it again"
|
|
201
|
+
*/
|
|
202
|
+
export function isRedoIntent(input) {
|
|
203
|
+
const clean = (input || '').trim().toLowerCase().replace(/[.!?]/g, '');
|
|
204
|
+
return /^((\/redo|redo|retry|repeat)(\s+(the|last|previous)?\s*(task|goal|action|command|one)?)?|do\s+it\s+again|run\s+again|try\s+again)$/i.test(clean);
|
|
205
|
+
}
|
|
196
206
|
export function findTargetFilesFromPrompt(userPrompt, specifiedFile, filesList) {
|
|
197
207
|
const norm = (p) => p.replace(/\\/g, '/').toLowerCase().trim();
|
|
198
208
|
if (specifiedFile && specifiedFile.trim()) {
|
|
@@ -389,8 +399,8 @@ ${chalk.cyan('/exit')} - Exit session
|
|
|
389
399
|
const KNOWN_SLASH_COMMANDS = [
|
|
390
400
|
'/help', '/tree', '/status', '/stats', '/test', '/explain',
|
|
391
401
|
'/export', '/save-session', '/diff', '/clear', '/compact',
|
|
392
|
-
'/undo', '/history', '/scan', '/plan', '/tasks', '/resume', '/voice', '/speak',
|
|
393
|
-
'/checkpoint', '/rollback', '/checkpoints', '/hud', '/delegate',
|
|
402
|
+
'/undo', '/redo', '/history', '/scan', '/plan', '/tasks', '/resume', '/voice', '/speak',
|
|
403
|
+
'/checkpoint', '/rollback', '/checkpoints', '/hud', '/delegate', '/support',
|
|
394
404
|
'/exit', '/quit'
|
|
395
405
|
];
|
|
396
406
|
if (trimmedInput.startsWith('/')) {
|
|
@@ -399,6 +409,7 @@ ${chalk.cyan('/exit')} - Exit session
|
|
|
399
409
|
const filterStr = trimmedInput.toLowerCase();
|
|
400
410
|
let availableOptions = [
|
|
401
411
|
{ value: '/help', label: '/help', hint: 'Show agent tools & commands guide' },
|
|
412
|
+
{ value: '/support', label: '/support', hint: 'Submit support tickets, view FAQs & diagnostics' },
|
|
402
413
|
{ value: '/checkpoint', label: '/checkpoint', hint: 'Create snapshot checkpoint of workspace' },
|
|
403
414
|
{ value: '/rollback', label: '/rollback', hint: 'Rewind files to a previous checkpoint' },
|
|
404
415
|
{ value: '/checkpoints', label: '/checkpoints', hint: 'List available time-machine checkpoints' },
|
|
@@ -406,6 +417,7 @@ ${chalk.cyan('/exit')} - Exit session
|
|
|
406
417
|
{ value: '/delegate', label: '/delegate', hint: 'Delegate task to specialist subagent swarm' },
|
|
407
418
|
{ value: '/tasks', label: '/tasks', hint: 'List saved autonomous tasks in .ft/tasks/' },
|
|
408
419
|
{ value: '/resume', label: '/resume', hint: 'Resume saved autonomous task by task ID' },
|
|
420
|
+
{ value: '/redo', label: '/redo', hint: 'Redo the most recent completed user task' },
|
|
409
421
|
{ value: '/voice', label: '/voice', hint: 'Activate microphone STT speech input' },
|
|
410
422
|
{ value: '/speak', label: '/speak', hint: 'Speak text out loud via TTS' },
|
|
411
423
|
{ value: '/tree', label: '/tree', hint: 'Display workspace directory tree' },
|
|
@@ -493,7 +505,7 @@ ${chalk.cyan('/exit')} - Exit session
|
|
|
493
505
|
- **grep_search**: String/regex pattern search across codebase.
|
|
494
506
|
- **glob_search**: Filter workspace files by file pattern.
|
|
495
507
|
- **git_diff**: Retrieve uncommitted workspace git diff.
|
|
496
|
-
- **ask_user**:
|
|
508
|
+
- **ask_user**: Prompt user for input, decisions, preferences, or clarifications.
|
|
497
509
|
- **task_completed**: Conclude task execution with teardown summary.
|
|
498
510
|
|
|
499
511
|
### ⚡ Pro & Enterprise Exclusive Features
|
|
@@ -504,6 +516,7 @@ ${chalk.cyan('/exit')} - Exit session
|
|
|
504
516
|
|
|
505
517
|
### 🚀 Interactive Slash Commands
|
|
506
518
|
- \`/help\`: Show this tools & commands guide.
|
|
519
|
+
- \`/support\`: Open Help & Support Center, raise tickets, view FAQs & diagnostics.
|
|
507
520
|
- \`/checkpoint [label]\`: Create an instant snapshot checkpoint of workspace files.
|
|
508
521
|
- \`/rollback [id]\`: Rewind workspace files to a previous checkpoint.
|
|
509
522
|
- \`/checkpoints\`: List all available time-machine checkpoints.
|
|
@@ -531,6 +544,16 @@ ${chalk.cyan('/exit')} - Exit session
|
|
|
531
544
|
safeNote(renderMarkdown(helpText), ' Scout Slash Commands & Tools');
|
|
532
545
|
continue;
|
|
533
546
|
}
|
|
547
|
+
if (trimmedInput.toLowerCase().startsWith('/support')) {
|
|
548
|
+
const parts = trimmedInput.split(/\s+/).slice(1);
|
|
549
|
+
const sub = parts[0]?.toLowerCase();
|
|
550
|
+
await handleSupport({
|
|
551
|
+
new: sub === 'new' || sub === 'create',
|
|
552
|
+
list: sub === 'list',
|
|
553
|
+
open: sub === 'open' || sub === 'web',
|
|
554
|
+
});
|
|
555
|
+
continue;
|
|
556
|
+
}
|
|
534
557
|
if (trimmedInput.toLowerCase() === '/tasks') {
|
|
535
558
|
const tasks = agentLoop.getStateManager().listSavedTasks();
|
|
536
559
|
if (tasks.length === 0) {
|
|
@@ -542,6 +565,15 @@ ${chalk.cyan('/exit')} - Exit session
|
|
|
542
565
|
}
|
|
543
566
|
continue;
|
|
544
567
|
}
|
|
568
|
+
if (isRedoIntent(trimmedInput)) {
|
|
569
|
+
const lastGoal = getLastUserGoal();
|
|
570
|
+
if (!lastGoal) {
|
|
571
|
+
safeNote(chalk.yellow('No previous user task found in session history to redo.'), ' Redo Task');
|
|
572
|
+
continue;
|
|
573
|
+
}
|
|
574
|
+
safeNote(chalk.bold.cyan(`🔁 Redoing last user task:\n${chalk.white(`"${lastGoal}"`)}`), ' Redo Task');
|
|
575
|
+
trimmedInput = lastGoal;
|
|
576
|
+
}
|
|
545
577
|
if (trimmedInput.toLowerCase().startsWith('/resume')) {
|
|
546
578
|
const parts = trimmedInput.split(/\s+/).slice(1);
|
|
547
579
|
const targetId = parts[0]?.trim();
|
|
@@ -1195,6 +1227,16 @@ ${filePreviews}
|
|
|
1195
1227
|
}
|
|
1196
1228
|
}
|
|
1197
1229
|
}
|
|
1230
|
+
// Check if user requested to redo/retry last task
|
|
1231
|
+
if (isRedoIntent(finalGoal)) {
|
|
1232
|
+
const lastGoal = getLastUserGoal();
|
|
1233
|
+
if (!lastGoal) {
|
|
1234
|
+
safeNote(chalk.yellow('No previous user task found in session history to redo.'), ' Redo Task');
|
|
1235
|
+
return;
|
|
1236
|
+
}
|
|
1237
|
+
safeNote(chalk.bold.cyan(`🔁 Redoing last user task:\n${chalk.white(`"${lastGoal}"`)}`), ' Redo Task');
|
|
1238
|
+
finalGoal = lastGoal;
|
|
1239
|
+
}
|
|
1198
1240
|
// Grok & Strawberry-style @mentions direct execution from CLI argument
|
|
1199
1241
|
const directMention = parseMentionedRole(finalGoal);
|
|
1200
1242
|
if (directMention.isMention && directMention.role) {
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { intro, outro, text, select, confirm, isCancel, spinner } from '@clack/prompts';
|
|
3
|
+
import { exec } from 'child_process';
|
|
4
|
+
import { promisify } from 'util';
|
|
5
|
+
import { loadAuthConfig } from '../utils/auth.js';
|
|
6
|
+
import { safeNote, renderMarkdown } from '../utils/markdown.js';
|
|
7
|
+
import { loadSupportTickets, createSupportTicket, getPresetFaqs, collectSanitizedDiagnostics, } from '../utils/support.js';
|
|
8
|
+
import { startDashboardServer } from '../server/server.js';
|
|
9
|
+
const execAsync = promisify(exec);
|
|
10
|
+
export async function handleSupport(options) {
|
|
11
|
+
const authCfg = loadAuthConfig();
|
|
12
|
+
const defaultEmail = authCfg.user?.email || '';
|
|
13
|
+
// Direct flag: --open (Open Web Dashboard)
|
|
14
|
+
if (options?.open) {
|
|
15
|
+
await openSupportInBrowser();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
// Direct flag: --list (List Tickets)
|
|
19
|
+
if (options?.list) {
|
|
20
|
+
displayTicketsList();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
// Direct flag: --new (Raise New Ticket)
|
|
24
|
+
if (options?.new) {
|
|
25
|
+
await promptCreateTicket(defaultEmail);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Direct flag: --faq (Show FAQs)
|
|
29
|
+
if (options?.faq) {
|
|
30
|
+
displayFaqs();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
// Direct flag: --diagnostics (Show Diagnostics)
|
|
34
|
+
if (options?.diagnostics) {
|
|
35
|
+
displayDiagnostics();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
// Interactive menu when no flags provided
|
|
39
|
+
intro(chalk.bold.cyan(' FrontTerrain Scout - Help & Support Center'));
|
|
40
|
+
const action = await select({
|
|
41
|
+
message: 'How can we assist you today?',
|
|
42
|
+
options: [
|
|
43
|
+
{ value: 'new', label: '🎫 Raise a New Support Ticket', hint: 'Submit bug, request feature, or ask for help' },
|
|
44
|
+
{ value: 'list', label: '📋 View My Open Tickets', hint: 'Check status and replies on raised tickets' },
|
|
45
|
+
{ value: 'web', label: '🌐 Open Web Support Dashboard', hint: 'Interactive tickets UI, FAQs & diagnostics in browser' },
|
|
46
|
+
{ value: 'faq', label: '💡 Browse Quick FAQs', hint: 'Common questions on quotas, desktop tools & MCP' },
|
|
47
|
+
{ value: 'diagnostics', label: '🔍 View System Diagnostics', hint: 'Check environment, model, tier & scout version' },
|
|
48
|
+
],
|
|
49
|
+
});
|
|
50
|
+
if (isCancel(action)) {
|
|
51
|
+
outro(chalk.yellow('Support session closed. Run `scout support` anytime!'));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
switch (action) {
|
|
55
|
+
case 'new':
|
|
56
|
+
await promptCreateTicket(defaultEmail);
|
|
57
|
+
break;
|
|
58
|
+
case 'list':
|
|
59
|
+
displayTicketsList();
|
|
60
|
+
break;
|
|
61
|
+
case 'web':
|
|
62
|
+
await openSupportInBrowser();
|
|
63
|
+
break;
|
|
64
|
+
case 'faq':
|
|
65
|
+
displayFaqs();
|
|
66
|
+
break;
|
|
67
|
+
case 'diagnostics':
|
|
68
|
+
displayDiagnostics();
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async function promptCreateTicket(defaultEmail) {
|
|
73
|
+
const subject = await text({
|
|
74
|
+
message: 'Ticket Subject / Summary:',
|
|
75
|
+
placeholder: 'e.g. Issue launching VS Code with computer tools',
|
|
76
|
+
validate: (val) => (!val || !val.trim() ? 'Subject is required.' : undefined),
|
|
77
|
+
});
|
|
78
|
+
if (isCancel(subject))
|
|
79
|
+
return;
|
|
80
|
+
const category = await select({
|
|
81
|
+
message: 'Select Category:',
|
|
82
|
+
options: [
|
|
83
|
+
{ value: 'agent_automation', label: '🤖 Agent & Computer Automation', hint: 'CLI steps, app launching, file edits' },
|
|
84
|
+
{ value: 'billing_quota', label: '💳 Billing, Credits & BYOK', hint: 'Subscription upgrades, PayPal/Razorpay, quotas' },
|
|
85
|
+
{ value: 'cli_crash', label: '⚡ CLI Error or Crash', hint: 'Terminal exceptions, command failures' },
|
|
86
|
+
{ value: 'mcp_integration', label: '🔌 MCP Tools & Servers', hint: 'Connecting servers, stdio/http tools' },
|
|
87
|
+
{ value: 'feature_request', label: '✨ Feature Suggestion', hint: 'Ideas to make Scout co-pilot better' },
|
|
88
|
+
{ value: 'other', label: '❓ General Question / Other' },
|
|
89
|
+
],
|
|
90
|
+
});
|
|
91
|
+
if (isCancel(category))
|
|
92
|
+
return;
|
|
93
|
+
const priority = await select({
|
|
94
|
+
message: 'Select Priority Level:',
|
|
95
|
+
options: [
|
|
96
|
+
{ value: 'low', label: '🟢 Low', hint: 'Minor inquiry or cosmetic suggestion' },
|
|
97
|
+
{ value: 'medium', label: '🟡 Medium', hint: 'Normal feature or non-blocking bug' },
|
|
98
|
+
{ value: 'high', label: '🟠 High', hint: 'Degraded capability or failing workflow' },
|
|
99
|
+
{ value: 'urgent', label: '🔴 Urgent / Blocker', hint: 'Critical blocker preventing work' },
|
|
100
|
+
],
|
|
101
|
+
});
|
|
102
|
+
if (isCancel(priority))
|
|
103
|
+
return;
|
|
104
|
+
const description = await text({
|
|
105
|
+
message: 'Detailed Description (what happened, steps to reproduce, or requirements):',
|
|
106
|
+
placeholder: 'Describe your issue or request in detail...',
|
|
107
|
+
validate: (val) => (!val || !val.trim() ? 'Description is required.' : undefined),
|
|
108
|
+
});
|
|
109
|
+
if (isCancel(description))
|
|
110
|
+
return;
|
|
111
|
+
const email = await text({
|
|
112
|
+
message: 'Your Contact Email (for status updates & response notifications):',
|
|
113
|
+
defaultValue: defaultEmail,
|
|
114
|
+
placeholder: 'developer@example.com',
|
|
115
|
+
validate: (val) => {
|
|
116
|
+
if (!val || !val.trim())
|
|
117
|
+
return 'Contact email is required.';
|
|
118
|
+
if (!val.includes('@') || !val.includes('.'))
|
|
119
|
+
return 'Please enter a valid email address.';
|
|
120
|
+
return undefined;
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
if (isCancel(email))
|
|
124
|
+
return;
|
|
125
|
+
const attachDiagnostics = await confirm({
|
|
126
|
+
message: 'Auto-attach sanitized system diagnostics (OS, Scout version, active tier, active model)?',
|
|
127
|
+
initialValue: true,
|
|
128
|
+
});
|
|
129
|
+
if (isCancel(attachDiagnostics))
|
|
130
|
+
return;
|
|
131
|
+
const spin = spinner();
|
|
132
|
+
spin.start('Submitting support ticket to FrontTerrain...');
|
|
133
|
+
const ticket = createSupportTicket({
|
|
134
|
+
subject: String(subject),
|
|
135
|
+
description: String(description),
|
|
136
|
+
userEmail: String(email),
|
|
137
|
+
category: category,
|
|
138
|
+
priority: priority,
|
|
139
|
+
attachDiagnostics: Boolean(attachDiagnostics),
|
|
140
|
+
});
|
|
141
|
+
spin.stop(chalk.green(`Ticket created successfully: ${chalk.bold(ticket.id)}`));
|
|
142
|
+
safeNote(`${chalk.bold.green('✔ Support Ticket Submitted Successfully')}\n\n` +
|
|
143
|
+
`• ${chalk.bold('Ticket ID:')} ${chalk.bold.cyan(ticket.id)}\n` +
|
|
144
|
+
`• ${chalk.bold('Subject:')} ${ticket.subject}\n` +
|
|
145
|
+
`• ${chalk.bold('Category:')} ${ticket.category.replace(/_/g, ' ').toUpperCase()}\n` +
|
|
146
|
+
`• ${chalk.bold('Priority:')} ${ticket.priority.toUpperCase()}\n` +
|
|
147
|
+
`• ${chalk.bold('Status:')} ${chalk.bold.yellow(ticket.status.toUpperCase())}\n` +
|
|
148
|
+
`• ${chalk.bold('Contact:')} ${ticket.userEmail}\n\n` +
|
|
149
|
+
`${chalk.dim('You can track this ticket anytime using:')}\n` +
|
|
150
|
+
` ${chalk.cyan('scout support --list')}\n` +
|
|
151
|
+
` ${chalk.cyan('scout support --open')} ${chalk.dim('(opens web dashboard)')}`, 'FrontTerrain Support Ticket');
|
|
152
|
+
}
|
|
153
|
+
function displayTicketsList() {
|
|
154
|
+
const tickets = loadSupportTickets();
|
|
155
|
+
if (tickets.length === 0) {
|
|
156
|
+
safeNote('No support tickets found on this device.\n\n' +
|
|
157
|
+
`To raise a ticket, run: ${chalk.cyan('scout support --new')}`, 'Support Tickets');
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const lines = tickets.map((t) => {
|
|
161
|
+
let statusBadge = chalk.yellow(`[${t.status.toUpperCase()}]`);
|
|
162
|
+
if (t.status === 'resolved')
|
|
163
|
+
statusBadge = chalk.green(`[${t.status.toUpperCase()}]`);
|
|
164
|
+
if (t.status === 'in_progress')
|
|
165
|
+
statusBadge = chalk.cyan(`[${t.status.toUpperCase()}]`);
|
|
166
|
+
if (t.status === 'closed')
|
|
167
|
+
statusBadge = chalk.gray(`[${t.status.toUpperCase()}]`);
|
|
168
|
+
let priorityBadge = chalk.white(`[${t.priority.toUpperCase()}]`);
|
|
169
|
+
if (t.priority === 'urgent')
|
|
170
|
+
priorityBadge = chalk.bold.red(`[URGENT]`);
|
|
171
|
+
else if (t.priority === 'high')
|
|
172
|
+
priorityBadge = chalk.yellow(`[HIGH]`);
|
|
173
|
+
return (`${chalk.bold.cyan(t.id)} ${statusBadge} ${priorityBadge} ${chalk.bold(t.subject)}\n` +
|
|
174
|
+
` • Category: ${chalk.dim(t.category.replace(/_/g, ' '))} | Created: ${chalk.dim(new Date(t.createdAt).toLocaleString())}\n` +
|
|
175
|
+
` • Messages: ${t.messages.length} | Contact: ${chalk.dim(t.userEmail)}`);
|
|
176
|
+
});
|
|
177
|
+
safeNote(`Found ${tickets.length} support ticket(s):\n\n` +
|
|
178
|
+
lines.join('\n\n') +
|
|
179
|
+
`\n\n${chalk.dim('To manage tickets in browser, run:')} ${chalk.cyan('scout support --open')}`, `Support Tickets (${tickets.length})`);
|
|
180
|
+
}
|
|
181
|
+
function displayFaqs() {
|
|
182
|
+
const faqs = getPresetFaqs();
|
|
183
|
+
const formatted = faqs.map((f, i) => `### ${i + 1}. ${f.question}\n` +
|
|
184
|
+
`*Category: ${f.category}*\n\n` +
|
|
185
|
+
`${f.answer}\n`).join('\n---\n\n');
|
|
186
|
+
safeNote(renderMarkdown(formatted), 'FrontTerrain Scout Knowledge Base');
|
|
187
|
+
}
|
|
188
|
+
function displayDiagnostics() {
|
|
189
|
+
const diag = collectSanitizedDiagnostics();
|
|
190
|
+
const content = `• **Scout Version:** \`${diag.scoutVersion}\`\n` +
|
|
191
|
+
`• **Node.js:** \`${diag.nodeVersion}\`\n` +
|
|
192
|
+
`• **OS Platform:** \`${diag.platform} (${diag.osRelease}) [${diag.arch}]\`\n` +
|
|
193
|
+
`• **Subscription Tier:** \`${diag.currentTier}\`\n` +
|
|
194
|
+
`• **Active LLM Model:** \`${diag.activeModel}\`\n` +
|
|
195
|
+
`• **BYOK Mode:** \`${diag.byokEnabled ? 'Enabled' : 'Disabled'}\`\n` +
|
|
196
|
+
`• **Credit Quota:** \`${diag.usedCredits}/${diag.totalCredits} credits used\`\n` +
|
|
197
|
+
`• **Active Saved Tasks:** \`${diag.activeTaskCount}\`\n`;
|
|
198
|
+
safeNote(renderMarkdown(content), 'Scout System Diagnostics');
|
|
199
|
+
}
|
|
200
|
+
async function openSupportInBrowser() {
|
|
201
|
+
const s = spinner();
|
|
202
|
+
s.start('Connecting to Scout Web Support Dashboard...');
|
|
203
|
+
try {
|
|
204
|
+
const { url } = await startDashboardServer(9120);
|
|
205
|
+
const supportUrl = `${url}/support`;
|
|
206
|
+
s.stop(`Support server active at ${chalk.bold.cyan(supportUrl)}`);
|
|
207
|
+
const openCmd = process.platform === 'win32'
|
|
208
|
+
? `start "" "${supportUrl}"`
|
|
209
|
+
: process.platform === 'darwin'
|
|
210
|
+
? `open "${supportUrl}"`
|
|
211
|
+
: `xdg-open "${supportUrl}"`;
|
|
212
|
+
try {
|
|
213
|
+
await execAsync(openCmd);
|
|
214
|
+
}
|
|
215
|
+
catch { }
|
|
216
|
+
safeNote(`Web Support Dashboard: ${chalk.bold.underline.cyan(supportUrl)}\n\n` +
|
|
217
|
+
`• Submit & track tickets with live messaging\n` +
|
|
218
|
+
`• Searchable Knowledge Base & FAQs\n` +
|
|
219
|
+
`• Instant Diagnostic Report export\n\n` +
|
|
220
|
+
`${chalk.dim('Press Ctrl+C to stop local dashboard server.')}`, 'FrontTerrain Help & Support Dashboard');
|
|
221
|
+
}
|
|
222
|
+
catch (err) {
|
|
223
|
+
s.stop(chalk.red('Failed to start dashboard server.'));
|
|
224
|
+
console.error(chalk.red(`Error: ${err?.message || err}`));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=support.js.map
|
|
@@ -277,7 +277,7 @@ export const AGENT_TOOLS = [
|
|
|
277
277
|
},
|
|
278
278
|
{
|
|
279
279
|
name: 'ask_user',
|
|
280
|
-
description: '
|
|
280
|
+
description: 'Prompt the user directly for input, decisions, preferences, confirmations, or clarifications. Use this whenever you need user guidance, choices between options, or additional details to proceed.',
|
|
281
281
|
parameters: {
|
|
282
282
|
type: 'object',
|
|
283
283
|
properties: {
|
|
@@ -745,6 +745,70 @@ When returning tool calls, use standard OpenAI function calling format or JSON t
|
|
|
745
745
|
}
|
|
746
746
|
// Robust Target File Discovery: Only run file discovery if the goal has explicit code editing/modification intent
|
|
747
747
|
const simpleAppCheck = checkSimpleAppAction(userGoal);
|
|
748
|
+
if (simpleAppCheck.isSimple && simpleAppCheck.appName) {
|
|
749
|
+
const app = simpleAppCheck.appName;
|
|
750
|
+
const action = simpleAppCheck.action || 'open';
|
|
751
|
+
this.taskStateManager.startStep(1);
|
|
752
|
+
let res;
|
|
753
|
+
const toolName = action === 'close' ? 'computer_close_app' : (action === 'switch' ? 'computer_switch_window' : 'computer_open_app');
|
|
754
|
+
const toolArgs = action === 'switch' ? { windowTitleOrApp: app } : { appName: app };
|
|
755
|
+
renderStepHeader({
|
|
756
|
+
step: 1,
|
|
757
|
+
maxSteps: this.maxSteps,
|
|
758
|
+
startTimeMs: this.startTime,
|
|
759
|
+
tokensConsumed: 0,
|
|
760
|
+
userTier: this.userTier,
|
|
761
|
+
});
|
|
762
|
+
renderToolCall({
|
|
763
|
+
name: toolName,
|
|
764
|
+
args: toolArgs,
|
|
765
|
+
step: 1,
|
|
766
|
+
});
|
|
767
|
+
const actionStartTime = Date.now();
|
|
768
|
+
if (action === 'close') {
|
|
769
|
+
res = await this.computerController.closeApplication(app);
|
|
770
|
+
}
|
|
771
|
+
else if (action === 'switch') {
|
|
772
|
+
res = await this.computerController.switchWindow(app);
|
|
773
|
+
}
|
|
774
|
+
else {
|
|
775
|
+
res = await this.computerController.openApplication(app);
|
|
776
|
+
}
|
|
777
|
+
renderToolResult({
|
|
778
|
+
name: toolName,
|
|
779
|
+
args: toolArgs,
|
|
780
|
+
result: JSON.stringify(res, null, 2),
|
|
781
|
+
durationMs: Date.now() - actionStartTime,
|
|
782
|
+
success: res && res.success !== false,
|
|
783
|
+
});
|
|
784
|
+
const actionVerb = action === 'close' ? 'closed' : (action === 'switch' ? 'focused' : 'launched');
|
|
785
|
+
const summary = res && res.success !== false
|
|
786
|
+
? `I've ${actionVerb} ${app} for you. It's ready on your screen!`
|
|
787
|
+
: `Attempted to ${action} ${app}: ${res?.output || res?.error || 'Failed to execute application action'}`;
|
|
788
|
+
this.taskStateManager.completeStep(1, summary);
|
|
789
|
+
this.taskStateManager.setStatus(res && res.success !== false ? 'completed' : 'failed');
|
|
790
|
+
renderTaskCompletedCard({
|
|
791
|
+
objective: userGoal,
|
|
792
|
+
summary,
|
|
793
|
+
modifiedFiles: [],
|
|
794
|
+
steps: 1,
|
|
795
|
+
maxSteps: this.maxSteps,
|
|
796
|
+
totalTokens: 0,
|
|
797
|
+
totalToolCalls: 1,
|
|
798
|
+
elapsedSecs: Math.max(0.1, (Date.now() - this.startTime) / 1000),
|
|
799
|
+
userTier: this.userTier,
|
|
800
|
+
});
|
|
801
|
+
saveAgentSession({
|
|
802
|
+
goal: userGoal,
|
|
803
|
+
summary,
|
|
804
|
+
modifiedFiles: [],
|
|
805
|
+
});
|
|
806
|
+
this.syncTelemetry('idle', `scout: completed app action ${action} for ${app}`);
|
|
807
|
+
return {
|
|
808
|
+
success: res && res.success !== false,
|
|
809
|
+
summary,
|
|
810
|
+
};
|
|
811
|
+
}
|
|
748
812
|
const lowerGoal = userGoal.toLowerCase().trim();
|
|
749
813
|
const hasCodeEditIntent = /\b(edit|modify|fix|update|change|refactor|write|create|implement|patch|delete|remove|add\s+code|add\s+function|debug)\b/i.test(lowerGoal) &&
|
|
750
814
|
!/\b(lookup|look\s*up|who|what|why|where|how|explain|describe|tell|status|check|github|mcp)\b/i.test(lowerGoal);
|
|
@@ -940,9 +1004,40 @@ When returning tool calls, use standard OpenAI function calling format or JSON t
|
|
|
940
1004
|
goalLower.includes('calc') ||
|
|
941
1005
|
goalLower.includes('paint') ||
|
|
942
1006
|
goalLower.includes('type') ||
|
|
1007
|
+
goalLower.includes('chrome') ||
|
|
1008
|
+
goalLower.includes('browser') ||
|
|
1009
|
+
goalLower.includes('vscode') ||
|
|
1010
|
+
goalLower.includes('vs code') ||
|
|
1011
|
+
goalLower.includes('code') ||
|
|
1012
|
+
goalLower.includes('terminal') ||
|
|
1013
|
+
goalLower.includes('powershell') ||
|
|
1014
|
+
goalLower.includes('cmd') ||
|
|
1015
|
+
goalLower.includes('explorer') ||
|
|
1016
|
+
goalLower.includes('spotify') ||
|
|
1017
|
+
goalLower.includes('slack') ||
|
|
1018
|
+
goalLower.includes('discord') ||
|
|
1019
|
+
goalLower.includes('edge') ||
|
|
1020
|
+
goalLower.includes('firefox') ||
|
|
1021
|
+
goalLower.includes('excel') ||
|
|
1022
|
+
goalLower.includes('word') ||
|
|
1023
|
+
goalLower.includes('blender') ||
|
|
1024
|
+
goalLower.includes('open') ||
|
|
1025
|
+
goalLower.includes('launch') ||
|
|
1026
|
+
goalLower.includes('window') ||
|
|
1027
|
+
simpleAppCheck.isSimple ||
|
|
943
1028
|
this.executionIntent?.requiredInteraction === 'computer' ||
|
|
944
1029
|
(this.executionIntent?.requiredApplications && this.executionIntent.requiredApplications.length > 0);
|
|
945
1030
|
let baseTools = this.toolRegistry.getToolsForTier(this.userTier);
|
|
1031
|
+
if (needsComputer) {
|
|
1032
|
+
const computerTools = this.toolRegistry.getAllTools().filter((t) => t.name.startsWith('computer_'));
|
|
1033
|
+
const existingNames = new Set(baseTools.map((t) => t.name));
|
|
1034
|
+
for (const ct of computerTools) {
|
|
1035
|
+
if (!existingNames.has(ct.name)) {
|
|
1036
|
+
baseTools.push(ct);
|
|
1037
|
+
existingNames.add(ct.name);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
946
1041
|
if (mcpRouting.tools.length > 0 && !needsBrowser && !needsComputer) {
|
|
947
1042
|
const ESSENTIAL_BASE_TOOLS = new Set(['read_file', 'write_file', 'edit_file', 'run_command', 'list_dir', 'grep_search', 'task_completed', 'ask_user', 'speak_text', 'scratchpad', 'computer_open_app']);
|
|
948
1043
|
baseTools = baseTools.filter((t) => ESSENTIAL_BASE_TOOLS.has(t.name));
|
|
@@ -1976,11 +2071,6 @@ You MUST output exactly ONE JSON code block per tool call. Do NOT describe what
|
|
|
1976
2071
|
}
|
|
1977
2072
|
case 'ask_user': {
|
|
1978
2073
|
const questionText = String(args.question || args.prompt || 'Please provide input:').trim();
|
|
1979
|
-
if (this.autoApprove) {
|
|
1980
|
-
return {
|
|
1981
|
-
result: `[Auto-Approved Mode Active]: User prompt bypassed ("${questionText}"). Inspect local workspace files (read_file, glob_search, list_dir) and proceed autonomously.`
|
|
1982
|
-
};
|
|
1983
|
-
}
|
|
1984
2074
|
const askSpin = spinner();
|
|
1985
2075
|
askSpin.stop();
|
|
1986
2076
|
safeNote(questionText, ' Scout Agent Question for User');
|
|
@@ -116,6 +116,12 @@ export declare class SystemComputerController implements IComputerController {
|
|
|
116
116
|
keyPress(key: string): Promise<ComputerActionResult>;
|
|
117
117
|
hotkey(keys: string[]): Promise<ComputerActionResult>;
|
|
118
118
|
wait(ms: number): Promise<void>;
|
|
119
|
+
resolveCanonicalApp(appName: string, args?: string[]): {
|
|
120
|
+
canonicalCmd: string;
|
|
121
|
+
args: string[];
|
|
122
|
+
titleTerms: string[];
|
|
123
|
+
processNames: string[];
|
|
124
|
+
};
|
|
119
125
|
openApplication(appName: string, args?: string[]): Promise<ComputerActionResult>;
|
|
120
126
|
closeApplication(appName: string): Promise<ComputerActionResult>;
|
|
121
127
|
switchWindow(windowTitleOrApp: string): Promise<ComputerActionResult>;
|