@wujie-shell/core 0.1.3 → 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 +8 -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`.
|
|
@@ -54,7 +54,7 @@ Options:
|
|
|
54
54
|
|
|
55
55
|
Behavior:
|
|
56
56
|
|
|
57
|
-
-
|
|
57
|
+
- Builds or refreshes the product-local runtime base when needed.
|
|
58
58
|
- Validates Node runtime version.
|
|
59
59
|
- Installs the configured OpenClaw version when `prepare` is used and versions
|
|
60
60
|
differ.
|
|
@@ -63,10 +63,14 @@ Behavior:
|
|
|
63
63
|
- Copies product agents into `openclaw/agents`.
|
|
64
64
|
- Copies product global skills into `openclaw/skills`.
|
|
65
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`.
|
|
66
69
|
- Updates `runtime-manifest.json` with product metadata.
|
|
67
70
|
|
|
68
|
-
`syncOnly: true` does not install a new OpenClaw version; it
|
|
69
|
-
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.
|
|
70
74
|
|
|
71
75
|
The desktop gateway startup calls `ensureOpenClawDoctorFixed()` before
|
|
72
76
|
launching OpenClaw. That check compares the embedded runtime version with a
|
package/dist/bin/wujie-shell.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
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 _0xe7c34b=_0x103d;(function(_0x3faeca,_0x2f0942){const _0x5c21a7=_0x103d,_0x1d73ea=_0x3faeca();while(!![]){try{const _0x9bb23f=-parseInt(_0x5c21a7(0x124))/0x1+parseInt(_0x5c21a7(0xbe))/0x2+parseInt(_0x5c21a7(0x128))/0x3*(-parseInt(_0x5c21a7(0x10c))/0x4)+parseInt(_0x5c21a7(0xb9))/0x5*(-parseInt(_0x5c21a7(0x118))/0x6)+-parseInt(_0x5c21a7(0xbf))/0x7+-parseInt(_0x5c21a7(0xa9))/0x8+parseInt(_0x5c21a7(0xaa))/0x9;if(_0x9bb23f===_0x2f0942)break;else _0x1d73ea['push'](_0x1d73ea['shift']());}catch(_0x3face7){_0x1d73ea['push'](_0x1d73ea['shift']());}}}(_0x1c58,0xcfbe7));import{randomBytes}from'node:crypto';import{existsSync,unwatchFile,watchFile}from'node:fs';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import _0x2ec80b,{portNumbers}from'get-port';import{ensureShellStateDirs,getConfigPaths,readJsonFile,writeJsonFile}from'@wujie-shell/config';import{asRecord,dedupeStrings,getTrimmedString,writeJson}from'./utils.mjs';function _0x103d(_0x851c37,_0x289eb4){_0x851c37=_0x851c37-0xa8;const _0x1c587e=_0x1c58();let _0x103d69=_0x1c587e[_0x851c37];return _0x103d69;}import{loadRuntimeInfo}from'./runtime.mjs';import{createRuntimeLogger,summarizeRuntimeManifest}from'./runtime-logger.mjs';import{syncRuntimeManifestPlugins}from'./plugin-sync.mjs';const MEMORY_CORE_PLUGIN_ID=_0xe7c34b(0x130)+_0xe7c34b(0xa8),ACTIVE_MEMORY_PLUGIN_ID=_0xe7c34b(0xc5)+'emory',ASK_USER_QUESTION_PLUGIN_ID=_0xe7c34b(0x10b)+_0xe7c34b(0x10d)+'n';function createToken(){const _0x179e8c=_0xe7c34b;return randomBytes(0x18)[_0x179e8c(0xae)](_0x179e8c(0x108));}function createProviderModelConfig(_0x27f22f,_0x2ad79a=![]){const _0x4b3df8=_0xe7c34b;return{'id':_0x27f22f,'name':_0x27f22f,'reasoning':!![],'input':_0x2ad79a?[_0x4b3df8(0x115),'image']:['text'],'cost':{'input':0x0,'output':0x0,'cacheRead':0x0,'cacheWrite':0x0},'contextWindow':0x3e800,'maxTokens':0x3e800};}function createProviderConfig(_0x1e3a5c){const _0xc7f7c=_0xe7c34b;return{'apiKey':_0x1e3a5c[_0xc7f7c(0xd8)],'api':_0x1e3a5c[_0xc7f7c(0x100)]===_0xc7f7c(0x127)+'c'?_0xc7f7c(0x127)+_0xc7f7c(0xd6)+'es':_0xc7f7c(0x103)+_0xc7f7c(0xb1)+'ns',..._0x1e3a5c[_0xc7f7c(0xe8)]?{'baseUrl':_0x1e3a5c[_0xc7f7c(0xe8)]}:{},'models':[createProviderModelConfig(_0x1e3a5c[_0xc7f7c(0xf0)+'e'])]};}function _0x1c58(){const _0x1d9da8=['tart','active-m','elPrimar','keys','filter','\x20config\x20','environm','provider','ange','model\x20co','product\x20','entries','self-ope','written','claw\x20con','mtimeMs','dels\x20upd','plugins\x20','c-messag','agents','apiKey','tarted','defaultM','ing','ated','missing;','config','isArray','configPa','config\x20s','auto','runtimeR','fig\x20chan','stateDir','runtime\x20','oot','baseUrl','created','Version','mode','info\x20loa','extraDir','last-goo','per-chan','modelNam','compat','\x20for\x20con','local','nfig\x20syn','ded\x20for\x20','fig','ConfigPa','skills','ready\x20cu','red','gatewayS','indexOf','openclaw','toISOStr','penclaw\x20','protocol','info','ensure\x20i','openai-c','onfig\x20ch','plugin\x20c','slice','imageMod','hex','her\x20obse','now','ask-user','689288ZMtqGp','-questio','allow','config\x20c','nto\x20open','memory','her\x20igno','nfig\x20alr','nitial\x20o','text','models','anged','3953370fqjZVw','merge','odel','load','stringif','aw\x20confi','projectR','rated\x20mo','idle','eUrl','g\x20writte','Key','1646854YkFlhG','error','d\x20opencl','anthropi','3QtULGk','reload\x20s','entityPa','deviceId','ile\x20watc','dmScope','\x20creatin','dataDir','memory-c','modelBas','yName','ailed','nChange','ore','10062760bpEAck','37340370vteTeM','defaults','rrent','ports','toString','config\x20f','manifest','ompletio','initial\x20','eady\x20cur','session','ync','primary','ttings\x20u','changed','5saeESN','persiste','length','plugins','nfig\x20upd','959662yKyaAM','293482yclsJU','ompleted','model','lastGood','ernal\x20ch'];_0x1c58=function(){return _0x1d9da8;};return _0x1c58();}function createRuntimePluginBootstrap(_0x35e1dd){const _0x353957=_0xe7c34b,_0xaf2c79={},_0x42a263=[];for(const _0x324397 of _0x35e1dd??[]){const _0xe13a3=getTrimmedString(_0x324397['pluginId']);if(!_0xe13a3)continue;_0xaf2c79[_0xe13a3]={'enabled':!![]},_0x42a263['push'](_0xe13a3);}return!_0xaf2c79[MEMORY_CORE_PLUGIN_ID]&&(_0xaf2c79[MEMORY_CORE_PLUGIN_ID]={'enabled':!![],'config':{'dreaming':{'enabled':!![]}}}),!_0xaf2c79[ACTIVE_MEMORY_PLUGIN_ID]&&(_0xaf2c79[ACTIVE_MEMORY_PLUGIN_ID]={'enabled':!![]}),{'entries':_0xaf2c79,'allow':dedupeStrings([..._0x42a263,MEMORY_CORE_PLUGIN_ID,ACTIVE_MEMORY_PLUGIN_ID]),'bundledDiscovery':_0x353957(0xf1)};}function createInitialOpenClawConfig(_0x1d4f2d,_0x52a088){const _0x478f6d=_0xe7c34b,_0x55df76=new Date()[_0x478f6d(0xfe)+_0x478f6d(0xdb)](),_0x257b0f=join(_0x1d4f2d[_0x478f6d(0x12f)],'workspac'+'e'),_0xce3ee4=asRecord(_0x1d4f2d[_0x478f6d(0x116)]),_0x5d225b=getTrimmedString(_0xce3ee4[_0x478f6d(0xda)+_0x478f6d(0x11a)]),_0x379a1d={'workspace':_0x257b0f,'memorySearch':{'enabled':!![],'sources':[_0x478f6d(0x111)],'provider':_0x478f6d(0xe2)},'compaction':{'memoryFlush':{'enabled':!![],'forceFlushTranscriptBytes':'256kb','softThresholdTokens':0x30d40}}};return _0x5d225b&&(_0x379a1d['model']={'primary':_0x5d225b}),{'meta':{'lastTouchedVersion':_0x52a088[_0x478f6d(0xfd)+_0x478f6d(0xea)],'lastTouchedAt':_0x55df76},'wizard':{'lastRunAt':_0x55df76,'lastRunVersion':_0x52a088['openclaw'+'Version'],'lastRunCommand':'onboard','lastRunMode':_0x478f6d(0xf3)},'models':{'mode':_0x478f6d(0x119),'providers':asRecord(_0xce3ee4[_0x478f6d(0xcb)+'s'])},'agents':{'defaults':_0x379a1d},'tools':{'profile':'full'},'plugins':createRuntimePluginBootstrap(_0x52a088[_0x478f6d(0xbc)]),'skills':{'load':{'extraDirs':[_0x478f6d(0xf8)]}},'session':{'dmScope':'per-chan'+'nel-peer','reset':{'mode':_0x478f6d(0x120)}}};}function hasMeaningfulProductModels(_0x59ba6e){const _0x2c8bc3=_0xe7c34b,_0xf46259=asRecord(_0x59ba6e[_0x2c8bc3(0x116)]);return Object[_0x2c8bc3(0xc7)](asRecord(_0xf46259[_0x2c8bc3(0xcb)+'s']))[_0x2c8bc3(0xbb)]>0x0||Boolean(getTrimmedString(_0xf46259['defaultM'+_0x2c8bc3(0x11a)]));}function summarizeOpenClawConfig(_0x475187){const _0x115ce9=_0xe7c34b,_0x42b527=asRecord(_0x475187['models']),_0x3d27bc=asRecord(_0x42b527[_0x115ce9(0xcb)+'s']),_0x2750d4=asRecord(_0x475187[_0x115ce9(0xd7)]),_0x587215=asRecord(_0x2750d4[_0x115ce9(0xab)]),_0x5d8047=asRecord(_0x587215['model']),_0x37bd3a=asRecord(_0x475187[_0x115ce9(0xbc)]),_0x47ae26=asRecord(_0x37bd3a['entries']),_0x5b3973=asRecord(_0x475187[_0x115ce9(0xf8)]),_0x2f747a=asRecord(_0x5b3973[_0x115ce9(0x11b)]),_0x1ed08d=asRecord(_0x475187[_0x115ce9(0xb4)]),_0x4d92de=Array[_0x115ce9(0xdf)](_0x2f747a[_0x115ce9(0xed)+'s'])?_0x2f747a[_0x115ce9(0xed)+'s']:[];return{'providerCount':Object[_0x115ce9(0xc7)](_0x3d27bc)['length'],'defaultModel':getTrimmedString(_0x5d8047[_0x115ce9(0xb6)]),'pluginEntryCount':Object[_0x115ce9(0xc7)](_0x47ae26)[_0x115ce9(0xbb)],'pluginAllowCount':Array[_0x115ce9(0xdf)](_0x37bd3a[_0x115ce9(0x10e)])?_0x37bd3a[_0x115ce9(0x10e)][_0x115ce9(0xbb)]:0x0,'skillExtraDirCount':_0x4d92de[_0x115ce9(0xbb)],'sessionDmScope':getTrimmedString(_0x1ed08d[_0x115ce9(0x12d)])};}function syncProductModels(_0x33a71a,_0x28825a){const _0x42fc71=_0xe7c34b;if(!hasMeaningfulProductModels(_0x28825a))return{'config':_0x33a71a,'changed':![]};let _0x20eb74=![];const _0x5022a0=asRecord(_0x28825a['models']),_0x2a4ff8=asRecord(_0x5022a0['provider'+'s']),_0x50b45c=getTrimmedString(_0x5022a0[_0x42fc71(0xda)+_0x42fc71(0x11a)]),_0x44aa94=asRecord(_0x33a71a[_0x42fc71(0x116)]),_0x3358ba=asRecord(_0x44aa94[_0x42fc71(0xcb)+'s']);for(const [_0x1e6800,_0x64610a]of Object[_0x42fc71(0xcf)](_0x2a4ff8)){const _0x1fdbb7=asRecord(_0x3358ba[_0x1e6800]),_0x1221d7=asRecord(_0x64610a);JSON['stringif'+'y'](_0x1fdbb7)!==JSON[_0x42fc71(0x11c)+'y'](_0x1221d7)&&(_0x3358ba[_0x1e6800]=_0x1221d7,_0x20eb74=!![]);}_0x44aa94[_0x42fc71(0xeb)]!==_0x42fc71(0x119)&&(_0x44aa94[_0x42fc71(0xeb)]=_0x42fc71(0x119),_0x20eb74=!![]);_0x44aa94[_0x42fc71(0xcb)+'s']!==_0x3358ba&&(_0x44aa94[_0x42fc71(0xcb)+'s']=_0x3358ba,_0x20eb74=!![]);_0x33a71a[_0x42fc71(0x116)]!==_0x44aa94&&(_0x33a71a[_0x42fc71(0x116)]=_0x44aa94,_0x20eb74=!![]);if(_0x50b45c){const _0x580307=asRecord(_0x33a71a[_0x42fc71(0xd7)]),_0x2be581=asRecord(_0x580307[_0x42fc71(0xab)]),_0x396511=asRecord(_0x2be581[_0x42fc71(0xc1)]);_0x396511[_0x42fc71(0xb6)]!==_0x50b45c&&(_0x2be581[_0x42fc71(0xc1)]={..._0x396511,'primary':_0x50b45c},_0x580307['defaults']=_0x2be581,_0x33a71a[_0x42fc71(0xd7)]=_0x580307,_0x20eb74=!![]);}return{'config':_0x33a71a,'changed':_0x20eb74};}export function createConfigController(_0x28e9e9){const _0x4e77e2=_0xe7c34b,_0x1c03f6=getConfigPaths(_0x28e9e9),_0x345183=createRuntimeLogger(_0x1c03f6,_0x4e77e2(0xde));let _0x34942d=![],_0x5c0ca1=0x0,_0x25d807=null,_0x7fde80=null;function _0x4dc29a(){const _0x386100=_0x4e77e2;return _0x1c03f6[_0x386100(0xe0)+'th'];}function _0x5dc681(){const _0x5e1b72=_0x4e77e2;return _0x1c03f6[_0x5e1b72(0xe5)];}function _0x405ae1(){const _0x6db0fe=_0x4e77e2;return _0x1c03f6[_0x6db0fe(0x12b)+_0x6db0fe(0x12a)+'th'];}async function _0x4bf6ae(){const _0x3a5398=_0x4e77e2;await ensureShellStateDirs(_0x28e9e9),process.env.OPENCLAW_STATE_DIR=_0x1c03f6[_0x3a5398(0xe5)],process.env.OPENCLAW_CONFIG_PATH=_0x1c03f6[_0x3a5398(0xe0)+'th'],_0x345183?.[_0x3a5398(0x101)]('openclaw'+_0x3a5398(0xc9)+_0x3a5398(0xca)+'ent\x20ensu'+_0x3a5398(0xfa),{'stateDir':_0x1c03f6[_0x3a5398(0xe5)],'configPath':_0x1c03f6['configPa'+'th'],'logsDir':_0x1c03f6['logsDir']});}async function _0x80cb40(){const _0x4eba1d=_0x4e77e2,_0x59c612=Date[_0x4eba1d(0x10a)]();_0x345183?.['info'](_0x4eba1d(0x102)+_0x4eba1d(0x114)+_0x4eba1d(0xff)+_0x4eba1d(0xe1)+_0x4eba1d(0xd9),{'configPath':_0x1c03f6[_0x4eba1d(0xe0)+'th'],'stateDir':_0x1c03f6[_0x4eba1d(0xe5)]});try{await _0x4bf6ae();const _0x116afb=await loadRuntimeInfo(_0x28e9e9[_0x4eba1d(0x11e)+_0x4eba1d(0xe7)]);_0x345183?.[_0x4eba1d(0x101)](_0x4eba1d(0xe6)+_0x4eba1d(0xec)+_0x4eba1d(0xf5)+_0x4eba1d(0xe1)+_0x4eba1d(0xb5),{'runtimeRoot':_0x116afb[_0x4eba1d(0xe3)+'oot'],'manifest':summarizeRuntimeManifest(_0x116afb[_0x4eba1d(0xb0)])});if(!existsSync(_0x1c03f6[_0x4eba1d(0xe0)+'th'])){const _0x2015de=createInitialOpenClawConfig(_0x28e9e9,_0x116afb);_0x345183?.['info'](_0x4eba1d(0xb2)+_0x4eba1d(0xfd)+_0x4eba1d(0xc9)+_0x4eba1d(0xdd)+_0x4eba1d(0x12e)+'g',{'configPath':_0x1c03f6[_0x4eba1d(0xe0)+'th'],'config':summarizeOpenClawConfig(_0x2015de)}),_0x359e29(),await _0x119139(_0x2015de,'initial\x20'+_0x4eba1d(0xfd)+'\x20config\x20'+_0x4eba1d(0xe9)),await writeJson(_0x1c03f6[_0x4eba1d(0xc2)+'ConfigPa'+'th'],_0x2015de),_0x345183?.[_0x4eba1d(0x101)]('last-goo'+_0x4eba1d(0x126)+_0x4eba1d(0x11d)+_0x4eba1d(0x122)+'n',{'path':_0x1c03f6[_0x4eba1d(0xc2)+_0x4eba1d(0xf7)+'th'],'reason':'initial\x20'+_0x4eba1d(0xfd)+_0x4eba1d(0xc9)+'created'});}else _0x345183?.['info'](_0x4eba1d(0xb2)+'openclaw'+'\x20config\x20'+'exists',{'configPath':_0x1c03f6[_0x4eba1d(0xe0)+'th']});await _0x3cb49d(),await _0x1afcbd(),_0x345183?.[_0x4eba1d(0x101)](_0x4eba1d(0x102)+_0x4eba1d(0x114)+_0x4eba1d(0xff)+_0x4eba1d(0x10f)+_0x4eba1d(0xc0),{'durationMs':Date[_0x4eba1d(0x10a)]()-_0x59c612});}catch(_0x1bbf59){_0x345183?.[_0x4eba1d(0x125)](_0x4eba1d(0x102)+_0x4eba1d(0x114)+_0x4eba1d(0xff)+_0x4eba1d(0xaf)+_0x4eba1d(0x133),{'durationMs':Date[_0x4eba1d(0x10a)]()-_0x59c612,'error':_0x1bbf59});throw _0x1bbf59;}}async function _0x15d653(){return await _0x80cb40(),readJsonFile(_0x1c03f6['configPa'+'th'],{});}async function _0x5f15b3(){const _0x2bfed7=_0x4e77e2;return readJsonFile(_0x1c03f6[_0x2bfed7(0xe0)+'th'],{});}async function _0x119139(_0x5683ff,_0x13457d=_0x4e77e2(0xfd)+_0x4e77e2(0xc9)+_0x4e77e2(0xd1)){const _0xd6e5b4=_0x4e77e2;await mkdir(dirname(_0x1c03f6[_0xd6e5b4(0xe0)+'th']),{'recursive':!![]}),await writeFile(_0x1c03f6[_0xd6e5b4(0xe0)+'th'],JSON[_0xd6e5b4(0x11c)+'y'](_0x5683ff,null,0x2)+'\x0a','utf8'),_0x345183?.['info'](_0x13457d,{'configPath':_0x1c03f6[_0xd6e5b4(0xe0)+'th'],'config':summarizeOpenClawConfig(_0x5683ff)});}async function _0x1afcbd(){const _0x446ab2=_0x4e77e2,_0x43a51f=await loadRuntimeInfo(_0x28e9e9[_0x446ab2(0x11e)+'oot']),_0x3ad17c=await _0x5f15b3(),_0x2468be=syncRuntimeManifestPlugins(_0x3ad17c[_0x446ab2(0xbc)],_0x43a51f[_0x446ab2(0xbc)]);_0x2468be['changed']||!_0x3ad17c[_0x446ab2(0xbc)]?(_0x3ad17c[_0x446ab2(0xbc)]=_0x2468be[_0x446ab2(0xbc)],_0x359e29(),await _0x119139(_0x3ad17c,'runtime\x20'+_0x446ab2(0xd5)+'synced\x20i'+_0x446ab2(0x110)+_0x446ab2(0xd2)+_0x446ab2(0xf6)),_0x345183?.[_0x446ab2(0x101)](_0x446ab2(0xe6)+_0x446ab2(0x105)+_0x446ab2(0x104)+_0x446ab2(0x117),{'runtimePluginCount':_0x43a51f[_0x446ab2(0xbc)][_0x446ab2(0xbb)],'config':summarizeOpenClawConfig(_0x3ad17c)})):_0x345183?.[_0x446ab2(0x101)](_0x446ab2(0xe6)+_0x446ab2(0x105)+'onfig\x20al'+_0x446ab2(0xf9)+_0x446ab2(0xac),{'runtimePluginCount':_0x43a51f['plugins'][_0x446ab2(0xbb)]});}async function _0x3cb49d(){const _0x108419=_0x4e77e2,_0xa5e177=await _0x5f15b3(),_0x15cbc1=syncProductModels(_0xa5e177,_0x28e9e9);_0x15cbc1[_0x108419(0xb8)]?(await _0x4dd52c(_0x15cbc1[_0x108419(0xde)],_0x108419(0xce)+'model\x20co'+_0x108419(0xbd)+_0x108419(0xdc)),_0x345183?.[_0x108419(0x101)](_0x108419(0xce)+_0x108419(0xcd)+_0x108419(0xf4)+'ced',{'config':summarizeOpenClawConfig(_0x15cbc1['config'])})):_0x345183?.[_0x108419(0x101)](_0x108419(0xce)+'model\x20co'+_0x108419(0x113)+_0x108419(0xb3)+'rent',{'hasProductModels':hasMeaningfulProductModels(_0x28e9e9)});}async function _0x44acab(){const _0x3cd4c3=_0x4e77e2;await _0x80cb40();const _0x19394b=await _0x2ec80b({'port':portNumbers(_0x28e9e9[_0x3cd4c3(0xad)]['gatewayS'+_0x3cd4c3(0xc4)],_0x28e9e9[_0x3cd4c3(0xad)][_0x3cd4c3(0xfb)+_0x3cd4c3(0xc4)]+0x63)});return{'token':createToken(),'port':_0x19394b};}async function _0x2c6883(){const _0x2f08c4=_0x4e77e2,_0x2a2482=await _0x15d653(),_0x175000=asRecord(_0x2a2482['agents']),_0x128bcf=asRecord(_0x175000[_0x2f08c4(0xab)]),_0x4f9e2f=asRecord(_0x128bcf['model']),_0x5e381d=getTrimmedString(_0x4f9e2f[_0x2f08c4(0xb6)]),_0x422526=_0x5e381d[_0x2f08c4(0xfc)]('/'),_0x1819a3=_0x422526>0x0?_0x5e381d[_0x2f08c4(0x106)](0x0,_0x422526):_0x5e381d,_0x407450=_0x422526>0x0?_0x5e381d[_0x2f08c4(0x106)](_0x422526+0x1):'',_0x3cdb1b=asRecord(asRecord(_0x2a2482['models'])['provider'+'s']),_0x35d8a3=asRecord(_0x3cdb1b[_0x1819a3]);return{'provider':_0x1819a3||'','apiKey':getTrimmedString(_0x35d8a3['apiKey']),'modelName':_0x407450,'modelBaseUrl':getTrimmedString(_0x35d8a3[_0x2f08c4(0xe8)])};}async function _0x35bf70(_0x1b0e04,_0x4e758d={}){const _0x43efdd=_0x4e77e2,_0x222df9=await _0x15d653(),_0x2b0695=_0x1b0e04[_0x43efdd(0xcb)]||'default',_0x86f1ab=_0x2b0695+'/'+_0x1b0e04[_0x43efdd(0xf0)+'e'],_0x37dfb9=asRecord(_0x222df9['models']),_0x437824=asRecord(_0x37dfb9[_0x43efdd(0xcb)+'s']);_0x437824[_0x2b0695]={...asRecord(_0x437824[_0x2b0695]),...createProviderConfig({'apiKey':_0x1b0e04[_0x43efdd(0xd8)]||'','protocol':_0x1b0e04[_0x43efdd(0x100)]||'openai','baseUrl':_0x1b0e04[_0x43efdd(0x131)+_0x43efdd(0x121)]||_0x1b0e04['baseUrl']||'','modelName':_0x1b0e04[_0x43efdd(0xf0)+'e']})},_0x37dfb9['provider'+'s']=_0x437824,_0x222df9[_0x43efdd(0x116)]=_0x37dfb9;const _0x355907=asRecord(_0x222df9[_0x43efdd(0xd7)]),_0x2f346e=asRecord(_0x355907[_0x43efdd(0xab)]);return _0x2f346e[_0x43efdd(0xc1)]={...asRecord(_0x2f346e[_0x43efdd(0xc1)]),'primary':_0x86f1ab},_0x2f346e[_0x43efdd(0x116)]={...asRecord(_0x2f346e['models']),[_0x86f1ab]:asRecord(asRecord(_0x2f346e[_0x43efdd(0x116)])[_0x86f1ab])},_0x355907[_0x43efdd(0xab)]=_0x2f346e,_0x222df9[_0x43efdd(0xd7)]=_0x355907,_0x222df9[_0x43efdd(0xb4)]={...asRecord(_0x222df9[_0x43efdd(0xb4)]),'dmScope':_0x43efdd(0xef)+'nel-peer'},await _0x4dd52c(_0x222df9,_0x4e758d['restartO'+_0x43efdd(0x134)]?'model\x20se'+_0x43efdd(0xb7)+'pdated':''),{'ok':!![]};}async function _0x2bdf03(_0x5bcaa0){const _0x5cfa4d=_0x4e77e2,_0x27d9fb=await _0x15d653(),_0x10f64b=_0x5bcaa0[_0x5cfa4d(0xcb)+_0x5cfa4d(0x123)],_0x4800e8=asRecord(_0x27d9fb[_0x5cfa4d(0x116)]),_0x30e72a=asRecord(_0x4800e8[_0x5cfa4d(0xcb)+'s']);_0x30e72a[_0x10f64b]={...asRecord(_0x30e72a[_0x10f64b]),'apiKey':_0x5bcaa0[_0x5cfa4d(0xd8)],'api':_0x5cfa4d(0x103)+_0x5cfa4d(0xb1)+'ns','baseUrl':_0x5bcaa0['baseUrl'],'models':(_0x5bcaa0[_0x5cfa4d(0xf0)+'es']??[])['map'](_0x4ed84a=>createProviderModelConfig(_0x4ed84a,_0x4ed84a===_0x5bcaa0[_0x5cfa4d(0x107)+'elPrimar'+_0x5cfa4d(0x132)]))},_0x4800e8[_0x5cfa4d(0xcb)+'s']=_0x30e72a,_0x27d9fb[_0x5cfa4d(0x116)]=_0x4800e8;if(_0x5bcaa0[_0x5cfa4d(0x107)+_0x5cfa4d(0xc6)+_0x5cfa4d(0x132)]){const _0x457331=asRecord(_0x27d9fb[_0x5cfa4d(0xd7)]),_0x4764e3=asRecord(_0x457331['defaults']);_0x4764e3[_0x5cfa4d(0x107)+'el']={...asRecord(_0x4764e3[_0x5cfa4d(0x107)+'el']),'primary':_0x10f64b+'/'+_0x5bcaa0['imageMod'+_0x5cfa4d(0xc6)+_0x5cfa4d(0x132)]},_0x457331[_0x5cfa4d(0xab)]=_0x4764e3,_0x27d9fb[_0x5cfa4d(0xd7)]=_0x457331;}return await _0x4dd52c(_0x27d9fb,_0x5cfa4d(0xd0)+_0x5cfa4d(0x11f)+_0x5cfa4d(0xd4)+_0x5cfa4d(0xdc)),{'ok':!![]};}async function _0x22ccdd({callbackUrl:_0x50201f,secret:_0x2dc680}){const _0x2e8819=_0x4e77e2,_0x5a5210=await _0x15d653(),_0x291930=asRecord(_0x5a5210[_0x2e8819(0xbc)]),_0x2cd16a=asRecord(_0x291930[_0x2e8819(0xcf)]),_0x1edda4=asRecord(_0x2cd16a[ASK_USER_QUESTION_PLUGIN_ID]);return _0x2cd16a[ASK_USER_QUESTION_PLUGIN_ID]={..._0x1edda4,'enabled':!![],'config':{...asRecord(_0x1edda4[_0x2e8819(0xde)]),'callbackUrl':_0x50201f,'secret':_0x2dc680}},_0x291930[_0x2e8819(0xcf)]=_0x2cd16a,_0x291930[_0x2e8819(0x10e)]=dedupeStrings([...(Array[_0x2e8819(0xdf)](_0x291930['allow'])?_0x291930[_0x2e8819(0x10e)]:[])[_0x2e8819(0xc8)](Boolean),ASK_USER_QUESTION_PLUGIN_ID]),_0x5a5210[_0x2e8819(0xbc)]=_0x291930,await _0x4dd52c(_0x5a5210,''),{'ok':!![]};}async function _0x4dd52c(_0x9f99b2,_0x126004=''){const _0x1ae5b8=_0x4e77e2;_0x359e29(),await _0x119139(_0x9f99b2,_0x126004||_0x1ae5b8(0xfd)+_0x1ae5b8(0xc9)+_0x1ae5b8(0xba)+'d'),await writeJsonFile(_0x1c03f6[_0x1ae5b8(0xc2)+_0x1ae5b8(0xf7)+'th'],_0x9f99b2),_0x345183?.[_0x1ae5b8(0x101)](_0x1ae5b8(0xee)+'d\x20opencl'+_0x1ae5b8(0x11d)+_0x1ae5b8(0x122)+'n',{'path':_0x1c03f6[_0x1ae5b8(0xc2)+_0x1ae5b8(0xf7)+'th'],'reason':_0x126004||_0x1ae5b8(0xfd)+'\x20config\x20'+'persiste'+'d'});if(_0x126004)_0x2fbc22(_0x126004);}function _0x359e29(){if(_0x34942d)_0x5c0ca1+=0x1;}function _0xdbce9f(_0x3c28ea){_0x7fde80=_0x3c28ea;}function _0x2fbc22(_0x4ac04b){const _0x550c8f=_0x4e77e2;if(!_0x7fde80)return;if(_0x25d807)clearTimeout(_0x25d807);_0x345183?.[_0x550c8f(0x101)]('gateway\x20'+_0x550c8f(0x129)+'cheduled'+_0x550c8f(0xf2)+_0x550c8f(0xe4)+'ge',{'reason':_0x4ac04b,'debounceMs':0xfa}),_0x25d807=setTimeout(()=>_0x7fde80(_0x4ac04b),0xfa);}function _0x1a1cac(){const _0x1f1eea=_0x4e77e2;unwatchFile(_0x1c03f6[_0x1f1eea(0xe0)+'th']),_0x34942d=!![],watchFile(_0x1c03f6[_0x1f1eea(0xe0)+'th'],{'interval':0x3e8},(_0x2b7cd0,_0x1ec52b)=>{const _0x2aa322=_0x1f1eea;if(_0x2b7cd0[_0x2aa322(0xd3)]===_0x1ec52b[_0x2aa322(0xd3)])return;if(_0x5c0ca1>0x0){_0x5c0ca1-=0x1,_0x345183?.[_0x2aa322(0x101)](_0x2aa322(0xaf)+'ile\x20watc'+_0x2aa322(0x112)+'red\x20inte'+'rnal\x20wri'+'te',{'configPath':_0x1c03f6[_0x2aa322(0xe0)+'th'],'ignoredConfigWatchReloads':_0x5c0ca1});return;}_0x345183?.[_0x2aa322(0x101)]('config\x20f'+_0x2aa322(0x12c)+_0x2aa322(0x109)+'rved\x20ext'+_0x2aa322(0xc3)+_0x2aa322(0xcc),{'configPath':_0x1c03f6['configPa'+'th']}),_0x2fbc22(_0x2aa322(0x10f)+'hange');});}function _0x26ee04(){const _0x2cd109=_0x4e77e2;if(_0x25d807)clearTimeout(_0x25d807);unwatchFile(_0x1c03f6[_0x2cd109(0xe0)+'th']),_0x34942d=![],_0x5c0ca1=0x0;}return{'paths':_0x1c03f6,'resolveConfigPath':_0x4dc29a,'resolveStateDir':_0x5dc681,'resolveDeviceIdentityPath':_0x405ae1,'ensureConfigPathEnv':_0x4bf6ae,'ensureInitialConfig':_0x80cb40,'ensureGatewaySettings':_0x44acab,'readConfig':_0x15d653,'writeConfig':_0x119139,'syncRuntimePlugins':_0x1afcbd,'getModelSettings':_0x2c6883,'setModelSettings':_0x35bf70,'setSelfOperatedModels':_0x2bdf03,'ensureAskUserQuestionPluginConfig':_0x22ccdd,'markConfigWriteHandledInternally':_0x359e29,'setGatewayRestartHandler':_0xdbce9f,'watchConfigChanges':_0x1a1cac,'dispose':_0x26ee04};}
|
|
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 _0x11c6d2=_0x157e;(function(_0x6b399f,_0x5b7512){const _0x3e7b3b=_0x157e,_0x50c757=_0x6b399f();while(!![]){try{const _0x24c241=-parseInt(_0x3e7b3b(0x17f))/0x1*(parseInt(_0x3e7b3b(0x13c))/0x2)+-parseInt(_0x3e7b3b(0x15f))/0x3+parseInt(_0x3e7b3b(0x141))/0x4*(-parseInt(_0x3e7b3b(0x149))/0x5)+parseInt(_0x3e7b3b(0xc5))/0x6*(parseInt(_0x3e7b3b(0x1bc))/0x7)+parseInt(_0x3e7b3b(0x18a))/0x8*(parseInt(_0x3e7b3b(0x142))/0x9)+parseInt(_0x3e7b3b(0x18c))/0xa*(-parseInt(_0x3e7b3b(0x129))/0xb)+parseInt(_0x3e7b3b(0x1ac))/0xc;if(_0x24c241===_0x5b7512)break;else _0x50c757['push'](_0x50c757['shift']());}catch(_0x10dc71){_0x50c757['push'](_0x50c757['shift']());}}}(_0x5628,0x2614b));import _0x5b0c5b from'electron';import{fileURLToPath}from'node:url';import{dirname,join,resolve}from'node:path';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,'preload.'+_0x11c6d2(0x11c)),{app,BrowserWindow,dialog,globalShortcut,ipcMain,shell}=_0x5b0c5b,DEVTOOLS_ACCELERATOR=_0x11c6d2(0x160)+_0x11c6d2(0xe8)+'+Shift+I';let mainWindow=null,shellConfig=null,configController=null,gatewayController=null,bootError=null,mainLogger=null,ipcLogger=null,filesLogger=null,rendererLogger=null;function getMode(){const _0x1ddf78=_0x11c6d2;return process.env.VITE_DEV_SERVER_URL?'dev':_0x1ddf78(0x18b);}function resolveProjectRoot(){const _0x393f68=_0x11c6d2;return resolve(process.env.WUJIE_SHELL_PROJECT_ROOT||process[_0x393f68(0xbf)]());}function broadcast(_0x46d8f9,_0x2658c9){const _0x7978f6=_0x11c6d2;for(const _0x3a12ee of BrowserWindow['getAllWi'+'ndows']()){!_0x3a12ee[_0x7978f6(0x17b)+'nts'][_0x7978f6(0x1b1)+_0x7978f6(0xfa)]()&&_0x3a12ee[_0x7978f6(0x17b)+_0x7978f6(0xb4)][_0x7978f6(0x139)]('wujie-sh'+_0x7978f6(0xbd)+'t',{'name':_0x46d8f9,'payload':_0x2658c9});}}function openDevToolsForActiveContext(){const _0xd2dffc=_0x11c6d2,_0x48530c=BrowserWindow['getFocus'+'edWindow']()||mainWindow;if(!_0x48530c||_0x48530c[_0xd2dffc(0x1b1)+_0xd2dffc(0xfa)]())return{'ok':![]};return _0x48530c[_0xd2dffc(0x17b)+'nts']['openDevT'+_0xd2dffc(0x1ba)]({'mode':_0xd2dffc(0x119)}),_0x48530c[_0xd2dffc(0x17b)+'nts'][_0xd2dffc(0x139)](_0xd2dffc(0x192)+_0xd2dffc(0xbd)+'t',{'name':_0xd2dffc(0x177)+_0xd2dffc(0x175)+'t','payload':{'accelerator':DEVTOOLS_ACCELERATOR}}),{'ok':!![]};}function registerShellShortcuts(){const _0xbdfed1=_0x11c6d2;globalShortcut['unregist'+'er'](DEVTOOLS_ACCELERATOR);const _0x57a558=globalShortcut[_0xbdfed1(0xee)](DEVTOOLS_ACCELERATOR,openDevToolsForActiveContext);!_0x57a558&&console['warn'](_0xbdfed1(0x12f)+_0xbdfed1(0xf2)+_0xbdfed1(0x1c2)+_0xbdfed1(0xee)+'\x20shortcu'+_0xbdfed1(0x1a6)+DEVTOOLS_ACCELERATOR);}function _0x5628(){const _0x384f69=['isDestro','setName','default','file\x20rea','\x20main\x20bo','logs:ope','openExte',':delete','workspac','ools','info','28tivHVk','files:re','platform','ned-keys','window:m','elected-','iled\x20to\x20','logs',':runtime','title','window-a','sessions','leted','dKeys','uncaught','chat','level','before\x20q','ModelId','select\x20d','ot\x20compl','operated','nts','cron:lis','\x20gone','l\x20reques','pdate','utf8','est\x20star','ipc\x20requ','filePath','ell:even','boot\x20ele','cwd','session-','Dialog','pdated','dels','shared-c','397932GKBbmq','main','catch','create','ctory','-once','settings','ontext','projectR','delete','openDevT','skills','darwin','canceled','models','dRejecti','set','ontents','files:se','then','context','peratedM','fromWebC','ate','logs\x20dir','ot\x20initi',':pinned-','map','e:write-','rocess-g','-logs','ory\x20open','file\x20wri','n-direct','yInfo','rControl','chat:his','getStatu','tatus','stop','minimize','register','ite','skills:s','getVersi','hell]\x20fa','-info','senderFr','keys',':gateway','paths','url','openclaw','yed','showOpen','openFile','main\x20win','pened','ocess-go','from','ent','e\x20comple','d\x20reject','renderer','ile\x20read','config:r','\x20complet','child-pr','status','stopped\x20','chrome','versions','close','ist','size','loadFile','cron','ipc','app:open','ell\x20gate','ask-user','eam-even','meta','preventD','detach','unhandle','trim','mjs','dow\x20load','ll-close','ndows','filters','et-self-','director','uit:\x20sto','dist','ted','gateway\x20','model-id','abort','143AKGSoj','files:wr','uit','cron:run','sender','efault','[wujie-s','ectory\x20o','\x20request','ell\x20boot','-context','ectory','ngs','handle','isArray','#f8fafc','send','restart','length','22UxrwHp','dataDir','string','error','ite-bina','4RulORQ','14031gqPDDH','rename','object','ile\x20comp','getRecen','setPinne','chat-str','501305seInHw','chat:abo','ile\x20writ','log','limit','answerAs','node','app:info','one','quit','open\x20ext','cron:upd','\x20failed:','nstall','logs:wri','orted',':answer-','byteLeng','-questio','finally','message','logs\x20exp','442539Dhpduu','CommandO','binary\x20f','nfo','writeSha','electron','sharedCo','runOnce','agents:l','now',':rename','agents','productN',':create','targetDi','whenRead','d\x20failed','kUserQue','\x20process','update','index.ht','ame','-shortcu','d\x20comple','devtools','logs:exp','ocess\x20go','ections','webConte','content','-status','irectory','12057YTlZmT','ot\x20faile','logsDir','runtimeI','path','alized','unmaximi','models:s','ximize','\x20main\x20wi','ory-info','536wpPyiX','prod','26790CTrjgo','skills:u','oggle-ma','cron:log','zed','ot\x20start','wujie-sh','eted','rnal','oot','pen-devt','will-qui','ndow','ustom-mo','est\x20fail','Exceptio','lect-dir','agent-ev','multiSel','ad-binar','setSetti','list','configPa','skills:i','arch','activate','t:\x20','openPath','gateway-','\x20excepti','isMaximi','e:open-d','2417592OomniL','est\x20comp','pinnedKe','setSelfO','ernal\x20ur'];_0x5628=function(){return _0x384f69;};return _0x5628();}function _0x157e(_0x403492,_0x9bc099){_0x403492=_0x403492-0xad;const _0x56284f=_0x5628();let _0x157ec4=_0x56284f[_0x403492];return _0x157ec4;}async function createWindow(){const _0x50a997=_0x11c6d2,_0x4249d1=process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x50a997(0xcd)+_0x50a997(0x195)],_0x50a997(0x124),_0x50a997(0x173)+'ml');mainLogger?.['info']('creating'+_0x50a997(0x188)+_0x50a997(0x198),{'rendererUrl':_0x4249d1,'mode':getMode()}),mainWindow=new BrowserWindow({'width':0x49c,'height':0x30c,'minWidth':0x384,'minHeight':0x26c,'title':shellConfig[_0x50a997(0x16b)+_0x50a997(0x174)],'backgroundColor':_0x50a997(0x138),'titleBarStyle':process[_0x50a997(0x1be)]===_0x50a997(0xd1)?'hiddenIn'+_0x50a997(0xd5):_0x50a997(0x1b3),'webPreferences':{'preload':preloadPath,'contextIsolation':!![],'nodeIntegration':![],'sandbox':![]}});const _0x481148=process.env.VITE_DEV_SERVER_URL;_0x481148?(await mainWindow['loadURL'](_0x481148),process.env.WUJIE_SHELL_OPEN_DEVTOOLS==='1'&&mainWindow[_0x50a997(0x17b)+_0x50a997(0xb4)][_0x50a997(0xcf)+_0x50a997(0x1ba)]({'mode':_0x50a997(0x119)})):await mainWindow[_0x50a997(0x110)](join(shellConfig[_0x50a997(0xcd)+_0x50a997(0x195)],'dist','index.ht'+'ml')),mainLogger?.['info'](_0x50a997(0xfd)+_0x50a997(0x11d)+'ed',{'rendererUrl':_0x4249d1,'mode':getMode()});}function installIpcHandlers(){const _0xeea2b7=_0x11c6d2,_0x289766=(_0x2c745e,_0x5b1410)=>{const _0x33d20e=_0x157e;ipcMain[_0x33d20e(0x136)](_0x2c745e,async(_0x1555af,_0x401e0a)=>{const _0x1c45fb=_0x33d20e,_0x3969d3=Date[_0x1c45fb(0x168)](),_0x571c21=_0x1555af[_0x1c45fb(0xf4)+_0x1c45fb(0x174)]?.[_0x1c45fb(0xf8)]||_0x1555af[_0x1c45fb(0x12d)]['getURL']();ipcLogger?.[_0x1c45fb(0x1bb)](_0x1c45fb(0xbb)+_0x1c45fb(0xba)+_0x1c45fb(0x125),{'channel':_0x2c745e,'senderUrl':_0x571c21,'payload':summarizePayload(_0x401e0a)});try{const _0x57c1d4=await _0x5b1410(_0x1555af,_0x401e0a);return ipcLogger?.[_0x1c45fb(0x1bb)](_0x1c45fb(0xbb)+_0x1c45fb(0x1ad)+'leted',{'channel':_0x2c745e,'durationMs':Date[_0x1c45fb(0x168)]()-_0x3969d3,'result':summarizePayload(_0x57c1d4,{'maxDepth':0x2})}),_0x57c1d4;}catch(_0x171def){ipcLogger?.[_0x1c45fb(0x13f)]('ipc\x20requ'+_0x1c45fb(0x19a)+'ed',{'channel':_0x2c745e,'durationMs':Date[_0x1c45fb(0x168)]()-_0x3969d3,'error':summarizeError(_0x171def)});throw _0x171def;}});},_0x241966=()=>{const _0x53bcd1=_0x157e;if(!gatewayController)throw new Error(bootError?_0x53bcd1(0x192)+_0x53bcd1(0x132)+_0x53bcd1(0x155)+'\x20'+bootError:'wujie-sh'+_0x53bcd1(0x114)+'way\x20is\x20n'+_0x53bcd1(0xde)+_0x53bcd1(0x184));return gatewayController;};_0x289766(_0xeea2b7(0x150),async()=>({'name':shellConfig[_0xeea2b7(0x16b)+_0xeea2b7(0x174)],'version':app[_0xeea2b7(0xf1)+'on'](),'appId':shellConfig['appId'],'dataDir':shellConfig[_0xeea2b7(0x13d)]})),_0x289766(_0xeea2b7(0x113)+'-url',async(_0x8e03b0,_0x8da761)=>{const _0x3e7cb9=_0xeea2b7,_0x2a8738=typeof _0x8da761===_0x3e7cb9(0x13e)?_0x8da761:'';if(!_0x2a8738)return{'ok':![]};return filesLogger?.['info'](_0x3e7cb9(0x153)+_0x3e7cb9(0x1b0)+_0x3e7cb9(0xb7)+_0x3e7cb9(0x125),{'url':summarizeText(_0x2a8738,0xa0)}),await shell[_0x3e7cb9(0x1b7)+_0x3e7cb9(0x194)](_0x2a8738),{'ok':!![]};}),_0x289766(_0xeea2b7(0x1c0)+'inimize',_0x52b5e6=>{const _0x275c39=_0xeea2b7;return BrowserWindow[_0x275c39(0xdb)+_0x275c39(0xd6)](_0x52b5e6[_0x275c39(0x12d)])?.[_0x275c39(0xed)](),{'ok':!![]};}),_0x289766('window:t'+_0xeea2b7(0x18e)+_0xeea2b7(0x187),_0x55394e=>{const _0x55bc97=_0xeea2b7,_0x2751b4=BrowserWindow[_0x55bc97(0xdb)+'ontents'](_0x55394e['sender']);if(!_0x2751b4)return{'isMaximized':![]};if(_0x2751b4[_0x55bc97(0x1aa)+_0x55bc97(0x190)]())_0x2751b4[_0x55bc97(0x185)+'ze']();else _0x2751b4['maximize']();return{'isMaximized':_0x2751b4[_0x55bc97(0x1aa)+'zed']()};}),_0x289766('window:c'+'lose',_0x1a9b5a=>{const _0x2b8aeb=_0xeea2b7;return BrowserWindow[_0x2b8aeb(0xdb)+'ontents'](_0x1a9b5a[_0x2b8aeb(0x12d)])?.[_0x2b8aeb(0x10d)](),{'ok':!![]};}),_0x289766('window:o'+_0xeea2b7(0x196)+_0xeea2b7(0x1ba),()=>openDevToolsForActiveContext()),_0x289766(_0xeea2b7(0xf9)+_0xeea2b7(0x1c4)+_0xeea2b7(0xf3),()=>_0x241966()[_0xeea2b7(0x182)+_0xeea2b7(0x162)]()),_0x289766('openclaw'+_0xeea2b7(0xf6)+_0xeea2b7(0x17d),()=>_0x241966()[_0xeea2b7(0xea)+'s']()),_0x289766(_0xeea2b7(0xf9)+_0xeea2b7(0xf6)+'-restart',()=>_0x241966()[_0xeea2b7(0x13a)](_0xeea2b7(0x104)+_0xeea2b7(0x131))),_0x289766(_0xeea2b7(0xf9)+_0xeea2b7(0xf6)+_0xeea2b7(0xe3),(_0x4eb199,_0x39d804={})=>_0x241966()[_0xeea2b7(0x146)+'tLogs'](_0x39d804?.[_0xeea2b7(0x14d)]??0xc8)),_0x289766('openclaw'+_0xeea2b7(0x159)+_0xeea2b7(0x115)+_0xeea2b7(0x15b)+'n',(_0x4e33ea,_0x7a48a8)=>_0x241966()[_0xeea2b7(0x14e)+_0xeea2b7(0x170)+'stion'](_0x7a48a8)),_0x289766(_0xeea2b7(0x167)+_0xeea2b7(0x10e),()=>_0x241966()[_0xeea2b7(0x16a)][_0xeea2b7(0x1a1)]()),_0x289766(_0xeea2b7(0xf0)+_0xeea2b7(0xeb),(_0x4a6ea9,_0xf28179)=>_0x241966()[_0xeea2b7(0xd0)][_0xeea2b7(0x109)](_0xf28179)),_0x289766(_0xeea2b7(0x1c7)+_0xeea2b7(0x16c),(_0x2c30b2,_0x841407)=>_0x241966()[_0xeea2b7(0x1c7)]['create'](_0x841407)),_0x289766(_0xeea2b7(0x1c7)+':list',(_0x232374,_0x24fe31)=>_0x241966()[_0xeea2b7(0x1c7)][_0xeea2b7(0x1a1)](_0x24fe31)),_0x289766(_0xeea2b7(0x1c7)+_0xeea2b7(0x1b8),(_0x5ef2ea,_0x37e87d)=>_0x241966()[_0xeea2b7(0x1c7)][_0xeea2b7(0xce)](_0x37e87d)),_0x289766('chat:str'+'eam',(_0x5a181b,_0x1befb1)=>_0x241966()[_0xeea2b7(0xad)]['stream'](_0x1befb1)),_0x289766(_0xeea2b7(0x14a)+'rt',(_0x55f8c7,_0x57c65f)=>_0x241966()[_0xeea2b7(0xad)][_0xeea2b7(0x128)](_0x57c65f)),_0x289766(_0xeea2b7(0xe9)+'tory',(_0x19fb18,_0x34af9c)=>_0x241966()[_0xeea2b7(0xad)]['history'](_0x34af9c)),_0x289766(_0xeea2b7(0x157)+'te',async(_0x262478,_0x395a19={})=>{const _0x4e586e=_0xeea2b7,_0x40c664=typeof _0x395a19[_0x4e586e(0xae)]===_0x4e586e(0x13e)?_0x395a19[_0x4e586e(0xae)]:_0x4e586e(0x1bb),_0x1261c4=typeof _0x395a19[_0x4e586e(0x15d)]===_0x4e586e(0x13e)?_0x395a19[_0x4e586e(0x15d)]:_0x4e586e(0x104)+'\x20log',_0x1e6dba=typeof _0x395a19[_0x4e586e(0xd9)]===_0x4e586e(0x13e)&&_0x395a19['context']['trim']()?_0x4e586e(0x104)+':'+_0x395a19[_0x4e586e(0xd9)][_0x4e586e(0x11b)]():'renderer',_0x5db850=_0x395a19[_0x4e586e(0x117)]&&typeof _0x395a19[_0x4e586e(0x117)]===_0x4e586e(0x144)?summarizePayload(_0x395a19[_0x4e586e(0x117)]):undefined,_0x1fb61a=rendererLogger;if(_0x1fb61a?.[_0x40c664])await _0x1fb61a[_0x40c664](_0x1261c4,_0x5db850);else await _0x1fb61a?.[_0x4e586e(0x1bb)](_0x1261c4,_0x5db850);return{'ok':!![]};}),_0x289766(_0xeea2b7(0x178)+'ort',async(_0x584a40,_0x32837e={})=>{const _0x478f16=_0xeea2b7,_0x313bef=typeof _0x32837e[_0x478f16(0x16d)+'r']===_0x478f16(0x13e)&&_0x32837e['targetDi'+'r']['trim']()?_0x32837e[_0x478f16(0x16d)+'r']:undefined,_0x309805=await exportLogsArchive({'logsDir':configController[_0x478f16(0xf7)][_0x478f16(0x181)],'targetDir':_0x313bef,'appVersion':app[_0x478f16(0xf1)+'on']()});return mainLogger?.[_0x478f16(0x1bb)](_0x478f16(0x15e)+_0x478f16(0x158),{'path':toHomePath(_0x309805['path'])}),_0x309805;}),_0x289766(_0xeea2b7(0x1b6)+_0xeea2b7(0xe6)+'ory',async()=>{const _0x1e6032=_0xeea2b7;return await shell[_0x1e6032(0x1a7)](configController[_0x1e6032(0xf7)][_0x1e6032(0x181)]),mainLogger?.[_0x1e6032(0x1bb)](_0x1e6032(0xdd)+_0x1e6032(0x130)+_0x1e6032(0xfe),{'logsDir':toHomePath(configController[_0x1e6032(0xf7)][_0x1e6032(0x181)])}),{'ok':!![],'path':configController[_0x1e6032(0xf7)][_0x1e6032(0x181)]};}),_0x289766('files:re'+'ad',async(_0x4cfa3e,_0x57f842)=>{const _0x50e621=_0xeea2b7,_0x4b38cb=Date[_0x50e621(0x168)]();try{const _0x2a8ddb=await readFile(_0x57f842,_0x50e621(0xb9));return filesLogger?.[_0x50e621(0x1bb)](_0x50e621(0x1b4)+_0x50e621(0x176)+_0x50e621(0x125),{'path':toHomePath(_0x57f842),'bytes':Buffer[_0x50e621(0x15a)+'th'](_0x2a8ddb),'durationMs':Date['now']()-_0x4b38cb}),_0x2a8ddb;}catch(_0x38d1c4){filesLogger?.[_0x50e621(0x13f)](_0x50e621(0x1b4)+_0x50e621(0x16f),{'path':toHomePath(_0x57f842),'durationMs':Date[_0x50e621(0x168)]()-_0x4b38cb,'error':summarizeError(_0x38d1c4)});throw _0x38d1c4;}}),_0x289766(_0xeea2b7(0x1bd)+_0xeea2b7(0x19f)+'y',async(_0x3478fd,_0x3914f5)=>{const _0x1c323e=_0xeea2b7,_0xfc3132=Date['now']();try{const _0x4f0518=await readFile(_0x3914f5);return filesLogger?.['info']('binary\x20f'+_0x1c323e(0x105)+_0x1c323e(0x107)+'ed',{'path':toHomePath(_0x3914f5),'bytes':_0x4f0518[_0x1c323e(0x15a)+'th'],'durationMs':Date[_0x1c323e(0x168)]()-_0xfc3132}),new Uint8Array(_0x4f0518);}catch(_0x29275d){filesLogger?.[_0x1c323e(0x13f)](_0x1c323e(0x161)+_0x1c323e(0x105)+'\x20failed',{'path':toHomePath(_0x3914f5),'durationMs':Date[_0x1c323e(0x168)]()-_0xfc3132,'error':summarizeError(_0x29275d)});throw _0x29275d;}}),_0x289766(_0xeea2b7(0x12a)+_0xeea2b7(0xef),async(_0x225937,_0x465dc1={})=>{const _0x381b96=_0xeea2b7,_0x26594f=Date[_0x381b96(0x168)]();return await writeFile(_0x465dc1[_0x381b96(0x183)],_0x465dc1[_0x381b96(0x17c)]??'',_0x381b96(0xb9)),filesLogger?.[_0x381b96(0x1bb)](_0x381b96(0xe5)+'te\x20compl'+_0x381b96(0x193),{'path':toHomePath(_0x465dc1[_0x381b96(0x183)]),'bytes':Buffer[_0x381b96(0x15a)+'th'](String(_0x465dc1[_0x381b96(0x17c)]??'')),'durationMs':Date['now']()-_0x26594f}),{'ok':!![]};}),_0x289766('files:wr'+_0xeea2b7(0x140)+'ry',async(_0x334130,_0x251f0b={})=>{const _0x12304b=_0xeea2b7,_0x482926=Date[_0x12304b(0x168)]();await writeFile(_0x251f0b['path'],Buffer[_0x12304b(0x100)](_0x251f0b[_0x12304b(0x17c)]??[]));const _0x1abe47=await stat(_0x251f0b[_0x12304b(0x183)])[_0x12304b(0xc7)](()=>null);return filesLogger?.[_0x12304b(0x1bb)](_0x12304b(0x161)+_0x12304b(0x14b)+_0x12304b(0x102)+'ted',{'path':toHomePath(_0x251f0b['path']),'bytes':_0x1abe47?.[_0x12304b(0x10f)]??0x0,'durationMs':Date[_0x12304b(0x168)]()-_0x482926}),{'ok':!![]};}),_0x289766(_0xeea2b7(0xd7)+'lect-fil'+'e',async(_0xab2e14,_0x379bcc={})=>{const _0x12c5b5=_0xeea2b7,_0x3e895a=await dialog[_0x12c5b5(0xfb)+_0x12c5b5(0xc1)](BrowserWindow[_0x12c5b5(0xdb)+'ontents'](_0xab2e14[_0x12c5b5(0x12d)])??mainWindow,{'title':typeof _0x379bcc[_0x12c5b5(0x1c5)]===_0x12c5b5(0x13e)?_0x379bcc['title']:undefined,'properties':[_0x12c5b5(0xfc),..._0x379bcc[_0x12c5b5(0x19e)+_0x12c5b5(0x17a)]?[_0x12c5b5(0x19e)+_0x12c5b5(0x17a)]:[]],'filters':Array[_0x12c5b5(0x137)](_0x379bcc[_0x12c5b5(0x120)])?_0x379bcc[_0x12c5b5(0x120)]:undefined});return filesLogger?.[_0x12c5b5(0x1bb)]('select\x20f'+_0x12c5b5(0x145)+_0x12c5b5(0x1c8),{'canceled':_0x3e895a[_0x12c5b5(0xd2)],'count':_0x3e895a[_0x12c5b5(0xbc)+'s'][_0x12c5b5(0x13b)],'paths':_0x3e895a[_0x12c5b5(0xbc)+'s'][_0x12c5b5(0xe0)](toHomePath)}),{'canceled':_0x3e895a[_0x12c5b5(0xd2)],'paths':_0x3e895a[_0x12c5b5(0xbc)+'s']};}),_0x289766(_0xeea2b7(0xd7)+_0xeea2b7(0x19c)+_0xeea2b7(0x134),async(_0x1834f6,_0x1d0c8b={})=>{const _0x27bc78=_0xeea2b7,_0x419c4d=await dialog[_0x27bc78(0xfb)+_0x27bc78(0xc1)](BrowserWindow['fromWebC'+_0x27bc78(0xd6)](_0x1834f6[_0x27bc78(0x12d)])??mainWindow,{'title':typeof _0x1d0c8b['title']===_0x27bc78(0x13e)?_0x1d0c8b[_0x27bc78(0x1c5)]:undefined,'properties':['openDire'+_0x27bc78(0xc9)]});return filesLogger?.['info'](_0x27bc78(0xb1)+_0x27bc78(0x17e)+_0x27bc78(0x107)+'ed',{'canceled':_0x419c4d[_0x27bc78(0xd2)],'count':_0x419c4d['filePath'+'s'][_0x27bc78(0x13b)],'paths':_0x419c4d[_0x27bc78(0xbc)+'s'][_0x27bc78(0xe0)](toHomePath)}),{'canceled':_0x419c4d[_0x27bc78(0xd2)],'paths':_0x419c4d[_0x27bc78(0xbc)+'s']};}),_0x289766(_0xeea2b7(0x1b9)+'e:direct'+_0xeea2b7(0x189),()=>_0x241966()[_0xeea2b7(0x1b9)+'e'][_0xeea2b7(0x122)+_0xeea2b7(0xe7)]()),_0x289766(_0xeea2b7(0x1b9)+_0xeea2b7(0x1ab)+_0xeea2b7(0x17e),async()=>{const _0x1759ce=_0xeea2b7,_0x5e5432=await _0x241966()[_0x1759ce(0x1b9)+'e']['director'+'yInfo']();return await shell[_0x1759ce(0x1a7)](_0x5e5432[_0x1759ce(0x183)]),filesLogger?.['info'](_0x1759ce(0x1b9)+'e\x20direct'+_0x1759ce(0xe4)+'ed',{'path':toHomePath(_0x5e5432[_0x1759ce(0x183)])}),{'ok':!![],'path':_0x5e5432[_0x1759ce(0x183)]};}),_0x289766(_0xeea2b7(0x1b9)+'e:shared'+_0xeea2b7(0x133),()=>_0x241966()['workspac'+'e'][_0xeea2b7(0x165)+'ntext']()),_0x289766(_0xeea2b7(0x1b9)+_0xeea2b7(0xe1)+_0xeea2b7(0xc4)+_0xeea2b7(0xcc),(_0x5833f1,_0xb60b36)=>_0x241966()['workspac'+'e'][_0xeea2b7(0x163)+'redConte'+'xt'](_0xb60b36)),_0x289766(_0xeea2b7(0x1c7)+_0xeea2b7(0x169),(_0x3fba6f,_0xffcfd6)=>_0x241966()[_0xeea2b7(0x1c7)][_0xeea2b7(0x143)](_0xffcfd6)),_0x289766(_0xeea2b7(0x1c7)+_0xeea2b7(0xdf)+_0xeea2b7(0xf5),()=>_0x241966()[_0xeea2b7(0x1c7)][_0xeea2b7(0x1ae)+'ys']()),_0x289766('sessions'+':set-pin'+_0xeea2b7(0x1bf),(_0x29680a,_0x4e5f54)=>_0x241966()[_0xeea2b7(0x1c7)][_0xeea2b7(0x147)+_0xeea2b7(0x1c9)](_0x4e5f54)),_0x289766(_0xeea2b7(0x1a3)+_0xeea2b7(0x156),(_0x575c9e,_0x1860bd)=>_0x241966()[_0xeea2b7(0xd0)]['install'](_0x1860bd)),_0x289766(_0xeea2b7(0x18d)+_0xeea2b7(0xb8),(_0x4851b5,_0x1feb10)=>_0x241966()[_0xeea2b7(0xd0)][_0xeea2b7(0x172)](_0x1feb10)),_0x289766('skills:d'+'elete',(_0x4bbd4c,_0x11d24b)=>_0x241966()[_0xeea2b7(0xd0)][_0xeea2b7(0xce)](_0x11d24b)),_0x289766(_0xeea2b7(0xb5)+'t',(_0x1749a0,_0x44e72a)=>_0x241966()[_0xeea2b7(0x111)][_0xeea2b7(0x1a1)](_0x44e72a)),_0x289766('cron:cre'+_0xeea2b7(0xdc),(_0x146705,_0x5bd50d)=>_0x241966()['cron'][_0xeea2b7(0xc8)](_0x5bd50d)),_0x289766(_0xeea2b7(0x154)+_0xeea2b7(0xdc),(_0xe60de7,_0x268961)=>_0x241966()[_0xeea2b7(0x111)][_0xeea2b7(0x172)](_0x268961)),_0x289766('cron:rem'+'ove',(_0x256ab2,_0x68f696)=>_0x241966()[_0xeea2b7(0x111)]['remove'](_0x68f696)),_0x289766(_0xeea2b7(0x12c)+_0xeea2b7(0xca),(_0x56f932,_0x5f1aec)=>_0x241966()[_0xeea2b7(0x111)][_0xeea2b7(0x166)](_0x5f1aec)),_0x289766(_0xeea2b7(0x18f)+'s',(_0x52a1bc,_0x1e5b60)=>_0x241966()[_0xeea2b7(0x111)][_0xeea2b7(0x1c3)](_0x1e5b60)),_0x289766(_0xeea2b7(0x186)+'ettings',()=>_0x241966()['models'][_0xeea2b7(0xcb)]()),_0x289766(_0xeea2b7(0x186)+'et-setti'+_0xeea2b7(0x135),(_0x11c3e5,_0x3edaeb)=>_0x241966()[_0xeea2b7(0xd3)][_0xeea2b7(0x1a0)+_0xeea2b7(0x135)](_0x3edaeb)),_0x289766(_0xeea2b7(0x186)+_0xeea2b7(0x121)+_0xeea2b7(0xb3),(_0x555e2a,_0x459754)=>_0x241966()[_0xeea2b7(0xd3)][_0xeea2b7(0x1af)+_0xeea2b7(0xda)+'odels'](_0x459754)),_0x289766(_0xeea2b7(0x186)+_0xeea2b7(0x1c1)+_0xeea2b7(0x127),()=>_0x241966()['models']['selected'+_0xeea2b7(0xb0)]()),_0x289766('models:c'+_0xeea2b7(0x199)+_0xeea2b7(0xc3),()=>_0x241966()['models']['customMo'+_0xeea2b7(0xc3)]()),_0x289766(_0xeea2b7(0x106)+'ead',()=>_0x241966()['config']['read']());}async function boot(){const _0x216875=_0x11c6d2;shellConfig=await loadShellConfig(resolveProjectRoot()),app[_0x216875(0x1b2)](shellConfig[_0x216875(0x16b)+_0x216875(0x174)]),configController=createConfigController(shellConfig),mainLogger=createShellLogger(configController[_0x216875(0xf7)],_0x216875(0xc6)),ipcLogger=createShellLogger(configController['paths'],_0x216875(0x112)),filesLogger=createShellLogger(configController['paths'],'files'),rendererLogger=createShellLogger(configController[_0x216875(0xf7)],_0x216875(0x104)),registerProcessLogHooks(),mainLogger?.[_0x216875(0x1bb)](_0x216875(0x164)+_0x216875(0x1b5)+_0x216875(0x191)+'ed',{'appVersion':app['getVersi'+'on'](),'electronVersion':process[_0x216875(0x10c)][_0x216875(0x164)],'nodeVersion':process[_0x216875(0x10c)][_0x216875(0x14f)],'chromeVersion':process[_0x216875(0x10c)][_0x216875(0x10b)],'platform':process[_0x216875(0x1be)],'arch':process[_0x216875(0x1a4)],'mode':getMode(),'projectRoot':shellConfig[_0x216875(0xcd)+'oot'],'configPath':shellConfig[_0x216875(0x1a2)+'th'],'dataDir':shellConfig['dataDir'],'logsDir':configController[_0x216875(0xf7)]['logsDir'],'rendererUrl':process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x216875(0xcd)+_0x216875(0x195)],_0x216875(0x124),_0x216875(0x173)+'ml')}),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x216875(0xf1)+'on']()});for(const _0x37919c of[_0x216875(0x1a8)+_0x216875(0x109),'gateway-'+_0x216875(0x14c),_0x216875(0x148)+_0x216875(0x116)+'t',_0x216875(0xc0)+'updated',_0x216875(0x19d)+_0x216875(0x101),'agents-u'+_0x216875(0xc2),_0x216875(0x115)+_0x216875(0x15b)+'n']){gatewayController['on'](_0x37919c,_0x970612=>broadcast(_0x37919c,_0x970612));}installIpcHandlers(),registerShellShortcuts(),await createWindow(),await gatewayController['start'](),mainLogger?.['info'](_0x216875(0x164)+_0x216875(0x1b5)+_0x216875(0xb2)+_0x216875(0x193));}function registerProcessLogHooks(){const _0x149ae9=_0x11c6d2;if(registerProcessLogHooks[_0x149ae9(0xee)+'ed'])return;registerProcessLogHooks[_0x149ae9(0xee)+'ed']=!![],process['on'](_0x149ae9(0x1ca)+_0x149ae9(0x19b)+'n',_0x43183c=>{const _0x47349b=_0x149ae9;mainLogger?.['error'](_0x47349b(0x1ca)+_0x47349b(0x1a9)+'on',summarizeError(_0x43183c));}),process['on'](_0x149ae9(0x11a)+_0x149ae9(0xd4)+'on',_0x2b8899=>{const _0x4a22e5=_0x149ae9;mainLogger?.[_0x4a22e5(0x13f)](_0x4a22e5(0x11a)+_0x4a22e5(0x103)+'ion',summarizeError(_0x2b8899));}),app['on']('render-p'+_0x149ae9(0xe2)+_0x149ae9(0x151),(_0x516930,_0x3ace5e,_0xafc4d6)=>{const _0x27e8c3=_0x149ae9;mainLogger?.[_0x27e8c3(0x13f)]('renderer'+_0x27e8c3(0x171)+_0x27e8c3(0xb6),{'url':_0x3ace5e['getURL'](),'details':_0xafc4d6});}),app['on'](_0x149ae9(0x108)+_0x149ae9(0xff)+'ne',(_0x5ab3aa,_0x40d681)=>{const _0x30d606=_0x149ae9;mainLogger?.[_0x30d606(0x13f)]('child\x20pr'+_0x30d606(0x179)+'ne',{'details':_0x40d681});});}app['on'](_0x11c6d2(0x1c6)+_0x11c6d2(0x11e)+'d',()=>{const _0x48975c=_0x11c6d2;if(process[_0x48975c(0x1be)]!==_0x48975c(0xd1))app[_0x48975c(0x152)]();}),app['on'](_0x11c6d2(0x1a5),async()=>{const _0x432bd4=_0x11c6d2;BrowserWindow['getAllWi'+_0x432bd4(0x11f)]()[_0x432bd4(0x13b)]===0x0&&shellConfig&&await createWindow();}),app['on']('before-q'+'uit',_0x1cf8c3=>{const _0x573541=_0x11c6d2;if(!gatewayController)return;mainLogger?.[_0x573541(0x1bb)](_0x573541(0xaf)+_0x573541(0x123)+'pping\x20ga'+'teway'),_0x1cf8c3[_0x573541(0x118)+_0x573541(0x12e)](),void gatewayController[_0x573541(0xec)]()[_0x573541(0x15c)](()=>{const _0x289a02=_0x573541;gatewayController=null,mainLogger?.['info'](_0x289a02(0x126)+_0x289a02(0x10a)+_0x289a02(0xaf)+_0x289a02(0x12b)),app[_0x289a02(0x152)]();});}),app['on'](_0x11c6d2(0x197)+'t',()=>{globalShortcut['unregist'+'er'](DEVTOOLS_ACCELERATOR);}),app[_0x11c6d2(0x16e)+'y']()[_0x11c6d2(0xd8)](boot)[_0x11c6d2(0xc7)](_0x46122e=>{const _0x13fd42=_0x11c6d2;bootError=_0x46122e instanceof Error?_0x46122e['message']:String(_0x46122e),mainLogger?.['error'](_0x13fd42(0x164)+_0x13fd42(0x1b5)+_0x13fd42(0x180)+'d',summarizeError(_0x46122e)),console[_0x13fd42(0x13f)](_0x13fd42(0x12f)+_0x13fd42(0xf2)+_0x13fd42(0x1c2)+_0x13fd42(0xbe)+'ctron\x20ma'+'in',_0x46122e);});
|
|
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)}});
|