vamp-mcp 0.2.0 → 0.2.4

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.

Potentially problematic release.


This version of vamp-mcp might be problematic. Click here for more details.

Files changed (134) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +144 -107
  3. package/THIRD_PARTY_NOTICES.md +32 -27
  4. package/bin/vamp-mcp.mjs +37 -37
  5. package/notices/mcp-virtualbox-LICENSE +21 -21
  6. package/notices/mcp-virtualbox-PROVENANCE.json +37 -37
  7. package/package.json +51 -17
  8. package/runtime/backends/common/Test-Environment.ps1 +7 -6
  9. package/runtime/backends/common/guest-install.json +58 -0
  10. package/runtime/backends/common/guest_install.py +57 -0
  11. package/runtime/backends/common/host-support.cjs +16 -0
  12. package/runtime/backends/common/packer.cjs +16 -0
  13. package/runtime/backends/hyperv/scripts/Manage-Desktop.ps1 +40 -67
  14. package/runtime/backends/hyperv/scripts/Send-InstallerBoot.ps1 +25 -0
  15. package/runtime/backends/kvm/debian-preseed.cfg +35 -35
  16. package/runtime/backends/library/registry.py +77 -77
  17. package/runtime/backends/library/replay.py +154 -154
  18. package/runtime/backends/packer/answer_media.py +16 -0
  19. package/runtime/backends/packer/deploy-hyperv.ps1 +10 -0
  20. package/runtime/backends/packer/drivers.py +49 -0
  21. package/runtime/backends/packer/hyperv-network.ps1 +10 -0
  22. package/runtime/backends/packer/images.py +75 -0
  23. package/runtime/backends/packer/osinfo.py +113 -0
  24. package/runtime/backends/packer/policy.json +15 -0
  25. package/runtime/backends/packer/runner.py +224 -0
  26. package/runtime/backends/packer/templates.py +118 -0
  27. package/runtime/backends/packer/toolchain.py +80 -0
  28. package/runtime/backends/remote_ssh/server.mjs +310 -93
  29. package/runtime/backends/virtualbox/desktop.cjs +37 -0
  30. package/runtime/backends/virtualbox/display.py +101 -101
  31. package/runtime/backends/virtualbox/history.py +139 -139
  32. package/runtime/backends/virtualbox/mouse_click.py +15 -15
  33. package/runtime/backends/virtualbox/mouse_move.py +18 -18
  34. package/runtime/backends/virtualbox/profiles.json +46 -46
  35. package/runtime/backends/virtualbox/provision.py +238 -197
  36. package/runtime/backends/virtualbox/recording_listener.py +29 -29
  37. package/runtime/backends/virtualbox/recordings.py +39 -39
  38. package/runtime/backends/virtualbox/requirements.txt +7 -7
  39. package/runtime/backends/virtualbox/rpas/debian_first_boot/manifest.json +1 -1
  40. package/runtime/backends/virtualbox/rpas/debian_first_boot/run.robot +13 -13
  41. package/runtime/backends/virtualbox/rpas/debian_first_boot/workflow.py +75 -75
  42. package/runtime/backends/virtualbox/rpas/observe/manifest.json +7 -7
  43. package/runtime/backends/virtualbox/rpas/observe/run.robot +13 -13
  44. package/runtime/backends/virtualbox/rpas/observe/workflow.py +14 -14
  45. package/runtime/backends/virtualbox/server.mjs +288 -237
  46. package/runtime/backends/virtualbox/setup_windows_sdk.py +58 -58
  47. package/runtime/backends/virtualbox/shares.py +68 -68
  48. package/runtime/backends/virtualbox/snapshots.py +53 -53
  49. package/runtime/backends/virtualbox/transfers.py +89 -89
  50. package/runtime/backends/virtualbox/vnc.py +61 -61
  51. package/runtime/guest_keys.py +13 -13
  52. package/runtime/guest_setup/http/debian-preseed.cfg +39 -0
  53. package/runtime/guest_setup/http/postdeb.sh +50 -3
  54. package/runtime/guest_setup/http/postwin.ps1 +53 -28
  55. package/runtime/guest_setup/http/setup-all.ps1 +25 -25
  56. package/runtime/guest_setup/http/setup-win.cmd +7 -7
  57. package/runtime/guest_setup/http/setup.ps1 +44 -29
  58. package/runtime/guest_setup/kvm/setup-windows.ps1 +52 -52
  59. package/runtime/guest_setup/recorder/README.txt +12 -12
  60. package/runtime/guest_setup/recorder/RECORDER-LICENSE +674 -674
  61. package/runtime/guest_setup/recorder/RECORDING-GUIDE.txt +31 -31
  62. package/runtime/guest_setup/recorder/apply-display.py +41 -41
  63. package/runtime/guest_setup/recorder/configure-debian-mirrors.py +62 -62
  64. package/runtime/guest_setup/recorder/configure-gdm.py +23 -0
  65. package/runtime/guest_setup/recorder/configure-session.ps1 +14 -0
  66. package/runtime/guest_setup/recorder/gnome-display.py +60 -60
  67. package/runtime/guest_setup/recorder/install-display-startup.py +67 -39
  68. package/runtime/guest_setup/recorder/install-hypervisor-drivers.ps1 +34 -0
  69. package/runtime/guest_setup/recorder/install-resolution-shortcut.ps1 +36 -0
  70. package/runtime/guest_setup/recorder/postwin.cmd +10 -10
  71. package/runtime/guest_setup/recorder/prepare-recording.py +30 -30
  72. package/runtime/guest_setup/recorder/requirements-recorder.txt +2 -2
  73. package/runtime/guest_setup/recorder/session-policy.py +22 -0
  74. package/runtime/guest_setup/recorder/set-resolution-registry.ps1 +40 -0
  75. package/runtime/guest_setup/recorder/setup-user.py +53 -53
  76. package/runtime/guest_setup/recorder/setup-win.cmd +4 -60
  77. package/runtime/guest_setup/recorder/setup.ps1 +112 -81
  78. package/runtime/guest_setup/recorder/setup.sh +1 -0
  79. package/runtime/guest_setup/recorder/vamp-recorder.py +148 -148
  80. package/runtime/guest_setup/recorder/verify-recorder.py +4 -4
  81. package/runtime/guest_setup/recorder/windows-display.py +76 -76
  82. package/runtime/guest_setup/requirements.txt +2 -2
  83. package/runtime/guest_setup/setup-all.ps1 +35 -35
  84. package/runtime/guest_setup/vault/Install-VCRuntime.ps1 +26 -26
  85. package/runtime/guest_setup/vault/setup-guest-vault.ps1 +148 -148
  86. package/runtime/recording_converter.py +230 -230
  87. package/runtime/requirements-mcp.txt +11 -11
  88. package/runtime/rpas/README.md +161 -161
  89. package/runtime/rpas/captcha_handoff/manifest.json +27 -27
  90. package/runtime/rpas/captcha_handoff/run.robot +16 -16
  91. package/runtime/rpas/captcha_handoff/workflow.py +11 -11
  92. package/runtime/rpas/common.resource +26 -26
  93. package/runtime/rpas/debian_update/manifest.json +27 -27
  94. package/runtime/rpas/debian_update/run.robot +17 -17
  95. package/runtime/rpas/debian_update/workflow.py +13 -13
  96. package/runtime/rpas/desktop_control/manifest.json +26 -26
  97. package/runtime/rpas/desktop_control/run.robot +27 -27
  98. package/runtime/rpas/desktop_control/workflow.py +51 -51
  99. package/runtime/rpas/firefox_launch/manifest.json +27 -27
  100. package/runtime/rpas/firefox_launch/run.robot +15 -15
  101. package/runtime/rpas/firefox_launch/workflow.py +25 -25
  102. package/runtime/rpas/firefox_naver/manifest.json +27 -27
  103. package/runtime/rpas/firefox_naver/run.robot +21 -21
  104. package/runtime/rpas/firefox_naver/workflow.py +28 -28
  105. package/runtime/rpas/kvm_validation/README.md +11 -11
  106. package/runtime/rpas/kvm_validation/manifest.json +28 -28
  107. package/runtime/rpas/kvm_validation/run.robot +30 -30
  108. package/runtime/rpas/kvm_validation/workflow.py +91 -91
  109. package/runtime/rpas/manifest.schema.json +105 -105
  110. package/runtime/rpas/naver_login/login.robot +25 -25
  111. package/runtime/rpas/naver_login/manifest.json +33 -33
  112. package/runtime/rpas/naver_login/run.robot +20 -20
  113. package/runtime/rpas/naver_login/workflow.py +32 -32
  114. package/runtime/rpas/windows_naver_recorded/README.md +24 -24
  115. package/runtime/rpas/windows_naver_recorded/conversion.json +25 -25
  116. package/runtime/rpas/windows_naver_recorded/manifest.json +28 -28
  117. package/runtime/rpas/windows_naver_recorded/run.robot +37 -37
  118. package/runtime/rpas/windows_naver_recorded/workflow.py +32 -32
  119. package/runtime/scripts/build_recorder_media.py +39 -39
  120. package/runtime/scripts/macos/setup-host.sh +0 -0
  121. package/runtime/scripts/script_server.py +571 -517
  122. package/runtime/skills/vamp-rpa-ui-checks/SKILL.md +26 -0
  123. package/runtime/skills/vamp-rpa-ui-checks/agents/openai.yaml +4 -0
  124. package/runtime/skills/vamp-rpa-ui-checks/references/display.md +12 -0
  125. package/runtime/skills/vamp-rpa-ui-checks/references/user-guide.md +51 -0
  126. package/runtime/skills/vamp-ui-cleanup/SKILL.md +15 -0
  127. package/runtime/skills/vamp-ui-cleanup/agents/openai.yaml +4 -0
  128. package/runtime/skills/vamp-ui-validation/SKILL.md +27 -0
  129. package/runtime/skills/vamp-ui-validation/agents/openai.yaml +4 -0
  130. package/runtime/third_party/mcp-virtualbox/scripts/mouse_click.py +65 -65
  131. package/runtime/third_party/pyautogui-recorder/LICENSE +674 -674
  132. package/runtime/third_party/pyautogui-recorder/PROVENANCE.json +16 -16
  133. package/runtime/third_party/pyautogui-recorder/PyAutoGuiRecorder.py +169 -169
  134. package/runtime/third_party/pyautogui-recorder/README.md +53 -53
