ft-scout 1.0.8 → 1.1.0

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.
Files changed (243) hide show
  1. package/.firebase/hosting.d2Vi.cache +9 -0
  2. package/.firebaserc +14 -0
  3. package/AUTONOMOUS_FEATURES.md +192 -0
  4. package/README.md +482 -32
  5. package/bin/ft.js +2 -0
  6. package/bin/src/commands/agent.d.ts.map +1 -0
  7. package/bin/src/commands/agent.js +1230 -0
  8. package/bin/src/commands/agent.js.map +1 -0
  9. package/bin/src/commands/audit.d.ts.map +1 -0
  10. package/bin/src/commands/audit.js +104 -0
  11. package/bin/src/commands/audit.js.map +1 -0
  12. package/bin/src/commands/authCommand.d.ts.map +1 -0
  13. package/bin/src/commands/authCommand.js +38 -0
  14. package/bin/src/commands/authCommand.js.map +1 -0
  15. package/bin/src/commands/benchmark.d.ts.map +1 -0
  16. package/bin/src/commands/benchmark.js +135 -0
  17. package/bin/src/commands/benchmark.js.map +1 -0
  18. package/bin/src/commands/brief.d.ts.map +1 -1
  19. package/bin/src/commands/brief.js +28 -19
  20. package/bin/src/commands/brief.js.map +1 -1
  21. package/bin/src/commands/configCommand.d.ts.map +1 -0
  22. package/bin/src/commands/configCommand.js +53 -0
  23. package/bin/src/commands/configCommand.js.map +1 -0
  24. package/bin/src/commands/dashboard.d.ts.map +1 -0
  25. package/bin/src/commands/dashboard.js +41 -0
  26. package/bin/src/commands/dashboard.js.map +1 -0
  27. package/bin/src/commands/history.d.ts.map +1 -0
  28. package/bin/src/commands/history.js +20 -0
  29. package/bin/src/commands/history.js.map +1 -0
  30. package/bin/src/commands/init.d.ts.map +1 -1
  31. package/bin/src/commands/init.js +411 -78
  32. package/bin/src/commands/init.js.map +1 -1
  33. package/bin/src/commands/login.d.ts.map +1 -0
  34. package/bin/src/commands/login.js +190 -0
  35. package/bin/src/commands/login.js.map +1 -0
  36. package/bin/src/commands/logout.d.ts.map +1 -0
  37. package/bin/src/commands/logout.js +15 -0
  38. package/bin/src/commands/logout.js.map +1 -0
  39. package/bin/src/commands/mcp.d.ts.map +1 -0
  40. package/bin/src/commands/mcp.js +393 -0
  41. package/bin/src/commands/mcp.js.map +1 -0
  42. package/bin/src/commands/owners.js +6 -6
  43. package/bin/src/commands/owners.js.map +1 -1
  44. package/bin/src/commands/plan.d.ts.map +1 -0
  45. package/bin/src/commands/plan.js +152 -0
  46. package/bin/src/commands/plan.js.map +1 -0
  47. package/bin/src/commands/quota.d.ts.map +1 -0
  48. package/bin/src/commands/quota.js +32 -0
  49. package/bin/src/commands/quota.js.map +1 -0
  50. package/bin/src/commands/recommend.d.ts.map +1 -0
  51. package/bin/src/commands/recommend.js +46 -0
  52. package/bin/src/commands/recommend.js.map +1 -0
  53. package/bin/src/commands/risky.d.ts.map +1 -1
  54. package/bin/src/commands/risky.js +235 -39
  55. package/bin/src/commands/risky.js.map +1 -1
  56. package/bin/src/commands/setup.d.ts.map +1 -1
  57. package/bin/src/commands/setup.js +411 -16
  58. package/bin/src/commands/setup.js.map +1 -1
  59. package/bin/src/commands/signup.d.ts.map +1 -0
  60. package/bin/src/commands/signup.js +118 -0
  61. package/bin/src/commands/signup.js.map +1 -0
  62. package/bin/src/commands/undo.d.ts.map +1 -0
  63. package/bin/src/commands/undo.js +59 -0
  64. package/bin/src/commands/undo.js.map +1 -0
  65. package/bin/src/commands/web.d.ts.map +1 -0
  66. package/bin/src/commands/web.js +90 -0
  67. package/bin/src/commands/web.js.map +1 -0
  68. package/bin/src/discovery/config.d.ts.map +1 -0
  69. package/bin/src/discovery/config.js +41 -0
  70. package/bin/src/discovery/config.js.map +1 -0
  71. package/bin/src/discovery/display.d.ts.map +1 -0
  72. package/bin/src/discovery/display.js +57 -0
  73. package/bin/src/discovery/display.js.map +1 -0
  74. package/bin/src/discovery/messages.d.ts.map +1 -0
  75. package/bin/src/discovery/messages.js +7 -0
  76. package/bin/src/discovery/messages.js.map +1 -0
  77. package/bin/src/discovery/signals.d.ts.map +1 -0
  78. package/bin/src/discovery/signals.js +33 -0
  79. package/bin/src/discovery/signals.js.map +1 -0
  80. package/bin/src/engine/actionVerifier.d.ts.map +1 -0
  81. package/bin/src/engine/actionVerifier.js +283 -0
  82. package/bin/src/engine/actionVerifier.js.map +1 -0
  83. package/bin/src/engine/agentEngine.d.ts.map +1 -0
  84. package/bin/src/engine/agentEngine.js +2188 -0
  85. package/bin/src/engine/agentEngine.js.map +1 -0
  86. package/bin/src/engine/agentState.d.ts.map +1 -0
  87. package/bin/src/engine/agentState.js +381 -0
  88. package/bin/src/engine/agentState.js.map +1 -0
  89. package/bin/src/engine/browser/browserController.d.ts.map +1 -0
  90. package/bin/src/engine/browser/browserController.js +737 -0
  91. package/bin/src/engine/browser/browserController.js.map +1 -0
  92. package/bin/src/engine/browser/index.d.ts.map +1 -0
  93. package/bin/src/engine/browser/index.js +2 -0
  94. package/bin/src/engine/browser/index.js.map +1 -0
  95. package/bin/src/engine/computer/computerController.d.ts.map +1 -0
  96. package/bin/src/engine/computer/computerController.js +773 -0
  97. package/bin/src/engine/computer/computerController.js.map +1 -0
  98. package/bin/src/engine/computer/computerDiagnostic.d.ts.map +1 -0
  99. package/bin/src/engine/computer/computerDiagnostic.js +71 -0
  100. package/bin/src/engine/computer/computerDiagnostic.js.map +1 -0
  101. package/bin/src/engine/computer/index.d.ts.map +1 -0
  102. package/bin/src/engine/computer/index.js +4 -0
  103. package/bin/src/engine/computer/index.js.map +1 -0
  104. package/bin/src/engine/computer/mockComputer.d.ts.map +1 -0
  105. package/bin/src/engine/computer/mockComputer.js +260 -0
  106. package/bin/src/engine/computer/mockComputer.js.map +1 -0
  107. package/bin/src/engine/computer/scoutDriver.cs +1161 -0
  108. package/bin/src/engine/computer/scout_driver.exe +0 -0
  109. package/bin/src/engine/git.d.ts.map +1 -1
  110. package/bin/src/engine/git.js +71 -0
  111. package/bin/src/engine/git.js.map +1 -1
  112. package/bin/src/engine/llm.d.ts.map +1 -1
  113. package/bin/src/engine/llm.js +1272 -23
  114. package/bin/src/engine/llm.js.map +1 -1
  115. package/bin/src/engine/planner.d.ts.map +1 -0
  116. package/bin/src/engine/planner.js +321 -0
  117. package/bin/src/engine/planner.js.map +1 -0
  118. package/bin/src/engine/runtime/agentRuntime.d.ts.map +1 -0
  119. package/bin/src/engine/runtime/agentRuntime.js +1258 -0
  120. package/bin/src/engine/runtime/agentRuntime.js.map +1 -0
  121. package/bin/src/engine/runtime/index.d.ts.map +1 -0
  122. package/bin/src/engine/runtime/index.js +2 -0
  123. package/bin/src/engine/runtime/index.js.map +1 -0
  124. package/bin/src/engine/safety.d.ts.map +1 -0
  125. package/bin/src/engine/safety.js +316 -0
  126. package/bin/src/engine/safety.js.map +1 -0
  127. package/bin/src/engine/scoutAudioRecorder.cs +215 -0
  128. package/bin/src/engine/scout_audio_recorder.exe +0 -0
  129. package/bin/src/engine/toolRegistry.d.ts.map +1 -0
  130. package/bin/src/engine/toolRegistry.js +521 -0
  131. package/bin/src/engine/toolRegistry.js.map +1 -0
  132. package/bin/src/engine/verifier.d.ts.map +1 -0
  133. package/bin/src/engine/verifier.js +414 -0
  134. package/bin/src/engine/verifier.js.map +1 -0
  135. package/bin/src/engine/voiceEngine.d.ts.map +1 -0
  136. package/bin/src/engine/voiceEngine.js +474 -0
  137. package/bin/src/engine/voiceEngine.js.map +1 -0
  138. package/bin/src/engine/web.d.ts.map +1 -0
  139. package/bin/src/engine/web.js +161 -0
  140. package/bin/src/engine/web.js.map +1 -0
  141. package/bin/src/engine/workspace/agentWorkspace.d.ts.map +1 -0
  142. package/bin/src/engine/workspace/agentWorkspace.js +505 -0
  143. package/bin/src/engine/workspace/agentWorkspace.js.map +1 -0
  144. package/bin/src/engine/workspace/index.d.ts.map +1 -0
  145. package/bin/src/engine/workspace/index.js +2 -0
  146. package/bin/src/engine/workspace/index.js.map +1 -0
  147. package/bin/src/index.js +365 -23
  148. package/bin/src/index.js.map +1 -1
  149. package/bin/src/mcp/client.d.ts.map +1 -0
  150. package/bin/src/mcp/client.js +127 -0
  151. package/bin/src/mcp/client.js.map +1 -0
  152. package/bin/src/mcp/discovery.d.ts.map +1 -0
  153. package/bin/src/mcp/discovery.js +91 -0
  154. package/bin/src/mcp/discovery.js.map +1 -0
  155. package/bin/src/mcp/health.d.ts.map +1 -0
  156. package/bin/src/mcp/health.js +44 -0
  157. package/bin/src/mcp/health.js.map +1 -0
  158. package/bin/src/mcp/index.d.ts.map +1 -0
  159. package/bin/src/mcp/index.js +15 -0
  160. package/bin/src/mcp/index.js.map +1 -0
  161. package/bin/src/mcp/manager.d.ts.map +1 -0
  162. package/bin/src/mcp/manager.js +648 -0
  163. package/bin/src/mcp/manager.js.map +1 -0
  164. package/bin/src/mcp/permissions.d.ts.map +1 -0
  165. package/bin/src/mcp/permissions.js +50 -0
  166. package/bin/src/mcp/permissions.js.map +1 -0
  167. package/bin/src/mcp/persistence.d.ts.map +1 -0
  168. package/bin/src/mcp/persistence.js +171 -0
  169. package/bin/src/mcp/persistence.js.map +1 -0
  170. package/bin/src/mcp/recovery.d.ts.map +1 -0
  171. package/bin/src/mcp/recovery.js +75 -0
  172. package/bin/src/mcp/recovery.js.map +1 -0
  173. package/bin/src/mcp/telemetry.d.ts.map +1 -0
  174. package/bin/src/mcp/telemetry.js +82 -0
  175. package/bin/src/mcp/telemetry.js.map +1 -0
  176. package/bin/src/mcp/toolRouter.d.ts.map +1 -0
  177. package/bin/src/mcp/toolRouter.js +127 -0
  178. package/bin/src/mcp/toolRouter.js.map +1 -0
  179. package/bin/src/mcp/transport.d.ts.map +1 -0
  180. package/bin/src/mcp/transport.js +328 -0
  181. package/bin/src/mcp/transport.js.map +1 -0
  182. package/bin/src/mcp/types.d.ts.map +1 -0
  183. package/bin/src/mcp/types.js +6 -0
  184. package/bin/src/mcp/types.js.map +1 -0
  185. package/bin/src/server/server.d.ts.map +1 -0
  186. package/bin/src/server/server.js +989 -0
  187. package/bin/src/server/server.js.map +1 -0
  188. package/bin/src/utils/admin.d.ts.map +1 -0
  189. package/bin/src/utils/admin.js +231 -0
  190. package/bin/src/utils/admin.js.map +1 -0
  191. package/bin/src/utils/auditLogger.d.ts.map +1 -0
  192. package/bin/src/utils/auditLogger.js +70 -0
  193. package/bin/src/utils/auditLogger.js.map +1 -0
  194. package/bin/src/utils/auth.d.ts.map +1 -0
  195. package/bin/src/utils/auth.js +679 -0
  196. package/bin/src/utils/auth.js.map +1 -0
  197. package/bin/src/utils/branding.d.ts.map +1 -0
  198. package/bin/src/utils/branding.js +14 -0
  199. package/bin/src/utils/branding.js.map +1 -0
  200. package/bin/src/utils/config.d.ts.map +1 -1
  201. package/bin/src/utils/config.js +124 -3
  202. package/bin/src/utils/config.js.map +1 -1
  203. package/bin/src/utils/email.d.ts.map +1 -0
  204. package/bin/src/utils/email.js +267 -0
  205. package/bin/src/utils/email.js.map +1 -0
  206. package/bin/src/utils/firebaseAuth.d.ts.map +1 -0
  207. package/bin/src/utils/firebaseAuth.js +174 -0
  208. package/bin/src/utils/firebaseAuth.js.map +1 -0
  209. package/bin/src/utils/holoseneAuth.d.ts.map +1 -0
  210. package/bin/src/utils/holoseneAuth.js +307 -0
  211. package/bin/src/utils/holoseneAuth.js.map +1 -0
  212. package/bin/src/utils/language.d.ts.map +1 -0
  213. package/bin/src/utils/language.js +181 -0
  214. package/bin/src/utils/language.js.map +1 -0
  215. package/bin/src/utils/markdown.d.ts.map +1 -0
  216. package/bin/src/utils/markdown.js +215 -0
  217. package/bin/src/utils/markdown.js.map +1 -0
  218. package/bin/src/utils/payment.d.ts.map +1 -0
  219. package/bin/src/utils/payment.js +290 -0
  220. package/bin/src/utils/payment.js.map +1 -0
  221. package/bin/src/utils/pricing.d.ts.map +1 -0
  222. package/bin/src/utils/pricing.js +165 -0
  223. package/bin/src/utils/pricing.js.map +1 -0
  224. package/bin/src/utils/razorpay.d.ts.map +1 -0
  225. package/bin/src/utils/razorpay.js +144 -0
  226. package/bin/src/utils/razorpay.js.map +1 -0
  227. package/bin/src/utils/session.d.ts.map +1 -0
  228. package/bin/src/utils/session.js +82 -0
  229. package/bin/src/utils/session.js.map +1 -0
  230. package/bin/src/utils/updateCheck.d.ts.map +1 -0
  231. package/bin/src/utils/updateCheck.js +108 -0
  232. package/bin/src/utils/updateCheck.js.map +1 -0
  233. package/downloads/invoice-2026-03.pdf +1 -0
  234. package/firebase.json +74 -0
  235. package/package.json +49 -46
  236. package/web/ScoutFavicon.png +0 -0
  237. package/web/app.js +3944 -0
  238. package/web/styles.css +3081 -0
  239. package/.ft/context.json +0 -18
  240. package/email-template.html +0 -223
  241. package/email-template.txt +0 -45
  242. package/scripts/send-brevo-campaign.cjs +0 -167
  243. package/scripts/send-email.js +0 -77
