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
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import { loadAuthConfig } from './auth.js';
|
|
5
|
+
import { getActiveModelInfo } from '../engine/llm.js';
|
|
6
|
+
const FT_DIR = path.join(process.cwd(), '.ft', 'scout');
|
|
7
|
+
const TICKETS_FILE = path.join(FT_DIR, 'support-tickets.json');
|
|
8
|
+
function ensureFtDir() {
|
|
9
|
+
if (!fs.existsSync(FT_DIR)) {
|
|
10
|
+
try {
|
|
11
|
+
fs.mkdirSync(FT_DIR, { recursive: true });
|
|
12
|
+
}
|
|
13
|
+
catch { }
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function loadSupportTickets() {
|
|
17
|
+
ensureFtDir();
|
|
18
|
+
if (!fs.existsSync(TICKETS_FILE)) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
const raw = fs.readFileSync(TICKETS_FILE, 'utf-8');
|
|
23
|
+
const parsed = JSON.parse(raw);
|
|
24
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function saveSupportTickets(tickets) {
|
|
31
|
+
ensureFtDir();
|
|
32
|
+
try {
|
|
33
|
+
fs.writeFileSync(TICKETS_FILE, JSON.stringify(tickets, null, 2), 'utf-8');
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
console.error('Failed to save support tickets:', err);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function generateTicketId() {
|
|
40
|
+
const randomHex = Math.floor(100000 + Math.random() * 900000);
|
|
41
|
+
return `FT-${randomHex}`;
|
|
42
|
+
}
|
|
43
|
+
export function collectSanitizedDiagnostics() {
|
|
44
|
+
const authCfg = loadAuthConfig();
|
|
45
|
+
const modelInfo = getActiveModelInfo();
|
|
46
|
+
let taskCount = 0;
|
|
47
|
+
const tasksDir = path.join(process.cwd(), '.ft', 'tasks');
|
|
48
|
+
if (fs.existsSync(tasksDir)) {
|
|
49
|
+
try {
|
|
50
|
+
taskCount = fs.readdirSync(tasksDir).filter(f => f.endsWith('.json')).length;
|
|
51
|
+
}
|
|
52
|
+
catch { }
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
scoutVersion: '9.5.5',
|
|
56
|
+
nodeVersion: process.version,
|
|
57
|
+
platform: process.platform,
|
|
58
|
+
osRelease: os.release(),
|
|
59
|
+
arch: os.arch(),
|
|
60
|
+
currentTier: (authCfg.currentTier || 'free').toUpperCase(),
|
|
61
|
+
activeModel: modelInfo.currentActiveModel,
|
|
62
|
+
byokEnabled: Boolean(authCfg.byokEnabled),
|
|
63
|
+
totalCredits: authCfg.creditsTotal || 100,
|
|
64
|
+
usedCredits: authCfg.creditsUsed || 0,
|
|
65
|
+
activeTaskCount: taskCount,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export function createSupportTicket(params) {
|
|
69
|
+
const tickets = loadSupportTickets();
|
|
70
|
+
const now = new Date().toISOString();
|
|
71
|
+
const id = generateTicketId();
|
|
72
|
+
const diagnostics = params.attachDiagnostics !== false
|
|
73
|
+
? collectSanitizedDiagnostics()
|
|
74
|
+
: undefined;
|
|
75
|
+
const initialMessage = {
|
|
76
|
+
id: `msg-${Date.now()}-1`,
|
|
77
|
+
sender: 'user',
|
|
78
|
+
senderName: params.userName || params.userEmail || 'Developer',
|
|
79
|
+
message: params.description.trim(),
|
|
80
|
+
timestamp: now,
|
|
81
|
+
};
|
|
82
|
+
const newTicket = {
|
|
83
|
+
id,
|
|
84
|
+
subject: params.subject.trim(),
|
|
85
|
+
description: params.description.trim(),
|
|
86
|
+
userEmail: params.userEmail.trim(),
|
|
87
|
+
userName: params.userName,
|
|
88
|
+
category: params.category || 'other',
|
|
89
|
+
priority: params.priority || 'medium',
|
|
90
|
+
status: 'open',
|
|
91
|
+
createdAt: now,
|
|
92
|
+
updatedAt: now,
|
|
93
|
+
diagnostics,
|
|
94
|
+
messages: [initialMessage],
|
|
95
|
+
};
|
|
96
|
+
tickets.unshift(newTicket);
|
|
97
|
+
saveSupportTickets(tickets);
|
|
98
|
+
return newTicket;
|
|
99
|
+
}
|
|
100
|
+
export function getSupportTicket(id) {
|
|
101
|
+
const tickets = loadSupportTickets();
|
|
102
|
+
const found = tickets.find(t => t.id.toLowerCase() === id.toLowerCase());
|
|
103
|
+
return found || null;
|
|
104
|
+
}
|
|
105
|
+
export function addTicketMessage(ticketId, messageContent, sender = 'user', senderName) {
|
|
106
|
+
const tickets = loadSupportTickets();
|
|
107
|
+
const idx = tickets.findIndex(t => t.id.toLowerCase() === ticketId.toLowerCase());
|
|
108
|
+
if (idx === -1)
|
|
109
|
+
return null;
|
|
110
|
+
const now = new Date().toISOString();
|
|
111
|
+
const newMsg = {
|
|
112
|
+
id: `msg-${Date.now()}-${Math.floor(Math.random() * 1000)}`,
|
|
113
|
+
sender,
|
|
114
|
+
senderName: senderName || (sender === 'support' ? 'FrontTerrain Support' : (sender === 'system' ? 'System' : 'Developer')),
|
|
115
|
+
message: messageContent.trim(),
|
|
116
|
+
timestamp: now,
|
|
117
|
+
};
|
|
118
|
+
tickets[idx].messages.push(newMsg);
|
|
119
|
+
tickets[idx].updatedAt = now;
|
|
120
|
+
if (sender === 'user' && tickets[idx].status === 'resolved') {
|
|
121
|
+
tickets[idx].status = 'open';
|
|
122
|
+
}
|
|
123
|
+
saveSupportTickets(tickets);
|
|
124
|
+
return tickets[idx];
|
|
125
|
+
}
|
|
126
|
+
export function updateTicketStatus(ticketId, status) {
|
|
127
|
+
const tickets = loadSupportTickets();
|
|
128
|
+
const idx = tickets.findIndex(t => t.id.toLowerCase() === ticketId.toLowerCase());
|
|
129
|
+
if (idx === -1)
|
|
130
|
+
return null;
|
|
131
|
+
tickets[idx].status = status;
|
|
132
|
+
tickets[idx].updatedAt = new Date().toISOString();
|
|
133
|
+
saveSupportTickets(tickets);
|
|
134
|
+
return tickets[idx];
|
|
135
|
+
}
|
|
136
|
+
export function getPresetFaqs() {
|
|
137
|
+
return [
|
|
138
|
+
{
|
|
139
|
+
id: 'faq-1',
|
|
140
|
+
category: 'Getting Started',
|
|
141
|
+
question: 'How do I run my first autonomous coding task with Scout?',
|
|
142
|
+
answer: 'Run `scout "your task here"` or launch `scout agent` in interactive mode. Scout can inspect files, write multi-file features, fix bugs, run test suites, and take user guidance via `ask_user`.',
|
|
143
|
+
tags: ['agent', 'start', 'cli', 'tasks'],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: 'faq-2',
|
|
147
|
+
category: 'Desktop & Computer Use',
|
|
148
|
+
question: 'How does Scout launch and interact with desktop applications?',
|
|
149
|
+
answer: 'Scout has built-in Windows, macOS, and Linux desktop driver support. You can say "open notepad", "open chrome", or "launch calculator" — simple launches execute deterministically in < 100ms. For multi-step tasks (e.g. typing or clicking in apps), the `@operator` subagent controls GUI windows securely.',
|
|
150
|
+
tags: ['desktop', 'apps', 'automation', 'operator'],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: 'faq-3',
|
|
154
|
+
category: 'Billing & Quotas',
|
|
155
|
+
question: 'What happens when I hit my free credit limit? How do I use BYOK?',
|
|
156
|
+
answer: 'Free tier includes standard monthly developer credits. When exhausted, you can upgrade to Pro ($19/mo) with unlimited steps and autonomous scratchpad memory, or enable BYOK (Bring Your Own Key) mode via `scout dashboard` to use your custom OpenAI, Anthropic, or NVIDIA API key.',
|
|
157
|
+
tags: ['credits', 'quota', 'byok', 'billing', 'pro'],
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: 'faq-4',
|
|
161
|
+
category: 'MCP Integration',
|
|
162
|
+
question: 'How do I connect external MCP (Model Context Protocol) servers?',
|
|
163
|
+
answer: 'Run `scout mcp add` to launch the interactive MCP wizard. Scout supports both Stdio and HTTP transports with automatic schema validation, permission boundaries, and encryption at rest with AES-256-GCM.',
|
|
164
|
+
tags: ['mcp', 'tools', 'servers', 'transport'],
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: 'faq-5',
|
|
168
|
+
category: 'Troubleshooting & Fixes',
|
|
169
|
+
question: 'How do I undo an agent modification or rollback to a clean state?',
|
|
170
|
+
answer: 'Type `/rollback` or run `scout rollback [checkpointId]` to rewind your workspace files to any snapshot. You can also run `scout undo` to revert the most recent single file modification.',
|
|
171
|
+
tags: ['undo', 'rollback', 'checkpoints', 'history'],
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: 'faq-6',
|
|
175
|
+
category: 'Multi-Account Support',
|
|
176
|
+
question: 'Can I manage multiple FrontTerrain / Holosene developer accounts?',
|
|
177
|
+
answer: 'Yes! Use `scout accounts` to list all signed-in profiles, `scout switch <email>` to switch active accounts seamlessly, or `scout logout --all` to sign out everywhere.',
|
|
178
|
+
tags: ['account', 'switch', 'profiles', 'login'],
|
|
179
|
+
},
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=support.js.map
|