ft-scout 9.4.9 → 9.5.2
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 +12 -18
- package/bin/src/commands/agent.d.ts +41 -0
- 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 +2 -0
- 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 -1
- 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 +34 -15
- 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/computer/scoutDriver.cs +85 -20
- package/bin/src/engine/git.d.ts +20 -0
- package/bin/src/engine/llm.d.ts +92 -0
- package/bin/src/engine/llm.js +298 -273
- package/bin/src/engine/planner.d.ts +21 -0
- package/bin/src/engine/planner.js +12 -4
- package/bin/src/engine/runtime/agentRuntime.d.ts +111 -0
- package/bin/src/engine/runtime/agentRuntime.js +12 -1
- 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 +29 -0
- 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 +4 -4
- 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/auth.js +13 -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 +101 -0
- 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/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 +14 -4
- 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/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/bin/src/engine/llm.js
CHANGED
|
@@ -36,7 +36,7 @@ export function getClientForModel(modelName) {
|
|
|
36
36
|
return clientCache.get('byok');
|
|
37
37
|
}
|
|
38
38
|
const modelLower = (modelName || '').toLowerCase();
|
|
39
|
-
if ((modelLower.startsWith('nvidia/') || modelLower.startsWith('meta/') || modelLower.includes('nemotron') || modelLower.startsWith('deepseek-ai/')) && nvidiaApiKey) {
|
|
39
|
+
if ((modelLower.startsWith('nvidia/') || modelLower.startsWith('meta/') || modelLower.includes('nemotron') || modelLower.startsWith('deepseek-ai/') || modelLower.startsWith('poolside/') || modelLower.startsWith('mistralai/')) && nvidiaApiKey) {
|
|
40
40
|
if (!clientCache.has('nvidia')) {
|
|
41
41
|
clientCache.set('nvidia', new OpenAI({ apiKey: nvidiaApiKey, baseURL: 'https://integrate.api.nvidia.com/v1', timeout: 60000 }));
|
|
42
42
|
}
|
|
@@ -79,14 +79,18 @@ export const openai = new Proxy({}, {
|
|
|
79
79
|
if (prop === 'chat') {
|
|
80
80
|
return {
|
|
81
81
|
completions: {
|
|
82
|
-
create: (params, options) => {
|
|
83
|
-
const model = params?.model || MODEL_FALLBACKS[0] || '
|
|
82
|
+
create: async (params, options) => {
|
|
83
|
+
const model = params?.model || MODEL_FALLBACKS[0] || 'nvidia/nemotron-3.5-bolt-e4b';
|
|
84
84
|
const client = getClientForModel(model);
|
|
85
85
|
const req = { ...params };
|
|
86
86
|
if ((model.startsWith('nvidia/') || model.includes('nemotron')) && req.response_format) {
|
|
87
87
|
delete req.response_format;
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
const res = await client.chat.completions.create(req, options);
|
|
90
|
+
if (res?.choices?.[0]?.message && !res.choices[0].message.content && res.choices[0].message.reasoning_content) {
|
|
91
|
+
res.choices[0].message.content = res.choices[0].message.reasoning_content;
|
|
92
|
+
}
|
|
93
|
+
return res;
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
96
|
};
|
|
@@ -97,26 +101,39 @@ export const openai = new Proxy({}, {
|
|
|
97
101
|
}
|
|
98
102
|
});
|
|
99
103
|
export const AGENT_MODEL_FALLBACKS = [
|
|
100
|
-
...(nvidiaApiKey || byokProvider === 'nvidia' ? [
|
|
104
|
+
...(nvidiaApiKey || byokProvider === 'nvidia' ? [
|
|
105
|
+
'nvidia/nemotron-3.5-bolt-e4b',
|
|
106
|
+
'nvidia/nemotron-3.5-lightning-30b-a3b',
|
|
107
|
+
'nvidia/nemotron-3-ultra-550b-a55b',
|
|
108
|
+
] : []),
|
|
101
109
|
...(geminiApiKey || byokProvider === 'gemini' ? ['gemini-2.5-flash', 'gemini-2.0-flash'] : []),
|
|
102
110
|
...(openaiApiKey || byokProvider === 'openai' ? ['gpt-4o-mini', 'gpt-4o'] : []),
|
|
103
|
-
'
|
|
111
|
+
'nvidia/nemotron-3.5-bolt-e4b',
|
|
104
112
|
'nvidia/nemotron-3.5-lightning-30b-a3b',
|
|
105
113
|
];
|
|
106
114
|
export const INIT_MODEL_FALLBACKS = [
|
|
115
|
+
...(nvidiaApiKey || byokProvider === 'nvidia' ? [
|
|
116
|
+
'nvidia/nemotron-3.5-bolt-e4b',
|
|
117
|
+
'nvidia/nemotron-3.5-lightning-30b-a3b',
|
|
118
|
+
] : []),
|
|
107
119
|
...(geminiApiKey || byokProvider === 'gemini' ? ['gemini-2.5-flash', 'gemini-2.0-flash'] : []),
|
|
108
|
-
...(nvidiaApiKey || byokProvider === 'nvidia' ? ['meta/llama-3.2-11b-vision-instruct', 'nvidia/nemotron-3.5-lightning-30b-a3b'] : []),
|
|
109
120
|
...(openaiApiKey || byokProvider === 'openai' ? ['gpt-4o-mini', 'gpt-4o'] : []),
|
|
121
|
+
'nvidia/nemotron-3.5-bolt-e4b',
|
|
110
122
|
];
|
|
111
123
|
export const WEB_MODEL_FALLBACKS = [
|
|
124
|
+
...(nvidiaApiKey || byokProvider === 'nvidia' ? [
|
|
125
|
+
'nvidia/nemotron-3.5-bolt-e4b',
|
|
126
|
+
'nvidia/nemotron-3.5-lightning-30b-a3b',
|
|
127
|
+
] : []),
|
|
112
128
|
...(geminiApiKey || byokProvider === 'gemini' ? ['gemini-2.5-flash', 'gemini-2.0-flash'] : []),
|
|
113
|
-
...(nvidiaApiKey || byokProvider === 'nvidia' ? ['meta/llama-3.2-11b-vision-instruct', 'nvidia/nemotron-3.5-lightning-30b-a3b'] : []),
|
|
114
129
|
...(openaiApiKey || byokProvider === 'openai' ? ['gpt-4o-mini', 'gpt-4o'] : []),
|
|
130
|
+
'nvidia/nemotron-3.5-bolt-e4b',
|
|
115
131
|
];
|
|
116
132
|
export const MODEL_FALLBACKS = AGENT_MODEL_FALLBACKS;
|
|
117
133
|
export const NVIDIA_INCEPTION_MODELS = [
|
|
118
|
-
'
|
|
119
|
-
'nvidia/nemotron-3.5-lightning-30b-a3b'
|
|
134
|
+
'nvidia/nemotron-3.5-bolt-e4b',
|
|
135
|
+
'nvidia/nemotron-3.5-lightning-30b-a3b',
|
|
136
|
+
'nvidia/nemotron-3-ultra-550b-a55b',
|
|
120
137
|
];
|
|
121
138
|
let inceptionBadgeShown = false;
|
|
122
139
|
export function showInceptionBadgeIfNeeded(tier) {
|
|
@@ -361,17 +378,25 @@ export async function callOpenAIWithRetry(fn, maxRetries = 2, initialDelayMs = 3
|
|
|
361
378
|
async function callOpenAIWithRetryUnqueued(fn, maxRetries, initialDelayMs, customFallbackChain) {
|
|
362
379
|
let lastError;
|
|
363
380
|
const MODEL_REPLACEMENTS = {
|
|
364
|
-
'
|
|
365
|
-
'
|
|
366
|
-
'
|
|
367
|
-
'
|
|
368
|
-
'llama-3.
|
|
369
|
-
'
|
|
381
|
+
'meta/llama-3.2-11b-vision-instruct': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
382
|
+
'meta/llama-3.1-8b-instruct': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
383
|
+
'meta/llama-3.1-70b-instruct': 'nvidia/nemotron-3-ultra-550b-a55b',
|
|
384
|
+
'meta/llama-3.3-70b-instruct': 'nvidia/nemotron-3-ultra-550b-a55b',
|
|
385
|
+
'nvidia/llama-3.1-nemotron-70b-instruct': 'nvidia/nemotron-3.5-lightning-30b-a3b',
|
|
386
|
+
'mistralai/mistral-large-2-instruct': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
387
|
+
'mistralai/mistral-7b-instruct-v0.3': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
388
|
+
'google/gemma-3-12b-it': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
389
|
+
'qwen/qwen3.6-27b': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
390
|
+
'qwen/qwen3.8-27b': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
391
|
+
'llama3-8b-8192': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
392
|
+
'llama3-70b-8192': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
393
|
+
'llama-3.3-70b-versatile': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
394
|
+
'llama-3.1-8b-instant': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
370
395
|
'gpt-oss-8b': 'gpt-4o-mini',
|
|
371
396
|
'openai/gpt-oss-120b': 'gpt-4o',
|
|
372
397
|
'openai/gpt-oss-20b': 'gpt-4o-mini',
|
|
373
|
-
'deepseek-r1-distill-llama-70b': '
|
|
374
|
-
'deepseek-r1-distill-qwen-32b': '
|
|
398
|
+
'deepseek-r1-distill-llama-70b': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
399
|
+
'deepseek-r1-distill-qwen-32b': 'nvidia/nemotron-3.5-bolt-e4b',
|
|
375
400
|
};
|
|
376
401
|
showInceptionBadgeIfNeeded();
|
|
377
402
|
const rawChain = customFallbackChain && customFallbackChain.length > 0 ? customFallbackChain : MODEL_FALLBACKS;
|
|
@@ -384,7 +409,7 @@ async function callOpenAIWithRetryUnqueued(fn, maxRetries, initialDelayMs, custo
|
|
|
384
409
|
...targetChain.filter((m) => m !== primaryCandidate),
|
|
385
410
|
]));
|
|
386
411
|
for (let i = 0; i < modelsToTry.length; i++) {
|
|
387
|
-
const model = modelsToTry[i] || 'nvidia/nemotron-3.5-
|
|
412
|
+
const model = modelsToTry[i] || 'nvidia/nemotron-3.5-bolt-e4b';
|
|
388
413
|
let modelToUse = model;
|
|
389
414
|
try {
|
|
390
415
|
const info = getModelDecommissionInfo(model);
|
|
@@ -549,60 +574,60 @@ function sanitizeRepoSummary(parsed, projectName, filesList) {
|
|
|
549
574
|
}
|
|
550
575
|
let architectureDiagram = typeof parsed.architectureDiagram === 'string' && parsed.architectureDiagram.trim().length > 10
|
|
551
576
|
? parsed.architectureDiagram.trim()
|
|
552
|
-
: `┌───────────────────────┐
|
|
553
|
-
│ Client / User │
|
|
554
|
-
└───────────┬───────────┘
|
|
555
|
-
│
|
|
556
|
-
|
|
557
|
-
┌───────────────────────┐
|
|
558
|
-
│ ${projectName.padEnd(21).substring(0, 21)} │
|
|
559
|
-
└───────────┬───────────┘
|
|
560
|
-
│
|
|
561
|
-
|
|
562
|
-
┌───────────────────────┐
|
|
563
|
-
│ Data & Services │
|
|
577
|
+
: `┌───────────────────────┐
|
|
578
|
+
│ Client / User │
|
|
579
|
+
└───────────┬───────────┘
|
|
580
|
+
│
|
|
581
|
+
|
|
582
|
+
┌───────────────────────┐
|
|
583
|
+
│ ${projectName.padEnd(21).substring(0, 21)} │
|
|
584
|
+
└───────────┬───────────┘
|
|
585
|
+
│
|
|
586
|
+
|
|
587
|
+
┌───────────────────────┐
|
|
588
|
+
│ Data & Services │
|
|
564
589
|
└───────────────────────┘`;
|
|
565
590
|
return { summary, entryPoint, readOrder, painPoints, architectureDiagram };
|
|
566
591
|
}
|
|
567
592
|
export async function generateRepoSummary(projectName, filesList, packageJsonContent, language, native) {
|
|
568
593
|
const langInfo = getLanguageInstruction(language, native);
|
|
569
|
-
const prompt = `
|
|
570
|
-
You are a world-class Principal Software Architect and Y Combinator Technical Partner conducting an elite, high-energy codebase teardown for a YC Demo Day pitch.
|
|
571
|
-
|
|
572
|
-
Target Project: ${projectName}
|
|
573
|
-
Target Output Language: ${langInfo.displayName}
|
|
574
|
-
|
|
575
|
-
File Tree Overview:
|
|
576
|
-
${filesList.join('\n')}
|
|
577
|
-
|
|
578
|
-
Manifest / Configuration Details:
|
|
579
|
-
${packageJsonContent}
|
|
580
|
-
|
|
581
|
-
Your goal: Generate an extremely engaging, technically deep, punchy, and impressive breakdown of this codebase. Avoid generic or dry 1-sentence answers. Make it read like a million-dollar technical due-diligence report that wows investors and engineers alike!
|
|
582
|
-
|
|
583
|
-
CRITICAL JSON & SCRIPT GENERATION RULE: ${langInfo.instruction}
|
|
584
|
-
You MUST write complete, deep, rich technical sentences in ${langInfo.displayName} for EVERY SINGLE property in the JSON schema below.
|
|
585
|
-
Keep the bold bullet header titles exact in English (e.g. "- **Core Capability**:", "- **Architecture & Stack**:", "- **Architectural Moat**:") and write the descriptive explanation after the colon in ${langInfo.displayName}.
|
|
586
|
-
Do NOT leave any empty strings, isolated commas, or blank placeholders after colons or arrows (e.g. do NOT output ", ," or "file.js -> ").
|
|
587
|
-
Every read order item MUST be formatted as: "filepath -> Detailed explanation in ${langInfo.displayName}".
|
|
588
|
-
Every pain point item MUST be formatted as: " [Category]: Detailed technical risk analysis in ${langInfo.displayName}".
|
|
589
|
-
|
|
590
|
-
Provide a JSON output matching this exact schema:
|
|
591
|
-
{
|
|
592
|
-
"summary": "- **Core Capability**: A punchy 1-2 sentence description of what the project does written in ${langInfo.displayName}.\n- **Architecture & Stack**: Tech stack & core design pattern written in ${langInfo.displayName}.\n- **Architectural Moat**: Unique engineering advantage or value prop written in ${langInfo.displayName}.",
|
|
593
|
-
"entryPoint": "the exact relative path to the primary execution entry point file",
|
|
594
|
-
"readOrder": [
|
|
595
|
-
"file/path/1 -> Strategic reason written in ${langInfo.displayName} detailing why this file is foundational to the architecture",
|
|
596
|
-
"file/path/2 -> Technical justification written in ${langInfo.displayName} for reading this subsystem next",
|
|
597
|
-
"file/path/3 -> Crucial module written in ${langInfo.displayName} detailing core business logic or pipeline routing"
|
|
598
|
-
],
|
|
599
|
-
"painPoints": [
|
|
600
|
-
" [Subsystem Risk]: Deep technical insight written in ${langInfo.displayName} into potential architectural debt, fragile dependency, or scaling bottleneck",
|
|
601
|
-
" [Scaling Bottleneck]: Critical operational or state management risk written in ${langInfo.displayName} engineers must watch out for",
|
|
602
|
-
" [Execution Note]: Key architectural constraint or environment requirement written in ${langInfo.displayName} for developer onboarding"
|
|
603
|
-
],
|
|
604
|
-
"architectureDiagram": "A clean 4-8 line ASCII box diagram representing the subsystem flow (e.g. [Client] --> [API Router] --> [Service Layer] --> [Database])"
|
|
605
|
-
}
|
|
594
|
+
const prompt = `
|
|
595
|
+
You are a world-class Principal Software Architect and Y Combinator Technical Partner conducting an elite, high-energy codebase teardown for a YC Demo Day pitch.
|
|
596
|
+
|
|
597
|
+
Target Project: ${projectName}
|
|
598
|
+
Target Output Language: ${langInfo.displayName}
|
|
599
|
+
|
|
600
|
+
File Tree Overview:
|
|
601
|
+
${filesList.join('\n')}
|
|
602
|
+
|
|
603
|
+
Manifest / Configuration Details:
|
|
604
|
+
${packageJsonContent}
|
|
605
|
+
|
|
606
|
+
Your goal: Generate an extremely engaging, technically deep, punchy, and impressive breakdown of this codebase. Avoid generic or dry 1-sentence answers. Make it read like a million-dollar technical due-diligence report that wows investors and engineers alike!
|
|
607
|
+
|
|
608
|
+
CRITICAL JSON & SCRIPT GENERATION RULE: ${langInfo.instruction}
|
|
609
|
+
You MUST write complete, deep, rich technical sentences in ${langInfo.displayName} for EVERY SINGLE property in the JSON schema below.
|
|
610
|
+
Keep the bold bullet header titles exact in English (e.g. "- **Core Capability**:", "- **Architecture & Stack**:", "- **Architectural Moat**:") and write the descriptive explanation after the colon in ${langInfo.displayName}.
|
|
611
|
+
Do NOT leave any empty strings, isolated commas, or blank placeholders after colons or arrows (e.g. do NOT output ", ," or "file.js -> ").
|
|
612
|
+
Every read order item MUST be formatted as: "filepath -> Detailed explanation in ${langInfo.displayName}".
|
|
613
|
+
Every pain point item MUST be formatted as: " [Category]: Detailed technical risk analysis in ${langInfo.displayName}".
|
|
614
|
+
|
|
615
|
+
Provide a JSON output matching this exact schema:
|
|
616
|
+
{
|
|
617
|
+
"summary": "- **Core Capability**: A punchy 1-2 sentence description of what the project does written in ${langInfo.displayName}.\n- **Architecture & Stack**: Tech stack & core design pattern written in ${langInfo.displayName}.\n- **Architectural Moat**: Unique engineering advantage or value prop written in ${langInfo.displayName}.",
|
|
618
|
+
"entryPoint": "the exact relative path to the primary execution entry point file",
|
|
619
|
+
"readOrder": [
|
|
620
|
+
"file/path/1 -> Strategic reason written in ${langInfo.displayName} detailing why this file is foundational to the architecture",
|
|
621
|
+
"file/path/2 -> Technical justification written in ${langInfo.displayName} for reading this subsystem next",
|
|
622
|
+
"file/path/3 -> Crucial module written in ${langInfo.displayName} detailing core business logic or pipeline routing"
|
|
623
|
+
],
|
|
624
|
+
"painPoints": [
|
|
625
|
+
" [Subsystem Risk]: Deep technical insight written in ${langInfo.displayName} into potential architectural debt, fragile dependency, or scaling bottleneck",
|
|
626
|
+
" [Scaling Bottleneck]: Critical operational or state management risk written in ${langInfo.displayName} engineers must watch out for",
|
|
627
|
+
" [Execution Note]: Key architectural constraint or environment requirement written in ${langInfo.displayName} for developer onboarding"
|
|
628
|
+
],
|
|
629
|
+
"architectureDiagram": "A clean 4-8 line ASCII box diagram representing the subsystem flow (e.g. [Client] --> [API Router] --> [Service Layer] --> [Database])"
|
|
630
|
+
}
|
|
606
631
|
`;
|
|
607
632
|
try {
|
|
608
633
|
const response = await callOpenAIWithRetry((model) => openai.chat.completions.create({
|
|
@@ -621,23 +646,23 @@ Provide a JSON output matching this exact schema:
|
|
|
621
646
|
}
|
|
622
647
|
export async function explainCodebaseRisks(file, lineRanges, commitMsgs, language, native) {
|
|
623
648
|
const langInfo = getLanguageInstruction(language, native);
|
|
624
|
-
const prompt = `
|
|
625
|
-
You are a Principal Software Architect analyzing a fragile, high-churn source code file in a software repository.
|
|
626
|
-
|
|
627
|
-
File Path: ${file}
|
|
628
|
-
Fragile Hotspot Line Ranges: ${lineRanges.join(', ') || 'Entire File'}
|
|
629
|
-
Recent Hotfix / Patch Commit Messages:
|
|
630
|
-
${commitMsgs.map((m) => `- ${m}`).join('\n')}
|
|
631
|
-
|
|
632
|
-
Output Language: ${langInfo.displayName}
|
|
633
|
-
Language Instruction: ${langInfo.instruction}
|
|
634
|
-
|
|
635
|
-
Your Goal: Provide a deep technical explanation of:
|
|
636
|
-
1. Why these specific line ranges/hotspots are repeatedly failing or requiring emergency patches.
|
|
637
|
-
2. ️ What architectural debt or design pattern flaws are creating this fragility.
|
|
638
|
-
3. ️ Step-by-step actionable recommendations for refactoring and stabilizing this file.
|
|
639
|
-
|
|
640
|
-
Format the output in clean, elegant Markdown.
|
|
649
|
+
const prompt = `
|
|
650
|
+
You are a Principal Software Architect analyzing a fragile, high-churn source code file in a software repository.
|
|
651
|
+
|
|
652
|
+
File Path: ${file}
|
|
653
|
+
Fragile Hotspot Line Ranges: ${lineRanges.join(', ') || 'Entire File'}
|
|
654
|
+
Recent Hotfix / Patch Commit Messages:
|
|
655
|
+
${commitMsgs.map((m) => `- ${m}`).join('\n')}
|
|
656
|
+
|
|
657
|
+
Output Language: ${langInfo.displayName}
|
|
658
|
+
Language Instruction: ${langInfo.instruction}
|
|
659
|
+
|
|
660
|
+
Your Goal: Provide a deep technical explanation of:
|
|
661
|
+
1. Why these specific line ranges/hotspots are repeatedly failing or requiring emergency patches.
|
|
662
|
+
2. ️ What architectural debt or design pattern flaws are creating this fragility.
|
|
663
|
+
3. ️ Step-by-step actionable recommendations for refactoring and stabilizing this file.
|
|
664
|
+
|
|
665
|
+
Format the output in clean, elegant Markdown.
|
|
641
666
|
`;
|
|
642
667
|
try {
|
|
643
668
|
const response = await callOpenAIWithRetry((model) => openai.chat.completions.create({
|
|
@@ -667,28 +692,28 @@ export async function askRepoQuestion(question, projectName, filesList, manifest
|
|
|
667
692
|
}
|
|
668
693
|
}
|
|
669
694
|
const langInfo = getLanguageInstruction(options?.language, options?.native);
|
|
670
|
-
const systemPrompt = `You are FrontTerrain AI, a world-class Principal Software Architect and Y Combinator Technical Co-Pilot.
|
|
671
|
-
You have indexed the codebase for project: "${projectName}".
|
|
672
|
-
${isWebQuery ? ' Internet Access: ACTIVE. You have live web search capabilities enabled.' : ''}
|
|
673
|
-
|
|
674
|
-
Repository File Structure:
|
|
675
|
-
${filesList.slice(0, 150).join('\n')}
|
|
676
|
-
|
|
677
|
-
Manifest / Config Highlights:
|
|
678
|
-
${manifestContent.slice(0, 2000)}
|
|
695
|
+
const systemPrompt = `You are FrontTerrain AI, a world-class Principal Software Architect and Y Combinator Technical Co-Pilot.
|
|
696
|
+
You have indexed the codebase for project: "${projectName}".
|
|
697
|
+
${isWebQuery ? ' Internet Access: ACTIVE. You have live web search capabilities enabled.' : ''}
|
|
698
|
+
|
|
699
|
+
Repository File Structure:
|
|
700
|
+
${filesList.slice(0, 150).join('\n')}
|
|
701
|
+
|
|
702
|
+
Manifest / Config Highlights:
|
|
703
|
+
${manifestContent.slice(0, 2000)}
|
|
679
704
|
${liveWebContext
|
|
680
705
|
? `\n${liveWebContext}\nInstructions for Internet Context: Utilize the live web search results above to supplement repository technical analysis, provide up-to-date documentation details, and answer external library or architectural questions accurately.`
|
|
681
|
-
: ''}
|
|
682
|
-
|
|
683
|
-
Your mission: Answer technical questions about this repository and web context with extreme clarity, deep technical insight, and structured formatting.
|
|
684
|
-
|
|
685
|
-
CRITICAL LANGUAGE & TERMINAL RENDERING REQUIREMENT: ${langInfo.instruction} Translate all explanations, section titles, and architectural notes into ${langInfo.displayName} while keeping exact code blocks, filenames, function names, and option flags intact.
|
|
686
|
-
|
|
687
|
-
CRITICAL CLI FORMATTING INSTRUCTIONS:
|
|
688
|
-
1. Always structure your answer into short sections using Markdown headers (e.g. ### Architecture Overview).
|
|
689
|
-
2. Use bold lead-in bullet points (e.g. - **Subsystem**: Description) instead of monolithic text walls.
|
|
690
|
-
3. Enclose all filenames, function names, paths, and options in backticks (e.g. \`src/index.ts\`).
|
|
691
|
-
4. Wrap any code snippet in typed markdown code blocks (e.g. \`\`\`ts ... \`\`\`).
|
|
706
|
+
: ''}
|
|
707
|
+
|
|
708
|
+
Your mission: Answer technical questions about this repository and web context with extreme clarity, deep technical insight, and structured formatting.
|
|
709
|
+
|
|
710
|
+
CRITICAL LANGUAGE & TERMINAL RENDERING REQUIREMENT: ${langInfo.instruction} Translate all explanations, section titles, and architectural notes into ${langInfo.displayName} while keeping exact code blocks, filenames, function names, and option flags intact.
|
|
711
|
+
|
|
712
|
+
CRITICAL CLI FORMATTING INSTRUCTIONS:
|
|
713
|
+
1. Always structure your answer into short sections using Markdown headers (e.g. ### Architecture Overview).
|
|
714
|
+
2. Use bold lead-in bullet points (e.g. - **Subsystem**: Description) instead of monolithic text walls.
|
|
715
|
+
3. Enclose all filenames, function names, paths, and options in backticks (e.g. \`src/index.ts\`).
|
|
716
|
+
4. Wrap any code snippet in typed markdown code blocks (e.g. \`\`\`ts ... \`\`\`).
|
|
692
717
|
5. Keep paragraphs short (2-3 sentences max) to ensure medium line-width readability in terminal interfaces.`;
|
|
693
718
|
const messages = [
|
|
694
719
|
{ role: 'system', content: systemPrompt },
|
|
@@ -711,27 +736,27 @@ CRITICAL CLI FORMATTING INSTRUCTIONS:
|
|
|
711
736
|
}
|
|
712
737
|
export async function generateCodeScanReport(projectName, filesList, codeSample, language, native) {
|
|
713
738
|
const langInfo = getLanguageInstruction(language, native);
|
|
714
|
-
const prompt = `You are a Principal Security & Software Quality Auditor performing a read-only bug and code quality scan for project: "${projectName}".
|
|
715
|
-
|
|
716
|
-
File Tree:
|
|
717
|
-
${filesList.slice(0, 100).join('\n')}
|
|
718
|
-
|
|
719
|
-
Key Code Sample / Config Context:
|
|
720
|
-
${codeSample.slice(0, 2500)}
|
|
721
|
-
|
|
722
|
-
Language requirement: Write descriptions in ${langInfo.displayName}.
|
|
723
|
-
|
|
724
|
-
Identify 3 potential bugs, unhandled null pointers, fragile error handlers, or performance risks in this repository.
|
|
725
|
-
Return a valid JSON array matching this exact schema:
|
|
726
|
-
[
|
|
727
|
-
{
|
|
728
|
-
"id": 1,
|
|
729
|
-
"title": "Short title of the bug or issue",
|
|
730
|
-
"file": "relative/file/path.ts",
|
|
731
|
-
"severity": "high",
|
|
732
|
-
"description": "Detailed explanation of why this is a bug or fragile pattern, matching patterns from past hotfixes."
|
|
733
|
-
}
|
|
734
|
-
]
|
|
739
|
+
const prompt = `You are a Principal Security & Software Quality Auditor performing a read-only bug and code quality scan for project: "${projectName}".
|
|
740
|
+
|
|
741
|
+
File Tree:
|
|
742
|
+
${filesList.slice(0, 100).join('\n')}
|
|
743
|
+
|
|
744
|
+
Key Code Sample / Config Context:
|
|
745
|
+
${codeSample.slice(0, 2500)}
|
|
746
|
+
|
|
747
|
+
Language requirement: Write descriptions in ${langInfo.displayName}.
|
|
748
|
+
|
|
749
|
+
Identify 3 potential bugs, unhandled null pointers, fragile error handlers, or performance risks in this repository.
|
|
750
|
+
Return a valid JSON array matching this exact schema:
|
|
751
|
+
[
|
|
752
|
+
{
|
|
753
|
+
"id": 1,
|
|
754
|
+
"title": "Short title of the bug or issue",
|
|
755
|
+
"file": "relative/file/path.ts",
|
|
756
|
+
"severity": "high",
|
|
757
|
+
"description": "Detailed explanation of why this is a bug or fragile pattern, matching patterns from past hotfixes."
|
|
758
|
+
}
|
|
759
|
+
]
|
|
735
760
|
`;
|
|
736
761
|
try {
|
|
737
762
|
const response = await callOpenAIWithRetry((model) => openai.chat.completions.create({
|
|
@@ -796,23 +821,23 @@ Return a valid JSON array matching this exact schema:
|
|
|
796
821
|
}
|
|
797
822
|
export async function generateCodeRecommendations(projectName, filesList, codeSample, language, native) {
|
|
798
823
|
const langInfo = getLanguageInstruction(language, native);
|
|
799
|
-
const prompt = `You are a Principal Software Architect and Y Combinator Technical Partner.
|
|
800
|
-
Provide architecture, performance, and DSA-level suggestions for repository "${projectName}".
|
|
801
|
-
|
|
802
|
-
File Tree:
|
|
803
|
-
${filesList.slice(0, 100).join('\n')}
|
|
804
|
-
|
|
805
|
-
Manifest / Code Highlights:
|
|
806
|
-
${codeSample.slice(0, 2000)}
|
|
807
|
-
|
|
808
|
-
Language requirement: ${langInfo.instruction} Write all headers and explanations in ${langInfo.displayName}.
|
|
809
|
-
|
|
810
|
-
Structure your response into 3 sections:
|
|
811
|
-
1. ### ️ Architectural Enhancements
|
|
812
|
-
2. ### Performance & Caching Optimizations
|
|
813
|
-
3. ### Algorithmic & DSA Recommendations
|
|
814
|
-
|
|
815
|
-
Provide concrete, actionable technical recommendations with exact file names and code pattern suggestions.
|
|
824
|
+
const prompt = `You are a Principal Software Architect and Y Combinator Technical Partner.
|
|
825
|
+
Provide architecture, performance, and DSA-level suggestions for repository "${projectName}".
|
|
826
|
+
|
|
827
|
+
File Tree:
|
|
828
|
+
${filesList.slice(0, 100).join('\n')}
|
|
829
|
+
|
|
830
|
+
Manifest / Code Highlights:
|
|
831
|
+
${codeSample.slice(0, 2000)}
|
|
832
|
+
|
|
833
|
+
Language requirement: ${langInfo.instruction} Write all headers and explanations in ${langInfo.displayName}.
|
|
834
|
+
|
|
835
|
+
Structure your response into 3 sections:
|
|
836
|
+
1. ### ️ Architectural Enhancements
|
|
837
|
+
2. ### Performance & Caching Optimizations
|
|
838
|
+
3. ### Algorithmic & DSA Recommendations
|
|
839
|
+
|
|
840
|
+
Provide concrete, actionable technical recommendations with exact file names and code pattern suggestions.
|
|
816
841
|
`;
|
|
817
842
|
try {
|
|
818
843
|
const response = await callOpenAIWithRetry((model) => openai.chat.completions.create({
|
|
@@ -827,18 +852,18 @@ Provide concrete, actionable technical recommendations with exact file names and
|
|
|
827
852
|
}
|
|
828
853
|
export async function generateFeaturePlan(idea, projectName, filesList, language, native) {
|
|
829
854
|
const langInfo = getLanguageInstruction(language, native);
|
|
830
|
-
const prompt = `You are a Lead Solutions Architect assessing feature request: "${idea}" for project "${projectName}".
|
|
831
|
-
|
|
832
|
-
File Tree:
|
|
833
|
-
${filesList.slice(0, 120).join('\n')}
|
|
834
|
-
|
|
835
|
-
Language requirement: ${langInfo.instruction} Write all explanations in ${langInfo.displayName}.
|
|
836
|
-
|
|
837
|
-
Produce a comprehensive Feasibility Assessment & Step-by-Step Implementation Roadmap:
|
|
838
|
-
1. ### Feasibility & Complexity Assessment
|
|
839
|
-
2. ### Target Files & Affected Subsystems
|
|
840
|
-
3. ### ️ Step-by-Step Implementation Plan
|
|
841
|
-
4. ### ️ Architectural Risks & Considerations
|
|
855
|
+
const prompt = `You are a Lead Solutions Architect assessing feature request: "${idea}" for project "${projectName}".
|
|
856
|
+
|
|
857
|
+
File Tree:
|
|
858
|
+
${filesList.slice(0, 120).join('\n')}
|
|
859
|
+
|
|
860
|
+
Language requirement: ${langInfo.instruction} Write all explanations in ${langInfo.displayName}.
|
|
861
|
+
|
|
862
|
+
Produce a comprehensive Feasibility Assessment & Step-by-Step Implementation Roadmap:
|
|
863
|
+
1. ### Feasibility & Complexity Assessment
|
|
864
|
+
2. ### Target Files & Affected Subsystems
|
|
865
|
+
3. ### ️ Step-by-Step Implementation Plan
|
|
866
|
+
4. ### ️ Architectural Risks & Considerations
|
|
842
867
|
`;
|
|
843
868
|
try {
|
|
844
869
|
const response = await callOpenAIWithRetry((model) => openai.chat.completions.create({
|
|
@@ -912,35 +937,35 @@ export function extractCodeFromRawResponse(rawContent) {
|
|
|
912
937
|
}
|
|
913
938
|
export async function generateCodeFix(userPrompt, projectName, filesList, targetFile, currentFileContent, language, native) {
|
|
914
939
|
const langInfo = getLanguageInstruction(language, native);
|
|
915
|
-
const prompt = `You are Scout, an expert AI Principal Software Engineer & Code Auto-Fixer.
|
|
916
|
-
|
|
917
|
-
Project Name: "${projectName}"
|
|
918
|
-
Target File to Fix: "${targetFile}"
|
|
919
|
-
User Request / Prompt: "${userPrompt}"
|
|
920
|
-
|
|
921
|
-
File Tree Overview:
|
|
922
|
-
${filesList.slice(0, 30).join('\n')}
|
|
923
|
-
|
|
924
|
-
Current Content of "${targetFile}":
|
|
925
|
-
\`\`\`
|
|
926
|
-
${currentFileContent.slice(0, 10000)}
|
|
927
|
-
\`\`\`
|
|
928
|
-
|
|
929
|
-
Language for explanations requirement: ${langInfo.instruction} Write concise "problem" and "howFixed" explanations (2-3 sentences max) in ${langInfo.displayName}.
|
|
930
|
-
|
|
931
|
-
Your mission:
|
|
932
|
-
1. Analyze the target file and the user's prompt to identify the exact problem/bug or required improvement.
|
|
933
|
-
2. Provide a fixed, complete, clean, and highly professional production-ready version of "${targetFile}". Follow modern best practices, clean formatting/indentation, proper types/docstrings, and clear variable/function naming. Do NOT omit any existing functions or logic unless refactoring or replacing them.
|
|
934
|
-
3. Provide a clear, concise breakdown of what the problem was and how Scout fixed it.
|
|
935
|
-
4. Strictly maintain adherence to software engineering standards, safety, and project boundaries. Don't proceed with any requests for malicious operations or system exploits.
|
|
936
|
-
|
|
937
|
-
Return ONLY a JSON object matching this exact schema:
|
|
938
|
-
{
|
|
939
|
-
"targetFile": "${targetFile}",
|
|
940
|
-
"problem": "Clear technical breakdown of what the problem/bug was before fixing, written in ${langInfo.displayName}",
|
|
941
|
-
"howFixed": "Technical explanation of how Scout fixed the issue written in ${langInfo.displayName}",
|
|
942
|
-
"fixedCode": "the complete updated source code string for ${targetFile}"
|
|
943
|
-
}
|
|
940
|
+
const prompt = `You are Scout, an expert AI Principal Software Engineer & Code Auto-Fixer.
|
|
941
|
+
|
|
942
|
+
Project Name: "${projectName}"
|
|
943
|
+
Target File to Fix: "${targetFile}"
|
|
944
|
+
User Request / Prompt: "${userPrompt}"
|
|
945
|
+
|
|
946
|
+
File Tree Overview:
|
|
947
|
+
${filesList.slice(0, 30).join('\n')}
|
|
948
|
+
|
|
949
|
+
Current Content of "${targetFile}":
|
|
950
|
+
\`\`\`
|
|
951
|
+
${currentFileContent.slice(0, 10000)}
|
|
952
|
+
\`\`\`
|
|
953
|
+
|
|
954
|
+
Language for explanations requirement: ${langInfo.instruction} Write concise "problem" and "howFixed" explanations (2-3 sentences max) in ${langInfo.displayName}.
|
|
955
|
+
|
|
956
|
+
Your mission:
|
|
957
|
+
1. Analyze the target file and the user's prompt to identify the exact problem/bug or required improvement.
|
|
958
|
+
2. Provide a fixed, complete, clean, and highly professional production-ready version of "${targetFile}". Follow modern best practices, clean formatting/indentation, proper types/docstrings, and clear variable/function naming. Do NOT omit any existing functions or logic unless refactoring or replacing them.
|
|
959
|
+
3. Provide a clear, concise breakdown of what the problem was and how Scout fixed it.
|
|
960
|
+
4. Strictly maintain adherence to software engineering standards, safety, and project boundaries. Don't proceed with any requests for malicious operations or system exploits.
|
|
961
|
+
|
|
962
|
+
Return ONLY a JSON object matching this exact schema:
|
|
963
|
+
{
|
|
964
|
+
"targetFile": "${targetFile}",
|
|
965
|
+
"problem": "Clear technical breakdown of what the problem/bug was before fixing, written in ${langInfo.displayName}",
|
|
966
|
+
"howFixed": "Technical explanation of how Scout fixed the issue written in ${langInfo.displayName}",
|
|
967
|
+
"fixedCode": "the complete updated source code string for ${targetFile}"
|
|
968
|
+
}
|
|
944
969
|
`;
|
|
945
970
|
try {
|
|
946
971
|
const response = await callOpenAIWithRetry(async (model) => {
|
|
@@ -1020,19 +1045,19 @@ Return ONLY a JSON object matching this exact schema:
|
|
|
1020
1045
|
}
|
|
1021
1046
|
}
|
|
1022
1047
|
export async function identifyTargetFiles(userPrompt, projectName, filesList, language, native) {
|
|
1023
|
-
const prompt = `You are Scout, an AI Principal Software Engineer.
|
|
1024
|
-
Project: "${projectName}"
|
|
1025
|
-
User Request: "${userPrompt}"
|
|
1026
|
-
|
|
1027
|
-
File Tree Overview:
|
|
1028
|
-
${filesList.slice(0, 150).join('\n')}
|
|
1029
|
-
|
|
1030
|
-
Based on the user request, identify which specific file path(s) from the file tree list above need to be modified.
|
|
1031
|
-
Select ONLY the file(s) that strictly need modifications to fulfill the request. Unless the request explicitly asks to modify all files, prefer selecting only the single file or minimal set of files directly relevant.
|
|
1032
|
-
Return ONLY a JSON object matching this exact schema:
|
|
1033
|
-
{
|
|
1034
|
-
"targetFiles": ["relative/file/path1.ts", "relative/file/path2.html"]
|
|
1035
|
-
}
|
|
1048
|
+
const prompt = `You are Scout, an AI Principal Software Engineer.
|
|
1049
|
+
Project: "${projectName}"
|
|
1050
|
+
User Request: "${userPrompt}"
|
|
1051
|
+
|
|
1052
|
+
File Tree Overview:
|
|
1053
|
+
${filesList.slice(0, 150).join('\n')}
|
|
1054
|
+
|
|
1055
|
+
Based on the user request, identify which specific file path(s) from the file tree list above need to be modified.
|
|
1056
|
+
Select ONLY the file(s) that strictly need modifications to fulfill the request. Unless the request explicitly asks to modify all files, prefer selecting only the single file or minimal set of files directly relevant.
|
|
1057
|
+
Return ONLY a JSON object matching this exact schema:
|
|
1058
|
+
{
|
|
1059
|
+
"targetFiles": ["relative/file/path1.ts", "relative/file/path2.html"]
|
|
1060
|
+
}
|
|
1036
1061
|
`;
|
|
1037
1062
|
try {
|
|
1038
1063
|
const response = await callOpenAIWithRetry((model) => openai.chat.completions.create({
|
|
@@ -1076,34 +1101,34 @@ export async function generateMultiCodeFix(userPrompt, projectName, filesList, t
|
|
|
1076
1101
|
combinedFilesPrompt += `\n--- File: "${f}" ---\n\`\`\`\n${content.slice(0, 8000)}\n\`\`\`\n`;
|
|
1077
1102
|
}
|
|
1078
1103
|
if (totalLength < 25000 && filePaths.length <= 10) {
|
|
1079
|
-
const prompt = `You are Scout, an expert AI Principal Software Engineer & Code Auto-Fixer.
|
|
1080
|
-
|
|
1081
|
-
Project Name: "${projectName}"
|
|
1082
|
-
User Request / Prompt: "${userPrompt}"
|
|
1083
|
-
Target Files to Fix (${filePaths.length} files): ${filePaths.join(', ')}
|
|
1084
|
-
|
|
1085
|
-
File Tree Overview:
|
|
1086
|
-
${filesList.slice(0, 50).join('\n')}
|
|
1087
|
-
|
|
1088
|
-
Contents of Target Files:
|
|
1089
|
-
${combinedFilesPrompt}
|
|
1090
|
-
|
|
1091
|
-
Language for explanations requirement: ${langInfo.instruction} Write "problem" and "howFixed" explanations in ${langInfo.displayName}.
|
|
1092
|
-
|
|
1093
|
-
Your mission:
|
|
1094
|
-
1. Analyze ALL target files and the user prompt.
|
|
1095
|
-
2. Provide updated, complete production-ready code for EACH target file according to the user request. Do NOT omit existing logic unless refactoring or fulfilling the prompt.
|
|
1096
|
-
3. Return a JSON object matching this exact schema:
|
|
1097
|
-
{
|
|
1098
|
-
"problem": "Clear technical breakdown of what the issue was across these files written in ${langInfo.displayName}",
|
|
1099
|
-
"howFixed": "Technical explanation of how Scout fixed all target files written in ${langInfo.displayName}",
|
|
1100
|
-
"files": [
|
|
1101
|
-
{
|
|
1102
|
-
"targetFile": "relative/file/path",
|
|
1103
|
-
"fixedCode": "complete updated source code string for this file"
|
|
1104
|
-
}
|
|
1105
|
-
]
|
|
1106
|
-
}
|
|
1104
|
+
const prompt = `You are Scout, an expert AI Principal Software Engineer & Code Auto-Fixer.
|
|
1105
|
+
|
|
1106
|
+
Project Name: "${projectName}"
|
|
1107
|
+
User Request / Prompt: "${userPrompt}"
|
|
1108
|
+
Target Files to Fix (${filePaths.length} files): ${filePaths.join(', ')}
|
|
1109
|
+
|
|
1110
|
+
File Tree Overview:
|
|
1111
|
+
${filesList.slice(0, 50).join('\n')}
|
|
1112
|
+
|
|
1113
|
+
Contents of Target Files:
|
|
1114
|
+
${combinedFilesPrompt}
|
|
1115
|
+
|
|
1116
|
+
Language for explanations requirement: ${langInfo.instruction} Write "problem" and "howFixed" explanations in ${langInfo.displayName}.
|
|
1117
|
+
|
|
1118
|
+
Your mission:
|
|
1119
|
+
1. Analyze ALL target files and the user prompt.
|
|
1120
|
+
2. Provide updated, complete production-ready code for EACH target file according to the user request. Do NOT omit existing logic unless refactoring or fulfilling the prompt.
|
|
1121
|
+
3. Return a JSON object matching this exact schema:
|
|
1122
|
+
{
|
|
1123
|
+
"problem": "Clear technical breakdown of what the issue was across these files written in ${langInfo.displayName}",
|
|
1124
|
+
"howFixed": "Technical explanation of how Scout fixed all target files written in ${langInfo.displayName}",
|
|
1125
|
+
"files": [
|
|
1126
|
+
{
|
|
1127
|
+
"targetFile": "relative/file/path",
|
|
1128
|
+
"fixedCode": "complete updated source code string for this file"
|
|
1129
|
+
}
|
|
1130
|
+
]
|
|
1131
|
+
}
|
|
1107
1132
|
`;
|
|
1108
1133
|
try {
|
|
1109
1134
|
const response = await callOpenAIWithRetry((model) => openai.chat.completions.create({
|
|
@@ -1175,28 +1200,28 @@ Your mission:
|
|
|
1175
1200
|
}
|
|
1176
1201
|
export async function generateCodeFile(filePath, userPrompt, projectName, filesList, language, native) {
|
|
1177
1202
|
const langInfo = getLanguageInstruction(language, native);
|
|
1178
|
-
const prompt = `You are Scout, an expert AI Software Architect & Code Generator.
|
|
1179
|
-
|
|
1180
|
-
Project Name: "${projectName}"
|
|
1181
|
-
Target File to Create: "${filePath}"
|
|
1182
|
-
User Instructions / Prompt: "${userPrompt}"
|
|
1183
|
-
|
|
1184
|
-
File Tree Context:
|
|
1185
|
-
${filesList.slice(0, 80).join('\n')}
|
|
1186
|
-
|
|
1187
|
-
Language requirement: ${langInfo.instruction} Write the "description" explanation in ${langInfo.displayName}.
|
|
1188
|
-
|
|
1189
|
-
Your mission:
|
|
1190
|
-
1. Generate complete, clean, highly professional, modular, and production-ready source code for "${filePath}".
|
|
1191
|
-
2. Maintain strict code elegance: modern language standards, proper syntax, clear variable/function names, explicit types (if TypeScript) or docstrings, defensive null checks, robust error handling, clean formatting, and industry best practices.
|
|
1192
|
-
3. Provide a clear description of what this code does.
|
|
1193
|
-
|
|
1194
|
-
Return ONLY a JSON object matching this exact schema:
|
|
1195
|
-
{
|
|
1196
|
-
"targetFile": "${filePath}",
|
|
1197
|
-
"description": "Clear description of the generated code and its capabilities written in ${langInfo.displayName}",
|
|
1198
|
-
"code": "complete source code string for ${filePath}"
|
|
1199
|
-
}
|
|
1203
|
+
const prompt = `You are Scout, an expert AI Software Architect & Code Generator.
|
|
1204
|
+
|
|
1205
|
+
Project Name: "${projectName}"
|
|
1206
|
+
Target File to Create: "${filePath}"
|
|
1207
|
+
User Instructions / Prompt: "${userPrompt}"
|
|
1208
|
+
|
|
1209
|
+
File Tree Context:
|
|
1210
|
+
${filesList.slice(0, 80).join('\n')}
|
|
1211
|
+
|
|
1212
|
+
Language requirement: ${langInfo.instruction} Write the "description" explanation in ${langInfo.displayName}.
|
|
1213
|
+
|
|
1214
|
+
Your mission:
|
|
1215
|
+
1. Generate complete, clean, highly professional, modular, and production-ready source code for "${filePath}".
|
|
1216
|
+
2. Maintain strict code elegance: modern language standards, proper syntax, clear variable/function names, explicit types (if TypeScript) or docstrings, defensive null checks, robust error handling, clean formatting, and industry best practices.
|
|
1217
|
+
3. Provide a clear description of what this code does.
|
|
1218
|
+
|
|
1219
|
+
Return ONLY a JSON object matching this exact schema:
|
|
1220
|
+
{
|
|
1221
|
+
"targetFile": "${filePath}",
|
|
1222
|
+
"description": "Clear description of the generated code and its capabilities written in ${langInfo.displayName}",
|
|
1223
|
+
"code": "complete source code string for ${filePath}"
|
|
1224
|
+
}
|
|
1200
1225
|
`;
|
|
1201
1226
|
try {
|
|
1202
1227
|
const response = await callOpenAIWithRetry(async (model) => {
|
|
@@ -1271,32 +1296,32 @@ Return ONLY a JSON object matching this exact schema:
|
|
|
1271
1296
|
}
|
|
1272
1297
|
export async function analyzeCommandError(command, exitCode, output, projectName, filesList, language, native) {
|
|
1273
1298
|
const langInfo = getLanguageInstruction(language, native);
|
|
1274
|
-
const prompt = `You are Scout, an expert AI Systems & Build Engineer diagnosing a command failure.
|
|
1275
|
-
|
|
1276
|
-
Project: "${projectName}"
|
|
1277
|
-
Executed Command: \`${command}\`
|
|
1278
|
-
Exit Code: ${exitCode}
|
|
1279
|
-
|
|
1280
|
-
File Tree Overview:
|
|
1281
|
-
${filesList.slice(0, 80).join('\n')}
|
|
1282
|
-
|
|
1283
|
-
Command Output / Failure Logs:
|
|
1284
|
-
\`\`\`
|
|
1285
|
-
${output.slice(0, 8000)}
|
|
1286
|
-
\`\`\`
|
|
1287
|
-
|
|
1288
|
-
Language requirement: ${langInfo.instruction} Write "rootCause" and "suggestedFix" in ${langInfo.displayName}.
|
|
1289
|
-
|
|
1290
|
-
Diagnose why the command failed and identify which source file in the project likely needs to be fixed.
|
|
1291
|
-
|
|
1292
|
-
Return ONLY a JSON object matching this exact schema:
|
|
1293
|
-
{
|
|
1294
|
-
"command": "${command}",
|
|
1295
|
-
"exitCode": ${exitCode},
|
|
1296
|
-
"rootCause": "Clear explanation of why the command failed written in ${langInfo.displayName}",
|
|
1297
|
-
"suggestedFix": "Concrete suggestion on how to resolve the failure written in ${langInfo.displayName}",
|
|
1298
|
-
"targetFileToFix": "relative path to the source file that caused the failure, or empty string if unknown"
|
|
1299
|
-
}
|
|
1299
|
+
const prompt = `You are Scout, an expert AI Systems & Build Engineer diagnosing a command failure.
|
|
1300
|
+
|
|
1301
|
+
Project: "${projectName}"
|
|
1302
|
+
Executed Command: \`${command}\`
|
|
1303
|
+
Exit Code: ${exitCode}
|
|
1304
|
+
|
|
1305
|
+
File Tree Overview:
|
|
1306
|
+
${filesList.slice(0, 80).join('\n')}
|
|
1307
|
+
|
|
1308
|
+
Command Output / Failure Logs:
|
|
1309
|
+
\`\`\`
|
|
1310
|
+
${output.slice(0, 8000)}
|
|
1311
|
+
\`\`\`
|
|
1312
|
+
|
|
1313
|
+
Language requirement: ${langInfo.instruction} Write "rootCause" and "suggestedFix" in ${langInfo.displayName}.
|
|
1314
|
+
|
|
1315
|
+
Diagnose why the command failed and identify which source file in the project likely needs to be fixed.
|
|
1316
|
+
|
|
1317
|
+
Return ONLY a JSON object matching this exact schema:
|
|
1318
|
+
{
|
|
1319
|
+
"command": "${command}",
|
|
1320
|
+
"exitCode": ${exitCode},
|
|
1321
|
+
"rootCause": "Clear explanation of why the command failed written in ${langInfo.displayName}",
|
|
1322
|
+
"suggestedFix": "Concrete suggestion on how to resolve the failure written in ${langInfo.displayName}",
|
|
1323
|
+
"targetFileToFix": "relative path to the source file that caused the failure, or empty string if unknown"
|
|
1324
|
+
}
|
|
1300
1325
|
`;
|
|
1301
1326
|
try {
|
|
1302
1327
|
const response = await callOpenAIWithRetry((model) => openai.chat.completions.create({
|