lycheedev 1.1.1 → 2.0.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.
- package/LICENSE +49 -0
- package/README.md +45 -0
- package/THIRD_PARTY_NOTICES +812 -0
- package/bin/lycheedev.mjs +56 -0
- package/native/windows-amd64/lycheedev.exe +0 -0
- package/package.json +12 -33
- package/payload/addon/Bridge/CaptureWriter.lua +154 -0
- package/payload/addon/Bridge/Definitions.lua +3 -0
- package/payload/addon/Bridge/Identity.lua +127 -0
- package/{vendor/addon/Libs/AutomationQR.lua → payload/addon/Bridge/MatrixSymbol.lua} +23 -30
- package/payload/addon/Bridge/ProbeQueue.lua +136 -0
- package/payload/addon/Bridge/ProbeRunner.lua +128 -0
- package/payload/addon/Bridge/ReceiptView.lua +160 -0
- package/payload/addon/Bridge/Reentry.lua +192 -0
- package/payload/addon/Bridge/ReportStore.lua +153 -0
- package/payload/addon/Bridge/Session.lua +163 -0
- package/payload/addon/Clients/Evergreen.lua +2 -0
- package/payload/addon/Clients/Live.lua +2 -0
- package/payload/addon/Clients/Pandaria.lua +2 -0
- package/payload/addon/Clients/Titan.lua +2 -0
- package/payload/addon/Core/Compat.lua +59 -0
- package/payload/addon/Core/Controls.lua +168 -0
- package/{vendor/addon/Core/Bootstrap.lua → payload/addon/Core/Execute.lua} +12 -23
- package/{vendor → payload}/addon/Core/Inspector.lua +19 -235
- package/{vendor → payload}/addon/Core/Locale.lua +129 -94
- package/{vendor → payload}/addon/Core/Locale_enUS.lua +129 -96
- package/payload/addon/Core/Persistence.lua +58 -0
- package/payload/addon/Core/Platform.lua +58 -0
- package/payload/addon/Core/Runtime.lua +25 -0
- package/payload/addon/Core/Safety.lua +56 -0
- package/{vendor → payload}/addon/Core/Serializer.lua +18 -6
- package/payload/addon/Core/Stores.lua +611 -0
- package/payload/addon/Lychee Dev_Forever.toc +52 -0
- package/payload/addon/Lychee Dev_Mainline.toc +52 -0
- package/payload/addon/Lychee Dev_Mists.toc +52 -0
- package/payload/addon/Lychee Dev_Wrath.toc +52 -0
- package/payload/addon/Modules/AutomationView.lua +393 -0
- package/{vendor → payload}/addon/Modules/Diagnostics.lua +92 -36
- package/{vendor → payload}/addon/Modules/Events/Catalog.lua +9 -0
- package/{vendor → payload}/addon/Modules/Events/Monitor.lua +45 -5
- package/payload/addon/Modules/FunctionTrace.lua +150 -0
- package/{vendor → payload}/addon/Modules/ObjectInspector.lua +105 -31
- package/{vendor → payload}/addon/UI/Export.lua +64 -34
- package/{vendor → payload}/addon/UI/Pages/About.lua +26 -14
- package/payload/addon/UI/Pages/Automation.lua +446 -0
- package/payload/addon/UI/Pages/Diagnostics.lua +402 -0
- package/{vendor/addon/UI/Features.lua → payload/addon/UI/Pages/Events.lua} +192 -302
- package/{vendor → payload}/addon/UI/Pages/ExportRecords.lua +213 -132
- package/{vendor → payload}/addon/UI/Pages/Object.lua +229 -121
- package/payload/addon/UI/Pages/Run.lua +423 -0
- package/payload/addon/UI/Pages/Trace.lua +314 -0
- package/payload/addon/UI/TreeView.lua +246 -0
- package/{vendor/addon/UI/MainWindow.lua → payload/addon/UI/Widgets.lua} +89 -529
- package/payload/addon/UI/Window.lua +425 -0
- package/payload/skill/SKILL.md +87 -0
- package/payload/skill/agents/openai.yaml +7 -0
- package/payload/skill/references/addon-validation.md +42 -0
- package/payload/skill/references/asset-export.md +109 -0
- package/payload/skill/references/commands.md +169 -0
- package/payload/skill/references/data-investigation.md +242 -0
- package/payload/skill/references/error-diagnosis.md +41 -0
- package/payload/skill/references/installation.md +18 -0
- package/payload/skill/references/live-investigation.md +129 -0
- package/payload/skill/references/source-research.md +82 -0
- package/payload/skill/scripts/lycheedev.mjs +59 -0
- package/release.json +346 -0
- package/bin/lycheedev.js +0 -742
- package/src/addon.js +0 -95
- package/src/config.js +0 -68
- package/src/doctor.js +0 -126
- package/src/install.js +0 -145
- package/src/paths.js +0 -93
- package/src/py/instances.py +0 -165
- package/src/python.js +0 -111
- package/src/skill.js +0 -48
- package/src/wow.js +0 -541
- package/vendor/addon/Core/Clients/Forever.lua +0 -9
- package/vendor/addon/Core/Clients/Mainline.lua +0 -9
- package/vendor/addon/Core/Clients/Mists.lua +0 -9
- package/vendor/addon/Core/Clients/Titan.lua +0 -9
- package/vendor/addon/Core/Compatibility.lua +0 -43
- package/vendor/addon/Core/Database.lua +0 -859
- package/vendor/addon/Core/Safety.lua +0 -42
- package/vendor/addon/Lychee Dev_Forever.toc +0 -43
- package/vendor/addon/Lychee Dev_Mainline.toc +0 -43
- package/vendor/addon/Lychee Dev_Mists.toc +0 -43
- package/vendor/addon/Lychee Dev_Wrath.toc +0 -43
- package/vendor/addon/Modules/Automation/Controller.lua +0 -884
- package/vendor/addon/Modules/Automation/Report.lua +0 -409
- package/vendor/addon/Modules/Automation/auto/auto.lua +0 -12
- package/vendor/addon/Modules/FunctionTrace.lua +0 -85
- package/vendor/addon/UI/AutomationOverlay.lua +0 -253
- package/vendor/addon/UI/Pages/Automation.lua +0 -417
- package/vendor/addon/UI/Pages/Diagnostics.lua +0 -289
- package/vendor/addon/UI/Pages/Trace.lua +0 -165
- package/vendor/skill/SKILL.md +0 -42
- package/vendor/skill/agents/openai.yaml +0 -4
- package/vendor/skill/references/automation.md +0 -128
- package/vendor/skill/references/clients.md +0 -51
- package/vendor/skill/references/runtime-investigations.md +0 -104
- package/vendor/skill/scripts/automation/__init__.py +0 -1
- package/vendor/skill/scripts/automation/registry.py +0 -516
- package/vendor/skill/scripts/automation/saved_variables.py +0 -438
- package/vendor/skill/scripts/automation/session.py +0 -207
- package/vendor/skill/scripts/automation/windows.py +0 -792
- package/vendor/skill/scripts/automation.py +0 -1034
- package/vendor/skill/scripts/requirements.txt +0 -13
- package/vendor/skill/scripts/selftest_offline.py +0 -1061
- package/vendor/skill/scripts/test_input_safety.py +0 -132
- /package/{vendor → payload}/addon/Media/GitHub.png +0 -0
- /package/{vendor → payload}/addon/Media/Logo.png +0 -0
- /package/{vendor → payload}/addon/Modules/Events/CatalogData_Forever.lua +0 -0
- /package/{vendor → payload}/addon/Modules/Events/CatalogData_Mainline.lua +0 -0
- /package/{vendor → payload}/addon/Modules/Events/CatalogData_Mists.lua +0 -0
- /package/{vendor → payload}/addon/Modules/Events/CatalogData_Titan.lua +0 -0
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"""Offline input regression: all window, keyboard and clipboard calls are mocked."""
|
|
2
|
-
import unittest
|
|
3
|
-
from unittest.mock import patch
|
|
4
|
-
from automation import windows
|
|
5
|
-
|
|
6
|
-
class Clipboard:
|
|
7
|
-
def __init__(self): self.text = "previous clipboard"
|
|
8
|
-
def read_text(self): return self.text
|
|
9
|
-
def copy_text(self, value): self.text = value
|
|
10
|
-
def clear(self): self.text = None
|
|
11
|
-
|
|
12
|
-
class InputSafetyTests(unittest.TestCase):
|
|
13
|
-
def test_windows_path_aliases_match(self):
|
|
14
|
-
identity = windows.WindowIdentity(1, 2, r"D:\Game\Wow.exe", "test")
|
|
15
|
-
self.assertTrue(identity.matches(pid=2, exe_path="d:/game/WOW.EXE"))
|
|
16
|
-
self.assertFalse(identity.matches(pid=3))
|
|
17
|
-
|
|
18
|
-
def exercise(self, draft=None, *, paste=True, copy=True, lose_focus=False, mode="foreground", escape=True):
|
|
19
|
-
clipboard = Clipboard()
|
|
20
|
-
state = {"open": draft is not None, "text": draft or "", "selected": False,
|
|
21
|
-
"foreground": True, "public": [], "commands": []}
|
|
22
|
-
def key(vk, ctrl=False):
|
|
23
|
-
if vk == 0x1b:
|
|
24
|
-
if escape: state.update(open=False, text="", selected=False)
|
|
25
|
-
elif vk == 0xBF:
|
|
26
|
-
state["open"] = True
|
|
27
|
-
state["text"] += "/"
|
|
28
|
-
elif vk == windows.VK_RETURN:
|
|
29
|
-
if state["open"]:
|
|
30
|
-
text = state["text"]
|
|
31
|
-
if text: state["commands" if text.startswith("/") else "public"].append(text)
|
|
32
|
-
state.update(open=False, text="", selected=False)
|
|
33
|
-
else: state["open"] = True
|
|
34
|
-
elif ctrl and vk == 0x41: state["selected"] = True
|
|
35
|
-
elif ctrl and vk == windows.VK_V and state["open"]:
|
|
36
|
-
if paste:
|
|
37
|
-
state["text"] = ("" if state["selected"] else state["text"]) + clipboard.text
|
|
38
|
-
state["selected"] = False
|
|
39
|
-
if lose_focus: state["foreground"] = False
|
|
40
|
-
elif ctrl and vk == 0x43 and state["open"] and state["selected"] and copy:
|
|
41
|
-
clipboard.text = state["text"]
|
|
42
|
-
error = None
|
|
43
|
-
with patch.object(windows, "confirm_window", return_value=windows.WindowIdentity(1, 2, "D:/Game/Wow.exe", "test")), \
|
|
44
|
-
patch.object(windows, "focus_window"), \
|
|
45
|
-
patch.object(windows, "is_foreground", side_effect=lambda hwnd: state["foreground"]), \
|
|
46
|
-
patch.object(windows, "_send_key", side_effect=key), patch.object(windows.time, "sleep"):
|
|
47
|
-
try:
|
|
48
|
-
windows.send_command(1, "/reload", clipboard=clipboard, mode=mode)
|
|
49
|
-
except windows.InputError as exc: error = exc
|
|
50
|
-
self.assertEqual(state["public"], [], "automation submitted a public chat draft")
|
|
51
|
-
if paste:
|
|
52
|
-
self.assertEqual(clipboard.text, "previous clipboard")
|
|
53
|
-
return state, error
|
|
54
|
-
|
|
55
|
-
def test_existing_draft_is_cancelled(self):
|
|
56
|
-
state, error = self.exercise("unfinished public chat ")
|
|
57
|
-
self.assertIsNone(error)
|
|
58
|
-
self.assertEqual(state["commands"], ["/reload"])
|
|
59
|
-
|
|
60
|
-
def test_ignored_escape_cannot_submit_draft(self):
|
|
61
|
-
state, error = self.exercise("public draft", escape=False)
|
|
62
|
-
self.assertIsNone(error)
|
|
63
|
-
self.assertEqual(state["commands"], ["/reload"])
|
|
64
|
-
|
|
65
|
-
def test_messages_stays_background_and_cancels_draft(self):
|
|
66
|
-
state = {"open": True, "text": "public draft", "public": [], "commands": []}
|
|
67
|
-
def post(hwnd, message, value, lparam):
|
|
68
|
-
self.assertEqual(hwnd, 1)
|
|
69
|
-
if message == windows.WM_KEYDOWN:
|
|
70
|
-
if value == windows.VK_ESCAPE:
|
|
71
|
-
state.update(open=False, text="")
|
|
72
|
-
elif value == windows.VK_RETURN:
|
|
73
|
-
if state["open"]:
|
|
74
|
-
text = state["text"]
|
|
75
|
-
if text: state["commands" if text.startswith("/") else "public"].append(text)
|
|
76
|
-
state.update(open=False, text="")
|
|
77
|
-
else: state["open"] = True
|
|
78
|
-
elif message == windows.WM_CHAR:
|
|
79
|
-
self.assertEqual(lparam, 1)
|
|
80
|
-
if state["open"]: state["text"] += chr(value)
|
|
81
|
-
return 1
|
|
82
|
-
with patch.object(windows, "confirm_window", return_value=windows.WindowIdentity(1, 2, "D:/Wow.exe", "test")), \
|
|
83
|
-
patch.object(windows.user32, "PostMessageW", side_effect=post), \
|
|
84
|
-
patch.object(windows, "focus_window", side_effect=AssertionError("must stay background")), \
|
|
85
|
-
patch.object(windows, "_send_key", side_effect=AssertionError("must not SendInput")), \
|
|
86
|
-
patch.object(windows, "Clipboard", side_effect=AssertionError("must not use clipboard")), \
|
|
87
|
-
patch.object(windows.time, "sleep"):
|
|
88
|
-
windows.send_command(1, "/reload", mode="messages")
|
|
89
|
-
self.assertEqual(state["public"], [])
|
|
90
|
-
self.assertEqual(state["commands"], ["/reload"])
|
|
91
|
-
|
|
92
|
-
def test_background_rejection_does_not_queue_submit(self):
|
|
93
|
-
posted = []
|
|
94
|
-
def post(hwnd, message, value, lparam):
|
|
95
|
-
posted.append((message, value))
|
|
96
|
-
return message != windows.WM_CHAR
|
|
97
|
-
with patch.object(windows, "confirm_window", return_value=windows.WindowIdentity(1, 2, "D:/Wow.exe", "test")), \
|
|
98
|
-
patch.object(windows.user32, "PostMessageW", side_effect=post), \
|
|
99
|
-
patch.object(windows.time, "sleep"):
|
|
100
|
-
with self.assertRaises(windows.InputError):
|
|
101
|
-
windows.send_command(1, "/reload", mode="messages")
|
|
102
|
-
returns = [entry for entry in posted if entry == (windows.WM_KEYDOWN, windows.VK_RETURN)]
|
|
103
|
-
self.assertEqual(len(returns), 1, "failed typing must not queue final submit")
|
|
104
|
-
self.assertEqual(posted[-1], (windows.WM_KEYUP, windows.VK_ESCAPE))
|
|
105
|
-
|
|
106
|
-
def test_invalid_commands_never_focus_or_type(self):
|
|
107
|
-
with patch.object(windows, "focus_window") as focus, patch.object(windows, "_send_key") as key:
|
|
108
|
-
for command in ("hello", "/reload\n/dev", "/" + "a" * 255):
|
|
109
|
-
with self.assertRaises(windows.InputError):
|
|
110
|
-
windows.send_command(1, command)
|
|
111
|
-
focus.assert_not_called()
|
|
112
|
-
key.assert_not_called()
|
|
113
|
-
|
|
114
|
-
def test_closed_and_empty_chat(self):
|
|
115
|
-
for draft in (None, ""):
|
|
116
|
-
state, error = self.exercise(draft)
|
|
117
|
-
self.assertIsNone(error)
|
|
118
|
-
self.assertEqual(state["commands"], ["/reload"])
|
|
119
|
-
|
|
120
|
-
def test_failed_paste_or_copy_never_submits(self):
|
|
121
|
-
for options in ({"paste": False}, {"copy": False}):
|
|
122
|
-
state, error = self.exercise(**options)
|
|
123
|
-
self.assertIsNotNone(error)
|
|
124
|
-
self.assertEqual(state["commands"], [])
|
|
125
|
-
self.assertFalse(state["open"])
|
|
126
|
-
|
|
127
|
-
def test_focus_loss_never_submits(self):
|
|
128
|
-
state, error = self.exercise(lose_focus=True)
|
|
129
|
-
self.assertIsNotNone(error)
|
|
130
|
-
self.assertEqual(state["commands"], [])
|
|
131
|
-
|
|
132
|
-
if __name__ == "__main__": unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|