lycheedev 3.1.2 → 3.2.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/README.md +16 -38
- package/THIRD_PARTY_NOTICES +4 -314
- package/bin/lycheedev.mjs +1 -1
- package/bin/update.mjs +26 -32
- package/native/windows-amd64/lycheedev.exe +0 -0
- package/package.json +1 -1
- package/payload/addon/Bindings.xml +12 -0
- package/payload/addon/Bridge/ActivityView.lua +2 -5
- package/payload/addon/Bridge/CaptureWriter.lua +9 -115
- package/payload/addon/Bridge/FocusBindings.lua +71 -0
- package/payload/addon/Bridge/InputProtection.lua +2 -9
- package/payload/addon/Bridge/InputState.lua +15 -19
- package/payload/addon/Bridge/MemoryProtocol.lua +1 -1
- package/payload/addon/Bridge/ProbeExecution.lua +1 -0
- package/payload/addon/Bridge/ReceiverBindings.lua +73 -279
- package/payload/addon/Bridge/SlotProtocol.lua +30 -12
- package/payload/addon/Bridge/SlotRuntime.lua +9 -12
- package/payload/addon/Core/ClientGate.lua +2 -0
- package/payload/addon/Core/Compat.lua +25 -24
- package/payload/addon/Core/Controls.lua +27 -248
- package/payload/addon/Core/Execute.lua +22 -19
- package/payload/addon/Core/Locale.lua +4 -116
- package/payload/addon/Core/Locale_enUS.lua +4 -116
- package/payload/addon/Core/Persistence.lua +2 -2
- package/payload/addon/Core/Runtime.lua +46 -64
- package/payload/addon/Core/Serializer.lua +9 -1
- package/payload/addon/Core/Startup.lua +20 -0
- package/payload/addon/Core/Stores.lua +63 -95
- package/payload/addon/LICENSE +21 -0
- package/payload/addon/Lychee Dev.toc +10 -21
- package/payload/addon/Modules/AutomationView.lua +47 -383
- package/payload/addon/Modules/Diagnostics.lua +0 -4
- package/payload/addon/Modules/Events/Catalog.lua +1 -1
- package/payload/addon/Modules/Events/CatalogData_Anniversary.lua +1489 -0
- package/payload/addon/Modules/Events/CatalogData_Era.lua +1489 -0
- package/payload/addon/Modules/FunctionTrace.lua +17 -6
- package/payload/addon/Modules/ObjectInspector.lua +27 -25
- package/payload/addon/THIRD_PARTY_NOTICES +483 -0
- package/payload/addon/UI/Pages/Automation.lua +7 -64
- package/payload/addon/UI/Pages/Events.lua +0 -4
- package/payload/addon/UI/Pages/ExportRecords.lua +1 -1
- package/payload/addon/UI/Pages/Object.lua +5 -4
- package/payload/addon/UI/Pages/Run.lua +7 -1
- package/payload/addon/UI/TreeView.lua +0 -11
- package/payload/addon/UI/Widgets.lua +0 -102
- package/payload/addon/UI/Window.lua +0 -6
- package/payload/skill/SKILL.md +11 -2
- package/payload/skill/references/commands.md +17 -27
- package/payload/skill/references/data-hotfix.md +6 -3
- package/payload/skill/references/data-investigation.md +5 -2
- package/payload/skill/references/data-tables.md +4 -0
- package/payload/skill/references/data-targets.md +4 -2
- package/payload/skill/references/installation.md +9 -3
- package/payload/skill/references/live-investigation.md +14 -6
- package/payload/skill/references/live-probes.md +9 -8
- package/payload/skill/references/live-recovery.md +67 -43
- package/payload/skill/references/live-startup.md +97 -76
- package/payload/skill/references/runtime-investigations.md +10 -8
- package/payload/skill/references/source-preparation.md +23 -2
- package/payload/skill/references/source-research.md +58 -5
- package/payload/skill/scripts/lycheedev.mjs +16 -12
- package/release.json +136 -176
- package/payload/addon/Bridge/Definitions.lua +0 -3
- package/payload/addon/Bridge/FaultRunner.lua +0 -44
- package/payload/addon/Bridge/Identity.lua +0 -127
- package/payload/addon/Bridge/InputProtocol.lua +0 -76
- package/payload/addon/Bridge/InputSignal.lua +0 -36
- package/payload/addon/Bridge/Investigation.lua +0 -159
- package/payload/addon/Bridge/MatrixSymbol.lua +0 -1169
- package/payload/addon/Bridge/ProbeQueue.lua +0 -205
- package/payload/addon/Bridge/ProbeRunner.lua +0 -349
- package/payload/addon/Bridge/ReceiptView.lua +0 -316
- package/payload/addon/Bridge/Receiver.lua +0 -326
- package/payload/addon/Bridge/Reentry.lua +0 -261
- package/payload/addon/Bridge/ReportStore.lua +0 -224
- package/payload/addon/Bridge/Session.lua +0 -173
- package/payload/addon/Bridge/StartupBeacon.lua +0 -63
|
@@ -1,180 +1,18 @@
|
|
|
1
|
-
local
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-- manual Execute remains solely for legacy queue entries. Neither provider
|
|
6
|
-
-- makes this page a second executor or a transport recovery journal.
|
|
7
|
-
--
|
|
8
|
-
-- Real status vocabulary (derived from the bridge surface):
|
|
9
|
-
-- queued lycheedev.queue.v1 entry registered, nothing loaded yet
|
|
10
|
-
-- loaded compiled but not dispatched
|
|
11
|
-
-- running the shared ProbeRunner is executing
|
|
12
|
-
-- finalizing the shared ProbeRunner is releasing resources
|
|
13
|
-
-- reported ReportStore retains the report (awaiting acknowledgement)
|
|
14
|
-
-- acknowledged report acknowledged and removed (acknowledge lifecycle done)
|
|
15
|
-
-- cleared retired: no queue entry, no runner request, no report
|
|
16
|
-
-- unavailable derivation failed; errorCode carries the bridge error code
|
|
17
|
-
local MAX_RECORDS = 200
|
|
18
|
-
local REPORT_DISPLAY_BYTES = 48 * 1024
|
|
19
|
-
local KIND_LUA = "lua"
|
|
20
|
-
|
|
21
|
-
-- Captured before Bridge/ProbeQueue.lua takes ownership of the table (see the
|
|
22
|
-
-- TOC order note). Strictly read-only: used to list queued request ids and
|
|
23
|
-
-- their code digests. When nil (different load order or bridge), the list can
|
|
24
|
-
-- only show report-backed history and says so through HasQueueRegistry().
|
|
25
|
-
local queueDefinitions = ns.ProbeDefinitions
|
|
26
|
-
|
|
27
|
-
local records = {}
|
|
28
|
-
local recordIndex = {}
|
|
29
|
-
local observedSequence = 0
|
|
1
|
+
local _, ns = ...
|
|
2
|
+
-- Read-only workbench projection of the current mailbox history.
|
|
3
|
+
local MAX_RECORDS, REPORT_DISPLAY_BYTES = 200, 48*1024
|
|
4
|
+
local records, recordIndex, observedSequence = {}, {}, 0
|
|
30
5
|
local changeHandler
|
|
31
|
-
|
|
32
|
-
local function Restricted(
|
|
33
|
-
return issecretvalue and issecretvalue(value)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
local function RequestId(value)
|
|
37
|
-
return not Restricted(value) and type(value) == "string"
|
|
38
|
-
and #value > 0 and #value <= 128
|
|
39
|
-
and string.match(value, "^[%w_%-]+$") ~= nil
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
local function BoundedText(value, limit)
|
|
43
|
-
if Restricted(value) or type(value) ~= "string" then
|
|
44
|
-
return nil
|
|
45
|
-
end
|
|
46
|
-
if #value > limit then
|
|
47
|
-
return value:sub(1, limit)
|
|
48
|
-
end
|
|
49
|
-
return value
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
-- Display-only bounded pattern reads over stored report/receipt text. Nothing
|
|
53
|
-
-- is evaluated or rewritten; the stored bodies stay byte-identical.
|
|
54
|
-
local function ReadSignalField(receipt, pattern)
|
|
55
|
-
if Restricted(receipt) or type(receipt) ~= "string" then
|
|
56
|
-
return nil
|
|
57
|
-
end
|
|
58
|
-
return string.match(receipt, pattern)
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
local function IsPending(record)
|
|
62
|
-
return record.pending == true or record.hasReport == true
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
local function IsProtected(record)
|
|
66
|
-
return record.protected == true
|
|
67
|
-
end
|
|
68
|
-
|
|
6
|
+
local function Restricted(v) return issecretvalue and issecretvalue(v) end
|
|
7
|
+
local function RequestId(v) return not Restricted(v) and type(v)=="string" and #v>0 and #v<=128 end
|
|
69
8
|
local function PruneRecordSlot()
|
|
70
|
-
if #records
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
local record = records[index]
|
|
75
|
-
if not IsProtected(record) and not IsPending(record) then
|
|
76
|
-
table.remove(records, index)
|
|
77
|
-
recordIndex[record.requestId] = nil
|
|
78
|
-
return true
|
|
79
|
-
end
|
|
80
|
-
end
|
|
9
|
+
if #records<MAX_RECORDS then return true end
|
|
10
|
+
for i,r in ipairs(records) do if not r.protected and not r.pending and not r.hasReport then
|
|
11
|
+
recordIndex[r.requestId]=nil;table.remove(records,i);return true
|
|
12
|
+
end end
|
|
81
13
|
return false
|
|
82
14
|
end
|
|
83
|
-
|
|
84
|
-
local function ReportRead(requestId)
|
|
85
|
-
if not ns.ReportStore or type(ns.ReportStore.Read) ~= "function" then
|
|
86
|
-
return nil, "bridge_unavailable"
|
|
87
|
-
end
|
|
88
|
-
return ns.ReportStore.Read(requestId)
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
-- Side-effect-free status derivation from the bridge records only.
|
|
92
|
-
local function DeriveStatus(requestId)
|
|
93
|
-
local receipt, bodyOrReason = ReportRead(requestId)
|
|
94
|
-
if receipt then
|
|
95
|
-
return "reported", nil, receipt, bodyOrReason
|
|
96
|
-
end
|
|
97
|
-
if bodyOrReason ~= "report_unavailable" then
|
|
98
|
-
return "unavailable", bodyOrReason
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
if ns.ReportStore and type(ns.ReportStore.Acknowledged) == "function" then
|
|
102
|
-
local acknowledged = ns.ReportStore.Acknowledged(requestId)
|
|
103
|
-
if acknowledged then
|
|
104
|
-
return "acknowledged", nil, acknowledged
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
if not ns.ProbeRunner or type(ns.ProbeRunner.Reported) ~= "function"
|
|
109
|
-
or type(ns.ProbeRunner.VerifyAbsent) ~= "function" then
|
|
110
|
-
return "unavailable", "bridge_unavailable"
|
|
111
|
-
end
|
|
112
|
-
local reportedReceipt, reportedReason = ns.ProbeRunner.Reported(requestId)
|
|
113
|
-
if reportedReceipt then
|
|
114
|
-
return "reported", nil, reportedReceipt
|
|
115
|
-
end
|
|
116
|
-
if reportedReason == "report_unavailable" then
|
|
117
|
-
-- Runner reported once and the report was acknowledged away.
|
|
118
|
-
return "acknowledged"
|
|
119
|
-
elseif reportedReason ~= "probe_not_reported" then
|
|
120
|
-
return "unavailable", reportedReason
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
local absent, probeReason = ns.ProbeRunner.VerifyAbsent(requestId)
|
|
124
|
-
if absent == true then
|
|
125
|
-
if not ns.ProbeQueue or type(ns.ProbeQueue.ReloadScope) ~= "function" then
|
|
126
|
-
return "unavailable", "bridge_unavailable"
|
|
127
|
-
end
|
|
128
|
-
local scope, scopeReason = ns.ProbeQueue.ReloadScope(requestId)
|
|
129
|
-
if scope then
|
|
130
|
-
return "queued"
|
|
131
|
-
elseif scopeReason == "queue_request_missing" then
|
|
132
|
-
return "cleared"
|
|
133
|
-
end
|
|
134
|
-
return "unavailable", scopeReason
|
|
135
|
-
elseif probeReason == "probe_still_retained" then
|
|
136
|
-
if type(ns.ProbeRunner.State)=="function" then
|
|
137
|
-
local phase=ns.ProbeRunner.State(requestId)
|
|
138
|
-
if phase=="running" then return "running" end
|
|
139
|
-
if phase=="settling" then return "finalizing" end
|
|
140
|
-
if phase=="quarantined" or phase=="unresolved" then return "unavailable","probe_"..phase end
|
|
141
|
-
end
|
|
142
|
-
return "loaded"
|
|
143
|
-
end
|
|
144
|
-
return "unavailable", probeReason
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
local function ApplyDerived(record)
|
|
148
|
-
if record.transport == "memory-slot" then return record end
|
|
149
|
-
record.status, record.errorCode = nil, nil
|
|
150
|
-
record.receipt, record.reportBody, record.hasReport = nil, nil, nil
|
|
151
|
-
record.probeStatus, record.probeError = nil, nil
|
|
152
|
-
|
|
153
|
-
local status, errorCode, receipt, body = DeriveStatus(record.requestId)
|
|
154
|
-
record.status = status
|
|
155
|
-
record.errorCode = errorCode
|
|
156
|
-
if receipt then
|
|
157
|
-
record.receipt = receipt
|
|
158
|
-
record.hasReport = status == "reported" and true or nil
|
|
159
|
-
record.signalKind = ReadSignalField(receipt, '"kind":"(%a+)"')
|
|
160
|
-
local sequence = ReadSignalField(receipt, '"sequence":(%d+)')
|
|
161
|
-
record.sequence = sequence and tonumber(sequence) or nil
|
|
162
|
-
if record.codeBytes == nil then
|
|
163
|
-
local codeBytes = ReadSignalField(receipt, '"codeBytes":(%d+)')
|
|
164
|
-
record.codeBytes = codeBytes and tonumber(codeBytes) or nil
|
|
165
|
-
end
|
|
166
|
-
if record.codeAdler32 == nil then
|
|
167
|
-
record.codeAdler32 = ReadSignalField(receipt, '"codeAdler32":"([0-9a-f]+)"')
|
|
168
|
-
end
|
|
169
|
-
end
|
|
170
|
-
if status == "reported" and type(body) == "string" and not Restricted(body) then
|
|
171
|
-
record.reportBody = body
|
|
172
|
-
record.probeStatus = string.match(body, '"probeStatus":"(%a+)"')
|
|
173
|
-
record.probeError = BoundedText(string.match(body, '"error":"([^"]*)"'), 128)
|
|
174
|
-
end
|
|
175
|
-
return record
|
|
176
|
-
end
|
|
177
|
-
|
|
15
|
+
local KIND_LUA="lua"
|
|
178
16
|
local function Observe(incoming)
|
|
179
17
|
if type(incoming) ~= "table" or not RequestId(incoming.requestId) then
|
|
180
18
|
return nil, "auto_invalid_request"
|
|
@@ -204,220 +42,46 @@ local function Observe(incoming)
|
|
|
204
42
|
return record
|
|
205
43
|
end
|
|
206
44
|
|
|
207
|
-
local function Collect()
|
|
208
|
-
if ns.AutomationHistory then
|
|
209
|
-
local current = {}
|
|
210
|
-
for _,stored in ipairs(ns.AutomationHistory.List()) do
|
|
211
|
-
local incoming={transport="memory-slot",kind=KIND_LUA}
|
|
212
|
-
for key,value in pairs(stored) do incoming[key]=value end
|
|
213
|
-
current[incoming.requestId]=true
|
|
214
|
-
Observe(incoming)
|
|
215
|
-
end
|
|
216
|
-
for index=#records,1,-1 do
|
|
217
|
-
local record=records[index]
|
|
218
|
-
if record.transport=="memory-slot" and not current[record.requestId] then
|
|
219
|
-
recordIndex[record.requestId]=nil;table.remove(records,index)
|
|
220
|
-
end
|
|
221
|
-
end
|
|
222
|
-
end
|
|
223
|
-
if not ns.ProbeQueue and not ns.ReportStore and not ns.Persistence then
|
|
224
|
-
return 0
|
|
225
|
-
end
|
|
226
45
|
|
|
227
|
-
|
|
228
|
-
local
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
if ns.Persistence and type(ns.Persistence.Bridge) == "function" then
|
|
243
|
-
state = ns.Persistence.Bridge()
|
|
244
|
-
end
|
|
245
|
-
if type(state) == "table" and not Restricted(state) then
|
|
246
|
-
local reports = state.reports
|
|
247
|
-
if type(reports) == "table" and not Restricted(reports) then
|
|
248
|
-
for id in pairs(reports) do
|
|
249
|
-
if RequestId(id) and not seen[id] then
|
|
250
|
-
seen[id] = true
|
|
251
|
-
discovered[#discovered + 1] = id
|
|
252
|
-
end
|
|
253
|
-
end
|
|
254
|
-
end
|
|
255
|
-
local ticket = state.reentry
|
|
256
|
-
if type(ticket) == "table" and not Restricted(ticket) and RequestId(ticket.requestId)
|
|
257
|
-
and not seen[ticket.requestId] then
|
|
258
|
-
seen[ticket.requestId] = true
|
|
259
|
-
discovered[#discovered + 1] = ticket.requestId
|
|
260
|
-
end
|
|
261
|
-
end
|
|
262
|
-
|
|
263
|
-
-- Deterministic within one pass; across passes later-observed ids are
|
|
264
|
-
-- newer (they get the higher observation sequence).
|
|
265
|
-
table.sort(discovered)
|
|
266
|
-
for index = 1, #discovered do
|
|
267
|
-
local requestId = discovered[index]
|
|
268
|
-
local record = recordIndex[requestId]
|
|
269
|
-
if not record then
|
|
270
|
-
record = Observe({ requestId = requestId })
|
|
271
|
-
end
|
|
272
|
-
if record then
|
|
273
|
-
local entry = entries and entries[requestId] or nil
|
|
274
|
-
if type(entry) == "table" and not Restricted(entry) then
|
|
275
|
-
record.codeBytes = entry.codeBytes
|
|
276
|
-
record.codeSHA256 = entry.codeSHA256
|
|
277
|
-
record.codeAdler32 = entry.codeAdler32
|
|
278
|
-
end
|
|
279
|
-
ApplyDerived(record)
|
|
280
|
-
end
|
|
281
|
-
end
|
|
282
|
-
return #discovered
|
|
283
|
-
end
|
|
284
|
-
|
|
285
|
-
local function GetOrder()
|
|
286
|
-
local order = {}
|
|
287
|
-
for index = #records, 1, -1 do
|
|
288
|
-
order[#order + 1] = records[index].requestId
|
|
289
|
-
end
|
|
290
|
-
return order
|
|
291
|
-
end
|
|
292
|
-
|
|
293
|
-
local function GetRecord(target)
|
|
294
|
-
if type(target) == "table" then
|
|
295
|
-
return target
|
|
296
|
-
end
|
|
297
|
-
return RequestId(target) and recordIndex[target] or nil
|
|
298
|
-
end
|
|
299
|
-
|
|
300
|
-
local function RefreshRecord(target)
|
|
301
|
-
local record = GetRecord(target)
|
|
302
|
-
if not record then
|
|
303
|
-
return nil, "auto_execution_unknown"
|
|
304
|
-
end
|
|
305
|
-
ApplyDerived(record)
|
|
306
|
-
return record
|
|
307
|
-
end
|
|
308
|
-
|
|
309
|
-
-- Manual execute: the same two calls the /dev bridge load/run verbs make, in
|
|
310
|
-
-- the same order. When the bridge or session context is absent the honest
|
|
311
|
-
-- bridge error code is returned instead of inventing one.
|
|
312
|
-
local function Execute(target)
|
|
313
|
-
local record = GetRecord(target)
|
|
314
|
-
if not record then
|
|
315
|
-
return nil, "auto_execution_unknown"
|
|
316
|
-
end
|
|
317
|
-
if record.transport=="memory-slot" then return nil,"auto_history_read_only" end
|
|
318
|
-
if not ns.ProbeQueue or type(ns.ProbeQueue.Load) ~= "function"
|
|
319
|
-
or not ns.ProbeRunner or type(ns.ProbeRunner.Dispatch) ~= "function" then
|
|
320
|
-
return nil, "bridge_unavailable"
|
|
321
|
-
end
|
|
322
|
-
local loadReceipt, loadReason = ns.ProbeQueue.Load(record.requestId)
|
|
323
|
-
if not loadReceipt and loadReason ~= "probe_request_exists" then
|
|
324
|
-
return nil, loadReason
|
|
325
|
-
end
|
|
326
|
-
return ns.ProbeRunner.Dispatch(record.requestId)
|
|
327
|
-
end
|
|
328
|
-
|
|
329
|
-
local function ShowNotice(target)
|
|
330
|
-
local record = GetRecord(target)
|
|
331
|
-
if not record then
|
|
332
|
-
return nil, "auto_execution_unknown"
|
|
333
|
-
end
|
|
334
|
-
if record.transport=="memory-slot" then return nil,"auto_notice_unavailable" end
|
|
335
|
-
local receipt = record.receipt
|
|
336
|
-
if not receipt then
|
|
337
|
-
receipt = ReportRead(record.requestId)
|
|
338
|
-
end
|
|
339
|
-
if Restricted(receipt) or type(receipt) ~= "string" or #receipt == 0 then
|
|
340
|
-
return nil, "auto_notice_unavailable"
|
|
341
|
-
end
|
|
342
|
-
if not ns.ReceiptView or type(ns.ReceiptView.Show) ~= "function" then
|
|
343
|
-
return nil, "bridge_unavailable"
|
|
344
|
-
end
|
|
345
|
-
-- Read-only redisplay through the one overlay system.
|
|
346
|
-
return ns.ReceiptView.Show(receipt)
|
|
347
|
-
end
|
|
348
|
-
|
|
349
|
-
local function HideNotice()
|
|
350
|
-
if ns.ReceiptView and type(ns.ReceiptView.Hide) == "function" then
|
|
351
|
-
ns.ReceiptView.Hide()
|
|
352
|
-
end
|
|
353
|
-
return true
|
|
354
|
-
end
|
|
355
|
-
|
|
356
|
-
-- Display text for the report view. The 48 KB display cap only bounds the
|
|
357
|
-
-- returned string; the stored body is never modified.
|
|
46
|
+
local function Collect()
|
|
47
|
+
local current={}
|
|
48
|
+
for _,stored in ipairs(ns.AutomationHistory.List()) do
|
|
49
|
+
local incoming={transport="memory-slot",kind="lua"}
|
|
50
|
+
for key,value in pairs(stored) do incoming[key]=value end
|
|
51
|
+
current[incoming.requestId]=true
|
|
52
|
+
local old=recordIndex[incoming.requestId]
|
|
53
|
+
-- Clear fields removed by the current persisted record.
|
|
54
|
+
if old then for key in pairs(old) do if key~="requestId" and key~="observedSeq" and key~="protected" then old[key]=nil end end end
|
|
55
|
+
Observe(incoming)
|
|
56
|
+
end
|
|
57
|
+
for i=#records,1,-1 do local r=records[i];if not current[r.requestId] then recordIndex[r.requestId]=nil;table.remove(records,i) end end
|
|
58
|
+
return #records
|
|
59
|
+
end
|
|
60
|
+
local function GetRecord(target) return type(target)=="table" and target or recordIndex[target] end
|
|
358
61
|
local function GetReportText(target)
|
|
359
|
-
local
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
end
|
|
363
|
-
|
|
364
|
-
if body
|
|
365
|
-
local receipt, stored = ReportRead(record.requestId)
|
|
366
|
-
body = receipt and stored or nil
|
|
367
|
-
end
|
|
368
|
-
if Restricted(body) then
|
|
369
|
-
return "<secret>"
|
|
370
|
-
end
|
|
371
|
-
if type(body) ~= "string" then
|
|
372
|
-
return nil, ns.L.AUTO_NO_REPORT
|
|
373
|
-
end
|
|
374
|
-
if record.reportTruncated then
|
|
375
|
-
return body .. "\n... " .. string.format(ns.L.AUTO_REPORT_HISTORY_LIMIT, ns.AutomationHistory.REPORT_BYTES / 1024)
|
|
376
|
-
end
|
|
377
|
-
if #body > REPORT_DISPLAY_BYTES then
|
|
378
|
-
return body:sub(1, REPORT_DISPLAY_BYTES)
|
|
379
|
-
.. "\n... " .. string.format(ns.L.AUTO_REPORT_DISPLAY_LIMIT, REPORT_DISPLAY_BYTES / 1024)
|
|
380
|
-
end
|
|
62
|
+
local r=GetRecord(target);if not r then return nil,"auto_execution_unknown" end
|
|
63
|
+
local body=r.reportBody
|
|
64
|
+
if Restricted(body) then return "<secret>" end
|
|
65
|
+
if type(body)~="string" then return nil,ns.L.AUTO_NO_REPORT end
|
|
66
|
+
if r.reportTruncated then return body.."\n... "..string.format(ns.L.AUTO_REPORT_HISTORY_LIMIT,ns.AutomationHistory.REPORT_BYTES/1024) end
|
|
67
|
+
if #body>REPORT_DISPLAY_BYTES then return body:sub(1,REPORT_DISPLAY_BYTES).."\n... "..string.format(ns.L.AUTO_REPORT_DISPLAY_LIMIT,REPORT_DISPLAY_BYTES/1024) end
|
|
381
68
|
return body
|
|
382
69
|
end
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
70
|
+
ns.AutomationView={
|
|
71
|
+
MAX_RECORDS=MAX_RECORDS,REPORT_DISPLAY_BYTES=REPORT_DISPLAY_BYTES,
|
|
72
|
+
SetChangeHandler=function(handler)changeHandler=handler end,
|
|
73
|
+
Changed=function()if changeHandler then pcall(changeHandler) end end,
|
|
74
|
+
Observe=Observe,Collect=Collect,GetRecord=GetRecord,GetReportText=GetReportText,
|
|
75
|
+
GetCount=function()return #records end,
|
|
76
|
+
GetOrder=function()local out={};for i=#records,1,-1 do out[#out+1]=records[i].requestId end;return out end,
|
|
77
|
+
RefreshRecord=function(target)local r=GetRecord(target);return r,r==nil and "auto_execution_unknown" or nil end,
|
|
78
|
+
ClearRecords=function()
|
|
79
|
+
local removed=0
|
|
80
|
+
for i=#records,1,-1 do local r=records[i]
|
|
81
|
+
if not r.protected and not r.pending and not r.hasReport then
|
|
82
|
+
ns.AutomationHistory.Remove(r.requestId);recordIndex[r.requestId]=nil;table.remove(records,i);removed=removed+1
|
|
83
|
+
end
|
|
396
84
|
end
|
|
397
|
-
|
|
398
|
-
return removed
|
|
399
|
-
end
|
|
400
|
-
|
|
401
|
-
ns.AutomationView = {
|
|
402
|
-
SetChangeHandler = function(handler) changeHandler=handler end,
|
|
403
|
-
Changed = function() if changeHandler then pcall(changeHandler) end end,
|
|
404
|
-
MAX_RECORDS = MAX_RECORDS,
|
|
405
|
-
REPORT_DISPLAY_BYTES = REPORT_DISPLAY_BYTES,
|
|
406
|
-
Observe = Observe,
|
|
407
|
-
Collect = Collect,
|
|
408
|
-
GetOrder = GetOrder,
|
|
409
|
-
GetRecord = GetRecord,
|
|
410
|
-
GetCount = function()
|
|
411
|
-
return #records
|
|
412
|
-
end,
|
|
413
|
-
DeriveStatus = DeriveStatus,
|
|
414
|
-
RefreshRecord = RefreshRecord,
|
|
415
|
-
Execute = Execute,
|
|
416
|
-
ShowNotice = ShowNotice,
|
|
417
|
-
HideNotice = HideNotice,
|
|
418
|
-
GetReportText = GetReportText,
|
|
419
|
-
ClearRecords = ClearRecords,
|
|
420
|
-
HasQueueRegistry = function()
|
|
421
|
-
return type(queueDefinitions) == "table" and type(queueDefinitions.entries) == "table"
|
|
85
|
+
return removed
|
|
422
86
|
end,
|
|
423
87
|
}
|
|
@@ -164,10 +164,6 @@ function diagnostics.FormatAgentReport(entry)
|
|
|
164
164
|
return table.concat(sections, "\n")
|
|
165
165
|
end
|
|
166
166
|
|
|
167
|
-
function diagnostics.FormatError(entry)
|
|
168
|
-
return diagnostics.FormatAgentReport(entry)
|
|
169
|
-
end
|
|
170
|
-
|
|
171
167
|
function diagnostics.ResetErrors()
|
|
172
168
|
if ns.Safety.IsCombatBlocked() then
|
|
173
169
|
return false, ns.L.COMBAT_BLOCKED
|
|
@@ -4,7 +4,7 @@ local ADDON_NAME, ns = ...
|
|
|
4
4
|
-- (ns.EventCatalogData: alternating name, payloadSignature strings). Data is
|
|
5
5
|
-- sorted by literal event name, so Find is a binary search. No frames, events
|
|
6
6
|
-- or hooks are created here; selection editing stays pure Lua state.
|
|
7
|
-
-- All
|
|
7
|
+
-- All client catalogs load in one TOC under per-product fields
|
|
8
8
|
-- (EventCatalogData_<product>); the runtime client gate's product selects the
|
|
9
9
|
-- table here at load time. An unknown client has no catalog, which surfaces as
|
|
10
10
|
-- an empty catalog rather than wrong data.
|