@@ -1,148 +1,148 @@
1
- # SPDX-License-Identifier: GPL-3.0-only
2
- # VAMP recorder UI adaptation of axel-magard/PyAutoGUI-Recorder.
3
- # Original source/license/provenance are bundled separately in recorder.zip.
4
- # This derivative guest program remains GPL-3.0; host integration is MIT.
5
- """Visible, user-started recorder. Saves literal PyAutoGUI Python; never evals playback."""
6
- import json
7
- import os
8
- from pathlib import Path
9
- import queue
10
- import subprocess
11
- import sys
12
- import threading
13
- from datetime import datetime,timezone
14
- import time
15
- import tkinter as tk
16
- from tkinter import ttk,messagebox
17
- from pynput import keyboard,mouse
18
-
19
-
20
- def output_folder():
21
- candidates=[]
22
- if os.environ.get('VAMP_RECORDINGS_DIR'):candidates.append(Path(os.environ['VAMP_RECORDINGS_DIR']))
23
- if sys.platform=='win32':candidates.append(Path(r'\\VBOXSVR\VAMPRecords'))
24
- else:candidates += [Path.home()/'VAMP-Shared',Path('/media/sf_VAMPRecords')]
25
- for folder in candidates:
26
- try:
27
- if folder.is_dir() and os.access(folder,os.W_OK):return folder,True
28
- except OSError:pass
29
- folder=Path(__file__).resolve().parent/'recordings';folder.mkdir(exist_ok=True)
30
- return folder,False
31
-
32
-
33
- class Recorder:
34
- def __init__(self):
35
- self.root=tk.Tk();self.root.title('VAMP Recorder — VM to Robot RPA');self.root.geometry('760x510')
36
- self.root.configure(bg='#111827');style=ttk.Style();style.theme_use('clam')
37
- style.configure('TFrame',background='#111827');style.configure('TLabel',background='#111827',foreground='#e5e7eb')
38
- style.configure('TButton',font=('Segoe UI',11),padding=(12,9));style.configure('TCheckbutton',background='#111827',foreground='#e5e7eb')
39
- style.configure('Accent.TButton',background='#6750c8',foreground='white')
40
- self.active=False;self.events=[];self.pending=queue.Queue();self.lock=threading.Lock();self.last=0
41
- self.held=set();self.bounds=(0,0,0,0);self.last_saved=None;self.folder,self.shared=output_folder()
42
- frame=ttk.Frame(self.root,padding=22);frame.pack(fill='both',expand=True)
43
- ttk.Label(frame,text='VAMP / Recorder',font=('Segoe UI',22,'bold')).pack(anchor='w')
44
- ttk.Label(frame,text='Record in the VM at 1920 × 1080. Keep passwords and certificates out of recordings.').pack(anchor='w',pady=(8,14))
45
- self.status=tk.StringVar(value='Ready · F8 starts/stops recording')
46
- ttk.Label(frame,textvariable=self.status,font=('Segoe UI',12,'bold')).pack(anchor='w')
47
- self.path_label=ttk.Label(frame,text=('SHARED WITH HOST: ' if self.shared else 'LOCAL ONLY: ')+str(self.folder),wraplength=700)
48
- self.path_label.pack(anchor='w',pady=(8,12))
49
- buttons=ttk.Frame(frame);buttons.pack(fill='x')
50
- self.start_button=ttk.Button(buttons,text='● Start recording',style='Accent.TButton',command=self.start);self.start_button.pack(side='left',padx=(0,8))
51
- ttk.Button(buttons,text='■ Stop',command=self.stop).pack(side='left',padx=(0,8))
52
- ttk.Button(buttons,text='Save Python',command=self.save).pack(side='left')
53
- self.preview=tk.Text(frame,height=10,bg='#1f2937',fg='#a7f3d0',insertbackground='white',font=('Consolas',10),state='disabled')
54
- self.preview.pack(fill='both',expand=True,pady=14)
55
- bottom=ttk.Frame(frame);bottom.pack(fill='x')
56
- ttk.Button(bottom,text='Open save folder',command=self.open_folder).pack(side='left',padx=(0,8))
57
- ttk.Button(bottom,text='Copy last path',command=self.copy_path).pack(side='left')
58
- ttk.Label(frame,text='Tell the AI the saved host path + VM name + task goal. No auto-playback.',wraplength=700).pack(anchor='w',pady=(12,0))
59
- self.mouse=mouse.Listener(on_click=self.click);self.keyboard=keyboard.Listener(on_press=self.press,on_release=self.release)
60
- self.mouse.start();self.keyboard.start();self.root.protocol('WM_DELETE_WINDOW',self.close);self.root.after(50,self.poll)
61
- self.write_health()
62
- if sys.platform=='win32':
63
- script=Path(os.environ['LOCALAPPDATA'])/'VAMP/display/apply-display.py'
64
- if script.is_file():subprocess.Popen([sys.executable,str(script),'--attempts','2','--delay','3'])
65
- def write_health(self):
66
- try:
67
- (self.folder/'recorder-status.json').write_text(json.dumps({'status':'gui_open',
68
- 'shared_with_host':self.shared,'recording_active':self.active,
69
- 'native_resolution':[self.root.winfo_screenwidth(),self.root.winfo_screenheight()],
70
- 'session_type':os.environ.get('XDG_SESSION_TYPE', 'windows' if sys.platform == 'win32' else 'unknown'),
71
- 'timestamp':datetime.now(timezone.utc).isoformat()},indent=2)+'\n')
72
- except OSError:pass
73
-
74
- def add(self,code):
75
- with self.lock:
76
- if not self.active:return
77
- now=time.monotonic();delay=max(0,now-self.last);self.last=now
78
- self.pending.put((delay,code))
79
- def click(self,x,y,button,pressed):
80
- if not pressed:return
81
- x0,y0,x1,y1=self.bounds
82
- if x0<=x<=x1 and y0<=y<=y1:return
83
- self.add(f'pyautogui.click(x={int(x)}, y={int(y)}, button={button.name!r})')
84
- @staticmethod
85
- def key_name(key):return getattr(key,'char',None) or getattr(key,'name',str(key))
86
- def press(self,key):
87
- if key==keyboard.Key.f8:self.pending.put(('toggle',None));return
88
- name=self.key_name(key)
89
- with self.lock:
90
- if not self.active or name in self.held:return
91
- self.held.add(name)
92
- self.add(f'pyautogui.keyDown({name!r})')
93
- def release(self,key):
94
- if key==keyboard.Key.f8:return
95
- name=self.key_name(key)
96
- with self.lock:
97
- if name not in self.held:return
98
- self.held.discard(name)
99
- self.add(f'pyautogui.keyUp({name!r})')
100
- def start(self):
101
- if self.active:return
102
- if sys.platform!='win32' and os.environ.get('XDG_SESSION_TYPE')=='wayland':
103
- messagebox.showwarning('X11 session required','Global recording requires GNOME on Xorg. Log out and choose that session.');return
104
- with self.lock:self.active=True;self.last=time.monotonic();self.held.clear()
105
- self.status.set('● RECORDING · F8 or Stop to pause');self.start_button.configure(state='disabled');self.write_health()
106
- def stop(self):
107
- with self.lock:
108
- self.active=False
109
- for name in self.held:self.pending.put((0,f'pyautogui.keyUp({name!r})'))
110
- self.held.clear()
111
- self.start_button.configure(state='normal');self.status.set('Stopped · Save Python to share with the AI');self.write_health()
112
- def poll(self):
113
- self.bounds=(self.root.winfo_rootx(),self.root.winfo_rooty(),self.root.winfo_rootx()+self.root.winfo_width(),self.root.winfo_rooty()+self.root.winfo_height())
114
- while True:
115
- try:delay,code=self.pending.get_nowait()
116
- except queue.Empty:break
117
- if delay=='toggle':self.stop() if self.active else self.start();continue
118
- self.events.append((delay,code));self.preview.configure(state='normal');self.preview.insert('end',code+'\n');self.preview.see('end');self.preview.configure(state='disabled')
119
- self.root.after(50,self.poll)
120
- def save(self):
121
- self.stop()
122
- # Drain already queued events before serializing, without a nested Tk main loop.
123
- while not self.pending.empty():
124
- delay,code=self.pending.get_nowait()
125
- if delay!='toggle':self.events.append((delay,code))
126
- if not self.events:messagebox.showinfo('Nothing recorded','Start recording, perform the task, then stop and save.');return
127
- path=self.folder/('rpa_'+time.strftime('%Y%m%d_%H%M%S')+'_'+str(time.time_ns()%1000000)+'.py')
128
- lines=['import pyautogui','import time','']
129
- for delay,code in self.events:
130
- if delay>0.001:lines.append(f'time.sleep({delay:.5f})')
131
- lines.append(code)
132
- try:
133
- path.write_text('\n'.join(lines)+'\n',encoding='utf-8');self.last_saved=path
134
- (path.with_suffix('.handoff.json')).write_text(json.dumps({'recording_path_in_guest':str(path),
135
- 'shared_with_host':self.shared,'expected_native_resolution':[1920,1080],
136
- 'resolution_verified':False,'source_executed':False},indent=2)+'\n')
137
- self.status.set('Saved: '+path.name);self.copy_path()
138
- messagebox.showinfo('Recording saved',str(path)+'\n\nPath copied. Tell the AI the VM name and desired outcome.')
139
- except OSError as exc:messagebox.showerror('Save failed',str(exc))
140
- def copy_path(self):
141
- path=str(self.last_saved or self.folder);self.root.clipboard_clear();self.root.clipboard_append(path)
142
- def open_folder(self):
143
- if sys.platform=='win32':os.startfile(self.folder)
144
- else:subprocess.Popen(['xdg-open',str(self.folder)])
145
- def close(self):
146
- self.stop();self.mouse.stop();self.keyboard.stop();self.root.destroy()
147
-
148
- if __name__=='__main__':Recorder().root.mainloop()
1
+ # SPDX-License-Identifier: GPL-3.0-only
2
+ # VAMP recorder UI adaptation of axel-magard/PyAutoGUI-Recorder.
3
+ # Original source/license/provenance are bundled separately in recorder.zip.
4
+ # This derivative guest program remains GPL-3.0; host integration is MIT.
5
+ """Visible, user-started recorder. Saves literal PyAutoGUI Python; never evals playback."""
6
+ import json
7
+ import os
8
+ from pathlib import Path
9
+ import queue
10
+ import subprocess
11
+ import sys
12
+ import threading
13
+ from datetime import datetime,timezone
14
+ import time
15
+ import tkinter as tk
16
+ from tkinter import ttk,messagebox
17
+ from pynput import keyboard,mouse
18
+
19
+
20
+ def output_folder():
21
+ candidates=[]
22
+ if os.environ.get('VAMP_RECORDINGS_DIR'):candidates.append(Path(os.environ['VAMP_RECORDINGS_DIR']))
23
+ if sys.platform=='win32':candidates.append(Path(r'\\VBOXSVR\VAMPRecords'))
24
+ else:candidates += [Path.home()/'VAMP-Shared',Path('/media/sf_VAMPRecords')]
25
+ for folder in candidates:
26
+ try:
27
+ if folder.is_dir() and os.access(folder,os.W_OK):return folder,True
28
+ except OSError:pass
29
+ folder=Path(__file__).resolve().parent/'recordings';folder.mkdir(exist_ok=True)
30
+ return folder,False
31
+
32
+
33
+ class Recorder:
34
+ def __init__(self):
35
+ self.root=tk.Tk();self.root.title('VAMP Recorder — VM to Robot RPA');self.root.geometry('760x510')
36
+ self.root.configure(bg='#111827');style=ttk.Style();style.theme_use('clam')
37
+ style.configure('TFrame',background='#111827');style.configure('TLabel',background='#111827',foreground='#e5e7eb')
38
+ style.configure('TButton',font=('Segoe UI',11),padding=(12,9));style.configure('TCheckbutton',background='#111827',foreground='#e5e7eb')
39
+ style.configure('Accent.TButton',background='#6750c8',foreground='white')
40
+ self.active=False;self.events=[];self.pending=queue.Queue();self.lock=threading.Lock();self.last=0
41
+ self.held=set();self.bounds=(0,0,0,0);self.last_saved=None;self.folder,self.shared=output_folder()
42
+ frame=ttk.Frame(self.root,padding=22);frame.pack(fill='both',expand=True)
43
+ ttk.Label(frame,text='VAMP / Recorder',font=('Segoe UI',22,'bold')).pack(anchor='w')
44
+ ttk.Label(frame,text='Record in the VM at 1920 × 1080. Keep passwords and certificates out of recordings.').pack(anchor='w',pady=(8,14))
45
+ self.status=tk.StringVar(value='Ready · F8 starts/stops recording')
46
+ ttk.Label(frame,textvariable=self.status,font=('Segoe UI',12,'bold')).pack(anchor='w')
47
+ self.path_label=ttk.Label(frame,text=('SHARED WITH HOST: ' if self.shared else 'LOCAL ONLY: ')+str(self.folder),wraplength=700)
48
+ self.path_label.pack(anchor='w',pady=(8,12))
49
+ buttons=ttk.Frame(frame);buttons.pack(fill='x')
50
+ self.start_button=ttk.Button(buttons,text='● Start recording',style='Accent.TButton',command=self.start);self.start_button.pack(side='left',padx=(0,8))
51
+ ttk.Button(buttons,text='■ Stop',command=self.stop).pack(side='left',padx=(0,8))
52
+ ttk.Button(buttons,text='Save Python',command=self.save).pack(side='left')
53
+ self.preview=tk.Text(frame,height=10,bg='#1f2937',fg='#a7f3d0',insertbackground='white',font=('Consolas',10),state='disabled')
54
+ self.preview.pack(fill='both',expand=True,pady=14)
55
+ bottom=ttk.Frame(frame);bottom.pack(fill='x')
56
+ ttk.Button(bottom,text='Open save folder',command=self.open_folder).pack(side='left',padx=(0,8))
57
+ ttk.Button(bottom,text='Copy last path',command=self.copy_path).pack(side='left')
58
+ ttk.Label(frame,text='Tell the AI the saved host path + VM name + task goal. No auto-playback.',wraplength=700).pack(anchor='w',pady=(12,0))
59
+ self.mouse=mouse.Listener(on_click=self.click);self.keyboard=keyboard.Listener(on_press=self.press,on_release=self.release)
60
+ self.mouse.start();self.keyboard.start();self.root.protocol('WM_DELETE_WINDOW',self.close);self.root.after(50,self.poll)
61
+ self.write_health()
62
+ if sys.platform=='win32':
63
+ script=Path(os.environ['LOCALAPPDATA'])/'VAMP/display/apply-display.py'
64
+ if script.is_file():subprocess.Popen([sys.executable,str(script),'--attempts','2','--delay','3'])
65
+ def write_health(self):
66
+ try:
67
+ (self.folder/'recorder-status.json').write_text(json.dumps({'status':'gui_open',
68
+ 'shared_with_host':self.shared,'recording_active':self.active,
69
+ 'native_resolution':[self.root.winfo_screenwidth(),self.root.winfo_screenheight()],
70
+ 'session_type':os.environ.get('XDG_SESSION_TYPE', 'windows' if sys.platform == 'win32' else 'unknown'),
71
+ 'timestamp':datetime.now(timezone.utc).isoformat()},indent=2)+'\n')
72
+ except OSError:pass
73
+
74
+ def add(self,code):
75
+ with self.lock:
76
+ if not self.active:return
77
+ now=time.monotonic();delay=max(0,now-self.last);self.last=now
78
+ self.pending.put((delay,code))
79
+ def click(self,x,y,button,pressed):
80
+ if not pressed:return
81
+ x0,y0,x1,y1=self.bounds
82
+ if x0<=x<=x1 and y0<=y<=y1:return
83
+ self.add(f'pyautogui.click(x={int(x)}, y={int(y)}, button={button.name!r})')
84
+ @staticmethod
85
+ def key_name(key):return getattr(key,'char',None) or getattr(key,'name',str(key))
86
+ def press(self,key):
87
+ if key==keyboard.Key.f8:self.pending.put(('toggle',None));return
88
+ name=self.key_name(key)
89
+ with self.lock:
90
+ if not self.active or name in self.held:return
91
+ self.held.add(name)
92
+ self.add(f'pyautogui.keyDown({name!r})')
93
+ def release(self,key):
94
+ if key==keyboard.Key.f8:return
95
+ name=self.key_name(key)
96
+ with self.lock:
97
+ if name not in self.held:return
98
+ self.held.discard(name)
99
+ self.add(f'pyautogui.keyUp({name!r})')
100
+ def start(self):
101
+ if self.active:return
102
+ if sys.platform!='win32' and os.environ.get('XDG_SESSION_TYPE')=='wayland':
103
+ messagebox.showwarning('X11 session required','Global recording requires GNOME on Xorg. Log out and choose that session.');return
104
+ with self.lock:self.active=True;self.last=time.monotonic();self.held.clear()
105
+ self.status.set('● RECORDING · F8 or Stop to pause');self.start_button.configure(state='disabled');self.write_health()
106
+ def stop(self):
107
+ with self.lock:
108
+ self.active=False
109
+ for name in self.held:self.pending.put((0,f'pyautogui.keyUp({name!r})'))
110
+ self.held.clear()
111
+ self.start_button.configure(state='normal');self.status.set('Stopped · Save Python to share with the AI');self.write_health()
112
+ def poll(self):
113
+ self.bounds=(self.root.winfo_rootx(),self.root.winfo_rooty(),self.root.winfo_rootx()+self.root.winfo_width(),self.root.winfo_rooty()+self.root.winfo_height())
114
+ while True:
115
+ try:delay,code=self.pending.get_nowait()
116
+ except queue.Empty:break
117
+ if delay=='toggle':self.stop() if self.active else self.start();continue
118
+ self.events.append((delay,code));self.preview.configure(state='normal');self.preview.insert('end',code+'\n');self.preview.see('end');self.preview.configure(state='disabled')
119
+ self.root.after(50,self.poll)
120
+ def save(self):
121
+ self.stop()
122
+ # Drain already queued events before serializing, without a nested Tk main loop.
123
+ while not self.pending.empty():
124
+ delay,code=self.pending.get_nowait()
125
+ if delay!='toggle':self.events.append((delay,code))
126
+ if not self.events:messagebox.showinfo('Nothing recorded','Start recording, perform the task, then stop and save.');return
127
+ path=self.folder/('rpa_'+time.strftime('%Y%m%d_%H%M%S')+'_'+str(time.time_ns()%1000000)+'.py')
128
+ lines=['import pyautogui','import time','']
129
+ for delay,code in self.events:
130
+ if delay>0.001:lines.append(f'time.sleep({delay:.5f})')
131
+ lines.append(code)
132
+ try:
133
+ path.write_text('\n'.join(lines)+'\n',encoding='utf-8');self.last_saved=path
134
+ (path.with_suffix('.handoff.json')).write_text(json.dumps({'recording_path_in_guest':str(path),
135
+ 'shared_with_host':self.shared,'expected_native_resolution':[1920,1080],
136
+ 'resolution_verified':False,'source_executed':False},indent=2)+'\n')
137
+ self.status.set('Saved: '+path.name);self.copy_path()
138
+ messagebox.showinfo('Recording saved',str(path)+'\n\nPath copied. Tell the AI the VM name and desired outcome.')
139
+ except OSError as exc:messagebox.showerror('Save failed',str(exc))
140
+ def copy_path(self):
141
+ path=str(self.last_saved or self.folder);self.root.clipboard_clear();self.root.clipboard_append(path)
142
+ def open_folder(self):
143
+ if sys.platform=='win32':os.startfile(self.folder)
144
+ else:subprocess.Popen(['xdg-open',str(self.folder)])
145
+ def close(self):
146
+ self.stop();self.mouse.stop();self.keyboard.stop();self.root.destroy()
147
+
148
+ if __name__=='__main__':Recorder().root.mainloop()
@@ -1,4 +1,4 @@
1
- """Verify recorder distributions without importing host input libraries."""
2
- import importlib.metadata as metadata
3
- import json
4
- print(json.dumps({name: metadata.version(name) for name in ('PyAutoGUI', 'pynput')}))
1
+ """Verify recorder distributions without importing host input libraries."""
2
+ import importlib.metadata as metadata
3
+ import json
4
+ print(json.dumps({name: metadata.version(name) for name in ('PyAutoGUI', 'pynput')}))
@@ -1,76 +1,76 @@
1
- """Windows guest: inspect registry, apply a supported primary mode via user32."""
2
- import ctypes
3
- from ctypes import wintypes as w
4
-
5
-
6
- def registry_snapshot():
7
- import winreg
8
- values=[]
9
- root=r'SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration'
10
- try:
11
- with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,root) as parent:
12
- for index in range(min(winreg.QueryInfoKey(parent)[0],32)):
13
- name=winreg.EnumKey(parent,index)
14
- try:
15
- with winreg.OpenKey(parent,name+r'\00\00') as key:
16
- values.append({'width':winreg.QueryValueEx(key,'PrimSurfSize.cx')[0],
17
- 'height':winreg.QueryValueEx(key,'PrimSurfSize.cy')[0]})
18
- except OSError:pass
19
- except OSError:pass
20
- return {'source':'GraphicsDrivers/Configuration (read only; may contain stale modes)',
21
- 'stored_modes':values}
22
-
23
-
24
- def apply(width=1920, height=1080):
25
- if (width, height) not in ((1920, 1080), (2560, 1440)):
26
- raise ValueError('Supported guest modes are FHD and QHD')
27
- class Point(ctypes.Structure):
28
- _fields_=[('x',w.LONG),('y',w.LONG)]
29
- class Display(ctypes.Structure):
30
- _fields_=[('position',Point),('orientation',w.DWORD),('fixed_output',w.DWORD)]
31
- class DeviceMode(ctypes.Structure):
32
- _fields_=[('device_name',w.WCHAR*32),('spec_version',w.WORD),('driver_version',w.WORD),
33
- ('size',w.WORD),('driver_extra',w.WORD),('fields',w.DWORD),('display',Display),
34
- ('color',w.SHORT),('duplex',w.SHORT),('y_resolution',w.SHORT),('tt_option',w.SHORT),
35
- ('collate',w.SHORT),('form_name',w.WCHAR*32),('log_pixels',w.WORD),
36
- ('bits_per_pixel',w.DWORD),('width',w.DWORD),('height',w.DWORD),
37
- ('flags',w.DWORD),('frequency',w.DWORD),('icm_method',w.DWORD),('icm_intent',w.DWORD),
38
- ('media_type',w.DWORD),('dither_type',w.DWORD),('reserved1',w.DWORD),
39
- ('reserved2',w.DWORD),('panning_width',w.DWORD),('panning_height',w.DWORD)]
40
- if ctypes.sizeof(DeviceMode)!=220:raise RuntimeError('Unexpected Windows DEVMODEW ABI')
41
- user=ctypes.WinDLL('user32',use_last_error=True)
42
- enum=user.EnumDisplaySettingsW
43
- enum.argtypes=[w.LPCWSTR,w.DWORD,ctypes.POINTER(DeviceMode)];enum.restype=w.BOOL
44
- change=user.ChangeDisplaySettingsExW
45
- change.argtypes=[w.LPCWSTR,ctypes.POINTER(DeviceMode),w.HWND,w.DWORD,ctypes.c_void_p]
46
- change.restype=w.LONG
47
- if user.GetSystemMetrics(80)!=1:raise RuntimeError('Expected one guest monitor; refusing to change a multi-monitor layout')
48
- def current():
49
- mode=DeviceMode();mode.size=ctypes.sizeof(mode)
50
- if not enum(None,0xFFFFFFFF,ctypes.byref(mode)):raise RuntimeError('Cannot read current display mode')
51
- return mode
52
- before=current();snapshot=registry_snapshot()
53
- selected=None;index=0
54
- while True:
55
- mode=DeviceMode();mode.size=ctypes.sizeof(mode)
56
- if not enum(None,index,ctypes.byref(mode)):break
57
- if (mode.width,mode.height,mode.bits_per_pixel)==(width,height,32):
58
- if selected is None or abs(mode.frequency-before.frequency)<abs(selected.frequency-before.frequency):selected=mode
59
- index+=1
60
- mode_source='enumerated'
61
- if selected is None:
62
- # Dynamic virtual displays may omit a usable mode from the enumerated list.
63
- # Reuse the current driver DEVMODE and require CDS_TEST before applying.
64
- selected=current();selected.width=width;selected.height=height;selected.bits_per_pixel=32
65
- mode_source='current_mode_with_tested_target'
66
- selected.fields=0x00080000|0x00100000|0x00040000|0x00400000 # width/height/bpp/frequency
67
- tested=change(None,ctypes.byref(selected),None,2,None) # CDS_TEST
68
- if tested!=0:raise RuntimeError(f'Display driver rejected requested mode: {tested}')
69
- updated=change(None,ctypes.byref(selected),None,1,None) # CDS_UPDATEREGISTRY
70
- after=current()
71
- verified=(after.width,after.height)==(width,height) and updated==0
72
- return {'status':'succeeded' if verified else 'needs_attention','resolution_verified':verified,
73
- 'before':[before.width,before.height],'observed_resolution':[after.width,after.height],
74
- 'mode_source':mode_source,'change_result':int(updated),'restart_required':updated==1,'registry':snapshot,
75
- 'mechanism':'EnumDisplaySettingsW + ChangeDisplaySettingsExW; registry is not edited directly',
76
- 'scale_100_percent_verified':False}
1
+ """Windows guest: inspect registry, apply a supported primary mode via user32."""
2
+ import ctypes
3
+ from ctypes import wintypes as w
4
+
5
+
6
+ def registry_snapshot():
7
+ import winreg
8
+ values=[]
9
+ root=r'SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration'
10
+ try:
11
+ with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,root) as parent:
12
+ for index in range(min(winreg.QueryInfoKey(parent)[0],32)):
13
+ name=winreg.EnumKey(parent,index)
14
+ try:
15
+ with winreg.OpenKey(parent,name+r'\00\00') as key:
16
+ values.append({'width':winreg.QueryValueEx(key,'PrimSurfSize.cx')[0],
17
+ 'height':winreg.QueryValueEx(key,'PrimSurfSize.cy')[0]})
18
+ except OSError:pass
19
+ except OSError:pass
20
+ return {'source':'GraphicsDrivers/Configuration (read only; may contain stale modes)',
21
+ 'stored_modes':values}
22
+
23
+
24
+ def apply(width=1920, height=1080):
25
+ if (width, height) not in ((1920, 1080), (2560, 1440)):
26
+ raise ValueError('Supported guest modes are FHD and QHD')
27
+ class Point(ctypes.Structure):
28
+ _fields_=[('x',w.LONG),('y',w.LONG)]
29
+ class Display(ctypes.Structure):
30
+ _fields_=[('position',Point),('orientation',w.DWORD),('fixed_output',w.DWORD)]
31
+ class DeviceMode(ctypes.Structure):
32
+ _fields_=[('device_name',w.WCHAR*32),('spec_version',w.WORD),('driver_version',w.WORD),
33
+ ('size',w.WORD),('driver_extra',w.WORD),('fields',w.DWORD),('display',Display),
34
+ ('color',w.SHORT),('duplex',w.SHORT),('y_resolution',w.SHORT),('tt_option',w.SHORT),
35
+ ('collate',w.SHORT),('form_name',w.WCHAR*32),('log_pixels',w.WORD),
36
+ ('bits_per_pixel',w.DWORD),('width',w.DWORD),('height',w.DWORD),
37
+ ('flags',w.DWORD),('frequency',w.DWORD),('icm_method',w.DWORD),('icm_intent',w.DWORD),
38
+ ('media_type',w.DWORD),('dither_type',w.DWORD),('reserved1',w.DWORD),
39
+ ('reserved2',w.DWORD),('panning_width',w.DWORD),('panning_height',w.DWORD)]
40
+ if ctypes.sizeof(DeviceMode)!=220:raise RuntimeError('Unexpected Windows DEVMODEW ABI')
41
+ user=ctypes.WinDLL('user32',use_last_error=True)
42
+ enum=user.EnumDisplaySettingsW
43
+ enum.argtypes=[w.LPCWSTR,w.DWORD,ctypes.POINTER(DeviceMode)];enum.restype=w.BOOL
44
+ change=user.ChangeDisplaySettingsExW
45
+ change.argtypes=[w.LPCWSTR,ctypes.POINTER(DeviceMode),w.HWND,w.DWORD,ctypes.c_void_p]
46
+ change.restype=w.LONG
47
+ if user.GetSystemMetrics(80)!=1:raise RuntimeError('Expected one guest monitor; refusing to change a multi-monitor layout')
48
+ def current():
49
+ mode=DeviceMode();mode.size=ctypes.sizeof(mode)
50
+ if not enum(None,0xFFFFFFFF,ctypes.byref(mode)):raise RuntimeError('Cannot read current display mode')
51
+ return mode
52
+ before=current();snapshot=registry_snapshot()
53
+ selected=None;index=0
54
+ while True:
55
+ mode=DeviceMode();mode.size=ctypes.sizeof(mode)
56
+ if not enum(None,index,ctypes.byref(mode)):break
57
+ if (mode.width,mode.height,mode.bits_per_pixel)==(width,height,32):
58
+ if selected is None or abs(mode.frequency-before.frequency)<abs(selected.frequency-before.frequency):selected=mode
59
+ index+=1
60
+ mode_source='enumerated'
61
+ if selected is None:
62
+ # Dynamic virtual displays may omit a usable mode from the enumerated list.
63
+ # Reuse the current driver DEVMODE and require CDS_TEST before applying.
64
+ selected=current();selected.width=width;selected.height=height;selected.bits_per_pixel=32
65
+ mode_source='current_mode_with_tested_target'
66
+ selected.fields=0x00080000|0x00100000|0x00040000|0x00400000 # width/height/bpp/frequency
67
+ tested=change(None,ctypes.byref(selected),None,2,None) # CDS_TEST
68
+ if tested!=0:raise RuntimeError(f'Display driver rejected requested mode: {tested}')
69
+ updated=change(None,ctypes.byref(selected),None,1,None) # CDS_UPDATEREGISTRY
70
+ after=current()
71
+ verified=(after.width,after.height)==(width,height) and updated==0
72
+ return {'status':'succeeded' if verified else 'needs_attention','resolution_verified':verified,
73
+ 'before':[before.width,before.height],'observed_resolution':[after.width,after.height],
74
+ 'mode_source':mode_source,'change_result':int(updated),'restart_required':updated==1,'registry':snapshot,
75
+ 'mechanism':'EnumDisplaySettingsW + ChangeDisplaySettingsExW; registry is not edited directly',
76
+ 'scale_100_percent_verified':False}
@@ -1,2 +1,2 @@
1
- # Host ISO builder; guest runtime requirements are separate.
2
- pycdlib==1.14.0
1
+ # Host ISO builder; guest runtime requirements are separate.
2
+ pycdlib==1.14.0
@@ -1,35 +1,35 @@
1
- <#
2
- .SYNOPSIS
3
- Unified VAMP Guest Post-Provisioning Setup:
4
- 1. Installs RPA Recorder (PyAutoGUI, Tkinter, virtual environment)
5
- 2. Installs KeePassXC (with Chrome/Edge Passkey browser integration)
6
- 3. Installs VeraCrypt CLI
7
- 4. Configures Removable-USB (/m rm) auto-mount helper for secondary vault.vhd
8
- #>
9
-
10
- $ErrorActionPreference = 'Stop'
11
- $dir = $PSScriptRoot
12
-
13
- Write-Output "=========================================================="
14
- Write-Output " VAMP Guest Setup: RPA Recorder + Vault + Passkeys"
15
- Write-Output "=========================================================="
16
-
17
- # 1. RPA Recorder Setup
18
- Write-Output "`n[Step 1/2] Installing RPA Recorder..."
19
- $recorderScript = Join-Path $dir 'recorder\setup.ps1'
20
- if (Test-Path $recorderScript) {
21
- & $recorderScript
22
- } else {
23
- Write-Warning "recorder\setup.ps1 not found, skipping."
24
- }
25
-
26
- # 2. Vault, Passkeys & Removable USB Setup
27
- Write-Output "`n[Step 2/2] Installing KeePassXC, VeraCrypt & Removable Mount..."
28
- $vaultScript = Join-Path $dir 'vault\setup-guest-vault.ps1'
29
- if (Test-Path $vaultScript) {
30
- & $vaultScript
31
- } else {
32
- Write-Warning "vault\setup-guest-vault.ps1 not found, skipping."
33
- }
34
-
35
- Write-Output "`n=== All VAMP Guest Services Installed Successfully! ==="
1
+ <#
2
+ .SYNOPSIS
3
+ Unified VAMP Guest Post-Provisioning Setup:
4
+ 1. Installs RPA Recorder (PyAutoGUI, Tkinter, virtual environment)
5
+ 2. Installs KeePassXC (with Chrome/Edge Passkey browser integration)
6
+ 3. Installs VeraCrypt CLI
7
+ 4. Configures Removable-USB (/m rm) auto-mount helper for secondary vault.vhd
8
+ #>
9
+
10
+ $ErrorActionPreference = 'Stop'
11
+ $dir = $PSScriptRoot
12
+
13
+ Write-Output "=========================================================="
14
+ Write-Output " VAMP Guest Setup: RPA Recorder + Vault + Passkeys"
15
+ Write-Output "=========================================================="
16
+
17
+ # 1. RPA Recorder Setup
18
+ Write-Output "`n[Step 1/2] Installing RPA Recorder..."
19
+ $recorderScript = Join-Path $dir 'recorder\setup.ps1'
20
+ if (Test-Path $recorderScript) {
21
+ & $recorderScript
22
+ } else {
23
+ Write-Warning "recorder\setup.ps1 not found, skipping."
24
+ }
25
+
26
+ # 2. Vault, Passkeys & Removable USB Setup
27
+ Write-Output "`n[Step 2/2] Installing KeePassXC, VeraCrypt & Removable Mount..."
28
+ $vaultScript = Join-Path $dir 'vault\setup-guest-vault.ps1'
29
+ if (Test-Path $vaultScript) {
30
+ & $vaultScript
31
+ } else {
32
+ Write-Warning "vault\setup-guest-vault.ps1 not found, skipping."
33
+ }
34
+
35
+ Write-Output "`n=== All VAMP Guest Services Installed Successfully! ==="
@@ -1,26 +1,26 @@
1
- # Install the x64 runtime before installing or launching KeePassXC.
2
- param([string]$InstallerPath, [string]$ExpectedSha256)
3
- $ErrorActionPreference = 'Stop'
4
- function Test-VCRuntime {
5
- $runtime = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64' -ErrorAction SilentlyContinue
6
- return ($runtime.Installed -eq 1 -and
7
- (Test-Path "$env:WINDIR\System32\msvcp140.dll") -and
8
- (Test-Path "$env:WINDIR\System32\vcruntime140.dll") -and
9
- (Test-Path "$env:WINDIR\System32\vcruntime140_1.dll"))
10
- }
11
- $rebootRequired = $false
12
- if (-not (Test-VCRuntime)) {
13
- Write-Host 'Installing Microsoft Visual C++ x64 runtime before KeePassXC.'
14
- if ($InstallerPath) {
15
- if (-not $ExpectedSha256) { throw 'A verified installer SHA-256 is required.' }
16
- if ((Get-FileHash -LiteralPath $InstallerPath -Algorithm SHA256).Hash -ne $ExpectedSha256) { throw 'VC++ runtime installer checksum mismatch.' }
17
- $process = Start-Process -FilePath $InstallerPath -ArgumentList '/install /quiet /norestart' -Wait -PassThru
18
- if ($process.ExitCode -notin @(0,3010)) { throw "VC++ runtime installation failed: $($process.ExitCode)" }
19
- $rebootRequired = $process.ExitCode -eq 3010
20
- } else {
21
- & winget install --exact --id Microsoft.VCRedist.2015+.x64 --scope machine --accept-package-agreements --accept-source-agreements --silent
22
- if ($LASTEXITCODE -ne 0) { throw "VC++ runtime installation failed: $LASTEXITCODE" }
23
- }
24
- if (-not (Test-VCRuntime)) { throw 'VC++ x64 runtime files or installation registration are missing; KeePassXC installation stopped.' }
25
- }
26
- @{installed=$true;architecture='x64';reboot_required=$rebootRequired}
1
+ # Install the x64 runtime before installing or launching KeePassXC.
2
+ param([string]$InstallerPath, [string]$ExpectedSha256)
3
+ $ErrorActionPreference = 'Stop'
4
+ function Test-VCRuntime {
5
+ $runtime = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64' -ErrorAction SilentlyContinue
6
+ return ($runtime.Installed -eq 1 -and
7
+ (Test-Path "$env:WINDIR\System32\msvcp140.dll") -and
8
+ (Test-Path "$env:WINDIR\System32\vcruntime140.dll") -and
9
+ (Test-Path "$env:WINDIR\System32\vcruntime140_1.dll"))
10
+ }
11
+ $rebootRequired = $false
12
+ if (-not (Test-VCRuntime)) {
13
+ Write-Host 'Installing Microsoft Visual C++ x64 runtime before KeePassXC.'
14
+ if ($InstallerPath) {
15
+ if (-not $ExpectedSha256) { throw 'A verified installer SHA-256 is required.' }
16
+ if ((Get-FileHash -LiteralPath $InstallerPath -Algorithm SHA256).Hash -ne $ExpectedSha256) { throw 'VC++ runtime installer checksum mismatch.' }
17
+ $process = Start-Process -FilePath $InstallerPath -ArgumentList '/install /quiet /norestart' -Wait -PassThru
18
+ if ($process.ExitCode -notin @(0,3010)) { throw "VC++ runtime installation failed: $($process.ExitCode)" }
19
+ $rebootRequired = $process.ExitCode -eq 3010
20
+ } else {
21
+ & winget install --exact --id Microsoft.VCRedist.2015+.x64 --scope machine --accept-package-agreements --accept-source-agreements --silent
22
+ if ($LASTEXITCODE -ne 0) { throw "VC++ runtime installation failed: $LASTEXITCODE" }
23
+ }
24
+ if (-not (Test-VCRuntime)) { throw 'VC++ x64 runtime files or installation registration are missing; KeePassXC installation stopped.' }
25
+ }
26
+ @{installed=$true;architecture='x64';reboot_required=$rebootRequired}