@@ -0,0 +1,9 @@
1
+ web_cli.html,1789384706180,ddc717303bef518170154b79b8f6911602342f588460119bcaa3d6c81294c8b8
2
+ styles.css,1789384706593,ce4a8628cace15e0a7433ec66509d810f7cc6397c67cabc93599985fa4910114
3
+ ScoutFavicon.png,1786186569805,41a9ca9abf7acd2976e78c72a72285b49cc0e64b2b5eeb2c2b88c69628fc618a
4
+ paid_plans.html,1789384706179,65fd06f74baaf16bdcb3d52a5c80dedada312c58fc489a95da62a1e44122fdc4
5
+ oauth.html,1789356703050,1be7945dd29de564c4d8707b60cd74361e8a4c3c3ab667e5f6fe120dc3a0868d
6
+ authentication.html,1789384706593,0a4c6d035db49e65aa2f79ccfe79a4c9901b5ada5ab2c4be8b7586e4255632e5
7
+ index.html,1789389871678,f5533079081acd7ac2f0551cf025cc432fc9fab34b98d052d01426ef84912151
8
+ admin.html,1789389899952,8cf25a81762f83370eba8e092b6c0ada72c0a43af14d128e3aa19c8b9c2c471c
9
+ app.js,1789389842222,c0356373512932d86a5d14ad5b8989df43b647781a39bc8ae85649bca743d8ae
package/.firebaserc ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "projects": {
3
+ "default": "frontterrain"
4
+ },
5
+ "targets": {
6
+ "frontterrain": {
7
+ "hosting": {
8
+ "tryscout": [
9
+ "tryscout"
10
+ ]
11
+ }
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,192 @@
1
+ # 🚀 Scout Autonomous Agent Features & Architecture Guide
2
+
3
+ Scout is an advanced, multi-modal autonomous agent platform built directly into FT-CLI. It bridges traditional developer terminal workflows with modern web automation and full operating-system desktop control (GUI).
4
+
5
+ ---
6
+
7
+ ## 📑 Table of Contents
8
+
9
+ 1. [Architectural Overview](#architectural-overview)
10
+ 2. [Desktop & Computer-Use (GUI Control)](#1-desktop--computer-use-gui-control)
11
+ 3. [Browser Automation & Web Scraping](#2-browser-automation--web-scraping)
12
+ 4. [Multi-Step Planning & Cognitive Scratchpad](#3-multi-step-planning--cognitive-scratchpad)
13
+ 5. [Action Verification & Self-Healing Engine](#4-action-verification--self-healing-engine)
14
+ 6. [Safety & Human-in-the-Loop Risk Classifier](#5-safety--human-in-the-loop-risk-classifier)
15
+ 7. [Developer & Workspace Baseline Operations](#6-developer--workspace-baseline-operations)
16
+ 8. [Subscription Tier Capabilities (Free vs Pro / Enterprise)](#subscription-tier-capabilities)
17
+
18
+ ---
19
+
20
+ ## Architectural Overview
21
+
22
+ Scout executes a continuous **Perceive ➔ Plan ➔ Act ➔ Verify ➔ Recover** operational loop:
23
+
24
+ ```mermaid
25
+ flowchart TD
26
+ Goal[User High-Level Objective] --> Planner[TaskPlanner & DAG Decomposition]
27
+ Planner --> Scratchpad[Cognitive Scratchpad & State Checkpoint]
28
+ Scratchpad --> SelectTool[Tool Selection Hierarchy]
29
+ SelectTool --> RiskCheck{RiskClassifier & Safety Gate}
30
+ RiskCheck -- High/Critical Risk --> Approval[ApprovalManager: Human Confirmation]
31
+ Approval -- Approved --> Dispatcher[Agent Runtime Dispatcher]
32
+ RiskCheck -- Low/Medium Risk --> Dispatcher
33
+ Dispatcher --> Execute[Execution: Native Computer / Browser / CLI Tools]
34
+ Execute --> Verify[ActionVerifier: Post-Execution Verification]
35
+ Verify -- Success --> Checkpoint[Save Task State & Next Step]
36
+ Verify -- Failure --> Recovery[Error Recovery Strategy: Retry / Alternative]
37
+ Recovery --> Dispatcher
38
+ Checkpoint --> Done{All Steps Complete?}
39
+ Done -- No --> Scratchpad
40
+ Done -- Yes --> Complete[Task Complete Notification]
41
+ ```
42
+
43
+ ---
44
+
45
+ ## 1. 🖥️ Desktop & Computer-Use (GUI Control)
46
+
47
+ Scout provides deep operating system control powered by the high-performance native `scout_driver.exe` engine (Win32 API interop) and Node.js controller integration (`SystemComputerController`).
48
+
49
+ ### Core Features
50
+
51
+ - **Multi-Monitor Screen Perception:**
52
+ - `computer_screenshot` / `screenshot`: Captures high-resolution screen frames to perceive visible windows, buttons, and visual state.
53
+ - **Precision Mouse Automation:**
54
+ - `computer_click`: Sends left, right, or middle mouse clicks to exact screen coordinates `(x, y)`.
55
+ - `computer_double_click`: Opens files, selects words, or triggers desktop shortcuts via double-click.
56
+ - `computer_mouse_move`: Translates the cursor smoothly or instantly across display bounds.
57
+ - `computer_mouse_down` & `computer_mouse_up`: Granular mouse button holds and releases for complex interactions.
58
+ - `computer_drag`: Drags items from `(fromX, fromY)` to destination coordinates `(toX, toY)`.
59
+ - `computer_scroll`: Dispatches vertical and horizontal mouse-wheel scroll deltas.
60
+ - **Keyboard & Shortcut Dispatch:**
61
+ - `computer_type`: Emits text strings directly into focused input controls or editor windows.
62
+ - `computer_key_press`: Presses single functional keys (Enter, Escape, Tab, Backspace, Arrow keys, etc.).
63
+ - `computer_hotkey`: Emits multi-key chords (e.g. `["Control", "s"]` to save, `["Alt", "F4"]` to close, `["Alt", "Tab"]` to switch tasks).
64
+ - **Application & Window Orchestration:**
65
+ - `computer_open_app`: Launches desktop applications (VS Code, Notepad, File Explorer, Terminal, etc.).
66
+ - `computer_close_app`: Gracefully terminates or closes targeted desktop processes and windows.
67
+ - `computer_switch_window`: Brings specific applications into foreground focus by matching title or process.
68
+ - `computer_inspect_ui`: Enumerates active open desktop windows and highlights the current foreground window.
69
+ - `computer_wait`: Pauses execution (100ms - 30,000ms) to allow GUI windows, animations, and transitions to settle.
70
+ - `computer_diagnostic`: Collects display resolution, DPI scaling metrics, and driver connection status.
71
+
72
+ ---
73
+
74
+ ## 2. 🌐 Browser Automation & Web Scraping
75
+
76
+ Implemented in [`browserController.ts`](file:///c:/Users/rishi/FT-CLI/bin/src/engine/browser/browserController.ts), Scout includes an intelligent browser automation controller capable of navigating websites, analyzing semantic DOM trees, and extracting data.
77
+
78
+ ### Core Features
79
+
80
+ - **Page Navigation & State:**
81
+ - `browser_navigate`: Loads HTTP/HTTPS URLs, handles navigation history, and constructs interactive DOM trees.
82
+ - `browser_inspect`: Discovers interactive elements (links, buttons, form fields) and assigns lightweight reference IDs (e.g., `[ref=1]`).
83
+ - **Web Form Interaction:**
84
+ - `browser_click`: Clicks web elements identified by CSS selector, visible label text, or ref ID.
85
+ - `browser_type`: Enters query strings or credentials into active form fields and textareas.
86
+ - `browser_select`: Selects options from dropdown menus (`<select>`) by visible text or value.
87
+ - `browser_scroll`: Scrolls viewport up or down to trigger infinite scroll or lazy-loaded assets.
88
+ - **Data Scraping & File Downloads:**
89
+ - `browser_content`: Strips out HTML markup and extracts clean structured text, tables, and article content.
90
+ - `browser_screenshot`: Captures a visual snapshot of the current web page viewport.
91
+ - `browser_download`: Automatically downloads invoices, reports, PDFs, or files from web links and saves them directly to the workspace `downloads/` directory.
92
+
93
+ #### Example Implementation (`browserController.ts`):
94
+ ```typescript
95
+ // Content Extraction & Document Download
96
+ public async extract_content(selector?: string): Promise<BrowserActionResult> {
97
+ const page = this.mockPages.get(this.currentUrl);
98
+ const text = page
99
+ ? page.html.replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim()
100
+ : `Content of ${this.currentUrl}`;
101
+ return { success: true, output: text, url: this.currentUrl, title: this.currentTitle };
102
+ }
103
+
104
+ public async download_file(urlOrSelector: string, destPath?: string): Promise<BrowserActionResult> {
105
+ // Discovers links, downloads files, and writes to workspace disk
106
+ const fileName = path.basename(targetUrl).includes('.') ? path.basename(targetUrl) : 'downloaded_invoice.pdf';
107
+ const finalPath = destPath ? path.resolve(this.workspaceDir, destPath) : path.resolve(this.workspaceDir, 'downloads', fileName);
108
+ fs.mkdirSync(path.dirname(finalPath), { recursive: true });
109
+ // Stream data and persist to disk...
110
+ }
111
+ ```
112
+
113
+ ---
114
+
115
+ ## 3. 🧠 Multi-Step Planning & Cognitive Scratchpad
116
+
117
+ Complex tasks require structured reasoning, plan tracking, and persistent state across agent steps.
118
+
119
+ - **Dynamic Task Planning (`TaskPlanner`):**
120
+ - Parses open-ended goals into structured steps with explicit dependencies.
121
+ - Dynamically adapts when intermediate steps succeed, fail, or reveal new context.
122
+ - **Cognitive Scratchpad Memory (`scratchpad`):**
123
+ - Exclusive to **Pro & Enterprise** tiers.
124
+ - Provides working memory via `write`, `read`, `append`, and `clear` operations.
125
+ - Persisted locally to `.ft/scratchpad.md` to prevent LLM context overflow during long executions.
126
+ - **Task State Checkpoints (`TaskStateManager`):**
127
+ - Saves full task execution histories and artifact logs to `.ft/tasks/<task_id>.json`.
128
+ - Enables clean task resumption, history reviews, and rollback capabilities.
129
+
130
+ ---
131
+
132
+ ## 4. 🔍 Action Verification & Self-Healing Engine
133
+
134
+ Scout doesn't simply fire tools and assume success. Every action is verified through [`actionVerifier.ts`](file:///c:/Users/rishi/FT-CLI/bin/src/engine/actionVerifier.ts).
135
+
136
+ ### Verification Types
137
+ 1. `file_exists`: Verifies target file is present on the filesystem and contains non-empty contents.
138
+ 2. `app_active`: Verifies that an opened application is running and holds foreground focus.
139
+ 3. `url_matches`: Verifies the browser navigated to the expected target domain/path.
140
+ 4. `element_exists`: Confirms targeted DOM elements rendered on the page.
141
+
142
+ ### Autonomous Recovery Strategy
143
+ When verification fails:
144
+ - **`RETRY`**: Re-attempts the action if caused by transient loading latency.
145
+ - **`ALTERNATIVE`**: Selects a secondary tool or selector if the primary approach is blocked.
146
+ - **`ABORT`**: Gracefully yields to the user if irreversible roadblocks occur.
147
+
148
+ ### Intent Preservation
149
+ If a user requests GUI action (e.g. *"Open Notepad and type my notes"*), Scout strictly honors the intent and will **not** cheat by performing silent background file writes unless explicitly permitted.
150
+
151
+ ---
152
+
153
+ ## 5. 🛡️ Safety & Human-in-the-Loop Risk Classifier
154
+
155
+ Implemented in [`safety.ts`](file:///c:/Users/rishi/FT-CLI/bin/src/engine/safety.ts), Scout protects user systems from accidental disruption or destructive operations.
156
+
157
+ | Risk Level | Triggering Tools / Patterns | Behavior |
158
+ | :--- | :--- | :--- |
159
+ | **LOW** | `read_file`, `browser_inspect`, `computer_screenshot`, `file_info` | Auto-executed silently. |
160
+ | **MEDIUM** | `write_file`, `edit_file`, `browser_type`, `browser_click` | Executed with standard logging. |
161
+ | **HIGH** | `computer_close_app`, destructive hotkeys (`Alt+F4`), process termination | **Execution pauses.** Modal/CLI prompt requires user approval. |
162
+ | **CRITICAL** | System-wide deletion (`rmdir /s /q`, formatting), registry edits | **Blocked / Strict explicit consent required.** |
163
+
164
+ ---
165
+
166
+ ## 6. 💼 Developer & Workspace Baseline Operations
167
+
168
+ In addition to autonomous GUI and web tools, Scout provides a full suite of developer tools:
169
+
170
+ - **File Operations:** `read_file`, `write_file`, `edit_file`, `multi_edit_file`, `file_info`.
171
+ - **Search & Inspection:** `grep_search`, `glob_search`, `tree_view`, `list_dir`.
172
+ - **Command & Version Control:** `run_command`, `git_diff`.
173
+ - **Interaction:** `ask_user`, `task_completed`.
174
+
175
+ ---
176
+
177
+ ## Subscription Tier Capabilities
178
+
179
+ | Feature Capability | Free Tier | Pro Plan | Enterprise Plan |
180
+ | :--- | :---: | :---: | :---: |
181
+ | **Code Reading & File Editing** | ✅ Full | ✅ Full | ✅ Full |
182
+ | **File / Directory Creation** | ✅ Full | ✅ Full | ✅ Full |
183
+ | **Terminal & Build Commands** | ✅ Full | ✅ Full | ✅ Full |
184
+ | **AI Cognitive Scratchpad** | ❌ Blocked | ✅ Full | ✅ Full |
185
+ | **Autonomous Browser Automation** | ❌ Blocked | ✅ Full | ✅ Full |
186
+ | **Autonomous Computer & GUI Control** | ❌ Blocked | ✅ Full | ✅ Full |
187
+ | **Multi-App System Automation** | ❌ Blocked | ✅ Full | ✅ Full |
188
+ | **Dedicated Concurrency & Support** | Community | Priority | 24/7 Dedicated |
189
+
190
+ ---
191
+
192
+ *Authored by Front Terrain Engineering. For upgrades or enterprise deployment, visit [https://scout.frontterrain.com](https://scout.frontterrain.com).*