lycheedev 2.5.1 → 3.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/native/windows-amd64/lycheedev.exe +0 -0
- package/package.json +1 -1
- package/payload/addon/Bridge/ActivityView.lua +26 -12
- package/payload/addon/Bridge/InputProtection.lua +63 -0
- package/payload/addon/Bridge/InputSignal.lua +36 -0
- package/payload/addon/Bridge/InputState.lua +93 -0
- package/payload/addon/Bridge/MemoryProtocol.lua +31 -0
- package/payload/addon/Bridge/ProbeExecution.lua +147 -0
- package/payload/addon/Bridge/ReceiverBindings.lua +6 -0
- package/payload/addon/Bridge/SlotProtocol.lua +172 -0
- package/payload/addon/Bridge/SlotRuntime.lua +125 -0
- package/payload/addon/Bridge/StartupBeacon.lua +8 -11
- package/payload/addon/Core/Compat.lua +16 -0
- package/payload/addon/Core/Controls.lua +16 -0
- package/payload/addon/Core/Locale.lua +6 -4
- package/payload/addon/Core/Locale_enUS.lua +4 -2
- package/payload/addon/Core/Platform.lua +4 -2
- package/payload/addon/Core/Runtime.lua +17 -6
- package/payload/addon/Lychee Dev.toc +9 -2
- package/payload/addon/Modules/AutomationHistory.lua +119 -0
- package/payload/addon/Modules/AutomationView.lua +26 -6
- package/payload/addon/UI/Pages/About.lua +0 -3
- package/payload/addon/UI/Pages/Automation.lua +40 -27
- package/payload/addon/UI/Pages/Diagnostics.lua +2 -4
- package/payload/addon/UI/Pages/Object.lua +0 -1
- package/payload/addon/UI/Pages/Run.lua +2 -1
- package/payload/addon/UI/Pages/Trace.lua +0 -1
- package/payload/addon/UI/Theme.lua +3 -2
- package/payload/addon/UI/Widgets.lua +32 -22
- package/payload/addon/UI/Window.lua +3 -35
- package/payload/skill/SKILL.md +89 -162
- package/payload/skill/agents/openai.yaml +2 -2
- package/payload/skill/references/asset-export.md +1 -1
- package/payload/skill/references/commands.md +37 -35
- package/payload/skill/references/data-hotfix.md +112 -0
- package/payload/skill/references/data-investigation.md +74 -320
- package/payload/skill/references/data-recovery.md +55 -0
- package/payload/skill/references/data-tables.md +170 -0
- package/payload/skill/references/data-targets.md +93 -0
- package/payload/skill/references/error-diagnosis.md +8 -12
- package/payload/skill/references/installation.md +20 -13
- package/payload/skill/references/live-investigation.md +84 -367
- package/payload/skill/references/live-probes.md +160 -0
- package/payload/skill/references/live-recovery.md +190 -0
- package/payload/skill/references/live-startup.md +63 -133
- package/payload/skill/references/runtime-investigations.md +17 -3
- package/payload/skill/references/source-preparation.md +58 -0
- package/payload/skill/references/source-relations.md +51 -0
- package/payload/skill/references/source-research.md +66 -162
- package/payload/skill/references/source-value-flow.md +48 -0
- package/release.json +155 -75
- package/payload/addon/UI/Pages/Settings.lua +0 -82
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
local _, ns = ...
|
|
2
|
+
|
|
3
|
+
-- Pure bounded protocol engine. Host input, frames, file loading and async
|
|
4
|
+
-- execution are adapters; there is only one owner and one active business job.
|
|
5
|
+
local ZERO=string.rep("0",32)
|
|
6
|
+
local LIMIT=200
|
|
7
|
+
local MAX_OPERATIONS=math.floor((LIMIT-16)/4)
|
|
8
|
+
local function plain(v)return not (issecretvalue and issecretvalue(v)) and type(v)=="table" and getmetatable(v)==nil end
|
|
9
|
+
local function safe(v)return not (issecretvalue and issecretvalue(v))end
|
|
10
|
+
|
|
11
|
+
ns.SlotProtocol = { Count=LIMIT, Create=function(adapter)
|
|
12
|
+
assert(plain(adapter) and ns.MemoryProtocol.Token(adapter.runtime),"invalid slot adapter")
|
|
13
|
+
local wire=ns.MemoryProtocol
|
|
14
|
+
local owner,fence,active,pending
|
|
15
|
+
local sequence,count,cursor=0,0,1
|
|
16
|
+
local consumed,operations,receipts={},{},{}
|
|
17
|
+
local descriptor
|
|
18
|
+
local api={}
|
|
19
|
+
local function observe(op)
|
|
20
|
+
if adapter.observe then
|
|
21
|
+
local ok,result,reason=pcall(adapter.observe,op)
|
|
22
|
+
op.historyError=not ok and "automation_history_failed" or (not result and reason or nil)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
local function nextSlot()
|
|
26
|
+
while cursor<=LIMIT and consumed[cursor] do cursor=cursor+1 end
|
|
27
|
+
return cursor
|
|
28
|
+
end
|
|
29
|
+
local function actor()
|
|
30
|
+
local value=adapter.actor()
|
|
31
|
+
if not plain(value) or not safe(value.guid) or not safe(value.character) or not safe(value.realm)
|
|
32
|
+
or type(value.guid)~="string" or type(value.character)~="string" or type(value.realm)~="string" then return nil end
|
|
33
|
+
return value
|
|
34
|
+
end
|
|
35
|
+
local function encode(value,limit)
|
|
36
|
+
local text,reason=adapter.encode(value,limit)
|
|
37
|
+
if not text then return nil,reason end
|
|
38
|
+
return text
|
|
39
|
+
end
|
|
40
|
+
local function publish(e,state,extra,kind)
|
|
41
|
+
if sequence>=4294967295 then return nil,"slot_sequence_exhausted" end
|
|
42
|
+
local a=actor();if not a then return nil,"slot_actor_unavailable" end
|
|
43
|
+
sequence=sequence+1
|
|
44
|
+
local value={schema="lycheedev.slot.v2",runtime=adapter.runtime,owner=owner or "",fence=fence or 0,
|
|
45
|
+
nonce=e.nonce,ticket=e.ticket or ZERO,action=e.action,state=state,sequence=sequence,
|
|
46
|
+
nextSlot=nextSlot(),slots=LIMIT,character=a.character,realm=a.realm,guid=a.guid,
|
|
47
|
+
build=adapter.build,product=adapter.product,release=adapter.release,inventory=adapter.inventory,inputState=adapter.inputState}
|
|
48
|
+
for k,v in pairs(extra or {}) do value[k]=v end
|
|
49
|
+
local text,reason=encode(value,16384);if not text then return nil,reason end
|
|
50
|
+
local record;record,reason=wire.Encode(e.nonce,adapter.runtime,e.ticket or ZERO,kind or 2,1,sequence,text)
|
|
51
|
+
if not record then return nil,reason end
|
|
52
|
+
receipts[e.nonce]=record
|
|
53
|
+
return record,value
|
|
54
|
+
end
|
|
55
|
+
function api.Describe()
|
|
56
|
+
local a=actor();if not a then return nil,"slot_actor_unavailable" end
|
|
57
|
+
local text=encode({schema="lycheedev.slot.identity.v1",runtime=adapter.runtime,owner=owner or "",fence=fence or 0,
|
|
58
|
+
nextSlot=nextSlot(),slots=LIMIT,character=a.character,realm=a.realm,guid=a.guid,
|
|
59
|
+
build=adapter.build,product=adapter.product,release=adapter.release,inventory=adapter.inventory,inputState=adapter.inputState},16384)
|
|
60
|
+
if not text then return nil,"slot_identity_encoding" end
|
|
61
|
+
descriptor=wire.Encode(ZERO,adapter.runtime,ZERO,1,1,sequence,text)
|
|
62
|
+
return descriptor
|
|
63
|
+
end
|
|
64
|
+
local function finish(op,ok,value,metadata)
|
|
65
|
+
if op.state~="running" then return nil,"slot_not_running" end
|
|
66
|
+
op.resourcesReleased=not metadata or metadata.resourcesReleased~=false
|
|
67
|
+
local text,reason=encode({ok=ok,result=ok and value or nil,error=not ok and value or nil,
|
|
68
|
+
resourcesReleased=op.resourcesReleased,logs=metadata and metadata.logs or nil},524288)
|
|
69
|
+
if not text then ok=false;text=assert(encode({ok=false,error=type(reason)=="string" and reason or "report_encoding_failed"},16384)) end
|
|
70
|
+
-- Store body and outcome before constructing its public response.
|
|
71
|
+
op.payload=text;op.bytes=#text;op.checksum=wire.Checksum(text)
|
|
72
|
+
op.body=assert(wire.Encode(op.envelope.nonce,adapter.runtime,op.envelope.ticket,3,3,op.sequence,text))
|
|
73
|
+
op.state="reported";op.ok=ok
|
|
74
|
+
observe(op)
|
|
75
|
+
local record,value=publish(op.envelope,"reported",{reportBytes=op.bytes,reportChecksum=op.checksum,challenge=op.challenge})
|
|
76
|
+
if adapter.activity then adapter.activity("collecting",op.envelope.ticket) end
|
|
77
|
+
return record,value
|
|
78
|
+
end
|
|
79
|
+
local function reject(e,reason)
|
|
80
|
+
if plain(e) and wire.Token(e.nonce) and (e.ticket==nil or wire.Token(e.ticket)) then return publish(e,"rejected",{reason=reason}) end
|
|
81
|
+
return nil,reason
|
|
82
|
+
end
|
|
83
|
+
function api.Receive(index,e)
|
|
84
|
+
if type(index)~="number" or index%1~=0 or index<1 or index>LIMIT then return nil,"slot_index_invalid" end
|
|
85
|
+
if consumed[index] then return nil,"slot_already_consumed" end
|
|
86
|
+
consumed[index]=true -- Load-on-demand is consumed even by invalid data.
|
|
87
|
+
if e==nil then return nil,"slot_skipped_empty",true end
|
|
88
|
+
if not plain(e) then return nil,"slot_envelope_invalid" end
|
|
89
|
+
-- Never inspect or execute encoded business code before these checks.
|
|
90
|
+
for _,key in ipairs({"schema","index","runtime","owner","fence","nonce","ticket","action","guid","build","challenge","preparedNonce","reportBytes","reportChecksum"}) do if not safe(e[key]) then return nil,"slot_secret_envelope" end end
|
|
91
|
+
if e.schema~="lycheedev.slot.v2" or e.index~=index or not wire.Token(e.nonce)
|
|
92
|
+
or not wire.Token(e.ticket) or not wire.Token(e.owner) or not wire.Token(e.runtime) then return nil,"slot_envelope_invalid" end
|
|
93
|
+
if e.runtime~=adapter.runtime then
|
|
94
|
+
if type(e.guid)~="string" or type(e.build)~="string"
|
|
95
|
+
or type(e.fence)~="number" or e.fence<1 or e.fence%1~=0 or e.fence>9007199254740991
|
|
96
|
+
or (e.action~="bind" and e.action~="prepare" and e.action~="commit" and e.action~="confirm" and e.action~="release" and e.action~="unbind") then return nil,"slot_envelope_invalid" end
|
|
97
|
+
return nil,"slot_skipped_foreign",true
|
|
98
|
+
end
|
|
99
|
+
if receipts[e.nonce] then return receipts[e.nonce],"slot_nonce_reused" end
|
|
100
|
+
local a=actor();if not a or a.guid~=e.guid or e.build~=adapter.build then return reject(e,"slot_target_changed") end
|
|
101
|
+
if type(e.fence)~="number" or e.fence<1 or e.fence%1~=0 or e.fence>9007199254740991 then return reject(e,"slot_fence_invalid") end
|
|
102
|
+
if e.action=="bind" then
|
|
103
|
+
if owner and owner~=e.owner then return reject(e,"slot_owner_busy") end
|
|
104
|
+
if fence and e.fence<fence then return reject(e,"slot_stale_driver") end
|
|
105
|
+
owner,fence=e.owner,e.fence
|
|
106
|
+
api.Describe()
|
|
107
|
+
return publish(e,"bound")
|
|
108
|
+
end
|
|
109
|
+
if owner~=e.owner or fence~=e.fence then return reject(e,"slot_owner_mismatch") end
|
|
110
|
+
if e.action=="prepare" then
|
|
111
|
+
if active or pending then return reject(e,"slot_busy") end
|
|
112
|
+
if operations[e.ticket] then return reject(e,"slot_operation_exists") end
|
|
113
|
+
if nextSlot()>LIMIT-3 or count>=MAX_OPERATIONS then return reject(e,"slot_capacity") end
|
|
114
|
+
if not safe(e.code) or type(e.code)~="string" or #e.code<1 or #e.code>262144 or e.code:byte(1)==27
|
|
115
|
+
or not safe(e.codeBytes) or e.codeBytes~=#e.code or not safe(e.codeChecksum) or e.codeChecksum~=wire.Checksum(e.code)
|
|
116
|
+
or not safe(e.budget) or type(e.budget)~="number" or e.budget%1~=0 or e.budget<1 or e.budget>120 then return reject(e,"slot_code_invalid") end
|
|
117
|
+
local fn,reason=adapter.compile(e.code)
|
|
118
|
+
local challenge=adapter.runtime:sub(1,24)..string.format("%08x",sequence+1)
|
|
119
|
+
if not fn then
|
|
120
|
+
local op={envelope=e,challenge=challenge,sequence=sequence+1,state="running"}
|
|
121
|
+
operations[e.ticket]=op;active=op;count=count+1
|
|
122
|
+
if adapter.releaseInput then adapter.releaseInput() end
|
|
123
|
+
return finish(op,false,{kind="compile_error",message=reason or "slot_compile_failed"})
|
|
124
|
+
end
|
|
125
|
+
pending={envelope=e,fn=fn,challenge=challenge,sequence=sequence+1,state="prepared"}
|
|
126
|
+
operations[e.ticket]=pending;count=count+1
|
|
127
|
+
observe(pending)
|
|
128
|
+
return publish(e,"prepared",{challenge=challenge})
|
|
129
|
+
elseif e.action=="commit" then
|
|
130
|
+
if not pending or pending.envelope.ticket~=e.ticket or pending.challenge~=e.challenge
|
|
131
|
+
or pending.envelope.nonce~=e.preparedNonce then return reject(e,"slot_commit_mismatch") end
|
|
132
|
+
active=pending;pending=nil;active.state="running"
|
|
133
|
+
local op=active
|
|
134
|
+
observe(op)
|
|
135
|
+
local record,value=publish(e,"accepted")
|
|
136
|
+
if adapter.releaseInput then adapter.releaseInput() end
|
|
137
|
+
if adapter.activity then adapter.activity("running",e.ticket) end
|
|
138
|
+
local ok,reason=pcall(adapter.execute,op.fn,op.envelope.budget,function(ok,result,metadata)return finish(op,ok,result,metadata)end)
|
|
139
|
+
if not ok and op.state=="running" then finish(op,false,"probe_executor_error") end
|
|
140
|
+
return record,value
|
|
141
|
+
elseif e.action=="confirm" then
|
|
142
|
+
local op=operations[e.ticket]
|
|
143
|
+
if not op then return publish(e,"absent",nil,4) end
|
|
144
|
+
return publish(e,op.state,{preparedNonce=op.envelope.nonce,reportBytes=op.bytes,reportChecksum=op.checksum,challenge=op.challenge},4)
|
|
145
|
+
elseif e.action=="release" then
|
|
146
|
+
local op=operations[e.ticket]
|
|
147
|
+
if not op or (op.state~="reported" and op.state~="released")
|
|
148
|
+
or e.reportBytes~=op.bytes or e.reportChecksum~=op.checksum then return reject(e,"slot_release_mismatch") end
|
|
149
|
+
if op.resourcesReleased==false then return reject(e,"slot_resources_pending") end
|
|
150
|
+
op.payload=nil;op.body=nil;op.fn=nil;op.state="released"
|
|
151
|
+
-- Retain identity/digest tombstone; never re-admit its ticket.
|
|
152
|
+
op.envelope.code=nil
|
|
153
|
+
observe(op)
|
|
154
|
+
if active==op then active=nil end
|
|
155
|
+
if adapter.activity then adapter.activity("idle",e.ticket) end
|
|
156
|
+
return publish(e,"released")
|
|
157
|
+
elseif e.action=="unbind" then
|
|
158
|
+
if active or pending then return reject(e,"slot_busy") end
|
|
159
|
+
local record,value=publish(e,"unbound")
|
|
160
|
+
owner,fence=nil,nil;api.Describe();return record,value
|
|
161
|
+
end
|
|
162
|
+
return reject(e,"slot_action_invalid")
|
|
163
|
+
end
|
|
164
|
+
function api.NextSlot()return nextSlot()end
|
|
165
|
+
function api.InputIdentity()
|
|
166
|
+
local a=actor();if not a then return nil end
|
|
167
|
+
return {runtime=adapter.runtime,owner=owner or "",fence=fence or 0,nextSlot=nextSlot(),
|
|
168
|
+
guid=a.guid,build=adapter.build,character=a.character,realm=a.realm}
|
|
169
|
+
end
|
|
170
|
+
function api.Snapshot()return {descriptor=descriptor,receipts=receipts,operations=operations,owner=owner,fence=fence,consumed=consumed}end
|
|
171
|
+
return api
|
|
172
|
+
end }
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
local _, ns = ...
|
|
2
|
+
|
|
3
|
+
local engine,receiving,inputLease,expectedSlot,skipLoaded
|
|
4
|
+
local LIMIT=ns.SlotProtocol.Count
|
|
5
|
+
local zero=string.rep("0",32)
|
|
6
|
+
local function releaseInput()
|
|
7
|
+
receiving=false
|
|
8
|
+
if inputLease then ns.InputProtection.Release(inputLease);inputLease=nil end
|
|
9
|
+
end
|
|
10
|
+
local function protectInput()
|
|
11
|
+
if receiving then return true end
|
|
12
|
+
local reason
|
|
13
|
+
inputLease,reason=ns.InputProtection.Acquire(2,releaseInput,true)
|
|
14
|
+
if not inputLease then return nil,reason end
|
|
15
|
+
receiving=true
|
|
16
|
+
return true
|
|
17
|
+
end
|
|
18
|
+
local function activity(state,ticket)
|
|
19
|
+
if not ns.ActivityView then return end
|
|
20
|
+
if state=="idle" then ns.ActivityView.Finish(ticket)
|
|
21
|
+
elseif state=="collecting" and ns.ActivityView.Collecting then ns.ActivityView.Collecting(ticket)
|
|
22
|
+
else ns.ActivityView.Begin(ticket) end
|
|
23
|
+
end
|
|
24
|
+
local function start()
|
|
25
|
+
if engine then
|
|
26
|
+
local state=ns.Persistence.Current()
|
|
27
|
+
if ns.InputState and state and state.options.bridgeEnabled~=false then ns.InputState.Start(engine.InputIdentity) end
|
|
28
|
+
return true
|
|
29
|
+
end
|
|
30
|
+
local state,reason=ns.Persistence.Bridge();if not state then return nil,reason end
|
|
31
|
+
local build;build,reason=ns.Platform.ObserveBuild();if not build then return nil,reason end
|
|
32
|
+
local actor;actor,reason=ns.Platform.ObserveActor();if not actor then return nil,reason end
|
|
33
|
+
local epoch=state.memoryEpoch or 0
|
|
34
|
+
if (issecretvalue and issecretvalue(epoch)) or type(epoch)~="number" or epoch<0 or epoch%1~=0 or epoch>=4294967295 then return nil,"slot_epoch_invalid" end
|
|
35
|
+
local clock=ns.Compat.MonotonicSeconds();if not clock or clock>=4294967295 then return nil,"slot_clock_unavailable" end
|
|
36
|
+
-- A reload-persisted generation plus runtime clock and random suffix. The
|
|
37
|
+
-- CLI additionally binds the OS process creation identity and fresh nonce.
|
|
38
|
+
-- This token is an accidental-replay discriminator, not a secret/password.
|
|
39
|
+
state.memoryEpoch=epoch+1
|
|
40
|
+
local runtime=string.format("%08x%08x%04x%04x%04x%04x",epoch+1,math.floor(clock),math.random(0,65535),math.random(0,65535),math.random(0,65535),math.random(0,65535))
|
|
41
|
+
local available=0
|
|
42
|
+
for i=1,LIMIT do
|
|
43
|
+
local name=string.format("Lychee Dev Slot %02d",i)
|
|
44
|
+
if ns.Compat.GetAddOnMetadata(name,"X-Lychee-Slot")==tostring(i)
|
|
45
|
+
and ns.Compat.GetAddOnMetadata(name,"Version")==ns.Release
|
|
46
|
+
and ns.Compat.GetAddOnMetadata(name,"X-Lychee-Transport")=="memory-slot-v2" then available=available+1 end
|
|
47
|
+
end
|
|
48
|
+
ns.AutomationHistory.Begin(runtime,{character=actor.character,realm=actor.realm,guid=actor.guid,build=build.build,product=build.product})
|
|
49
|
+
engine=ns.SlotProtocol.Create({runtime=runtime,build=build.build,product=build.product,release=ns.Release,inventory=available,
|
|
50
|
+
inputState=ns.InputState and "lycheedev.input.hybrid.v1" or nil,
|
|
51
|
+
actor=function()
|
|
52
|
+
local current=ns.Platform.ObserveActor()
|
|
53
|
+
if current and current.guid==actor.guid then return current end
|
|
54
|
+
end,encode=ns.CaptureWriter.Encode,
|
|
55
|
+
compile=function(code)return loadstring(code,"=LycheeMemoryProbe")end,
|
|
56
|
+
execute=ns.ProbeExecution.Run,releaseInput=releaseInput,activity=activity,observe=ns.AutomationHistory.Observe})
|
|
57
|
+
engine.Describe()
|
|
58
|
+
local current=ns.Persistence.Current()
|
|
59
|
+
if ns.InputState and current and current.options.bridgeEnabled~=false then ns.InputState.Start(engine.InputIdentity) end
|
|
60
|
+
return true
|
|
61
|
+
end
|
|
62
|
+
local function inventory()
|
|
63
|
+
for i=1,LIMIT do
|
|
64
|
+
local name=string.format("Lychee Dev Slot %02d",i)
|
|
65
|
+
if ns.Compat.GetAddOnMetadata(name,"X-Lychee-Slot")~=tostring(i)
|
|
66
|
+
or ns.Compat.GetAddOnMetadata(name,"Version")~=ns.Release
|
|
67
|
+
or ns.Compat.GetAddOnMetadata(name,"X-Lychee-Transport")~="memory-slot-v2" then return nil,"slot_inventory_incomplete:"..i end
|
|
68
|
+
end
|
|
69
|
+
return true
|
|
70
|
+
end
|
|
71
|
+
local function wake()
|
|
72
|
+
local state=ns.Persistence.Current()
|
|
73
|
+
if not state or state.options.bridgeEnabled==false then return nil,"slot_disabled" end
|
|
74
|
+
local ok,reason=start();if not ok then return nil,reason end
|
|
75
|
+
if ns.Platform.ObserveInputState(true)~=true and not receiving then return nil,"slot_input_not_ready" end
|
|
76
|
+
ok,reason=inventory();if not ok then return nil,reason end
|
|
77
|
+
state.options.bridgeEnabled=true -- Explicit wake opts in; explicit off stays off.
|
|
78
|
+
if ns.StartupBeacon then ns.StartupBeacon.Stop() end
|
|
79
|
+
ok,reason=protectInput();if not ok then releaseInput();return nil,reason end
|
|
80
|
+
-- One wake may traverse foreign/empty physical slots, but can process at
|
|
81
|
+
-- most one own-runtime envelope. A rejected own envelope is still a stop.
|
|
82
|
+
for attempt=1,LIMIT do
|
|
83
|
+
local index=engine.NextSlot()
|
|
84
|
+
if index>LIMIT then releaseInput();engine.Describe();return nil,"slot_exhausted" end
|
|
85
|
+
expectedSlot,skipLoaded=index,nil
|
|
86
|
+
local loaded,failure=ns.Compat.LoadInputSlot(string.format("Lychee Dev Slot %02d",index))
|
|
87
|
+
expectedSlot=nil
|
|
88
|
+
if not loaded then releaseInput();engine.Describe();return nil,failure end
|
|
89
|
+
if skipLoaded==nil then releaseInput();engine.Describe();return nil,"slot_loader_no_dispatch" end
|
|
90
|
+
if not skipLoaded then break end
|
|
91
|
+
end
|
|
92
|
+
if skipLoaded and engine.NextSlot()>LIMIT then releaseInput();engine.Describe();return nil,"slot_exhausted" end
|
|
93
|
+
-- Control transactions have no long-lived keyboard ownership. A fresh
|
|
94
|
+
-- wake protects each input burst; business entry already released it.
|
|
95
|
+
releaseInput()
|
|
96
|
+
engine.Describe()
|
|
97
|
+
return true
|
|
98
|
+
end
|
|
99
|
+
local function guardedWake()
|
|
100
|
+
local ok,result,reason=pcall(wake)
|
|
101
|
+
expectedSlot,skipLoaded=nil,nil
|
|
102
|
+
releaseInput()
|
|
103
|
+
if ns.InputState then ns.InputState.Refresh() end
|
|
104
|
+
if not ok then return nil,"slot_wake_failed" end
|
|
105
|
+
return result,reason
|
|
106
|
+
end
|
|
107
|
+
local function close()
|
|
108
|
+
releaseInput()
|
|
109
|
+
ns.InputProtection.Cancel()
|
|
110
|
+
if ns.InputState then ns.InputState.Refresh() end
|
|
111
|
+
end
|
|
112
|
+
ns.SlotRuntime={
|
|
113
|
+
Start=start,Wake=guardedWake,Close=close,
|
|
114
|
+
IsActive=function()return ns.InputProtection.IsActive()end,
|
|
115
|
+
Receive=function(index,envelope)
|
|
116
|
+
if not engine or index~=expectedSlot then return nil,"slot_not_requested" end
|
|
117
|
+
local record,value,skip=engine.Receive(index,envelope)
|
|
118
|
+
skipLoaded=skip==true
|
|
119
|
+
return record,value
|
|
120
|
+
end,
|
|
121
|
+
Snapshot=function()return engine and engine.Snapshot()end,
|
|
122
|
+
Register=function()
|
|
123
|
+
return ns.ReceiverBindings.Register({wake=guardedWake,submit=guardedWake,close=close})
|
|
124
|
+
end,
|
|
125
|
+
}
|
|
@@ -2,7 +2,7 @@ local _, ns = ...
|
|
|
2
2
|
|
|
3
3
|
-- A short-lived visual hint, never an identity or execution permission. It is
|
|
4
4
|
-- armed only for an opted-in bridge at startup and stops permanently on wake.
|
|
5
|
-
local frame,
|
|
5
|
+
local frame, block, expiry, pulse, untilTime
|
|
6
6
|
local entered, loadingDone, phase, stopped
|
|
7
7
|
local colors = {{1,0,0},{0,1,0},{0,0,1}}
|
|
8
8
|
local function stop()
|
|
@@ -12,7 +12,7 @@ local function stop()
|
|
|
12
12
|
if frame then frame:Hide(); frame:UnregisterAllEvents(); frame:SetScript("OnEvent",nil) end
|
|
13
13
|
end
|
|
14
14
|
local function paint()
|
|
15
|
-
|
|
15
|
+
block:SetColorTexture(unpack(colors[phase+1]))
|
|
16
16
|
end
|
|
17
17
|
local function tick()
|
|
18
18
|
pulse=nil
|
|
@@ -37,16 +37,12 @@ ns.StartupBeacon = {
|
|
|
37
37
|
frame:Hide(); frame:EnableMouse(false); frame:SetFrameStrata("TOOLTIP")
|
|
38
38
|
local px=ns.Compat.GetPhysicalPixelSize()
|
|
39
39
|
frame:SetPoint("TOPLEFT",UIParent,"TOPLEFT",4*px,-4*px)
|
|
40
|
-
frame:SetSize(
|
|
40
|
+
frame:SetSize(12*px,12*px)
|
|
41
41
|
local background=frame:CreateTexture(nil,"BACKGROUND")
|
|
42
42
|
background:SetAllPoints(frame); background:SetColorTexture(0,0,0,1)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
block:SetSize(8*px,8*px)
|
|
47
|
-
block:SetPoint("TOPLEFT",(2+(index-1)*10)*px,-2*px)
|
|
48
|
-
blocks[index]=block
|
|
49
|
-
end
|
|
43
|
+
block=frame:CreateTexture(nil,"ARTWORK")
|
|
44
|
+
block:SetSize(8*px,8*px)
|
|
45
|
+
block:SetPoint("TOPLEFT",2*px,-2*px)
|
|
50
46
|
stopped=false; untilTime=GetTime()+45
|
|
51
47
|
expiry=C_Timer.NewTimer(45,stop)
|
|
52
48
|
for _,event in ipairs({"PLAYER_ENTERING_WORLD","LOADING_SCREEN_DISABLED","LOADING_SCREEN_ENABLED",
|
|
@@ -54,7 +50,8 @@ ns.StartupBeacon = {
|
|
|
54
50
|
frame:SetScript("OnEvent",function(_,event,initial,reloading)
|
|
55
51
|
if event=="PLAYER_LEAVING_WORLD" or event=="PLAYER_REGEN_DISABLED" then stop(); return end
|
|
56
52
|
if event=="PLAYER_ENTERING_WORLD" then
|
|
57
|
-
if
|
|
53
|
+
if issecretvalue and (issecretvalue(initial) or issecretvalue(reloading)) then stop(); return end
|
|
54
|
+
if initial~=false or reloading~=true then stop(); return end
|
|
58
55
|
entered=true
|
|
59
56
|
elseif event=="LOADING_SCREEN_ENABLED" then
|
|
60
57
|
loadingDone=false; frame:Hide()
|
|
@@ -5,6 +5,22 @@ local ADDON_NAME, ns = ...
|
|
|
5
5
|
-- before it is compared, formatted, indexed or branched on; failures open to a
|
|
6
6
|
-- harmless visible state instead of throwing.
|
|
7
7
|
ns.Compat = {
|
|
8
|
+
-- Pinned PlayerScriptDocumentation declares this on Retail/Classic/Titan.
|
|
9
|
+
InWorld = function()
|
|
10
|
+
if type(IsPlayerInWorld)~="function" then return nil end
|
|
11
|
+
local ok,value=pcall(IsPlayerInWorld)
|
|
12
|
+
if not ok or (issecretvalue and issecretvalue(value)) or type(value)~="boolean" then return nil end
|
|
13
|
+
return value
|
|
14
|
+
end,
|
|
15
|
+
LoadInputSlot = function(name)
|
|
16
|
+
if type(name)~="string" then return nil,"slot_name_invalid" end
|
|
17
|
+
local index=tonumber(name:match("^Lychee Dev Slot (%d+)$"))
|
|
18
|
+
if not index or index<1 or index>200 or name~=string.format("Lychee Dev Slot %02d",index) then return nil,"slot_name_invalid" end
|
|
19
|
+
if type(C_AddOns)~="table" or type(C_AddOns.LoadAddOn)~="function" then return nil,"slot_loader_unavailable" end
|
|
20
|
+
local ok,loaded,reason=pcall(C_AddOns.LoadAddOn,name)
|
|
21
|
+
if not ok or (issecretvalue and (issecretvalue(loaded) or issecretvalue(reason))) then return nil,"slot_load_failed" end
|
|
22
|
+
return loaded==true and true or nil,type(reason)=="string" and reason or "slot_load_failed"
|
|
23
|
+
end,
|
|
8
24
|
ReceiverChord = function(key)
|
|
9
25
|
if (issecretvalue and issecretvalue(key)) or type(key)~="string" then return nil end
|
|
10
26
|
local number=string.match(key,"^F([1-9]%d?)$")
|
|
@@ -79,6 +79,22 @@ ns.Controls = {
|
|
|
79
79
|
end
|
|
80
80
|
local state, failure = ns.Persistence.Current()
|
|
81
81
|
if not state then return nil, failure end
|
|
82
|
+
if ns.SlotRuntime then
|
|
83
|
+
if command=="connect" or command=="bridge on" then
|
|
84
|
+
state.options.bridgeEnabled=true
|
|
85
|
+
return ns.SlotRuntime.Start()
|
|
86
|
+
elseif command=="disconnect" or command=="bridge off" then
|
|
87
|
+
state.options.bridgeEnabled=false
|
|
88
|
+
if ns.InputState then ns.InputState.Stop() end
|
|
89
|
+
ns.SlotRuntime.Close()
|
|
90
|
+
if ns.ActivityView then ns.ActivityView.Stop() end
|
|
91
|
+
return true
|
|
92
|
+
elseif command=="status" then
|
|
93
|
+
return {transport="memory-slot-v1",enabled=ns.Persistence.BridgeEnabled()}
|
|
94
|
+
else
|
|
95
|
+
return nil,"command_retired: use the memory-slot CLI"
|
|
96
|
+
end
|
|
97
|
+
end
|
|
82
98
|
if command == "receiver reset" then
|
|
83
99
|
local profile, reason = ns.ReceiverBindings.Reset()
|
|
84
100
|
if not profile then return nil, reason end
|
|
@@ -322,10 +322,11 @@ ns.L = {
|
|
|
322
322
|
AUTO_ACK_RECEIVED = "外部已读取",
|
|
323
323
|
AUTO_ACK_FAILED = "外部读取失败",
|
|
324
324
|
AUTO_REPORT_DISPLAY_LIMIT = "显示已在 %d KB 处截断;完整报告以 Ticket 保存。",
|
|
325
|
+
AUTO_REPORT_HISTORY_LIMIT = "历史摘要已在 %d KB 处截断;完整结果保存在调用项目的 .lycheedev/live/ 中。",
|
|
325
326
|
AUTO_STATUS_RUNNING = "执行中",
|
|
326
327
|
AUTO_STATUS_FINALIZING = "整理中",
|
|
327
|
-
AUTO_STATUS_SUCCEEDED = "
|
|
328
|
-
AUTO_STATUS_FAILED = "
|
|
328
|
+
AUTO_STATUS_SUCCEEDED = "执行成功",
|
|
329
|
+
AUTO_STATUS_FAILED = "执行失败",
|
|
329
330
|
AUTO_STATUS_CANCELLED = "已取消",
|
|
330
331
|
AUTO_STATUS_INTERRUPTED = "已中断",
|
|
331
332
|
AUTO_KIND_LUA = "Lua 任务",
|
|
@@ -376,8 +377,9 @@ ns.L = {
|
|
|
376
377
|
SETTINGS_UNSAVED = "未保存",
|
|
377
378
|
RECEIVER_BINDING_CAPTURE_HELP = "单击快捷键,再按下 Ctrl+Alt 与 [、] 或 F1–F12 的组合,也可加 Shift。",
|
|
378
379
|
RECEIVER_BINDING_FIXED_HELP = "由 Agent 自动调用。此处仅供查看,无需配置。",
|
|
379
|
-
ACTIVITY_CONNECTING = "Agent
|
|
380
|
-
ACTIVITY_PROBE = "
|
|
380
|
+
ACTIVITY_CONNECTING = "Agent 接管中",
|
|
381
|
+
ACTIVITY_PROBE = "Agent 运行中",
|
|
382
|
+
ACTIVITY_COLLECTING = "结果待收取",
|
|
381
383
|
DIAGNOSTICS_SEARCH_HINT = "筛选错误关键词…",
|
|
382
384
|
RECEIVER_BINDING_PRESS = "请按组合键…",
|
|
383
385
|
REDUCE_MOTION = "减少动态效果",
|
|
@@ -327,6 +327,7 @@ local english = {
|
|
|
327
327
|
AUTO_ACK_RECEIVED = "Read by the host",
|
|
328
328
|
AUTO_ACK_FAILED = "Host read failed",
|
|
329
329
|
AUTO_REPORT_DISPLAY_LIMIT = "Display truncated at %d KB; the full report is stored under the Ticket.",
|
|
330
|
+
AUTO_REPORT_HISTORY_LIMIT = "History preview truncated at %d KB; the full result is in the calling project's .lycheedev/live/ directory.",
|
|
330
331
|
AUTO_STATUS_RUNNING = "Running",
|
|
331
332
|
AUTO_STATUS_FINALIZING = "Finalizing",
|
|
332
333
|
AUTO_STATUS_SUCCEEDED = "Succeeded",
|
|
@@ -382,8 +383,9 @@ local english = {
|
|
|
382
383
|
SETTINGS_UNSAVED = "Unsaved",
|
|
383
384
|
RECEIVER_BINDING_CAPTURE_HELP = "Click a shortcut, then press Ctrl+Alt with [, ] or F1-F12. Shift is optional.",
|
|
384
385
|
RECEIVER_BINDING_FIXED_HELP = "Used automatically by your agent. Shown for reference; no setup needed.",
|
|
385
|
-
ACTIVITY_CONNECTING = "Agent
|
|
386
|
-
ACTIVITY_PROBE = "
|
|
386
|
+
ACTIVITY_CONNECTING = "Agent in control",
|
|
387
|
+
ACTIVITY_PROBE = "Agent running",
|
|
388
|
+
ACTIVITY_COLLECTING = "Collecting result",
|
|
387
389
|
DIAGNOSTICS_SEARCH_HINT = "Filter errors by keyword...",
|
|
388
390
|
RECEIVER_BINDING_PRESS = "Press shortcut...",
|
|
389
391
|
RECEIVER_BINDINGS = "Command receiver shortcuts",
|
|
@@ -12,7 +12,7 @@ ns.Platform = {
|
|
|
12
12
|
-- A point-in-time observation, not permission to send input later. The
|
|
13
13
|
-- caller must also own a current session and observe focus after slash
|
|
14
14
|
-- dispatch unwinds. Missing or restricted APIs fail closed.
|
|
15
|
-
ObserveInputState = function()
|
|
15
|
+
ObserveInputState = function(allowFocusedInput)
|
|
16
16
|
if type(IsLoggedIn) ~= "function" or type(InCombatLockdown) ~= "function"
|
|
17
17
|
or type(GetCurrentKeyBoardFocus) ~= "function" then
|
|
18
18
|
return nil, "input_observation_unavailable"
|
|
@@ -29,7 +29,9 @@ ns.Platform = {
|
|
|
29
29
|
if combat then return false, "input_combat_lockdown" end
|
|
30
30
|
local focusOK, focus = pcall(GetCurrentKeyBoardFocus)
|
|
31
31
|
if not focusOK or restricted(focus) then return nil, "input_focus_unavailable" end
|
|
32
|
-
|
|
32
|
+
-- The slot path sends a non-text key and neither clears nor edits this
|
|
33
|
+
-- object. Other input paths still require an empty keyboard focus.
|
|
34
|
+
if focus ~= nil and allowFocusedInput ~= true then return false, "input_keyboard_focus" end
|
|
33
35
|
return true
|
|
34
36
|
end,
|
|
35
37
|
ObserveActor = function()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
local ADDON_NAME, ns = ...
|
|
2
2
|
|
|
3
|
-
ns.Release = "
|
|
3
|
+
ns.Release = "3.0.1"
|
|
4
4
|
ns.Startup = { ready = false, reason = "addon_not_loaded" }
|
|
5
5
|
-- Observability handle: mirrors the addon namespace for host-side /run
|
|
6
6
|
-- introspection (startup state, identity, commandFailure) on every client.
|
|
@@ -42,10 +42,12 @@ local function start(trigger)
|
|
|
42
42
|
started = true
|
|
43
43
|
local registered, registrationFailure = ns.Controls.Register()
|
|
44
44
|
if not registered then ns.Startup.commandFailure = registrationFailure end
|
|
45
|
-
local receiverRegistered, receiverFailure
|
|
45
|
+
local receiverRegistered, receiverFailure
|
|
46
|
+
if ns.SlotRuntime then receiverRegistered,receiverFailure=ns.SlotRuntime.Register()
|
|
47
|
+
else receiverRegistered,receiverFailure=ns.Receiver.Register() end
|
|
46
48
|
if not receiverRegistered then ns.Startup.receiverFailure = receiverFailure end
|
|
47
49
|
if ns.StartupBeacon then ns.StartupBeacon.Arm() end
|
|
48
|
-
if registered then
|
|
50
|
+
if registered and not ns.SlotRuntime then
|
|
49
51
|
local resumed, resumeFailure = ns.Reentry.Start(loader)
|
|
50
52
|
if not resumed then ns.Startup.resumeFailure = resumeFailure end
|
|
51
53
|
end
|
|
@@ -59,7 +61,16 @@ loader:SetScript("OnEvent", function(self, event, name)
|
|
|
59
61
|
if event == "ADDON_LOADED" and name ~= ADDON_NAME then return end
|
|
60
62
|
-- One-shot: the name-matched ADDON_LOADED owns startup, success or not;
|
|
61
63
|
-- PLAYER_LOGIN is the fallback trigger when that event never matched.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
if ns.SlotRuntime then
|
|
65
|
+
if start(event) then
|
|
66
|
+
-- Actor identity can be unavailable during ADDON_LOADED. The
|
|
67
|
+
-- existing one-shot loader owns the one PLAYER_LOGIN retry.
|
|
68
|
+
local ok=ns.SlotRuntime.Start()
|
|
69
|
+
if ok or event=="PLAYER_LOGIN" then self:UnregisterAllEvents();self:SetScript("OnEvent",nil) end
|
|
70
|
+
end
|
|
71
|
+
else
|
|
72
|
+
self:UnregisterAllEvents()
|
|
73
|
+
self:SetScript("OnEvent", nil)
|
|
74
|
+
start(event)
|
|
75
|
+
end
|
|
65
76
|
end)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## Interface: 120100, 50504, 38002, 16001
|
|
2
2
|
## Title: Lychee Dev
|
|
3
|
-
## Version:
|
|
3
|
+
## Version: 3.0.1
|
|
4
4
|
## SavedVariables: LycheeToolkitDB
|
|
5
5
|
## SavedVariablesPerCharacter: LycheeToolkitBridgeDB
|
|
6
6
|
|
|
@@ -22,6 +22,10 @@ Core\Persistence.lua
|
|
|
22
22
|
Bridge\Session.lua
|
|
23
23
|
Core\Controls.lua
|
|
24
24
|
Bridge\CaptureWriter.lua
|
|
25
|
+
Bridge\MemoryProtocol.lua
|
|
26
|
+
Bridge\SlotProtocol.lua
|
|
27
|
+
Bridge\InputProtection.lua
|
|
28
|
+
Bridge\ProbeExecution.lua
|
|
25
29
|
Bridge\InputProtocol.lua
|
|
26
30
|
Bridge\MatrixSymbol.lua
|
|
27
31
|
Bridge\ReceiptView.lua
|
|
@@ -30,6 +34,7 @@ Bridge\ReportStore.lua
|
|
|
30
34
|
Bridge\Investigation.lua
|
|
31
35
|
Bridge\ProbeRunner.lua
|
|
32
36
|
Bridge\Definitions.lua
|
|
37
|
+
Modules\AutomationHistory.lua
|
|
33
38
|
Modules\AutomationView.lua
|
|
34
39
|
Bridge\ProbeQueue.lua
|
|
35
40
|
Bridge\Reentry.lua
|
|
@@ -37,6 +42,9 @@ Bridge\Identity.lua
|
|
|
37
42
|
Bridge\ReceiverBindings.lua
|
|
38
43
|
Bridge\StartupBeacon.lua
|
|
39
44
|
Bridge\Receiver.lua
|
|
45
|
+
Bridge\SlotRuntime.lua
|
|
46
|
+
Bridge\InputSignal.lua
|
|
47
|
+
Bridge\InputState.lua
|
|
40
48
|
# --- Event catalogs: all four load; Catalog.lua selects ns.Client's table ---
|
|
41
49
|
Modules\Events\CatalogData_Mainline.lua
|
|
42
50
|
Modules\Events\CatalogData_Mists.lua
|
|
@@ -55,7 +63,6 @@ UI\Widgets.lua
|
|
|
55
63
|
UI\TreeView.lua
|
|
56
64
|
UI\Export.lua
|
|
57
65
|
UI\Window.lua
|
|
58
|
-
UI\Pages\Settings.lua
|
|
59
66
|
# --- Workbench pages: later page modules insert their load line here ---
|
|
60
67
|
UI\Pages\About.lua
|
|
61
68
|
UI\Pages\Run.lua
|