lycheedev 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/bin/lycheedev.js +58 -8
  2. package/package.json +1 -1
  3. package/vendor/addon/Core/Bootstrap.lua +131 -131
  4. package/vendor/addon/Core/Clients/Mainline.lua +9 -9
  5. package/vendor/addon/Core/Clients/Mists.lua +9 -9
  6. package/vendor/addon/Core/Clients/Titan.lua +9 -9
  7. package/vendor/addon/Core/Compatibility.lua +43 -43
  8. package/vendor/addon/Core/Database.lua +859 -859
  9. package/vendor/addon/Core/Inspector.lua +647 -647
  10. package/vendor/addon/Core/Locale.lua +307 -307
  11. package/vendor/addon/Core/Locale_enUS.lua +318 -318
  12. package/vendor/addon/Core/Safety.lua +42 -42
  13. package/vendor/addon/Core/Serializer.lua +324 -324
  14. package/vendor/addon/Libs/AutomationQR.lua +1176 -1176
  15. package/vendor/addon/Lychee Dev_Mainline.toc +43 -43
  16. package/vendor/addon/Lychee Dev_Mists.toc +43 -43
  17. package/vendor/addon/Lychee Dev_Wrath.toc +43 -43
  18. package/vendor/addon/Modules/Automation/Controller.lua +757 -757
  19. package/vendor/addon/Modules/Automation/Report.lua +409 -409
  20. package/vendor/addon/Modules/Automation/auto/auto.lua +12 -12
  21. package/vendor/addon/Modules/Diagnostics.lua +238 -238
  22. package/vendor/addon/Modules/Events/Catalog.lua +184 -184
  23. package/vendor/addon/Modules/Events/CatalogData_Mainline.lua +1788 -1788
  24. package/vendor/addon/Modules/Events/CatalogData_Mists.lua +1489 -1489
  25. package/vendor/addon/Modules/Events/CatalogData_Titan.lua +1492 -1492
  26. package/vendor/addon/Modules/Events/Monitor.lua +181 -181
  27. package/vendor/addon/Modules/FunctionTrace.lua +85 -85
  28. package/vendor/addon/Modules/ObjectInspector.lua +329 -329
  29. package/vendor/addon/UI/AutomationOverlay.lua +183 -183
  30. package/vendor/addon/UI/Export.lua +140 -140
  31. package/vendor/addon/UI/Features.lua +890 -890
  32. package/vendor/addon/UI/MainWindow.lua +1145 -1145
  33. package/vendor/addon/UI/Pages/About.lua +223 -223
  34. package/vendor/addon/UI/Pages/Automation.lua +417 -417
  35. package/vendor/addon/UI/Pages/Diagnostics.lua +289 -289
  36. package/vendor/addon/UI/Pages/ExportRecords.lua +387 -387
  37. package/vendor/addon/UI/Pages/Object.lua +573 -573
  38. package/vendor/addon/UI/Pages/Trace.lua +165 -165
  39. package/vendor/skill/SKILL.md +94 -94
  40. package/vendor/skill/agents/openai.yaml +4 -4
  41. package/vendor/skill/references/automation.md +327 -327
  42. package/vendor/skill/references/runtime-investigations.md +97 -97
  43. package/vendor/skill/scripts/automation/__init__.py +1 -1
  44. package/vendor/skill/scripts/automation/registry.py +516 -516
  45. package/vendor/skill/scripts/automation/saved_variables.py +438 -438
  46. package/vendor/skill/scripts/automation/session.py +207 -207
  47. package/vendor/skill/scripts/automation/windows.py +573 -573
  48. package/vendor/skill/scripts/automation.py +865 -865
  49. package/vendor/skill/scripts/requirements.txt +13 -13
  50. package/vendor/skill/scripts/selftest_offline.py +981 -981
package/bin/lycheedev.js CHANGED
@@ -8,7 +8,7 @@ import { runDoctor } from '../src/doctor.js';
8
8
  import { runInstall } from '../src/install.js';
9
9
  import { loadConfig } from '../src/config.js';
