ft-scout 9.0.5 → 9.0.6
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/.firebase/hosting.d2Vi.cache +4 -3
- package/AUTONOMOUS_FEATURES.md +192 -0
- package/README.md +67 -35
- package/bin/src/commands/login.d.ts.map +1 -1
- package/bin/src/commands/login.js +3 -1
- package/bin/src/commands/login.js.map +1 -1
- package/bin/src/engine/actionVerifier.d.ts.map +1 -1
- package/bin/src/engine/actionVerifier.js +9 -1
- package/bin/src/engine/actionVerifier.js.map +1 -1
- package/bin/src/engine/agentEngine.d.ts.map +1 -1
- package/bin/src/engine/agentEngine.js +69 -3
- package/bin/src/engine/agentEngine.js.map +1 -1
- package/bin/src/engine/browser/browserController.d.ts.map +1 -1
- package/bin/src/engine/browser/browserController.js +53 -13
- package/bin/src/engine/browser/browserController.js.map +1 -1
- package/bin/src/engine/computer/computerController.d.ts.map +1 -1
- package/bin/src/engine/computer/computerController.js +43 -11
- package/bin/src/engine/computer/computerController.js.map +1 -1
- package/bin/src/engine/computer/scoutDriver.cs +325 -37
- package/bin/src/engine/computer/scout_driver.exe +0 -0
- package/bin/src/engine/runtime/agentRuntime.d.ts.map +1 -1
- package/bin/src/engine/runtime/agentRuntime.js +27 -3
- package/bin/src/engine/runtime/agentRuntime.js.map +1 -1
- package/bin/src/engine/safety.d.ts.map +1 -1
- package/bin/src/engine/safety.js +4 -3
- package/bin/src/engine/safety.js.map +1 -1
- package/bin/src/engine/toolRegistry.d.ts.map +1 -1
- package/bin/src/engine/toolRegistry.js +65 -0
- package/bin/src/engine/toolRegistry.js.map +1 -1
- package/bin/src/index.js +5 -4
- package/bin/src/index.js.map +1 -1
- package/bin/src/utils/branding.js +1 -1
- package/bin/src/utils/holoseneAuth.d.ts.map +1 -1
- package/bin/src/utils/holoseneAuth.js +169 -41
- package/bin/src/utils/holoseneAuth.js.map +1 -1
- package/firebase.json +8 -0
- package/package.json +1 -1
- package/web/app.js +3 -3
- package/web/styles.css +2 -2
|
@@ -79,6 +79,13 @@ namespace Scout.ComputerControl
|
|
|
79
79
|
[DllImport("user32.dll")]
|
|
80
80
|
public static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo);
|
|
81
81
|
|
|
82
|
+
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
83
|
+
public static extern bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
|
|
84
|
+
|
|
85
|
+
public const uint WM_CLOSE = 0x0010;
|
|
86
|
+
public const uint KEYEVENTF_EXTENDEDKEY = 0x0001;
|
|
87
|
+
public const uint KEYEVENTF_KEYUP = 0x0002;
|
|
88
|
+
|
|
82
89
|
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
83
90
|
public static extern bool CreateProcess(
|
|
84
91
|
string lpApplicationName,
|
|
@@ -102,10 +109,21 @@ namespace Scout.ComputerControl
|
|
|
102
109
|
public const uint MOUSEEVENTF_MIDDLEUP = 0x0040;
|
|
103
110
|
public const uint MOUSEEVENTF_WHEEL = 0x0800;
|
|
104
111
|
|
|
112
|
+
[DllImport("user32.dll")]
|
|
113
|
+
[return: MarshalAs(UnmanagedType.Bool)]
|
|
114
|
+
public static extern bool IsIconic(IntPtr hWnd);
|
|
115
|
+
|
|
116
|
+
[DllImport("user32.dll")]
|
|
117
|
+
public static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach);
|
|
118
|
+
|
|
119
|
+
[DllImport("kernel32.dll")]
|
|
120
|
+
public static extern uint GetCurrentThreadId();
|
|
121
|
+
|
|
105
122
|
public const int SM_CXSCREEN = 0;
|
|
106
123
|
public const int SM_CYSCREEN = 1;
|
|
107
124
|
public const int SM_CXVIRTUALSCREEN = 78;
|
|
108
125
|
public const int SM_CYVIRTUALSCREEN = 79;
|
|
126
|
+
public const int SW_SHOW = 5;
|
|
109
127
|
public const int SW_RESTORE = 9;
|
|
110
128
|
|
|
111
129
|
[StructLayout(LayoutKind.Sequential)]
|
|
@@ -315,12 +333,21 @@ namespace Scout.ComputerControl
|
|
|
315
333
|
{
|
|
316
334
|
if (IsWindowVisible(hWnd))
|
|
317
335
|
{
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
string t = sb.ToString().Trim();
|
|
321
|
-
if (!string.IsNullOrEmpty(t) && t != "Default IME" && t != "MSCTFIME UI")
|
|
336
|
+
RECT rect;
|
|
337
|
+
if (GetWindowRect(hWnd, out rect))
|
|
322
338
|
{
|
|
323
|
-
|
|
339
|
+
int w = rect.Right - rect.Left;
|
|
340
|
+
int h = rect.Bottom - rect.Top;
|
|
341
|
+
if (w > 30 && h > 30)
|
|
342
|
+
{
|
|
343
|
+
StringBuilder sb = new StringBuilder(512);
|
|
344
|
+
GetWindowText(hWnd, sb, sb.Capacity);
|
|
345
|
+
string t = sb.ToString().Trim();
|
|
346
|
+
if (!string.IsNullOrEmpty(t) && t != "Default IME" && t != "MSCTFIME UI")
|
|
347
|
+
{
|
|
348
|
+
if (!list.Contains(t)) list.Add(t);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
324
351
|
}
|
|
325
352
|
}
|
|
326
353
|
return true;
|
|
@@ -361,11 +388,34 @@ namespace Scout.ComputerControl
|
|
|
361
388
|
|
|
362
389
|
if (foundHwnd != IntPtr.Zero)
|
|
363
390
|
{
|
|
364
|
-
|
|
391
|
+
if (IsIconic(foundHwnd))
|
|
392
|
+
{
|
|
393
|
+
ShowWindow(foundHwnd, SW_RESTORE);
|
|
394
|
+
}
|
|
395
|
+
else
|
|
396
|
+
{
|
|
397
|
+
ShowWindow(foundHwnd, SW_SHOW);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
IntPtr fgHwnd = GetForegroundWindow();
|
|
401
|
+
uint fgPid;
|
|
402
|
+
uint fgThreadId = GetWindowThreadProcessId(fgHwnd, out fgPid);
|
|
403
|
+
uint curThreadId = GetCurrentThreadId();
|
|
404
|
+
if (fgThreadId != 0 && fgThreadId != curThreadId)
|
|
405
|
+
{
|
|
406
|
+
AttachThreadInput(curThreadId, fgThreadId, true);
|
|
407
|
+
}
|
|
408
|
+
|
|
365
409
|
keybd_event(0x12, 0, 0, UIntPtr.Zero);
|
|
366
410
|
keybd_event(0x12, 0, 0x0002, UIntPtr.Zero);
|
|
367
411
|
SetForegroundWindow(foundHwnd);
|
|
368
412
|
BringWindowToTop(foundHwnd);
|
|
413
|
+
|
|
414
|
+
if (fgThreadId != 0 && fgThreadId != curThreadId)
|
|
415
|
+
{
|
|
416
|
+
AttachThreadInput(curThreadId, fgThreadId, false);
|
|
417
|
+
}
|
|
418
|
+
|
|
369
419
|
Thread.Sleep(150);
|
|
370
420
|
return true;
|
|
371
421
|
}
|
|
@@ -438,6 +488,20 @@ namespace Scout.ComputerControl
|
|
|
438
488
|
pid = pi.dwProcessId;
|
|
439
489
|
return true;
|
|
440
490
|
}
|
|
491
|
+
|
|
492
|
+
// Fallback to Process.Start with UseShellExecute
|
|
493
|
+
try
|
|
494
|
+
{
|
|
495
|
+
ProcessStartInfo psi = new ProcessStartInfo(appName);
|
|
496
|
+
psi.UseShellExecute = true;
|
|
497
|
+
Process p = Process.Start(psi);
|
|
498
|
+
if (p != null)
|
|
499
|
+
{
|
|
500
|
+
pid = p.Id;
|
|
501
|
+
return true;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
catch { }
|
|
441
505
|
}
|
|
442
506
|
catch { }
|
|
443
507
|
return false;
|
|
@@ -483,52 +547,252 @@ namespace Scout.ComputerControl
|
|
|
483
547
|
}
|
|
484
548
|
}
|
|
485
549
|
|
|
486
|
-
public static
|
|
550
|
+
public static byte GetVirtualKey(string key)
|
|
487
551
|
{
|
|
552
|
+
if (string.IsNullOrEmpty(key)) return 0;
|
|
488
553
|
string k = key.ToLower().Trim();
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
return
|
|
554
|
+
|
|
555
|
+
// Modifiers
|
|
556
|
+
if (k == "ctrl" || k == "control" || k == "lctrl" || k == "rctrl") return 0x11; // VK_CONTROL
|
|
557
|
+
if (k == "alt" || k == "alternate" || k == "menu" || k == "lalt" || k == "ralt") return 0x12; // VK_MENU
|
|
558
|
+
if (k == "shift" || k == "lshift" || k == "rshift") return 0x10; // VK_SHIFT
|
|
559
|
+
if (k == "win" || k == "windows" || k == "super" || k == "lwin" || k == "cmd" || k == "command") return 0x5B; // VK_LWIN
|
|
560
|
+
if (k == "rwin") return 0x5C; // VK_RWIN
|
|
561
|
+
|
|
562
|
+
// Function keys F1 - F24
|
|
563
|
+
if (k == "f1") return 0x70;
|
|
564
|
+
if (k == "f2") return 0x71;
|
|
565
|
+
if (k == "f3") return 0x72;
|
|
566
|
+
if (k == "f4") return 0x73;
|
|
567
|
+
if (k == "f5") return 0x74;
|
|
568
|
+
if (k == "f6") return 0x75;
|
|
569
|
+
if (k == "f7") return 0x76;
|
|
570
|
+
if (k == "f8") return 0x77;
|
|
571
|
+
if (k == "f9") return 0x78;
|
|
572
|
+
if (k == "f10") return 0x79;
|
|
573
|
+
if (k == "f11") return 0x7A;
|
|
574
|
+
if (k == "f12") return 0x7B;
|
|
575
|
+
if (k == "f13") return 0x7C;
|
|
576
|
+
if (k == "f14") return 0x7D;
|
|
577
|
+
if (k == "f15") return 0x7E;
|
|
578
|
+
if (k == "f16") return 0x7F;
|
|
579
|
+
|
|
580
|
+
// Common special keys
|
|
581
|
+
if (k == "enter" || k == "return") return 0x0D; // VK_RETURN
|
|
582
|
+
if (k == "esc" || k == "escape") return 0x1B; // VK_ESCAPE
|
|
583
|
+
if (k == "tab") return 0x09; // VK_TAB
|
|
584
|
+
if (k == "space" || k == "spacebar") return 0x20; // VK_SPACE
|
|
585
|
+
if (k == "backspace" || k == "back" || k == "bksp") return 0x08; // VK_BACK
|
|
586
|
+
if (k == "del" || k == "delete") return 0x2E; // VK_DELETE
|
|
587
|
+
if (k == "ins" || k == "insert") return 0x2D; // VK_INSERT
|
|
588
|
+
if (k == "home") return 0x24; // VK_HOME
|
|
589
|
+
if (k == "end") return 0x23; // VK_END
|
|
590
|
+
if (k == "pageup" || k == "pgup") return 0x21; // VK_PRIOR
|
|
591
|
+
if (k == "pagedown" || k == "pgdn") return 0x22; // VK_NEXT
|
|
592
|
+
if (k == "left") return 0x25; // VK_LEFT
|
|
593
|
+
if (k == "up") return 0x26; // VK_UP
|
|
594
|
+
if (k == "right") return 0x27; // VK_RIGHT
|
|
595
|
+
if (k == "down") return 0x28; // VK_DOWN
|
|
596
|
+
if (k == "prtscn" || k == "printscreen" || k == "snapshot") return 0x2C; // VK_SNAPSHOT
|
|
597
|
+
|
|
598
|
+
// Single letters a-z
|
|
599
|
+
if (k.Length == 1 && k[0] >= 'a' && k[0] <= 'z')
|
|
600
|
+
{
|
|
601
|
+
return (byte)('A' + (k[0] - 'a'));
|
|
602
|
+
}
|
|
603
|
+
// Single digits 0-9
|
|
604
|
+
if (k.Length == 1 && k[0] >= '0' && k[0] <= '9')
|
|
605
|
+
{
|
|
606
|
+
return (byte)k[0];
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// Punctuation and symbols
|
|
610
|
+
if (k == "+" || k == "plus" || k == "add") return 0xBB; // VK_OEM_PLUS
|
|
611
|
+
if (k == "-" || k == "minus" || k == "subtract") return 0xBD; // VK_OEM_MINUS
|
|
612
|
+
if (k == "=" || k == "equal" || k == "equals") return 0xBB;
|
|
613
|
+
if (k == "," || k == "comma") return 0xBC; // VK_OEM_COMMA
|
|
614
|
+
if (k == "." || k == "period" || k == "dot") return 0xBE; // VK_OEM_PERIOD
|
|
615
|
+
if (k == "/" || k == "slash") return 0xBF; // VK_OEM_2
|
|
616
|
+
if (k == "\\" || k == "backslash") return 0xDC; // VK_OEM_5
|
|
617
|
+
if (k == ";" || k == "semicolon") return 0xBA; // VK_OEM_1
|
|
618
|
+
if (k == "'" || k == "quote" || k == "singlequote") return 0xDE; // VK_OEM_7
|
|
619
|
+
if (k == "[" || k == "openbracket") return 0xDB; // VK_OEM_4
|
|
620
|
+
if (k == "]" || k == "closebracket") return 0xDD; // VK_OEM_6
|
|
621
|
+
if (k == "`" || k == "backtick") return 0xC0; // VK_OEM_3
|
|
622
|
+
|
|
623
|
+
return 0;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
public static string FormatKeyForSendKeys(string key)
|
|
627
|
+
{
|
|
628
|
+
if (string.IsNullOrEmpty(key)) return "";
|
|
629
|
+
string k = key.ToLower().Trim();
|
|
630
|
+
if (k == "enter" || k == "return") return "{ENTER}";
|
|
631
|
+
if (k == "tab") return "{TAB}";
|
|
632
|
+
if (k == "esc" || k == "escape") return "{ESC}";
|
|
633
|
+
if (k == "backspace" || k == "back" || k == "bksp") return "{BACKSPACE}";
|
|
634
|
+
if (k == "del" || k == "delete") return "{DEL}";
|
|
635
|
+
if (k == "ins" || k == "insert") return "{INS}";
|
|
636
|
+
if (k == "up") return "{UP}";
|
|
637
|
+
if (k == "down") return "{DOWN}";
|
|
638
|
+
if (k == "left") return "{LEFT}";
|
|
639
|
+
if (k == "right") return "{RIGHT}";
|
|
640
|
+
if (k == "space" || k == "spacebar") return " ";
|
|
641
|
+
if (k == "home") return "{HOME}";
|
|
642
|
+
if (k == "end") return "{END}";
|
|
643
|
+
if (k == "pageup" || k == "pgup") return "{PGUP}";
|
|
644
|
+
if (k == "pagedown" || k == "pgdn") return "{PGDN}";
|
|
645
|
+
|
|
646
|
+
if (k.Length >= 2 && k[0] == 'f')
|
|
647
|
+
{
|
|
648
|
+
int fnum;
|
|
649
|
+
if (int.TryParse(k.Substring(1), out fnum) && fnum >= 1 && fnum <= 24)
|
|
650
|
+
{
|
|
651
|
+
return "{" + k.ToUpper() + "}";
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
if (k.Length == 1)
|
|
656
|
+
{
|
|
657
|
+
char c = k[0];
|
|
658
|
+
if (c == '+' || c == '^' || c == '%' || c == '~' || c == '(' || c == ')' || c == '{' || c == '}' || c == '[' || c == ']')
|
|
659
|
+
{
|
|
660
|
+
return "{" + c + "}";
|
|
661
|
+
}
|
|
662
|
+
return k;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
return "{" + key.ToUpper() + "}";
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
public static bool KeyPress(string key)
|
|
669
|
+
{
|
|
670
|
+
byte vk = GetVirtualKey(key);
|
|
671
|
+
if (vk != 0)
|
|
672
|
+
{
|
|
673
|
+
keybd_event(vk, 0, 0, UIntPtr.Zero);
|
|
674
|
+
Thread.Sleep(20);
|
|
675
|
+
keybd_event(vk, 0, KEYEVENTF_KEYUP, UIntPtr.Zero);
|
|
676
|
+
return true;
|
|
677
|
+
}
|
|
678
|
+
try
|
|
679
|
+
{
|
|
680
|
+
string sendStr = FormatKeyForSendKeys(key);
|
|
681
|
+
SendKeys.SendWait(sendStr);
|
|
682
|
+
return true;
|
|
683
|
+
}
|
|
684
|
+
catch
|
|
685
|
+
{
|
|
686
|
+
return false;
|
|
687
|
+
}
|
|
507
688
|
}
|
|
508
689
|
|
|
509
690
|
public static bool Hotkey(string[] keys)
|
|
510
691
|
{
|
|
511
|
-
|
|
512
|
-
|
|
692
|
+
if (keys == null || keys.Length == 0) return false;
|
|
693
|
+
|
|
694
|
+
List<byte> vkList = new List<byte>();
|
|
513
695
|
foreach (string k in keys)
|
|
514
696
|
{
|
|
515
|
-
|
|
516
|
-
if (
|
|
517
|
-
else if (lk == "alt") prefix += "%";
|
|
518
|
-
else if (lk == "shift") prefix += "+";
|
|
519
|
-
else mainKey = k;
|
|
697
|
+
byte vk = GetVirtualKey(k);
|
|
698
|
+
if (vk != 0) vkList.Add(vk);
|
|
520
699
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
700
|
+
|
|
701
|
+
if (vkList.Count == keys.Length)
|
|
702
|
+
{
|
|
703
|
+
// Native virtual key press via keybd_event
|
|
704
|
+
for (int i = 0; i < vkList.Count; i++)
|
|
705
|
+
{
|
|
706
|
+
keybd_event(vkList[i], 0, 0, UIntPtr.Zero);
|
|
707
|
+
Thread.Sleep(20);
|
|
708
|
+
}
|
|
709
|
+
Thread.Sleep(40);
|
|
710
|
+
for (int i = vkList.Count - 1; i >= 0; i--)
|
|
711
|
+
{
|
|
712
|
+
keybd_event(vkList[i], 0, KEYEVENTF_KEYUP, UIntPtr.Zero);
|
|
713
|
+
Thread.Sleep(20);
|
|
714
|
+
}
|
|
715
|
+
return true;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
// Fallback to SendKeys with proper formatting
|
|
719
|
+
try
|
|
720
|
+
{
|
|
721
|
+
string prefix = "";
|
|
722
|
+
string mainKey = "";
|
|
723
|
+
foreach (string k in keys)
|
|
724
|
+
{
|
|
725
|
+
string lk = k.ToLower().Trim();
|
|
726
|
+
if (lk == "ctrl" || lk == "control") prefix += "^";
|
|
727
|
+
else if (lk == "alt" || lk == "alternate") prefix += "%";
|
|
728
|
+
else if (lk == "shift") prefix += "+";
|
|
729
|
+
else mainKey = k;
|
|
730
|
+
}
|
|
731
|
+
string sendStr = prefix + FormatKeyForSendKeys(mainKey);
|
|
732
|
+
SendKeys.SendWait(sendStr);
|
|
733
|
+
return true;
|
|
734
|
+
}
|
|
735
|
+
catch
|
|
736
|
+
{
|
|
737
|
+
return false;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
public static bool CloseWindow(string titleOrApp)
|
|
742
|
+
{
|
|
743
|
+
try
|
|
744
|
+
{
|
|
745
|
+
IntPtr targetHwnd = IntPtr.Zero;
|
|
746
|
+
if (string.IsNullOrEmpty(titleOrApp))
|
|
747
|
+
{
|
|
748
|
+
targetHwnd = GetForegroundWindow();
|
|
749
|
+
}
|
|
750
|
+
else
|
|
751
|
+
{
|
|
752
|
+
string target = titleOrApp.ToLower().Trim();
|
|
753
|
+
EnumWindows((hWnd, lParam) =>
|
|
754
|
+
{
|
|
755
|
+
if (IsWindowVisible(hWnd))
|
|
756
|
+
{
|
|
757
|
+
StringBuilder sb = new StringBuilder(256);
|
|
758
|
+
GetWindowText(hWnd, sb, 256);
|
|
759
|
+
string title = sb.ToString();
|
|
760
|
+
if (!string.IsNullOrEmpty(title) && title.ToLower().Contains(target))
|
|
761
|
+
{
|
|
762
|
+
targetHwnd = hWnd;
|
|
763
|
+
return false;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
return true;
|
|
767
|
+
}, IntPtr.Zero);
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
if (targetHwnd != IntPtr.Zero)
|
|
771
|
+
{
|
|
772
|
+
PostMessage(targetHwnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
|
|
773
|
+
return true;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
catch { }
|
|
777
|
+
return false;
|
|
524
778
|
}
|
|
525
779
|
|
|
526
780
|
public static string EscapeForSendKeys(string text)
|
|
527
781
|
{
|
|
782
|
+
if (string.IsNullOrEmpty(text)) return "";
|
|
528
783
|
StringBuilder sb = new StringBuilder();
|
|
529
784
|
foreach (char c in text)
|
|
530
785
|
{
|
|
531
|
-
if (c == '
|
|
786
|
+
if (c == '\r') continue;
|
|
787
|
+
if (c == '\n')
|
|
788
|
+
{
|
|
789
|
+
sb.Append("{ENTER}");
|
|
790
|
+
}
|
|
791
|
+
else if (c == '\t')
|
|
792
|
+
{
|
|
793
|
+
sb.Append("{TAB}");
|
|
794
|
+
}
|
|
795
|
+
else if (c == '+' || c == '^' || c == '%' || c == '~' || c == '(' || c == ')' || c == '{' || c == '}' || c == '[' || c == ']')
|
|
532
796
|
{
|
|
533
797
|
sb.Append("{" + c + "}");
|
|
534
798
|
}
|
|
@@ -689,7 +953,23 @@ namespace Scout.ComputerControl
|
|
|
689
953
|
|
|
690
954
|
if (act == "hotkey")
|
|
691
955
|
{
|
|
692
|
-
string[] keys
|
|
956
|
+
string[] keys;
|
|
957
|
+
if (args.Length > 1)
|
|
958
|
+
{
|
|
959
|
+
keys = args;
|
|
960
|
+
}
|
|
961
|
+
else if (args.Length == 1)
|
|
962
|
+
{
|
|
963
|
+
keys = args[0].Split(new char[] { '+', ',' }, StringSplitOptions.RemoveEmptyEntries);
|
|
964
|
+
}
|
|
965
|
+
else
|
|
966
|
+
{
|
|
967
|
+
keys = new string[0];
|
|
968
|
+
}
|
|
969
|
+
for (int i = 0; i < keys.Length; i++)
|
|
970
|
+
{
|
|
971
|
+
keys[i] = keys[i].Trim();
|
|
972
|
+
}
|
|
693
973
|
bool ok = Hotkey(keys);
|
|
694
974
|
return string.Format("{{\"success\":{0},\"action\":\"hotkey\",\"keys\":{1},\"activeWindow\":{2}}}",
|
|
695
975
|
ok ? "true" : "false", JsonEscape(string.Join("+", keys)), JsonEscape(GetActiveWindowTitle()));
|
|
@@ -725,6 +1005,14 @@ namespace Scout.ComputerControl
|
|
|
725
1005
|
ok ? "true" : "false", JsonEscape(win), JsonEscape(GetActiveWindowTitle()));
|
|
726
1006
|
}
|
|
727
1007
|
|
|
1008
|
+
if (act == "close_window" || act == "close_app")
|
|
1009
|
+
{
|
|
1010
|
+
string win = args.Length > 0 ? args[0] : "";
|
|
1011
|
+
bool ok = CloseWindow(win);
|
|
1012
|
+
return string.Format("{{\"success\":{0},\"action\":\"close_window\",\"target\":{1},\"activeWindow\":{2}}}",
|
|
1013
|
+
ok ? "true" : "false", JsonEscape(win), JsonEscape(GetActiveWindowTitle()));
|
|
1014
|
+
}
|
|
1015
|
+
|
|
728
1016
|
if (act == "launch" || act == "open_app")
|
|
729
1017
|
{
|
|
730
1018
|
string app = args.Length > 0 ? args[0] : "";
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentRuntime.d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,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAE5J;IAEY,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAmF7J;YAEa,oBAAoB;IAgVlC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAU9B;;;;OAIG;YACW,2BAA2B;IAgBzC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;YAwBb,mBAAmB;YAyFnB,gBAAgB;IAsO9B,OAAO,CAAC,mBAAmB;CAqB9B"}
|
|
@@ -432,7 +432,7 @@ Action Rules:
|
|
|
432
432
|
// 1. Computer Control Tools
|
|
433
433
|
if (name.startsWith('computer_') || name === 'computer') {
|
|
434
434
|
if (!this.isProOrEnterprise()) {
|
|
435
|
-
const upgradeMsg = `[PLAN RESTRICTION]: Autonomous Computer Control tools (${name}) are exclusively available to Pro and Enterprise plan developers. Free tier developers can perform code editing, creating files/folders, and running terminal commands. Upgrade to Pro at https://
|
|
435
|
+
const upgradeMsg = `[PLAN RESTRICTION]: Autonomous Computer Control tools (${name}) are exclusively available to Pro and Enterprise plan developers. Free tier developers can perform code editing, creating files/folders, and running terminal commands. Upgrade to Pro at https://scout.frontterrain.com to unlock autonomous computer & app control.`;
|
|
436
436
|
this.workspace.addObservation({
|
|
437
437
|
tool: name,
|
|
438
438
|
resultSummary: upgradeMsg,
|
|
@@ -445,7 +445,7 @@ Action Rules:
|
|
|
445
445
|
// 2. Browser Automation Tools
|
|
446
446
|
if (name.startsWith('browser_')) {
|
|
447
447
|
if (!this.isProOrEnterprise()) {
|
|
448
|
-
const upgradeMsg = `[PLAN RESTRICTION]: Autonomous Browser Control tools (${name}) are exclusively available to Pro and Enterprise plan developers. Free tier developers can perform code editing, creating files/folders, and running terminal commands. Upgrade to Pro at https://
|
|
448
|
+
const upgradeMsg = `[PLAN RESTRICTION]: Autonomous Browser Control tools (${name}) are exclusively available to Pro and Enterprise plan developers. Free tier developers can perform code editing, creating files/folders, and running terminal commands. Upgrade to Pro at https://scout.frontterrain.com to unlock browser automation.`;
|
|
449
449
|
this.workspace.addObservation({
|
|
450
450
|
tool: name,
|
|
451
451
|
resultSummary: upgradeMsg,
|
|
@@ -906,6 +906,30 @@ Action Rules:
|
|
|
906
906
|
this.workspace.addObservation({ tool: name, resultSummary: `Extracted content (${res.output.length} chars)`, verified: res.success });
|
|
907
907
|
return { result: res.output };
|
|
908
908
|
}
|
|
909
|
+
case 'browser_screenshot': {
|
|
910
|
+
const res = await this.browserController.screenshot();
|
|
911
|
+
this.workspace.addObservation({
|
|
912
|
+
tool: name,
|
|
913
|
+
resultSummary: res.output,
|
|
914
|
+
verified: res.success,
|
|
915
|
+
...(res.url ? { target: res.url } : {}),
|
|
916
|
+
});
|
|
917
|
+
return { result: res.output };
|
|
918
|
+
}
|
|
919
|
+
case 'browser_select': {
|
|
920
|
+
const selector = String(args.selector || args.target || '');
|
|
921
|
+
const val = String(args.value || args.val || '');
|
|
922
|
+
const res = await this.browserController.select(selector, val);
|
|
923
|
+
this.workspace.addObservation({ tool: name, resultSummary: res.output, verified: res.success, target: selector });
|
|
924
|
+
return { result: res.output };
|
|
925
|
+
}
|
|
926
|
+
case 'browser_scroll': {
|
|
927
|
+
const direction = (args.direction || 'down');
|
|
928
|
+
const amount = Number(args.amount) || 4;
|
|
929
|
+
const res = await this.browserController.scroll(direction, amount);
|
|
930
|
+
this.workspace.addObservation({ tool: name, resultSummary: res.output, verified: res.success });
|
|
931
|
+
return { result: res.output };
|
|
932
|
+
}
|
|
909
933
|
default:
|
|
910
934
|
return { result: `Unknown browser tool: "${name}"` };
|
|
911
935
|
}
|
|
@@ -914,7 +938,7 @@ Action Rules:
|
|
|
914
938
|
switch (name) {
|
|
915
939
|
case 'scratchpad': {
|
|
916
940
|
if (!this.isProOrEnterprise()) {
|
|
917
|
-
const upgradeMsg = `[PLAN RESTRICTION]: AI Scratchpad & Autonomous reasoning is an exclusive feature for Pro and Enterprise plan subscribers. Free tier developers can perform code editing, creating files/folders, and running commands. Upgrade to Pro at https://
|
|
941
|
+
const upgradeMsg = `[PLAN RESTRICTION]: AI Scratchpad & Autonomous reasoning is an exclusive feature for Pro and Enterprise plan subscribers. Free tier developers can perform code editing, creating files/folders, and running commands. Upgrade to Pro at https://scout.frontterrain.com to unlock the AI Scratchpad.`;
|
|
918
942
|
this.workspace.addObservation({
|
|
919
943
|
tool: name,
|
|
920
944
|
resultSummary: upgradeMsg,
|