lycheedev 1.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/bin/lycheedev.js +257 -0
- package/package.json +42 -0
- package/src/addon.js +87 -0
- package/src/config.js +64 -0
- package/src/doctor.js +100 -0
- package/src/install.js +131 -0
- package/src/paths.js +93 -0
- package/src/python.js +107 -0
- package/src/skill.js +48 -0
- package/src/wow.js +110 -0
- package/vendor/addon/Core/Bootstrap.lua +131 -0
- package/vendor/addon/Core/Clients/Mainline.lua +9 -0
- package/vendor/addon/Core/Clients/Mists.lua +9 -0
- package/vendor/addon/Core/Clients/Titan.lua +9 -0
- package/vendor/addon/Core/Compatibility.lua +43 -0
- package/vendor/addon/Core/Database.lua +859 -0
- package/vendor/addon/Core/Inspector.lua +647 -0
- package/vendor/addon/Core/Locale.lua +307 -0
- package/vendor/addon/Core/Locale_enUS.lua +318 -0
- package/vendor/addon/Core/Safety.lua +42 -0
- package/vendor/addon/Core/Serializer.lua +324 -0
- package/vendor/addon/Libs/AutomationQR.lua +1176 -0
- package/vendor/addon/Lychee Dev_Mainline.toc +43 -0
- package/vendor/addon/Lychee Dev_Mists.toc +43 -0
- package/vendor/addon/Lychee Dev_Wrath.toc +43 -0
- package/vendor/addon/Media/GitHub.png +0 -0
- package/vendor/addon/Media/Logo.png +0 -0
- package/vendor/addon/Modules/Automation/Controller.lua +757 -0
- package/vendor/addon/Modules/Automation/Report.lua +409 -0
- package/vendor/addon/Modules/Automation/auto/auto.lua +12 -0
- package/vendor/addon/Modules/Diagnostics.lua +238 -0
- package/vendor/addon/Modules/Events/Catalog.lua +184 -0
- package/vendor/addon/Modules/Events/CatalogData_Mainline.lua +1788 -0
- package/vendor/addon/Modules/Events/CatalogData_Mists.lua +1489 -0
- package/vendor/addon/Modules/Events/CatalogData_Titan.lua +1492 -0
- package/vendor/addon/Modules/Events/Monitor.lua +181 -0
- package/vendor/addon/Modules/FunctionTrace.lua +85 -0
- package/vendor/addon/Modules/ObjectInspector.lua +329 -0
- package/vendor/addon/UI/AutomationOverlay.lua +183 -0
- package/vendor/addon/UI/Export.lua +140 -0
- package/vendor/addon/UI/Features.lua +890 -0
- package/vendor/addon/UI/MainWindow.lua +1145 -0
- package/vendor/addon/UI/Pages/About.lua +223 -0
- package/vendor/addon/UI/Pages/Automation.lua +417 -0
- package/vendor/addon/UI/Pages/Diagnostics.lua +289 -0
- package/vendor/addon/UI/Pages/ExportRecords.lua +387 -0
- package/vendor/addon/UI/Pages/Object.lua +573 -0
- package/vendor/addon/UI/Pages/Trace.lua +165 -0
- package/vendor/skill/SKILL.md +94 -0
- package/vendor/skill/agents/openai.yaml +4 -0
- package/vendor/skill/references/automation.md +327 -0
- package/vendor/skill/references/runtime-investigations.md +97 -0
- package/vendor/skill/scripts/automation/__init__.py +1 -0
- package/vendor/skill/scripts/automation/registry.py +516 -0
- package/vendor/skill/scripts/automation/saved_variables.py +438 -0
- package/vendor/skill/scripts/automation/session.py +207 -0
- package/vendor/skill/scripts/automation/windows.py +573 -0
- package/vendor/skill/scripts/automation.py +865 -0
- package/vendor/skill/scripts/requirements.txt +13 -0
- package/vendor/skill/scripts/selftest_offline.py +981 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
local ADDON_NAME, ns = ...
|
|
2
|
+
|
|
3
|
+
local DEFAULT_MAX_DEPTH = 6
|
|
4
|
+
local DEFAULT_MAX_ENTRIES = 200
|
|
5
|
+
local DEFAULT_MAX_OUTPUT_BYTES = 44000
|
|
6
|
+
local STREAM_CHUNK_BYTES = 44000
|
|
7
|
+
local STREAM_YIELD_BYTES = 4096
|
|
8
|
+
local STREAM_MAX_DEPTH = 32
|
|
9
|
+
local STREAM_MAX_ENTRIES = 10000
|
|
10
|
+
local STREAM_MAX_OUTPUT_BYTES = 16 * 1024 * 1024
|
|
11
|
+
|
|
12
|
+
local function SortKey(value)
|
|
13
|
+
if issecretvalue and issecretvalue(value) then
|
|
14
|
+
return "0:<secret>"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
local valueType = type(value)
|
|
18
|
+
if valueType == "number" then
|
|
19
|
+
return "1:" .. tostring(value)
|
|
20
|
+
elseif valueType == "string" then
|
|
21
|
+
return "2:" .. value
|
|
22
|
+
elseif valueType == "boolean" then
|
|
23
|
+
return value and "3:1" or "3:0"
|
|
24
|
+
end
|
|
25
|
+
return "4:" .. valueType .. ":" .. tostring(value)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
local function Append(state, text)
|
|
29
|
+
if state.truncated then
|
|
30
|
+
return
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
if state.length + #text > state.maxOutputBytes then
|
|
34
|
+
state.parts[#state.parts + 1] = "\n... <output truncated>"
|
|
35
|
+
state.truncated = true
|
|
36
|
+
state.incomplete = true
|
|
37
|
+
return
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
state.parts[#state.parts + 1] = text
|
|
41
|
+
state.length = state.length + #text
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
local function SerializeValue(value, state, depth, indent)
|
|
45
|
+
if state.truncated then
|
|
46
|
+
return
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
if issecretvalue and issecretvalue(value) then
|
|
50
|
+
Append(state, "<secret>")
|
|
51
|
+
return
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
local valueType = type(value)
|
|
55
|
+
|
|
56
|
+
if valueType == "string" then
|
|
57
|
+
Append(state, string.format("%q", value))
|
|
58
|
+
elseif valueType == "number" or valueType == "boolean" or valueType == "nil" then
|
|
59
|
+
Append(state, tostring(value))
|
|
60
|
+
elseif valueType ~= "table" then
|
|
61
|
+
Append(state, "<" .. valueType .. ": " .. tostring(value) .. ">")
|
|
62
|
+
elseif state.seen[value] then
|
|
63
|
+
Append(state, "<cycle>")
|
|
64
|
+
elseif depth >= state.maxDepth then
|
|
65
|
+
Append(state, "<max depth>")
|
|
66
|
+
state.incomplete = true
|
|
67
|
+
else
|
|
68
|
+
state.seen[value] = true
|
|
69
|
+
|
|
70
|
+
local keys = {}
|
|
71
|
+
local secretKeyCount = 0
|
|
72
|
+
for key in pairs(value) do
|
|
73
|
+
if issecretvalue and issecretvalue(key) then
|
|
74
|
+
secretKeyCount = secretKeyCount + 1
|
|
75
|
+
else
|
|
76
|
+
keys[#keys + 1] = key
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
table.sort(keys, function(left, right)
|
|
80
|
+
return SortKey(left) < SortKey(right)
|
|
81
|
+
end)
|
|
82
|
+
|
|
83
|
+
if #keys == 0 and secretKeyCount == 0 then
|
|
84
|
+
Append(state, "{}")
|
|
85
|
+
else
|
|
86
|
+
Append(state, "{")
|
|
87
|
+
local count = math.min(#keys, state.maxEntries)
|
|
88
|
+
for index = 1, count do
|
|
89
|
+
local key = keys[index]
|
|
90
|
+
Append(state, "\n" .. indent .. " [")
|
|
91
|
+
SerializeValue(key, state, depth + 1, indent .. " ")
|
|
92
|
+
Append(state, "] = ")
|
|
93
|
+
SerializeValue(value[key], state, depth + 1, indent .. " ")
|
|
94
|
+
Append(state, ",")
|
|
95
|
+
end
|
|
96
|
+
if #keys > state.maxEntries then
|
|
97
|
+
Append(state, "\n" .. indent .. " ... <" .. (#keys - state.maxEntries) .. " entries omitted>")
|
|
98
|
+
state.incomplete = true
|
|
99
|
+
end
|
|
100
|
+
if secretKeyCount > 0 then
|
|
101
|
+
Append(state, "\n" .. indent .. " ... <" .. secretKeyCount .. " secret keys omitted>")
|
|
102
|
+
end
|
|
103
|
+
Append(state, "\n" .. indent .. "}")
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
state.seen[value] = nil
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
local function SerializeWithLimits(value, maxDepth, maxEntries, maxOutputBytes)
|
|
111
|
+
local state = {
|
|
112
|
+
parts = {},
|
|
113
|
+
length = 0,
|
|
114
|
+
seen = {},
|
|
115
|
+
truncated = false,
|
|
116
|
+
incomplete = false,
|
|
117
|
+
maxDepth = maxDepth,
|
|
118
|
+
maxEntries = maxEntries,
|
|
119
|
+
maxOutputBytes = maxOutputBytes,
|
|
120
|
+
}
|
|
121
|
+
SerializeValue(value, state, 0, "")
|
|
122
|
+
return table.concat(state.parts), state.incomplete
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
function ns.Serialize(value)
|
|
126
|
+
return SerializeWithLimits(value, DEFAULT_MAX_DEPTH, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_OUTPUT_BYTES)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
function ns.SerializeValues(values)
|
|
130
|
+
local lines = {}
|
|
131
|
+
for index = 1, values.n do
|
|
132
|
+
lines[index] = "[" .. index .. "] = " .. ns.Serialize(values[index])
|
|
133
|
+
end
|
|
134
|
+
return table.concat(lines, "\n")
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
local function CreateStreamCoroutine(value, streamState)
|
|
138
|
+
return coroutine.create(function()
|
|
139
|
+
local parts = {}
|
|
140
|
+
local length = 0
|
|
141
|
+
local emitted = 0
|
|
142
|
+
local seen = {}
|
|
143
|
+
local stopped = false
|
|
144
|
+
|
|
145
|
+
local function Flush()
|
|
146
|
+
if length == 0 then
|
|
147
|
+
return
|
|
148
|
+
end
|
|
149
|
+
local text = table.concat(parts)
|
|
150
|
+
parts = {}
|
|
151
|
+
length = 0
|
|
152
|
+
emitted = emitted + #text
|
|
153
|
+
coroutine.yield(text)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
local function Emit(text)
|
|
157
|
+
if stopped then
|
|
158
|
+
return false
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
local remaining = STREAM_MAX_OUTPUT_BYTES - emitted - length
|
|
162
|
+
if #text > remaining then
|
|
163
|
+
local marker = "\n... <output limit reached>"
|
|
164
|
+
local available = math.max(0, remaining - #marker)
|
|
165
|
+
if available > 0 then
|
|
166
|
+
parts[#parts + 1] = text:sub(1, available)
|
|
167
|
+
length = length + available
|
|
168
|
+
end
|
|
169
|
+
if remaining >= #marker then
|
|
170
|
+
parts[#parts + 1] = marker
|
|
171
|
+
length = length + #marker
|
|
172
|
+
end
|
|
173
|
+
streamState.limited = true
|
|
174
|
+
stopped = true
|
|
175
|
+
return false
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
parts[#parts + 1] = text
|
|
179
|
+
length = length + #text
|
|
180
|
+
if length >= STREAM_YIELD_BYTES then
|
|
181
|
+
Flush()
|
|
182
|
+
end
|
|
183
|
+
return true
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
local SerializeStreamValue
|
|
187
|
+
SerializeStreamValue = function(current, depth, indent)
|
|
188
|
+
if stopped then
|
|
189
|
+
return
|
|
190
|
+
elseif issecretvalue and issecretvalue(current) then
|
|
191
|
+
Emit("<secret>")
|
|
192
|
+
return
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
local valueType = type(current)
|
|
196
|
+
if valueType == "string" then
|
|
197
|
+
Emit(string.format("%q", current))
|
|
198
|
+
elseif valueType == "number" or valueType == "boolean" or valueType == "nil" then
|
|
199
|
+
Emit(tostring(current))
|
|
200
|
+
elseif valueType ~= "table" then
|
|
201
|
+
Emit("<" .. valueType .. ": " .. tostring(current) .. ">")
|
|
202
|
+
elseif seen[current] then
|
|
203
|
+
Emit("<cycle>")
|
|
204
|
+
elseif depth >= STREAM_MAX_DEPTH then
|
|
205
|
+
Emit("<max depth>")
|
|
206
|
+
streamState.limited = true
|
|
207
|
+
else
|
|
208
|
+
seen[current] = true
|
|
209
|
+
local keys = {}
|
|
210
|
+
local secretKeyCount = 0
|
|
211
|
+
for key in pairs(current) do
|
|
212
|
+
if issecretvalue and issecretvalue(key) then
|
|
213
|
+
secretKeyCount = secretKeyCount + 1
|
|
214
|
+
else
|
|
215
|
+
keys[#keys + 1] = key
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
table.sort(keys, function(left, right)
|
|
219
|
+
return SortKey(left) < SortKey(right)
|
|
220
|
+
end)
|
|
221
|
+
|
|
222
|
+
if #keys == 0 and secretKeyCount == 0 then
|
|
223
|
+
Emit("{}")
|
|
224
|
+
else
|
|
225
|
+
Emit("{")
|
|
226
|
+
local count = math.min(#keys, STREAM_MAX_ENTRIES)
|
|
227
|
+
for index = 1, count do
|
|
228
|
+
if stopped then
|
|
229
|
+
break
|
|
230
|
+
end
|
|
231
|
+
local key = keys[index]
|
|
232
|
+
Emit("\n" .. indent .. " [")
|
|
233
|
+
SerializeStreamValue(key, depth + 1, indent .. " ")
|
|
234
|
+
Emit("] = ")
|
|
235
|
+
SerializeStreamValue(current[key], depth + 1, indent .. " ")
|
|
236
|
+
Emit(",")
|
|
237
|
+
end
|
|
238
|
+
if not stopped and #keys > STREAM_MAX_ENTRIES then
|
|
239
|
+
Emit("\n" .. indent .. " ... <"
|
|
240
|
+
.. (#keys - STREAM_MAX_ENTRIES) .. " entries omitted>")
|
|
241
|
+
streamState.limited = true
|
|
242
|
+
end
|
|
243
|
+
if not stopped and secretKeyCount > 0 then
|
|
244
|
+
Emit("\n" .. indent .. " ... <"
|
|
245
|
+
.. secretKeyCount .. " secret keys omitted>")
|
|
246
|
+
end
|
|
247
|
+
if not stopped then
|
|
248
|
+
Emit("\n" .. indent .. "}")
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
seen[current] = nil
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
SerializeStreamValue(value, 0, "")
|
|
256
|
+
Flush()
|
|
257
|
+
end)
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
function ns.CreateSerializationStream(value)
|
|
261
|
+
local state = { limited = false }
|
|
262
|
+
local thread = CreateStreamCoroutine(value, state)
|
|
263
|
+
local stream = {
|
|
264
|
+
finished = false,
|
|
265
|
+
pending = "",
|
|
266
|
+
state = state,
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function stream:ReadChunk(maxBytes)
|
|
270
|
+
maxBytes = math.max(1, math.floor(tonumber(maxBytes) or STREAM_CHUNK_BYTES))
|
|
271
|
+
local output = {}
|
|
272
|
+
local outputLength = 0
|
|
273
|
+
|
|
274
|
+
while outputLength < maxBytes and (self.pending ~= "" or not self.finished) do
|
|
275
|
+
if self.pending == "" then
|
|
276
|
+
local succeeded, segment = coroutine.resume(thread)
|
|
277
|
+
if not succeeded then
|
|
278
|
+
self.finished = true
|
|
279
|
+
self.state.limited = true
|
|
280
|
+
self.errorMessage = tostring(segment)
|
|
281
|
+
break
|
|
282
|
+
elseif coroutine.status(thread) == "dead" then
|
|
283
|
+
self.finished = true
|
|
284
|
+
break
|
|
285
|
+
end
|
|
286
|
+
self.pending = segment or ""
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
if self.pending ~= "" then
|
|
290
|
+
local take = math.min(#self.pending, maxBytes - outputLength)
|
|
291
|
+
output[#output + 1] = self.pending:sub(1, take)
|
|
292
|
+
self.pending = self.pending:sub(take + 1)
|
|
293
|
+
outputLength = outputLength + take
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
return table.concat(output), self.finished and self.pending == ""
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
function stream:IsFinished()
|
|
301
|
+
return self.finished and self.pending == ""
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
function stream:WasLimited()
|
|
305
|
+
return self.state.limited
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
return stream
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
function ns.SerializeForExport(value)
|
|
312
|
+
local stream = ns.CreateSerializationStream(value)
|
|
313
|
+
local parts = {}
|
|
314
|
+
repeat
|
|
315
|
+
local chunk = stream:ReadChunk()
|
|
316
|
+
if chunk ~= "" then
|
|
317
|
+
parts[#parts + 1] = chunk
|
|
318
|
+
end
|
|
319
|
+
until stream:IsFinished()
|
|
320
|
+
if stream.errorMessage then
|
|
321
|
+
error(stream.errorMessage, 0)
|
|
322
|
+
end
|
|
323
|
+
return table.concat(parts), stream:WasLimited(), stream.errorMessage
|
|
324
|
+
end
|