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,289 +0,0 @@
|
|
|
1
|
-
local ADDON_NAME, ns = ...
|
|
2
|
-
local L = ns.L
|
|
3
|
-
|
|
4
|
-
local ERROR_ROW_HEIGHT = 44
|
|
5
|
-
local ERROR_LIST_WIDTH = 430
|
|
6
|
-
local VISIBLE_ROWS = 16
|
|
7
|
-
|
|
8
|
-
local function SetReadOnlyText(panel, text, selectAll)
|
|
9
|
-
local editBox = panel.editBox
|
|
10
|
-
editBox.savedText, editBox.updatingText = text or "", true
|
|
11
|
-
editBox:SetText(text or "")
|
|
12
|
-
editBox.updatingText = nil
|
|
13
|
-
editBox:SetCursorPosition(0)
|
|
14
|
-
panel.scroll:SetVerticalScroll(0)
|
|
15
|
-
if selectAll then
|
|
16
|
-
editBox:SetFocus()
|
|
17
|
-
editBox:HighlightText()
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
local function CreateLineInput(parent, ui)
|
|
22
|
-
local panel = ui.CreatePanel(parent, ui.editorR, ui.editorG, ui.editorB, 1)
|
|
23
|
-
local editBox = CreateFrame("EditBox", nil, panel)
|
|
24
|
-
editBox:SetAutoFocus(false)
|
|
25
|
-
editBox:SetFontObject(ChatFontNormal)
|
|
26
|
-
editBox:SetTextColor(0.94, 0.95, 0.96)
|
|
27
|
-
editBox:SetTextInsets(9, 9, 0, 0)
|
|
28
|
-
editBox:SetPoint("TOPLEFT", 1, -1)
|
|
29
|
-
editBox:SetPoint("BOTTOMRIGHT", -1, 1)
|
|
30
|
-
editBox:SetScript("OnEscapePressed", function(self) self:ClearFocus() end)
|
|
31
|
-
editBox:SetScript("OnEditFocusGained", function() ui.SetBorderColor(panel, true, 0.75) end)
|
|
32
|
-
editBox:SetScript("OnEditFocusLost", function() ui.SetBorderColor(panel, false) end)
|
|
33
|
-
panel.editBox = editBox
|
|
34
|
-
return panel
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
function ns.CreateDiagnosticsPage(parent, ui)
|
|
38
|
-
local page = CreateFrame("Frame", nil, parent)
|
|
39
|
-
page:SetAllPoints(parent)
|
|
40
|
-
|
|
41
|
-
local refreshButton = ui.CreateButton(page, 92, L.REFRESH, false)
|
|
42
|
-
refreshButton:SetPoint("TOPRIGHT", -14, -84)
|
|
43
|
-
local clearButton = ui.CreateButton(page, 178, L.CLEAR_ERRORS, false)
|
|
44
|
-
clearButton:SetPoint("RIGHT", refreshButton, "LEFT", -8, 0)
|
|
45
|
-
|
|
46
|
-
local status = page:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
|
47
|
-
status:SetPoint("TOPLEFT", 17, -94)
|
|
48
|
-
status:SetPoint("RIGHT", clearButton, "LEFT", -10, 0)
|
|
49
|
-
status:SetJustifyH("LEFT")
|
|
50
|
-
local function SetStatus(text, errorState)
|
|
51
|
-
local r = errorState and ui.accentR or 0.55
|
|
52
|
-
local g = errorState and ui.accentG or 0.60
|
|
53
|
-
local b = errorState and ui.accentB or 0.65
|
|
54
|
-
status:SetText(text or "")
|
|
55
|
-
status:SetTextColor(r, g, b, 0.92)
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
local errorsView = CreateFrame("Frame", nil, page)
|
|
59
|
-
errorsView:SetPoint("TOPLEFT", 0, -126)
|
|
60
|
-
errorsView:SetPoint("BOTTOMRIGHT")
|
|
61
|
-
|
|
62
|
-
local currentScope = ui.CreateButton(errorsView, 104, L.CURRENT_SESSION, "selected")
|
|
63
|
-
currentScope:SetPoint("TOPLEFT", 14, 0)
|
|
64
|
-
local allScope = ui.CreateButton(errorsView, 104, L.ALL_SESSIONS, false)
|
|
65
|
-
allScope:SetPoint("LEFT", currentScope, "RIGHT", 8, 0)
|
|
66
|
-
local searchPanel = CreateLineInput(errorsView, ui)
|
|
67
|
-
searchPanel:SetPoint("TOPLEFT", allScope, "TOPRIGHT", 14, 0)
|
|
68
|
-
searchPanel:SetWidth(260)
|
|
69
|
-
searchPanel:SetHeight(28)
|
|
70
|
-
local searchButton = ui.CreateButton(errorsView, 76, L.SEARCH, false)
|
|
71
|
-
searchButton:SetPoint("LEFT", searchPanel, "RIGHT", 8, 0)
|
|
72
|
-
local selectReport = ui.CreateButton(errorsView, 110, L.SELECT_REPORT, false)
|
|
73
|
-
selectReport:SetPoint("TOPRIGHT", -14, 0)
|
|
74
|
-
local exportReport = ui.CreateButton(errorsView, 92, L.SAVE_TO_DISK, false)
|
|
75
|
-
exportReport:SetPoint("RIGHT", selectReport, "LEFT", -8, 0)
|
|
76
|
-
page.currentScope = currentScope
|
|
77
|
-
page.allScope = allScope
|
|
78
|
-
page.refreshButton = refreshButton
|
|
79
|
-
page.clearButton = clearButton
|
|
80
|
-
page.selectReport = selectReport
|
|
81
|
-
page.exportReport = exportReport
|
|
82
|
-
|
|
83
|
-
local listLabel = ui.CreateSectionLabel(errorsView, L.ERROR_LIST)
|
|
84
|
-
listLabel:SetPoint("TOPLEFT", 17, -48)
|
|
85
|
-
local reportLabel = ui.CreateSectionLabel(errorsView, L.AGENT_REPORT)
|
|
86
|
-
reportLabel:SetPoint("TOPLEFT", ERROR_LIST_WIDTH + 29, -48)
|
|
87
|
-
|
|
88
|
-
local listPanel = ui.CreatePanel(errorsView, ui.editorR, ui.editorG, ui.editorB, 0.78)
|
|
89
|
-
listPanel:SetPoint("TOPLEFT", 14, -68)
|
|
90
|
-
listPanel:SetPoint("BOTTOMLEFT", 14, 54)
|
|
91
|
-
listPanel:SetWidth(ERROR_LIST_WIDTH)
|
|
92
|
-
local errorScroll = ui.CreateScrollArea(listPanel, 8, 8, 7, 8)
|
|
93
|
-
local errorContent = CreateFrame("Frame", nil, errorScroll)
|
|
94
|
-
errorContent:SetWidth(ERROR_LIST_WIDTH - 26)
|
|
95
|
-
errorContent:SetHeight(1)
|
|
96
|
-
errorScroll:SetScrollChild(errorContent)
|
|
97
|
-
local errorEmpty = listPanel:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
98
|
-
errorEmpty:SetPoint("TOP", 0, -24)
|
|
99
|
-
errorEmpty:SetText(L.NO_ERRORS)
|
|
100
|
-
errorEmpty:SetTextColor(1, 1, 1, 0.32)
|
|
101
|
-
|
|
102
|
-
local reportPanel = ui.CreateTextArea(errorsView, true)
|
|
103
|
-
reportPanel:SetPoint("TOPLEFT", ERROR_LIST_WIDTH + 26, -68)
|
|
104
|
-
reportPanel:SetPoint("BOTTOMRIGHT", -14, 54)
|
|
105
|
-
reportPanel.editBox:SetWidth(ui.windowWidth - ERROR_LIST_WIDTH - 78)
|
|
106
|
-
reportPanel.editBox:SetScript("OnMouseUp", function(self)
|
|
107
|
-
self:SetFocus()
|
|
108
|
-
end)
|
|
109
|
-
SetReadOnlyText(reportPanel, L.SELECT_ERROR_DETAIL)
|
|
110
|
-
|
|
111
|
-
local errors = {}
|
|
112
|
-
local selectedError
|
|
113
|
-
local errorRows = {}
|
|
114
|
-
local scope = "current"
|
|
115
|
-
local confirmClear = false
|
|
116
|
-
local callbackOwner = {}
|
|
117
|
-
local callbackRegistered = false
|
|
118
|
-
local refreshQueued = false
|
|
119
|
-
|
|
120
|
-
local function ApplyErrorRowStyle(row)
|
|
121
|
-
local selected = row.errorEntry == selectedError
|
|
122
|
-
ui.SetListRowState(row, selected, row.isHovered)
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
local function CreateErrorRow(index)
|
|
126
|
-
local row = ui.CreateListRow(errorContent, ERROR_ROW_HEIGHT)
|
|
127
|
-
row:SetWidth(ERROR_LIST_WIDTH - 26)
|
|
128
|
-
local message = row:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
|
129
|
-
message:SetPoint("TOPLEFT", 9, -6)
|
|
130
|
-
message:SetPoint("TOPRIGHT", -54, -6)
|
|
131
|
-
message:SetJustifyH("LEFT")
|
|
132
|
-
message:SetWordWrap(false)
|
|
133
|
-
row.message = message
|
|
134
|
-
local count = row:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
135
|
-
count:SetPoint("TOPRIGHT", -9, -6)
|
|
136
|
-
count:SetTextColor(1, 1, 1, 0.42)
|
|
137
|
-
row.count = count
|
|
138
|
-
local metadata = row:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
139
|
-
metadata:SetPoint("BOTTOMLEFT", 9, 5)
|
|
140
|
-
metadata:SetPoint("BOTTOMRIGHT", -9, 5)
|
|
141
|
-
metadata:SetJustifyH("LEFT")
|
|
142
|
-
metadata:SetWordWrap(false)
|
|
143
|
-
metadata:SetTextColor(1, 1, 1, 0.34)
|
|
144
|
-
row.metadata = metadata
|
|
145
|
-
row:SetScript("OnEnter", function(self)
|
|
146
|
-
self.isHovered = true
|
|
147
|
-
ApplyErrorRowStyle(self)
|
|
148
|
-
end)
|
|
149
|
-
row:SetScript("OnLeave", function(self)
|
|
150
|
-
self.isHovered = nil
|
|
151
|
-
ApplyErrorRowStyle(self)
|
|
152
|
-
end)
|
|
153
|
-
row:SetScript("OnClick", function(self)
|
|
154
|
-
selectedError = self.errorEntry
|
|
155
|
-
SetReadOnlyText(reportPanel, ns.Diagnostics.FormatAgentReport(selectedError))
|
|
156
|
-
page:RefreshErrors()
|
|
157
|
-
end)
|
|
158
|
-
errorRows[index] = row
|
|
159
|
-
return row
|
|
160
|
-
end
|
|
161
|
-
|
|
162
|
-
function page:RefreshErrors()
|
|
163
|
-
for index = 1, #errorRows do errorRows[index]:Hide() end
|
|
164
|
-
local offset = errorScroll:GetVerticalScroll()
|
|
165
|
-
if issecretvalue and issecretvalue(offset) then offset = 0 end
|
|
166
|
-
local first = math.floor((offset or 0) / ERROR_ROW_HEIGHT) + 1
|
|
167
|
-
local last = math.min(#errors, first + VISIBLE_ROWS - 1)
|
|
168
|
-
local pool = 0
|
|
169
|
-
for itemIndex = first, last do
|
|
170
|
-
pool = pool + 1
|
|
171
|
-
local entry = errors[itemIndex]
|
|
172
|
-
local row = errorRows[pool] or CreateErrorRow(pool)
|
|
173
|
-
row.errorEntry = entry
|
|
174
|
-
row:ClearAllPoints()
|
|
175
|
-
row:SetPoint("TOPLEFT", 0, -((itemIndex - 1) * ERROR_ROW_HEIGHT))
|
|
176
|
-
row.message:SetText((tostring(entry.message or "")):match("([^\r\n]+)") or L.UNKNOWN_ERROR)
|
|
177
|
-
row.count:SetText("x" .. (tonumber(entry.counter) or 1))
|
|
178
|
-
row.metadata:SetText(string.format(L.ERROR_ROW_META,
|
|
179
|
-
tonumber(entry.session) or -1,
|
|
180
|
-
tonumber(entry.time) and date("%m-%d %H:%M:%S", entry.time) or L.UNKNOWN_TIME))
|
|
181
|
-
ApplyErrorRowStyle(row)
|
|
182
|
-
row:Show()
|
|
183
|
-
end
|
|
184
|
-
errorContent:SetHeight(math.max(1, #errors * ERROR_ROW_HEIGHT))
|
|
185
|
-
errorScroll:UpdateScrollChildRect()
|
|
186
|
-
errorEmpty:SetShown(#errors == 0)
|
|
187
|
-
ui.SetButtonEnabled(clearButton, #errors > 0)
|
|
188
|
-
ui.SetButtonEnabled(selectReport, selectedError ~= nil)
|
|
189
|
-
ui.SetButtonEnabled(exportReport, #errors > 0)
|
|
190
|
-
end
|
|
191
|
-
|
|
192
|
-
local function RefreshErrorsFromSource()
|
|
193
|
-
confirmClear = false
|
|
194
|
-
ui.SetButtonText(clearButton, L.CLEAR_ERRORS)
|
|
195
|
-
ui.SetButtonVariant(clearButton, "secondary")
|
|
196
|
-
local succeeded, snapshot, errorMessage = ns.Diagnostics.GetErrors(scope, searchPanel.editBox:GetText())
|
|
197
|
-
if not succeeded then
|
|
198
|
-
SetStatus(errorMessage, true)
|
|
199
|
-
return
|
|
200
|
-
end
|
|
201
|
-
errors = snapshot.errors
|
|
202
|
-
selectedError = nil
|
|
203
|
-
SetReadOnlyText(reportPanel, L.SELECT_ERROR_DETAIL)
|
|
204
|
-
SetStatus(string.format(scope == "current" and L.CURRENT_ERRORS_STATUS or L.ALL_ERRORS_STATUS, #errors), false)
|
|
205
|
-
page:RefreshErrors()
|
|
206
|
-
end
|
|
207
|
-
|
|
208
|
-
local function SetScope(newScope)
|
|
209
|
-
scope = newScope
|
|
210
|
-
ui.SetButtonVariant(currentScope, scope == "current" and "selected" or "secondary")
|
|
211
|
-
ui.SetButtonVariant(allScope, scope == "all" and "selected" or "secondary")
|
|
212
|
-
RefreshErrorsFromSource()
|
|
213
|
-
end
|
|
214
|
-
|
|
215
|
-
local function QueueErrorRefresh()
|
|
216
|
-
if refreshQueued then return end
|
|
217
|
-
refreshQueued = true
|
|
218
|
-
C_Timer.After(0, function()
|
|
219
|
-
refreshQueued = false
|
|
220
|
-
if page:IsShown() then
|
|
221
|
-
RefreshErrorsFromSource()
|
|
222
|
-
end
|
|
223
|
-
end)
|
|
224
|
-
end
|
|
225
|
-
|
|
226
|
-
local function RegisterErrorCallback()
|
|
227
|
-
if callbackRegistered or not EventRegistry then return end
|
|
228
|
-
EventRegistry:RegisterCallback("BugGrabber.BugGrabbed", QueueErrorRefresh, callbackOwner)
|
|
229
|
-
callbackRegistered = true
|
|
230
|
-
end
|
|
231
|
-
|
|
232
|
-
local function UnregisterErrorCallback()
|
|
233
|
-
if not callbackRegistered or not EventRegistry then return end
|
|
234
|
-
EventRegistry:UnregisterCallback("BugGrabber.BugGrabbed", callbackOwner)
|
|
235
|
-
callbackRegistered = false
|
|
236
|
-
end
|
|
237
|
-
|
|
238
|
-
errorScroll.onVerticalScrollChanged = function() page:RefreshErrors() end
|
|
239
|
-
currentScope:SetScript("OnClick", function() SetScope("current") end)
|
|
240
|
-
allScope:SetScript("OnClick", function() SetScope("all") end)
|
|
241
|
-
searchButton:SetScript("OnClick", RefreshErrorsFromSource)
|
|
242
|
-
searchPanel.editBox:SetScript("OnEnterPressed", RefreshErrorsFromSource)
|
|
243
|
-
selectReport:SetScript("OnClick", function()
|
|
244
|
-
if selectedError then
|
|
245
|
-
SetReadOnlyText(reportPanel, ns.Diagnostics.FormatAgentReport(selectedError))
|
|
246
|
-
reportPanel:SelectAll()
|
|
247
|
-
else
|
|
248
|
-
SetStatus(L.SELECT_ERROR_FIRST, true)
|
|
249
|
-
end
|
|
250
|
-
end)
|
|
251
|
-
exportReport:SetScript("OnClick", function()
|
|
252
|
-
if #errors > 0 then
|
|
253
|
-
ui.ExportText("error_log", L.ERROR_LIST, function()
|
|
254
|
-
return ns.SerializeForExport(errors)
|
|
255
|
-
end, { scope = scope, query = searchPanel.editBox:GetText(), recordCount = #errors })
|
|
256
|
-
else
|
|
257
|
-
SetStatus(L.NO_ERRORS, true)
|
|
258
|
-
end
|
|
259
|
-
end)
|
|
260
|
-
refreshButton:SetScript("OnClick", RefreshErrorsFromSource)
|
|
261
|
-
clearButton:SetScript("OnClick", function()
|
|
262
|
-
if not confirmClear then
|
|
263
|
-
confirmClear = true
|
|
264
|
-
ui.SetButtonText(clearButton, L.CONFIRM_CLEAR_ERRORS)
|
|
265
|
-
ui.SetButtonVariant(clearButton, "danger")
|
|
266
|
-
SetStatus(L.CONFIRM_CLEAR_ERRORS, true)
|
|
267
|
-
return
|
|
268
|
-
end
|
|
269
|
-
local succeeded, message = ns.Diagnostics.ResetErrors()
|
|
270
|
-
SetStatus(message, not succeeded)
|
|
271
|
-
if succeeded then RefreshErrorsFromSource() end
|
|
272
|
-
end)
|
|
273
|
-
|
|
274
|
-
page:SetScript("OnShow", RegisterErrorCallback)
|
|
275
|
-
page:SetScript("OnHide", UnregisterErrorCallback)
|
|
276
|
-
|
|
277
|
-
function page:Activate()
|
|
278
|
-
RefreshErrorsFromSource()
|
|
279
|
-
end
|
|
280
|
-
function page:Stop()
|
|
281
|
-
UnregisterErrorCallback()
|
|
282
|
-
end
|
|
283
|
-
|
|
284
|
-
ui.SetButtonEnabled(clearButton, false)
|
|
285
|
-
ui.SetButtonEnabled(selectReport, false)
|
|
286
|
-
ui.SetButtonEnabled(exportReport, false)
|
|
287
|
-
SetStatus(L.READY, false)
|
|
288
|
-
return page
|
|
289
|
-
end
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
local ADDON_NAME, ns = ...
|
|
2
|
-
local L = ns.L
|
|
3
|
-
|
|
4
|
-
local ROW_HEIGHT = 38
|
|
5
|
-
local LIST_WIDTH = 520
|
|
6
|
-
local VISIBLE_ROWS = 18
|
|
7
|
-
|
|
8
|
-
local function SetReadOnlyText(panel, text)
|
|
9
|
-
local editBox = panel.editBox
|
|
10
|
-
editBox.savedText, editBox.updatingText = text or "", true
|
|
11
|
-
editBox:SetText(text or "")
|
|
12
|
-
editBox.updatingText = nil
|
|
13
|
-
editBox:SetCursorPosition(0)
|
|
14
|
-
panel.scroll:SetVerticalScroll(0)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
local function CreateLineInput(parent, ui)
|
|
18
|
-
local panel = ui.CreatePanel(parent, ui.editorR, ui.editorG, ui.editorB, 1)
|
|
19
|
-
local editBox = CreateFrame("EditBox", nil, panel)
|
|
20
|
-
editBox:SetAutoFocus(false)
|
|
21
|
-
editBox:SetFontObject(ChatFontNormal)
|
|
22
|
-
editBox:SetTextColor(0.94, 0.95, 0.96)
|
|
23
|
-
editBox:SetTextInsets(9, 9, 0, 0)
|
|
24
|
-
editBox:SetPoint("TOPLEFT", 1, -1)
|
|
25
|
-
editBox:SetPoint("BOTTOMRIGHT", -1, 1)
|
|
26
|
-
editBox:SetScript("OnEscapePressed", function(self) self:ClearFocus() end)
|
|
27
|
-
panel.editBox = editBox
|
|
28
|
-
return panel
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
function ns.CreateTracePage(parent, ui)
|
|
32
|
-
local page = CreateFrame("Frame", nil, parent)
|
|
33
|
-
page:SetAllPoints(parent)
|
|
34
|
-
local input = CreateLineInput(page, ui)
|
|
35
|
-
input:SetPoint("TOPLEFT", 14, -84)
|
|
36
|
-
input:SetPoint("TOPRIGHT", -250, -84)
|
|
37
|
-
input:SetHeight(30)
|
|
38
|
-
input.editBox:SetText("C_AddOns.GetAddOnInfo")
|
|
39
|
-
local traceButton = ui.CreateButton(page, 112, L.START_TRACE, true)
|
|
40
|
-
traceButton:SetPoint("TOPRIGHT", -14, -84)
|
|
41
|
-
local clear = ui.CreateButton(page, 100, L.CLEAR_LOG, false)
|
|
42
|
-
clear:SetPoint("RIGHT", traceButton, "LEFT", -8, 0)
|
|
43
|
-
page.traceButton = traceButton
|
|
44
|
-
page.clearButton = clear
|
|
45
|
-
|
|
46
|
-
local dot = page:CreateTexture(nil, "ARTWORK")
|
|
47
|
-
dot:SetSize(5, 5)
|
|
48
|
-
dot:SetPoint("TOPLEFT", input, "BOTTOMLEFT", 2, -15)
|
|
49
|
-
local status = page:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
|
50
|
-
status:SetPoint("LEFT", dot, "RIGHT", 7, 0)
|
|
51
|
-
local function SetStatus(text, r, g, b)
|
|
52
|
-
status:SetText(text) status:SetTextColor(r, g, b, 0.92) dot:SetColorTexture(r, g, b, 0.92)
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
local listLabel = ui.CreateSectionLabel(page, L.CALL_RECORDS)
|
|
56
|
-
listLabel:SetPoint("TOPLEFT", 17, -152)
|
|
57
|
-
local detailLabel = ui.CreateSectionLabel(page, L.CALL_ARGUMENTS)
|
|
58
|
-
detailLabel:SetPoint("TOPLEFT", LIST_WIDTH + 29, -152)
|
|
59
|
-
local listPanel = ui.CreatePanel(page, ui.editorR, ui.editorG, ui.editorB, 0.78)
|
|
60
|
-
listPanel:SetPoint("TOPLEFT", 14, -172)
|
|
61
|
-
listPanel:SetPoint("BOTTOMLEFT", 14, 54)
|
|
62
|
-
listPanel:SetWidth(LIST_WIDTH)
|
|
63
|
-
local scroll = ui.CreateScrollArea(listPanel, 8, 8, 7, 8)
|
|
64
|
-
local content = CreateFrame("Frame", nil, scroll)
|
|
65
|
-
content:SetWidth(LIST_WIDTH - 26) content:SetHeight(1) scroll:SetScrollChild(content)
|
|
66
|
-
local empty = listPanel:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
67
|
-
empty:SetPoint("TOP", 0, -24) empty:SetText(L.NO_CALLS_CAPTURED) empty:SetTextColor(1, 1, 1, 0.32)
|
|
68
|
-
local selected
|
|
69
|
-
local Format
|
|
70
|
-
local detail = ui.CreateTextArea(page, true)
|
|
71
|
-
detail:SetPoint("TOPLEFT", LIST_WIDTH + 26, -172)
|
|
72
|
-
detail:SetPoint("BOTTOMRIGHT", -14, 54)
|
|
73
|
-
detail.editBox:SetWidth(ui.windowWidth - LIST_WIDTH - 78)
|
|
74
|
-
SetReadOnlyText(detail, L.SELECT_CALL_DETAIL)
|
|
75
|
-
|
|
76
|
-
local exportDetail = ui.CreateButton(page, 92, L.SAVE_TO_DISK, false)
|
|
77
|
-
exportDetail:SetPoint("BOTTOMRIGHT", -14, 14)
|
|
78
|
-
exportDetail:SetScript("OnClick", function()
|
|
79
|
-
local recordCount = ns.FunctionTrace.GetCount()
|
|
80
|
-
if recordCount > 0 then
|
|
81
|
-
ui.ExportText("function_trace", L.CALL_RECORDS, function()
|
|
82
|
-
local records = {}
|
|
83
|
-
for index = 1, recordCount do
|
|
84
|
-
records[index] = ns.FunctionTrace.GetRecord(index)
|
|
85
|
-
end
|
|
86
|
-
return ns.SerializeForExport(records)
|
|
87
|
-
end, { recordCount = recordCount })
|
|
88
|
-
end
|
|
89
|
-
end)
|
|
90
|
-
page.exportDetail = exportDetail
|
|
91
|
-
|
|
92
|
-
local rows, refreshQueued = {}, false
|
|
93
|
-
local function SyncTraceButton()
|
|
94
|
-
local running = ns.FunctionTrace.IsRunning()
|
|
95
|
-
ui.SetButtonText(traceButton, running and L.STOP_TRACE or L.START_TRACE)
|
|
96
|
-
ui.SetButtonVariant(traceButton, running and "danger" or "primary")
|
|
97
|
-
end
|
|
98
|
-
Format = function(record)
|
|
99
|
-
if not record then return L.SELECT_CALL_DETAIL end
|
|
100
|
-
local lines = { string.format(L.TRACE_PATH, record.path), string.format(L.ELAPSED_DETAIL, record.elapsed), "" }
|
|
101
|
-
if #record.arguments == 0 then lines[#lines + 1] = L.NO_ARGUMENTS end
|
|
102
|
-
for index = 1, #record.arguments do lines[#lines + 1] = "[" .. index .. "] = " .. record.arguments[index] end
|
|
103
|
-
return table.concat(lines, "\n")
|
|
104
|
-
end
|
|
105
|
-
local function CreateRow(index)
|
|
106
|
-
local row = ui.CreateListRow(content, ROW_HEIGHT)
|
|
107
|
-
row:SetWidth(LIST_WIDTH - 26)
|
|
108
|
-
local elapsed = row:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
109
|
-
elapsed:SetPoint("LEFT", 8, 0) elapsed:SetWidth(62) elapsed:SetJustifyH("LEFT") elapsed:SetTextColor(1, 1, 1, 0.38) row.elapsed = elapsed
|
|
110
|
-
local name = row:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
|
111
|
-
name:SetPoint("TOPLEFT", 72, -5) name:SetPoint("TOPRIGHT", -8, -5) name:SetJustifyH("LEFT") name:SetWordWrap(false) row.name = name
|
|
112
|
-
local summary = row:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
113
|
-
summary:SetPoint("BOTTOMLEFT", 72, 5) summary:SetPoint("BOTTOMRIGHT", -8, 5) summary:SetJustifyH("LEFT") summary:SetWordWrap(false) summary:SetTextColor(1, 1, 1, 0.38) row.summary = summary
|
|
114
|
-
row:SetScript("OnEnter", function(self) self.isHovered = true ui.SetListRowState(self, self.record == selected, true) end)
|
|
115
|
-
row:SetScript("OnLeave", function(self) self.isHovered = nil ui.SetListRowState(self, self.record == selected, false) end)
|
|
116
|
-
row:SetScript("OnClick", function(self) selected = self.record SetReadOnlyText(detail, Format(selected)) page:Refresh() end)
|
|
117
|
-
rows[index] = row return row
|
|
118
|
-
end
|
|
119
|
-
function page:Refresh()
|
|
120
|
-
for index = 1, #rows do rows[index]:Hide() end
|
|
121
|
-
local recordCount = ns.FunctionTrace.GetCount()
|
|
122
|
-
ui.SetButtonEnabled(clear, recordCount > 0)
|
|
123
|
-
ui.SetButtonEnabled(exportDetail, recordCount > 0)
|
|
124
|
-
local offset = scroll:GetVerticalScroll() if issecretvalue and issecretvalue(offset) then offset = 0 end
|
|
125
|
-
local first = math.floor((offset or 0) / ROW_HEIGHT) + 1
|
|
126
|
-
local last, pool = math.min(recordCount, first + VISIBLE_ROWS - 1), 0
|
|
127
|
-
for recordIndex = first, last do
|
|
128
|
-
pool = pool + 1
|
|
129
|
-
local record = ns.FunctionTrace.GetRecord(recordIndex)
|
|
130
|
-
local row = rows[pool] or CreateRow(pool)
|
|
131
|
-
row.record = record row:ClearAllPoints() row:SetPoint("TOPLEFT", 0, -((recordIndex - 1) * ROW_HEIGHT))
|
|
132
|
-
row.elapsed:SetText(string.format("+%.2fs", record.elapsed)) row.name:SetText(record.path) row.summary:SetText(record.summary ~= "" and record.summary or L.NO_ARGUMENTS)
|
|
133
|
-
ui.SetListRowState(row, record == selected, row.isHovered) row:Show()
|
|
134
|
-
end
|
|
135
|
-
content:SetHeight(math.max(1, recordCount * ROW_HEIGHT)) scroll:UpdateScrollChildRect() empty:SetShown(recordCount == 0)
|
|
136
|
-
end
|
|
137
|
-
scroll.onVerticalScrollChanged = function() page:Refresh() end
|
|
138
|
-
local function QueueRefresh()
|
|
139
|
-
if refreshQueued then return end
|
|
140
|
-
refreshQueued = true
|
|
141
|
-
C_Timer.After(0, function() refreshQueued = false if page:IsShown() then page:Refresh() end end)
|
|
142
|
-
end
|
|
143
|
-
traceButton:SetScript("OnClick", function()
|
|
144
|
-
if ns.FunctionTrace.IsRunning() then
|
|
145
|
-
ns.FunctionTrace.Stop()
|
|
146
|
-
SetStatus(L.STOPPED, 0.55, 0.60, 0.65)
|
|
147
|
-
SyncTraceButton()
|
|
148
|
-
return
|
|
149
|
-
end
|
|
150
|
-
|
|
151
|
-
local succeeded, errorMessage = ns.FunctionTrace.Start(input.editBox:GetText(), QueueRefresh)
|
|
152
|
-
SetStatus(succeeded and string.format(L.TRACING_FUNCTION, ns.FunctionTrace.GetActivePath()) or errorMessage, succeeded and 0.42 or ui.accentR, succeeded and 0.76 or ui.accentG, succeeded and 0.43 or ui.accentB)
|
|
153
|
-
SyncTraceButton()
|
|
154
|
-
end)
|
|
155
|
-
clear:SetScript("OnClick", function() ns.FunctionTrace.Clear() selected = nil SetReadOnlyText(detail, L.SELECT_CALL_DETAIL) page:Refresh() end)
|
|
156
|
-
input.editBox:SetScript("OnEnterPressed", function() traceButton:Click() end)
|
|
157
|
-
function page:Activate() input.editBox:SetFocus() page:Refresh() end
|
|
158
|
-
function page:Stop()
|
|
159
|
-
ns.FunctionTrace.Stop()
|
|
160
|
-
SetStatus(L.STOPPED, 0.55, 0.60, 0.65)
|
|
161
|
-
SyncTraceButton()
|
|
162
|
-
end
|
|
163
|
-
SetStatus(L.STOPPED, 0.55, 0.60, 0.65) SyncTraceButton() page:Refresh()
|
|
164
|
-
return page
|
|
165
|
-
end
|
package/vendor/skill/SKILL.md
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: lychee-dev
|
|
3
|
-
description: 编排 Lychee Dev 的 WoW 后台自动化任务、错误快照、二维码回执和 SavedVariables Ticket 读取;也用于有界 Run 性能调查、对象检查与事件监控。不用于无关插件实现或通用 WoW API 查询。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Lychee Dev
|
|
7
|
-
|
|
8
|
-
把用户的调查问题变成完整、可追溯的游戏运行证据。已获授权的自动化应连续完成发送、读取、确认和收尾,不能停在“已发送”、二维码出现或脚本生成。
|
|
9
|
-
|
|
10
|
-
## 按任务读取资料
|
|
11
|
-
|
|
12
|
-
- 要操作正在运行的游戏:先读 [clients.md](references/clients.md),确定版本、实例和安装位置。
|
|
13
|
-
- 要执行自动任务、获取最近 n 条错误、ACK 或恢复中断:读 [automation.md](references/automation.md),按其闭环继续到完成。
|
|
14
|
-
- 设计内存/CPU 调查:另读 [runtime-investigations.md](references/runtime-investigations.md)。只读已有 Ticket 不需要准备新探针。
|
|
15
|
-
|
|
16
|
-
## 默认后台通路
|
|
17
|
-
|
|
18
|
-
使用随 Skill 附带的 `scripts/automation.py`。发送显式传 `--mode messages`,通过 PostMessage 投递到绑定的 HWND;WGC 直接捕获窗口,zxing-cpp 解码。两者都不要求窗口获得前台焦点,不使用 GDI 截屏,也不需要剪贴板。不要自行换成 SetForegroundWindow、SendInput、点击聊天框或要求用户粘贴。
|
|
19
|
-
|
|
20
|
-
工具仍保留显式 `foreground` 模式;它不是后台通路的自动降级方案。后台异常时检查状态和证据,不把失败直接转成人工提交。用户明确选择人工 Run 时,才按该方式组织。
|
|
21
|
-
|
|
22
|
-
无焦点要求不等于所有窗口状态都可用:最小化、客户端切换、战斗、尚未载入世界、其他游戏编辑框和自定义聊天键位可能影响操作。只报告本次实际验证的客户端/版本/状态。消息成功入队不证明游戏执行;二维码出现不证明 SV 已落盘。
|
|
23
|
-
|
|
24
|
-
## 完成标准
|
|
25
|
-
|
|
26
|
-
一次自动调查需要取得匹配 task/requestId/Ticket 的完整报告,核对身份与校验信息、保存证据、确认 ACK,并完成该回执的界面清理。未完成的阶段必须明确说明。不要为了清理画面重跑任务。
|
|
27
|
-
|
|
28
|
-
- 接收已有 Ticket:先找精确记录,禁止重新执行原任务来“获取同样结果”。
|
|
29
|
-
- 新任务:只在目标安装目录 `Modules/Automation/auto/auto.lua` 更新自己拥有的 task-id 区块;同一次逻辑执行保持 requestId 不变。
|
|
30
|
-
- 错误调查:`bugs --count n` 获取最多 n 条已有错误,不制造新错误填满数量。
|
|
31
|
-
- 完整内容始终走 SV;超过 10 KB 不切换传输方式,不把正文塞进二维码。
|
|
32
|
-
- 测试也是完整工作:每个用例结束或中断时处理自己留下的草稿、回执与任务块,再报告状态;不要在没有解释的情况下留在下一用例的中间步骤。
|
|
33
|
-
|
|
34
|
-
保留当前会话已给出的授权,不重复请求常规步骤确认。调查授权不意味着可覆盖其他任务、重置数据库或发布插件;共享游戏实例存在实际占用时先协调。
|
|
35
|
-
|
|
36
|
-
## 已有证据与人工工具
|
|
37
|
-
|
|
38
|
-
SV 是数据:用受限解析器读取,不能在宿主执行 Lua。主记录位于 `LycheeDevDB.exports.records[TICKET]`,完整内容是 `payload.content`;`history` 与 metadata 都不能代替完整报告。未知/较新字段应保留,已有旧性能记录仍可作为历史证据。
|
|
39
|
-
|
|
40
|
-
用户选择手动操作时:Run 支持 `/run` 或 `/script` 和 Lua 5.1;异步调查使用验证过的完成写入机制。对象检查走 `/dev > Objects`,事件监控走 `/dev > Events`。没有独立 `/object`、`/event` 命令;Performance、自动性能采集、health scan 和 benchmark 页面已移除。脚本必须有界,异步资源用清理回调释放,不对可能为 secret 的值直接比较或格式化。
|
|
41
|
-
|
|
42
|
-
结果说明以用户问题的结论开头,附 Ticket、客户端实际版本、完整 payload 路径和验证边界。区分“提交”“游戏完成”“报告读取”“收尾完成”,不要用一个“成功”掩盖中间阶段。
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Lychee Dev"
|
|
3
|
-
short_description: "Orchestrate background WoW tasks and verified Ticket evidence"
|
|
4
|
-
default_prompt: "Use $lychee-dev to complete a background WoW investigation through verified Ticket evidence, acknowledgement, cleanup, and recovery if interrupted."
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
# 后台自动化闭环
|
|
2
|
-
|
|
3
|
-
检索:目标绑定、任务区块、状态、执行、错误快照、ACK、恢复、清理、证据。
|
|
4
|
-
|
|
5
|
-
## 工具与协议
|
|
6
|
-
|
|
7
|
-
发送使用 Python `scripts/automation.py` 的 `--mode messages`(当前默认);读取使用 WGC + zxing-cpp。不要重写 ctypes 投递、拼接临时按键脚本或改成 GDI。Node CLI 负责安装/发现,游戏与 SV 逻辑由 Python 持有。
|
|
8
|
-
|
|
9
|
-
运行时 RGB 色块表示状态;完成 QR 只包含版本、Ticket、task、requestId、时间戳等短元数据:
|
|
10
|
-
|
|
11
|
-
```json
|
|
12
|
-
{"v":1,"ticket":"LYCHEE-...","task":"probe","run":"req-...","ts":1234567890}
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
无论正文大小,一律在输出 reload 后读取 SavedVariables。二维码不承担正文传输。成功/失败/取消都可能生成报告,必须读取报告的 status/complete/incompleteReasons,不能看见二维码就说调查成功。
|
|
16
|
-
|
|
17
|
-
固定一个稳定的 `--installation` 标识(对应安装目录与会话绑定),并在所有命令中沿用同一个 `--data-dir`。宿主默认目录是 `%LOCALAPPDATA%/LycheeDev/automation`,保存 `session.log.jsonl`、配置和 `received/<Ticket>/` 下的 evidence/report/content 文件。插件内存中的数据库只有在 reload、退出或登出后才落盘。
|
|
18
|
-
|
|
19
|
-
## 职责和完成边界
|
|
20
|
-
|
|
21
|
-
Agent 负责目标选择、设计有界 Lua、连续推进各阶段、解释异常。Python 负责注册表原子更新、输入、QR 校验、reload 去重、SV 校验和 ACK。当前不存在一个涵盖所有步骤的 `workflow` 命令;用下面的真实命令连续编排,不让用户逐条接力。
|
|
22
|
-
|
|
23
|
-
| 阶段 | 通过证据 | 下一步 |
|
|
24
|
-
| --- | --- | --- |
|
|
25
|
-
| 目标绑定 | 本次进程与产品/角色/安装匹配 | 写自己的任务区块 |
|
|
26
|
-
| 源码已准备 | upsert 的 hash/requestId/revision | 输入侧 reload 使新源码加载 |
|
|
27
|
-
| 输入已提交 | command_submitted,仅表示投递完成 | 等待匹配 task/run 的完成 QR |
|
|
28
|
-
| 游戏已完成 | 匹配 QR | 输出 reload 一次 |
|
|
29
|
-
| 已落盘读取 | 精确 Ticket、环境、完整性和校验通过 | ACK received |
|
|
30
|
-
| ACK 已确认 | Ticket/nonce/status 匹配 | 按该 nonce 清理并观察码消失 |
|
|
31
|
-
| 已收尾 | ticket_ack_cleared;自有测试资源处理完成 | 向用户报告结果 |
|
|
32
|
-
|
|
33
|
-
`run`/`bugs` 当前负责到 SV 读取,不自动执行 `ack`。返回 0 后必须继续 ACK。`send` 返回 0 不能当作游戏成功。`recover` 没有未决 reload 也不证明 ACK/界面清理完成,需要检查对应阶段事件。
|
|
34
|
-
|
|
35
|
-
## 准备任务
|
|
36
|
-
|
|
37
|
-
目标目录是 `<addon>/Modules/Automation/auto/auto.lua`,按 task-id 分区。只能通过注册表工具改自己的区块,保留别人的块和标记外文本:
|
|
38
|
-
|
|
39
|
-
```text
|
|
40
|
-
python <skill>/scripts/automation.py --installation <binding> task upsert --install-dir <addon> --id <task> --source-file <probe.lua> --request-id <request> --revision <revision> --expected-interface <interface>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
task-id 是 `[A-Za-z0-9_-]{1,64}`;requestId 建议只用字母、数字、点、连字符(兼容插件与 Python)。一项新执行分配新 requestId,源码变化同时换 revision;超时恢复保持原 requestId。更新已有块时用 `--expect-revision` 防覆盖。
|
|
44
|
-
|
|
45
|
-
源码是 UTF-8 Lua 5.1,最多 256 KiB;注册表最多 16 块/1 MiB。标准输出限制默认 384 KiB、最大 512 KiB,以实际安装工具限制为准。不要用不受支持的 schema/kind 扩展协议。区块只注册数据,不会加载即执行。
|
|
46
|
-
|
|
47
|
-
同步调查返回紧凑结构。异步调查调用 `SetAsync()`,通过 `Finish(...)` 或 `Fail(message, code)` 完成,用 `OnCleanup(fn)` 释放自己创建的资源,检查 `IsCancelled()`;`Log` 与 `print` 输出有界。不得返回尚未完成的表并指望后来修改自动保存。
|
|
48
|
-
|
|
49
|
-
输入侧 reload:发送 `/reload` 后等待客户端恢复可交互状态再发执行命令。SV mtime 变化只证明开始写盘,不证明加载已结束。用 WGC 观察世界画面恢复或验证过的就绪信号;固定等待数秒不能单独作为就绪证明。不得因暂时加载中而连续发命令试探。
|
|
50
|
-
|
|
51
|
-
## 执行已绑定账户的任务
|
|
52
|
-
|
|
53
|
-
下面示例的全局 `--data-dir`(如有)放在子命令前。全部窗口操作沿用本次绑定:
|
|
54
|
-
|
|
55
|
-
```text
|
|
56
|
-
python <skill>/scripts/automation.py --installation <binding> send --mode messages --hwnd <hwnd> --pid <pid> --exe-path <exe> --text "/reload"
|
|
57
|
-
python <skill>/scripts/automation.py --installation <binding> run --mode messages --hwnd <hwnd> --pid <pid> --exe-path <exe> --task <task> --install-dir <addon> --sv <verified-sv> --timeout 120
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
不要把两条命令无条件贴在同一个连续执行脚本里:输入 reload 后需先确认就绪。`run` 读取安装区块的 requestId/revision,提交 `/dev auto run <task>`,过滤旧完成码,记录输出 reload 去重键,再校验 SV 并保存完整报告。
|
|
61
|
-
|
|
62
|
-
账户未绑定时按 [clients.md](clients.md) 分段执行:`send` 运行、`capture` 取码、Agent 验证 task/run、带 requestId/Ticket 发送一次 `/reload`、定位精确记录,再 `sv read`。`capture` 本身只验证 QR 格式,不知道本次预期 task/run,不能拿任何码直接触发 reload。
|
|
63
|
-
|
|
64
|
-
```text
|
|
65
|
-
python <skill>/scripts/automation.py --installation <binding> send --mode messages --hwnd <hwnd> --pid <pid> --exe-path <exe> --text "/dev auto run <task>"
|
|
66
|
-
python <skill>/scripts/automation.py capture --hwnd <hwnd> --pid <pid> --exe-path <exe> --timeout 120
|
|
67
|
-
python <skill>/scripts/automation.py --installation <binding> send --mode messages --hwnd <hwnd> --pid <pid> --exe-path <exe> --text "/reload" --request-id <request> --ticket <ticket>
|
|
68
|
-
python <skill>/scripts/automation.py --installation <binding> sv read --sv <matched-sv> --ticket <ticket> --task <task> --request-id <request> --revision <revision> --request-type task
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
同一个 `(installation, requestId, Ticket)` 的输出 reload 只允许自动发一次。写盘暂时未完成时进行有界读取等待,不重跑 Lua。
|
|
72
|
-
|
|
73
|
-
## 最近 n 条错误
|
|
74
|
-
|
|
75
|
-
```text
|
|
76
|
-
python <skill>/scripts/automation.py --installation <binding> bugs --mode messages --hwnd <hwnd> --pid <pid> --exe-path <exe> --count <n> --request-id <request> --sv <verified-sv> --timeout 120
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
n 在 1–100 之间。该流程发送 `/dev auto bug <n> <request>`,完成码 task 为 `bug`,内层报告 requestType 为 `bug`。数量是上限;按 provider storage order 读取可能跨会话的现有日志,不能未经核对就声称是本次测试产生的 n 个错误。报告保留 scope/排序信息,不用 metadata 代替错误正文。账户未知时同样分段定位 Ticket。
|
|
80
|
-
|
|
81
|
-
## ACK 与正常收尾
|
|
82
|
-
|
|
83
|
-
SV 内容已完整验证后发送 received;读失败但已明确决定结束本次接收才用 failed,不把一次暂时读盘失败直接 ACK 为失败。
|
|
84
|
-
|
|
85
|
-
```text
|
|
86
|
-
python <skill>/scripts/automation.py --installation <binding> ack --mode messages --hwnd <hwnd> --pid <pid> --exe-path <exe> --ticket <ticket> --status received --timeout 30
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
输出 reload 后先确认世界已恢复。ACK 分配新 nonce,等待含该 nonce、Ticket 和 outcome 的 QR;随后发送 `/dev auto unidentify <nonce>`,只隐藏对应 ACK 标记,再观察该码消失。`ticket_ack_confirmed` 和 `ticket_ack_cleared` 分开记录;确认成功但清理超时不等于任务失败。
|
|
90
|
-
|
|
91
|
-
旧版插件只支持两参数 ACK,不支持 nonce 清理。使用前核对工具与插件协议版本;授权的测试/更新应备份后同步相应源码并 reload。不能在旧插件上持续重试不支持的命令。`/dev auto unidentify` 无参数会隐藏身份标记,仅在明确属于自己的标记且没有新回执时用;不能用通用 stop 掩盖未处理证据。
|
|
92
|
-
|
|
93
|
-
读取 ACK 不需要又一次输出 reload;receivedAt/receivedStatus 留在内存,下一次正常 reload 才持久化。不要为了把确认再确认一遍制造无限 ACK/reload 环。
|
|
94
|
-
|
|
95
|
-
自有临时任务结束后用 `task remove --install-dir <addon> --id <task>` 清理磁盘区块,保留证据和他人区块;是否额外 reload 清除内存定义按实际需要决定,不为界面整洁无条件多做 reload。
|
|
96
|
-
|
|
97
|
-
## 完整报告校验
|
|
98
|
-
|
|
99
|
-
读取当前 `Lychee Dev.lua`,用受限 Lua 数据解析器定位 `LycheeDevDB.exports.records[Ticket]`。校验 envelope schema/ticket/createdAt、payload 的 UTF-8 字节数与编码、Adler-32、metadata taskId/executionId/revision、内层 schema/status/complete/requestType。Agent 另将 environment 的角色/服务器/产品/build 与当前绑定比较;当前 reader 验证环境结构,不替 Agent 证明它就是选定窗口。
|
|
100
|
-
|
|
101
|
-
`received/<Ticket>/content.json` 是字节精确的完整 payload,report.json 是解析报告,evidence.json 是外层证据。报告给用户时引用实际文件与 Ticket,不能只给 QR 截图或日志摘要。
|
|
102
|
-
|
|
103
|
-
## 中断、超时与恢复
|
|
104
|
-
|
|
105
|
-
先读本 installation 的 `status`/`recover`、本次保存的 task/request/Ticket 和当前画面;不要从第一条命令重新开始。
|
|
106
|
-
|
|
107
|
-
| 停留状态 | 恢复动作 |
|
|
108
|
-
| --- | --- |
|
|
109
|
-
| 已 upsert、未确认加载 | 核对源码与客户端状态,完成输入侧 reload,不运行旧区块 |
|
|
110
|
-
| 已提交、无完成码 | 有界等待/只读观察;超时记 unresolved,不自动生成新 request 重跑 |
|
|
111
|
-
| 完成码在屏幕 | 校验 task/run;查是否已请求 reload、Ticket 是否已在 SV,再决定推进 |
|
|
112
|
-
| 已请求 reload、读不到 Ticket | 等待写盘并搜索该安装所有候选;拒绝 newest-file 猜测 |
|
|
113
|
-
| SV 已验证、ACK 未完成 | 只继续 ACK,不重新执行任务或输出 reload |
|
|
114
|
-
| ACK 已确认、码仍显示 | 从日志取原 nonce,仅补对应 unidentify 和读取验证 |
|
|
115
|
-
| HWND/PID/角色变了 | 重新绑定,再恢复只读阶段;不沿用旧窗口序号 |
|
|
116
|
-
| 留有自有未提交草稿 | 核对仍是原窗口,取消草稿;不按 Enter“继续” |
|
|
117
|
-
|
|
118
|
-
仅在证据证明上次 reload 未执行且任务仍在内存,并处于现有授权内时,允许一次明确记录的恢复 reload;不循环试错。游戏崩溃前未落盘的内容可能丢失,应直接说明。
|
|
119
|
-
|
|
120
|
-
后台 PostMessage 不使用前台/剪贴板,但队列接受不证明 Escape 被消费或焦点处于聊天框。不要把 SendInput 当补救。输入错误后检查状态,修复明确原因或报告阻塞;不要留下未说明的测试草稿再开始别的用例。
|
|
121
|
-
|
|
122
|
-
退出码:0 为该命令完成,1 为参数/绑定错误,2 为注册表错误,3 为 SV 读取或验证失败,4 为窗口/输入/依赖问题,5 为回执、写盘或清理观察超时。已经确认的阶段不能因后续阶段失败而被抹掉。
|
|
123
|
-
|
|
124
|
-
## 依赖与验证范围
|
|
125
|
-
|
|
126
|
-
Python 图像依赖放在 `~/.lycheedev/python`,通过 PYTHONPATH 加载,使用随工具 requirements.txt 的版本;不要装进用户 site-packages。后台发送只依赖 ctypes;QR 读取及 ACK 的确认/清理需要 WGC、numpy、zxing-cpp。缺依赖时先在受管目录修复,不切换传输通道。
|
|
127
|
-
|
|
128
|
-
已有实机证据:Retail 12.1.0.69875 / Interface 120100 后台身份 QR、13,019 字节任务报告、reload 落盘和 nonce ACK 已通过。四客户端离线矩阵通过不等于四客户端实机通过;最小化、全部编辑状态、句柄重用仍未完整验证。同一 Retail 实例的 ACK 自动收尾已实测:确认后按 nonce 隐藏,WGC 再读取无残留码;测试禁止调用前台激活、SendInput 与剪贴板入口,仍成功。不要将该结果扩大为所有客户端/窗口状态都通过。
|