lycheedev 1.2.0 → 2.0.1
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 +128 -93
- package/{vendor → payload}/addon/Core/Locale_enUS.lua +128 -95
- 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 -746
- 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 -44
- package/vendor/addon/Lychee Dev_Mainline.toc +0 -44
- package/vendor/addon/Lychee Dev_Mists.toc +0 -44
- package/vendor/addon/Lychee Dev_Wrath.toc +0 -44
- package/vendor/addon/Modules/Automation/Controller.lua +0 -896
- package/vendor/addon/Modules/Automation/Reload.lua +0 -101
- 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 -44
- package/vendor/skill/agents/openai.yaml +0 -4
- package/vendor/skill/references/automation.md +0 -130
- 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/reload.py +0 -121
- 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 -1067
- 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/skill/scripts/test_reload.py +0 -120
- /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
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
local ADDON_NAME, ns = ...
|
|
2
|
+
|
|
3
|
+
-- Automation workbench page: the in-game view and manual execute over the SAME
|
|
4
|
+
-- game-side probe machinery the CLI drives (design.md section 12). It lists
|
|
5
|
+
-- queue entries and execution history through Modules/AutomationView.lua,
|
|
6
|
+
-- which derives every status from ns.ProbeQueue / ns.ProbeRunner /
|
|
7
|
+
-- ns.ReportStore. No task registry, no /dev auto grammar and no parallel
|
|
8
|
+
-- executor exist here.
|
|
9
|
+
local L = ns.L
|
|
10
|
+
local W = ns.Widgets
|
|
11
|
+
local view = ns.AutomationView
|
|
12
|
+
|
|
13
|
+
local ROW_HEIGHT = 58
|
|
14
|
+
local LIST_WIDTH = 354
|
|
15
|
+
local VISIBLE_ROWS = 8
|
|
16
|
+
|
|
17
|
+
-- Mirrors the bridge record vocabulary exposed by the bridge modules (see
|
|
18
|
+
-- Modules/AutomationView.lua for the derivation). An unavailable record shows
|
|
19
|
+
-- its raw bridge error code instead of a made-up label.
|
|
20
|
+
local STATUS_LABELS = {
|
|
21
|
+
queued = "AUTO_STATUS_QUEUED",
|
|
22
|
+
loaded = "AUTO_STATUS_LOADED",
|
|
23
|
+
reported = "AUTO_STATUS_REPORTED",
|
|
24
|
+
acknowledged = "AUTO_STATUS_ACKNOWLEDGED",
|
|
25
|
+
cleared = "AUTO_STATUS_CLEARED",
|
|
26
|
+
unavailable = "AUTO_STATUS_UNAVAILABLE",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
local KIND_LABELS = {
|
|
30
|
+
lua = "AUTO_KIND_LUA",
|
|
31
|
+
bug_snapshot = "AUTO_KIND_BUG",
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
local function Restricted(value)
|
|
35
|
+
return issecretvalue and issecretvalue(value)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
local function ShownText(value, fallback)
|
|
39
|
+
if Restricted(value) then
|
|
40
|
+
return "<secret>"
|
|
41
|
+
end
|
|
42
|
+
if value == nil then
|
|
43
|
+
return fallback or ""
|
|
44
|
+
end
|
|
45
|
+
return tostring(value)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
local function GetStatusText(record)
|
|
49
|
+
if record.status == "unavailable" and record.errorCode then
|
|
50
|
+
return ShownText(record.errorCode)
|
|
51
|
+
end
|
|
52
|
+
local key = STATUS_LABELS[record.status]
|
|
53
|
+
return key and L[key] or ShownText(record.status, L.UNKNOWN)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
local function GetKindLabel(kind)
|
|
57
|
+
local key = KIND_LABELS[kind]
|
|
58
|
+
return key and L[key] or L.EXPORT_KIND_UNKNOWN
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
local function FormatTime(timestamp)
|
|
62
|
+
if Restricted(timestamp) then
|
|
63
|
+
return "<secret>"
|
|
64
|
+
end
|
|
65
|
+
timestamp = tonumber(timestamp) or 0
|
|
66
|
+
if timestamp <= 0 then
|
|
67
|
+
return L.UNKNOWN
|
|
68
|
+
end
|
|
69
|
+
return date("%Y-%m-%d %H:%M:%S", timestamp)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
local function FormatCode(record)
|
|
73
|
+
if Restricted(record.codeBytes) or type(record.codeBytes) ~= "number" then
|
|
74
|
+
return L.NOT_AVAILABLE
|
|
75
|
+
end
|
|
76
|
+
return string.format(L.AUTO_CODE_SUMMARY, record.codeBytes,
|
|
77
|
+
ShownText(record.codeAdler32, "-"), ShownText(record.codeSHA256, "-"))
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
local function FormatRecorded(record)
|
|
81
|
+
local text = FormatTime(record.observedAt)
|
|
82
|
+
if type(record.sequence) == "number" and not Restricted(record.sequence) then
|
|
83
|
+
text = text .. " · #" .. tostring(record.sequence)
|
|
84
|
+
end
|
|
85
|
+
return text
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
local function CreateField(parent, labelText, x, y, width)
|
|
89
|
+
local label = parent:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
90
|
+
label:SetPoint("TOPLEFT", x, y)
|
|
91
|
+
label:SetText(labelText)
|
|
92
|
+
label:SetTextColor(1, 1, 1, 0.34)
|
|
93
|
+
|
|
94
|
+
local value = parent:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
|
95
|
+
value:SetPoint("TOPLEFT", x, y - 20)
|
|
96
|
+
value:SetWidth(width)
|
|
97
|
+
value:SetJustifyH("LEFT")
|
|
98
|
+
value:SetWordWrap(false)
|
|
99
|
+
value:SetTextColor(0.91, 0.93, 0.95, 0.92)
|
|
100
|
+
return value
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
function ns.CreateAutomationPage(parent)
|
|
104
|
+
local colors = W.Colors
|
|
105
|
+
local page = CreateFrame("Frame", nil, parent)
|
|
106
|
+
page:SetAllPoints(parent)
|
|
107
|
+
|
|
108
|
+
local selectedRequestId
|
|
109
|
+
local rows = {}
|
|
110
|
+
|
|
111
|
+
local heading = W.CreateSectionLabel(page, L.TAB_AUTOMATION)
|
|
112
|
+
heading:SetPoint("TOPLEFT", 17, -84)
|
|
113
|
+
|
|
114
|
+
local countText = page:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
115
|
+
countText:SetPoint("LEFT", heading, "RIGHT", 12, 0)
|
|
116
|
+
countText:SetTextColor(1, 1, 1, 0.36)
|
|
117
|
+
|
|
118
|
+
local clearButton = W.CreateConfirmButton(page, 118, L.AUTO_CLEAR_HISTORY,
|
|
119
|
+
L.CONFIRM_CLEAR_CACHE, function()
|
|
120
|
+
if ns.Safety.IsCombatBlocked() then
|
|
121
|
+
ns.Safety.PrintBlocked()
|
|
122
|
+
return
|
|
123
|
+
end
|
|
124
|
+
view.ClearRecords()
|
|
125
|
+
selectedRequestId = nil
|
|
126
|
+
page:Refresh()
|
|
127
|
+
end, "secondary")
|
|
128
|
+
clearButton:SetPoint("TOPRIGHT", -14, -104)
|
|
129
|
+
|
|
130
|
+
local hideNoticeButton = W.CreateButton(page, 118, L.AUTO_HIDE_NOTICE, "secondary")
|
|
131
|
+
hideNoticeButton:SetPoint("RIGHT", clearButton, "LEFT", -8, 0)
|
|
132
|
+
|
|
133
|
+
local showNoticeButton = W.CreateButton(page, 128, L.AUTO_SHOW_NOTICE, "secondary")
|
|
134
|
+
showNoticeButton:SetPoint("RIGHT", hideNoticeButton, "LEFT", -8, 0)
|
|
135
|
+
|
|
136
|
+
local executeButton = W.CreateButton(page, 96, L.AUTO_EXECUTE, "primary")
|
|
137
|
+
executeButton:SetPoint("RIGHT", showNoticeButton, "LEFT", -8, 0)
|
|
138
|
+
|
|
139
|
+
local listPanel = W.CreatePanel(page, colors.editor[1], colors.editor[2], colors.editor[3], 0.78)
|
|
140
|
+
listPanel:SetPoint("TOPLEFT", 14, -144)
|
|
141
|
+
listPanel:SetPoint("BOTTOMLEFT", 14, 54)
|
|
142
|
+
listPanel:SetWidth(LIST_WIDTH)
|
|
143
|
+
|
|
144
|
+
local listScroll = W.CreateScrollArea(listPanel, 8, 8, 7, 8)
|
|
145
|
+
local listContent = CreateFrame("Frame", nil, listScroll)
|
|
146
|
+
listContent:SetWidth(LIST_WIDTH - 26)
|
|
147
|
+
listContent:SetHeight(1)
|
|
148
|
+
listScroll:SetScrollChild(listContent)
|
|
149
|
+
|
|
150
|
+
local emptyTitle = listPanel:CreateFontString(nil, "OVERLAY", "GameFontNormal")
|
|
151
|
+
emptyTitle:SetPoint("CENTER", listPanel, "CENTER", 0, 14)
|
|
152
|
+
emptyTitle:SetText(L.AUTO_NO_EXECUTIONS)
|
|
153
|
+
emptyTitle:SetTextColor(1, 1, 1, 0.58)
|
|
154
|
+
|
|
155
|
+
local detailPanel = CreateFrame("Frame", nil, page)
|
|
156
|
+
detailPanel:SetPoint("TOPLEFT", listPanel, "TOPRIGHT", 12, 0)
|
|
157
|
+
detailPanel:SetPoint("BOTTOMRIGHT", -14, 54)
|
|
158
|
+
|
|
159
|
+
local detailHeading = detailPanel:CreateFontString(nil, "OVERLAY", "GameFontNormal")
|
|
160
|
+
detailHeading:SetPoint("TOPLEFT", 4, -4)
|
|
161
|
+
detailHeading:SetText(L.AUTO_DETAIL)
|
|
162
|
+
|
|
163
|
+
local detailState = detailPanel:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
|
164
|
+
detailState:SetPoint("TOPRIGHT", -4, -4)
|
|
165
|
+
|
|
166
|
+
local requestValue = CreateField(detailPanel, L.AUTO_FIELD_REQUEST, 4, -48, 282)
|
|
167
|
+
local kindValue = CreateField(detailPanel, L.EXPORT_RECORD_KIND, 314, -48, 272)
|
|
168
|
+
local statusValue = CreateField(detailPanel, L.AUTO_FIELD_STATUS, 4, -106, 282)
|
|
169
|
+
local codeValue = CreateField(detailPanel, L.AUTO_FIELD_CODE, 314, -106, 272)
|
|
170
|
+
local timeValue = CreateField(detailPanel, L.AUTO_FIELD_TIME, 4, -164, 282)
|
|
171
|
+
local errorValue = CreateField(detailPanel, L.AUTO_FIELD_ERROR, 314, -164, 272)
|
|
172
|
+
|
|
173
|
+
local reportLabel = detailPanel:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
174
|
+
reportLabel:SetPoint("TOPLEFT", 4, -226)
|
|
175
|
+
reportLabel:SetText(L.RESULT)
|
|
176
|
+
reportLabel:SetTextColor(1, 1, 1, 0.34)
|
|
177
|
+
|
|
178
|
+
local viewReportButton = W.CreateButton(detailPanel, 118, L.AUTO_VIEW_REPORT, "secondary")
|
|
179
|
+
viewReportButton:SetPoint("TOPRIGHT", -4, -226)
|
|
180
|
+
|
|
181
|
+
local reportArea = W.CreateTextArea(detailPanel, true)
|
|
182
|
+
reportArea:SetPoint("TOPLEFT", 4, -268)
|
|
183
|
+
reportArea:SetPoint("BOTTOMRIGHT", -4, 4)
|
|
184
|
+
W.SetReadOnlyText(reportArea, "")
|
|
185
|
+
|
|
186
|
+
local function StatusColor(record)
|
|
187
|
+
if record.status == "reported" or record.probeStatus == "completed" then
|
|
188
|
+
return 0.42, 0.76, 0.43, 0.92
|
|
189
|
+
elseif record.status == "queued" or record.status == "loaded" then
|
|
190
|
+
return colors.accent[1], colors.accent[2], colors.accent[3], 0.92
|
|
191
|
+
elseif record.status == "unavailable" or record.probeStatus == "failed" then
|
|
192
|
+
return 0.86, 0.47, 0.55, 0.92
|
|
193
|
+
end
|
|
194
|
+
return 1, 1, 1, 0.30
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
local function ApplyRowState(row)
|
|
198
|
+
local selected = row.requestId == selectedRequestId
|
|
199
|
+
W.SetListRowState(row, selected, row.hovered)
|
|
200
|
+
if selected then
|
|
201
|
+
row.title:SetTextColor(1, 1, 1, 0.96)
|
|
202
|
+
elseif row.hovered then
|
|
203
|
+
row.title:SetTextColor(1, 1, 1, 0.90)
|
|
204
|
+
else
|
|
205
|
+
row.title:SetTextColor(1, 1, 1, 0.76)
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
local function RefreshDetail()
|
|
210
|
+
local record = selectedRequestId and view.GetRecord(selectedRequestId) or nil
|
|
211
|
+
local hasRecord = record ~= nil
|
|
212
|
+
|
|
213
|
+
detailHeading:SetText(hasRecord and ShownText(record.requestId) or L.AUTO_DETAIL)
|
|
214
|
+
detailState:SetText(hasRecord and GetStatusText(record) or "")
|
|
215
|
+
if hasRecord then
|
|
216
|
+
detailState:SetTextColor(StatusColor(record))
|
|
217
|
+
else
|
|
218
|
+
detailState:SetTextColor(1, 1, 1, 0.36)
|
|
219
|
+
end
|
|
220
|
+
requestValue:SetText(hasRecord and ShownText(record.requestId) or "")
|
|
221
|
+
kindValue:SetText(hasRecord and GetKindLabel(record.kind) or "")
|
|
222
|
+
statusValue:SetText(hasRecord and GetStatusText(record) or "")
|
|
223
|
+
codeValue:SetText(hasRecord and FormatCode(record) or "")
|
|
224
|
+
timeValue:SetText(hasRecord and FormatRecorded(record) or "")
|
|
225
|
+
errorValue:SetText(hasRecord
|
|
226
|
+
and ShownText(record.actionError or record.probeError or record.errorCode, L.NOT_AVAILABLE) or "")
|
|
227
|
+
|
|
228
|
+
W.SetButtonEnabled(executeButton, hasRecord)
|
|
229
|
+
W.SetButtonEnabled(showNoticeButton, hasRecord and record.receipt ~= nil)
|
|
230
|
+
W.SetButtonEnabled(viewReportButton, hasRecord)
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
local function SelectRecord(requestId)
|
|
234
|
+
selectedRequestId = requestId
|
|
235
|
+
W.SetReadOnlyText(reportArea, "")
|
|
236
|
+
for index = 1, #rows do
|
|
237
|
+
ApplyRowState(rows[index])
|
|
238
|
+
end
|
|
239
|
+
RefreshDetail()
|
|
240
|
+
end
|
|
241
|
+
page.SelectRecord = SelectRecord
|
|
242
|
+
|
|
243
|
+
local function AcquireRow(index)
|
|
244
|
+
local row = rows[index]
|
|
245
|
+
if row then
|
|
246
|
+
return row
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
row = W.CreateListRow(listContent, ROW_HEIGHT)
|
|
250
|
+
row:SetPoint("TOPLEFT", 0, 0)
|
|
251
|
+
row:SetPoint("TOPRIGHT", 0, 0)
|
|
252
|
+
row.hovered = false
|
|
253
|
+
|
|
254
|
+
local title = row:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
|
255
|
+
title:SetPoint("TOPLEFT", 12, -10)
|
|
256
|
+
title:SetPoint("TOPRIGHT", -100, -10)
|
|
257
|
+
title:SetJustifyH("LEFT")
|
|
258
|
+
title:SetWordWrap(false)
|
|
259
|
+
row.title = title
|
|
260
|
+
|
|
261
|
+
local status = row:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
262
|
+
status:SetPoint("TOPRIGHT", -10, -10)
|
|
263
|
+
status:SetJustifyH("RIGHT")
|
|
264
|
+
row.status = status
|
|
265
|
+
|
|
266
|
+
local meta = row:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
267
|
+
meta:SetPoint("BOTTOMLEFT", 12, 9)
|
|
268
|
+
meta:SetPoint("BOTTOMRIGHT", -10, 9)
|
|
269
|
+
meta:SetJustifyH("LEFT")
|
|
270
|
+
meta:SetWordWrap(false)
|
|
271
|
+
meta:SetTextColor(1, 1, 1, 0.34)
|
|
272
|
+
row.meta = meta
|
|
273
|
+
|
|
274
|
+
row:SetScript("OnEnter", function(self)
|
|
275
|
+
self.hovered = true
|
|
276
|
+
ApplyRowState(self)
|
|
277
|
+
end)
|
|
278
|
+
row:SetScript("OnLeave", function(self)
|
|
279
|
+
self.hovered = nil
|
|
280
|
+
ApplyRowState(self)
|
|
281
|
+
end)
|
|
282
|
+
row:SetScript("OnClick", function(self)
|
|
283
|
+
SelectRecord(self.requestId)
|
|
284
|
+
end)
|
|
285
|
+
row:SetScript("OnMouseWheel", listScroll.onMouseWheel)
|
|
286
|
+
rows[index] = row
|
|
287
|
+
return row
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
local function Refresh()
|
|
291
|
+
view.Collect()
|
|
292
|
+
local order = view.GetOrder()
|
|
293
|
+
countText:SetText(string.format(L.AUTO_EXECUTION_COUNT, #order))
|
|
294
|
+
emptyTitle:SetShown(#order == 0)
|
|
295
|
+
W.SetButtonEnabled(clearButton, #order > 0)
|
|
296
|
+
|
|
297
|
+
for index = 1, #rows do
|
|
298
|
+
rows[index]:Hide()
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
local scrollOffset = listScroll:GetVerticalScroll()
|
|
302
|
+
if Restricted(scrollOffset) then
|
|
303
|
+
scrollOffset = 0
|
|
304
|
+
end
|
|
305
|
+
local firstIndex = math.floor((scrollOffset or 0) / ROW_HEIGHT) + 1
|
|
306
|
+
local lastIndex = math.min(#order, firstIndex + VISIBLE_ROWS - 1)
|
|
307
|
+
local poolIndex = 0
|
|
308
|
+
for orderIndex = firstIndex, lastIndex do
|
|
309
|
+
poolIndex = poolIndex + 1
|
|
310
|
+
local record = view.GetRecord(order[orderIndex])
|
|
311
|
+
local row = rows[poolIndex] or AcquireRow(poolIndex)
|
|
312
|
+
row.requestId = record.requestId
|
|
313
|
+
row:ClearAllPoints()
|
|
314
|
+
row:SetPoint("TOPLEFT", 0, -((orderIndex - 1) * ROW_HEIGHT))
|
|
315
|
+
row:SetPoint("TOPRIGHT", 0, -((orderIndex - 1) * ROW_HEIGHT))
|
|
316
|
+
row.title:SetText(ShownText(record.requestId))
|
|
317
|
+
row.status:SetText(GetStatusText(record))
|
|
318
|
+
row.status:SetTextColor(StatusColor(record))
|
|
319
|
+
row.meta:SetText(FormatTime(record.observedAt) .. " | " .. GetKindLabel(record.kind))
|
|
320
|
+
ApplyRowState(row)
|
|
321
|
+
row:Show()
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
listContent:SetHeight(math.max(1, #order * ROW_HEIGHT))
|
|
325
|
+
listScroll:UpdateScrollChildRect()
|
|
326
|
+
|
|
327
|
+
-- Newest record first: when the selection is gone, fall back to the
|
|
328
|
+
-- head of the newest-first order.
|
|
329
|
+
if selectedRequestId and not view.GetRecord(selectedRequestId) then
|
|
330
|
+
selectedRequestId = nil
|
|
331
|
+
end
|
|
332
|
+
if not selectedRequestId and order[1] then
|
|
333
|
+
selectedRequestId = order[1]
|
|
334
|
+
W.SetReadOnlyText(reportArea, "")
|
|
335
|
+
end
|
|
336
|
+
for index = 1, #rows do
|
|
337
|
+
ApplyRowState(rows[index])
|
|
338
|
+
end
|
|
339
|
+
RefreshDetail()
|
|
340
|
+
end
|
|
341
|
+
page.Refresh = Refresh
|
|
342
|
+
|
|
343
|
+
listScroll.onVerticalScrollChanged = function()
|
|
344
|
+
page:Refresh()
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
executeButton:SetScript("OnClick", function()
|
|
348
|
+
if ns.Safety.IsCombatBlocked() then
|
|
349
|
+
ns.Safety.PrintBlocked()
|
|
350
|
+
return
|
|
351
|
+
end
|
|
352
|
+
if not selectedRequestId then
|
|
353
|
+
return
|
|
354
|
+
end
|
|
355
|
+
-- The one execute path: ProbeQueue.Load + ProbeRunner.Dispatch, the
|
|
356
|
+
-- exact calls the /dev bridge load/run verbs make. Failures surface as
|
|
357
|
+
-- their bridge error codes; nothing is invented here.
|
|
358
|
+
local _, failure = view.Execute(selectedRequestId)
|
|
359
|
+
local record = view.GetRecord(selectedRequestId)
|
|
360
|
+
if record then
|
|
361
|
+
-- Transient action error for the detail pane; the row status stays
|
|
362
|
+
-- the derived bridge status refreshed below.
|
|
363
|
+
record.actionError = failure
|
|
364
|
+
end
|
|
365
|
+
Refresh()
|
|
366
|
+
end)
|
|
367
|
+
|
|
368
|
+
showNoticeButton:SetScript("OnClick", function()
|
|
369
|
+
if ns.Safety.IsCombatBlocked() then
|
|
370
|
+
ns.Safety.PrintBlocked()
|
|
371
|
+
return
|
|
372
|
+
end
|
|
373
|
+
if selectedRequestId then
|
|
374
|
+
view.ShowNotice(selectedRequestId)
|
|
375
|
+
end
|
|
376
|
+
end)
|
|
377
|
+
|
|
378
|
+
-- Hiding the notice is teardown and must stay available in every state.
|
|
379
|
+
hideNoticeButton:SetScript("OnClick", function()
|
|
380
|
+
view.HideNotice()
|
|
381
|
+
end)
|
|
382
|
+
|
|
383
|
+
viewReportButton:SetScript("OnClick", function()
|
|
384
|
+
if ns.Safety.IsCombatBlocked() then
|
|
385
|
+
ns.Safety.PrintBlocked()
|
|
386
|
+
return
|
|
387
|
+
end
|
|
388
|
+
if not selectedRequestId then
|
|
389
|
+
return
|
|
390
|
+
end
|
|
391
|
+
local text, failure = view.GetReportText(selectedRequestId)
|
|
392
|
+
W.SetReadOnlyText(reportArea, text or ShownText(failure, L.AUTO_NO_REPORT))
|
|
393
|
+
end)
|
|
394
|
+
|
|
395
|
+
page.rows = rows
|
|
396
|
+
page.reportArea = reportArea
|
|
397
|
+
page.requestValue = requestValue
|
|
398
|
+
page.kindValue = kindValue
|
|
399
|
+
page.statusValue = statusValue
|
|
400
|
+
page.codeValue = codeValue
|
|
401
|
+
page.timeValue = timeValue
|
|
402
|
+
page.errorValue = errorValue
|
|
403
|
+
page.executeButton = executeButton
|
|
404
|
+
page.showNoticeButton = showNoticeButton
|
|
405
|
+
page.hideNoticeButton = hideNoticeButton
|
|
406
|
+
page.viewReportButton = viewReportButton
|
|
407
|
+
page.clearButton = clearButton
|
|
408
|
+
function page:Activate()
|
|
409
|
+
Refresh()
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
Refresh()
|
|
413
|
+
return page
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
-- Workbench registration (zero cost before the first /dev; the page builds
|
|
417
|
+
-- lazily and owns no events or timers).
|
|
418
|
+
local pageInstance
|
|
419
|
+
local definition = {
|
|
420
|
+
key = "automation",
|
|
421
|
+
titleKey = "TAB_AUTOMATION",
|
|
422
|
+
build = function(parent)
|
|
423
|
+
pageInstance = ns.CreateAutomationPage(parent)
|
|
424
|
+
return pageInstance
|
|
425
|
+
end,
|
|
426
|
+
activate = function()
|
|
427
|
+
if pageInstance then
|
|
428
|
+
pageInstance:Refresh()
|
|
429
|
+
end
|
|
430
|
+
end,
|
|
431
|
+
suspend = function()
|
|
432
|
+
end,
|
|
433
|
+
shutdown = function()
|
|
434
|
+
if ns.AutomationView then
|
|
435
|
+
ns.AutomationView.HideNotice()
|
|
436
|
+
end
|
|
437
|
+
end,
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if ns.Workbench and type(ns.Workbench.RegisterPage) == "function" then
|
|
441
|
+
ns.Workbench.RegisterPage(definition)
|
|
442
|
+
if type(ns.Workbench.RegisterShutdown) == "function" then
|
|
443
|
+
ns.Workbench.RegisterShutdown(definition.shutdown)
|
|
444
|
+
end
|
|
445
|
+
end
|
|
446
|
+
ns.AutomationPageDefinition = definition
|