@wujie-shell/core 0.1.2 → 0.1.4
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 +17 -4
- package/dist/bin/wujie-shell.mjs +1 -1
- package/dist/src/bundled-agent-skills.mjs +1 -1
- package/dist/src/bundled-agents.mjs +1 -1
- package/dist/src/config-controller.mjs +1 -1
- package/dist/src/electron/main.mjs +1 -1
- package/dist/src/electron/preload.mjs +1 -1
- package/dist/src/gateway-controller.mjs +1 -1
- package/dist/src/gateway-ws.mjs +1 -1
- package/dist/src/index.mjs +1 -1
- package/dist/src/logging.mjs +1 -1
- package/dist/src/plugin-sync.mjs +1 -1
- package/dist/src/runtime-logger.mjs +1 -1
- package/dist/src/runtime.mjs +1 -1
- package/dist/src/utils.mjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Electron main/preload implementation used by product UI projects.
|
|
|
7
7
|
|
|
8
8
|
## Responsibility
|
|
9
9
|
|
|
10
|
-
- Prepare `apps/<product>/.tmp/runtime`
|
|
10
|
+
- Prepare `apps/<product>/.tmp/runtime` for the product.
|
|
11
11
|
- Install or validate the configured OpenClaw version.
|
|
12
12
|
- Sync product Plugin, Agent, and Skill directories into the runtime.
|
|
13
13
|
- Generate and maintain `~/<dataDirName>/openclaw.json`.
|
|
@@ -24,6 +24,7 @@ logic or hard-coded product asset lists.
|
|
|
24
24
|
import {
|
|
25
25
|
createConfigController,
|
|
26
26
|
createGatewayController,
|
|
27
|
+
ensureOpenClawDoctorFixed,
|
|
27
28
|
loadRuntimeInfo,
|
|
28
29
|
prepareRuntime,
|
|
29
30
|
runClawOnce,
|
|
@@ -53,7 +54,7 @@ Options:
|
|
|
53
54
|
|
|
54
55
|
Behavior:
|
|
55
56
|
|
|
56
|
-
-
|
|
57
|
+
- Builds or refreshes the product-local runtime base when needed.
|
|
57
58
|
- Validates Node runtime version.
|
|
58
59
|
- Installs the configured OpenClaw version when `prepare` is used and versions
|
|
59
60
|
differ.
|
|
@@ -62,10 +63,22 @@ Behavior:
|
|
|
62
63
|
- Copies product agents into `openclaw/agents`.
|
|
63
64
|
- Copies product global skills into `openclaw/skills`.
|
|
64
65
|
- Writes `bin/wujieclaw` so OpenClaw uses the product data directory and config.
|
|
66
|
+
The wrapper plays the Wujie startup logo animation (`bin/wujie-logo.mjs`,
|
|
67
|
+
copied from `assets/wujie-logo.mjs`) before exec'ing OpenClaw. It only runs on
|
|
68
|
+
an interactive TTY and can be disabled with `WUJIE_NO_LOGO=1`.
|
|
65
69
|
- Updates `runtime-manifest.json` with product metadata.
|
|
66
70
|
|
|
67
|
-
`syncOnly: true` does not install a new OpenClaw version; it
|
|
68
|
-
prepared runtime already matches the
|
|
71
|
+
`syncOnly: true` does not install a new OpenClaw version; it builds any missing
|
|
72
|
+
runtime base files, then validates that the prepared runtime already matches the
|
|
73
|
+
configured OpenClaw version.
|
|
74
|
+
|
|
75
|
+
The desktop gateway startup calls `ensureOpenClawDoctorFixed()` before
|
|
76
|
+
launching OpenClaw. That check compares the embedded runtime version with a
|
|
77
|
+
shell-owned marker at `~/<dataDirName>/runtime-state/openclaw-doctor.json`, then
|
|
78
|
+
runs `openclaw doctor --fix` when the user's persisted product state has not yet
|
|
79
|
+
been repaired for the current OpenClaw version. This covers packaged macOS and
|
|
80
|
+
Windows upgrades where the embedded `resources/runtime/runtime-manifest.json`
|
|
81
|
+
already belongs to the newly installed app bundle.
|
|
69
82
|
|
|
70
83
|
### `loadRuntimeInfo(projectRoot)`
|
|
71
84
|
|
package/dist/bin/wujie-shell.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
(function(_0x3fe431,_0x4c1610){const _0xa57b3e=_0x2818,_0x50633e=_0x3fe431();while(!![]){try{const _0x3444e2=parseInt(_0xa57b3e(0x1e5))/0x1+parseInt(_0xa57b3e(0x1e7))/0x2+-parseInt(_0xa57b3e(0x1fb))/0x3*(parseInt(_0xa57b3e(0x1f5))/0x4)+parseInt(_0xa57b3e(0x1fc))/0x5*(parseInt(_0xa57b3e(0x1fa))/0x6)+-parseInt(_0xa57b3e(0x1dd))/0x7+parseInt(_0xa57b3e(0x1fe))/0x8+parseInt(_0xa57b3e(0x1de))/0x9*(-parseInt(_0xa57b3e(0x1f6))/0xa);if(_0x3444e2===_0x4c1610)break;else _0x50633e['push'](_0x50633e['shift']());}catch(_0x3676c8){_0x50633e['push'](_0x50633e['shift']());}}}(_0x51b0,0xb6c4e));function _0x51b0(){const _0x5184d9=['help','2755900pDATiF','-shell\x20s','slice','stringif','cwd','plugins','message','jie-shel','--help','argv','stack','ntime','/.tmp/ru','project>','1483992dXZcnB','648350BFqWms','ect\x20<ui-','e\x20--proj','oject\x20<u','18pNlPqL','12GCJJgV','1474745atVbuF','project','5292976uzvEXW','sync','length','ge:\x0a\x20\x20wu','i-projec','ell\x0a\x0aUsa','Version','ync\x20--pr','t>\x0a','9532271ZiArTA','45JFMtpn','unknown\x20','wujie-sh','log','error','exit','isArray','994123qaXYys'];_0x51b0=function(){return _0x5184d9;};return _0x51b0();}function _0x2818(_0x4e5f67,_0x2e315e){_0x4e5f67=_0x4e5f67-0x1d9;const _0x51b04e=_0x51b0();let _0x2818f2=_0x51b04e[_0x4e5f67];return _0x2818f2;}import{resolve}from'node:path';import{loadShellConfig}from'@wujie-shell/config';import{prepareRuntime}from'../src/runtime.mjs';function parseArgs(_0x49b380){const _0x21f077=_0x2818,_0x3ccf92=[..._0x49b380],_0x46dfe5=_0x3ccf92['shift']()||_0x21f077(0x1e6),_0x55ae26={'project':process[_0x21f077(0x1eb)]()};for(let _0xfe4df=0x0;_0xfe4df<_0x3ccf92[_0x21f077(0x200)];_0xfe4df+=0x1){const _0x420c71=_0x3ccf92[_0xfe4df];(_0x420c71==='--projec'+'t'||_0x420c71==='-p')&&(_0x55ae26['project']=_0x3ccf92[_0xfe4df+0x1],_0xfe4df+=0x1);}return{'command':_0x46dfe5,'options':_0x55ae26};}function usage(){const _0x578eaf=_0x2818;console[_0x578eaf(0x1e1)](_0x578eaf(0x1e0)+_0x578eaf(0x1d9)+_0x578eaf(0x201)+_0x578eaf(0x1ee)+'l\x20prepar'+_0x578eaf(0x1f8)+_0x578eaf(0x1f7)+_0x578eaf(0x1f4)+'\x0a\x20\x20wujie'+_0x578eaf(0x1e8)+_0x578eaf(0x1db)+_0x578eaf(0x1f9)+_0x578eaf(0x202)+_0x578eaf(0x1dc));}async function main(){const _0x3809c7=_0x2818,{command:_0x743112,options:_0x3d08c6}=parseArgs(process[_0x3809c7(0x1f0)][_0x3809c7(0x1e9)](0x2));if(_0x743112===_0x3809c7(0x1e6)||_0x743112===_0x3809c7(0x1ef)||_0x743112==='-h'){usage();return;}if(_0x743112!=='prepare'&&_0x743112!==_0x3809c7(0x1ff))throw new Error(_0x3809c7(0x1df)+'command:'+'\x20'+_0x743112);const _0x44888f=resolve(_0x3d08c6[_0x3809c7(0x1fd)]),_0x3545c0=await loadShellConfig(_0x44888f),_0x3f3cbc=await prepareRuntime(_0x3545c0,{'syncOnly':_0x743112===_0x3809c7(0x1ff)});console[_0x3809c7(0x1e1)](JSON[_0x3809c7(0x1ea)+'y']({'ok':!![],'command':_0x743112,'projectRoot':_0x44888f,'runtimeRoot':_0x44888f+(_0x3809c7(0x1f3)+_0x3809c7(0x1f2)),'openclawVersion':_0x3f3cbc['openclaw'+_0x3809c7(0x1da)],'pluginCount':Array[_0x3809c7(0x1e4)](_0x3f3cbc[_0x3809c7(0x1ec)])?_0x3f3cbc[_0x3809c7(0x1ec)]['length']:0x0},null,0x2));}main()['catch'](_0x4aa694=>{const _0x11c0c8=_0x2818;console[_0x11c0c8(0x1e2)](_0x4aa694 instanceof Error?_0x4aa694[_0x11c0c8(0x1f1)]||_0x4aa694[_0x11c0c8(0x1ed)]:String(_0x4aa694)),process[_0x11c0c8(0x1e3)](0x1);});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x41fe(_0x88d858,_0xd89c55){_0x88d858=_0x88d858-0x13d;const _0xff427=_0xff42();let _0x41fe06=_0xff427[_0x88d858];return _0x41fe06;}(function(_0x1c17b8,_0x2bdf66){const _0x2e69bb=_0x41fe,_0x5e7de6=_0x1c17b8();while(!![]){try{const _0x3c132a=-parseInt(_0x2e69bb(0x144))/0x1+-parseInt(_0x2e69bb(0x146))/0x2+parseInt(_0x2e69bb(0x14c))/0x3*(parseInt(_0x2e69bb(0x151))/0x4)+-parseInt(_0x2e69bb(0x154))/0x5+-parseInt(_0x2e69bb(0x161))/0x6*(-parseInt(_0x2e69bb(0x14f))/0x7)+-parseInt(_0x2e69bb(0x13f))/0x8+parseInt(_0x2e69bb(0x15e))/0x9;if(_0x3c132a===_0x2bdf66)break;else _0x5e7de6['push'](_0x5e7de6['shift']());}catch(_0xdbb249){_0x5e7de6['push'](_0x5e7de6['shift']());}}}(_0xff42,0xda263));import{existsSync}from'node:fs';import{readdir}from'node:fs/promises';import{join}from'node:path';import{asRecord,asStringArray,dedupeStrings,getTrimmedString}from'./utils.mjs';async function listValidSkillKeys(_0x162d63,_0x4c365a){const _0x32b2e4=_0x41fe;if(!existsSync(_0x162d63))return[];let _0x526234=[];try{_0x526234=await readdir(_0x162d63,{'withFileTypes':!![],'encoding':_0x32b2e4(0x15d)});}catch(_0x3a4c1d){return console['warn'](_0x32b2e4(0x148)+_0x32b2e4(0x142)+_0x32b2e4(0x160)+_0x32b2e4(0x158)+_0x32b2e4(0x162)+'ls\x20dir\x20a'+_0x32b2e4(0x150)+_0x4c365a,_0x3a4c1d),[];}const _0x5031c2=[];for(const _0x55d521 of _0x526234){if(!_0x55d521['isDirect'+_0x32b2e4(0x155)]())continue;const _0xc0958b=_0x55d521[_0x32b2e4(0x159)][_0x32b2e4(0x140)]();if(!_0xc0958b||_0xc0958b[_0x32b2e4(0x143)+'th']('_'))continue;if(existsSync(join(_0x162d63,_0xc0958b,'SKILL.md')))_0x5031c2[_0x32b2e4(0x156)](_0xc0958b);}return _0x5031c2;}export async function discoverBundledAgentSkills(_0x38e387,_0x29008c){const _0x30a9d1=_0x41fe,_0x10055b=[],_0x37a26e={},_0xa83a3d={};for(const _0x2813af of _0x38e387){const _0x3dc42e=_0x29008c(_0x2813af),_0x4df0fa=await listValidSkillKeys(_0x3dc42e,_0x2813af);_0xa83a3d[_0x2813af]=_0x4df0fa,_0x4df0fa['length']>0x0&&(_0x10055b[_0x30a9d1(0x156)](_0x3dc42e),_0x37a26e[_0x2813af]=_0x3dc42e);}return{'extraDirs':_0x10055b,'extraDirByAgent':_0x37a26e,'agentAllowlist':_0xa83a3d};}function _0xff42(){const _0x231fb4=['main','13043936cLrlob','trim','length','hell:ski','startsWi','516753PFbiXH','stringif','2672726kexHch','load','[wujie-s','isArray','list','owlist','3hjzuRi','entries','agents','285257bcGWZy','gent=','3502612dMablz','object','find','7043370geOczA','ory','push','agentAll','led\x20to\x20r','name','map','skills','extraDir','utf8','29154393cPlekT','filter','lls]\x20fai','246tMPYqf','ead\x20skil','has'];_0xff42=function(){return _0x231fb4;};return _0xff42();}export async function syncBundledAgentSkillsToConfig({agentIds:_0xccb2b2,resolveSkillsDir:_0x58e11a,readConfig:_0x445679,writeConfig:_0x3d269f,markConfigWriteHandledInternally:_0x58c25a}){const _0x4c46d7=_0x41fe,_0x7b3989=await discoverBundledAgentSkills(_0xccb2b2,_0x58e11a);if(_0xccb2b2[_0x4c46d7(0x141)]===0x0)return{'discovery':_0x7b3989,'changed':![]};const _0x424f2d=await _0x445679();let _0x3c1ee4=![];const _0x47edfe=asRecord(_0x424f2d[_0x4c46d7(0x15b)]),_0x2af3f3=asRecord(_0x47edfe[_0x4c46d7(0x147)]),_0x1b46bc=asStringArray(_0x2af3f3[_0x4c46d7(0x15c)+'s']),_0x2dae3f=dedupeStrings([..._0x1b46bc,..._0x7b3989[_0x4c46d7(0x15c)+'s']]);JSON[_0x4c46d7(0x145)+'y'](_0x1b46bc)!==JSON[_0x4c46d7(0x145)+'y'](_0x2dae3f)&&(_0x2af3f3[_0x4c46d7(0x15c)+'s']=_0x2dae3f,_0x47edfe[_0x4c46d7(0x147)]=_0x2af3f3,_0x424f2d[_0x4c46d7(0x15b)]=_0x47edfe,_0x3c1ee4=!![]);const _0x4d7a2b=asRecord(_0x424f2d[_0x4c46d7(0x14e)]),_0x3998f7=Array[_0x4c46d7(0x149)](_0x4d7a2b['list'])?_0x4d7a2b[_0x4c46d7(0x14a)]:[];if(_0x3998f7[_0x4c46d7(0x141)]>0x0){const _0x4adcca=_0x3998f7[_0x4c46d7(0x15a)](_0x52b8d3=>_0x52b8d3&&typeof _0x52b8d3===_0x4c46d7(0x152)?{..._0x52b8d3}:_0x52b8d3);let _0x46f582=![];for(const [_0x4be54c,_0x175618]of Object[_0x4c46d7(0x14d)](_0x7b3989[_0x4c46d7(0x157)+_0x4c46d7(0x14b)])){if(_0x4be54c===_0x4c46d7(0x13e))continue;const _0x32080e=_0x4adcca['find'](_0x4b8bd3=>asRecord(_0x4b8bd3)['id']===_0x4be54c);if(!_0x32080e)continue;const _0xc1b916=Array[_0x4c46d7(0x149)](_0x32080e[_0x4c46d7(0x15b)])?_0x32080e[_0x4c46d7(0x15b)]:null;(!_0xc1b916||JSON['stringif'+'y'](_0xc1b916)!==JSON[_0x4c46d7(0x145)+'y'](_0x175618))&&(_0x32080e[_0x4c46d7(0x15b)]=_0x175618,_0x46f582=!![]);}_0x46f582&&(_0x4d7a2b['list']=_0x4adcca,_0x424f2d[_0x4c46d7(0x14e)]=_0x4d7a2b,_0x3c1ee4=!![]);}return _0x3c1ee4&&(_0x58c25a?.(),await _0x3d269f(_0x424f2d)),{'discovery':_0x7b3989,'changed':_0x3c1ee4};}export function filterSkillsForAgent(_0x5585e1,_0x594a24,_0x35ff33=''){const _0x1fd05c=_0x41fe,_0x348805=Array[_0x1fd05c(0x149)](asRecord(_0x5585e1)[_0x1fd05c(0x15b)])?asRecord(_0x5585e1)[_0x1fd05c(0x15b)]:[],_0x5375ae=getTrimmedString(_0x35ff33)||_0x1fd05c(0x13e),_0x21fa70=Array[_0x1fd05c(0x149)](asRecord(asRecord(_0x594a24)['agents'])[_0x1fd05c(0x14a)])?asRecord(asRecord(_0x594a24)[_0x1fd05c(0x14e)])[_0x1fd05c(0x14a)]:[],_0x240c3f=_0x21fa70[_0x1fd05c(0x15a)](asRecord)[_0x1fd05c(0x153)](_0x5dc655=>getTrimmedString(_0x5dc655['id'])===_0x5375ae),_0x50619c=_0x240c3f&&Array[_0x1fd05c(0x149)](_0x240c3f['skills'])?new Set(asStringArray(_0x240c3f[_0x1fd05c(0x15b)])):null;if(!_0x50619c)return _0x5585e1;return{...asRecord(_0x5585e1),'skills':_0x348805[_0x1fd05c(0x15f)](_0x22532e=>_0x50619c[_0x1fd05c(0x13d)](getTrimmedString(asRecord(_0x22532e)[_0x1fd05c(0x159)])))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x411bae,_0x2b6d2a){const _0x52401a=_0x10ef,_0xbdb2c6=_0x411bae();while(!![]){try{const _0x57c442=-parseInt(_0x52401a(0xd9))/0x1+parseInt(_0x52401a(0xcc))/0x2+parseInt(_0x52401a(0xc6))/0x3+parseInt(_0x52401a(0xf4))/0x4*(-parseInt(_0x52401a(0xd1))/0x5)+parseInt(_0x52401a(0xea))/0x6*(parseInt(_0x52401a(0xc9))/0x7)+-parseInt(_0x52401a(0xef))/0x8+parseInt(_0x52401a(0xd0))/0x9;if(_0x57c442===_0x2b6d2a)break;else _0xbdb2c6['push'](_0xbdb2c6['shift']());}catch(_0x3c5971){_0xbdb2c6['push'](_0xbdb2c6['shift']());}}}(_0x99ef,0xefd1c));import{existsSync}from'node:fs';import{cp,mkdir,readFile,readdir,rm}from'node:fs/promises';import{dirname,join,resolve,sep}from'node:path';function _0x99ef(){const _0x30a024=['afe\x20mana','564906SdMZFE','cnName','toolDoma','101605DEbCLH','emoji','name','205964SjixVX','aths','ory','length','33966468DyuYJd','1349090kosSPJ','ins','ync\x20bund','version','[wujie-s','avatar','error','tyDomain','1706476ytGhLC','isDirect','led\x20agen','model','utf8','isArray','icon','some','capabili','relPath','map','startsWi','main','nts]\x20ski','son','includes','agents','270hPdKDh','parse','find','nts]\x20fai','pped\x20uns','9762248lGbaAi','trim','absPath','readme.j','t\x20\x22','12OEksbS','warn','workspac'];_0x99ef=function(){return _0x30a024;};return _0x99ef();}import{asRecord,asStringArray,getTrimmedString,readJson}from'./utils.mjs';function toOptionalString(_0x3a2b9e){const _0xbc35a3=getTrimmedString(_0x3a2b9e);return _0xbc35a3||undefined;}export async function loadBundledAgents(_0x295081){const _0x46aea0=_0x10ef;let _0x3fb912=[];try{_0x3fb912=await readdir(_0x295081,{'withFileTypes':!![],'encoding':_0x46aea0(0xdd)});}catch{return[];}const _0x1a9741=await Promise['all'](_0x3fb912['filter'](_0x440bf4=>_0x440bf4[_0x46aea0(0xda)+_0x46aea0(0xce)]())[_0x46aea0(0xe3)](async _0x53dfee=>{const _0x1e8f7b=_0x46aea0,_0x24e59d=_0x53dfee[_0x1e8f7b(0xcb)][_0x1e8f7b(0xf0)]();if(!_0x24e59d)return null;const _0x17b8eb=await readJson(join(_0x295081,_0x24e59d,_0x1e8f7b(0xf2)+'son'),{}),_0x59cc8f=asRecord(_0x17b8eb),_0x18c18b=toOptionalString(_0x59cc8f['name'])??_0x24e59d;if(!_0x18c18b)return null;return{'name':_0x18c18b,'cnName':toOptionalString(_0x59cc8f[_0x1e8f7b(0xc7)]),'avatar':toOptionalString(_0x59cc8f[_0x1e8f7b(0xd6)]),'icon':toOptionalString(_0x59cc8f[_0x1e8f7b(0xdf)]),'emoji':toOptionalString(_0x59cc8f[_0x1e8f7b(0xca)]),'model':toOptionalString(_0x59cc8f[_0x1e8f7b(0xdc)]),'version':toOptionalString(_0x59cc8f[_0x1e8f7b(0xd4)]),'capabilityDomains':asStringArray(_0x59cc8f[_0x1e8f7b(0xe1)+_0x1e8f7b(0xd8)+'s']??_0x59cc8f[_0x1e8f7b(0xc8)+_0x1e8f7b(0xd2)]),'managedPaths':asStringArray(_0x59cc8f['managedP'+_0x1e8f7b(0xcd)])};}));return _0x1a9741['filter'](Boolean);}async function readJsonVersion(_0x3a2300){const _0x14d74a=_0x10ef;try{const _0x3b5bbb=JSON[_0x14d74a(0xeb)](await readFile(_0x3a2300,_0x14d74a(0xdd)));return getTrimmedString(asRecord(_0x3b5bbb)[_0x14d74a(0xd4)])||null;}catch{return null;}}function assertSafeManagedPath(_0x2e382a,_0x56bbc3){const _0x4d4237=_0x10ef,_0x50d568=getTrimmedString(_0x56bbc3);if(!_0x50d568||_0x50d568[_0x4d4237(0xe4)+'th']('/')||_0x50d568[_0x4d4237(0xe8)]('..'))return null;const _0x537a99=resolve(_0x2e382a),_0x1c103b=resolve(join(_0x2e382a,_0x50d568));if(_0x1c103b!==_0x537a99&&!_0x1c103b[_0x4d4237(0xe4)+'th'](_0x537a99+sep))return null;return{'relPath':_0x50d568,'absPath':_0x1c103b};}function _0x10ef(_0x3f16c6,_0x40b210){_0x3f16c6=_0x3f16c6-0xc6;const _0x99ef01=_0x99ef();let _0x10efed=_0x99ef01[_0x3f16c6];return _0x10efed;}async function copyManagedPaths(_0x4364c9,_0x786c4b,_0x106f5a){const _0x1ec9f2=_0x10ef;if(_0x106f5a[_0x1ec9f2(0xcf)]===0x0){await cp(_0x4364c9,_0x786c4b,{'recursive':!![]});return;}for(const _0x47dd4a of _0x106f5a){const _0x4b8710=assertSafeManagedPath(_0x786c4b,_0x47dd4a);if(!_0x4b8710){console[_0x1ec9f2(0xf5)](_0x1ec9f2(0xd5)+'hell:age'+_0x1ec9f2(0xe6)+_0x1ec9f2(0xee)+_0x1ec9f2(0xf7)+'gedPath:'+'\x20'+_0x47dd4a);continue;}const _0x230d31=join(_0x4364c9,_0x4b8710[_0x1ec9f2(0xe2)]);if(!existsSync(_0x230d31)){await rm(_0x4b8710['absPath'],{'recursive':!![],'force':!![]});continue;}await rm(_0x4b8710[_0x1ec9f2(0xf1)],{'recursive':!![],'force':!![]}),await mkdir(dirname(_0x4b8710[_0x1ec9f2(0xf1)]),{'recursive':!![]}),await cp(_0x230d31,_0x4b8710['absPath'],{'recursive':!![]});}}export async function ensureBundledAgents({runtimeBundledAgentsDir:_0x1a11a2,stateDir:_0x4faad0,listAgents:_0x3c1fba,createAgent:_0x2302e1,updateAgent:_0x4ede26,syncSkills:_0x19f7dd}){const _0x40cf50=_0x10ef;let _0x312583=![];const _0x3967db=await _0x3c1fba(),_0x145964=Array[_0x40cf50(0xde)](_0x3967db[_0x40cf50(0xe9)])?_0x3967db[_0x40cf50(0xe9)]:[],_0x2477e0=_0x145964[_0x40cf50(0xec)](_0x2a0ecc=>_0x2a0ecc?.['id']==='main'),_0x4bb381=getTrimmedString(_0x2477e0?.['workspac'+'e'])||join(_0x4faad0,_0x40cf50(0xf6)+'e'),_0x2885df=await loadBundledAgents(_0x1a11a2);for(const _0xe9b7b1 of _0x2885df){const {name:_0x1c849c,cnName:_0x26eaaa,avatar:_0x40baf7,emoji:_0x5c01f8,version:_0x1352c3,managedPaths:_0x513cdb}=_0xe9b7b1,_0x1d5d03=_0x1c849c===_0x40cf50(0xe5),_0x147329=_0x1d5d03?_0x4bb381:join(dirname(_0x4bb381),_0x40cf50(0xf6)+'e-'+_0x1c849c),_0x1bae1=join(_0x1a11a2,_0x1c849c);if(!existsSync(_0x1bae1))continue;try{const _0x2d6c94=_0x1d5d03||_0x145964[_0x40cf50(0xe0)](_0x3ae98c=>_0x3ae98c?.['id']===_0x1c849c);if(_0x2d6c94){const _0x3f15b1=await readJsonVersion(join(_0x147329,'readme.j'+_0x40cf50(0xe7)));if(_0x1352c3&&_0x3f15b1&&_0x1352c3===_0x3f15b1)continue;await mkdir(_0x147329,{'recursive':!![]}),await copyManagedPaths(_0x1bae1,_0x147329,_0x513cdb);}else await rm(_0x147329,{'recursive':!![],'force':!![]}),await mkdir(_0x147329,{'recursive':!![]}),await cp(_0x1bae1,_0x147329,{'recursive':!![]});_0x312583=!![];if(_0x1d5d03)continue;if(_0x2d6c94){const _0x5b8878={'agentId':_0x1c849c,'workspace':_0x147329};if(_0x26eaaa)_0x5b8878['name']=_0x26eaaa;if(_0x40baf7)_0x5b8878[_0x40cf50(0xd6)]=_0x40baf7;if(_0x5c01f8)_0x5b8878[_0x40cf50(0xca)]=_0x5c01f8;await _0x4ede26(_0x5b8878);}else{const _0x4690c5={'name':_0x1c849c,'workspace':_0x147329};if(_0x40baf7)_0x4690c5[_0x40cf50(0xd6)]=_0x40baf7;if(_0x5c01f8)_0x4690c5[_0x40cf50(0xca)]=_0x5c01f8;const _0x598b70=asRecord(await _0x2302e1(_0x4690c5));_0x26eaaa&&await _0x4ede26({'agentId':getTrimmedString(_0x598b70['agentId'])||_0x1c849c,'name':_0x26eaaa});}}catch(_0x34271f){console[_0x40cf50(0xd7)](_0x40cf50(0xd5)+'hell:age'+_0x40cf50(0xed)+'led\x20to\x20s'+_0x40cf50(0xd3)+_0x40cf50(0xdb)+_0x40cf50(0xf3)+_0x1c849c+'\x22',_0x34271f);}}return await _0x19f7dd?.({'agentIds':_0x2885df[_0x40cf50(0xe3)](_0xd9bb14=>_0xd9bb14[_0x40cf50(0xcb)]),'mainWorkspace':_0x4bb381}),{'didUpdate':_0x312583,'bundledAgents':_0x2885df};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x35dcde=_0x5409;(function(_0x189c98,_0x5119f5){const _0x5e3a99=_0x5409,_0x5d6f17=_0x189c98();while(!![]){try{const _0xcbef3c=parseInt(_0x5e3a99(0x1a9))/0x1*(parseInt(_0x5e3a99(0x13c))/0x2)+-parseInt(_0x5e3a99(0x16c))/0x3+parseInt(_0x5e3a99(0x14c))/0x4+-parseInt(_0x5e3a99(0x163))/0x5+-parseInt(_0x5e3a99(0x16d))/0x6*(-parseInt(_0x5e3a99(0x1c1))/0x7)+parseInt(_0x5e3a99(0x1a3))/0x8*(parseInt(_0x5e3a99(0x196))/0x9)+-parseInt(_0x5e3a99(0x17b))/0xa;if(_0xcbef3c===_0x5119f5)break;else _0x5d6f17['push'](_0x5d6f17['shift']());}catch(_0x2d25da){_0x5d6f17['push'](_0x5d6f17['shift']());}}}(_0xaa35,0xb4dba));import{randomBytes}from'node:crypto';function _0x5409(_0x3ef482,_0x52bfb3){_0x3ef482=_0x3ef482-0x136;const _0xaa35db=_0xaa35();let _0x54090f=_0xaa35db[_0x3ef482];return _0x54090f;}import{existsSync,unwatchFile,watchFile}from'node:fs';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import _0xb305b3,{portNumbers}from'get-port';import{ensureShellStateDirs,getConfigPaths,readJsonFile,writeJsonFile}from'@wujie-shell/config';import{asRecord,dedupeStrings,getTrimmedString,writeJson}from'./utils.mjs';import{loadRuntimeInfo}from'./runtime.mjs';import{createRuntimeLogger,summarizeRuntimeManifest}from'./runtime-logger.mjs';function _0xaa35(){const _0x2e14ad=['modelNam','odel','mtimeMs','ompletio','anged','ailed','ing','ced','toISOStr','dels\x20upd','session','initial\x20','exists','nel-peer','918762cMyFLo','memory-c','aw\x20confi','openai','ated','push','imageMod','product\x20','onfig\x20al','persiste','model','provider','models','memory','keys','merge','3398196AxRGbr','tarted','ttings\x20u','extraDir','ensure\x20i','changed','skills','length','config\x20c','her\x20obse','now','load','openclaw','fig\x20chan','\x20for\x20con','tart','reload\x20s','deviceId','nto\x20open','missing;','info\x20loa','eUrl','pdated','6744700KuYFAI','compat','defaultM','ent\x20ensu','apiKey','config','logsDir','ready\x20cu','lastGood','21495XXxCDC','6TloCTl','anthropi','ded\x20for\x20','256kb','isArray','yName','auto','stateDir','environm','nfig\x20upd','projectR','toString','d\x20opencl','gateway\x20','14733940BCHyGx','openai-c','elPrimar','full','ile\x20watc','ConfigPa','filter','rnal\x20wri','config\x20f','hange','agents','red','ync','created','configPa','Version','oot','rrent','emory','\x20config\x20','runtimeR','indexOf','baseUrl','utf8','per-chan','red\x20inte','slice','5245137ChPqDy','config\x20s','\x20creatin','ore','restartO','eady\x20cur','workspac','c-messag','dmScope','rent','default','dataDir','entries','16fTbyDs','gatewayS','model\x20co','entityPa','protocol','nChange','1rtlOCb','nfig\x20syn','onfig\x20ch','ernal\x20ch','ange','ask-user','allow','penclaw\x20','primary','pluginId','text','plugins','stringif','last-goo','plugin\x20c','fig','nitial\x20o','hex','info','defaults','-questio','modelBas','ports','cheduled','7670439nbKthp','runtime\x20','ompleted'];_0xaa35=function(){return _0x2e14ad;};return _0xaa35();}import{syncRuntimeManifestPlugins}from'./plugin-sync.mjs';const MEMORY_CORE_PLUGIN_ID=_0x35dcde(0x13d)+_0x35dcde(0x199),ACTIVE_MEMORY_PLUGIN_ID='active-m'+_0x35dcde(0x18d),ASK_USER_QUESTION_PLUGIN_ID=_0x35dcde(0x1ae)+_0x35dcde(0x1bd)+'n';function createToken(){const _0x1fccaf=_0x35dcde;return randomBytes(0x18)[_0x1fccaf(0x178)](_0x1fccaf(0x1ba));}function createProviderModelConfig(_0x3d72b0,_0x132799=![]){const _0x42e720=_0x35dcde;return{'id':_0x3d72b0,'name':_0x3d72b0,'reasoning':!![],'input':_0x132799?['text','image']:[_0x42e720(0x1b3)],'cost':{'input':0x0,'output':0x0,'cacheRead':0x0,'cacheWrite':0x0},'contextWindow':0x3e800,'maxTokens':0x3e800};}function createProviderConfig(_0x532090){const _0x5b9c8a=_0x35dcde;return{'apiKey':_0x532090[_0x5b9c8a(0x167)],'api':_0x532090[_0x5b9c8a(0x1a7)]==='anthropi'+'c'?_0x5b9c8a(0x16e)+_0x5b9c8a(0x19d)+'es':_0x5b9c8a(0x17c)+'ompletio'+'ns',..._0x532090[_0x5b9c8a(0x191)]?{'baseUrl':_0x532090[_0x5b9c8a(0x191)]}:{},'models':[createProviderModelConfig(_0x532090[_0x5b9c8a(0x1c4)+'e'])]};}function createRuntimePluginBootstrap(_0x103ada){const _0x199159=_0x35dcde,_0x3696d6={},_0x4fe724=[];for(const _0x4c1f02 of _0x103ada??[]){const _0x2f93ee=getTrimmedString(_0x4c1f02[_0x199159(0x1b2)]);if(!_0x2f93ee)continue;_0x3696d6[_0x2f93ee]={'enabled':!![]},_0x4fe724[_0x199159(0x141)](_0x2f93ee);}return!_0x3696d6[MEMORY_CORE_PLUGIN_ID]&&(_0x3696d6[MEMORY_CORE_PLUGIN_ID]={'enabled':!![],'config':{'dreaming':{'enabled':!![]}}}),!_0x3696d6[ACTIVE_MEMORY_PLUGIN_ID]&&(_0x3696d6[ACTIVE_MEMORY_PLUGIN_ID]={'enabled':!![]}),{'entries':_0x3696d6,'allow':dedupeStrings([..._0x4fe724,MEMORY_CORE_PLUGIN_ID,ACTIVE_MEMORY_PLUGIN_ID]),'bundledDiscovery':_0x199159(0x164)};}function createInitialOpenClawConfig(_0x4e3caa,_0x5c7389){const _0x21eb74=_0x35dcde,_0x21875b=new Date()[_0x21eb74(0x136)+_0x21eb74(0x1ca)](),_0x26cd8e=join(_0x4e3caa[_0x21eb74(0x1a1)],_0x21eb74(0x19c)+'e'),_0x307fdd=asRecord(_0x4e3caa[_0x21eb74(0x148)]),_0x137617=getTrimmedString(_0x307fdd['defaultM'+_0x21eb74(0x1c5)]),_0x43fa50={'workspace':_0x26cd8e,'memorySearch':{'enabled':!![],'sources':[_0x21eb74(0x149)],'provider':_0x21eb74(0x173)},'compaction':{'memoryFlush':{'enabled':!![],'forceFlushTranscriptBytes':_0x21eb74(0x170),'softThresholdTokens':0x30d40}}};return _0x137617&&(_0x43fa50['model']={'primary':_0x137617}),{'meta':{'lastTouchedVersion':_0x5c7389['openclaw'+_0x21eb74(0x18a)],'lastTouchedAt':_0x21875b},'wizard':{'lastRunAt':_0x21875b,'lastRunVersion':_0x5c7389['openclaw'+'Version'],'lastRunCommand':'onboard','lastRunMode':'local'},'models':{'mode':_0x21eb74(0x14b),'providers':asRecord(_0x307fdd[_0x21eb74(0x147)+'s'])},'agents':{'defaults':_0x43fa50},'tools':{'profile':_0x21eb74(0x17e)},'plugins':createRuntimePluginBootstrap(_0x5c7389['plugins']),'skills':{'load':{'extraDirs':[_0x21eb74(0x152)]}},'session':{'dmScope':_0x21eb74(0x193)+_0x21eb74(0x13b),'reset':{'mode':'idle'}}};}function hasMeaningfulProductModels(_0x26230d){const _0x52659e=_0x35dcde,_0xae7383=asRecord(_0x26230d['models']);return Object[_0x52659e(0x14a)](asRecord(_0xae7383[_0x52659e(0x147)+'s']))['length']>0x0||Boolean(getTrimmedString(_0xae7383[_0x52659e(0x165)+_0x52659e(0x1c5)]));}function summarizeOpenClawConfig(_0x579737){const _0x398cae=_0x35dcde,_0x4b4565=asRecord(_0x579737[_0x398cae(0x148)]),_0x4ed24c=asRecord(_0x4b4565[_0x398cae(0x147)+'s']),_0x54fb42=asRecord(_0x579737[_0x398cae(0x185)]),_0x422d14=asRecord(_0x54fb42[_0x398cae(0x1bc)]),_0x1232fe=asRecord(_0x422d14['model']),_0x38e395=asRecord(_0x579737[_0x398cae(0x1b4)]),_0x3fafca=asRecord(_0x38e395[_0x398cae(0x1a2)]),_0x5ca38d=asRecord(_0x579737[_0x398cae(0x152)]),_0x44ccc9=asRecord(_0x5ca38d[_0x398cae(0x157)]),_0x31c11b=asRecord(_0x579737['session']),_0x3a8cae=Array[_0x398cae(0x171)](_0x44ccc9[_0x398cae(0x14f)+'s'])?_0x44ccc9[_0x398cae(0x14f)+'s']:[];return{'providerCount':Object['keys'](_0x4ed24c)[_0x398cae(0x153)],'defaultModel':getTrimmedString(_0x1232fe['primary']),'pluginEntryCount':Object[_0x398cae(0x14a)](_0x3fafca)[_0x398cae(0x153)],'pluginAllowCount':Array[_0x398cae(0x171)](_0x38e395['allow'])?_0x38e395[_0x398cae(0x1af)][_0x398cae(0x153)]:0x0,'skillExtraDirCount':_0x3a8cae[_0x398cae(0x153)],'sessionDmScope':getTrimmedString(_0x31c11b[_0x398cae(0x19e)])};}function syncProductModels(_0x52bddd,_0x36309f){const _0x521baf=_0x35dcde;if(!hasMeaningfulProductModels(_0x36309f))return{'config':_0x52bddd,'changed':![]};let _0x16af6b=![];const _0x2ee795=asRecord(_0x36309f[_0x521baf(0x148)]),_0x5b5e56=asRecord(_0x2ee795['provider'+'s']),_0x56fde0=getTrimmedString(_0x2ee795[_0x521baf(0x165)+_0x521baf(0x1c5)]),_0x28c40b=asRecord(_0x52bddd['models']),_0x258eab=asRecord(_0x28c40b[_0x521baf(0x147)+'s']);for(const [_0x277b80,_0x183379]of Object[_0x521baf(0x1a2)](_0x5b5e56)){const _0x5754b7=asRecord(_0x258eab[_0x277b80]),_0xfe2586=asRecord(_0x183379);JSON['stringif'+'y'](_0x5754b7)!==JSON[_0x521baf(0x1b5)+'y'](_0xfe2586)&&(_0x258eab[_0x277b80]=_0xfe2586,_0x16af6b=!![]);}_0x28c40b['mode']!==_0x521baf(0x14b)&&(_0x28c40b['mode']=_0x521baf(0x14b),_0x16af6b=!![]);_0x28c40b[_0x521baf(0x147)+'s']!==_0x258eab&&(_0x28c40b[_0x521baf(0x147)+'s']=_0x258eab,_0x16af6b=!![]);_0x52bddd[_0x521baf(0x148)]!==_0x28c40b&&(_0x52bddd['models']=_0x28c40b,_0x16af6b=!![]);if(_0x56fde0){const _0x4e3366=asRecord(_0x52bddd[_0x521baf(0x185)]),_0x774753=asRecord(_0x4e3366['defaults']),_0x3bd299=asRecord(_0x774753[_0x521baf(0x146)]);_0x3bd299[_0x521baf(0x1b1)]!==_0x56fde0&&(_0x774753['model']={..._0x3bd299,'primary':_0x56fde0},_0x4e3366[_0x521baf(0x1bc)]=_0x774753,_0x52bddd['agents']=_0x4e3366,_0x16af6b=!![]);}return{'config':_0x52bddd,'changed':_0x16af6b};}export function createConfigController(_0x35e35a){const _0x272f25=_0x35dcde,_0x49914a=getConfigPaths(_0x35e35a),_0xbc1f29=createRuntimeLogger(_0x49914a,_0x272f25(0x168));let _0x569d3c=![],_0x56b9e0=0x0,_0x10b720=null,_0x4fa935=null;function _0x33721b(){const _0xdd5086=_0x272f25;return _0x49914a[_0xdd5086(0x189)+'th'];}function _0xbcc4d0(){const _0x56f2b9=_0x272f25;return _0x49914a[_0x56f2b9(0x174)];}function _0x3dce05(){const _0x5cb28b=_0x272f25;return _0x49914a[_0x5cb28b(0x15d)+_0x5cb28b(0x1a6)+'th'];}async function _0x53c077(){const _0x464ee5=_0x272f25;await ensureShellStateDirs(_0x35e35a),process.env.OPENCLAW_STATE_DIR=_0x49914a[_0x464ee5(0x174)],process.env.OPENCLAW_CONFIG_PATH=_0x49914a[_0x464ee5(0x189)+'th'],_0xbc1f29?.['info']('openclaw'+'\x20config\x20'+_0x464ee5(0x175)+_0x464ee5(0x166)+_0x464ee5(0x186),{'stateDir':_0x49914a[_0x464ee5(0x174)],'configPath':_0x49914a[_0x464ee5(0x189)+'th'],'logsDir':_0x49914a[_0x464ee5(0x169)]});}async function _0x294036(){const _0x1dbe04=_0x272f25,_0x2623d2=Date[_0x1dbe04(0x156)]();_0xbc1f29?.[_0x1dbe04(0x1bb)]('ensure\x20i'+_0x1dbe04(0x1b9)+'penclaw\x20'+_0x1dbe04(0x197)+_0x1dbe04(0x14d),{'configPath':_0x49914a[_0x1dbe04(0x189)+'th'],'stateDir':_0x49914a[_0x1dbe04(0x174)]});try{await _0x53c077();const _0x2e7823=await loadRuntimeInfo(_0x35e35a[_0x1dbe04(0x177)+_0x1dbe04(0x18b)]);_0xbc1f29?.['info'](_0x1dbe04(0x1c2)+_0x1dbe04(0x160)+_0x1dbe04(0x16f)+_0x1dbe04(0x197)+_0x1dbe04(0x187),{'runtimeRoot':_0x2e7823[_0x1dbe04(0x18f)+'oot'],'manifest':summarizeRuntimeManifest(_0x2e7823['manifest'])});if(!existsSync(_0x49914a[_0x1dbe04(0x189)+'th'])){const _0x354078=createInitialOpenClawConfig(_0x35e35a,_0x2e7823);_0xbc1f29?.['info']('initial\x20'+_0x1dbe04(0x158)+_0x1dbe04(0x18e)+_0x1dbe04(0x15f)+_0x1dbe04(0x198)+'g',{'configPath':_0x49914a[_0x1dbe04(0x189)+'th'],'config':summarizeOpenClawConfig(_0x354078)}),_0x5c939f(),await _0x502002(_0x354078,_0x1dbe04(0x139)+_0x1dbe04(0x158)+'\x20config\x20'+_0x1dbe04(0x188)),await writeJson(_0x49914a[_0x1dbe04(0x16b)+'ConfigPa'+'th'],_0x354078),_0xbc1f29?.['info'](_0x1dbe04(0x1b6)+_0x1dbe04(0x179)+_0x1dbe04(0x13e)+'g\x20writte'+'n',{'path':_0x49914a[_0x1dbe04(0x16b)+_0x1dbe04(0x180)+'th'],'reason':'initial\x20'+_0x1dbe04(0x158)+_0x1dbe04(0x18e)+_0x1dbe04(0x188)});}else _0xbc1f29?.['info'](_0x1dbe04(0x139)+_0x1dbe04(0x158)+_0x1dbe04(0x18e)+_0x1dbe04(0x13a),{'configPath':_0x49914a[_0x1dbe04(0x189)+'th']});await _0x1b509a(),await _0x80672c(),_0xbc1f29?.[_0x1dbe04(0x1bb)](_0x1dbe04(0x150)+_0x1dbe04(0x1b9)+_0x1dbe04(0x1b0)+_0x1dbe04(0x154)+_0x1dbe04(0x1c3),{'durationMs':Date[_0x1dbe04(0x156)]()-_0x2623d2});}catch(_0x3e5871){_0xbc1f29?.['error'](_0x1dbe04(0x150)+_0x1dbe04(0x1b9)+_0x1dbe04(0x1b0)+_0x1dbe04(0x183)+_0x1dbe04(0x1c9),{'durationMs':Date['now']()-_0x2623d2,'error':_0x3e5871});throw _0x3e5871;}}async function _0x2cfab7(){const _0x5d34ee=_0x272f25;return await _0x294036(),readJsonFile(_0x49914a[_0x5d34ee(0x189)+'th'],{});}async function _0x446bbb(){const _0x3b8362=_0x272f25;return readJsonFile(_0x49914a[_0x3b8362(0x189)+'th'],{});}async function _0x502002(_0x245094,_0x22ceb8='openclaw'+'\x20config\x20'+'written'){const _0x286fe5=_0x272f25;await mkdir(dirname(_0x49914a[_0x286fe5(0x189)+'th']),{'recursive':!![]}),await writeFile(_0x49914a[_0x286fe5(0x189)+'th'],JSON['stringif'+'y'](_0x245094,null,0x2)+'\x0a',_0x286fe5(0x192)),_0xbc1f29?.['info'](_0x22ceb8,{'configPath':_0x49914a[_0x286fe5(0x189)+'th'],'config':summarizeOpenClawConfig(_0x245094)});}async function _0x80672c(){const _0xe62d0d=_0x272f25,_0x1df9d6=await loadRuntimeInfo(_0x35e35a[_0xe62d0d(0x177)+_0xe62d0d(0x18b)]),_0x503890=await _0x446bbb(),_0x2c736d=syncRuntimeManifestPlugins(_0x503890['plugins'],_0x1df9d6[_0xe62d0d(0x1b4)]);_0x2c736d[_0xe62d0d(0x151)]||!_0x503890['plugins']?(_0x503890[_0xe62d0d(0x1b4)]=_0x2c736d[_0xe62d0d(0x1b4)],_0x5c939f(),await _0x502002(_0x503890,_0xe62d0d(0x1c2)+'plugins\x20'+'synced\x20i'+_0xe62d0d(0x15e)+'claw\x20con'+_0xe62d0d(0x1b8)),_0xbc1f29?.[_0xe62d0d(0x1bb)](_0xe62d0d(0x1c2)+_0xe62d0d(0x1b7)+_0xe62d0d(0x1ab)+_0xe62d0d(0x1c8),{'runtimePluginCount':_0x1df9d6[_0xe62d0d(0x1b4)][_0xe62d0d(0x153)],'config':summarizeOpenClawConfig(_0x503890)})):_0xbc1f29?.[_0xe62d0d(0x1bb)](_0xe62d0d(0x1c2)+'plugin\x20c'+_0xe62d0d(0x144)+_0xe62d0d(0x16a)+_0xe62d0d(0x18c),{'runtimePluginCount':_0x1df9d6[_0xe62d0d(0x1b4)][_0xe62d0d(0x153)]});}async function _0x1b509a(){const _0x1cd378=_0x272f25,_0x20a001=await _0x446bbb(),_0x4b8ebf=syncProductModels(_0x20a001,_0x35e35a);_0x4b8ebf[_0x1cd378(0x151)]?(await _0x1c1127(_0x4b8ebf[_0x1cd378(0x168)],_0x1cd378(0x143)+_0x1cd378(0x1a5)+_0x1cd378(0x176)+_0x1cd378(0x140)),_0xbc1f29?.[_0x1cd378(0x1bb)](_0x1cd378(0x143)+_0x1cd378(0x1a5)+_0x1cd378(0x1aa)+_0x1cd378(0x1cb),{'config':summarizeOpenClawConfig(_0x4b8ebf[_0x1cd378(0x168)])})):_0xbc1f29?.[_0x1cd378(0x1bb)]('product\x20'+'model\x20co'+'nfig\x20alr'+_0x1cd378(0x19b)+_0x1cd378(0x19f),{'hasProductModels':hasMeaningfulProductModels(_0x35e35a)});}async function _0x1e1212(){const _0x2be4b0=_0x272f25;await _0x294036();const _0x5410fe=await _0xb305b3({'port':portNumbers(_0x35e35a['ports']['gatewayS'+_0x2be4b0(0x15b)],_0x35e35a[_0x2be4b0(0x1bf)][_0x2be4b0(0x1a4)+_0x2be4b0(0x15b)]+0x63)});return{'token':createToken(),'port':_0x5410fe};}async function _0x4aa76f(){const _0x18cd0b=_0x272f25,_0x449b1e=await _0x2cfab7(),_0x58c97a=asRecord(_0x449b1e['agents']),_0x5c7c3d=asRecord(_0x58c97a[_0x18cd0b(0x1bc)]),_0x503d15=asRecord(_0x5c7c3d[_0x18cd0b(0x146)]),_0x2e88ea=getTrimmedString(_0x503d15[_0x18cd0b(0x1b1)]),_0x2de75a=_0x2e88ea[_0x18cd0b(0x190)]('/'),_0x388e8c=_0x2de75a>0x0?_0x2e88ea['slice'](0x0,_0x2de75a):_0x2e88ea,_0x540a9f=_0x2de75a>0x0?_0x2e88ea[_0x18cd0b(0x195)](_0x2de75a+0x1):'',_0x449536=asRecord(asRecord(_0x449b1e['models'])['provider'+'s']),_0x2521c5=asRecord(_0x449536[_0x388e8c]);return{'provider':_0x388e8c||'','apiKey':getTrimmedString(_0x2521c5[_0x18cd0b(0x167)]),'modelName':_0x540a9f,'modelBaseUrl':getTrimmedString(_0x2521c5[_0x18cd0b(0x191)])};}async function _0x2329b4(_0x285e23,_0x3b3792={}){const _0x5ec6f8=_0x272f25,_0x538d0e=await _0x2cfab7(),_0x59a5d2=_0x285e23[_0x5ec6f8(0x147)]||_0x5ec6f8(0x1a0),_0x45c6e2=_0x59a5d2+'/'+_0x285e23[_0x5ec6f8(0x1c4)+'e'],_0xf390ef=asRecord(_0x538d0e['models']),_0x22589a=asRecord(_0xf390ef[_0x5ec6f8(0x147)+'s']);_0x22589a[_0x59a5d2]={...asRecord(_0x22589a[_0x59a5d2]),...createProviderConfig({'apiKey':_0x285e23[_0x5ec6f8(0x167)]||'','protocol':_0x285e23[_0x5ec6f8(0x1a7)]||_0x5ec6f8(0x13f),'baseUrl':_0x285e23[_0x5ec6f8(0x1be)+_0x5ec6f8(0x161)]||_0x285e23[_0x5ec6f8(0x191)]||'','modelName':_0x285e23['modelNam'+'e']})},_0xf390ef[_0x5ec6f8(0x147)+'s']=_0x22589a,_0x538d0e[_0x5ec6f8(0x148)]=_0xf390ef;const _0x5e3cb2=asRecord(_0x538d0e[_0x5ec6f8(0x185)]),_0x13b1ea=asRecord(_0x5e3cb2[_0x5ec6f8(0x1bc)]);return _0x13b1ea[_0x5ec6f8(0x146)]={...asRecord(_0x13b1ea[_0x5ec6f8(0x146)]),'primary':_0x45c6e2},_0x13b1ea['models']={...asRecord(_0x13b1ea['models']),[_0x45c6e2]:asRecord(asRecord(_0x13b1ea[_0x5ec6f8(0x148)])[_0x45c6e2])},_0x5e3cb2[_0x5ec6f8(0x1bc)]=_0x13b1ea,_0x538d0e['agents']=_0x5e3cb2,_0x538d0e[_0x5ec6f8(0x138)]={...asRecord(_0x538d0e[_0x5ec6f8(0x138)]),'dmScope':_0x5ec6f8(0x193)+'nel-peer'},await _0x1c1127(_0x538d0e,_0x3b3792[_0x5ec6f8(0x19a)+_0x5ec6f8(0x1a8)]?'model\x20se'+_0x5ec6f8(0x14e)+_0x5ec6f8(0x162):''),{'ok':!![]};}async function _0x1f0acc(_0x97d53c){const _0x3c6ba3=_0x272f25,_0x244aa2=await _0x2cfab7(),_0x2b197d=_0x97d53c['provider'+'Key'],_0x39c085=asRecord(_0x244aa2[_0x3c6ba3(0x148)]),_0x27f976=asRecord(_0x39c085[_0x3c6ba3(0x147)+'s']);_0x27f976[_0x2b197d]={...asRecord(_0x27f976[_0x2b197d]),'apiKey':_0x97d53c[_0x3c6ba3(0x167)],'api':_0x3c6ba3(0x17c)+_0x3c6ba3(0x1c7)+'ns','baseUrl':_0x97d53c[_0x3c6ba3(0x191)],'models':(_0x97d53c[_0x3c6ba3(0x1c4)+'es']??[])['map'](_0x455cca=>createProviderModelConfig(_0x455cca,_0x455cca===_0x97d53c[_0x3c6ba3(0x142)+_0x3c6ba3(0x17d)+_0x3c6ba3(0x172)]))},_0x39c085['provider'+'s']=_0x27f976,_0x244aa2[_0x3c6ba3(0x148)]=_0x39c085;if(_0x97d53c[_0x3c6ba3(0x142)+'elPrimar'+_0x3c6ba3(0x172)]){const _0x166ef2=asRecord(_0x244aa2['agents']),_0x4c9cea=asRecord(_0x166ef2[_0x3c6ba3(0x1bc)]);_0x4c9cea[_0x3c6ba3(0x142)+'el']={...asRecord(_0x4c9cea[_0x3c6ba3(0x142)+'el']),'primary':_0x2b197d+'/'+_0x97d53c[_0x3c6ba3(0x142)+_0x3c6ba3(0x17d)+_0x3c6ba3(0x172)]},_0x166ef2[_0x3c6ba3(0x1bc)]=_0x4c9cea,_0x244aa2[_0x3c6ba3(0x185)]=_0x166ef2;}return await _0x1c1127(_0x244aa2,'self-ope'+'rated\x20mo'+_0x3c6ba3(0x137)+_0x3c6ba3(0x140)),{'ok':!![]};}async function _0x365d4e({callbackUrl:_0x4f6f0e,secret:_0x531b9a}){const _0x4f69e8=_0x272f25,_0x31a166=await _0x2cfab7(),_0x424d32=asRecord(_0x31a166[_0x4f69e8(0x1b4)]),_0xa73ad2=asRecord(_0x424d32[_0x4f69e8(0x1a2)]),_0x25c72b=asRecord(_0xa73ad2[ASK_USER_QUESTION_PLUGIN_ID]);return _0xa73ad2[ASK_USER_QUESTION_PLUGIN_ID]={..._0x25c72b,'enabled':!![],'config':{...asRecord(_0x25c72b[_0x4f69e8(0x168)]),'callbackUrl':_0x4f6f0e,'secret':_0x531b9a}},_0x424d32['entries']=_0xa73ad2,_0x424d32[_0x4f69e8(0x1af)]=dedupeStrings([...(Array[_0x4f69e8(0x171)](_0x424d32[_0x4f69e8(0x1af)])?_0x424d32[_0x4f69e8(0x1af)]:[])[_0x4f69e8(0x181)](Boolean),ASK_USER_QUESTION_PLUGIN_ID]),_0x31a166[_0x4f69e8(0x1b4)]=_0x424d32,await _0x1c1127(_0x31a166,''),{'ok':!![]};}async function _0x1c1127(_0x165aa6,_0x141441=''){const _0x208fcc=_0x272f25;_0x5c939f(),await _0x502002(_0x165aa6,_0x141441||_0x208fcc(0x158)+_0x208fcc(0x18e)+'persiste'+'d'),await writeJsonFile(_0x49914a['lastGood'+_0x208fcc(0x180)+'th'],_0x165aa6),_0xbc1f29?.[_0x208fcc(0x1bb)]('last-goo'+_0x208fcc(0x179)+_0x208fcc(0x13e)+'g\x20writte'+'n',{'path':_0x49914a[_0x208fcc(0x16b)+'ConfigPa'+'th'],'reason':_0x141441||'openclaw'+_0x208fcc(0x18e)+_0x208fcc(0x145)+'d'});if(_0x141441)_0xf2e71(_0x141441);}function _0x5c939f(){if(_0x569d3c)_0x56b9e0+=0x1;}function _0x364aea(_0x2cb0d5){_0x4fa935=_0x2cb0d5;}function _0xf2e71(_0x51c0e1){const _0x492516=_0x272f25;if(!_0x4fa935)return;if(_0x10b720)clearTimeout(_0x10b720);_0xbc1f29?.[_0x492516(0x1bb)](_0x492516(0x17a)+_0x492516(0x15c)+_0x492516(0x1c0)+_0x492516(0x15a)+_0x492516(0x159)+'ge',{'reason':_0x51c0e1,'debounceMs':0xfa}),_0x10b720=setTimeout(()=>_0x4fa935(_0x51c0e1),0xfa);}function _0x3e9767(){const _0x49a100=_0x272f25;unwatchFile(_0x49914a['configPa'+'th']),_0x569d3c=!![],watchFile(_0x49914a[_0x49a100(0x189)+'th'],{'interval':0x3e8},(_0x439abe,_0x1c2e06)=>{const _0x3c30dd=_0x49a100;if(_0x439abe[_0x3c30dd(0x1c6)]===_0x1c2e06['mtimeMs'])return;if(_0x56b9e0>0x0){_0x56b9e0-=0x1,_0xbc1f29?.[_0x3c30dd(0x1bb)](_0x3c30dd(0x183)+_0x3c30dd(0x17f)+'her\x20igno'+_0x3c30dd(0x194)+_0x3c30dd(0x182)+'te',{'configPath':_0x49914a[_0x3c30dd(0x189)+'th'],'ignoredConfigWatchReloads':_0x56b9e0});return;}_0xbc1f29?.[_0x3c30dd(0x1bb)](_0x3c30dd(0x183)+_0x3c30dd(0x17f)+_0x3c30dd(0x155)+'rved\x20ext'+_0x3c30dd(0x1ac)+_0x3c30dd(0x1ad),{'configPath':_0x49914a[_0x3c30dd(0x189)+'th']}),_0xf2e71(_0x3c30dd(0x154)+_0x3c30dd(0x184));});}function _0x3ac860(){const _0x1b51f0=_0x272f25;if(_0x10b720)clearTimeout(_0x10b720);unwatchFile(_0x49914a[_0x1b51f0(0x189)+'th']),_0x569d3c=![],_0x56b9e0=0x0;}return{'paths':_0x49914a,'resolveConfigPath':_0x33721b,'resolveStateDir':_0xbcc4d0,'resolveDeviceIdentityPath':_0x3dce05,'ensureConfigPathEnv':_0x53c077,'ensureInitialConfig':_0x294036,'ensureGatewaySettings':_0x1e1212,'readConfig':_0x2cfab7,'writeConfig':_0x502002,'syncRuntimePlugins':_0x80672c,'getModelSettings':_0x4aa76f,'setModelSettings':_0x2329b4,'setSelfOperatedModels':_0x1f0acc,'ensureAskUserQuestionPluginConfig':_0x365d4e,'markConfigWriteHandledInternally':_0x5c939f,'setGatewayRestartHandler':_0x364aea,'watchConfigChanges':_0x3e9767,'dispose':_0x3ac860};}
|
|
1
|
+
const _0x17f4d0=_0x39c5;(function(_0x49a767,_0x3fc9e4){const _0x907562=_0x39c5,_0x4d3b5f=_0x49a767();while(!![]){try{const _0xbf02a9=-parseInt(_0x907562(0x13f))/0x1*(-parseInt(_0x907562(0x143))/0x2)+-parseInt(_0x907562(0x14e))/0x3*(parseInt(_0x907562(0x141))/0x4)+parseInt(_0x907562(0x12c))/0x5*(-parseInt(_0x907562(0x132))/0x6)+-parseInt(_0x907562(0x147))/0x7*(-parseInt(_0x907562(0x16b))/0x8)+parseInt(_0x907562(0x11d))/0x9+parseInt(_0x907562(0x127))/0xa*(parseInt(_0x907562(0x163))/0xb)+-parseInt(_0x907562(0x117))/0xc;if(_0xbf02a9===_0x3fc9e4)break;else _0x4d3b5f['push'](_0x4d3b5f['shift']());}catch(_0xa7f9bf){_0x4d3b5f['push'](_0x4d3b5f['shift']());}}}(_0x2662,0x3cdbe));import{randomBytes}from'node:crypto';import{existsSync,unwatchFile,watchFile}from'node:fs';import{mkdir,writeFile}from'node:fs/promises';function _0x39c5(_0x4cd899,_0x2af9f7){_0x4cd899=_0x4cd899-0xfd;const _0x2662be=_0x2662();let _0x39c587=_0x2662be[_0x4cd899];return _0x39c587;}import{dirname,join}from'node:path';import _0x5e9967,{portNumbers}from'get-port';import{ensureShellStateDirs,getConfigPaths,readJsonFile,writeJsonFile}from'@wujie-shell/config';function _0x2662(){const _0xa26e82=['g\x20writte','585109eJaIiU','onboard','openai','product\x20','slice','config','mode','9EPgLHh','memory-c','local','ent\x20ensu','rated\x20mo','config\x20c','per-chan','protocol','pluginId','ernal\x20ch','isArray','\x20for\x20con','nfig\x20syn','length','toString','written','apiKey','baseUrl','self-ope','load','now','11scAIAS','default','ced','ask-user','info','allow','projectR','modelNam','8EHqnPC','agents','tart','model\x20co','ompletio','keys','initial\x20','last-goo','image','ensure\x20i','entries','lastGood','idle','stringif','fig','hex','eUrl','d\x20opencl','active-m','plugins','defaultM','exists','ing','256kb','restartO','nel-peer','mtimeMs','defaults','environm','model','text','ompleted','manifest','session','cheduled','provider','reload\x20s','error','models','anged','ConfigPa','yName','elPrimar','rnal\x20wri','toISOStr','plugin\x20c','claw\x20con','primary','openai-c','nfig\x20alr','ync','auto','onfig\x20al','ore','entityPa','runtime\x20','aw\x20confi','ports','1813704wdimVp','filter','info\x20loa','her\x20obse','onfig\x20ch','config\x20s','2402514RSoRUE','persiste','push','indexOf','nitial\x20o','emory','her\x20igno','utf8','\x20config\x20','odel','2538840WadxkT','openclaw','configPa','ile\x20watc','ded\x20for\x20','196665vfited','oot','logsDir','-questio','gatewayS','merge','36zolViI','Version','fig\x20chan','penclaw\x20','config\x20f','deviceId','plugins\x20','skills','imageMod','compat','extraDir','created','stateDir','73537EuLSlB','\x20creatin','251480JGCaYT','red','6jgcmQn','ated','changed'];_0x2662=function(){return _0xa26e82;};return _0x2662();}import{asRecord,dedupeStrings,getTrimmedString,writeJson}from'./utils.mjs';import{loadRuntimeInfo}from'./runtime.mjs';import{createRuntimeLogger,summarizeRuntimeManifest}from'./runtime-logger.mjs';import{syncRuntimeManifestPlugins}from'./plugin-sync.mjs';const MEMORY_CORE_PLUGIN_ID=_0x17f4d0(0x14f)+_0x17f4d0(0x112),ACTIVE_MEMORY_PLUGIN_ID=_0x17f4d0(0x17d)+_0x17f4d0(0x122),ASK_USER_QUESTION_PLUGIN_ID=_0x17f4d0(0x166)+_0x17f4d0(0x12f)+'n';function createToken(){const _0x218650=_0x17f4d0;return randomBytes(0x18)[_0x218650(0x15c)](_0x218650(0x17a));}function createProviderModelConfig(_0x5d0450,_0x4e412c=![]){const _0x71b1ad=_0x17f4d0;return{'id':_0x5d0450,'name':_0x5d0450,'reasoning':!![],'input':_0x4e412c?['text',_0x71b1ad(0x173)]:[_0x71b1ad(0x189)],'cost':{'input':0x0,'output':0x0,'cacheRead':0x0,'cacheWrite':0x0},'contextWindow':0x3e800,'maxTokens':0x3e800};}function createProviderConfig(_0x39d136){const _0x2b14f0=_0x17f4d0;return{'apiKey':_0x39d136[_0x2b14f0(0x15e)],'api':_0x39d136[_0x2b14f0(0x155)]==='anthropi'+'c'?'anthropi'+'c-messag'+'es':'openai-c'+_0x2b14f0(0x16f)+'ns',..._0x39d136['baseUrl']?{'baseUrl':_0x39d136[_0x2b14f0(0x15f)]}:{},'models':[createProviderModelConfig(_0x39d136[_0x2b14f0(0x16a)+'e'])]};}function createRuntimePluginBootstrap(_0x1d6f52){const _0x4c0ee5=_0x17f4d0,_0x3ae50d={},_0x25120a=[];for(const _0x1c5150 of _0x1d6f52??[]){const _0x5cd2b9=getTrimmedString(_0x1c5150[_0x4c0ee5(0x156)]);if(!_0x5cd2b9)continue;_0x3ae50d[_0x5cd2b9]={'enabled':!![]},_0x25120a[_0x4c0ee5(0x11f)](_0x5cd2b9);}return!_0x3ae50d[MEMORY_CORE_PLUGIN_ID]&&(_0x3ae50d[MEMORY_CORE_PLUGIN_ID]={'enabled':!![],'config':{'dreaming':{'enabled':!![]}}}),!_0x3ae50d[ACTIVE_MEMORY_PLUGIN_ID]&&(_0x3ae50d[ACTIVE_MEMORY_PLUGIN_ID]={'enabled':!![]}),{'entries':_0x3ae50d,'allow':dedupeStrings([..._0x25120a,MEMORY_CORE_PLUGIN_ID,ACTIVE_MEMORY_PLUGIN_ID]),'bundledDiscovery':_0x4c0ee5(0x13b)};}function createInitialOpenClawConfig(_0x8a7ca5,_0x559e03){const _0x511afb=_0x17f4d0,_0x4d1629=new Date()[_0x511afb(0x109)+_0x511afb(0x181)](),_0x3de880=join(_0x8a7ca5['dataDir'],'workspac'+'e'),_0x418623=asRecord(_0x8a7ca5[_0x511afb(0x103)]),_0x29ff79=getTrimmedString(_0x418623[_0x511afb(0x17f)+'odel']),_0x224d05={'workspace':_0x3de880,'memorySearch':{'enabled':!![],'sources':['memory'],'provider':_0x511afb(0x110)},'compaction':{'memoryFlush':{'enabled':!![],'forceFlushTranscriptBytes':_0x511afb(0x182),'softThresholdTokens':0x30d40}}};return _0x29ff79&&(_0x224d05[_0x511afb(0x188)]={'primary':_0x29ff79}),{'meta':{'lastTouchedVersion':_0x559e03['openclaw'+_0x511afb(0x133)],'lastTouchedAt':_0x4d1629},'wizard':{'lastRunAt':_0x4d1629,'lastRunVersion':_0x559e03[_0x511afb(0x128)+'Version'],'lastRunCommand':_0x511afb(0x148),'lastRunMode':_0x511afb(0x150)},'models':{'mode':'merge','providers':asRecord(_0x418623[_0x511afb(0x100)+'s'])},'agents':{'defaults':_0x224d05},'tools':{'profile':'full'},'plugins':createRuntimePluginBootstrap(_0x559e03[_0x511afb(0x17e)]),'skills':{'load':{'extraDirs':[_0x511afb(0x139)]}},'session':{'dmScope':_0x511afb(0x154)+_0x511afb(0x184),'reset':{'mode':_0x511afb(0x177)}}};}function hasMeaningfulProductModels(_0x4ef3ad){const _0x4eeb4f=_0x17f4d0,_0x2413d0=asRecord(_0x4ef3ad[_0x4eeb4f(0x103)]);return Object[_0x4eeb4f(0x170)](asRecord(_0x2413d0[_0x4eeb4f(0x100)+'s']))[_0x4eeb4f(0x15b)]>0x0||Boolean(getTrimmedString(_0x2413d0[_0x4eeb4f(0x17f)+'odel']));}function summarizeOpenClawConfig(_0xffedea){const _0x555c21=_0x17f4d0,_0x349033=asRecord(_0xffedea[_0x555c21(0x103)]),_0x1de8ee=asRecord(_0x349033['provider'+'s']),_0x15865d=asRecord(_0xffedea['agents']),_0x28e3a0=asRecord(_0x15865d['defaults']),_0x682e1f=asRecord(_0x28e3a0['model']),_0xa2c0a5=asRecord(_0xffedea[_0x555c21(0x17e)]),_0x1a601c=asRecord(_0xa2c0a5[_0x555c21(0x175)]),_0x264e18=asRecord(_0xffedea[_0x555c21(0x139)]),_0x2322e3=asRecord(_0x264e18[_0x555c21(0x161)]),_0x4b19b7=asRecord(_0xffedea[_0x555c21(0xfe)]),_0x5f06c0=Array[_0x555c21(0x158)](_0x2322e3[_0x555c21(0x13c)+'s'])?_0x2322e3['extraDir'+'s']:[];return{'providerCount':Object[_0x555c21(0x170)](_0x1de8ee)['length'],'defaultModel':getTrimmedString(_0x682e1f['primary']),'pluginEntryCount':Object[_0x555c21(0x170)](_0x1a601c)[_0x555c21(0x15b)],'pluginAllowCount':Array['isArray'](_0xa2c0a5['allow'])?_0xa2c0a5[_0x555c21(0x168)]['length']:0x0,'skillExtraDirCount':_0x5f06c0[_0x555c21(0x15b)],'sessionDmScope':getTrimmedString(_0x4b19b7['dmScope'])};}function syncProductModels(_0x101ec5,_0x22ce61){const _0x3cdc8c=_0x17f4d0;if(!hasMeaningfulProductModels(_0x22ce61))return{'config':_0x101ec5,'changed':![]};let _0x1bf28b=![];const _0x2cd1b2=asRecord(_0x22ce61['models']),_0x5749d1=asRecord(_0x2cd1b2['provider'+'s']),_0x286aa3=getTrimmedString(_0x2cd1b2[_0x3cdc8c(0x17f)+_0x3cdc8c(0x126)]),_0x4dd78c=asRecord(_0x101ec5[_0x3cdc8c(0x103)]),_0x40fe02=asRecord(_0x4dd78c[_0x3cdc8c(0x100)+'s']);for(const [_0x28cd88,_0x2ed5c9]of Object['entries'](_0x5749d1)){const _0x1cb1a5=asRecord(_0x40fe02[_0x28cd88]),_0x3d330b=asRecord(_0x2ed5c9);JSON[_0x3cdc8c(0x178)+'y'](_0x1cb1a5)!==JSON[_0x3cdc8c(0x178)+'y'](_0x3d330b)&&(_0x40fe02[_0x28cd88]=_0x3d330b,_0x1bf28b=!![]);}_0x4dd78c[_0x3cdc8c(0x14d)]!==_0x3cdc8c(0x131)&&(_0x4dd78c[_0x3cdc8c(0x14d)]='merge',_0x1bf28b=!![]);_0x4dd78c[_0x3cdc8c(0x100)+'s']!==_0x40fe02&&(_0x4dd78c[_0x3cdc8c(0x100)+'s']=_0x40fe02,_0x1bf28b=!![]);_0x101ec5[_0x3cdc8c(0x103)]!==_0x4dd78c&&(_0x101ec5[_0x3cdc8c(0x103)]=_0x4dd78c,_0x1bf28b=!![]);if(_0x286aa3){const _0xf810fd=asRecord(_0x101ec5['agents']),_0x2d4d2b=asRecord(_0xf810fd[_0x3cdc8c(0x186)]),_0x16d721=asRecord(_0x2d4d2b[_0x3cdc8c(0x188)]);_0x16d721[_0x3cdc8c(0x10c)]!==_0x286aa3&&(_0x2d4d2b[_0x3cdc8c(0x188)]={..._0x16d721,'primary':_0x286aa3},_0xf810fd[_0x3cdc8c(0x186)]=_0x2d4d2b,_0x101ec5['agents']=_0xf810fd,_0x1bf28b=!![]);}return{'config':_0x101ec5,'changed':_0x1bf28b};}export function createConfigController(_0x34d030){const _0x5859e5=_0x17f4d0,_0x25626a=getConfigPaths(_0x34d030),_0x3f4277=createRuntimeLogger(_0x25626a,_0x5859e5(0x14c));let _0x57d797=![],_0x48e6ed=0x0,_0x4161e0=null,_0x216b4a=null;function _0x258400(){const _0x466017=_0x5859e5;return _0x25626a[_0x466017(0x129)+'th'];}function _0x2ea794(){const _0x599c4f=_0x5859e5;return _0x25626a[_0x599c4f(0x13e)];}function _0x391fa9(){const _0x5002fc=_0x5859e5;return _0x25626a[_0x5002fc(0x137)+_0x5002fc(0x113)+'th'];}async function _0x14ca9e(){const _0x462f07=_0x5859e5;await ensureShellStateDirs(_0x34d030),process.env.OPENCLAW_STATE_DIR=_0x25626a['stateDir'],process.env.OPENCLAW_CONFIG_PATH=_0x25626a[_0x462f07(0x129)+'th'],_0x3f4277?.[_0x462f07(0x167)](_0x462f07(0x128)+_0x462f07(0x125)+_0x462f07(0x187)+_0x462f07(0x151)+_0x462f07(0x142),{'stateDir':_0x25626a['stateDir'],'configPath':_0x25626a[_0x462f07(0x129)+'th'],'logsDir':_0x25626a[_0x462f07(0x12e)]});}async function _0x36b57a(){const _0x1df3d2=_0x5859e5,_0x4fc2aa=Date[_0x1df3d2(0x162)]();_0x3f4277?.[_0x1df3d2(0x167)](_0x1df3d2(0x174)+_0x1df3d2(0x121)+_0x1df3d2(0x135)+_0x1df3d2(0x11c)+'tarted',{'configPath':_0x25626a['configPa'+'th'],'stateDir':_0x25626a[_0x1df3d2(0x13e)]});try{await _0x14ca9e();const _0x218090=await loadRuntimeInfo(_0x34d030[_0x1df3d2(0x169)+_0x1df3d2(0x12d)]);_0x3f4277?.[_0x1df3d2(0x167)]('runtime\x20'+_0x1df3d2(0x119)+_0x1df3d2(0x12b)+_0x1df3d2(0x11c)+_0x1df3d2(0x10f),{'runtimeRoot':_0x218090['runtimeR'+'oot'],'manifest':summarizeRuntimeManifest(_0x218090[_0x1df3d2(0xfd)])});if(!existsSync(_0x25626a[_0x1df3d2(0x129)+'th'])){const _0x10ebdb=createInitialOpenClawConfig(_0x34d030,_0x218090);_0x3f4277?.[_0x1df3d2(0x167)](_0x1df3d2(0x171)+'openclaw'+_0x1df3d2(0x125)+'missing;'+_0x1df3d2(0x140)+'g',{'configPath':_0x25626a[_0x1df3d2(0x129)+'th'],'config':summarizeOpenClawConfig(_0x10ebdb)}),_0x261716(),await _0x2ad1da(_0x10ebdb,_0x1df3d2(0x171)+'openclaw'+_0x1df3d2(0x125)+_0x1df3d2(0x13d)),await writeJson(_0x25626a[_0x1df3d2(0x176)+_0x1df3d2(0x105)+'th'],_0x10ebdb),_0x3f4277?.[_0x1df3d2(0x167)]('last-goo'+'d\x20opencl'+_0x1df3d2(0x115)+_0x1df3d2(0x146)+'n',{'path':_0x25626a[_0x1df3d2(0x176)+_0x1df3d2(0x105)+'th'],'reason':_0x1df3d2(0x171)+_0x1df3d2(0x128)+_0x1df3d2(0x125)+_0x1df3d2(0x13d)});}else _0x3f4277?.[_0x1df3d2(0x167)](_0x1df3d2(0x171)+_0x1df3d2(0x128)+'\x20config\x20'+_0x1df3d2(0x180),{'configPath':_0x25626a[_0x1df3d2(0x129)+'th']});await _0x133fa0(),await _0x1d708a(),_0x3f4277?.[_0x1df3d2(0x167)](_0x1df3d2(0x174)+_0x1df3d2(0x121)+_0x1df3d2(0x135)+'config\x20c'+_0x1df3d2(0x18a),{'durationMs':Date[_0x1df3d2(0x162)]()-_0x4fc2aa});}catch(_0x3ff96e){_0x3f4277?.[_0x1df3d2(0x102)](_0x1df3d2(0x174)+_0x1df3d2(0x121)+'penclaw\x20'+_0x1df3d2(0x136)+'ailed',{'durationMs':Date[_0x1df3d2(0x162)]()-_0x4fc2aa,'error':_0x3ff96e});throw _0x3ff96e;}}async function _0x2eea59(){const _0x37b162=_0x5859e5;return await _0x36b57a(),readJsonFile(_0x25626a[_0x37b162(0x129)+'th'],{});}async function _0x5590e6(){const _0x19820b=_0x5859e5;return readJsonFile(_0x25626a[_0x19820b(0x129)+'th'],{});}async function _0x2ad1da(_0x20cf80,_0x5591d8='openclaw'+'\x20config\x20'+_0x5859e5(0x15d)){const _0x3fde7b=_0x5859e5;await mkdir(dirname(_0x25626a[_0x3fde7b(0x129)+'th']),{'recursive':!![]}),await writeFile(_0x25626a[_0x3fde7b(0x129)+'th'],JSON[_0x3fde7b(0x178)+'y'](_0x20cf80,null,0x2)+'\x0a',_0x3fde7b(0x124)),_0x3f4277?.[_0x3fde7b(0x167)](_0x5591d8,{'configPath':_0x25626a[_0x3fde7b(0x129)+'th'],'config':summarizeOpenClawConfig(_0x20cf80)});}async function _0x1d708a(){const _0xb7102f=_0x5859e5,_0x5a3b0a=await loadRuntimeInfo(_0x34d030[_0xb7102f(0x169)+'oot']),_0x59bcd4=await _0x5590e6(),_0x392395=syncRuntimeManifestPlugins(_0x59bcd4['plugins'],_0x5a3b0a['plugins']);_0x392395[_0xb7102f(0x145)]||!_0x59bcd4['plugins']?(_0x59bcd4[_0xb7102f(0x17e)]=_0x392395['plugins'],_0x261716(),await _0x2ad1da(_0x59bcd4,_0xb7102f(0x114)+_0xb7102f(0x138)+'synced\x20i'+'nto\x20open'+_0xb7102f(0x10b)+_0xb7102f(0x179)),_0x3f4277?.['info'](_0xb7102f(0x114)+_0xb7102f(0x10a)+_0xb7102f(0x11b)+_0xb7102f(0x104),{'runtimePluginCount':_0x5a3b0a[_0xb7102f(0x17e)]['length'],'config':summarizeOpenClawConfig(_0x59bcd4)})):_0x3f4277?.[_0xb7102f(0x167)]('runtime\x20'+_0xb7102f(0x10a)+_0xb7102f(0x111)+'ready\x20cu'+'rrent',{'runtimePluginCount':_0x5a3b0a[_0xb7102f(0x17e)][_0xb7102f(0x15b)]});}async function _0x133fa0(){const _0x41b247=_0x5859e5,_0x347aa5=await _0x5590e6(),_0x12339e=syncProductModels(_0x347aa5,_0x34d030);_0x12339e[_0x41b247(0x145)]?(await _0x29c3cc(_0x12339e[_0x41b247(0x14c)],'product\x20'+'model\x20co'+'nfig\x20upd'+_0x41b247(0x144)),_0x3f4277?.[_0x41b247(0x167)](_0x41b247(0x14a)+_0x41b247(0x16e)+_0x41b247(0x15a)+_0x41b247(0x165),{'config':summarizeOpenClawConfig(_0x12339e['config'])})):_0x3f4277?.[_0x41b247(0x167)](_0x41b247(0x14a)+_0x41b247(0x16e)+_0x41b247(0x10e)+'eady\x20cur'+'rent',{'hasProductModels':hasMeaningfulProductModels(_0x34d030)});}async function _0x592570(){const _0xb9321b=_0x5859e5;await _0x36b57a();const _0x3e6bfe=await _0x5e9967({'port':portNumbers(_0x34d030[_0xb9321b(0x116)][_0xb9321b(0x130)+_0xb9321b(0x16d)],_0x34d030[_0xb9321b(0x116)][_0xb9321b(0x130)+'tart']+0x63)});return{'token':createToken(),'port':_0x3e6bfe};}async function _0x4a7f1a(){const _0x2519ef=_0x5859e5,_0x1c2a45=await _0x2eea59(),_0x52a0ac=asRecord(_0x1c2a45[_0x2519ef(0x16c)]),_0x222b41=asRecord(_0x52a0ac[_0x2519ef(0x186)]),_0x45d417=asRecord(_0x222b41[_0x2519ef(0x188)]),_0x44be30=getTrimmedString(_0x45d417[_0x2519ef(0x10c)]),_0x3d3988=_0x44be30[_0x2519ef(0x120)]('/'),_0x323808=_0x3d3988>0x0?_0x44be30[_0x2519ef(0x14b)](0x0,_0x3d3988):_0x44be30,_0x13f8a9=_0x3d3988>0x0?_0x44be30[_0x2519ef(0x14b)](_0x3d3988+0x1):'',_0x2384bf=asRecord(asRecord(_0x1c2a45[_0x2519ef(0x103)])[_0x2519ef(0x100)+'s']),_0x18500c=asRecord(_0x2384bf[_0x323808]);return{'provider':_0x323808||'','apiKey':getTrimmedString(_0x18500c['apiKey']),'modelName':_0x13f8a9,'modelBaseUrl':getTrimmedString(_0x18500c[_0x2519ef(0x15f)])};}async function _0x313d59(_0x13e0f2,_0x5e4dba={}){const _0x2d8fce=_0x5859e5,_0x4c2dc4=await _0x2eea59(),_0x465f35=_0x13e0f2[_0x2d8fce(0x100)]||_0x2d8fce(0x164),_0x273154=_0x465f35+'/'+_0x13e0f2[_0x2d8fce(0x16a)+'e'],_0x386fb4=asRecord(_0x4c2dc4[_0x2d8fce(0x103)]),_0x53bfd3=asRecord(_0x386fb4[_0x2d8fce(0x100)+'s']);_0x53bfd3[_0x465f35]={...asRecord(_0x53bfd3[_0x465f35]),...createProviderConfig({'apiKey':_0x13e0f2[_0x2d8fce(0x15e)]||'','protocol':_0x13e0f2[_0x2d8fce(0x155)]||_0x2d8fce(0x149),'baseUrl':_0x13e0f2['modelBas'+_0x2d8fce(0x17b)]||_0x13e0f2[_0x2d8fce(0x15f)]||'','modelName':_0x13e0f2[_0x2d8fce(0x16a)+'e']})},_0x386fb4[_0x2d8fce(0x100)+'s']=_0x53bfd3,_0x4c2dc4[_0x2d8fce(0x103)]=_0x386fb4;const _0x338eae=asRecord(_0x4c2dc4['agents']),_0x2071e5=asRecord(_0x338eae[_0x2d8fce(0x186)]);return _0x2071e5[_0x2d8fce(0x188)]={...asRecord(_0x2071e5[_0x2d8fce(0x188)]),'primary':_0x273154},_0x2071e5[_0x2d8fce(0x103)]={...asRecord(_0x2071e5[_0x2d8fce(0x103)]),[_0x273154]:asRecord(asRecord(_0x2071e5['models'])[_0x273154])},_0x338eae['defaults']=_0x2071e5,_0x4c2dc4[_0x2d8fce(0x16c)]=_0x338eae,_0x4c2dc4[_0x2d8fce(0xfe)]={...asRecord(_0x4c2dc4[_0x2d8fce(0xfe)]),'dmScope':_0x2d8fce(0x154)+_0x2d8fce(0x184)},await _0x29c3cc(_0x4c2dc4,_0x5e4dba[_0x2d8fce(0x183)+'nChange']?'model\x20se'+'ttings\x20u'+'pdated':''),{'ok':!![]};}async function _0x83cc56(_0x399578){const _0x577bf6=_0x5859e5,_0x98149b=await _0x2eea59(),_0x2bb33d=_0x399578[_0x577bf6(0x100)+'Key'],_0x32513a=asRecord(_0x98149b['models']),_0x7beef=asRecord(_0x32513a[_0x577bf6(0x100)+'s']);_0x7beef[_0x2bb33d]={...asRecord(_0x7beef[_0x2bb33d]),'apiKey':_0x399578[_0x577bf6(0x15e)],'api':_0x577bf6(0x10d)+_0x577bf6(0x16f)+'ns','baseUrl':_0x399578[_0x577bf6(0x15f)],'models':(_0x399578['modelNam'+'es']??[])['map'](_0x53f021=>createProviderModelConfig(_0x53f021,_0x53f021===_0x399578[_0x577bf6(0x13a)+'elPrimar'+_0x577bf6(0x106)]))},_0x32513a[_0x577bf6(0x100)+'s']=_0x7beef,_0x98149b['models']=_0x32513a;if(_0x399578[_0x577bf6(0x13a)+_0x577bf6(0x107)+_0x577bf6(0x106)]){const _0x1ad9eb=asRecord(_0x98149b['agents']),_0x11fc29=asRecord(_0x1ad9eb[_0x577bf6(0x186)]);_0x11fc29[_0x577bf6(0x13a)+'el']={...asRecord(_0x11fc29['imageMod'+'el']),'primary':_0x2bb33d+'/'+_0x399578[_0x577bf6(0x13a)+'elPrimar'+_0x577bf6(0x106)]},_0x1ad9eb[_0x577bf6(0x186)]=_0x11fc29,_0x98149b[_0x577bf6(0x16c)]=_0x1ad9eb;}return await _0x29c3cc(_0x98149b,_0x577bf6(0x160)+_0x577bf6(0x152)+'dels\x20upd'+_0x577bf6(0x144)),{'ok':!![]};}async function _0xb370da({callbackUrl:_0x32f35b,secret:_0x35db08}){const _0xb7f5e5=_0x5859e5,_0x4cca42=await _0x2eea59(),_0x129a10=asRecord(_0x4cca42[_0xb7f5e5(0x17e)]),_0x159c54=asRecord(_0x129a10['entries']),_0x58df5c=asRecord(_0x159c54[ASK_USER_QUESTION_PLUGIN_ID]);return _0x159c54[ASK_USER_QUESTION_PLUGIN_ID]={..._0x58df5c,'enabled':!![],'config':{...asRecord(_0x58df5c[_0xb7f5e5(0x14c)]),'callbackUrl':_0x32f35b,'secret':_0x35db08}},_0x129a10[_0xb7f5e5(0x175)]=_0x159c54,_0x129a10[_0xb7f5e5(0x168)]=dedupeStrings([...(Array['isArray'](_0x129a10[_0xb7f5e5(0x168)])?_0x129a10[_0xb7f5e5(0x168)]:[])[_0xb7f5e5(0x118)](Boolean),ASK_USER_QUESTION_PLUGIN_ID]),_0x4cca42[_0xb7f5e5(0x17e)]=_0x129a10,await _0x29c3cc(_0x4cca42,''),{'ok':!![]};}async function _0x29c3cc(_0x1aa848,_0x418d0a=''){const _0x5c9185=_0x5859e5;_0x261716(),await _0x2ad1da(_0x1aa848,_0x418d0a||_0x5c9185(0x128)+_0x5c9185(0x125)+'persiste'+'d'),await writeJsonFile(_0x25626a['lastGood'+_0x5c9185(0x105)+'th'],_0x1aa848),_0x3f4277?.[_0x5c9185(0x167)](_0x5c9185(0x172)+_0x5c9185(0x17c)+_0x5c9185(0x115)+'g\x20writte'+'n',{'path':_0x25626a[_0x5c9185(0x176)+_0x5c9185(0x105)+'th'],'reason':_0x418d0a||_0x5c9185(0x128)+_0x5c9185(0x125)+_0x5c9185(0x11e)+'d'});if(_0x418d0a)_0x27bc2b(_0x418d0a);}function _0x261716(){if(_0x57d797)_0x48e6ed+=0x1;}function _0x5b2176(_0x726054){_0x216b4a=_0x726054;}function _0x27bc2b(_0x3e1d35){const _0x37ed03=_0x5859e5;if(!_0x216b4a)return;if(_0x4161e0)clearTimeout(_0x4161e0);_0x3f4277?.[_0x37ed03(0x167)]('gateway\x20'+_0x37ed03(0x101)+_0x37ed03(0xff)+_0x37ed03(0x159)+_0x37ed03(0x134)+'ge',{'reason':_0x3e1d35,'debounceMs':0xfa}),_0x4161e0=setTimeout(()=>_0x216b4a(_0x3e1d35),0xfa);}function _0x1dc08b(){const _0x4dc782=_0x5859e5;unwatchFile(_0x25626a[_0x4dc782(0x129)+'th']),_0x57d797=!![],watchFile(_0x25626a[_0x4dc782(0x129)+'th'],{'interval':0x3e8},(_0x31b968,_0x18abe0)=>{const _0x5ce3c2=_0x4dc782;if(_0x31b968[_0x5ce3c2(0x185)]===_0x18abe0['mtimeMs'])return;if(_0x48e6ed>0x0){_0x48e6ed-=0x1,_0x3f4277?.['info']('config\x20f'+_0x5ce3c2(0x12a)+_0x5ce3c2(0x123)+'red\x20inte'+_0x5ce3c2(0x108)+'te',{'configPath':_0x25626a['configPa'+'th'],'ignoredConfigWatchReloads':_0x48e6ed});return;}_0x3f4277?.[_0x5ce3c2(0x167)](_0x5ce3c2(0x136)+_0x5ce3c2(0x12a)+_0x5ce3c2(0x11a)+'rved\x20ext'+_0x5ce3c2(0x157)+'ange',{'configPath':_0x25626a[_0x5ce3c2(0x129)+'th']}),_0x27bc2b(_0x5ce3c2(0x153)+'hange');});}function _0x59d978(){const _0x34651c=_0x5859e5;if(_0x4161e0)clearTimeout(_0x4161e0);unwatchFile(_0x25626a[_0x34651c(0x129)+'th']),_0x57d797=![],_0x48e6ed=0x0;}return{'paths':_0x25626a,'resolveConfigPath':_0x258400,'resolveStateDir':_0x2ea794,'resolveDeviceIdentityPath':_0x391fa9,'ensureConfigPathEnv':_0x14ca9e,'ensureInitialConfig':_0x36b57a,'ensureGatewaySettings':_0x592570,'readConfig':_0x2eea59,'writeConfig':_0x2ad1da,'syncRuntimePlugins':_0x1d708a,'getModelSettings':_0x4a7f1a,'setModelSettings':_0x313d59,'setSelfOperatedModels':_0x83cc56,'ensureAskUserQuestionPluginConfig':_0xb370da,'markConfigWriteHandledInternally':_0x261716,'setGatewayRestartHandler':_0x5b2176,'watchConfigChanges':_0x1dc08b,'dispose':_0x59d978};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x108741=_0x961c;(function(_0x4f16bf,_0x3ac052){const _0x2fbe58=_0x961c,_0xced5d6=_0x4f16bf();while(!![]){try{const _0x20ed39=parseInt(_0x2fbe58(0x299))/0x1*(parseInt(_0x2fbe58(0x21b))/0x2)+-parseInt(_0x2fbe58(0x245))/0x3*(parseInt(_0x2fbe58(0x28d))/0x4)+-parseInt(_0x2fbe58(0x274))/0x5+parseInt(_0x2fbe58(0x283))/0x6*(parseInt(_0x2fbe58(0x1c7))/0x7)+-parseInt(_0x2fbe58(0x254))/0x8*(parseInt(_0x2fbe58(0x252))/0x9)+-parseInt(_0x2fbe58(0x1b0))/0xa+parseInt(_0x2fbe58(0x21e))/0xb;if(_0x20ed39===_0x3ac052)break;else _0xced5d6['push'](_0xced5d6['shift']());}catch(_0x52d223){_0xced5d6['push'](_0xced5d6['shift']());}}}(_0x1576,0x95599));import _0x41831d from'electron';function _0x961c(_0x59dec7,_0xc25447){_0x59dec7=_0x59dec7-0x182;const _0x15768d=_0x1576();let _0x961c88=_0x15768d[_0x59dec7];return _0x961c88;}import{fileURLToPath}from'node:url';import{dirname,join,resolve}from'node:path';function _0x1576(){const _0x40d780=['oggle-ma','ernal\x20ur','binary\x20f','n-direct','delete','byteLeng','configPa','cron:cre',':create','minimize','agents:l','content','\x20excepti','isMaximi','pinnedKe','send','ipc\x20requ','filePath','preventD','ll-close','l\x20reques','1921323kJPQEy','dow\x20load','window:m','window:c','filters','cron:run','logs:exp','pping\x20ga','context','teway','\x20failed:','\x20failed','setPinne','299556pNQTov','-restart','192NtrldX','dels','loadFile','runtimeI','cron','chrome','platform','irectory','path','agents-u','files:se','ximize','settings','ectory\x20o','workspac','wujie-sh','-questio','isArray','efault','hiddenIn','tory','pdated','config','trim','shared-c','appId','before\x20q','create','open\x20ext','limit','ndows','dRejecti','969200WdRiHf','dev','ontext','boot\x20ele','quit','-logs','ocess-go','ile\x20read','remove','whenRead',':answer-','length','openclaw','devtools','loadURL','254202qMpaVL','redConte','message','unregist','e:direct','set','openPath','chat:str','ent','odels','4TRhqfK','yInfo',':delete','utf8','est\x20fail','canceled','getVersi','elected-','ion','models:s','ile\x20writ','install','373tfcYXt','answerAs','-status','-info','ot\x20compl','\x20log','ell:even','est\x20comp','cron:log','finally','ned-keys','select\x20f','-once','file\x20rea','senderFr','d\x20comple','getRecen','stop','ocess\x20go','dataDir','electron','sessions','[wujie-s','info','object','rocess-g','map','logs','Exceptio','uit:\x20sto','dist','index.ht','projectR','ontents',':pinned-','config:r','ctron\x20ma','kUserQue','pened','then','et-self-','operated','meta','rename','ort','ove','est\x20star','oot','window:o','peratedM','agents','chat','cron:upd','logs:ope','logs:wri','preload.','restart','11788880AIMLMG','list','ory\x20open','uncaught','nstall','eam','ngs','\x20process','model-id','read','+Shift+I','skills','t:\x20','renderer','logsDir','productN','ools','nfo','ite-bina','zed','sharedCo','getAllWi','openExte','28GLmOMg','files:re','getURL','stion',':rename','darwin','updated','ctory','dKeys','logs\x20dir','session-','default','ettings','e:shared','nts','multiSel','status','render-p','main\x20win','file\x20wri','detach',':set-pin','inimize','ite','lose','ot\x20faile','select\x20d','versions','sender','gateway-','main','ory-info','close','\x20request','hell]\x20fa','ell\x20gate','prod','unhandle','uit','openDire','files','customMo','ory','targetDi','ead','ate','files:wr','level','app:info','title','e\x20direct','cwd','#f8fafc','setSelfO','fromWebC',':gateway','writeSha','eted','logs\x20exp','models','now','runOnce','agent-ev','ustom-mo','-context','ad-binar','string','CommandO','isDestro','Dialog','e:open-d','getFocus','director','paths','ask-user','ile\x20comp','ame','\x20complet','will-qui','iled\x20to\x20','error','ot\x20initi','setName','webConte','1046ZsRndT','ections','register','33650925XIWkaw','elete','maximize','-url','window:t','\x20main\x20wi','d\x20failed','ndow','ted','handle','one',':list','alized','getStatu','chat-str','app:open','creating','arch'];_0x1576=function(){return _0x40d780;};return _0x1576();}import{readFile,stat,writeFile}from'node:fs/promises';import{loadShellConfig}from'@wujie-shell/config';import{createConfigController}from'../config-controller.mjs';import{createGatewayController}from'../gateway-controller.mjs';import{createShellLogger,exportLogsArchive,summarizeError,summarizePayload,summarizeText,toHomePath}from'../logging.mjs';const __dirname=dirname(fileURLToPath(import.meta.url)),preloadPath=join(__dirname,_0x108741(0x1ae)+'mjs'),{app,BrowserWindow,dialog,globalShortcut,ipcMain,shell}=_0x41831d,DEVTOOLS_ACCELERATOR=_0x108741(0x20a)+'rControl'+_0x108741(0x1ba);let mainWindow=null,shellConfig=null,configController=null,gatewayController=null,bootError=null,mainLogger=null,ipcLogger=null,filesLogger=null,rendererLogger=null;function getMode(){const _0x32e366=_0x108741;return process.env.VITE_DEV_SERVER_URL?_0x32e366(0x275):_0x32e366(0x1eb);}function resolveProjectRoot(){const _0x3abb58=_0x108741;return resolve(process.env.WUJIE_SHELL_PROJECT_ROOT||process[_0x3abb58(0x1fa)]());}function broadcast(_0x4e039c,_0x56a066){const _0x2284ff=_0x108741;for(const _0x38f850 of BrowserWindow[_0x2284ff(0x1c5)+_0x2284ff(0x272)]()){!_0x38f850[_0x2284ff(0x21a)+'nts'][_0x2284ff(0x20b)+'yed']()&&_0x38f850[_0x2284ff(0x21a)+_0x2284ff(0x1d5)]['send']('wujie-sh'+_0x2284ff(0x29f)+'t',{'name':_0x4e039c,'payload':_0x56a066});}}function openDevToolsForActiveContext(){const _0x42d2a2=_0x108741,_0x393fde=BrowserWindow[_0x42d2a2(0x20e)+'edWindow']()||mainWindow;if(!_0x393fde||_0x393fde[_0x42d2a2(0x20b)+'yed']())return{'ok':![]};return _0x393fde['webConte'+'nts']['openDevT'+_0x42d2a2(0x1c0)]({'mode':_0x42d2a2(0x1db)}),_0x393fde[_0x42d2a2(0x21a)+_0x42d2a2(0x1d5)][_0x42d2a2(0x23f)](_0x42d2a2(0x263)+_0x42d2a2(0x29f)+'t',{'name':_0x42d2a2(0x281)+'-shortcu'+'t','payload':{'accelerator':DEVTOOLS_ACCELERATOR}}),{'ok':!![]};}function registerShellShortcuts(){const _0x208b92=_0x108741;globalShortcut[_0x208b92(0x286)+'er'](DEVTOOLS_ACCELERATOR);const _0x29ba42=globalShortcut['register'](DEVTOOLS_ACCELERATOR,openDevToolsForActiveContext);!_0x29ba42&&console['warn'](_0x208b92(0x18d)+_0x208b92(0x1e9)+_0x208b92(0x216)+_0x208b92(0x21d)+'\x20shortcu'+_0x208b92(0x1bc)+DEVTOOLS_ACCELERATOR);}async function createWindow(){const _0x55cfd3=_0x108741,_0x1d3071=process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x55cfd3(0x197)+_0x55cfd3(0x1a6)],_0x55cfd3(0x195),_0x55cfd3(0x196)+'ml');mainLogger?.[_0x55cfd3(0x18e)](_0x55cfd3(0x22e)+_0x55cfd3(0x223)+_0x55cfd3(0x225),{'rendererUrl':_0x1d3071,'mode':getMode()}),mainWindow=new BrowserWindow({'width':0x49c,'height':0x30c,'minWidth':0x384,'minHeight':0x26c,'title':shellConfig[_0x55cfd3(0x1bf)+_0x55cfd3(0x213)],'backgroundColor':_0x55cfd3(0x1fb),'titleBarStyle':process['platform']===_0x55cfd3(0x1cc)?_0x55cfd3(0x267)+_0x55cfd3(0x288):_0x55cfd3(0x1d2),'webPreferences':{'preload':preloadPath,'contextIsolation':!![],'nodeIntegration':![],'sandbox':![]}});const _0x1a3cff=process.env.VITE_DEV_SERVER_URL;_0x1a3cff?(await mainWindow[_0x55cfd3(0x282)](_0x1a3cff),process.env.WUJIE_SHELL_OPEN_DEVTOOLS==='1'&&mainWindow['webConte'+'nts']['openDevT'+_0x55cfd3(0x1c0)]({'mode':_0x55cfd3(0x1db)})):await mainWindow[_0x55cfd3(0x256)](join(shellConfig[_0x55cfd3(0x197)+_0x55cfd3(0x1a6)],_0x55cfd3(0x195),_0x55cfd3(0x196)+'ml')),mainLogger?.[_0x55cfd3(0x18e)](_0x55cfd3(0x1d9)+_0x55cfd3(0x246)+'ed',{'rendererUrl':_0x1d3071,'mode':getMode()});}function installIpcHandlers(){const _0x12a34a=_0x108741,_0x5a9d02=(_0xd0e251,_0x2c77d7)=>{const _0x2fa178=_0x961c;ipcMain[_0x2fa178(0x227)](_0xd0e251,async(_0x1ef6f4,_0x2a9b22)=>{const _0x49a1e8=_0x2fa178,_0x34be4d=Date['now'](),_0x1f3721=_0x1ef6f4[_0x49a1e8(0x185)+_0x49a1e8(0x213)]?.['url']||_0x1ef6f4[_0x49a1e8(0x1e3)][_0x49a1e8(0x1c9)]();ipcLogger?.[_0x49a1e8(0x18e)]('ipc\x20requ'+_0x49a1e8(0x1a5)+'ted',{'channel':_0xd0e251,'senderUrl':_0x1f3721,'payload':summarizePayload(_0x2a9b22)});try{const _0xa3cf4a=await _0x2c77d7(_0x1ef6f4,_0x2a9b22);return ipcLogger?.['info'](_0x49a1e8(0x240)+_0x49a1e8(0x2a0)+'leted',{'channel':_0xd0e251,'durationMs':Date['now']()-_0x34be4d,'result':summarizePayload(_0xa3cf4a,{'maxDepth':0x2})}),_0xa3cf4a;}catch(_0x517f38){ipcLogger?.[_0x49a1e8(0x217)](_0x49a1e8(0x240)+_0x49a1e8(0x291)+'ed',{'channel':_0xd0e251,'durationMs':Date['now']()-_0x34be4d,'error':summarizeError(_0x517f38)});throw _0x517f38;}});},_0x5ab2ec=()=>{const _0x5b6eb4=_0x961c;if(!gatewayController)throw new Error(bootError?_0x5b6eb4(0x263)+'ell\x20boot'+_0x5b6eb4(0x24f)+'\x20'+bootError:'wujie-sh'+_0x5b6eb4(0x1ea)+'way\x20is\x20n'+_0x5b6eb4(0x218)+_0x5b6eb4(0x22a));return gatewayController;};_0x5a9d02(_0x12a34a(0x1f7),async()=>({'name':shellConfig[_0x12a34a(0x1bf)+_0x12a34a(0x213)],'version':app[_0x12a34a(0x293)+'on'](),'appId':shellConfig[_0x12a34a(0x26d)],'dataDir':shellConfig[_0x12a34a(0x18a)]})),_0x5a9d02(_0x12a34a(0x22d)+_0x12a34a(0x221),async(_0x2c5969,_0x3791f5)=>{const _0x44ea64=_0x12a34a,_0x533978=typeof _0x3791f5==='string'?_0x3791f5:'';if(!_0x533978)return{'ok':![]};return filesLogger?.[_0x44ea64(0x18e)](_0x44ea64(0x270)+_0x44ea64(0x231)+_0x44ea64(0x244)+_0x44ea64(0x226),{'url':summarizeText(_0x533978,0xa0)}),await shell[_0x44ea64(0x1c6)+'rnal'](_0x533978),{'ok':!![]};}),_0x5a9d02(_0x12a34a(0x247)+_0x12a34a(0x1dd),_0x4b4bb1=>{const _0x458373=_0x12a34a;return BrowserWindow[_0x458373(0x1fd)+'ontents'](_0x4b4bb1[_0x458373(0x1e3)])?.[_0x458373(0x239)](),{'ok':!![]};}),_0x5a9d02(_0x12a34a(0x222)+_0x12a34a(0x230)+_0x12a34a(0x25f),_0x522f64=>{const _0x2a42c3=_0x12a34a,_0x298b49=BrowserWindow[_0x2a42c3(0x1fd)+_0x2a42c3(0x198)](_0x522f64[_0x2a42c3(0x1e3)]);if(!_0x298b49)return{'isMaximized':![]};if(_0x298b49[_0x2a42c3(0x23d)+_0x2a42c3(0x1c3)]())_0x298b49['unmaximi'+'ze']();else _0x298b49[_0x2a42c3(0x220)]();return{'isMaximized':_0x298b49['isMaximi'+_0x2a42c3(0x1c3)]()};}),_0x5a9d02(_0x12a34a(0x248)+_0x12a34a(0x1df),_0x4e11c6=>{const _0x39bc3a=_0x12a34a;return BrowserWindow[_0x39bc3a(0x1fd)+'ontents'](_0x4e11c6[_0x39bc3a(0x1e3)])?.[_0x39bc3a(0x1e7)](),{'ok':!![]};}),_0x5a9d02(_0x12a34a(0x1a7)+'pen-devt'+'ools',()=>openDevToolsForActiveContext()),_0x5a9d02(_0x12a34a(0x280)+':runtime'+_0x12a34a(0x29c),()=>_0x5ab2ec()[_0x12a34a(0x257)+_0x12a34a(0x1c1)]()),_0x5a9d02(_0x12a34a(0x280)+_0x12a34a(0x1fe)+_0x12a34a(0x29b),()=>_0x5ab2ec()[_0x12a34a(0x22b)+'s']()),_0x5a9d02(_0x12a34a(0x280)+_0x12a34a(0x1fe)+_0x12a34a(0x253),()=>_0x5ab2ec()[_0x12a34a(0x1af)]('renderer'+_0x12a34a(0x1e8))),_0x5a9d02(_0x12a34a(0x280)+':gateway'+_0x12a34a(0x279),(_0x18dd3d,_0x359ae4={})=>_0x5ab2ec()[_0x12a34a(0x187)+'tLogs'](_0x359ae4?.[_0x12a34a(0x271)]??0xc8)),_0x5a9d02(_0x12a34a(0x280)+_0x12a34a(0x27e)+_0x12a34a(0x211)+_0x12a34a(0x264)+'n',(_0x35684e,_0x3f7791)=>_0x5ab2ec()[_0x12a34a(0x29a)+_0x12a34a(0x19c)+_0x12a34a(0x1ca)](_0x3f7791)),_0x5a9d02(_0x12a34a(0x23a)+'ist',()=>_0x5ab2ec()[_0x12a34a(0x1a9)][_0x12a34a(0x1b1)]()),_0x5a9d02('skills:s'+'tatus',(_0x3223c1,_0x330df2)=>_0x5ab2ec()[_0x12a34a(0x1bb)][_0x12a34a(0x1d7)](_0x330df2)),_0x5a9d02(_0x12a34a(0x18c)+_0x12a34a(0x238),(_0x5d7105,_0x1ed9b0)=>_0x5ab2ec()['sessions'][_0x12a34a(0x26f)](_0x1ed9b0)),_0x5a9d02(_0x12a34a(0x18c)+_0x12a34a(0x229),(_0x304492,_0x50227a)=>_0x5ab2ec()[_0x12a34a(0x18c)][_0x12a34a(0x1b1)](_0x50227a)),_0x5a9d02(_0x12a34a(0x18c)+_0x12a34a(0x28f),(_0xebc955,_0x3cf9bb)=>_0x5ab2ec()['sessions']['delete'](_0x3cf9bb)),_0x5a9d02(_0x12a34a(0x28a)+_0x12a34a(0x1b5),(_0x4e0834,_0x39e5c6)=>_0x5ab2ec()['chat']['stream'](_0x39e5c6)),_0x5a9d02('chat:abo'+'rt',(_0x16ab32,_0x473cb1)=>_0x5ab2ec()[_0x12a34a(0x1aa)]['abort'](_0x473cb1)),_0x5a9d02('chat:his'+_0x12a34a(0x268),(_0x482015,_0x5b87dc)=>_0x5ab2ec()[_0x12a34a(0x1aa)]['history'](_0x5b87dc)),_0x5a9d02(_0x12a34a(0x1ad)+'te',async(_0x3935e1,_0x240661={})=>{const _0x87e296=_0x12a34a,_0x45a8b0=typeof _0x240661[_0x87e296(0x1f6)]===_0x87e296(0x209)?_0x240661['level']:_0x87e296(0x18e),_0x4f33da=typeof _0x240661[_0x87e296(0x285)]===_0x87e296(0x209)?_0x240661['message']:_0x87e296(0x1bd)+_0x87e296(0x29e),_0x1e62f8=typeof _0x240661[_0x87e296(0x24d)]===_0x87e296(0x209)&&_0x240661[_0x87e296(0x24d)][_0x87e296(0x26b)]()?_0x87e296(0x1bd)+':'+_0x240661[_0x87e296(0x24d)][_0x87e296(0x26b)]():_0x87e296(0x1bd),_0x1972b1=_0x240661[_0x87e296(0x1a1)]&&typeof _0x240661['meta']===_0x87e296(0x18f)?summarizePayload(_0x240661[_0x87e296(0x1a1)]):undefined,_0x355619=rendererLogger;if(_0x355619?.[_0x45a8b0])await _0x355619[_0x45a8b0](_0x4f33da,_0x1972b1);else await _0x355619?.[_0x87e296(0x18e)](_0x4f33da,_0x1972b1);return{'ok':!![]};}),_0x5a9d02(_0x12a34a(0x24b)+_0x12a34a(0x1a3),async(_0x53068b,_0x2b89fa={})=>{const _0x2314fa=_0x12a34a,_0x51c15a=typeof _0x2b89fa[_0x2314fa(0x1f2)+'r']===_0x2314fa(0x209)&&_0x2b89fa[_0x2314fa(0x1f2)+'r'][_0x2314fa(0x26b)]()?_0x2b89fa[_0x2314fa(0x1f2)+'r']:undefined,_0x529c03=await exportLogsArchive({'logsDir':configController[_0x2314fa(0x210)][_0x2314fa(0x1be)],'targetDir':_0x51c15a,'appVersion':app['getVersi'+'on']()});return mainLogger?.[_0x2314fa(0x18e)](_0x2314fa(0x201)+'orted',{'path':toHomePath(_0x529c03[_0x2314fa(0x25c)])}),_0x529c03;}),_0x5a9d02(_0x12a34a(0x1ac)+_0x12a34a(0x233)+_0x12a34a(0x1f1),async()=>{const _0x3abc81=_0x12a34a;return await shell[_0x3abc81(0x289)](configController[_0x3abc81(0x210)]['logsDir']),mainLogger?.['info'](_0x3abc81(0x1d0)+_0x3abc81(0x261)+_0x3abc81(0x19d),{'logsDir':toHomePath(configController[_0x3abc81(0x210)][_0x3abc81(0x1be)])}),{'ok':!![],'path':configController[_0x3abc81(0x210)][_0x3abc81(0x1be)]};}),_0x5a9d02(_0x12a34a(0x1c8)+'ad',async(_0x2e611a,_0x1a748d)=>{const _0xabf51a=_0x12a34a,_0x3c1e98=Date[_0xabf51a(0x203)]();try{const _0x8a6430=await readFile(_0x1a748d,'utf8');return filesLogger?.[_0xabf51a(0x18e)]('file\x20rea'+_0xabf51a(0x186)+_0xabf51a(0x226),{'path':toHomePath(_0x1a748d),'bytes':Buffer[_0xabf51a(0x235)+'th'](_0x8a6430),'durationMs':Date[_0xabf51a(0x203)]()-_0x3c1e98}),_0x8a6430;}catch(_0xffb926){filesLogger?.[_0xabf51a(0x217)](_0xabf51a(0x184)+_0xabf51a(0x224),{'path':toHomePath(_0x1a748d),'durationMs':Date[_0xabf51a(0x203)]()-_0x3c1e98,'error':summarizeError(_0xffb926)});throw _0xffb926;}}),_0x5a9d02(_0x12a34a(0x1c8)+_0x12a34a(0x208)+'y',async(_0x39d2af,_0xde4a43)=>{const _0x44e4e5=_0x12a34a,_0x59c483=Date['now']();try{const _0x5d3d74=await readFile(_0xde4a43);return filesLogger?.['info'](_0x44e4e5(0x232)+'ile\x20read'+_0x44e4e5(0x214)+'ed',{'path':toHomePath(_0xde4a43),'bytes':_0x5d3d74[_0x44e4e5(0x235)+'th'],'durationMs':Date[_0x44e4e5(0x203)]()-_0x59c483}),new Uint8Array(_0x5d3d74);}catch(_0x12523c){filesLogger?.[_0x44e4e5(0x217)](_0x44e4e5(0x232)+_0x44e4e5(0x27b)+_0x44e4e5(0x250),{'path':toHomePath(_0xde4a43),'durationMs':Date[_0x44e4e5(0x203)]()-_0x59c483,'error':summarizeError(_0x12523c)});throw _0x12523c;}}),_0x5a9d02('files:wr'+_0x12a34a(0x1de),async(_0x4558a1,_0x585bbd={})=>{const _0x186f55=_0x12a34a,_0x1b2f54=Date[_0x186f55(0x203)]();return await writeFile(_0x585bbd[_0x186f55(0x25c)],_0x585bbd[_0x186f55(0x23b)]??'',_0x186f55(0x290)),filesLogger?.['info'](_0x186f55(0x1da)+'te\x20compl'+'eted',{'path':toHomePath(_0x585bbd[_0x186f55(0x25c)]),'bytes':Buffer[_0x186f55(0x235)+'th'](String(_0x585bbd[_0x186f55(0x23b)]??'')),'durationMs':Date['now']()-_0x1b2f54}),{'ok':!![]};}),_0x5a9d02(_0x12a34a(0x1f5)+_0x12a34a(0x1c2)+'ry',async(_0x48c1f7,_0x3a8c4d={})=>{const _0x179bff=_0x12a34a,_0x20ad89=Date[_0x179bff(0x203)]();await writeFile(_0x3a8c4d[_0x179bff(0x25c)],Buffer['from'](_0x3a8c4d[_0x179bff(0x23b)]??[]));const _0x15dbc7=await stat(_0x3a8c4d['path'])['catch'](()=>null);return filesLogger?.['info'](_0x179bff(0x232)+_0x179bff(0x297)+'e\x20comple'+'ted',{'path':toHomePath(_0x3a8c4d[_0x179bff(0x25c)]),'bytes':_0x15dbc7?.['size']??0x0,'durationMs':Date['now']()-_0x20ad89}),{'ok':!![]};}),_0x5a9d02('files:se'+'lect-fil'+'e',async(_0x49f3da,_0x13af42={})=>{const _0x2f5ef3=_0x12a34a,_0xd89af2=await dialog['showOpen'+_0x2f5ef3(0x20c)](BrowserWindow['fromWebC'+_0x2f5ef3(0x198)](_0x49f3da[_0x2f5ef3(0x1e3)])??mainWindow,{'title':typeof _0x13af42[_0x2f5ef3(0x1f8)]===_0x2f5ef3(0x209)?_0x13af42[_0x2f5ef3(0x1f8)]:undefined,'properties':['openFile',..._0x13af42[_0x2f5ef3(0x1d6)+'ections']?['multiSel'+_0x2f5ef3(0x21c)]:[]],'filters':Array[_0x2f5ef3(0x265)](_0x13af42[_0x2f5ef3(0x249)])?_0x13af42['filters']:undefined});return filesLogger?.[_0x2f5ef3(0x18e)](_0x2f5ef3(0x182)+_0x2f5ef3(0x212)+'leted',{'canceled':_0xd89af2[_0x2f5ef3(0x292)],'count':_0xd89af2['filePath'+'s'][_0x2f5ef3(0x27f)],'paths':_0xd89af2[_0x2f5ef3(0x241)+'s']['map'](toHomePath)}),{'canceled':_0xd89af2[_0x2f5ef3(0x292)],'paths':_0xd89af2[_0x2f5ef3(0x241)+'s']};}),_0x5a9d02(_0x12a34a(0x25e)+'lect-dir'+'ectory',async(_0x32586f,_0x17a549={})=>{const _0x36b5ae=_0x12a34a,_0x1d140b=await dialog['showOpen'+_0x36b5ae(0x20c)](BrowserWindow['fromWebC'+_0x36b5ae(0x198)](_0x32586f['sender'])??mainWindow,{'title':typeof _0x17a549[_0x36b5ae(0x1f8)]===_0x36b5ae(0x209)?_0x17a549[_0x36b5ae(0x1f8)]:undefined,'properties':[_0x36b5ae(0x1ee)+_0x36b5ae(0x1ce)]});return filesLogger?.['info'](_0x36b5ae(0x1e1)+_0x36b5ae(0x25b)+_0x36b5ae(0x214)+'ed',{'canceled':_0x1d140b['canceled'],'count':_0x1d140b[_0x36b5ae(0x241)+'s'][_0x36b5ae(0x27f)],'paths':_0x1d140b[_0x36b5ae(0x241)+'s'][_0x36b5ae(0x191)](toHomePath)}),{'canceled':_0x1d140b[_0x36b5ae(0x292)],'paths':_0x1d140b[_0x36b5ae(0x241)+'s']};}),_0x5a9d02(_0x12a34a(0x262)+_0x12a34a(0x287)+_0x12a34a(0x1e6),()=>_0x5ab2ec()[_0x12a34a(0x262)+'e'][_0x12a34a(0x20f)+_0x12a34a(0x28e)]()),_0x5a9d02(_0x12a34a(0x262)+_0x12a34a(0x20d)+_0x12a34a(0x25b),async()=>{const _0x4cea9b=_0x12a34a,_0x532298=await _0x5ab2ec()[_0x4cea9b(0x262)+'e'][_0x4cea9b(0x20f)+_0x4cea9b(0x28e)]();return await shell[_0x4cea9b(0x289)](_0x532298['path']),filesLogger?.['info'](_0x4cea9b(0x262)+_0x4cea9b(0x1f9)+_0x4cea9b(0x1b2)+'ed',{'path':toHomePath(_0x532298[_0x4cea9b(0x25c)])}),{'ok':!![],'path':_0x532298['path']};}),_0x5a9d02(_0x12a34a(0x262)+_0x12a34a(0x1d4)+_0x12a34a(0x207),()=>_0x5ab2ec()[_0x12a34a(0x262)+'e'][_0x12a34a(0x1c4)+'ntext']()),_0x5a9d02(_0x12a34a(0x262)+'e:write-'+_0x12a34a(0x26c)+_0x12a34a(0x276),(_0x59e836,_0x510883)=>_0x5ab2ec()[_0x12a34a(0x262)+'e'][_0x12a34a(0x1ff)+_0x12a34a(0x284)+'xt'](_0x510883)),_0x5a9d02('sessions'+_0x12a34a(0x1cb),(_0x1d7bef,_0x455365)=>_0x5ab2ec()[_0x12a34a(0x18c)][_0x12a34a(0x1a2)](_0x455365)),_0x5a9d02(_0x12a34a(0x18c)+_0x12a34a(0x199)+'keys',()=>_0x5ab2ec()['sessions'][_0x12a34a(0x23e)+'ys']()),_0x5a9d02(_0x12a34a(0x18c)+_0x12a34a(0x1dc)+_0x12a34a(0x2a3),(_0x55d178,_0x5e39bd)=>_0x5ab2ec()['sessions'][_0x12a34a(0x251)+_0x12a34a(0x1cf)](_0x5e39bd)),_0x5a9d02('skills:i'+_0x12a34a(0x1b4),(_0x19f279,_0x50c662)=>_0x5ab2ec()[_0x12a34a(0x1bb)][_0x12a34a(0x298)](_0x50c662)),_0x5a9d02('skills:u'+'pdate',(_0x51444a,_0x3b8948)=>_0x5ab2ec()[_0x12a34a(0x1bb)]['update'](_0x3b8948)),_0x5a9d02('skills:d'+_0x12a34a(0x21f),(_0x155aa2,_0x5f2071)=>_0x5ab2ec()['skills'][_0x12a34a(0x234)](_0x5f2071)),_0x5a9d02('cron:lis'+'t',(_0x42bd3d,_0x43e92d)=>_0x5ab2ec()[_0x12a34a(0x258)]['list'](_0x43e92d)),_0x5a9d02(_0x12a34a(0x237)+_0x12a34a(0x1f4),(_0x4c99e2,_0x350d16)=>_0x5ab2ec()['cron'][_0x12a34a(0x26f)](_0x350d16)),_0x5a9d02(_0x12a34a(0x1ab)+_0x12a34a(0x1f4),(_0x4880a0,_0x1687e2)=>_0x5ab2ec()[_0x12a34a(0x258)]['update'](_0x1687e2)),_0x5a9d02('cron:rem'+_0x12a34a(0x1a4),(_0xbb919f,_0xd47553)=>_0x5ab2ec()['cron'][_0x12a34a(0x27c)](_0xd47553)),_0x5a9d02(_0x12a34a(0x24a)+_0x12a34a(0x183),(_0x56fca4,_0x2f2907)=>_0x5ab2ec()[_0x12a34a(0x258)][_0x12a34a(0x204)](_0x2f2907)),_0x5a9d02(_0x12a34a(0x2a1)+'s',(_0x1c9b25,_0x3e21c3)=>_0x5ab2ec()[_0x12a34a(0x258)][_0x12a34a(0x192)](_0x3e21c3)),_0x5a9d02(_0x12a34a(0x296)+_0x12a34a(0x1d3),()=>_0x5ab2ec()[_0x12a34a(0x202)][_0x12a34a(0x260)]()),_0x5a9d02(_0x12a34a(0x296)+'et-setti'+_0x12a34a(0x1b6),(_0x540917,_0x453d88)=>_0x5ab2ec()[_0x12a34a(0x202)]['setSetti'+_0x12a34a(0x1b6)](_0x453d88)),_0x5a9d02(_0x12a34a(0x296)+_0x12a34a(0x19f)+_0x12a34a(0x1a0),(_0x2abc6f,_0x29db7c)=>_0x5ab2ec()['models'][_0x12a34a(0x1fc)+_0x12a34a(0x1a8)+_0x12a34a(0x28c)](_0x29db7c)),_0x5a9d02(_0x12a34a(0x296)+_0x12a34a(0x294)+_0x12a34a(0x1b8),()=>_0x5ab2ec()[_0x12a34a(0x202)]['selected'+'ModelId']()),_0x5a9d02('models:c'+_0x12a34a(0x206)+_0x12a34a(0x255),()=>_0x5ab2ec()[_0x12a34a(0x202)][_0x12a34a(0x1f0)+_0x12a34a(0x255)]()),_0x5a9d02(_0x12a34a(0x19a)+_0x12a34a(0x1f3),()=>_0x5ab2ec()[_0x12a34a(0x26a)][_0x12a34a(0x1b9)]());}async function boot(){const _0x409ea8=_0x108741;shellConfig=await loadShellConfig(resolveProjectRoot()),app[_0x409ea8(0x219)](shellConfig['productN'+'ame']),configController=createConfigController(shellConfig),mainLogger=createShellLogger(configController['paths'],_0x409ea8(0x1e5)),ipcLogger=createShellLogger(configController[_0x409ea8(0x210)],'ipc'),filesLogger=createShellLogger(configController[_0x409ea8(0x210)],_0x409ea8(0x1ef)),rendererLogger=createShellLogger(configController[_0x409ea8(0x210)],_0x409ea8(0x1bd)),registerProcessLogHooks(),mainLogger?.[_0x409ea8(0x18e)](_0x409ea8(0x18b)+'\x20main\x20bo'+'ot\x20start'+'ed',{'appVersion':app[_0x409ea8(0x293)+'on'](),'electronVersion':process[_0x409ea8(0x1e2)]['electron'],'nodeVersion':process[_0x409ea8(0x1e2)]['node'],'chromeVersion':process[_0x409ea8(0x1e2)][_0x409ea8(0x259)],'platform':process[_0x409ea8(0x25a)],'arch':process[_0x409ea8(0x22f)],'mode':getMode(),'projectRoot':shellConfig[_0x409ea8(0x197)+_0x409ea8(0x1a6)],'configPath':shellConfig[_0x409ea8(0x236)+'th'],'dataDir':shellConfig[_0x409ea8(0x18a)],'logsDir':configController[_0x409ea8(0x210)][_0x409ea8(0x1be)],'rendererUrl':process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x409ea8(0x197)+_0x409ea8(0x1a6)],'dist','index.ht'+'ml')}),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x409ea8(0x293)+'on']()});for(const _0x3c12de of[_0x409ea8(0x1e4)+_0x409ea8(0x1d7),'gateway-'+'log',_0x409ea8(0x22c)+'eam-even'+'t',_0x409ea8(0x1d1)+_0x409ea8(0x1cd),_0x409ea8(0x205)+_0x409ea8(0x28b),_0x409ea8(0x25d)+_0x409ea8(0x269),_0x409ea8(0x211)+_0x409ea8(0x264)+'n']){gatewayController['on'](_0x3c12de,_0x3ee209=>broadcast(_0x3c12de,_0x3ee209));}installIpcHandlers(),registerShellShortcuts(),await createWindow(),await gatewayController['start'](),mainLogger?.[_0x409ea8(0x18e)](_0x409ea8(0x18b)+'\x20main\x20bo'+_0x409ea8(0x29d)+_0x409ea8(0x200));}function registerProcessLogHooks(){const _0x451f67=_0x108741;if(registerProcessLogHooks[_0x451f67(0x21d)+'ed'])return;registerProcessLogHooks['register'+'ed']=!![],process['on'](_0x451f67(0x1b3)+_0x451f67(0x193)+'n',_0x2bb909=>{const _0x26d44e=_0x451f67;mainLogger?.['error'](_0x26d44e(0x1b3)+_0x26d44e(0x23c)+'on',summarizeError(_0x2bb909));}),process['on']('unhandle'+_0x451f67(0x273)+'on',_0x31d0cc=>{const _0x48ce78=_0x451f67;mainLogger?.[_0x48ce78(0x217)](_0x48ce78(0x1ec)+'d\x20reject'+_0x48ce78(0x295),summarizeError(_0x31d0cc));}),app['on'](_0x451f67(0x1d8)+_0x451f67(0x190)+_0x451f67(0x228),(_0x1de4dd,_0x427e18,_0x52e342)=>{const _0x160879=_0x451f67;mainLogger?.[_0x160879(0x217)](_0x160879(0x1bd)+_0x160879(0x1b7)+'\x20gone',{'url':_0x427e18[_0x160879(0x1c9)](),'details':_0x52e342});}),app['on']('child-pr'+_0x451f67(0x27a)+'ne',(_0x4606e7,_0x50664b)=>{const _0x380e55=_0x451f67;mainLogger?.['error']('child\x20pr'+_0x380e55(0x189)+'ne',{'details':_0x50664b});});}app['on']('window-a'+_0x108741(0x243)+'d',()=>{const _0x2f7b6b=_0x108741;if(process['platform']!==_0x2f7b6b(0x1cc))app[_0x2f7b6b(0x278)]();}),app['on']('activate',async()=>{const _0x40a3b1=_0x108741;BrowserWindow['getAllWi'+_0x40a3b1(0x272)]()['length']===0x0&&shellConfig&&await createWindow();}),app['on']('before-q'+_0x108741(0x1ed),_0x50e554=>{const _0x2592f3=_0x108741;if(!gatewayController)return;mainLogger?.[_0x2592f3(0x18e)](_0x2592f3(0x26e)+_0x2592f3(0x194)+_0x2592f3(0x24c)+_0x2592f3(0x24e)),_0x50e554[_0x2592f3(0x242)+_0x2592f3(0x266)](),void gatewayController[_0x2592f3(0x188)]()[_0x2592f3(0x2a2)](()=>{const _0x2d160c=_0x2592f3;gatewayController=null,mainLogger?.[_0x2d160c(0x18e)]('gateway\x20'+'stopped\x20'+_0x2d160c(0x26e)+'uit'),app[_0x2d160c(0x278)]();});}),app['on'](_0x108741(0x215)+'t',()=>{globalShortcut['unregist'+'er'](DEVTOOLS_ACCELERATOR);}),app[_0x108741(0x27d)+'y']()[_0x108741(0x19e)](boot)['catch'](_0xc75386=>{const _0x1ef875=_0x108741;bootError=_0xc75386 instanceof Error?_0xc75386[_0x1ef875(0x285)]:String(_0xc75386),mainLogger?.[_0x1ef875(0x217)](_0x1ef875(0x18b)+'\x20main\x20bo'+_0x1ef875(0x1e0)+'d',summarizeError(_0xc75386)),console['error'](_0x1ef875(0x18d)+_0x1ef875(0x1e9)+_0x1ef875(0x216)+_0x1ef875(0x277)+_0x1ef875(0x19b)+'in',_0xc75386);});
|
|
1
|
+
function _0x2133(_0x195fd9,_0x20eaf5){_0x195fd9=_0x195fd9-0x13a;const _0xc0accc=_0xc0ac();let _0x2133cc=_0xc0accc[_0x195fd9];return _0x2133cc;}const _0x1c0281=_0x2133;(function(_0x1562c6,_0x53105b){const _0x87a164=_0x2133,_0x1b6a54=_0x1562c6();while(!![]){try{const _0x3b4d4d=parseInt(_0x87a164(0x1d1))/0x1+-parseInt(_0x87a164(0x239))/0x2*(parseInt(_0x87a164(0x1ce))/0x3)+parseInt(_0x87a164(0x1ad))/0x4+-parseInt(_0x87a164(0x1fb))/0x5+parseInt(_0x87a164(0x16f))/0x6+parseInt(_0x87a164(0x1f1))/0x7*(parseInt(_0x87a164(0x171))/0x8)+-parseInt(_0x87a164(0x274))/0x9;if(_0x3b4d4d===_0x53105b)break;else _0x1b6a54['push'](_0x1b6a54['shift']());}catch(_0x44b027){_0x1b6a54['push'](_0x1b6a54['shift']());}}}(_0xc0ac,0x8853f));function _0xc0ac(){const _0x1af44c=['ame','rControl','models','est\x20star','slice','e:open-d','eam','508gMfOeo','detach','json','mpletion','cron:lis',':pinned-','e:write-','customMo','-status','openFile','writeSha','preload.','e\x20comple','ngs','cron:log','xOf','est\x20comp','agents-u','files:wr','skills:d','window-a','lt\x20model','level','extensio','unregist','command','\x20excepti','agents:l','models:c','gateway-','timeout','\x20failed','wujie-sh','agents','main\x20win','setSetti','filter','limit',':gateway','oot','register','versions','wujiecla','activate','openDevT','isDirect','isIntege','ist','ettings','targetDi','error','ot\x20start','ontents','apiKey','file\x20rea','renderer','skills:i','uit','headers','284634AUwVzt','one','elected-','Exceptio','e\x20direct','api.open','skills','senderFr','name','minimize','recursiv','reasonin','logs','ll-close','irectory','skills:u','replace','rename','toLowerC','onfigPat','finally',':runtime','ipc','ot\x20initi','status','ory','ntext','history','logsDir','trim','hiddenIn','install','file\x20wri','utf8','\x20main\x20bo','cwd','setSelfO','dist','showOpen','path','+Shift+I','cron:upd','tp\x20','way\x20is\x20n','ai.com/v','-logs','h\x0aexec\x20\x22','Terminal','ell\x20boot','filePath','ion','map','multiSel','getURL','ectory','open\x20ext','create','primary','platform','paths','inimize','n-direct','ell\x20gate','chat','title','url','baseUrl','isDestro','ile\x20read','lose','edWindow','info','iled\x20to\x20','electron','model-id','setName','logs\x20dir','messages','chat:abo','ned-keys','update','dRejecti','ndows','hell]\x20fa','productN','quit','\x20not\x20con','ections','ustom-mo','model\x20ht','l\x20first','stringif','lastInde','tatus','ctron\x20ma','delete','4407810IQiyIK','whenRead','8myGPDr','ile\x20writ',':answer-','model','set','red;\x20set','figured:','pping\x20ga','maxEntri','getAllWi','alized','bin','ell:even','read','elete','dev','redConte','leted','projectR','ools','darwin','getRecen','timeoutM','remove','getStatu','director','odels','parse','list','ocess-go','temp','ocess\x20go','dels','uit:\x20sto','length','loadURL','files:li','https://','meta','config','yInfo','pened','provider','e:direct','fromWebC','abort','[wujie-s','runOnce','prod','tory','indexOf','ot\x20faile','temperat','logs\x20exp','filters','now','then','openclaw','ted','context','1298884fuYzky','shared-c','teway','ipc\x20requ','keys','eam-even','\x20found:\x20','\x20process','dataDir','configPa','preventD','lect-dir','ite-bina','et-setti','l\x20prepar','config:r','-info',':list','nts','t:\x20','jie-shel','isFile','ModelId','ernal\x20ur','openPath','yed','files:re','files:se','startsWi','d\x20comple','ead','appId','-questio','10482iiCWSF','chat:his','stream','122756OOrMhv','ectory\x20o','defaults','workspac','window:o','ontext','ure','stopped\x20','gateway\x20','creating','binary\x20f','maxToken','isArray','isMaximi','index.ht','openExte','\x20failed:','arch',':create','oggle-ma','canceled','rnal','nstall','stion','Bearer\x20','unhandle','resolveC','\x20main\x20wi','models:s','ximize','pdate','dow\x20load','7570402gKfWqp','ask-user','rocess-g','message','l\x20reques','object','log','\x20a\x20provi','#!/bin/s','send','3930485AixbDC','open','#f8fafc','-url','ate','choices','webConte','number','d\x20failed','getFocus','efault','window:t','eted','settings','getVersi','getPath','string','handle','openDire','Dialog','kUserQue','close','unmaximi','select\x20f','i-window','before-q','logs:wri','session-','e\x20first.','ot\x20compl','\x20CLI\x20wra','ort','\x20complet','ell-cli.','zed','/chat/co','ent','maximize','ndow','operated','ion/json','setPinne','cron','byteLeng','et-self-',':open-cl','mjs','main','boot\x20ele','nfo','sessions','content','updated','uncaught','chat:str'];_0xc0ac=function(){return _0x1af44c;};return _0xc0ac();}import _0x1f5be4 from'electron';import{fileURLToPath}from'node:url';import{dirname,join,resolve}from'node:path';import{existsSync}from'node:fs';import{readFile,readdir,stat,writeFile}from'node:fs/promises';import{spawn}from'node:child_process';import{loadShellConfig}from'@wujie-shell/config';import{createConfigController}from'../config-controller.mjs';import{createGatewayController}from'../gateway-controller.mjs';import{createShellLogger,exportLogsArchive,summarizeError,summarizePayload,summarizeText,toHomePath}from'../logging.mjs';import{resolveRuntimeRoot}from'../runtime.mjs';const __dirname=dirname(fileURLToPath(import.meta.url)),preloadPath=join(__dirname,_0x1c0281(0x244)+_0x1c0281(0x229)),{app,BrowserWindow,dialog,globalShortcut,ipcMain,shell}=_0x1f5be4,DEVTOOLS_ACCELERATOR='CommandO'+_0x1c0281(0x233)+_0x1c0281(0x29c);let mainWindow=null,shellConfig=null,configController=null,gatewayController=null,bootError=null,mainLogger=null,ipcLogger=null,filesLogger=null,rendererLogger=null;function getMode(){const _0x21f96e=_0x1c0281;return process.env.VITE_DEV_SERVER_URL?_0x21f96e(0x180):_0x21f96e(0x1a1);}function resolveProjectRoot(){const _0x53ec03=_0x1c0281;return resolve(process.env.WUJIE_SHELL_PROJECT_ROOT||process[_0x53ec03(0x297)]());}function broadcast(_0x87792,_0x27c696){const _0x310098=_0x1c0281;for(const _0x14c444 of BrowserWindow[_0x310098(0x17a)+_0x310098(0x161)]()){!_0x14c444['webConte'+_0x310098(0x1bf)][_0x310098(0x152)+_0x310098(0x1c6)]()&&_0x14c444[_0x310098(0x201)+'nts']['send'](_0x310098(0x259)+_0x310098(0x17d)+'t',{'name':_0x87792,'payload':_0x27c696});}}function openDevToolsForActiveContext(){const _0x56db0e=_0x1c0281,_0x28caf5=BrowserWindow[_0x56db0e(0x204)+_0x56db0e(0x155)]()||mainWindow;if(!_0x28caf5||_0x28caf5[_0x56db0e(0x152)+_0x56db0e(0x1c6)]())return{'ok':![]};return _0x28caf5[_0x56db0e(0x201)+'nts']['openDevT'+'ools']({'mode':'detach'}),_0x28caf5[_0x56db0e(0x201)+_0x56db0e(0x1bf)][_0x56db0e(0x1fa)](_0x56db0e(0x259)+_0x56db0e(0x17d)+'t',{'name':'devtools'+'-shortcu'+'t','payload':{'accelerator':DEVTOOLS_ACCELERATOR}}),{'ok':!![]};}function registerShellShortcuts(){const _0x348378=_0x1c0281;globalShortcut[_0x348378(0x251)+'er'](DEVTOOLS_ACCELERATOR);const _0x11b945=globalShortcut[_0x348378(0x261)](DEVTOOLS_ACCELERATOR,openDevToolsForActiveContext);!_0x11b945&&console['warn']('[wujie-s'+_0x348378(0x162)+'iled\x20to\x20'+_0x348378(0x261)+'\x20shortcu'+_0x348378(0x1c0)+DEVTOOLS_ACCELERATOR);}async function createWindow(){const _0x1a68df=_0x1c0281,_0x80e007=process.env.VITE_DEV_SERVER_URL||join(shellConfig['projectR'+_0x1a68df(0x260)],_0x1a68df(0x299),_0x1a68df(0x1df)+'ml'),_0x412fa5=process[_0x1a68df(0x149)]==='darwin';mainLogger?.['info'](_0x1a68df(0x1da)+_0x1a68df(0x1ec)+_0x1a68df(0x221),{'rendererUrl':_0x80e007,'mode':getMode()}),mainWindow=new BrowserWindow({'width':0x49c,'height':0x30c,'minWidth':0x384,'minHeight':0x26c,'title':shellConfig[_0x1a68df(0x163)+'ame'],'backgroundColor':_0x412fa5?'#0000000'+'0':_0x1a68df(0x1fd),'titleBarStyle':_0x412fa5?_0x1a68df(0x292)+_0x1a68df(0x175):'default',..._0x412fa5?{'trafficLightPosition':{'x':0x12,'y':0x16}}:{},..._0x412fa5?{'vibrancy':'sidebar'}:{},'webPreferences':{'preload':preloadPath,'contextIsolation':!![],'nodeIntegration':![],'sandbox':![]}});const _0x50ac32=process.env.VITE_DEV_SERVER_URL;_0x50ac32?(await mainWindow[_0x1a68df(0x194)](_0x50ac32),process.env.WUJIE_SHELL_OPEN_DEVTOOLS==='1'&&mainWindow[_0x1a68df(0x201)+_0x1a68df(0x1bf)][_0x1a68df(0x265)+_0x1a68df(0x184)]({'mode':_0x1a68df(0x23a)})):await mainWindow['loadFile'](join(shellConfig['projectR'+_0x1a68df(0x260)],_0x1a68df(0x299),_0x1a68df(0x1df)+'ml')),mainLogger?.[_0x1a68df(0x156)](_0x1a68df(0x25b)+_0x1a68df(0x1f0)+'ed',{'rendererUrl':_0x80e007,'mode':getMode()});}function installIpcHandlers(){const _0x388ab6=_0x1c0281,_0x376cb8=(_0x3fad9c,_0x115c15)=>{const _0x189480=_0x2133;ipcMain[_0x189480(0x20c)](_0x3fad9c,async(_0x1c7d9b,_0xabb932)=>{const _0xefb5e5=_0x189480,_0x134456=Date[_0xefb5e5(0x1a8)](),_0x3200b5=_0x1c7d9b[_0xefb5e5(0x27b)+_0xefb5e5(0x232)]?.[_0xefb5e5(0x150)]||_0x1c7d9b['sender'][_0xefb5e5(0x144)]();ipcLogger?.['info'](_0xefb5e5(0x1b0)+_0xefb5e5(0x235)+_0xefb5e5(0x1ab),{'channel':_0x3fad9c,'senderUrl':_0x3200b5,'payload':summarizePayload(_0xabb932)});try{const _0xffaeef=await _0x115c15(_0x1c7d9b,_0xabb932);return ipcLogger?.['info']('ipc\x20requ'+_0xefb5e5(0x249)+_0xefb5e5(0x182),{'channel':_0x3fad9c,'durationMs':Date[_0xefb5e5(0x1a8)]()-_0x134456,'result':summarizePayload(_0xffaeef,{'maxDepth':0x2})}),_0xffaeef;}catch(_0xc70d91){ipcLogger?.['error']('ipc\x20requ'+'est\x20fail'+'ed',{'channel':_0x3fad9c,'durationMs':Date[_0xefb5e5(0x1a8)]()-_0x134456,'error':summarizeError(_0xc70d91)});throw _0xc70d91;}});},_0x37975c=()=>{const _0x52924b=_0x2133;if(!gatewayController)throw new Error(bootError?_0x52924b(0x259)+_0x52924b(0x13f)+_0x52924b(0x1e1)+'\x20'+bootError:_0x52924b(0x259)+_0x52924b(0x14d)+_0x52924b(0x13a)+_0x52924b(0x28b)+_0x52924b(0x17b));return gatewayController;};_0x376cb8('app:info',async()=>({'name':shellConfig[_0x388ab6(0x163)+_0x388ab6(0x232)],'version':app['getVersi'+'on'](),'appId':shellConfig[_0x388ab6(0x1cc)],'dataDir':shellConfig[_0x388ab6(0x1b5)]})),_0x376cb8('app:open'+_0x388ab6(0x1fe),async(_0x19266f,_0x58f093)=>{const _0x2396f6=_0x388ab6,_0x37f347=typeof _0x58f093===_0x2396f6(0x20b)?_0x58f093:'';if(!_0x37f347)return{'ok':![]};return filesLogger?.[_0x2396f6(0x156)](_0x2396f6(0x146)+_0x2396f6(0x1c4)+_0x2396f6(0x1f5)+_0x2396f6(0x1ab),{'url':summarizeText(_0x37f347,0xa0)}),await shell[_0x2396f6(0x1e0)+_0x2396f6(0x1e6)](_0x37f347),{'ok':!![]};}),_0x376cb8('window:m'+_0x388ab6(0x14b),_0xfda2d0=>{const _0x5b71be=_0x388ab6;return BrowserWindow[_0x5b71be(0x19d)+_0x5b71be(0x26d)](_0xfda2d0['sender'])?.[_0x5b71be(0x27d)](),{'ok':!![]};}),_0x376cb8(_0x388ab6(0x206)+_0x388ab6(0x1e4)+_0x388ab6(0x1ee),_0x2db8a6=>{const _0x2eb632=_0x388ab6,_0x162d4a=BrowserWindow[_0x2eb632(0x19d)+_0x2eb632(0x26d)](_0x2db8a6['sender']);if(!_0x162d4a)return{'isMaximized':![]};if(_0x162d4a[_0x2eb632(0x1de)+'zed']())_0x162d4a[_0x2eb632(0x211)+'ze']();else _0x162d4a[_0x2eb632(0x220)]();return{'isMaximized':_0x162d4a[_0x2eb632(0x1de)+_0x2eb632(0x21d)]()};}),_0x376cb8('window:c'+_0x388ab6(0x154),_0x3a4d15=>{const _0x44df3c=_0x388ab6;return BrowserWindow[_0x44df3c(0x19d)+_0x44df3c(0x26d)](_0x3a4d15['sender'])?.[_0x44df3c(0x210)](),{'ok':!![]};}),_0x376cb8(_0x388ab6(0x1d5)+'pen-devt'+'ools',()=>openDevToolsForActiveContext()),_0x376cb8(_0x388ab6(0x1aa)+_0x388ab6(0x289)+_0x388ab6(0x1bd),()=>_0x37975c()['runtimeI'+_0x388ab6(0x22c)]()),_0x376cb8(_0x388ab6(0x1aa)+_0x388ab6(0x25f)+_0x388ab6(0x241),()=>_0x37975c()[_0x388ab6(0x189)+'s']()),_0x376cb8(_0x388ab6(0x1aa)+_0x388ab6(0x25f)+'-restart',()=>_0x37975c()['restart'](_0x388ab6(0x270)+'\x20request')),_0x376cb8(_0x388ab6(0x1aa)+_0x388ab6(0x25f)+_0x388ab6(0x13c),(_0x38cbb1,_0x2be4c9={})=>_0x37975c()[_0x388ab6(0x186)+'tLogs'](_0x2be4c9?.[_0x388ab6(0x25e)]??0xc8)),_0x376cb8(_0x388ab6(0x1aa)+_0x388ab6(0x173)+_0x388ab6(0x1f2)+'-questio'+'n',(_0x55bd47,_0xbe75d2)=>_0x37975c()['answerAs'+_0x388ab6(0x20f)+_0x388ab6(0x1e8)](_0xbe75d2)),_0x376cb8(_0x388ab6(0x1aa)+_0x388ab6(0x228)+_0x388ab6(0x213),async()=>{const _0x59822d=_0x388ab6,_0x4d59c6=join(resolveRuntimeRoot(shellConfig['projectR'+_0x59822d(0x260)]),_0x59822d(0x17c),_0x59822d(0x263)+'w');if(!existsSync(_0x4d59c6))throw new Error('openclaw'+_0x59822d(0x219)+'pper\x20not'+_0x59822d(0x1b3)+_0x4d59c6+('.\x20Run\x20wu'+_0x59822d(0x1c1)+_0x59822d(0x1bb)+_0x59822d(0x217)));const _0xb3d125=join(app[_0x59822d(0x20a)](_0x59822d(0x18f)),'wujie-sh'+_0x59822d(0x21c)+_0x59822d(0x252));await writeFile(_0xb3d125,_0x59822d(0x1f9)+_0x59822d(0x13d)+_0x4d59c6[_0x59822d(0x284)](/\\/g,'\x5c\x5c')[_0x59822d(0x284)](/"/g,'\x5c\x22')+'\x22\x0a',{'mode':0x1ed});const _0x5e9b4c=spawn(_0x59822d(0x1fc),['-a',_0x59822d(0x13e),_0xb3d125],{'detached':!![],'stdio':'ignore'});return _0x5e9b4c['unref'](),{'ok':!![],'cliPath':_0x4d59c6};}),_0x376cb8(_0x388ab6(0x254)+_0x388ab6(0x268),()=>_0x37975c()[_0x388ab6(0x25a)][_0x388ab6(0x18d)]()),_0x376cb8('skills:s'+_0x388ab6(0x16c),(_0x376917,_0x4c8b64)=>_0x37975c()[_0x388ab6(0x27a)]['status'](_0x4c8b64)),_0x376cb8('sessions'+_0x388ab6(0x1e3),(_0x4a029a,_0x263dfd)=>_0x37975c()[_0x388ab6(0x22d)][_0x388ab6(0x147)](_0x263dfd)),_0x376cb8(_0x388ab6(0x22d)+_0x388ab6(0x1be),(_0x2e1d2d,_0x4883c3)=>_0x37975c()[_0x388ab6(0x22d)]['list'](_0x4883c3)),_0x376cb8(_0x388ab6(0x22d)+':delete',(_0x53b1df,_0x3c2a53)=>_0x37975c()['sessions'][_0x388ab6(0x16e)](_0x3c2a53)),_0x376cb8(_0x388ab6(0x231)+_0x388ab6(0x238),(_0x288c6a,_0x48d21d)=>_0x37975c()[_0x388ab6(0x14e)][_0x388ab6(0x1d0)](_0x48d21d)),_0x376cb8(_0x388ab6(0x15d)+'rt',(_0x1e0594,_0x52b302)=>_0x37975c()['chat'][_0x388ab6(0x19e)](_0x52b302)),_0x376cb8(_0x388ab6(0x1cf)+'tory',(_0x2e155c,_0x22ac97)=>_0x37975c()[_0x388ab6(0x14e)][_0x388ab6(0x28f)](_0x22ac97)),_0x376cb8(_0x388ab6(0x215)+'te',async(_0xb7e596,_0x207323={})=>{const _0x1a4039=_0x388ab6,_0xb067af=typeof _0x207323[_0x1a4039(0x24f)]===_0x1a4039(0x20b)?_0x207323[_0x1a4039(0x24f)]:_0x1a4039(0x156),_0x3bb229=typeof _0x207323[_0x1a4039(0x1f4)]===_0x1a4039(0x20b)?_0x207323[_0x1a4039(0x1f4)]:_0x1a4039(0x270)+'\x20log',_0x13797a=typeof _0x207323[_0x1a4039(0x1ac)]==='string'&&_0x207323['context'][_0x1a4039(0x291)]()?_0x1a4039(0x270)+':'+_0x207323[_0x1a4039(0x1ac)][_0x1a4039(0x291)]():_0x1a4039(0x270),_0x18303c=_0x207323['meta']&&typeof _0x207323[_0x1a4039(0x197)]===_0x1a4039(0x1f6)?summarizePayload(_0x207323[_0x1a4039(0x197)]):undefined,_0x1fae20=rendererLogger;if(_0x1fae20?.[_0xb067af])await _0x1fae20[_0xb067af](_0x3bb229,_0x18303c);else await _0x1fae20?.[_0x1a4039(0x156)](_0x3bb229,_0x18303c);return{'ok':!![]};}),_0x376cb8('logs:exp'+_0x388ab6(0x21a),async(_0x5ea9c4,_0x1c976e={})=>{const _0x1777cc=_0x388ab6,_0x1cc317=typeof _0x1c976e['targetDi'+'r']===_0x1777cc(0x20b)&&_0x1c976e[_0x1777cc(0x26a)+'r'][_0x1777cc(0x291)]()?_0x1c976e[_0x1777cc(0x26a)+'r']:undefined,_0x3c8059=await exportLogsArchive({'logsDir':configController[_0x1777cc(0x14a)][_0x1777cc(0x290)],'targetDir':_0x1cc317,'appVersion':app[_0x1777cc(0x209)+'on']()});return mainLogger?.['info'](_0x1777cc(0x1a6)+'orted',{'path':toHomePath(_0x3c8059['path'])}),_0x3c8059;}),_0x376cb8('logs:ope'+_0x388ab6(0x14c)+_0x388ab6(0x28d),async()=>{const _0x32ca88=_0x388ab6;return await shell['openPath'](configController[_0x32ca88(0x14a)][_0x32ca88(0x290)]),mainLogger?.['info'](_0x32ca88(0x15b)+_0x32ca88(0x1d2)+_0x32ca88(0x19a),{'logsDir':toHomePath(configController[_0x32ca88(0x14a)][_0x32ca88(0x290)])}),{'ok':!![],'path':configController[_0x32ca88(0x14a)][_0x32ca88(0x290)]};}),_0x376cb8(_0x388ab6(0x1c7)+'ad',async(_0x128a75,_0x4617e9)=>{const _0x575de6=_0x388ab6,_0x50f219=Date[_0x575de6(0x1a8)]();try{const _0x585f27=await readFile(_0x4617e9,_0x575de6(0x295));return filesLogger?.[_0x575de6(0x156)](_0x575de6(0x26f)+_0x575de6(0x1ca)+_0x575de6(0x1ab),{'path':toHomePath(_0x4617e9),'bytes':Buffer['byteLeng'+'th'](_0x585f27),'durationMs':Date[_0x575de6(0x1a8)]()-_0x50f219}),_0x585f27;}catch(_0x7c723e){filesLogger?.[_0x575de6(0x26b)](_0x575de6(0x26f)+_0x575de6(0x203),{'path':toHomePath(_0x4617e9),'durationMs':Date[_0x575de6(0x1a8)]()-_0x50f219,'error':summarizeError(_0x7c723e)});throw _0x7c723e;}}),_0x376cb8(_0x388ab6(0x1c7)+'ad-binar'+'y',async(_0x5e3ed8,_0x5b5160)=>{const _0x4f9030=_0x388ab6,_0x91e179=Date[_0x4f9030(0x1a8)]();try{const _0x2a1fc4=await readFile(_0x5b5160);return filesLogger?.[_0x4f9030(0x156)]('binary\x20f'+_0x4f9030(0x153)+_0x4f9030(0x21b)+'ed',{'path':toHomePath(_0x5b5160),'bytes':_0x2a1fc4[_0x4f9030(0x226)+'th'],'durationMs':Date[_0x4f9030(0x1a8)]()-_0x91e179}),new Uint8Array(_0x2a1fc4);}catch(_0xfa22f9){filesLogger?.[_0x4f9030(0x26b)]('binary\x20f'+_0x4f9030(0x153)+_0x4f9030(0x258),{'path':toHomePath(_0x5b5160),'durationMs':Date[_0x4f9030(0x1a8)]()-_0x91e179,'error':summarizeError(_0xfa22f9)});throw _0xfa22f9;}}),_0x376cb8(_0x388ab6(0x24b)+'ite',async(_0x1f7295,_0x803774={})=>{const _0x3659e4=_0x388ab6,_0x34bde2=Date['now']();return await writeFile(_0x803774[_0x3659e4(0x29b)],_0x803774['content']??'','utf8'),filesLogger?.[_0x3659e4(0x156)](_0x3659e4(0x294)+'te\x20compl'+_0x3659e4(0x207),{'path':toHomePath(_0x803774[_0x3659e4(0x29b)]),'bytes':Buffer[_0x3659e4(0x226)+'th'](String(_0x803774[_0x3659e4(0x22e)]??'')),'durationMs':Date['now']()-_0x34bde2}),{'ok':!![]};}),_0x376cb8(_0x388ab6(0x24b)+_0x388ab6(0x1b9)+'ry',async(_0x16e030,_0x1e01c5={})=>{const _0x175c29=_0x388ab6,_0x5d2f64=Date[_0x175c29(0x1a8)]();await writeFile(_0x1e01c5[_0x175c29(0x29b)],Buffer['from'](_0x1e01c5[_0x175c29(0x22e)]??[]));const _0x160284=await stat(_0x1e01c5[_0x175c29(0x29b)])['catch'](()=>null);return filesLogger?.[_0x175c29(0x156)](_0x175c29(0x1db)+_0x175c29(0x172)+_0x175c29(0x245)+_0x175c29(0x1ab),{'path':toHomePath(_0x1e01c5['path']),'bytes':_0x160284?.['size']??0x0,'durationMs':Date[_0x175c29(0x1a8)]()-_0x5d2f64}),{'ok':!![]};}),_0x376cb8(_0x388ab6(0x1c8)+'lect-fil'+'e',async(_0x329371,_0x2cade7={})=>{const _0x520aa8=_0x388ab6,_0x190268=await dialog[_0x520aa8(0x29a)+_0x520aa8(0x20e)](BrowserWindow['fromWebC'+_0x520aa8(0x26d)](_0x329371['sender'])??mainWindow,{'title':typeof _0x2cade7['title']===_0x520aa8(0x20b)?_0x2cade7[_0x520aa8(0x14f)]:undefined,'properties':[_0x520aa8(0x242),..._0x2cade7[_0x520aa8(0x143)+_0x520aa8(0x166)]?[_0x520aa8(0x143)+'ections']:[]],'filters':Array[_0x520aa8(0x1dd)](_0x2cade7['filters'])?_0x2cade7[_0x520aa8(0x1a7)]:undefined});return filesLogger?.[_0x520aa8(0x156)](_0x520aa8(0x212)+'ile\x20comp'+'leted',{'canceled':_0x190268[_0x520aa8(0x1e5)],'count':_0x190268[_0x520aa8(0x140)+'s']['length'],'paths':_0x190268[_0x520aa8(0x140)+'s'][_0x520aa8(0x142)](toHomePath)}),{'canceled':_0x190268[_0x520aa8(0x1e5)],'paths':_0x190268[_0x520aa8(0x140)+'s']};}),_0x376cb8(_0x388ab6(0x195)+'st-direc'+_0x388ab6(0x1a2),async(_0x3cad37,_0x1f4e77={})=>{const _0x4b2ea5=_0x388ab6,_0x4c8a4f=resolve(String(_0x1f4e77['path']||'')),_0x522614=_0x1f4e77[_0x4b2ea5(0x27e)+'e']!==![],_0xc112a9=Array[_0x4b2ea5(0x1dd)](_0x1f4e77['extensio'+'ns'])?_0x1f4e77[_0x4b2ea5(0x250)+'ns'][_0x4b2ea5(0x142)](_0x2e377b=>String(_0x2e377b)[_0x4b2ea5(0x286)+'ase']()[_0x4b2ea5(0x284)](/^\./,''))[_0x4b2ea5(0x25d)](Boolean):null,_0x437b0b=Number[_0x4b2ea5(0x267)+'r'](_0x1f4e77[_0x4b2ea5(0x179)+'es'])&&_0x1f4e77[_0x4b2ea5(0x179)+'es']>0x0?_0x1f4e77[_0x4b2ea5(0x179)+'es']:0xc350,_0x368ec8=[];let _0x59b039=![];async function _0x358a82(_0x1a6fe6){const _0x32bb89=_0x4b2ea5;if(_0x59b039)return;let _0x4cb2b4;try{_0x4cb2b4=await readdir(_0x1a6fe6,{'withFileTypes':!![]});}catch{return;}for(const _0x59047e of _0x4cb2b4){if(_0x59b039)return;if(_0x59047e['name'][_0x32bb89(0x1c9)+'th']('.'))continue;const _0x4a4baf=join(_0x1a6fe6,_0x59047e[_0x32bb89(0x27c)]);if(_0x59047e[_0x32bb89(0x266)+_0x32bb89(0x28d)]()){if(_0x522614)await _0x358a82(_0x4a4baf);continue;}if(!_0x59047e[_0x32bb89(0x1c2)]())continue;if(_0xc112a9){const _0x1bbde7=_0x59047e[_0x32bb89(0x27c)][_0x32bb89(0x16b)+_0x32bb89(0x248)]('.'),_0x53ddb5=_0x1bbde7>=0x0?_0x59047e[_0x32bb89(0x27c)][_0x32bb89(0x236)](_0x1bbde7+0x1)['toLowerC'+'ase']():'';if(!_0xc112a9['includes'](_0x53ddb5))continue;}if(_0x368ec8[_0x32bb89(0x193)]>=_0x437b0b){_0x59b039=!![];return;}_0x368ec8['push']({'name':_0x59047e[_0x32bb89(0x27c)],'path':_0x4a4baf});}}return await _0x358a82(_0x4c8a4f),{'path':_0x4c8a4f,'entries':_0x368ec8,'truncated':_0x59b039};}),_0x376cb8(_0x388ab6(0x1c8)+_0x388ab6(0x1b8)+_0x388ab6(0x145),async(_0x31e00d,_0x2efd2b={})=>{const _0x60b87c=_0x388ab6,_0x1aca3f=await dialog[_0x60b87c(0x29a)+_0x60b87c(0x20e)](BrowserWindow[_0x60b87c(0x19d)+_0x60b87c(0x26d)](_0x31e00d['sender'])??mainWindow,{'title':typeof _0x2efd2b[_0x60b87c(0x14f)]===_0x60b87c(0x20b)?_0x2efd2b['title']:undefined,'properties':[_0x60b87c(0x20d)+'ctory']});return filesLogger?.[_0x60b87c(0x156)]('select\x20d'+_0x60b87c(0x282)+'\x20complet'+'ed',{'canceled':_0x1aca3f[_0x60b87c(0x1e5)],'count':_0x1aca3f[_0x60b87c(0x140)+'s'][_0x60b87c(0x193)],'paths':_0x1aca3f[_0x60b87c(0x140)+'s']['map'](toHomePath)}),{'canceled':_0x1aca3f[_0x60b87c(0x1e5)],'paths':_0x1aca3f[_0x60b87c(0x140)+'s']};}),_0x376cb8(_0x388ab6(0x1d4)+_0x388ab6(0x19c)+'ory-info',()=>_0x37975c()[_0x388ab6(0x1d4)+'e'][_0x388ab6(0x18a)+'yInfo']()),_0x376cb8(_0x388ab6(0x1d4)+_0x388ab6(0x237)+_0x388ab6(0x282),async()=>{const _0x56543a=_0x388ab6,_0x4d8ac9=await _0x37975c()[_0x56543a(0x1d4)+'e'][_0x56543a(0x18a)+_0x56543a(0x199)]();return await shell[_0x56543a(0x1c5)](_0x4d8ac9[_0x56543a(0x29b)]),filesLogger?.[_0x56543a(0x156)](_0x56543a(0x1d4)+_0x56543a(0x278)+'ory\x20open'+'ed',{'path':toHomePath(_0x4d8ac9[_0x56543a(0x29b)])}),{'ok':!![],'path':_0x4d8ac9[_0x56543a(0x29b)]};}),_0x376cb8(_0x388ab6(0x1d4)+'e:shared'+'-context',()=>_0x37975c()['workspac'+'e']['sharedCo'+_0x388ab6(0x28e)]()),_0x376cb8('workspac'+_0x388ab6(0x23f)+_0x388ab6(0x1ae)+_0x388ab6(0x1d6),(_0x120fa7,_0x2dfafe)=>_0x37975c()['workspac'+'e'][_0x388ab6(0x243)+_0x388ab6(0x181)+'xt'](_0x2dfafe)),_0x376cb8(_0x388ab6(0x22d)+':rename',(_0x4025d6,_0x46fd53)=>_0x37975c()[_0x388ab6(0x22d)][_0x388ab6(0x285)](_0x46fd53)),_0x376cb8('sessions'+_0x388ab6(0x23e)+_0x388ab6(0x1b1),()=>_0x37975c()[_0x388ab6(0x22d)]['pinnedKe'+'ys']()),_0x376cb8(_0x388ab6(0x22d)+':set-pin'+_0x388ab6(0x15e),(_0x4d259e,_0xb26950)=>_0x37975c()[_0x388ab6(0x22d)][_0x388ab6(0x224)+'dKeys'](_0xb26950)),_0x376cb8(_0x388ab6(0x271)+_0x388ab6(0x1e7),(_0x2362c6,_0xed7078)=>_0x37975c()[_0x388ab6(0x27a)][_0x388ab6(0x293)](_0xed7078)),_0x376cb8(_0x388ab6(0x283)+_0x388ab6(0x1ef),(_0x3c0951,_0x40e94d)=>_0x37975c()[_0x388ab6(0x27a)][_0x388ab6(0x15f)](_0x40e94d)),_0x376cb8(_0x388ab6(0x24c)+_0x388ab6(0x17f),(_0x5d6f63,_0x58fe41)=>_0x37975c()[_0x388ab6(0x27a)]['delete'](_0x58fe41)),_0x376cb8(_0x388ab6(0x23d)+'t',(_0x531651,_0x19e39c)=>_0x37975c()[_0x388ab6(0x225)][_0x388ab6(0x18d)](_0x19e39c)),_0x376cb8('cron:cre'+_0x388ab6(0x1ff),(_0x5a00e2,_0x10aebf)=>_0x37975c()[_0x388ab6(0x225)][_0x388ab6(0x147)](_0x10aebf)),_0x376cb8(_0x388ab6(0x29d)+_0x388ab6(0x1ff),(_0x352823,_0x2a867e)=>_0x37975c()[_0x388ab6(0x225)][_0x388ab6(0x15f)](_0x2a867e)),_0x376cb8('cron:rem'+'ove',(_0x598629,_0x16290e)=>_0x37975c()[_0x388ab6(0x225)][_0x388ab6(0x188)](_0x16290e)),_0x376cb8('cron:run'+'-once',(_0x185740,_0x7a23f8)=>_0x37975c()[_0x388ab6(0x225)][_0x388ab6(0x1a0)](_0x7a23f8)),_0x376cb8(_0x388ab6(0x247)+'s',(_0xab1f6a,_0xe1bd7)=>_0x37975c()[_0x388ab6(0x225)][_0x388ab6(0x280)](_0xe1bd7)),_0x376cb8(_0x388ab6(0x255)+'omplete',async(_0x3ccdfa,_0x63acf7={})=>{const _0x27c9f0=_0x388ab6,_0x2811cb=configController[_0x27c9f0(0x1eb)+_0x27c9f0(0x287)+'h'](),_0x7aba56=JSON[_0x27c9f0(0x18c)](await readFile(_0x2811cb,_0x27c9f0(0x295))),_0x594a8a=_0x7aba56?.[_0x27c9f0(0x234)]?.[_0x27c9f0(0x19b)+'s']&&typeof _0x7aba56[_0x27c9f0(0x234)][_0x27c9f0(0x19b)+'s']==='object'?_0x7aba56[_0x27c9f0(0x234)]['provider'+'s']:{},_0x5e5d77=typeof _0x7aba56?.['agents']?.[_0x27c9f0(0x1d3)]?.[_0x27c9f0(0x174)]?.[_0x27c9f0(0x148)]==='string'?_0x7aba56[_0x27c9f0(0x25a)][_0x27c9f0(0x1d3)][_0x27c9f0(0x174)][_0x27c9f0(0x148)]:'',_0x55e1aa=String(_0x63acf7[_0x27c9f0(0x174)]||_0x5e5d77||'');if(!_0x55e1aa['includes']('/'))throw new Error('no\x20defau'+_0x27c9f0(0x24e)+'\x20configu'+_0x27c9f0(0x176)+_0x27c9f0(0x1f8)+'der/mode'+_0x27c9f0(0x169));const _0x157d74=_0x55e1aa[_0x27c9f0(0x1a3)]('/'),_0x1a171a=_0x55e1aa[_0x27c9f0(0x236)](0x0,_0x157d74),_0x2c2fe7=_0x55e1aa[_0x27c9f0(0x236)](_0x157d74+0x1),_0x66989e=_0x594a8a[_0x1a171a];if(!_0x66989e||typeof _0x66989e!==_0x27c9f0(0x1f6))throw new Error('provider'+_0x27c9f0(0x165)+_0x27c9f0(0x177)+'\x20'+_0x1a171a);const _0x164005=String(_0x66989e[_0x27c9f0(0x151)]||_0x27c9f0(0x196)+_0x27c9f0(0x279)+_0x27c9f0(0x13b)+'1')[_0x27c9f0(0x291)]()[_0x27c9f0(0x284)](/\/$/,''),_0x5aa141=await fetch(_0x164005+(_0x27c9f0(0x21e)+_0x27c9f0(0x23c)+'s'),{'method':'POST','headers':{'content-type':'applicat'+_0x27c9f0(0x223),'Authorization':_0x27c9f0(0x1e9)+(_0x66989e[_0x27c9f0(0x26e)]||''),..._0x66989e[_0x27c9f0(0x273)]&&typeof _0x66989e[_0x27c9f0(0x273)]===_0x27c9f0(0x1f6)?_0x66989e[_0x27c9f0(0x273)]:{}},'body':JSON[_0x27c9f0(0x16a)+'y']({'model':_0x2c2fe7,'max_tokens':Number[_0x27c9f0(0x267)+'r'](_0x63acf7[_0x27c9f0(0x1dc)+'s'])?_0x63acf7[_0x27c9f0(0x1dc)+'s']:0x400,'temperature':typeof _0x63acf7[_0x27c9f0(0x1a5)+_0x27c9f0(0x1d7)]===_0x27c9f0(0x202)?_0x63acf7[_0x27c9f0(0x1a5)+_0x27c9f0(0x1d7)]:undefined,'messages':Array[_0x27c9f0(0x1dd)](_0x63acf7[_0x27c9f0(0x15c)])?_0x63acf7[_0x27c9f0(0x15c)]:[]}),'signal':AbortSignal[_0x27c9f0(0x257)](Number['isIntege'+'r'](_0x63acf7[_0x27c9f0(0x187)+'s'])?_0x63acf7[_0x27c9f0(0x187)+'s']:0x1d4c0)});if(!_0x5aa141['ok']){const _0x447a1d=await _0x5aa141['text']();throw new Error(_0x27c9f0(0x168)+_0x27c9f0(0x29e)+_0x5aa141[_0x27c9f0(0x28c)]+':\x20'+_0x447a1d[_0x27c9f0(0x236)](0x0,0x190));}const _0x825fc4=await _0x5aa141[_0x27c9f0(0x23b)](),_0x5dfa15=_0x825fc4?.[_0x27c9f0(0x200)]?.[0x0]?.[_0x27c9f0(0x1f4)]??{};return{'content':typeof _0x5dfa15[_0x27c9f0(0x22e)]===_0x27c9f0(0x20b)?_0x5dfa15[_0x27c9f0(0x22e)]:'','reasoning':typeof _0x5dfa15[_0x27c9f0(0x27f)+'g_conten'+'t']===_0x27c9f0(0x20b)?_0x5dfa15[_0x27c9f0(0x27f)+'g_conten'+'t']:'','model':_0x825fc4?.['model']||_0x2c2fe7};}),_0x376cb8(_0x388ab6(0x1ed)+_0x388ab6(0x269),()=>_0x37975c()[_0x388ab6(0x234)][_0x388ab6(0x208)]()),_0x376cb8('models:s'+_0x388ab6(0x1ba)+_0x388ab6(0x246),(_0x2c1280,_0x1aaea7)=>_0x37975c()[_0x388ab6(0x234)][_0x388ab6(0x25c)+'ngs'](_0x1aaea7)),_0x376cb8(_0x388ab6(0x1ed)+_0x388ab6(0x227)+_0x388ab6(0x222),(_0x87d1db,_0x286462)=>_0x37975c()[_0x388ab6(0x234)][_0x388ab6(0x298)+'peratedM'+_0x388ab6(0x18b)](_0x286462)),_0x376cb8('models:s'+_0x388ab6(0x276)+_0x388ab6(0x159),()=>_0x37975c()[_0x388ab6(0x234)]['selected'+_0x388ab6(0x1c3)]()),_0x376cb8(_0x388ab6(0x255)+_0x388ab6(0x167)+'dels',()=>_0x37975c()[_0x388ab6(0x234)][_0x388ab6(0x240)+_0x388ab6(0x191)]()),_0x376cb8(_0x388ab6(0x1bc)+_0x388ab6(0x1cb),()=>_0x37975c()[_0x388ab6(0x198)][_0x388ab6(0x17e)]());}async function boot(){const _0x109004=_0x1c0281;shellConfig=await loadShellConfig(resolveProjectRoot()),app[_0x109004(0x15a)](shellConfig[_0x109004(0x163)+_0x109004(0x232)]),configController=createConfigController(shellConfig),mainLogger=createShellLogger(configController['paths'],_0x109004(0x22a)),ipcLogger=createShellLogger(configController[_0x109004(0x14a)],_0x109004(0x28a)),filesLogger=createShellLogger(configController['paths'],'files'),rendererLogger=createShellLogger(configController[_0x109004(0x14a)],_0x109004(0x270)),registerProcessLogHooks(),mainLogger?.['info']('electron'+'\x20main\x20bo'+_0x109004(0x26c)+'ed',{'appVersion':app['getVersi'+'on'](),'electronVersion':process[_0x109004(0x262)][_0x109004(0x158)],'nodeVersion':process[_0x109004(0x262)]['node'],'chromeVersion':process[_0x109004(0x262)]['chrome'],'platform':process[_0x109004(0x149)],'arch':process[_0x109004(0x1e2)],'mode':getMode(),'projectRoot':shellConfig[_0x109004(0x183)+_0x109004(0x260)],'configPath':shellConfig[_0x109004(0x1b6)+'th'],'dataDir':shellConfig[_0x109004(0x1b5)],'logsDir':configController[_0x109004(0x14a)][_0x109004(0x290)],'rendererUrl':process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x109004(0x183)+'oot'],_0x109004(0x299),_0x109004(0x1df)+'ml')}),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x109004(0x209)+'on']()});for(const _0x613a74 of[_0x109004(0x256)+_0x109004(0x28c),'gateway-'+_0x109004(0x1f7),'chat-str'+_0x109004(0x1b2)+'t',_0x109004(0x216)+_0x109004(0x22f),'agent-ev'+_0x109004(0x21f),_0x109004(0x24a)+'pdated',_0x109004(0x1f2)+_0x109004(0x1cd)+'n']){gatewayController['on'](_0x613a74,_0x387ee0=>broadcast(_0x613a74,_0x387ee0));}installIpcHandlers(),registerShellShortcuts(),await createWindow(),await gatewayController['start'](),mainLogger?.[_0x109004(0x156)](_0x109004(0x158)+_0x109004(0x296)+_0x109004(0x218)+'eted');}function registerProcessLogHooks(){const _0x3550ab=_0x1c0281;if(registerProcessLogHooks[_0x3550ab(0x261)+'ed'])return;registerProcessLogHooks['register'+'ed']=!![],process['on'](_0x3550ab(0x230)+_0x3550ab(0x277)+'n',_0x1ac19c=>{const _0x3a1fc3=_0x3550ab;mainLogger?.[_0x3a1fc3(0x26b)]('uncaught'+_0x3a1fc3(0x253)+'on',summarizeError(_0x1ac19c));}),process['on'](_0x3550ab(0x1ea)+_0x3550ab(0x160)+'on',_0x3d9550=>{const _0x15aee8=_0x3550ab;mainLogger?.['error'](_0x15aee8(0x1ea)+'d\x20reject'+_0x15aee8(0x141),summarizeError(_0x3d9550));}),app['on']('render-p'+_0x3550ab(0x1f3)+_0x3550ab(0x275),(_0x4afb38,_0x36e569,_0x166a5c)=>{const _0x4b7b02=_0x3550ab;mainLogger?.[_0x4b7b02(0x26b)](_0x4b7b02(0x270)+_0x4b7b02(0x1b4)+'\x20gone',{'url':_0x36e569[_0x4b7b02(0x144)](),'details':_0x166a5c});}),app['on']('child-pr'+_0x3550ab(0x18e)+'ne',(_0x4cf2ab,_0x3f6097)=>{const _0x49bd80=_0x3550ab;mainLogger?.[_0x49bd80(0x26b)]('child\x20pr'+_0x49bd80(0x190)+'ne',{'details':_0x3f6097});});}app['on'](_0x1c0281(0x24d)+_0x1c0281(0x281)+'d',()=>{const _0x4e2e25=_0x1c0281;if(process[_0x4e2e25(0x149)]!==_0x4e2e25(0x185))app[_0x4e2e25(0x164)]();}),app['on'](_0x1c0281(0x264),async()=>{const _0x720fc9=_0x1c0281;BrowserWindow[_0x720fc9(0x17a)+_0x720fc9(0x161)]()[_0x720fc9(0x193)]===0x0&&shellConfig&&await createWindow();}),app['on'](_0x1c0281(0x214)+_0x1c0281(0x272),_0xf58dcb=>{const _0x3cc2ef=_0x1c0281;if(!gatewayController)return;mainLogger?.[_0x3cc2ef(0x156)]('before\x20q'+_0x3cc2ef(0x192)+_0x3cc2ef(0x178)+_0x3cc2ef(0x1af)),_0xf58dcb[_0x3cc2ef(0x1b7)+_0x3cc2ef(0x205)](),void gatewayController['stop']()[_0x3cc2ef(0x288)](()=>{const _0x3fa91a=_0x3cc2ef;gatewayController=null,mainLogger?.['info'](_0x3fa91a(0x1d9)+_0x3fa91a(0x1d8)+'before\x20q'+'uit'),app[_0x3fa91a(0x164)]();});}),app['on']('will-qui'+'t',()=>{const _0x2be8e4=_0x1c0281;globalShortcut[_0x2be8e4(0x251)+'er'](DEVTOOLS_ACCELERATOR);}),app[_0x1c0281(0x170)+'y']()[_0x1c0281(0x1a9)](boot)['catch'](_0x58abad=>{const _0x3e16cd=_0x1c0281;bootError=_0x58abad instanceof Error?_0x58abad[_0x3e16cd(0x1f4)]:String(_0x58abad),mainLogger?.['error'](_0x3e16cd(0x158)+_0x3e16cd(0x296)+_0x3e16cd(0x1a4)+'d',summarizeError(_0x58abad)),console[_0x3e16cd(0x26b)](_0x3e16cd(0x19f)+'hell]\x20fa'+_0x3e16cd(0x157)+_0x3e16cd(0x22b)+_0x3e16cd(0x16d)+'in',_0x58abad);});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _0x40fe(){const _0x16be68=['ad-binar','ate','shared-c','off','invoke','st-direc','ite','payload','files:li',':list','models:c','wujie-sh',':runtime','ory-info','exposeIn','ell:even','eam','window:c','lose','-context','-url','files:re','window:m','log','cron:log','nstall','session-','dels','inimize',':delete','e:direct','cron:cre','ory','-shortcu','-once','ent','gateway-','MainWorl','skills:d','delete','i-window','workspac','model-id','logs:ope','n-direct','-questio','e:open-d','cron:rem','ite-bina','4476750PMjIpP','agents:l','3556160ItNgfS','ove','ist','-logs','ngs','et-setti','cron:run','ximize','lect-dir','ask-user','pdated','chat:str','4259458LjWljR','chat:his','-status','elete','ontext','ned-keys','ustom-mo',':pinned-','521237GGKkBS','app:info','oggle-ma','window:o','ectory',':gateway','tatus','-restart',':set-pin','ort','skills:i','files:se','ead','sessions',':create','operated','chat-str','4280525wJtKQy','wujieShe','openclaw','pdate','irectory','omplete','1979841pZtdYv',':open-cl','lect-fil','tory','models:s','830252LTzlwh','updated','e:shared','cron:lis'];_0x40fe=function(){return _0x16be68;};return _0x40fe();}const _0x5cfc1b=_0xe420;(function(_0x159ddd,_0x385cf2){const _0x4b6d19=_0xe420,_0x1e1a05=_0x159ddd();while(!![]){try{const _0x43153c=-parseInt(_0x4b6d19(0xe7))/0x1+parseInt(_0x4b6d19(0x103))/0x2+parseInt(_0x4b6d19(0xfe))/0x3+parseInt(_0x4b6d19(0xd3))/0x4+-parseInt(_0x4b6d19(0xf8))/0x5+-parseInt(_0x4b6d19(0xd1))/0x6+parseInt(_0x4b6d19(0xdf))/0x7;if(_0x43153c===_0x385cf2)break;else _0x1e1a05['push'](_0x1e1a05['shift']());}catch(_0x5c191f){_0x1e1a05['push'](_0x1e1a05['shift']());}}}(_0x40fe,0x6da74));function _0xe420(_0xd130f3,_0x32850e){_0xd130f3=_0xd130f3-0xb2;const _0x40fec9=_0x40fe();let _0xe42077=_0x40fec9[_0xd130f3];return _0xe42077;}import _0x29f0db from'electron';const {contextBridge,ipcRenderer}=_0x29f0db,eventListeners=new Map();function invoke(_0x2b8492,_0x2fe792){const _0x1f3025=_0xe420;return ipcRenderer[_0x1f3025(0x10b)](_0x2b8492,_0x2fe792);}function subscribe(_0x1c834b,_0xc806a8){const _0xedcb76=_0xe420;if(typeof _0xc806a8!=='function')return()=>{};const _0x3bdc38=(_0x315b56,_0x5f29c9)=>{const _0x55d262=_0xe420;if(_0x5f29c9?.['name']===_0x1c834b)_0xc806a8(_0x5f29c9[_0x55d262(0x10e)]);};return ipcRenderer['on'](_0xedcb76(0x112)+'ell:even'+'t',_0x3bdc38),eventListeners['set'](_0xc806a8,_0x3bdc38),()=>{const _0x501757=_0xedcb76,_0x2d07ea=eventListeners['get'](_0xc806a8)||_0x3bdc38;ipcRenderer[_0x501757(0x10a)](_0x501757(0x112)+_0x501757(0x116)+'t',_0x2d07ea),eventListeners[_0x501757(0xc7)](_0xc806a8);};}contextBridge[_0x5cfc1b(0x115)+_0x5cfc1b(0xc5)+'d'](_0x5cfc1b(0xf9)+'ll',{'app':{'info':()=>invoke(_0x5cfc1b(0xe8)),'openUrl':_0x4b4e59=>invoke('app:open'+_0x5cfc1b(0xb4),_0x4b4e59)},'window':{'minimize':()=>invoke(_0x5cfc1b(0xb6)+_0x5cfc1b(0xbc)),'toggleMaximize':()=>invoke('window:t'+_0x5cfc1b(0xe9)+_0x5cfc1b(0xda)),'close':()=>invoke(_0x5cfc1b(0x118)+_0x5cfc1b(0xb2)),'openDevTools':()=>invoke(_0x5cfc1b(0xea)+'pen-devt'+'ools'),'onDevToolsShortcut':_0x2102d8=>subscribe('devtools'+_0x5cfc1b(0xc1)+'t',_0x2102d8)},'files':{'read':_0x1350ad=>invoke(_0x5cfc1b(0xb5)+'ad',_0x1350ad),'readBinary':_0x396c4a=>invoke(_0x5cfc1b(0xb5)+_0x5cfc1b(0x107)+'y',_0x396c4a),'write':(_0x897c36,_0x1df2b8)=>invoke('files:wr'+_0x5cfc1b(0x10d),{'path':_0x897c36,'content':_0x1df2b8}),'writeBinary':(_0x2c9f90,_0x229dd0)=>invoke('files:wr'+_0x5cfc1b(0xd0)+'ry',{'path':_0x2c9f90,'content':_0x229dd0}),'selectFile':_0x30f557=>invoke(_0x5cfc1b(0xf2)+_0x5cfc1b(0x100)+'e',_0x30f557),'selectDirectory':_0x4befe5=>invoke(_0x5cfc1b(0xf2)+_0x5cfc1b(0xdb)+_0x5cfc1b(0xeb),_0x4befe5),'listDirectory':_0x3fcca3=>invoke(_0x5cfc1b(0x10f)+_0x5cfc1b(0x10c)+'tory',_0x3fcca3)},'workspace':{'directoryInfo':()=>invoke(_0x5cfc1b(0xc9)+_0x5cfc1b(0xbe)+_0x5cfc1b(0x114)),'openDirectory':()=>invoke('workspac'+_0x5cfc1b(0xce)+_0x5cfc1b(0xfc)),'sharedContext':()=>invoke(_0x5cfc1b(0xc9)+_0x5cfc1b(0x105)+_0x5cfc1b(0xb3)),'writeSharedContext':_0x4fbb28=>invoke('workspac'+'e:write-'+_0x5cfc1b(0x109)+_0x5cfc1b(0xe3),_0x4fbb28)},'openclaw':{'runtimeInfo':()=>invoke(_0x5cfc1b(0xfa)+_0x5cfc1b(0x113)+'-info'),'gatewayStatus':()=>invoke(_0x5cfc1b(0xfa)+_0x5cfc1b(0xec)+_0x5cfc1b(0xe1)),'gatewayRestart':()=>invoke(_0x5cfc1b(0xfa)+_0x5cfc1b(0xec)+_0x5cfc1b(0xee)),'gatewayLogs':_0x2d2e08=>invoke('openclaw'+_0x5cfc1b(0xec)+_0x5cfc1b(0xd6),_0x2d2e08),'onGatewayStatus':_0x4434c1=>subscribe(_0x5cfc1b(0xc4)+'status',_0x4434c1),'onGatewayLog':_0x5a88b7=>subscribe(_0x5cfc1b(0xc4)+_0x5cfc1b(0xb7),_0x5a88b7),'onAgentEvent':_0x5e0cf7=>subscribe('agent-ev'+_0x5cfc1b(0xc3),_0x5e0cf7),'onAgentsUpdated':_0x26681a=>subscribe('agents-u'+_0x5cfc1b(0xdd),_0x26681a),'onAskUserQuestion':_0x23cde5=>subscribe(_0x5cfc1b(0xdc)+_0x5cfc1b(0xcd)+'n',_0x23cde5),'answerAskUserQuestion':_0x5e0738=>invoke(_0x5cfc1b(0xfa)+':answer-'+_0x5cfc1b(0xdc)+_0x5cfc1b(0xcd)+'n',_0x5e0738),'openCliWindow':()=>invoke(_0x5cfc1b(0xfa)+_0x5cfc1b(0xff)+_0x5cfc1b(0xc8))},'agents':{'list':()=>invoke(_0x5cfc1b(0xd2)+_0x5cfc1b(0xd5))},'skills':{'status':_0x126e5a=>invoke('skills:s'+_0x5cfc1b(0xed),_0x126e5a),'install':_0x53f45b=>invoke(_0x5cfc1b(0xf1)+_0x5cfc1b(0xb9),_0x53f45b),'update':_0x579260=>invoke('skills:u'+_0x5cfc1b(0xfb),_0x579260),'delete':_0x468d94=>invoke(_0x5cfc1b(0xc6)+_0x5cfc1b(0xe2),_0x468d94)},'sessions':{'create':_0x47cb6a=>invoke(_0x5cfc1b(0xf4)+_0x5cfc1b(0xf5),_0x47cb6a),'list':_0x49db15=>invoke('sessions'+_0x5cfc1b(0x110),_0x49db15),'delete':_0x149172=>invoke(_0x5cfc1b(0xf4)+_0x5cfc1b(0xbd),_0x149172),'rename':_0x25477b=>invoke(_0x5cfc1b(0xf4)+':rename',_0x25477b),'pinnedKeys':()=>invoke(_0x5cfc1b(0xf4)+_0x5cfc1b(0xe6)+'keys'),'setPinnedKeys':_0x447ecd=>invoke(_0x5cfc1b(0xf4)+_0x5cfc1b(0xef)+_0x5cfc1b(0xe4),_0x447ecd),'onUpdated':_0xf0033f=>subscribe(_0x5cfc1b(0xba)+_0x5cfc1b(0x104),_0xf0033f)},'cron':{'list':_0x2fa38c=>invoke(_0x5cfc1b(0x106)+'t',_0x2fa38c),'create':_0x137b17=>invoke(_0x5cfc1b(0xbf)+'ate',_0x137b17),'update':_0x5ce779=>invoke('cron:upd'+_0x5cfc1b(0x108),_0x5ce779),'remove':_0x3c0d29=>invoke(_0x5cfc1b(0xcf)+_0x5cfc1b(0xd4),_0x3c0d29),'runOnce':_0x4b52b2=>invoke(_0x5cfc1b(0xd9)+_0x5cfc1b(0xc2),_0x4b52b2),'logs':_0x3bb7fc=>invoke(_0x5cfc1b(0xb8)+'s',_0x3bb7fc)},'models':{'complete':_0x18351=>invoke(_0x5cfc1b(0x111)+_0x5cfc1b(0xfd),_0x18351),'settings':()=>invoke('models:s'+'ettings'),'setSettings':_0x613f68=>invoke(_0x5cfc1b(0x102)+_0x5cfc1b(0xd8)+_0x5cfc1b(0xd7),_0x613f68),'setSelfOperatedModels':_0x285277=>invoke(_0x5cfc1b(0x102)+'et-self-'+_0x5cfc1b(0xf6),_0x285277),'selectedModelId':()=>invoke(_0x5cfc1b(0x102)+'elected-'+_0x5cfc1b(0xca)),'customModels':()=>invoke(_0x5cfc1b(0x111)+_0x5cfc1b(0xe5)+_0x5cfc1b(0xbb))},'config':{'read':()=>invoke('config:r'+_0x5cfc1b(0xf3))},'logs':{'write':_0x242f08=>invoke('logs:wri'+'te',_0x242f08),'export':_0x5d713e=>invoke('logs:exp'+_0x5cfc1b(0xf0),_0x5d713e),'openDirectory':()=>invoke(_0x5cfc1b(0xcb)+_0x5cfc1b(0xcc)+_0x5cfc1b(0xc0))},'chat':{'stream':_0x21820e=>invoke(_0x5cfc1b(0xde)+_0x5cfc1b(0x117),_0x21820e),'abort':_0x5441ba=>invoke('chat:abo'+'rt',_0x5441ba),'history':_0x30934f=>invoke(_0x5cfc1b(0xe0)+_0x5cfc1b(0x101),_0x30934f),'onStreamEvent':_0x469f5c=>subscribe(_0x5cfc1b(0xf7)+'eam-even'+'t',_0x469f5c)}});
|