10
10
  import { runAutomation } from '../src/python.js';
11
- import { scanClients } from '../src/wow.js';
11
+ import { findSavedVariablesCandidates, scanClients } from '../src/wow.js';
12
12
  import { addonFolderName, exists } from '../src/paths.js';
13
13
 
14
14
  const HELP = `lycheedev - Lychee Dev installer and World of Warcraft automation driver
@@ -174,7 +174,9 @@ function main(argv) {
174
174
 
175
175
  const forwarded = [];
176
176
  const client = target.client || {};
177
- if (client.addonsDir) forwarded.push('--install-dir', client.addonsDir);
177
+ // The python helper wants the installed addon directory itself, not the
178
+ // AddOns folder that contains it.
179
+ if (client.addonsDir) forwarded.push('--install-dir', path.join(client.addonsDir, addonFolderName));
178
180
 
179
181
  switch (command) {
180
182
  case 'send': {
@@ -224,7 +226,42 @@ function main(argv) {
224
226
  }
225
227
  return forward(['task', sub, ...forwarded, ...passthrough(flags)]);
226
228
  }
227
- case 'sv':
229
+ case 'sv': {
230
+ const sub = rest.shift();
231
+ if (sub === 'find') {
232
+ // The wrapper already knows the plaintext install and can enumerate the
233
+ // account folders itself, so `sv find` needs no profile binding.
234
+ const config = loadConfig();
235
+ const root = flags['wow-root'] || config.wowRoot;
236
+ if (!root || !exists(root)) {
237
+ console.error('error: no World of Warcraft root; run `lycheedev install --wow-root <path>`');
238
+ return 1;
239
+ }
240
+ const candidates = findSavedVariablesCandidates(root, client.flavorFolder);
241
+ if (candidates.length === 0) {
242
+ console.error(`no account-level '${addonFolderName}.lua' found under ${root}`);
243
+ return 1;
244
+ }
245
+ for (const candidate of candidates) console.log(candidate.path);
246
+ return 0;
247
+ }
248
+ if (sub === 'read') {
249
+ if (!flags.ticket) {
250
+ console.error('error: sv read needs --ticket <t>');
251
+ return 1;
252
+ }
253
+ const svPath = flags.sv || client.svPath;
254
+ if (!svPath) {
255
+ console.error('error: no SavedVariables path known for this client; '
256
+ + 'run `lycheedev install`, or pass --sv <path>');
257
+ return 1;
258
+ }
259
+ return forward(['sv', 'read', '--sv', svPath, '--ticket', flags.ticket,
260
+ ...passthrough(flags)]);
261
+ }
262
+ console.error('error: sv needs a subcommand: find or read');
263
+ return 1;
264
+ }
228
265
  case 'profile':
229
266
  case 'status':
230
267
  case 'recover':
@@ -237,11 +274,12 @@ function main(argv) {
237
274
 
238
275
  function passthrough(all) {
239
276
  const out = [];
277
+ // These are either handled by the wrapper itself or are global python
278
+ // options that `forward()` places before the subcommand.
279
+ const handled = ['wow-root', 'client', 'python', 'force', 'reset-registry', 'task', 'count',
280
+ 'ticket', 'status', 'json', 'help', 'version', 'data-dir', 'installation'];
240
281
  for (const [name, value] of Object.entries(all)) {
241
- if (['wow-root', 'client', 'python', 'force', 'reset-registry', 'task', 'count',
242
- 'ticket', 'status', 'json', 'help', 'version'].includes(name)) {
243
- continue;
244
- }
282
+ if (handled.includes(name)) continue;
245
283
  if (value === true) out.push(`--${name}`);
246
284
  else out.push(`--${name}`, String(value));
247
285
  }
@@ -249,7 +287,19 @@ function main(argv) {
249
287
  }
250
288
 
251
289
  function forward(args) {
252
- const result = runAutomation(args, { pythonBin: flags.python || (target.config || {}).pythonBin });
290
+ // `--data-dir` and `--installation` are global options of the python helper,
291
+ // so they must precede the subcommand or argparse rejects them. Everything
292
+ // else stays where the caller put it.
293
+ const globals = [];
294
+ if (flags['data-dir']) globals.push('--data-dir', String(flags['data-dir']));
295
+ if (flags.installation) globals.push('--installation', String(flags.installation));
296
+ const finalArgs = [...globals, ...args];
297
+ if (process.env.LYCHEEDEV_DEBUG) {
298
+ console.error(`[debug] python automation.py ${finalArgs.join(' ')}`);
299
+ }
300
+ const result = runAutomation(finalArgs, {
301
+ pythonBin: flags.python || (target.config || {}).pythonBin,
302
+ });
253
303
  return typeof result.status === 'number' ? result.status : 1;
254
304
  }
255
305
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lycheedev",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "lycheedev: install the World of Warcraft inspection addon, its in-game automation tooling, and drive it from the command line.",
5
5
  "keywords": [
6
6
  "wow",
@@ -1,131 +1,131 @@
1
- local ADDON_NAME, ns = ...
2
- local L = ns.L
3
-
4
- local MAX_CAPTURE_BYTES = 44000
5
-
6
- local function AddOutput(output, text)
7
- if output.truncated then
8
- return
9
- end
10
-
11
- text = tostring(text or "")
12
- local prefix = #output.parts > 0 and "\n" or ""
13
- local remaining = MAX_CAPTURE_BYTES - output.length - #prefix
14
- if #text > remaining then
15
- output.parts[#output.parts + 1] = prefix
16
- .. text:sub(1, math.max(0, remaining))
17
- .. "\n... <output truncated>"
18
- output.truncated = true
19
- output.length = output.length + #output.parts[#output.parts]
20
- return
21
- end
22
-
23
- output.parts[#output.parts + 1] = prefix .. text
24
- output.length = output.length + #prefix + #text
25
- end
26
-
27
- local function NormalizeCode(code)
28
- code = type(code) == "string" and code or ""
29
- code = code:gsub("^%s+", ""):gsub("%s+$", "")
30
-
31
- local prefixEnd = code:match("^/[Rr][Uu][Nn]%s+()")
32
- or code:match("^/[Ss][Cc][Rr][Ii][Pp][Tt]%s+()")
33
- if prefixEnd then
34
- code = code:sub(prefixEnd)
35
- end
36
-
37
- return code
38
- end
39
-
40
- local function BuildEnvironment(output)
41
- local environment = {}
42
-
43
- environment.print = function(...)
44
- local values = { n = select("#", ...), ... }
45
- local parts = {}
46
- for index = 1, values.n do
47
- if issecretvalue and issecretvalue(values[index]) then
48
- parts[index] = "<secret>"
49
- else
50
- parts[index] = tostring(values[index])
51
- end
52
- end
53
- AddOutput(output, table.concat(parts, " "))
54
- end
55
-
56
- environment.dump = function(value)
57
- AddOutput(output, ns.Serialize(value))
58
- return value
59
- end
60
-
61
- setmetatable(environment, { __index = _G, __newindex = _G })
62
- return environment
63
- end
64
-
65
- local function Pack(...)
66
- return { n = select("#", ...), ... }
67
- end
68
-
69
- function ns.Execute(code)
70
- if ns.IsCombatBlocked() then
71
- return false, ns.L.COMBAT_BLOCKED, ""
72
- end
73
- code = NormalizeCode(code)
74
- if code == "" then
75
- return false, L.ENTER_LUA, code
76
- end
77
-
78
- local output = {
79
- parts = {},
80
- length = 0,
81
- truncated = false,
82
- }
83
- local chunk, compileError = loadstring(code, "LycheeDevInput")
84
- if not chunk then
85
- return false, L.COMPILE_ERROR .. tostring(compileError), code
86
- end
87
-
88
- setfenv(chunk, BuildEnvironment(output))
89
-
90
- local packed = Pack(pcall(chunk))
91
- local succeeded = packed[1]
92
-
93
- if not succeeded then
94
- AddOutput(output, L.RUNTIME_ERROR .. tostring(packed[2]))
95
- return false, table.concat(output.parts), code
96
- end
97
-
98
- local values = { n = packed.n - 1 }
99
- for index = 2, packed.n do
100
- values[index - 1] = packed[index]
101
- end
102
-
103
- if values.n > 0 then
104
- AddOutput(output, ns.SerializeValues(values))
105
- end
106
-
107
- if #output.parts == 0 then
108
- AddOutput(output, L.COMPLETED_NO_OUTPUT)
109
- end
110
-
111
- return true, table.concat(output.parts), code, ns.CreateValueTree(values), ns.CreateStoredValueTree(values)
112
- end
113
-
114
- SLASH_LYCHEEDEV1 = "/dev"
115
- SlashCmdList.LYCHEEDEV = function(message)
116
- local text = tostring(message or "")
117
- local action = text:match("^(%S+)")
118
- if action and action:lower() == "auto" then
119
- if ns.Automation and ns.Automation.HandleCommand then
120
- ns.Automation.HandleCommand(text:match("^%S+%s*(.-)%s*$") or "")
121
- end
122
- return
123
- end
124
- if ns.IsCombatBlocked() then
125
- ns.PrintCombatBlocked()
126
- return
127
- end
128
- ns.EnsureSafety()
129
- ns.InitializeDatabase()
130
- ns.ToggleWindow()
131
- end
1
+ local ADDON_NAME, ns = ...
2
+ local L = ns.L
3
+
4
+ local MAX_CAPTURE_BYTES = 44000
5
+
6
+ local function AddOutput(output, text)
7
+ if output.truncated then
8
+ return
9
+ end
10
+
11
+ text = tostring(text or "")
12
+ local prefix = #output.parts > 0 and "\n" or ""
13
+ local remaining = MAX_CAPTURE_BYTES - output.length - #prefix
14
+ if #text > remaining then
15
+ output.parts[#output.parts + 1] = prefix
16
+ .. text:sub(1, math.max(0, remaining))
17
+ .. "\n... <output truncated>"
18
+ output.truncated = true
19
+ output.length = output.length + #output.parts[#output.parts]
20
+ return
21
+ end
22
+
23
+ output.parts[#output.parts + 1] = prefix .. text
24
+ output.length = output.length + #prefix + #text
25
+ end
26
+
27
+ local function NormalizeCode(code)
28
+ code = type(code) == "string" and code or ""
29
+ code = code:gsub("^%s+", ""):gsub("%s+$", "")
30
+
31
+ local prefixEnd = code:match("^/[Rr][Uu][Nn]%s+()")
32
+ or code:match("^/[Ss][Cc][Rr][Ii][Pp][Tt]%s+()")
33
+ if prefixEnd then
34
+ code = code:sub(prefixEnd)
35
+ end
36
+
37
+ return code
38
+ end
39
+
40
+ local function BuildEnvironment(output)
41
+ local environment = {}
42
+
43
+ environment.print = function(...)
44
+ local values = { n = select("#", ...), ... }
45
+ local parts = {}
46
+ for index = 1, values.n do
47
+ if issecretvalue and issecretvalue(values[index]) then
48
+ parts[index] = "<secret>"
49
+ else
50
+ parts[index] = tostring(values[index])
51
+ end
52
+ end
53
+ AddOutput(output, table.concat(parts, " "))
54
+ end
55
+
56
+ environment.dump = function(value)
57
+ AddOutput(output, ns.Serialize(value))
58
+ return value
59
+ end
60
+
61
+ setmetatable(environment, { __index = _G, __newindex = _G })
62
+ return environment
63
+ end
64
+
65
+ local function Pack(...)
66
+ return { n = select("#", ...), ... }
67
+ end
68
+
69
+ function ns.Execute(code)
70
+ if ns.IsCombatBlocked() then
71
+ return false, ns.L.COMBAT_BLOCKED, ""
72
+ end
73
+ code = NormalizeCode(code)
74
+ if code == "" then
75
+ return false, L.ENTER_LUA, code
76
+ end
77
+
78
+ local output = {
79
+ parts = {},
80
+ length = 0,
81
+ truncated = false,
82
+ }
83
+ local chunk, compileError = loadstring(code, "LycheeDevInput")
84
+ if not chunk then
85
+ return false, L.COMPILE_ERROR .. tostring(compileError), code
86
+ end
87
+
88
+ setfenv(chunk, BuildEnvironment(output))
89
+
90
+ local packed = Pack(pcall(chunk))
91
+ local succeeded = packed[1]
92
+
93
+ if not succeeded then
94
+ AddOutput(output, L.RUNTIME_ERROR .. tostring(packed[2]))
95
+ return false, table.concat(output.parts), code
96
+ end
97
+
98
+ local values = { n = packed.n - 1 }
99
+ for index = 2, packed.n do
100
+ values[index - 1] = packed[index]
101
+ end
102
+
103
+ if values.n > 0 then
104
+ AddOutput(output, ns.SerializeValues(values))
105
+ end
106
+
107
+ if #output.parts == 0 then
108
+ AddOutput(output, L.COMPLETED_NO_OUTPUT)
109
+ end
110
+
111
+ return true, table.concat(output.parts), code, ns.CreateValueTree(values), ns.CreateStoredValueTree(values)
112
+ end
113
+
114
+ SLASH_LYCHEEDEV1 = "/dev"
115
+ SlashCmdList.LYCHEEDEV = function(message)
116
+ local text = tostring(message or "")
117
+ local action = text:match("^(%S+)")
118
+ if action and action:lower() == "auto" then
119
+ if ns.Automation and ns.Automation.HandleCommand then
120
+ ns.Automation.HandleCommand(text:match("^%S+%s*(.-)%s*$") or "")
121
+ end
122
+ return
123
+ end
124
+ if ns.IsCombatBlocked() then
125
+ ns.PrintCombatBlocked()
126
+ return
127
+ end
128
+ ns.EnsureSafety()
129
+ ns.InitializeDatabase()
130
+ ns.ToggleWindow()
131
+ end
@@ -1,9 +1,9 @@
1
- local ADDON_NAME, ns = ...
2
-
3
- ns.Client = {
4
- id = "retail",
5
- name = "Retail",
6
- flavor = "Mainline",
7
- interface = 120100,
8
- baseline = "12.1.0",
9
- }
1
+ local ADDON_NAME, ns = ...
2
+
3
+ ns.Client = {
4
+ id = "retail",
5
+ name = "Retail",
6
+ flavor = "Mainline",
7
+ interface = 120100,
8
+ baseline = "12.1.0",
9
+ }
@@ -1,9 +1,9 @@
1
- local ADDON_NAME, ns = ...
2
-
3
- ns.Client = {
4
- id = "classic",
5
- name = "Classic",
6
- flavor = "Mists",
7
- interface = 50504,
8
- baseline = "5.5.4",
9
- }
1
+ local ADDON_NAME, ns = ...
2
+
3
+ ns.Client = {
4
+ id = "classic",
5
+ name = "Classic",
6
+ flavor = "Mists",
7
+ interface = 50504,
8
+ baseline = "5.5.4",
9
+ }
@@ -1,9 +1,9 @@
1
- local ADDON_NAME, ns = ...
2
-
3
- ns.Client = {
4
- id = "titan",
5
- name = "Classic Titan",
6
- flavor = "Titan",
7
- interface = 38002,
8
- baseline = "3.80.2",
9
- }
1
+ local ADDON_NAME, ns = ...
2
+
3
+ ns.Client = {
4
+ id = "titan",
5
+ name = "Classic Titan",
6
+ flavor = "Titan",
7
+ interface = 38002,
8
+ baseline = "3.80.2",
9
+ }
@@ -1,43 +1,43 @@
1
- local ADDON_NAME, ns = ...
2
-
3
- local client = assert(ns.Client, "Lychee Dev client profile must load first")
4
-
5
- function client.GetAddOnMetadata(addon, field)
6
- return C_AddOns.GetAddOnMetadata(addon, field)
7
- end
8
-
9
- function client.GetMouseFocus()
10
- local foci = GetMouseFoci()
11
- if issecretvalue(foci) or type(foci) ~= "table" or not foci[1]
12
- or issecretvalue(foci[1]) then
13
- return nil
14
- end
15
- return foci[1]
16
- end
17
-
18
- -- UI units per physical screen pixel, for screen-space overlays such as the
19
- -- automation status blocks and QR notice. GetPhysicalScreenSize was verified on
20
- -- the Retail 12.1.0 baseline only; other clients use the legacy 768-height
21
- -- approximation until verified.
22
- function client.GetPhysicalPixelSize()
23
- if GetPhysicalScreenSize then
24
- local succeeded, width, height = pcall(GetPhysicalScreenSize)
25
- if succeeded and not (issecretvalue and (issecretvalue(width) or issecretvalue(height)))
26
- and width and width > 0 and GetScreenWidth then
27
- local uiWidth = GetScreenWidth()
28
- if uiWidth and uiWidth > 0 and not (issecretvalue and issecretvalue(uiWidth)) then
29
- return uiWidth / width
30
- end
31
- end
32
- end
33
- -- Fallback for clients without a verified GetPhysicalScreenSize: the legacy
34
- -- 768-height approximation treats the screen as 768 physical pixels tall,
35
- -- so one physical pixel spans (uiHeight / 768) UI units. The inverse,
36
- -- 768 / uiHeight, would shrink the 4x4 physical-pixel status blocks below
37
- -- their specified minimum on tall UIs.
38
- local uiHeight = GetScreenHeight and GetScreenHeight() or nil
39
- if uiHeight and uiHeight > 0 and not (issecretvalue and issecretvalue(uiHeight)) then
40
- return uiHeight / 768
41
- end
42
- return 1
43
- end
1
+ local ADDON_NAME, ns = ...
2
+
3
+ local client = assert(ns.Client, "Lychee Dev client profile must load first")
4
+
5
+ function client.GetAddOnMetadata(addon, field)
6
+ return C_AddOns.GetAddOnMetadata(addon, field)
7
+ end
8
+
9
+ function client.GetMouseFocus()
10
+ local foci = GetMouseFoci()
11
+ if issecretvalue(foci) or type(foci) ~= "table" or not foci[1]
12
+ or issecretvalue(foci[1]) then
13
+ return nil
14
+ end
15
+ return foci[1]
16
+ end
17
+
18
+ -- UI units per physical screen pixel, for screen-space overlays such as the
19
+ -- automation status blocks and QR notice. GetPhysicalScreenSize was verified on
20
+ -- the Retail 12.1.0 baseline only; other clients use the legacy 768-height
21
+ -- approximation until verified.
22
+ function client.GetPhysicalPixelSize()
23
+ if GetPhysicalScreenSize then
24
+ local succeeded, width, height = pcall(GetPhysicalScreenSize)
25
+ if succeeded and not (issecretvalue and (issecretvalue(width) or issecretvalue(height)))
26
+ and width and width > 0 and GetScreenWidth then
27
+ local uiWidth = GetScreenWidth()
28
+ if uiWidth and uiWidth > 0 and not (issecretvalue and issecretvalue(uiWidth)) then
29
+ return uiWidth / width
30
+ end
31
+ end
32
+ end
33
+ -- Fallback for clients without a verified GetPhysicalScreenSize: the legacy
34
+ -- 768-height approximation treats the screen as 768 physical pixels tall,
35
+ -- so one physical pixel spans (uiHeight / 768) UI units. The inverse,
36
+ -- 768 / uiHeight, would shrink the 4x4 physical-pixel status blocks below
37
+ -- their specified minimum on tall UIs.
38
+ local uiHeight = GetScreenHeight and GetScreenHeight() or nil
39
+ if uiHeight and uiHeight > 0 and not (issecretvalue and issecretvalue(uiHeight)) then
40
+ return uiHeight / 768
41
+ end
42
+ return 1
43
+ end