@wujie-shell/core 3.0.2 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/wujie-shell.mjs +1 -1
- package/dist/src/agents/bundled-agent-skills.mjs +1 -1
- package/dist/src/agents/bundled-agents.mjs +1 -1
- package/dist/src/chat/media-archive.mjs +1 -1
- package/dist/src/chat/queue.mjs +1 -1
- package/dist/src/common/diagnostics.mjs +1 -1
- package/dist/src/common/logging.mjs +1 -1
- package/dist/src/common/runtime-logger.mjs +1 -1
- package/dist/src/common/user-events.mjs +1 -1
- package/dist/src/common/utils.mjs +1 -1
- package/dist/src/config/controller.mjs +1 -1
- package/dist/src/connectors/config-utils.mjs +1 -1
- package/dist/src/connectors/constants.mjs +1 -1
- package/dist/src/connectors/controller.mjs +1 -1
- package/dist/src/connectors/kdocs-cli.mjs +1 -1
- package/dist/src/electron/main.mjs +1 -1
- package/dist/src/electron/preload.mjs +1 -1
- package/dist/src/files/generated-files-store.mjs +1 -1
- package/dist/src/files/handlers.mjs +1 -1
- package/dist/src/gateway/chat-delta.mjs +1 -1
- package/dist/src/gateway/controller.mjs +1 -1
- package/dist/src/gateway/ws-client.mjs +1 -1
- package/dist/src/index.mjs +1 -1
- package/dist/src/log-reporting/handlers.mjs +1 -1
- package/dist/src/log-reporting/report-logs.mjs +1 -1
- package/dist/src/models/handlers.mjs +1 -1
- package/dist/src/preferences/store.mjs +1 -1
- package/dist/src/runtime/index.mjs +1 -1
- package/dist/src/runtime/patch-channel-plugin-runtime.mjs +1 -1
- package/dist/src/runtime/patch-chat-history-mixed-tool-content.mjs +1 -1
- package/dist/src/runtime/patch-session-store-sqlite.mjs +1 -1
- package/dist/src/runtime/plugin-sync.mjs +1 -1
- package/dist/src/sessions/agent-sessions-map-store.mjs +1 -1
- package/dist/src/sessions/runtime-bridge.mjs +1 -1
- package/dist/src/sessions/session-sqlite-store.mjs +1 -1
- package/dist/src/skills/import.mjs +1 -1
- package/dist/src/skills/market.mjs +1 -1
- package/dist/src/terminal/manager.mjs +1 -1
- package/dist/src/updates/controller.mjs +1 -1
- package/dist/src/updates/loader.mjs +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x543b23=_0x53f4;(function(_0x3f87c0,_0x53394c){const _0x33e754=_0x53f4,_0x45376f=_0x3f87c0();while(!![]){try{const _0x98f6cd=parseInt(_0x33e754(0x1ec))/0x1*(parseInt(_0x33e754(0x2c3))/0x2)+parseInt(_0x33e754(0x2fb))/0x3+-parseInt(_0x33e754(0x14d))/0x4+-parseInt(_0x33e754(0x36c))/0x5+-parseInt(_0x33e754(0x205))/0x6*(-parseInt(_0x33e754(0x277))/0x7)+parseInt(_0x33e754(0x198))/0x8*(parseInt(_0x33e754(0x2f6))/0x9)+parseInt(_0x33e754(0x17e))/0xa*(-parseInt(_0x33e754(0x2c6))/0xb);if(_0x98f6cd===_0x53394c)break;else _0x45376f['push'](_0x45376f['shift']());}catch(_0x12d70e){_0x45376f['push'](_0x45376f['shift']());}}}(_0x16a7,0x6aefe));import _0x1c74e0 from'electron';import{fileURLToPath,pathToFileURL}from'node:url';import{dirname,join,resolve,sep}from'node:path';function _0x53f4(_0xbe75a2,_0x559551){_0xbe75a2=_0xbe75a2-0x64;const _0x16a718=_0x16a7();let _0x53f44d=_0x16a718[_0xbe75a2];return _0x53f44d;}import{createReadStream,existsSync,statSync}from'node:fs';import{readFile,readdir,stat,writeFile}from'node:fs/promises';import{spawn}from'node:child_process';import{Readable}from'node:stream';import{loadShellConfig}from'@wujie-shell/config';import{createConfigController}from'../config/controller.mjs';import{createGatewayController}from'../gateway/controller.mjs';import{deleteManagedSkill,importSkillZip,updateManagedSkillConfig}from'../skills/import.mjs';import{deleteMarketSkillRegistryEntry,importMarketSkillZip}from'../skills/market.mjs';import{createAgentSessionsMapStore}from'../sessions/agent-sessions-map-store.mjs';import{createSessionSqliteStore}from'../sessions/session-sqlite-store.mjs';import{createTerminalManager}from'../terminal/manager.mjs';import{createShellLogger,exportLogsArchive,summarizeError,summarizePayload,summarizeText,toHomePath}from'../common/logging.mjs';import{createDiagnosticsWriter,diagnosticEventFromError}from'../common/diagnostics.mjs';import{createUserEventWriter}from'../common/user-events.mjs';import{createConnectorController}from'../connectors/controller.mjs';import{resolveRuntimeKdocsCliCommand}from'../connectors/kdocs-cli.mjs';import{createGeneratedFilesStore}from'../files/generated-files-store.mjs';import{registerFileHandlers}from'../files/handlers.mjs';import{registerProductLogHandlers}from'../log-reporting/handlers.mjs';import{resolveWujieApiEndpoint}from'../log-reporting/report-logs.mjs';import{extractModelMessageContent,registerModelHandlers}from'../models/handlers.mjs';import{createPreferencesStore}from'../preferences/store.mjs';import{loadRuntimeInfo,prepareRuntime,resolveRuntimeRoot,getRuntimeSpawnContext,resolveRuntimeLarkCliCommand,runClawOnce}from'../runtime/index.mjs';import{loadCreateUpdateController}from'../updates/loader.mjs';const __dirname=dirname(fileURLToPath(import.meta.url)),preloadPath=join(__dirname,_0x543b23(0x1da)+_0x543b23(0x2c0)),{app,BrowserWindow,clipboard,dialog,globalShortcut,ipcMain,protocol,shell}=_0x1c74e0,DEVTOOLS_ACCELERATOR=_0x543b23(0x1f4)+_0x543b23(0x248)+'+Shift+I',CLAWSPACE_PROTOCOL_SCHEME='clawspac'+'e',DEBUG_STDOUT=process.env.WUJIE_SHELL_DEBUG==='1'||process.env.VITE_DEV_SERVER_URL||process.env.NODE_ENV!==_0x543b23(0x88)+'on',LOCAL_FILE_MIME_TYPES=new Map([[_0x543b23(0x1fd),_0x543b23(0x203)+_0x543b23(0x2d9)+_0x543b23(0x10b)+'8'],[_0x543b23(0x9f),'text/mar'+_0x543b23(0x76)+_0x543b23(0x164)+_0x543b23(0x2ea)],[_0x543b23(0x1d7),_0x543b23(0x190)+'eg'],[_0x543b23(0x7b),_0x543b23(0x190)+'eg'],[_0x543b23(0xb4),'image/pn'+'g'],[_0x543b23(0x129),'image/gi'+'f'],[_0x543b23(0x1a4),'image/bm'+'p'],['.svg',_0x543b23(0x146)+_0x543b23(0x87)],[_0x543b23(0x140),_0x543b23(0x1d0)+'bp'],[_0x543b23(0x1c0),_0x543b23(0x108)+'4'],[_0x543b23(0x1a2),_0x543b23(0x334)+_0x543b23(0x37c)],[_0x543b23(0x188),_0x543b23(0x323)+_0x543b23(0x372)],[_0x543b23(0x107),_0x543b23(0x323)+_0x543b23(0x26b)],[_0x543b23(0x243),'video/we'+'bm'],[_0x543b23(0x2d7),_0x543b23(0x1f7)+'eg'],['.wav',_0x543b23(0x2b5)+'v'],[_0x543b23(0x31d),'audio/mp'+'4'],['.aac',_0x543b23(0x7e)+'c'],[_0x543b23(0x27a),_0x543b23(0x353)+'g'],['.flac',_0x543b23(0x1b6)+'ac']]);protocol[_0x543b23(0x2cf)+_0x543b23(0x2e3)+_0x543b23(0x244)+_0x543b23(0x193)]([{'scheme':CLAWSPACE_PROTOCOL_SCHEME,'privileges':{'secure':!![],'standard':!![],'supportFetchAPI':!![],'corsEnabled':!![]}}]);let mainWindow=null,shellConfig=null,configController=null,gatewayController=null,bootError=null,mainLogger=null,ipcLogger=null,filesLogger=null,rendererLogger=null,terminalManager=null,connectorController=null,generatedFilesStore=null,productRuntime=null,productRuntimeHooks={},sessionSqliteStore=null,diagnosticsWriter=null,userEventWriter=null,isQuitting=![],updateController=null;function attachGatewayBroadcastHandlers(_0x5c3c4a){const _0x128147=_0x543b23;for(const _0x196f48 of['gateway-'+_0x128147(0x7a),_0x128147(0x162)+_0x128147(0x283),_0x128147(0xd6)+_0x128147(0xbb)+'t','session-'+_0x128147(0x322),'sessions'+_0x128147(0x2e6)+'ated',_0x128147(0x1e8)+_0x128147(0x234),_0x128147(0xce)+'pdated','ask-user'+_0x128147(0x329)+'n']){_0x5c3c4a['on'](_0x196f48,_0x2fda82=>broadcast(_0x196f48,_0x2fda82));}}function ensureSessionSqliteStore(){const _0x1e5704=_0x543b23;if(sessionSqliteStore)return sessionSqliteStore;if(!configController)throw new Error('wujie-sh'+_0x1e5704(0x26a)+_0x1e5704(0x1b1)+'t\x20initia'+_0x1e5704(0x117));return sessionSqliteStore=createSessionSqliteStore({'stateDir':configController[_0x1e5704(0xb3)+'tateDir']()}),sessionSqliteStore;}function ensureGeneratedFilesStore(){const _0x4c5b06=_0x543b23;if(generatedFilesStore)return generatedFilesStore;if(!configController)throw new Error(_0x4c5b06(0x6c)+_0x4c5b06(0x26a)+_0x4c5b06(0x1b1)+_0x4c5b06(0x1e7)+'lized');return generatedFilesStore=createGeneratedFilesStore({'stateDir':configController[_0x4c5b06(0xb3)+'tateDir']()}),generatedFilesStore;}async function ensureGatewayControllerStarted(){const _0x210743=_0x543b23;if(gatewayController)return gatewayController;if(!shellConfig||!configController)throw new Error(bootError?_0x210743(0x6c)+_0x210743(0x2db)+_0x210743(0x1b4)+'\x20'+bootError:_0x210743(0x6c)+'ell\x20gate'+_0x210743(0x20f)+_0x210743(0x33a)+_0x210743(0x150));return mainLogger?.[_0x210743(0xcb)](_0x210743(0x1b3)+_0x210743(0x338)+'er\x20missi'+_0x210743(0x179)+_0x210743(0x291)),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x210743(0x1ad)+'on'](),'productRuntimeHooks':productRuntimeHooks,'userEventWriter':userEventWriter,'sessionSqliteStore':ensureSessionSqliteStore()}),attachGatewayBroadcastHandlers(gatewayController),await gatewayController[_0x210743(0x2e1)](),gatewayController;}function getMode(){const _0x2b94fd=_0x543b23;return process.env.VITE_DEV_SERVER_URL?_0x2b94fd(0x224):_0x2b94fd(0x339);}function isGatewayNotInitializedError(_0xa4ff2f){const _0x3d55e5=_0x543b23;return _0xa4ff2f instanceof Error&&_0xa4ff2f[_0x3d55e5(0xbf)]===_0x3d55e5(0x6c)+_0x3d55e5(0x225)+'way\x20is\x20n'+_0x3d55e5(0x33a)+'alized';}function revealPathInFolder(_0x297c1a){const _0x8d3f3=_0x543b23,_0x2db76e=String(_0x297c1a||'')['trim']();if(!_0x2db76e)return{'ok':![],'error':_0x8d3f3(0x33f)+_0x8d3f3(0x2f5)};return shell['showItem'+_0x8d3f3(0x2d3)](_0x2db76e),{'ok':!![]};}function resolveProjectRoot(){const _0x9395f4=_0x543b23;if(process.env.WUJIE_SHELL_PROJECT_ROOT)return resolve(process.env.WUJIE_SHELL_PROJECT_ROOT);if(app[_0x9395f4(0xe6)+'ed']&&process[_0x9395f4(0x6b)+'sPath'])return join(process[_0x9395f4(0x6b)+_0x9395f4(0x288)],_0x9395f4(0xed));return resolve(process[_0x9395f4(0x221)]());}function getLocalFileMimeType(_0x3ca542){const _0x1aabfb=_0x543b23;return LOCAL_FILE_MIME_TYPES[_0x1aabfb(0x2fc)](_0x3ca542[_0x1aabfb(0x2d2)](_0x3ca542[_0x1aabfb(0x11d)+_0x1aabfb(0x34e)]('.'))['toLowerC'+'ase']())||_0x1aabfb(0x1d4)+_0x1aabfb(0x2e2)+'t-stream';}function parseSingleRangeHeader(_0x34e880,_0x13d98a){const _0x56b5f0=_0x543b23,_0x493c28=/^bytes=(\d*)-(\d*)$/i[_0x56b5f0(0x85)](_0x34e880['trim']());if(!_0x493c28)return null;const [,_0x454e15,_0x4f74e5]=_0x493c28;if(!_0x454e15&&!_0x4f74e5)return null;if(!_0x454e15){const _0x4b9bf0=Number[_0x56b5f0(0x1df)](_0x4f74e5,0xa);if(!Number['isFinite'](_0x4b9bf0)||_0x4b9bf0<=0x0)return null;const _0x303c21=Math[_0x56b5f0(0x197)](_0x13d98a-_0x4b9bf0,0x0);return{'start':_0x303c21,'end':_0x13d98a-0x1};}const _0x55c70d=Number['parseInt'](_0x454e15,0xa);if(!Number[_0x56b5f0(0x294)](_0x55c70d)||_0x55c70d<0x0||_0x55c70d>=_0x13d98a)return null;const _0x3d7099=_0x4f74e5?Number[_0x56b5f0(0x1df)](_0x4f74e5,0xa):_0x13d98a-0x1;if(!Number[_0x56b5f0(0x294)](_0x3d7099)||_0x3d7099<_0x55c70d)return null;return{'start':_0x55c70d,'end':Math['min'](_0x3d7099,_0x13d98a-0x1)};}function decodeClawspacePath(_0x2766ca){const _0x57c3a6=_0x543b23;try{const _0x49a5e7=new URL(_0x2766ca);if(_0x49a5e7['protocol']!==CLAWSPACE_PROTOCOL_SCHEME+':')return null;if(_0x49a5e7[_0x57c3a6(0x2e5)]!==_0x57c3a6(0x302))return null;const _0x1831d0=decodeURIComponent(_0x49a5e7[_0x57c3a6(0x27e)]);if(!_0x1831d0)return null;if(/^\/[A-Za-z]:\//[_0x57c3a6(0x2ef)](_0x1831d0))return _0x1831d0[_0x57c3a6(0x2d2)](0x1);return _0x1831d0;}catch{return null;}}function createClawspaceHeaders(_0x62fc68={}){const _0x243d64=_0x543b23;return new Headers({'access-control-allow-origin':'*','access-control-allow-methods':'GET,\x20HEA'+'D,\x20OPTIO'+'NS','access-control-allow-headers':'range,\x20c'+_0x243d64(0x32b)+'ype','access-control-expose-headers':_0x243d64(0x27b)+_0x243d64(0x16d)+'content-'+'range,\x20a'+_0x243d64(0x1a3)+_0x243d64(0xbd),..._0x62fc68});}function createLocalFileResponse(_0x2b3ff9,_0x4a26ba){const _0x12e466=_0x543b23,_0x35d9cc=statSync(_0x4a26ba);if(!_0x35d9cc['isFile']())return new Response(_0x12e466(0x1d8)+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x12e466(0x203)+_0x12e466(0x2d9)+_0x12e466(0x10b)+'8'})});const _0x38cd7d=getLocalFileMimeType(_0x4a26ba),_0x616859=createClawspaceHeaders({'content-type':_0x38cd7d,'accept-ranges':_0x12e466(0x1d2),'cache-control':_0x12e466(0x172)});if(_0x2b3ff9['method']===_0x12e466(0x73))return _0x616859[_0x12e466(0x22f)]('content-'+_0x12e466(0xa3),String(_0x35d9cc[_0x12e466(0x2a9)])),new Response(null,{'status':0xc8,'headers':_0x616859});const _0xdeb954=_0x2b3ff9[_0x12e466(0x2fd)][_0x12e466(0x2fc)](_0x12e466(0x169));if(!_0xdeb954)return _0x616859[_0x12e466(0x22f)]('content-'+_0x12e466(0xa3),String(_0x35d9cc[_0x12e466(0x2a9)])),new Response(Readable['toWeb'](createReadStream(_0x4a26ba)),{'status':0xc8,'headers':_0x616859});const _0x1edece=parseSingleRangeHeader(_0xdeb954,_0x35d9cc[_0x12e466(0x2a9)]);if(!_0x1edece)return new Response(null,{'status':0x1a0,'headers':createClawspaceHeaders({...Object[_0x12e466(0x1f3)+_0x12e466(0x247)](_0x616859[_0x12e466(0x177)]()),'content-range':_0x12e466(0x29b)+_0x35d9cc['size']})});const {start:_0xd3d9e6,end:_0x317e90}=_0x1edece,_0x15a911=_0x317e90-_0xd3d9e6+0x1,_0x410200=new Headers(_0x616859);return _0x410200['set'](_0x12e466(0x27b)+_0x12e466(0xa3),String(_0x15a911)),_0x410200[_0x12e466(0x22f)]('content-'+_0x12e466(0x169),_0x12e466(0x267)+_0xd3d9e6+'-'+_0x317e90+'/'+_0x35d9cc[_0x12e466(0x2a9)]),new Response(Readable['toWeb'](createReadStream(_0x4a26ba,{'start':_0xd3d9e6,'end':_0x317e90})),{'status':0xce,'headers':_0x410200});}function _0x16a7(){const _0x4b369b=['window:t',':diagnos','agent\x20al','maxEntri','register','content','sessionK','slice','InFolder','window:c','te\x20compl','install','.mp3','oot','in;\x20char','e\x20comple','ell\x20boot','ready','ocess-go','t:\x20','s:hide','ists','start','ion/octe','SchemesA','config:c','hostname','-invalid','-pinned','nnelEnab','relaunch','tf-8','ensureIn','ernal\x20ur','\x20shortcu','cron:upd','test','-session','s:list','ipc_requ','ishuRegi','eam','required','261MSLsxF','agent\x20id','saveKdoc','openDevT','dow\x20load','2033064sNQDpq','get','headers','platform','before-q','app:tray','models:c','local','index.mj','-restart','nts','saveTenc','multiSel','cron','rocess-g','ory','sConnect','node','ChannelC','canceled','resolveC','agentId','\x20found:\x20','listImCh','chat:abo','liConnec','select\x20f','\x20gone','child\x20pr','Dialog','ces.json','renderer','tabs:req','dCheck','.m4a','setOpenC','Config','saveWeco','skills:d','updated','video/x-','openclaw',':save-qq','webConte','zed','setSelfO','-questio','deleteIm','ontent-t','app:info','level','deleteFi',':choose','then','tease-ma','ector:\x20','payload','video/qu','filters',':save-te','logs','controll','prod','ot\x20initi','edWindow','-shortcu','hell]\x20fa','l\x20reques','path\x20is\x20','ocs','feishu','ileName','omplete','tateDir','mport-zi','folder','apiKey','reload','ate','-data','unmaximi','saveFeis','utf8','xOf','timeoutM','saveDing','timeout','startWec','audio/og','devtools','temp','sender','failed','\x20log','d\x20reject','imePlugi','atus',':input','agents','ion','getLogin','ontext','huChanne','\x20failed','logs\x20exp','ith-sess','includes','nt]','dSession','main','tic','uncaught','Exceptio','3645085VNWVAL','senderFr','et-selec','ssionKey','replace','filter','msvideo','l\x20prepar','ession','openFile','enable','startFei','em:open-','[wujie-s','ectory','Entry','icktime','et-self-','m-channe','saveCust','getFeish','uest-age','app_acti','projectR','agents:u','-life-cy','cron:cre','omModel','enClawSk','resource','wujie-sh','showSave','kdocs','ources','nabled','pop','darwin','HEAD','tChannel','tSession','kdown;\x20c','tabs-age','rated-fi','cron:lis','status','.jpeg','update-c','path','audio/aa','stion','onfig\x20up','hell:eve','deleteCu','split','gatewayP','exec','entExmai','g+xml','producti','l\x20first','ipc\x20requ','tus','agent\x20cr','ove','plugin\x20e','appId','vate','-request','d\x20failed','n-direct','ssion:\x20','ed:\x20','led','ai.com/v','extensio','/chat/co','saveQqbo','isMaximi','tp\x20','Bearer\x20','ory\x20open','.md','agent-','-context','maxToken','length','\x20to\x20load',':unpin','text','oken','ask-user','product','string','yInfo','und','settings','writeSha','activate','illEntry','logs:lis','code','resolveS','.png','enClawCo','wujiecla','ame','e\x20direct','s:delete',':set-clo','eam-even','agent_id','nges','tabs-com','message','default','push','writeTex','ctron\x20ma','ad-binar','parse','Custom','loadFile','filePath','productN','te:get-s','warn','inned','window:o','agents-u','cancelWe','skills:i','pluginId','window_f','logs:rea','customMo','lt\x20model','chat-str','context','IPC\x20requ','nConfig','openPath','parentSe','OPTIONS','ist','setImCha',':agent-m','plugins','uDocCliC','disable','CliConne','name','elected-','isPackag','tup:get','isDestro','child-pr',':delete','pping\x20ga','cancelKd','app.asar','upsert','Terminal',':run-onc','i-window','roductCo','orted','roductDa','getRecen','agents:w','s-maximi','ncident','ings','chat:str','ted',':save-ne','tedModel','ections','ectory\x20o','bin','pper\x20not','ngs','close',':status','ncent-ex',':downloa','.mkv','video/mp','getAppPa','config:r','set=utf-','render-p','d-state','ionEntry','stopped\x20','red;\x20set','config:i','app:file',':fork','setSetti','-url','complete','lized','sion','targetDi','ItemSett','lect-fil','getFocus','lastInde','-port','quit','files:se','product\x20','itialize','te:quit-','clawspac','annelCon','meta','requestB','mand','.gif','ncent-do','rayOnClo','tup:set','dispose','sync-bun','record','pen-devt','control','unhandle','files','elConfig','isabled','ase','huDocCon','director','ile\x20read','ell-cli.','readSess','models:s','focus','est_fail','wechat','.webp','promises','files:re','app:star','binary\x20f','talkDocC','image/sv','Keys','Updates','ot\x20start','plugins:','recursiv',':pin','1885680TbmIHS','choices','logs:exp','alized','json','files:li','match','openDire','ired','runtime\x20','ort','\x20not\x20con','nnel','node:fs/','toLowerC','stringif','irectory','meFilter','runOnce','lose','startKdo','gateway-','uri','harset=u','leted','nt-state','csCliCon','from','range','ap:entry',':complet','quired','length,\x20','.\x20Run\x20wu','redConte','e:open-d','reasonin','no-store','versions','sessions','toISOStr','groups','entries','ngtalk-d','ng;\x20recr','restart','-logs','readConf','arch','3403930GOdMOV','ontents','plugin\x20d','agents:d','\x20main\x20wi','setSelec','getState','eted','ssion','electron','.avi','ternally','model','will-qui','untimeHa','rver','Everywhe','tate','image/jp','ions-lis','elSessio','ged','oggle-ma',':save-fe',':open-cl','max','24072AbRuIY','function','-once','tabs:nav','trim','efault','s:upsert','uired','files:wr','cron:run','.mov','ccept-ra','.bmp','number','shell-ru','stop',':gateway','ot\x20compl','key','markConf','checkFor','getVersi','keys','hatChann','runtimeI','ig\x20is\x20no','ion/json','gateway\x20','\x20failed:','hidden','audio/fl','mChannel','ure','setName','t-messag',':rename','lawMcpSe','error','agent\x20de','les:hide','.mp4','-status','isArray','rename','updateOp','input','Invalid\x20','les:reve','e:shared','assign','est\x20fail','chat','d\x20comple','tabs:pos','n\x20loaded','handle','image/we','gatewayT','bytes','ximize','applicat','nnectSes','onfig','.jpg','Not\x20foun','paths','preload.','saveQqMa','captureI',':save-di','dist','parseInt','lawSkill','writeCon','torConfi','defaults','ools','est\x20comp','openExte','t\x20initia','agent-ev','figured:','minimize','showOpen','29QZHUFY','update','ntime','agents:l','info','reorderP','chatChan','fromEntr','CommandO','deletedS','abort','audio/mp','href','ted\x20conn','nfo','igWriteH','skills:s','.txt','\x20complet','shuDocCl','chrome','entDocsC','odels','text/pla','shared-c','39378okWsZQ','\x20is\x20requ','fromIpc',':start','unknown','selected','nstall','baseUrl','byteLeng','cle','way\x20is\x20n','hideBySe','onnector','product-','saveNetE','oad','preventD','generate','Version','ustom-mo','\x20request','enClawMc','history','primary','lawChann','unregist','answerAs','th\x20is\x20re','cwd','indexOf','e:direct','dev','ell\x20gate',':create','\x20a\x20provi','\x20excepti','POST','logsDir','plugin\x20c','\x20configu','map','workspac','set','ectSessi','whenRead','figs','all','ent','ettings','app:gene','delete','send','skills','\x20process','migrateP','jie-shel','create','eated','mpletion','provider','e:write-','get-conf','.webm','sPrivile','runtime:','ndows','ies','rControl','lect-dir',':cancel','isIntege','dataDir','markQuit','ocsCliCo','enClawCh','getPinne','com-chan','method','channelI','stomMode','nectSess','quitAndI','object','fig','uit',':answer-','ot\x20faile','Unsuppor','setLogin','window:i','ted-stat','deleteOp','getKdocs','title','cancelFe','uit:\x20sto','command','before\x20q','bytes\x20','pened','Observed','ell\x20conf','matroska','ndow','iled\x20to\x20','file\x20rea','nel','type','#f8fafc','ey\x20is\x20re','emoji',':list','unref','ntext','777WDYNQu','logs:ope','ocess\x20go','.ogg','content-','cCliConn','hell:ipc','pathname','list','h\x0aexec\x20\x22','dels','-refresh','log','keyDown','ile\x20comp','orConfig','ector\x20se','sPath','tLogs','app:upda','g_conten','before-i','agent\x20up','nelSessi','hide',':save-kd','eating','board:wr','index.ht','isFinite','ead','file\x20wri','nput-eve','ap:get','d\x20is\x20req','ishu-doc','bytes\x20*/','models','ite','getPath','e\x20first.','ProductR','elete','nfig','closeToT','artifact','feishu_d','manifest','avatar','getURL','size','select\x20d','-weixin','n\x20not\x20fo','les:dele','nectorCo','maximize','now','app:syst','ls:set-e','catch','ctory','audio/wa','cron:rem','ing','\x20main\x20bo','aseMailC','preferen','getAllWi','chat:his','fromWebC','ndlers','yed','mjs','sourcePa','terminal','33476nmXSTH','started','Update','11VnuTQE','logs:wri','Session','app:open','writeEve'];_0x16a7=function(){return _0x4b369b;};return _0x16a7();}function installClawspaceProtocolHandler(){const _0x2cb238=_0x543b23;protocol[_0x2cb238(0x1cf)](CLAWSPACE_PROTOCOL_SCHEME,_0x34f65c=>{const _0x44eebd=_0x2cb238;if(_0x34f65c[_0x44eebd(0x252)]===_0x44eebd(0xdc))return new Response(null,{'status':0xcc,'headers':createClawspaceHeaders()});const _0x339a4f=decodeClawspacePath(_0x34f65c['url']);if(!_0x339a4f)return new Response(_0x44eebd(0x1c6)+_0x44eebd(0x124)+'e\x20url',{'status':0x190,'headers':createClawspaceHeaders({'content-type':_0x44eebd(0x203)+_0x44eebd(0x2d9)+'set=utf-'+'8'})});if(!existsSync(_0x339a4f))return new Response(_0x44eebd(0x1d8)+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x44eebd(0x203)+_0x44eebd(0x2d9)+_0x44eebd(0x10b)+'8'})});return createLocalFileResponse(_0x34f65c,_0x339a4f);});}function broadcast(_0x4df50f,_0x44752c){const _0x5c0294=_0x543b23;DEBUG_STDOUT&&console[_0x5c0294(0x1f0)](_0x5c0294(0x379)+_0x5c0294(0x81)+_0x5c0294(0x366),_0x4df50f,summarizePayload(_0x44752c,{'maxDepth':0x2}));for(const _0x5f0a92 of BrowserWindow[_0x5c0294(0x2bb)+_0x5c0294(0x246)]()){!_0x5f0a92[_0x5c0294(0x326)+_0x5c0294(0x305)][_0x5c0294(0xe8)+_0x5c0294(0x2bf)]()&&_0x5f0a92[_0x5c0294(0x326)+'nts']['send'](_0x5c0294(0x6c)+'ell:even'+'t',{'name':_0x4df50f,'payload':_0x44752c});}}async function loadProductRuntime(){const _0x2926b9=_0x543b23,_0x4df9cb=[join(shellConfig[_0x2926b9(0x65)+_0x2926b9(0x2d8)],_0x2926b9(0x1a6)+_0x2926b9(0x1ee),_0x2926b9(0x303)+'s'),join(app[_0x2926b9(0x109)+'th'](),'shell-ru'+'ntime',_0x2926b9(0x303)+'s')],_0x55f571=_0x4df9cb['find'](_0x1dc496=>existsSync(_0x1dc496));if(!_0x55f571)return mainLogger?.[_0x2926b9(0x1f0)]('product\x20'+_0x2926b9(0x156)+'extensio'+_0x2926b9(0x2ac)+_0x2926b9(0xac),{'runtimeCandidates':_0x4df9cb}),{};try{const _0x4a9b23=await import(pathToFileURL(_0x55f571)[_0x2926b9(0x1f8)]);return mainLogger?.[_0x2926b9(0x1f0)](_0x2926b9(0x121)+_0x2926b9(0x156)+_0x2926b9(0x98)+_0x2926b9(0x1ce),{'runtimePath':_0x55f571}),_0x4a9b23;}catch(_0x3c4c76){mainLogger?.[_0x2926b9(0x1bd)](_0x2926b9(0x121)+'runtime\x20'+'extensio'+'n\x20failed'+_0x2926b9(0xa4),{'runtimePath':_0x55f571,'error':summarizeError(_0x3c4c76)});throw _0x3c4c76;}}function openDevToolsForActiveContext(){const _0x4e6b7c=_0x543b23,_0x276b56=BrowserWindow[_0x4e6b7c(0x11c)+_0x4e6b7c(0x33b)]()||mainWindow;if(!_0x276b56||_0x276b56[_0x4e6b7c(0xe8)+'yed']())return{'ok':![]};return _0x276b56[_0x4e6b7c(0x326)+_0x4e6b7c(0x305)]['openDevT'+_0x4e6b7c(0x1e4)]({'mode':'detach'}),_0x276b56[_0x4e6b7c(0x326)+_0x4e6b7c(0x305)][_0x4e6b7c(0x238)](_0x4e6b7c(0x6c)+'ell:even'+'t',{'name':_0x4e6b7c(0x354)+_0x4e6b7c(0x33c)+'t','payload':{'accelerator':DEVTOOLS_ACCELERATOR}}),{'ok':!![]};}function registerShellShortcuts(){const _0x4024a7=_0x543b23;globalShortcut[_0x4024a7(0x21e)+'er'](DEVTOOLS_ACCELERATOR);const _0xe70e0c=globalShortcut[_0x4024a7(0x2cf)](DEVTOOLS_ACCELERATOR,openDevToolsForActiveContext);!_0xe70e0c&&console[_0x4024a7(0xcb)]('[wujie-s'+_0x4024a7(0x33d)+_0x4024a7(0x26d)+_0x4024a7(0x2cf)+_0x4024a7(0x2ed)+_0x4024a7(0x2de)+DEVTOOLS_ACCELERATOR);}async function getRuntimeResourceStatus(){const _0x42f13f=_0x543b23;try{const _0x454e46=await loadRuntimeInfo(shellConfig[_0x42f13f(0x65)+_0x42f13f(0x2d8)]),_0x55a18b=_0x454e46[_0x42f13f(0x2a6)]||{};return{'ok':!![],'runtimeRoot':_0x454e46['runtimeR'+_0x42f13f(0x2d8)],'openclawVersion':_0x454e46[_0x42f13f(0x324)+_0x42f13f(0x217)],'generatedAt':_0x55a18b[_0x42f13f(0x216)+'dAt']||null,'pluginCount':Array[_0x42f13f(0x1c2)](_0x55a18b[_0x42f13f(0xe0)])?_0x55a18b[_0x42f13f(0xe0)]['length']:0x0,'plugins':Array[_0x42f13f(0x1c2)](_0x55a18b[_0x42f13f(0xe0)])?_0x55a18b[_0x42f13f(0xe0)]:[],'agents':_0x55a18b[_0x42f13f(0x35d)]||null,'skills':_0x55a18b[_0x42f13f(0x239)]||null,'wrapper':_0x55a18b[_0x42f13f(0xb6)+'wBin']||null,'product':_0x55a18b[_0x42f13f(0xa9)]||null};}catch(_0x4d5ad8){return{'ok':![],'runtimeRoot':resolveRuntimeRoot(shellConfig?.['projectR'+'oot']||resolveProjectRoot()),'error':_0x4d5ad8 instanceof Error?_0x4d5ad8[_0x42f13f(0xbf)]:String(_0x4d5ad8)};}}async function createWindow(){const _0x470bce=_0x543b23,_0x154050=process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x470bce(0x65)+_0x470bce(0x2d8)],_0x470bce(0x1de),_0x470bce(0x293)+'ml'),_0x1fb2ad=process[_0x470bce(0x2fe)]===_0x470bce(0x72);mainLogger?.[_0x470bce(0x1f0)]('creating'+_0x470bce(0x182)+_0x470bce(0x26c),{'rendererUrl':_0x154050,'mode':getMode()}),mainWindow=new BrowserWindow({'width':0x49c,'height':0x30c,'minWidth':0x384,'minHeight':0x26c,'title':shellConfig[_0x470bce(0xc9)+_0x470bce(0xb7)],'backgroundColor':_0x1fb2ad?'#0000000'+'0':_0x470bce(0x271),'titleBarStyle':_0x1fb2ad?_0x470bce(0x1b5):_0x470bce(0xc0),..._0x1fb2ad?{'titleBarOverlay':!![],'trafficLightPosition':{'x':0x10,'y':0xc}}:{},..._0x1fb2ad?{'vibrancy':'sidebar'}:{},'webPreferences':{'preload':preloadPath,'contextIsolation':!![],'nodeIntegration':![],'sandbox':![]}}),mainWindow[_0x470bce(0x326)+_0x470bce(0x305)]['on'](_0x470bce(0x28c)+_0x470bce(0x297)+'nt',_0x3adfa2=>{const _0x2d159e=_0x470bce,_0x4e75a1=_0x3adfa2[_0x2d159e(0x1c5)];if(!_0x4e75a1||_0x4e75a1[_0x2d159e(0x270)]!==_0x2d159e(0x284))return;const _0x41290d=String(_0x4e75a1['key']||'')[_0x2d159e(0x15b)+_0x2d159e(0x136)](),_0x10910c=_0x41290d==='r',_0x179588=process[_0x2d159e(0x2fe)]===_0x2d159e(0x72)?_0x4e75a1[_0x2d159e(0x126)]===!![]:_0x4e75a1[_0x2d159e(0x131)]===!![];if(!_0x10910c||!_0x179588)return;_0x3adfa2[_0x2d159e(0x215)+'efault'](),broadcast('tabs-com'+_0x2d159e(0x128),{'type':'navigati'+'on','action':_0x2d159e(0x348)});}),mainWindow['on'](_0x470bce(0x13d),()=>{const _0x2c0cec=_0x470bce;updateController?.[_0x2c0cec(0x127)+'ackgroun'+_0x2c0cec(0x31c)](_0x2c0cec(0xd2)+'ocus');});const _0x510547=process.env.VITE_DEV_SERVER_URL;_0x510547?(await mainWindow['loadURL'](_0x510547),process.env.WUJIE_SHELL_OPEN_DEVTOOLS==='1'&&mainWindow[_0x470bce(0x326)+_0x470bce(0x305)][_0x470bce(0x2f9)+_0x470bce(0x1e4)]({'mode':'detach'})):await mainWindow[_0x470bce(0xc7)](join(shellConfig['projectR'+_0x470bce(0x2d8)],_0x470bce(0x1de),'index.ht'+'ml')),mainLogger?.[_0x470bce(0x1f0)]('main\x20win'+_0x470bce(0x2fa)+'ed',{'rendererUrl':_0x154050,'mode':getMode()});}async function installIpcHandlers(){const _0x18367f=_0x543b23,_0x10a429=(_0x3e2880,_0x1b68f5)=>{const _0x3ab545=_0x53f4;ipcMain[_0x3ab545(0x1cf)](_0x3e2880,async(_0x5b2f90,_0x9aba3d)=>{const _0x2f386a=_0x3ab545,_0x30771a=Date[_0x2f386a(0x2b0)](),_0x5d9dfd=_0x5b2f90[_0x2f386a(0x36d)+_0x2f386a(0xb7)]?.['url']||_0x5b2f90[_0x2f386a(0x356)][_0x2f386a(0x2a8)]();ipcLogger?.[_0x2f386a(0x1f0)](_0x2f386a(0x8a)+'est\x20star'+_0x2f386a(0xfb),{'channel':_0x3e2880,'senderUrl':_0x5d9dfd,'payload':summarizePayload(_0x9aba3d)});DEBUG_STDOUT&&console['info'](_0x2f386a(0x379)+_0x2f386a(0x27d)+']',_0x3e2880,_0x2f386a(0x2c4),summarizePayload(_0x9aba3d));try{let _0x432f13;try{_0x432f13=await _0x1b68f5(_0x5b2f90,_0x9aba3d);}catch(_0x5b72ee){if(!isGatewayNotInitializedError(_0x5b72ee))throw _0x5b72ee;await ensureGatewayControllerStarted(),_0x432f13=await _0x1b68f5(_0x5b2f90,_0x9aba3d);}const _0x2c8085=Date['now']()-_0x30771a;return ipcLogger?.['info']('ipc\x20requ'+_0x2f386a(0x1e5)+'leted',{'channel':_0x3e2880,'durationMs':_0x2c8085,'result':summarizePayload(_0x432f13,{'maxDepth':0x2})}),await userEventWriter?.[_0x2f386a(0x207)]({'channel':_0x3e2880,'payload':_0x9aba3d,'result':_0x432f13,'durationMs':_0x2c8085,'status':'succeede'+'d'}),DEBUG_STDOUT&&console['info'](_0x2f386a(0x379)+'hell:ipc'+']',_0x3e2880,_0x2f386a(0x116)+'d',summarizePayload(_0x432f13,{'maxDepth':0x2})),_0x432f13;}catch(_0x46cb24){const _0x204055=Date['now']()-_0x30771a;ipcLogger?.[_0x2f386a(0x1bd)](_0x2f386a(0x8a)+_0x2f386a(0x1ca)+'ed',{'channel':_0x3e2880,'durationMs':_0x204055,'error':summarizeError(_0x46cb24)}),await userEventWriter?.[_0x2f386a(0x207)]({'channel':_0x3e2880,'payload':_0x9aba3d,'error':_0x46cb24,'durationMs':_0x204055,'status':_0x2f386a(0x357)}),await diagnosticsWriter?.[_0x2f386a(0x1dc)+_0x2f386a(0xf8)](diagnosticEventFromError(_0x46cb24,{'category':'ipc','event':_0x2f386a(0x2f2)+_0x2f386a(0x13e)+'ed','message':_0x2f386a(0xd8)+'est\x20fail'+_0x2f386a(0x95)+_0x3e2880,'durationMs':_0x204055,'meta':{'channel':_0x3e2880,'senderUrl':_0x5d9dfd,'payload':summarizePayload(_0x9aba3d)}}));DEBUG_STDOUT&&console[_0x2f386a(0x1bd)](_0x2f386a(0x379)+'hell:ipc'+']',_0x3e2880,_0x2f386a(0x357),summarizeError(_0x46cb24));throw _0x46cb24;}});},_0x1d533c=()=>{const _0x3493e1=_0x53f4;if(!gatewayController)throw new Error(bootError?_0x3493e1(0x6c)+_0x3493e1(0x2db)+_0x3493e1(0x1b4)+'\x20'+bootError:_0x3493e1(0x6c)+_0x3493e1(0x225)+'way\x20is\x20n'+_0x3493e1(0x33a)+_0x3493e1(0x150));return gatewayController;},_0x25596d=()=>{const _0x124cdc=_0x53f4;if(typeof productRuntime[_0x124cdc(0x2cf)+'ProductR'+_0x124cdc(0x18c)+_0x124cdc(0x2be)]!==_0x124cdc(0x199))return;const _0x137756=productRuntime[_0x124cdc(0x2cf)+_0x124cdc(0x2a0)+_0x124cdc(0x18c)+_0x124cdc(0x2be)]({'app':app,'BrowserWindow':BrowserWindow,'broadcast':broadcast,'configController':configController,'diagnosticEventFromError':diagnosticEventFromError,'diagnosticsWriter':diagnosticsWriter,'dialog':dialog,'exportLogsArchive':exportLogsArchive,'filesLogger':filesLogger,'getRuntimeSpawnContext':getRuntimeSpawnContext,'handle':_0x10a429,'mainLogger':mainLogger,'mainWindow':mainWindow,'rendererLogger':rendererLogger,'requireGateway':_0x1d533c,'sep':sep,'openClawConfigHandlers':{'update':(..._0x11a8d3)=>configController[_0x124cdc(0x1c4)+_0x124cdc(0xb5)+_0x124cdc(0x2a2)](..._0x11a8d3),'setPluginConfig':_0x532cbf=>configController[_0x124cdc(0x31e)+'lawPlugi'+_0x124cdc(0xd9)](_0x532cbf),'setChannelConfig':_0x2b23fc=>configController[_0x124cdc(0x31e)+_0x124cdc(0x21d)+'elConfig'](_0x2b23fc),'deleteChannelConfig':_0x564bc2=>configController[_0x124cdc(0x260)+'enClawCh'+'annelCon'+_0x124cdc(0x258)](_0x564bc2),'setSkillEntry':_0x303ae7=>configController[_0x124cdc(0x31e)+_0x124cdc(0x1e0)+_0x124cdc(0x37b)](_0x303ae7),'deleteSkillEntry':_0x6febab=>configController['deleteOp'+_0x124cdc(0x6a)+'illEntry'](_0x6febab),'setMcpServer':_0x538bbd=>configController['setOpenC'+_0x124cdc(0x1bc)+_0x124cdc(0x18d)](_0x538bbd),'deleteMcpServer':_0x2aa8fe=>configController[_0x124cdc(0x260)+_0x124cdc(0x21a)+'pServer'](_0x2aa8fe)},'shell':shell,'shellConfig':shellConfig,'resolveRuntimeKdocsCliCommand':resolveRuntimeKdocsCliCommand,'resolveRuntimeLarkCliCommand':resolveRuntimeLarkCliCommand,'summarizePayload':summarizePayload,'summarizeText':summarizeText,'toHomePath':toHomePath,'writeMutableConfig':_0x1f5818})||{};Object[_0x124cdc(0x1c9)](productRuntimeHooks,_0x137756);};_0x10a429(_0x18367f(0x32c),async()=>({'name':shellConfig[_0x18367f(0xc9)+'ame'],'version':app[_0x18367f(0x1ad)+'on'](),'appId':shellConfig[_0x18367f(0x8f)],'dataDir':shellConfig[_0x18367f(0x24c)]})),_0x10a429(_0x18367f(0x2c9)+_0x18367f(0x115),async(_0x4866c4,_0x34cd80)=>{const _0x1b68a8=_0x18367f,_0x474be4=typeof _0x34cd80===_0x1b68a8(0xaa)?_0x34cd80:'';if(!_0x474be4)return{'ok':![]};return filesLogger?.[_0x1b68a8(0x1f0)]('open\x20ext'+_0x1b68a8(0x2ec)+_0x1b68a8(0x33e)+_0x1b68a8(0xfb),{'url':summarizeText(_0x474be4,0xa0)}),await shell[_0x1b68a8(0x1e6)+'rnal'](_0x474be4),{'ok':!![]};});const _0x1f5818=async(_0x274b1e,_0x4662f5)=>{const _0x15708a=_0x18367f;return configController[_0x15708a(0x1ab)+_0x15708a(0x1fb)+'andledIn'+_0x15708a(0x189)](),await configController[_0x15708a(0x1e1)+_0x15708a(0x258)](_0x274b1e,_0x4662f5),{'ok':!![]};};_0x25596d(),_0x10a429(_0x18367f(0xd0)+_0x18367f(0x345)+'p',async(_0x1dbdcd,_0x2b13aa)=>importMarketSkillZip({'payload':_0x2b13aa,'importSkillZip':_0xc14680=>importSkillZip({..._0xc14680,'app':app,'dialog':dialog,'dialogWindow':BrowserWindow['fromWebC'+_0x18367f(0x17f)](_0x1dbdcd[_0x18367f(0x356)])||mainWindow,'configController':configController}),'configController':configController})),_0x10a429('skills:u'+'pdate',(_0x63b567,_0x4362a3)=>updateManagedSkillConfig({'payload':_0x4362a3,'configController':configController})),_0x10a429(_0x18367f(0x321)+_0x18367f(0x2a1),(_0xec0580,_0x314ba5)=>deleteMarketSkillRegistryEntry({'payload':_0x314ba5,'deleteManagedSkill':_0x3d743c=>deleteManagedSkill({..._0x3d743c,'gateway':_0x1d533c(),'configController':configController}),'configController':configController}));const _0x38edc9=ensureGeneratedFilesStore();_0x10a429(_0x18367f(0x236)+'rated-fi'+'les:list',async()=>_0x38edc9[_0x18367f(0x27f)]()),_0x10a429(_0x18367f(0x236)+_0x18367f(0x78)+'les:upse'+'rt',async(_0x178162,_0x47d893={})=>_0x38edc9[_0x18367f(0xee)](_0x47d893)),_0x10a429(_0x18367f(0x236)+_0x18367f(0x78)+_0x18367f(0x1bf),async(_0x134481,_0x1fd2f9)=>_0x38edc9['hide'](String(_0x1fd2f9||''))),_0x10a429(_0x18367f(0x236)+_0x18367f(0x78)+_0x18367f(0x1bf)+'-by-sess'+_0x18367f(0x35e),async(_0x1ee99b,_0x1112b0)=>_0x38edc9[_0x18367f(0x210)+_0x18367f(0x186)](String(_0x1112b0||''))),_0x10a429(_0x18367f(0x236)+'rated-fi'+_0x18367f(0x2ad)+'te',async(_0x2cb1ab,_0x86b27f)=>_0x38edc9['deleteFi'+'le'](String(_0x86b27f||''))),_0x10a429('app:gene'+_0x18367f(0x78)+_0x18367f(0x2ad)+_0x18367f(0x25f)+'e',async(_0x4a3895,_0x1849ee=[])=>_0x38edc9[_0x18367f(0x1f5)+'tate'](_0x1849ee)),_0x10a429(_0x18367f(0x236)+_0x18367f(0x78)+_0x18367f(0x1c7)+'al',async(_0x136bc3,_0x4d3d40)=>revealPathInFolder(_0x4d3d40)),_0x10a429(_0x18367f(0x2a4)+_0x18367f(0x2f1),async()=>_0x38edc9[_0x18367f(0x27f)]()),_0x10a429('artifact'+_0x18367f(0x19e),async(_0x2a76f5,_0x4d3a78={})=>_0x38edc9[_0x18367f(0xee)](_0x4d3a78)),_0x10a429(_0x18367f(0x2a4)+_0x18367f(0x2df),async(_0x3f64b3,_0x125bc2={})=>_0x38edc9[_0x18367f(0x28f)](String(_0x125bc2['id']||_0x125bc2||''))),_0x10a429(_0x18367f(0x2a4)+'s:delete',async(_0x1553df,_0x27da5d={})=>_0x38edc9[_0x18367f(0x32e)+'le'](String(_0x27da5d['id']||_0x27da5d||''))),_0x10a429(_0x18367f(0x2a4)+_0x18367f(0xb9)+_0x18367f(0x10d),async(_0x19f3f4,_0x3af715={})=>_0x38edc9[_0x18367f(0x1f5)+_0x18367f(0x18f)](_0x3af715[_0x18367f(0x1d9)]||_0x3af715)),_0x10a429('artifact'+'s:reveal',async(_0x5cf9c5,_0x31394f={})=>{const _0x256792=_0x18367f,_0xd964ce=typeof _0x31394f===_0x256792(0xaa)?_0x31394f:_0x31394f['path']||_0x31394f[_0x256792(0x163)];return revealPathInFolder(_0xd964ce);});const _0x11ceda=createPreferencesStore({'stateDir':configController[_0x18367f(0xb3)+'tateDir'](),'storeFile':_0x18367f(0x212)+_0x18367f(0x2ba)+_0x18367f(0x319)});_0x10a429(_0x18367f(0x300)+':get-clo'+'se',async()=>_0x11ceda[_0x18367f(0x2fc)]('closeToT'+_0x18367f(0x12b)+'se',![])),_0x10a429(_0x18367f(0x300)+_0x18367f(0xba)+'se',async(_0x560e8c,_0x3a8d41)=>_0x11ceda['set'](_0x18367f(0x2a3)+_0x18367f(0x12b)+'se',_0x3a8d41===!![])),registerFileHandlers({'app':app,'filesLogger':filesLogger,'handle':_0x10a429,'sep':sep,'stateDir':configController['resolveS'+_0x18367f(0x344)](),'toHomePath':toHomePath}),registerProductLogHandlers({'app':app,'configController':configController,'diagnosticEventFromError':diagnosticEventFromError,'diagnosticsWriter':diagnosticsWriter,'exportLogsArchive':exportLogsArchive,'handle':_0x10a429,'mainLogger':mainLogger,'rendererLogger':rendererLogger,'summarizeText':summarizeText,'toHomePath':toHomePath}),registerModelHandlers({'handle':_0x10a429,'modelHandlers':{'saveCustomModel':_0x1d6f1c=>_0x1d533c()[_0x18367f(0x29c)][_0x18367f(0x37f)+_0x18367f(0x69)](_0x1d6f1c),'deleteCustomModel':_0x414754=>_0x1d533c()[_0x18367f(0x29c)][_0x18367f(0x82)+_0x18367f(0x254)+'l'](_0x414754)}}),connectorController=createConnectorController({'shellConfig':shellConfig,'configController':configController,'broadcast':broadcast,'shell':shell,'getRuntimeSpawnContext':getRuntimeSpawnContext,'openClawConfigHandlers':{'update':(..._0x238eb2)=>configController[_0x18367f(0x1c4)+'enClawCo'+'nfig'](..._0x238eb2),'setPluginConfig':_0x54ab9d=>configController[_0x18367f(0x31e)+'lawPlugi'+_0x18367f(0xd9)](_0x54ab9d),'setChannelConfig':_0x4614a5=>configController[_0x18367f(0x31e)+_0x18367f(0x21d)+_0x18367f(0x134)](_0x4614a5),'deleteChannelConfig':_0x47e18e=>configController[_0x18367f(0x260)+_0x18367f(0x24f)+_0x18367f(0x125)+_0x18367f(0x258)](_0x47e18e),'setSkillEntry':_0x8a159c=>configController['setOpenC'+_0x18367f(0x1e0)+'Entry'](_0x8a159c),'deleteSkillEntry':_0x2ac42c=>configController[_0x18367f(0x260)+_0x18367f(0x6a)+_0x18367f(0xb0)](_0x2ac42c),'setMcpServer':_0x3861f4=>configController['setOpenC'+_0x18367f(0x1bc)+'rver'](_0x3861f4),'deleteMcpServer':_0xcc042=>configController['deleteOp'+'enClawMc'+'pServer'](_0xcc042)},'resolveRuntimeKdocsCliCommand':resolveRuntimeKdocsCliCommand,'resolveRuntimeLarkCliCommand':resolveRuntimeLarkCliCommand}),_0x10a429(_0x18367f(0x111)+_0x18367f(0x37e)+'ls:list',async()=>connectorController[_0x18367f(0x312)+_0x18367f(0x125)+_0x18367f(0x232)]()),_0x10a429('config:i'+_0x18367f(0x37e)+'ls:delet'+'e',async(_0x41bf90,_0x5e875e={})=>connectorController[_0x18367f(0x32a)+_0x18367f(0x30d)+'onfig'](_0x5e875e)),_0x10a429('config:i'+_0x18367f(0x37e)+_0x18367f(0x2b2)+_0x18367f(0x70),async(_0x441858,_0x5ef64e={})=>connectorController[_0x18367f(0xde)+_0x18367f(0x2e8)+_0x18367f(0x96)](_0x5ef64e)),_0x10a429(_0x18367f(0x2e4)+'onnector'+':save',async(_0x513b45,_0x57f93b={})=>{const _0x4a3770=_0x18367f,_0x56fd70=String(_0x57f93b[_0x4a3770(0x253)+'d']||_0x57f93b[_0x4a3770(0x333)]?.['channelI'+'d']||_0x57f93b[_0x4a3770(0x333)]?.['id']||'');if(!_0x56fd70)throw new Error(_0x4a3770(0x253)+_0x4a3770(0x299)+_0x4a3770(0x19f));const _0x2da110=_0x57f93b[_0x4a3770(0x333)]||_0x57f93b,_0x42c6fd={'feishu':connectorController['saveFeis'+_0x4a3770(0x361)+'lConfig'],'qqbot':connectorController[_0x4a3770(0x9a)+_0x4a3770(0x74)+_0x4a3770(0x31f)],'wecom':connectorController[_0x4a3770(0x320)+_0x4a3770(0x1b7)+_0x4a3770(0x31f)],'qq_mail':connectorController[_0x4a3770(0x1db)+'ilConnec'+_0x4a3770(0x1e2)+'g'],'netease_mail':connectorController[_0x4a3770(0x213)+_0x4a3770(0x2b9)+'onnector'+'Config'],'tencent_exmail':connectorController[_0x4a3770(0x306)+_0x4a3770(0x86)+'lConnect'+_0x4a3770(0x286)],'feishu_doc':connectorController[_0x4a3770(0x34c)+_0x4a3770(0x137)+_0x4a3770(0x2ae)+_0x4a3770(0x2a2)],'tencent_docs':connectorController[_0x4a3770(0x306)+_0x4a3770(0x201)+_0x4a3770(0x211)+_0x4a3770(0x31f)],'kdocs':connectorController[_0x4a3770(0x2f8)+_0x4a3770(0x30b)+'orConfig'],'dingtalk_doc':connectorController['saveDing'+_0x4a3770(0x145)+_0x4a3770(0x211)+_0x4a3770(0x31f)]},_0x31e8ae=_0x42c6fd[_0x56fd70];if(!_0x31e8ae)throw new Error(_0x4a3770(0x25c)+_0x4a3770(0x1f9)+_0x4a3770(0x332)+_0x56fd70);return _0x31e8ae(_0x2da110);}),_0x10a429(_0x18367f(0x2e4)+_0x18367f(0x211)+':save-fe'+'ishu-cha'+_0x18367f(0x159),async(_0x5d6807,_0x483578={})=>connectorController[_0x18367f(0x34c)+_0x18367f(0x361)+'lConfig'](_0x483578)),_0x10a429(_0x18367f(0x2e4)+_0x18367f(0x211)+':save-qq'+'bot-chan'+_0x18367f(0x26f),async(_0x2fa857,_0x2a9e9b={})=>connectorController['saveQqbo'+_0x18367f(0x74)+_0x18367f(0x31f)](_0x2a9e9b)),_0x10a429(_0x18367f(0x2e4)+_0x18367f(0x211)+':save-we'+_0x18367f(0x251)+_0x18367f(0x26f),async(_0x512aa2,_0x3124e9={})=>connectorController[_0x18367f(0x320)+_0x18367f(0x1b7)+_0x18367f(0x31f)](_0x3124e9)),_0x10a429('config:c'+_0x18367f(0x211)+_0x18367f(0x325)+'-mail',async(_0x2c3fb6,_0x28c607={})=>connectorController[_0x18367f(0x1db)+'ilConnec'+'torConfi'+'g'](_0x28c607)),_0x10a429(_0x18367f(0x2e4)+_0x18367f(0x211)+_0x18367f(0xfc)+_0x18367f(0x331)+'il',async(_0x3f7637,_0x536464={})=>connectorController[_0x18367f(0x213)+'aseMailC'+_0x18367f(0x211)+_0x18367f(0x31f)](_0x536464)),_0x10a429('config:c'+_0x18367f(0x211)+_0x18367f(0x336)+_0x18367f(0x105)+'mail',async(_0x331d80,_0x36efa0={})=>connectorController[_0x18367f(0x306)+_0x18367f(0x86)+'lConnect'+'orConfig'](_0x36efa0)),_0x10a429('config:c'+'onnector'+_0x18367f(0x195)+_0x18367f(0x29a),async(_0x25de85,_0x183b0d={})=>connectorController[_0x18367f(0x34c)+'huDocCon'+'nectorCo'+'nfig'](_0x183b0d)),_0x10a429('config:c'+_0x18367f(0x211)+':save-te'+_0x18367f(0x12a)+'cs',async(_0x140231,_0x496c52={})=>connectorController[_0x18367f(0x306)+_0x18367f(0x201)+_0x18367f(0x211)+'Config'](_0x496c52)),_0x10a429('config:c'+_0x18367f(0x211)+_0x18367f(0x290)+_0x18367f(0x340),async(_0x1db090,_0x1587dd={})=>connectorController[_0x18367f(0x2f8)+_0x18367f(0x30b)+_0x18367f(0x286)](_0x1587dd)),_0x10a429(_0x18367f(0x2e4)+'onnector'+_0x18367f(0x1dd)+_0x18367f(0x178)+'oc',async(_0x13443d,_0x329459={})=>connectorController[_0x18367f(0x350)+_0x18367f(0x145)+_0x18367f(0x211)+'Config'](_0x329459)),_0x10a429(_0x18367f(0x2e4)+_0x18367f(0x211)+_0x18367f(0x2f0)+_0x18367f(0x208),async(_0x3a96d0,_0x34be15={})=>{const _0x5e67e7=_0x18367f,_0x3f80d=String(_0x34be15['channelI'+'d']||_0x34be15[_0x5e67e7(0x270)]||'');if(_0x3f80d===_0x5e67e7(0x6e))return connectorController[_0x5e67e7(0x161)+_0x5e67e7(0x167)+_0x5e67e7(0x255)+_0x5e67e7(0x35e)]();if(_0x3f80d===_0x5e67e7(0x2a5)+'oc')return connectorController[_0x5e67e7(0x377)+_0x5e67e7(0x1ff)+'iConnect'+'Session']();if(_0x3f80d===_0x5e67e7(0x341))return connectorController['startFei'+'shuRegis'+'trationS'+_0x5e67e7(0x374)](_0x34be15);if(_0x3f80d==='openclaw'+_0x5e67e7(0x2ab)||_0x3f80d===_0x5e67e7(0x13f))return connectorController[_0x5e67e7(0x352)+_0x5e67e7(0x1af)+_0x5e67e7(0x192)+'n']({'gatewayPort':_0x1d533c()[_0x5e67e7(0x84)+_0x5e67e7(0x157)](),'gatewayToken':_0x1d533c()[_0x5e67e7(0x1d1)+_0x5e67e7(0xa7)]()});throw new Error(_0x5e67e7(0x25c)+_0x5e67e7(0x1f9)+_0x5e67e7(0x287)+_0x5e67e7(0x94)+(_0x3f80d||'unknown'));}),_0x10a429(_0x18367f(0x2e4)+_0x18367f(0x211)+_0x18367f(0x2f0)+_0x18367f(0x104),async(_0x14c26e,_0x2a9ce5={})=>{const _0x4f045f=_0x18367f,_0x17492e=String(_0x2a9ce5[_0x4f045f(0x253)+'d']||_0x2a9ce5[_0x4f045f(0x270)]||'');if(_0x17492e===_0x4f045f(0x6e))return connectorController[_0x4f045f(0x261)+_0x4f045f(0xe3)+'ctStatus'](_0x2a9ce5);if(_0x17492e==='feishu_d'+'oc')return connectorController[_0x4f045f(0x380)+_0x4f045f(0xe1)+'onnectSt'+_0x4f045f(0x35b)](_0x2a9ce5);if(_0x17492e===_0x4f045f(0x341))return connectorController['getFeish'+'uRegistr'+'ationSta'+_0x4f045f(0x8b)](_0x2a9ce5);throw new Error(_0x4f045f(0x25c)+_0x4f045f(0x1f9)+_0x4f045f(0x287)+_0x4f045f(0x94)+(_0x17492e||_0x4f045f(0x209)));}),_0x10a429(_0x18367f(0x2e4)+'onnector'+_0x18367f(0x2f0)+_0x18367f(0x24a),async(_0x520280,_0x51d869={})=>{const _0x153e7f=_0x18367f,_0x2e1852=String(_0x51d869[_0x153e7f(0x253)+'d']||_0x51d869[_0x153e7f(0x270)]||'');if(_0x2e1852==='kdocs')return connectorController[_0x153e7f(0xec)+_0x153e7f(0x24e)+_0x153e7f(0x1d5)+_0x153e7f(0x118)](_0x51d869);if(_0x2e1852==='feishu_d'+'oc')return connectorController[_0x153e7f(0x263)+'ishuDocC'+_0x153e7f(0x314)+_0x153e7f(0x75)](_0x51d869);if(_0x2e1852===_0x153e7f(0x341))return connectorController[_0x153e7f(0x263)+_0x153e7f(0x2f3)+'stration'+_0x153e7f(0x2c8)](_0x51d869);if(_0x2e1852===_0x153e7f(0x324)+'-weixin'||_0x2e1852===_0x153e7f(0x13f))return connectorController[_0x153e7f(0xcf)+_0x153e7f(0x1f2)+_0x153e7f(0x28e)+'on']();return{'ok':!![]};}),_0x10a429(_0x18367f(0x2e4)+_0x18367f(0x211)+_0x18367f(0x2f0)+_0x18367f(0x16b)+'e',async(_0x1260fa,_0x39e740={})=>{const _0x57d3bf=_0x18367f,_0x68fe3=String(_0x39e740[_0x57d3bf(0x253)+'d']||_0x39e740[_0x57d3bf(0x270)]||'');if(_0x68fe3==='feishu_d'+'oc')return connectorController[_0x57d3bf(0x116)+'FeishuDo'+_0x57d3bf(0x27c)+_0x57d3bf(0x230)+'on'](_0x39e740);throw new Error(_0x57d3bf(0x25c)+_0x57d3bf(0x1f9)+_0x57d3bf(0x287)+'ssion:\x20'+(_0x68fe3||_0x57d3bf(0x209)));}),_0x10a429(_0x18367f(0x10a)+_0x18367f(0x295),()=>connectorController[_0x18367f(0x17c)+'igSnapsh'+'ot']());const _0x183918=_0x23b59c=>{const _0x1132ee=_0x18367f,_0x4c2b0e=_0x23b59c[_0x1132ee(0x35d)]&&typeof _0x23b59c[_0x1132ee(0x35d)]===_0x1132ee(0x257)?_0x23b59c[_0x1132ee(0x35d)]:{};return Array[_0x1132ee(0x1c2)](_0x4c2b0e[_0x1132ee(0x27f)])?_0x4c2b0e[_0x1132ee(0x27f)]:[];},_0x1ba225=_0x1c8fa8=>{const _0x547790=_0x18367f,_0x435afa=typeof _0x1c8fa8===_0x547790(0xaa)?_0x1c8fa8[_0x547790(0x19c)]():'',_0x33fe36=_0x435afa[_0x547790(0x153)](/^agent:([^:]+):/);return _0x33fe36?.[0x1]||'';},_0xbec0ac=(_0x38913e={},_0x126bc2=[])=>{const _0x439fcf=_0x18367f,_0x532bf1=Array['isArray'](_0x38913e[_0x439fcf(0x35d)])?_0x38913e['agents']:Array[_0x439fcf(0x1c2)](_0x38913e[_0x439fcf(0x27f)])?_0x38913e[_0x439fcf(0x27f)]:[],_0x709058=Array[_0x439fcf(0x1c2)](_0x126bc2)?_0x126bc2:[];return _0x532bf1[_0x439fcf(0x22d)](_0x54affd=>{const _0x468409=_0x439fcf,_0x5814d0=String(_0x54affd?.['id']||_0x54affd?.[_0x468409(0x310)]||'')[_0x468409(0x19c)]();return{'agent':_0x54affd,'sessions':_0x5814d0?_0x709058[_0x468409(0x371)](_0x233cc0=>{const _0x1e419f=_0x468409,_0x557f2c=String(_0x233cc0?.['agentId']||_0x233cc0?.[_0x1e419f(0xbc)]||_0x233cc0?.['agent']?.['id']||_0x1ba225(_0x233cc0?.[_0x1e419f(0x1aa)])||'')[_0x1e419f(0x19c)]();return _0x557f2c?_0x557f2c===_0x5814d0:_0x5814d0===_0x1e419f(0x368);}):[]};});};_0x10a429('app:upda'+_0x18367f(0xca)+_0x18367f(0x18f),async()=>updateController?.[_0x18367f(0x184)]()),_0x10a429(_0x18367f(0x28a)+'te:check',async()=>updateController?.[_0x18367f(0x1ac)+_0x18367f(0x148)]()),_0x10a429(_0x18367f(0x28a)+'te:downl'+_0x18367f(0x214),async()=>updateController?.['download'+_0x18367f(0x2c5)]()),_0x10a429(_0x18367f(0x28a)+_0x18367f(0x123)+'and-inst'+_0x18367f(0x233),async()=>updateController?.[_0x18367f(0x256)+'nstall']()),_0x10a429(_0x18367f(0x112)+_0x18367f(0x32f),async(_0x165941,_0x1b5f5d={})=>{const _0x29fbe7=_0x18367f,_0x2f02fb=await dialog[_0x29fbe7(0x1eb)+'Dialog'](BrowserWindow[_0x29fbe7(0x2bd)+_0x29fbe7(0x17f)](_0x165941['sender'])??mainWindow,{'properties':[_0x29fbe7(0x375),..._0x1b5f5d?.['limit']!==0x1?[_0x29fbe7(0x307)+_0x29fbe7(0xfe)]:[]],'filters':_0x1b5f5d?.['customNa'+_0x29fbe7(0x15e)+'s']?[{'name':_0x29fbe7(0xc6),'extensions':_0x1b5f5d['customNa'+_0x29fbe7(0x15e)+'s']}]:undefined});return _0x2f02fb[_0x29fbe7(0xc8)+'s'][_0x29fbe7(0x22d)](_0x2a5571=>({'path':_0x2a5571,'name':_0x2a5571[_0x29fbe7(0x83)](/[\\/]/)[_0x29fbe7(0x71)]()||_0x2a5571}));}),_0x10a429(_0x18367f(0x112)+_0x18367f(0x106)+'d-local',async(_0x5dc692,_0x1aabb1={})=>{const _0x273b5b=_0x18367f,_0x1401a3=String(_0x1aabb1['sourcePa'+'th']||'');if(!_0x1401a3)return{'success':![],'error':_0x273b5b(0x2c1)+_0x273b5b(0x220)+_0x273b5b(0x16c)};const _0x538ec9=await dialog[_0x273b5b(0x6d)+_0x273b5b(0x318)](mainWindow,{'defaultPath':_0x1aabb1['defaultF'+_0x273b5b(0x342)]||_0x1401a3[_0x273b5b(0x83)](/[\\/]/)[_0x273b5b(0x71)]()});if(_0x538ec9[_0x273b5b(0x30e)]||!_0x538ec9[_0x273b5b(0xc8)])return{'success':![],'canceled':!![]};const {copyFile:_0x4752fc}=await import(_0x273b5b(0x15a)+_0x273b5b(0x141));return await _0x4752fc(_0x1401a3,_0x538ec9[_0x273b5b(0xc8)]),{'success':!![],'filePath':_0x538ec9[_0x273b5b(0xc8)]};}),_0x10a429('app:clip'+_0x18367f(0x292)+_0x18367f(0x29d),async(_0x44db88,_0x4834a4)=>{const _0x41d779=_0x18367f;return clipboard[_0x41d779(0xc2)+'t'](String(_0x4834a4??'')),{'ok':!![]};}),_0x10a429(_0x18367f(0x2b1)+'em:resta'+'rt',async()=>{const _0x42db28=_0x18367f;return app[_0x42db28(0x2e9)](),app[_0x42db28(0x11f)](),{'ok':!![]};}),_0x10a429(_0x18367f(0x25e)+_0x18367f(0xf7)+_0x18367f(0x327),_0x1a45a5=>Boolean(BrowserWindow[_0x18367f(0x2bd)+_0x18367f(0x17f)](_0x1a45a5['sender'])?.[_0x18367f(0x9b)+_0x18367f(0x327)]())),_0x10a429(_0x18367f(0x143)+_0x18367f(0x12c),async(_0x1e29bf,_0x4386da)=>{const _0x385ce8=_0x18367f;return app[_0x385ce8(0x25d)+_0x385ce8(0x11a)+_0x385ce8(0xf9)]({'openAtLogin':_0x4386da===!![]}),{'ok':!![],'enabled':_0x4386da===!![]};}),_0x10a429(_0x18367f(0x143)+_0x18367f(0xe7),async()=>app[_0x18367f(0x35f)+_0x18367f(0x11a)+_0x18367f(0xf9)]()['openAtLo'+'gin']),_0x10a429(_0x18367f(0x112)+':choose-'+_0x18367f(0x346),async _0x588830=>{const _0x417ab9=_0x18367f,_0x218756=await dialog[_0x417ab9(0x1eb)+_0x417ab9(0x318)](BrowserWindow[_0x417ab9(0x2bd)+_0x417ab9(0x17f)](_0x588830[_0x417ab9(0x356)])??mainWindow,{'properties':[_0x417ab9(0x154)+'ctory']});return _0x218756[_0x417ab9(0xc8)+'s'][0x0]||'';}),_0x10a429(_0x18367f(0x2b1)+_0x18367f(0x378)+_0x18367f(0x346),async(_0x1955bf,_0x44b79b)=>{const _0x5b1293=await shell['openPath'](String(_0x44b79b||''));return _0x5b1293||'';}),_0x10a429('openclaw'+_0x18367f(0x1a8)+'-token',async()=>_0x1d533c()[_0x18367f(0x1d1)+_0x18367f(0xa7)]()),_0x10a429(_0x18367f(0x324)+_0x18367f(0x1a8)+_0x18367f(0x11e),async()=>_0x1d533c()['gatewayP'+_0x18367f(0x157)]()),_0x10a429('openclaw'+_0x18367f(0xf0)+'e',async(_0x2782a2,_0x5eb292=[])=>{const _0x2322bb=_0x18367f,_0x44088c=await runClawOnce(shellConfig[_0x2322bb(0x65)+_0x2322bb(0x2d8)],Array['isArray'](_0x5eb292)?_0x5eb292:[]);return{'ok':_0x44088c[_0x2322bb(0xb2)]===0x0,..._0x44088c};}),_0x10a429(_0x18367f(0x174)+_0x18367f(0x113),async(_0x45499b,_0x30923b={})=>_0x1d533c()['sessions'][_0x18367f(0x23d)]({..._0x30923b,'parentSessionKey':_0x30923b[_0x18367f(0xdb)+_0x18367f(0x36f)]||_0x30923b[_0x18367f(0x2d1)+'ey']}));const _0x12c05f=configController[_0x18367f(0xb3)+_0x18367f(0x344)]();sessionSqliteStore=ensureSessionSqliteStore();const _0x1df262=createAgentSessionsMapStore({'stateDir':_0x12c05f});_0x10a429(_0x18367f(0x174)+_0x18367f(0xdf)+_0x18367f(0x298),async(_0x5c6399,_0x8a8e5f={})=>_0x1df262['get'](_0x8a8e5f)),_0x10a429(_0x18367f(0x174)+_0x18367f(0xdf)+'ap:upser'+'t',async(_0x2533b4,_0x31b424={})=>_0x1df262[_0x18367f(0xee)](_0x31b424)),_0x10a429('sessions'+':agent-m'+_0x18367f(0x16a),async(_0x26a017,_0x2301eb={})=>{const _0x32337d=_0x18367f,_0x5e040d=String(_0x2301eb[_0x32337d(0x2d1)+'ey']||'')['trim']();if(!_0x5e040d)return null;return await sessionSqliteStore[_0x32337d(0x13b)+_0x32337d(0x10e)](_0x5e040d);}),_0x10a429('agents:c'+'reate',async(_0x4bb966,_0x418215={})=>{const _0x1fa44f=_0x18367f,_0x40c0cb=await readMutableConfig(),_0x1e2b4d=_0x40c0cb[_0x1fa44f(0x35d)]&&typeof _0x40c0cb[_0x1fa44f(0x35d)]===_0x1fa44f(0x257)?_0x40c0cb['agents']:{},_0x5363b3=_0x183918(_0x40c0cb),_0x2e4dd0=String(_0x418215['id']||_0x418215['name']||_0x1fa44f(0xa0)+Date[_0x1fa44f(0x2b0)]())[_0x1fa44f(0x19c)]()['replace'](/\s+/g,'-'),_0x501613={'id':_0x2e4dd0,'name':String(_0x418215[_0x1fa44f(0xe4)]||_0x2e4dd0),..._0x418215[_0x1fa44f(0x22e)+'e']?{'workspace':String(_0x418215[_0x1fa44f(0x22e)+'e'])}:{},..._0x418215[_0x1fa44f(0x18a)]?{'model':_0x418215['model']}:{},..._0x418215[_0x1fa44f(0x273)]?{'emoji':_0x418215[_0x1fa44f(0x273)]}:{},..._0x418215[_0x1fa44f(0x2a7)]?{'avatar':_0x418215[_0x1fa44f(0x2a7)]}:{},...Array[_0x1fa44f(0x1c2)](_0x418215['skills'])?{'skills':_0x418215['skills']}:{}};if(_0x5363b3['some'](_0xd847ee=>_0xd847ee?.['id']===_0x2e4dd0))throw new Error(_0x1fa44f(0x2cd)+'ready\x20ex'+_0x1fa44f(0x2e0));return _0x1e2b4d[_0x1fa44f(0x27f)]=[..._0x5363b3,_0x501613],_0x40c0cb[_0x1fa44f(0x35d)]=_0x1e2b4d,await _0x1f5818(_0x40c0cb,_0x1fa44f(0x8c)+_0x1fa44f(0x23e)),{'ok':!![],'agent':_0x501613};}),_0x10a429(_0x18367f(0x66)+'pdate',async(_0x2bf309,_0x5bb816={})=>{const _0x5d5d59=_0x18367f,_0xf9b52a=String(_0x5bb816['id']||_0x5bb816[_0x5d5d59(0x310)]||'')[_0x5d5d59(0x19c)]();if(!_0xf9b52a)throw new Error(_0x5d5d59(0x2f7)+_0x5d5d59(0x206)+_0x5d5d59(0x155));const _0x15a2da=await readMutableConfig(),_0x4c5138=_0x15a2da['agents']&&typeof _0x15a2da['agents']===_0x5d5d59(0x257)?_0x15a2da[_0x5d5d59(0x35d)]:{},_0x4c218d=_0x183918(_0x15a2da),_0x1fb231=_0x4c218d[_0x5d5d59(0x22d)](_0x43a33f=>_0x43a33f?.['id']===_0xf9b52a?{..._0x43a33f,..._0x5bb816,'id':_0xf9b52a}:_0x43a33f);return _0x4c5138[_0x5d5d59(0x27f)]=_0x1fb231,_0x15a2da[_0x5d5d59(0x35d)]=_0x4c5138,await _0x1f5818(_0x15a2da,_0x5d5d59(0x28d)+'dated'),{'ok':!![],'agent':_0x1fb231['find'](_0x51fcff=>_0x51fcff?.['id']===_0xf9b52a)||null};}),_0x10a429(_0x18367f(0x181)+'elete',async(_0x4035b8,_0x2a476d={})=>{const _0x30d8ce=_0x18367f,_0x207713=String(_0x2a476d['id']||_0x2a476d['agentId']||'')[_0x30d8ce(0x19c)]();if(!_0x207713)throw new Error(_0x30d8ce(0x2f7)+_0x30d8ce(0x206)+_0x30d8ce(0x155));const _0x85da00=await readMutableConfig(),_0x20addb=_0x85da00[_0x30d8ce(0x35d)]&&typeof _0x85da00[_0x30d8ce(0x35d)]==='object'?_0x85da00[_0x30d8ce(0x35d)]:{};return _0x20addb[_0x30d8ce(0x27f)]=_0x183918(_0x85da00)['filter'](_0x401963=>_0x401963?.['id']!==_0x207713),_0x85da00[_0x30d8ce(0x35d)]=_0x20addb,await _0x1f5818(_0x85da00,_0x30d8ce(0x1be)+_0x30d8ce(0x165)),{'ok':!![],'agentId':_0x207713};}),_0x10a429(_0x18367f(0xf6)+_0x18367f(0x364)+_0x18367f(0x191)+'t',async(_0x539b51,_0x11476b={})=>{const _0x4b2cc5=_0x18367f,[_0x542b0e,_0x19d054]=await Promise[_0x4b2cc5(0x233)]([_0x1d533c()[_0x4b2cc5(0x35d)][_0x4b2cc5(0x27f)](),_0x1d533c()[_0x4b2cc5(0x174)][_0x4b2cc5(0x27f)](_0x11476b)[_0x4b2cc5(0x2b3)](()=>({'sessions':[]}))]),_0x4ef249=Array[_0x4b2cc5(0x1c2)](_0x19d054[_0x4b2cc5(0x174)])?_0x19d054[_0x4b2cc5(0x174)]:[];return{..._0x542b0e,'sessions':_0x4ef249,'groups':Array[_0x4b2cc5(0x1c2)](_0x542b0e[_0x4b2cc5(0x176)])?_0x542b0e[_0x4b2cc5(0x176)]:_0xbec0ac(_0x542b0e,_0x4ef249)};}),terminalManager=createTerminalManager({'cwd':join(configController['resolveS'+_0x18367f(0x344)](),_0x18367f(0x22e)+'e'),'emitData':_0xefe555=>broadcast('terminal'+_0x18367f(0x34a),_0xefe555),'emitExit':_0x372ed0=>broadcast(_0x18367f(0x2c2)+'-exit',_0x372ed0)}),_0x10a429(_0x18367f(0x2c2)+_0x18367f(0x226),async(_0x33849e,_0x3d457b={})=>terminalManager[_0x18367f(0x23d)](_0x3d457b)),_0x10a429(_0x18367f(0x2c2)+_0x18367f(0x35c),async(_0x49db1d,_0x19b3f1={})=>terminalManager[_0x18367f(0x1c5)](_0x19b3f1)),_0x10a429(_0x18367f(0x2c2)+':resize',async(_0x5721a4,_0x350dfa={})=>terminalManager['resize'](_0x350dfa)),_0x10a429(_0x18367f(0x2c2)+':close',async(_0x4b9099,_0x468e51={})=>terminalManager[_0x18367f(0x103)](_0x468e51)),_0x10a429(_0x18367f(0x14a)+_0x18367f(0x27f),async()=>{const _0x5d1553=_0x18367f,_0x137b69=gatewayController?.[_0x5d1553(0x1b0)+'nfo']?.()||{};return _0x137b69['plugins']||[];}),_0x10a429('plugins:'+_0x18367f(0x242)+'ig',async(_0x3e6022,_0x1ff0d2={})=>{const _0x20e656=_0x18367f,_0x403882=String(_0x1ff0d2[_0x20e656(0xd1)]||_0x1ff0d2['id']||''),_0xc4bff4=await readMutableConfig(),_0x30cc02=_0xc4bff4[_0x20e656(0xe0)]?.[_0x20e656(0x177)]||{};return _0x403882?_0x30cc02[_0x403882]||null:_0x30cc02;}),_0x10a429(_0x18367f(0x14a)+_0x18367f(0x7c)+_0x18367f(0x1d6),async(_0x250479,_0x50f03b={})=>{const _0x3547f6=_0x18367f,_0x2ccca7=String(_0x50f03b[_0x3547f6(0xd1)]||_0x50f03b['id']||'');if(!_0x2ccca7)throw new Error('pluginId'+_0x3547f6(0x206)+'ired');const _0x25afe8=await readMutableConfig(),_0x46a75f=_0x25afe8[_0x3547f6(0xe0)]&&typeof _0x25afe8[_0x3547f6(0xe0)]===_0x3547f6(0x257)?_0x25afe8[_0x3547f6(0xe0)]:{},_0x1da1f2=_0x46a75f[_0x3547f6(0x177)]&&typeof _0x46a75f[_0x3547f6(0x177)]===_0x3547f6(0x257)?_0x46a75f[_0x3547f6(0x177)]:{};return _0x1da1f2[_0x2ccca7]={..._0x1da1f2[_0x2ccca7]||{},..._0x50f03b['config']||_0x50f03b['patch']||{}},_0x46a75f['entries']=_0x1da1f2,_0x25afe8[_0x3547f6(0xe0)]=_0x46a75f,_0x1f5818(_0x25afe8,_0x3547f6(0x22b)+_0x3547f6(0x80)+'dated');}),_0x10a429(_0x18367f(0x14a)+_0x18367f(0x376),async(_0x4812e8,_0x365406={})=>{const _0x2b9efb=_0x18367f,_0x3bee1f=String(_0x365406[_0x2b9efb(0xd1)]||_0x365406['id']||'');if(!_0x3bee1f)throw new Error(_0x2b9efb(0xd1)+'\x20is\x20requ'+_0x2b9efb(0x155));const _0x7d3d35=await readMutableConfig(),_0x3a1181=_0x7d3d35[_0x2b9efb(0xe0)]&&typeof _0x7d3d35['plugins']===_0x2b9efb(0x257)?_0x7d3d35[_0x2b9efb(0xe0)]:{},_0x559149=_0x3a1181[_0x2b9efb(0x177)]&&typeof _0x3a1181[_0x2b9efb(0x177)]===_0x2b9efb(0x257)?_0x3a1181['entries']:{};return _0x559149[_0x3bee1f]={..._0x559149[_0x3bee1f]||{},'enabled':!![]},_0x3a1181[_0x2b9efb(0x177)]=_0x559149,_0x7d3d35[_0x2b9efb(0xe0)]=_0x3a1181,_0x1f5818(_0x7d3d35,_0x2b9efb(0x8e)+'nabled');}),_0x10a429(_0x18367f(0x14a)+_0x18367f(0xe2),async(_0x42b3e3,_0xee79a={})=>{const _0xba9590=_0x18367f,_0x4c1340=String(_0xee79a[_0xba9590(0xd1)]||_0xee79a['id']||'');if(!_0x4c1340)throw new Error(_0xba9590(0xd1)+_0xba9590(0x206)+_0xba9590(0x155));const _0x235988=await readMutableConfig(),_0x40bddb=_0x235988[_0xba9590(0xe0)]&&typeof _0x235988[_0xba9590(0xe0)]==='object'?_0x235988[_0xba9590(0xe0)]:{},_0x5d4bde=_0x40bddb[_0xba9590(0x177)]&&typeof _0x40bddb[_0xba9590(0x177)]==='object'?_0x40bddb[_0xba9590(0x177)]:{};return _0x5d4bde[_0x4c1340]={..._0x5d4bde[_0x4c1340]||{},'enabled':![]},_0x40bddb[_0xba9590(0x177)]=_0x5d4bde,_0x235988[_0xba9590(0xe0)]=_0x40bddb,_0x1f5818(_0x235988,_0xba9590(0x180)+_0xba9590(0x135));}),_0x10a429(_0x18367f(0x14a)+_0x18367f(0x7a),async(_0xb1a079,_0x2d526d={})=>({'plugins':await((async()=>{const _0x14ed42=_0x18367f,_0x2b0f96=gatewayController?.[_0x14ed42(0x1b0)+_0x14ed42(0x1fa)]?.()||{};if(!_0x2d526d?.['pluginId']&&!_0x2d526d?.['id'])return _0x2b0f96['plugins']||[];const _0x14687b=String(_0x2d526d[_0x14ed42(0xd1)]||_0x2d526d['id']||'');return(_0x2b0f96['plugins']||[])[_0x14ed42(0x371)](_0x320f23=>_0x320f23[_0x14ed42(0xd1)]===_0x14687b);})())})),_0x10a429(_0x18367f(0x19b)+'igate',async(_0x4c5210,_0x305726)=>({'ok':!![],'payload':_0x305726})),_0x10a429(_0x18367f(0x1cd)+_0x18367f(0x1ba)+'e',async(_0x8eee87,_0x5c8340)=>{const _0x4cd017=_0x18367f;return broadcast(_0x4cd017(0xbe)+_0x4cd017(0x128),_0x5c8340),{'ok':!![]};}),_0x10a429(_0x18367f(0x31b)+_0x18367f(0x381)+_0x18367f(0x166),async()=>{const _0x2e0115=_0x18367f;return broadcast(_0x2e0115(0x77)+_0x2e0115(0x166)+_0x2e0115(0x91),{}),{'ok':!![]};}),_0x10a429('tabs:ref'+'resh-age'+_0x18367f(0x166),async(_0x279e3e,_0x55f580={})=>{const _0x44dab7=_0x18367f;return broadcast('tabs-age'+_0x44dab7(0x166)+_0x44dab7(0x282)+_0x44dab7(0x91),_0x55f580),{'ok':!![]};}),_0x10a429('window:m'+'inimize',_0x2aa01d=>{const _0x3ac15d=_0x18367f;return BrowserWindow['fromWebC'+_0x3ac15d(0x17f)](_0x2aa01d[_0x3ac15d(0x356)])?.[_0x3ac15d(0x1ea)](),{'ok':!![]};}),_0x10a429(_0x18367f(0x2cb)+_0x18367f(0x194)+_0x18367f(0x1d3),_0x45d7ab=>{const _0x1f9ae1=_0x18367f,_0x11268e=BrowserWindow[_0x1f9ae1(0x2bd)+_0x1f9ae1(0x17f)](_0x45d7ab[_0x1f9ae1(0x356)]);if(!_0x11268e)return{'isMaximized':![]};if(_0x11268e[_0x1f9ae1(0x9b)+_0x1f9ae1(0x327)]())_0x11268e[_0x1f9ae1(0x34b)+'ze']();else _0x11268e[_0x1f9ae1(0x2af)]();return{'isMaximized':_0x11268e[_0x1f9ae1(0x9b)+_0x1f9ae1(0x327)]()};}),_0x10a429(_0x18367f(0x2d4)+_0x18367f(0x160),_0x2b64a2=>{const _0x32f726=_0x18367f;return BrowserWindow['fromWebC'+'ontents'](_0x2b64a2[_0x32f726(0x356)])?.['close'](),{'ok':!![]};}),_0x10a429(_0x18367f(0xcd)+_0x18367f(0x130)+_0x18367f(0x1e4),()=>openDevToolsForActiveContext()),_0x10a429(_0x18367f(0x324)+':runtime'+'-info',()=>_0x1d533c()[_0x18367f(0x1b0)+'nfo']()),_0x10a429(_0x18367f(0x324)+_0x18367f(0x1a8)+_0x18367f(0x1c1),async()=>(await ensureGatewayControllerStarted())['getStatu'+'s']()),_0x10a429(_0x18367f(0x324)+_0x18367f(0x1a8)+_0x18367f(0x304),()=>_0x1d533c()[_0x18367f(0x17a)](_0x18367f(0x31a)+_0x18367f(0x219))),_0x10a429(_0x18367f(0x324)+':loading'+_0x18367f(0x67)+_0x18367f(0x20e),async()=>({'loadingLifeCycle':_0x18367f(0x2dc),'message':'','updatedAt':new Date()[_0x18367f(0x175)+'ing']()})),_0x10a429('openclaw'+_0x18367f(0x1a8)+_0x18367f(0x17b),(_0x386e26,_0x174a0d={})=>_0x1d533c()[_0x18367f(0xf5)+_0x18367f(0x289)](_0x174a0d?.['limit']??0xc8)),_0x10a429(_0x18367f(0x324)+_0x18367f(0x25a)+_0x18367f(0xa8)+_0x18367f(0x329)+'n',(_0x7720d8,_0x566223)=>_0x1d533c()[_0x18367f(0x21f)+'kUserQue'+_0x18367f(0x7f)](_0x566223)),_0x10a429('openclaw'+_0x18367f(0x196)+_0x18367f(0xf1),async()=>{const _0x46b57a=_0x18367f,_0xf13934=join(resolveRuntimeRoot(shellConfig[_0x46b57a(0x65)+_0x46b57a(0x2d8)]),_0x46b57a(0x100),_0x46b57a(0xb6)+'w');if(!existsSync(_0xf13934))throw new Error(_0x46b57a(0x324)+'\x20CLI\x20wra'+_0x46b57a(0x101)+_0x46b57a(0x311)+_0xf13934+(_0x46b57a(0x16e)+_0x46b57a(0x23c)+_0x46b57a(0x373)+_0x46b57a(0x29f)));const _0x50f967=join(app[_0x46b57a(0x29e)](_0x46b57a(0x355)),_0x46b57a(0x6c)+_0x46b57a(0x13a)+_0x46b57a(0x265));await writeFile(_0x50f967,'#!/bin/s'+_0x46b57a(0x280)+_0xf13934['replace'](/\\/g,'\x5c\x5c')[_0x46b57a(0x370)](/"/g,'\x5c\x22')+'\x22\x0a',{'mode':0x1ed});const _0x3c6f4a=spawn('open',['-a',_0x46b57a(0xef),_0x50f967],{'detached':!![],'stdio':'ignore'});return _0x3c6f4a[_0x46b57a(0x275)](),{'ok':!![],'cliPath':_0xf13934};}),_0x10a429(_0x18367f(0x1ef)+_0x18367f(0xdd),()=>_0x1d533c()['agents'][_0x18367f(0x27f)]()),_0x10a429(_0x18367f(0x1fc)+'tatus',(_0x2559ed,_0x54ab37)=>_0x1d533c()[_0x18367f(0x239)][_0x18367f(0x7a)](_0x54ab37)),_0x10a429(_0x18367f(0x174)+_0x18367f(0x226),(_0x3315fa,_0x28bc71)=>_0x1d533c()[_0x18367f(0x174)][_0x18367f(0x23d)](_0x28bc71)),_0x10a429('sessions'+_0x18367f(0x274),(_0x414989,_0x23f47d)=>_0x1d533c()[_0x18367f(0x174)][_0x18367f(0x27f)](_0x23f47d)),_0x10a429(_0x18367f(0x174)+_0x18367f(0xea),(_0x3358d9,_0x27c962)=>_0x1d533c()[_0x18367f(0x174)][_0x18367f(0x237)](_0x27c962)),_0x10a429(_0x18367f(0xfa)+_0x18367f(0x2f4),(_0x51458b,_0xf6a13d)=>_0x1d533c()[_0x18367f(0x1cb)]['stream'](_0xf6a13d)),_0x10a429(_0x18367f(0x313)+'rt',(_0x151b01,_0x20a577)=>_0x1d533c()[_0x18367f(0x1cb)][_0x18367f(0x1f6)](_0x20a577)),_0x10a429(_0x18367f(0x2bc)+'tory',(_0x3f3415,_0x1afe91)=>_0x1d533c()[_0x18367f(0x1cb)][_0x18367f(0x21b)](_0x1afe91)),_0x10a429(_0x18367f(0x2c7)+'te',async(_0x41817d,_0x488920={})=>{const _0x3da235=_0x18367f,_0x168642=typeof _0x488920[_0x3da235(0x32d)]===_0x3da235(0xaa)?_0x488920[_0x3da235(0x32d)]:_0x3da235(0x1f0),_0xef8714=typeof _0x488920['message']===_0x3da235(0xaa)?_0x488920[_0x3da235(0xbf)]:_0x3da235(0x31a)+_0x3da235(0x358),_0x391a6f=typeof _0x488920[_0x3da235(0xd7)]===_0x3da235(0xaa)&&_0x488920['context'][_0x3da235(0x19c)]()?_0x3da235(0x31a)+':'+_0x488920[_0x3da235(0xd7)][_0x3da235(0x19c)]():_0x3da235(0x31a),_0x253580=_0x488920[_0x3da235(0x126)]&&typeof _0x488920[_0x3da235(0x126)]===_0x3da235(0x257)?{...summarizePayload(_0x488920[_0x3da235(0x126)]),'context':_0x391a6f}:{'context':_0x391a6f},_0x1a6e28=rendererLogger;if(_0x1a6e28?.[_0x168642])await _0x1a6e28[_0x168642](_0xef8714,_0x253580);else await _0x1a6e28?.['info'](_0xef8714,_0x253580);if(_0x488920['diagnost'+'ic']===!![]||_0x391a6f===_0x3da235(0x31a)+_0x3da235(0x2cc)+_0x3da235(0x369)){const _0x446001=_0x488920['record']&&typeof _0x488920[_0x3da235(0x12f)]===_0x3da235(0x257)?_0x488920[_0x3da235(0x12f)]:_0x488920[_0x3da235(0x126)]?.[_0x3da235(0x12f)]&&typeof _0x488920[_0x3da235(0x126)][_0x3da235(0x12f)]===_0x3da235(0x257)?_0x488920['meta'][_0x3da235(0x12f)]:{'level':_0x168642,'category':'renderer','event':_0x391a6f,'message':_0xef8714,'meta':_0x488920['meta']};await diagnosticsWriter?.[_0x3da235(0x2ca)+'nt'](_0x446001,{'captureIncident':String(_0x446001['level']||_0x168642)[_0x3da235(0x15b)+_0x3da235(0x136)]()==='error'||_0x488920[_0x3da235(0x1dc)+'ncident']===!![]});}return{'ok':!![]};}),_0x10a429(_0x18367f(0x14f)+_0x18367f(0x157),async(_0x86d847,_0x11de72={})=>{const _0x49b414=_0x18367f,_0x4bff2f=typeof _0x11de72[_0x49b414(0x119)+'r']===_0x49b414(0xaa)&&_0x11de72[_0x49b414(0x119)+'r']['trim']()?_0x11de72[_0x49b414(0x119)+'r']:undefined,_0x2cb9b9=await exportLogsArchive({'logsDir':configController[_0x49b414(0x1d9)][_0x49b414(0x22a)],'targetDir':_0x4bff2f,'appVersion':app['getVersi'+'on']()});return mainLogger?.['info'](_0x49b414(0x363)+_0x49b414(0xf3),{'path':toHomePath(_0x2cb9b9[_0x49b414(0x7d)])}),_0x2cb9b9;}),_0x10a429(_0x18367f(0x278)+_0x18367f(0x93)+_0x18367f(0x30a),async()=>{const _0x40ebd3=_0x18367f;return await shell[_0x40ebd3(0xda)](configController[_0x40ebd3(0x1d9)][_0x40ebd3(0x22a)]),mainLogger?.['info']('logs\x20dir'+_0x40ebd3(0xff)+_0x40ebd3(0x268),{'logsDir':toHomePath(configController[_0x40ebd3(0x1d9)][_0x40ebd3(0x22a)])}),{'ok':!![],'path':configController['paths']['logsDir']};}),_0x10a429(_0x18367f(0xb1)+'t',async()=>{const _0x2d8666=_0x18367f,_0xebd090=await readdir(configController['paths'][_0x2d8666(0x22a)],{'recursive':!![]})[_0x2d8666(0x2b3)](()=>[]);return _0xebd090;}),_0x10a429(_0x18367f(0xd3)+'d',async(_0x13db35,_0x26dbdf={})=>{const _0x1cfaa0=_0x18367f,_0x3243a8=String(_0x26dbdf[_0x1cfaa0(0x7d)]||'');if(!_0x3243a8)throw new Error(_0x1cfaa0(0x33f)+_0x1cfaa0(0x2f5));return readFile(_0x3243a8,_0x1cfaa0(0x34d));}),_0x10a429(_0x18367f(0x142)+'ad',async(_0x39ef6f,_0x349672)=>{const _0x48559e=_0x18367f,_0x51d8a6=Date[_0x48559e(0x2b0)]();try{const _0x919037=await readFile(_0x349672,'utf8');return filesLogger?.['info'](_0x48559e(0x26e)+_0x48559e(0x1cc)+'ted',{'path':toHomePath(_0x349672),'bytes':Buffer[_0x48559e(0x20d)+'th'](_0x919037),'durationMs':Date['now']()-_0x51d8a6}),_0x919037;}catch(_0x41fb44){filesLogger?.[_0x48559e(0x1bd)](_0x48559e(0x26e)+_0x48559e(0x92),{'path':toHomePath(_0x349672),'durationMs':Date[_0x48559e(0x2b0)]()-_0x51d8a6,'error':summarizeError(_0x41fb44)});throw _0x41fb44;}}),_0x10a429(_0x18367f(0x142)+_0x18367f(0xc4)+'y',async(_0x35b2be,_0x5189cb)=>{const _0x16ac94=_0x18367f,_0x56c597=Date[_0x16ac94(0x2b0)]();try{const _0xebaf7b=await readFile(_0x5189cb);return filesLogger?.['info']('binary\x20f'+_0x16ac94(0x139)+_0x16ac94(0x1fe)+'ed',{'path':toHomePath(_0x5189cb),'bytes':_0xebaf7b[_0x16ac94(0x20d)+'th'],'durationMs':Date[_0x16ac94(0x2b0)]()-_0x56c597}),new Uint8Array(_0xebaf7b);}catch(_0x21b253){filesLogger?.[_0x16ac94(0x1bd)](_0x16ac94(0x144)+'ile\x20read'+_0x16ac94(0x362),{'path':toHomePath(_0x5189cb),'durationMs':Date[_0x16ac94(0x2b0)]()-_0x56c597,'error':summarizeError(_0x21b253)});throw _0x21b253;}}),_0x10a429('files:wr'+_0x18367f(0x29d),async(_0x3b74de,_0x1761d3={})=>{const _0x393770=_0x18367f,_0x44e94b=Date['now']();return await writeFile(_0x1761d3['path'],_0x1761d3[_0x393770(0x2d0)]??'',_0x393770(0x34d)),filesLogger?.[_0x393770(0x1f0)](_0x393770(0x296)+_0x393770(0x2d5)+_0x393770(0x185),{'path':toHomePath(_0x1761d3[_0x393770(0x7d)]),'bytes':Buffer[_0x393770(0x20d)+'th'](String(_0x1761d3[_0x393770(0x2d0)]??'')),'durationMs':Date[_0x393770(0x2b0)]()-_0x44e94b}),{'ok':!![]};}),_0x10a429(_0x18367f(0x1a0)+'ite-bina'+'ry',async(_0x17b1dc,_0x2dad56={})=>{const _0x4a201f=_0x18367f,_0x5011f6=Date['now']();await writeFile(_0x2dad56[_0x4a201f(0x7d)],Buffer[_0x4a201f(0x168)](_0x2dad56[_0x4a201f(0x2d0)]??[]));const _0x5c0bba=await stat(_0x2dad56[_0x4a201f(0x7d)])[_0x4a201f(0x2b3)](()=>null);return filesLogger?.['info'](_0x4a201f(0x144)+'ile\x20writ'+_0x4a201f(0x2da)+_0x4a201f(0xfb),{'path':toHomePath(_0x2dad56[_0x4a201f(0x7d)]),'bytes':_0x5c0bba?.['size']??0x0,'durationMs':Date['now']()-_0x5011f6}),{'ok':!![]};}),_0x10a429('files:se'+_0x18367f(0x11b)+'e',async(_0x42d6ce,_0x2b14f8={})=>{const _0x5abfa9=_0x18367f,_0x4925b=await dialog[_0x5abfa9(0x1eb)+_0x5abfa9(0x318)](BrowserWindow[_0x5abfa9(0x2bd)+_0x5abfa9(0x17f)](_0x42d6ce[_0x5abfa9(0x356)])??mainWindow,{'title':typeof _0x2b14f8[_0x5abfa9(0x262)]===_0x5abfa9(0xaa)?_0x2b14f8[_0x5abfa9(0x262)]:undefined,'properties':[_0x5abfa9(0x375),..._0x2b14f8[_0x5abfa9(0x307)+_0x5abfa9(0xfe)]?['multiSel'+_0x5abfa9(0xfe)]:[]],'filters':Array[_0x5abfa9(0x1c2)](_0x2b14f8[_0x5abfa9(0x335)])?_0x2b14f8[_0x5abfa9(0x335)]:undefined});return filesLogger?.[_0x5abfa9(0x1f0)](_0x5abfa9(0x315)+_0x5abfa9(0x285)+'leted',{'canceled':_0x4925b[_0x5abfa9(0x30e)],'count':_0x4925b[_0x5abfa9(0xc8)+'s']['length'],'paths':_0x4925b[_0x5abfa9(0xc8)+'s'][_0x5abfa9(0x22d)](toHomePath)}),{'canceled':_0x4925b[_0x5abfa9(0x30e)],'paths':_0x4925b[_0x5abfa9(0xc8)+'s']};}),_0x10a429(_0x18367f(0x152)+'st-direc'+'tory',async(_0x58acee,_0x3bb4d0={})=>{const _0x591fcf=_0x18367f,_0x31f124=resolve(String(_0x3bb4d0['path']||'')),_0x1e2f3d=_0x3bb4d0[_0x591fcf(0x14b)+'e']!==![],_0x55beef=Array[_0x591fcf(0x1c2)](_0x3bb4d0[_0x591fcf(0x98)+'ns'])?_0x3bb4d0[_0x591fcf(0x98)+'ns']['map'](_0x4ad034=>String(_0x4ad034)['toLowerC'+_0x591fcf(0x136)]()[_0x591fcf(0x370)](/^\./,''))['filter'](Boolean):null,_0x52f247=Number[_0x591fcf(0x24b)+'r'](_0x3bb4d0[_0x591fcf(0x2ce)+'es'])&&_0x3bb4d0['maxEntri'+'es']>0x0?_0x3bb4d0['maxEntri'+'es']:0xc350,_0x585deb=[];let _0x6da1d3=![];async function _0xb17a6c(_0x540236){const _0x5de74a=_0x591fcf;if(_0x6da1d3)return;let _0x37d4e4;try{_0x37d4e4=await readdir(_0x540236,{'withFileTypes':!![]});}catch{return;}for(const _0x35b13e of _0x37d4e4){if(_0x6da1d3)return;if(_0x35b13e[_0x5de74a(0xe4)]['startsWi'+'th']('.'))continue;const _0x4419fd=join(_0x540236,_0x35b13e[_0x5de74a(0xe4)]);if(_0x35b13e['isDirect'+_0x5de74a(0x30a)]()){if(_0x1e2f3d)await _0xb17a6c(_0x4419fd);continue;}if(!_0x35b13e['isFile']())continue;if(_0x55beef){const _0x5a893a=_0x35b13e['name']['lastInde'+'xOf']('.'),_0x915cc3=_0x5a893a>=0x0?_0x35b13e[_0x5de74a(0xe4)]['slice'](_0x5a893a+0x1)[_0x5de74a(0x15b)+_0x5de74a(0x136)]():'';if(!_0x55beef['includes'](_0x915cc3))continue;}if(_0x585deb[_0x5de74a(0xa3)]>=_0x52f247){_0x6da1d3=!![];return;}_0x585deb[_0x5de74a(0xc1)]({'name':_0x35b13e['name'],'path':_0x4419fd});}}return await _0xb17a6c(_0x31f124),{'path':_0x31f124,'entries':_0x585deb,'truncated':_0x6da1d3};}),_0x10a429(_0x18367f(0x120)+_0x18367f(0x249)+_0x18367f(0x37a),async(_0x5069c4,_0x224ba0={})=>{const _0x47e232=_0x18367f,_0x56c7ae=await dialog[_0x47e232(0x1eb)+_0x47e232(0x318)](BrowserWindow[_0x47e232(0x2bd)+_0x47e232(0x17f)](_0x5069c4[_0x47e232(0x356)])??mainWindow,{'title':typeof _0x224ba0[_0x47e232(0x262)]==='string'?_0x224ba0[_0x47e232(0x262)]:undefined,'properties':[_0x47e232(0x154)+_0x47e232(0x2b4)]});return filesLogger?.[_0x47e232(0x1f0)](_0x47e232(0x2aa)+_0x47e232(0x15d)+_0x47e232(0x1fe)+'ed',{'canceled':_0x56c7ae['canceled'],'count':_0x56c7ae[_0x47e232(0xc8)+'s'][_0x47e232(0xa3)],'paths':_0x56c7ae[_0x47e232(0xc8)+'s'][_0x47e232(0x22d)](toHomePath)}),{'canceled':_0x56c7ae[_0x47e232(0x30e)],'paths':_0x56c7ae[_0x47e232(0xc8)+'s']};}),_0x10a429(_0x18367f(0x22e)+_0x18367f(0x223)+'ory-info',()=>_0x1d533c()[_0x18367f(0x22e)+'e'][_0x18367f(0x138)+_0x18367f(0xab)]()),_0x10a429(_0x18367f(0x22e)+_0x18367f(0x170)+_0x18367f(0x15d),async()=>{const _0x2e6ab7=_0x18367f,_0x4a0990=await _0x1d533c()[_0x2e6ab7(0x22e)+'e']['director'+_0x2e6ab7(0xab)]();return await shell['openPath'](_0x4a0990[_0x2e6ab7(0x7d)]),filesLogger?.[_0x2e6ab7(0x1f0)](_0x2e6ab7(0x22e)+_0x2e6ab7(0xb8)+_0x2e6ab7(0x9e)+'ed',{'path':toHomePath(_0x4a0990[_0x2e6ab7(0x7d)])}),{'ok':!![],'path':_0x4a0990[_0x2e6ab7(0x7d)]};}),_0x10a429('workspac'+_0x18367f(0x1c8)+_0x18367f(0xa1),()=>_0x1d533c()['workspac'+'e']['sharedCo'+_0x18367f(0x276)]()),_0x10a429(_0x18367f(0x22e)+_0x18367f(0x241)+_0x18367f(0x204)+_0x18367f(0x360),(_0xd24d61,_0x454b97)=>_0x1d533c()[_0x18367f(0x22e)+'e'][_0x18367f(0xae)+_0x18367f(0x16f)+'xt'](_0x454b97)),_0x10a429(_0x18367f(0x174)+_0x18367f(0x1bb),(_0x42f46d,_0x5ca5c1)=>_0x1d533c()['sessions'][_0x18367f(0x1c3)](_0x5ca5c1)),_0x10a429('sessions'+_0x18367f(0x14c),async(_0x510d6e,_0x1c37f1={})=>{const _0x5db886=_0x18367f,_0x56bab9=String(_0x1c37f1['sessionK'+'ey']||_0x1c37f1[_0x5db886(0x1aa)]||'')[_0x5db886(0x19c)]();if(!_0x56bab9)throw new Error(_0x5db886(0x2d1)+_0x5db886(0x272)+_0x5db886(0x16c));const _0x126ebf=await ensureSessionSqliteStore()[_0x5db886(0x250)+_0x5db886(0x367)+_0x5db886(0x147)](),_0x42d846=await _0x1d533c()[_0x5db886(0x174)]['reorderP'+_0x5db886(0xcc)]([_0x56bab9,..._0x126ebf[_0x5db886(0x371)](_0x45f69a=>_0x45f69a!==_0x56bab9)]);return _0x42d846;}),_0x10a429(_0x18367f(0x174)+_0x18367f(0xa5),async(_0x4a91f2,_0x255078={})=>{const _0x244988=_0x18367f,_0x2f0a7f=String(_0x255078[_0x244988(0x2d1)+'ey']||_0x255078[_0x244988(0x1aa)]||'')['trim']();if(!_0x2f0a7f)throw new Error(_0x244988(0x2d1)+_0x244988(0x272)+_0x244988(0x16c));const _0x4c8e04=await ensureSessionSqliteStore()[_0x244988(0x250)+_0x244988(0x367)+'Keys']();return await _0x1d533c()[_0x244988(0x174)][_0x244988(0x1f1)+_0x244988(0xcc)](_0x4c8e04[_0x244988(0x371)](_0x52de06=>_0x52de06!==_0x2f0a7f));}),_0x10a429(_0x18367f(0x174)+':reorder'+_0x18367f(0x2e7),async(_0x3c4924,_0x35dc8f={})=>{const _0x37b00d=_0x18367f,_0x1b7030=Array[_0x37b00d(0x1c2)](_0x35dc8f['keys'])?_0x35dc8f[_0x37b00d(0x1ae)]:_0x35dc8f;return await _0x1d533c()[_0x37b00d(0x174)][_0x37b00d(0x1f1)+_0x37b00d(0xcc)](_0x1b7030);}),_0x10a429(_0x18367f(0xd0)+_0x18367f(0x20b),(_0x592bd2,_0x5486df)=>_0x1d533c()['skills'][_0x18367f(0x2d6)](_0x5486df)),_0x10a429(_0x18367f(0x79)+'t',(_0x39705d,_0x2c33a3)=>_0x1d533c()[_0x18367f(0x308)][_0x18367f(0x27f)](_0x2c33a3)),_0x10a429(_0x18367f(0x68)+_0x18367f(0x349),(_0x4bd4f6,_0x144b7b)=>_0x1d533c()[_0x18367f(0x308)][_0x18367f(0x23d)](_0x144b7b)),_0x10a429(_0x18367f(0x2ee)+_0x18367f(0x349),(_0x4ffa0c,_0x1463b8)=>_0x1d533c()['cron'][_0x18367f(0x1ed)](_0x1463b8)),_0x10a429(_0x18367f(0x2b6)+_0x18367f(0x8d),(_0x60b512,_0x5f479c)=>_0x1d533c()[_0x18367f(0x308)]['remove'](_0x5f479c)),_0x10a429(_0x18367f(0x1a1)+_0x18367f(0x19a),(_0x641ac1,_0x3c494f)=>_0x1d533c()[_0x18367f(0x308)][_0x18367f(0x15f)](_0x3c494f)),_0x10a429('cron:log'+'s',(_0x4b350c,_0x10315e)=>_0x1d533c()['cron'][_0x18367f(0x337)](_0x10315e)),_0x10a429(_0x18367f(0x301)+_0x18367f(0x343),async(_0x434f9f,_0x3ebc4b={})=>{const _0x42eea5=_0x18367f,_0x35ded6=configController[_0x42eea5(0x30f)+'onfigPat'+'h'](),_0x4f3069=JSON[_0x42eea5(0xc5)](await readFile(_0x35ded6,_0x42eea5(0x34d))),_0x52a357=_0x4f3069?.['models']?.[_0x42eea5(0x240)+'s']&&typeof _0x4f3069[_0x42eea5(0x29c)][_0x42eea5(0x240)+'s']==='object'?_0x4f3069[_0x42eea5(0x29c)]['provider'+'s']:{},_0x5713f9=typeof _0x4f3069?.[_0x42eea5(0x35d)]?.[_0x42eea5(0x1e3)]?.[_0x42eea5(0x18a)]?.[_0x42eea5(0x21c)]===_0x42eea5(0xaa)?_0x4f3069['agents'][_0x42eea5(0x1e3)][_0x42eea5(0x18a)][_0x42eea5(0x21c)]:'',_0x5f3624=String(_0x3ebc4b[_0x42eea5(0x18a)]||_0x5713f9||'');if(!_0x5f3624[_0x42eea5(0x365)]('/'))throw new Error('no\x20defau'+_0x42eea5(0xd5)+_0x42eea5(0x22c)+_0x42eea5(0x110)+_0x42eea5(0x227)+'der/mode'+_0x42eea5(0x89));const _0x38fa9f=_0x5f3624[_0x42eea5(0x222)]('/'),_0x57755d=_0x5f3624[_0x42eea5(0x2d2)](0x0,_0x38fa9f),_0x1b3fb6=_0x5f3624[_0x42eea5(0x2d2)](_0x38fa9f+0x1),_0x3f67b7=_0x52a357[_0x57755d];if(!_0x3f67b7||typeof _0x3f67b7!==_0x42eea5(0x257))throw new Error(_0x42eea5(0x240)+_0x42eea5(0x158)+_0x42eea5(0x1e9)+'\x20'+_0x57755d);const _0xa69554=String(_0x3f67b7[_0x42eea5(0x20c)]||'https://'+'api.open'+_0x42eea5(0x97)+'1')[_0x42eea5(0x19c)]()['replace'](/\/$/,''),_0xf8bb46=await fetch(_0xa69554+(_0x42eea5(0x99)+_0x42eea5(0x23f)+'s'),{'method':_0x42eea5(0x229),'headers':{'content-type':_0x42eea5(0x1d4)+_0x42eea5(0x1b2),'Authorization':_0x42eea5(0x9d)+(_0x3f67b7[_0x42eea5(0x347)]||''),..._0x3f67b7[_0x42eea5(0x2fd)]&&typeof _0x3f67b7[_0x42eea5(0x2fd)]==='object'?_0x3f67b7[_0x42eea5(0x2fd)]:{}},'body':JSON[_0x42eea5(0x15c)+'y']({'model':_0x1b3fb6,'max_tokens':Number[_0x42eea5(0x24b)+'r'](_0x3ebc4b[_0x42eea5(0xa2)+'s'])?_0x3ebc4b[_0x42eea5(0xa2)+'s']:0x400,'temperature':typeof _0x3ebc4b['temperat'+_0x42eea5(0x1b8)]===_0x42eea5(0x1a5)?_0x3ebc4b['temperat'+_0x42eea5(0x1b8)]:undefined,'messages':Array['isArray'](_0x3ebc4b['messages'])?_0x3ebc4b['messages']:[]}),'signal':AbortSignal[_0x42eea5(0x351)](Number['isIntege'+'r'](_0x3ebc4b['timeoutM'+'s'])?_0x3ebc4b[_0x42eea5(0x34f)+'s']:0x1d4c0)});if(!_0xf8bb46['ok']){const _0x57dc39=await _0xf8bb46[_0x42eea5(0xa6)]();throw new Error('model\x20ht'+_0x42eea5(0x9c)+_0xf8bb46[_0x42eea5(0x7a)]+':\x20'+_0x57dc39['slice'](0x0,0x190));}const _0x287a7d=await _0xf8bb46[_0x42eea5(0x151)](),_0xdd91c=_0x287a7d?.[_0x42eea5(0x14e)]?.[0x0]?.[_0x42eea5(0xbf)]??{};return{'content':extractModelMessageContent(_0xdd91c[_0x42eea5(0x2d0)]),'reasoning':typeof _0xdd91c[_0x42eea5(0x171)+_0x42eea5(0x28b)+'t']===_0x42eea5(0xaa)?_0xdd91c[_0x42eea5(0x171)+_0x42eea5(0x28b)+'t']:'','model':_0x287a7d?.[_0x42eea5(0x18a)]||_0x1b3fb6};}),_0x10a429('models:s'+_0x18367f(0x235),()=>_0x1d533c()['models'][_0x18367f(0xad)]()),_0x10a429('models:s'+'et-setti'+_0x18367f(0x102),(_0x207d8d,_0x5b7015)=>_0x1d533c()[_0x18367f(0x29c)][_0x18367f(0x114)+'ngs'](_0x5b7015)),_0x10a429(_0x18367f(0x13c)+_0x18367f(0x36e)+'ted-ever'+'ywhere',(_0x42c37b,_0x2e2e95)=>_0x1d533c()[_0x18367f(0x29c)][_0x18367f(0x183)+_0x18367f(0xfd)+_0x18367f(0x18e)+'re'](_0x2e2e95)),_0x10a429('models:s'+_0x18367f(0x37d)+'operated',(_0x4b3947,_0x1bf656)=>_0x1d533c()[_0x18367f(0x29c)][_0x18367f(0x328)+'peratedM'+_0x18367f(0x202)](_0x1bf656)),_0x10a429(_0x18367f(0x13c)+_0x18367f(0xe5)+'model-id',()=>_0x1d533c()[_0x18367f(0x29c)][_0x18367f(0x20a)+'ModelId']()),_0x10a429(_0x18367f(0x301)+_0x18367f(0x218)+_0x18367f(0x281),()=>_0x1d533c()['models'][_0x18367f(0xd4)+_0x18367f(0x281)]()),_0x10a429(_0x18367f(0x245)+_0x18367f(0x12e)+'dled-res'+_0x18367f(0x6f),async()=>{const _0x20c4d7=_0x18367f,_0x32a8b3=await prepareRuntime(shellConfig,{'syncOnly':!![]});return await configController['syncRunt'+_0x20c4d7(0x35a)+'ns'](),{'ok':!![],'syncedAt':new Date()['toISOStr'+_0x20c4d7(0x2b7)](),'manifest':_0x32a8b3,'status':await getRuntimeResourceStatus()};}),_0x10a429(_0x18367f(0x245)+_0x18367f(0x6b)+'-status',async()=>getRuntimeResourceStatus());}async function boot(){const _0x2c2583=_0x543b23;shellConfig=await loadShellConfig(resolveProjectRoot()),app[_0x2c2583(0x1b9)](shellConfig[_0x2c2583(0xc9)+_0x2c2583(0xb7)]),configController=createConfigController(shellConfig),mainLogger=createShellLogger(configController[_0x2c2583(0x1d9)],_0x2c2583(0x368)),ipcLogger=createShellLogger(configController[_0x2c2583(0x1d9)],'ipc'),filesLogger=createShellLogger(configController[_0x2c2583(0x1d9)],_0x2c2583(0x133)),rendererLogger=createShellLogger(configController['paths'],_0x2c2583(0x31a)),productRuntime=await loadProductRuntime();const _0x337d6f=resolveWujieApiEndpoint();diagnosticsWriter=createDiagnosticsWriter({'logsDir':configController[_0x2c2583(0x1d9)][_0x2c2583(0x22a)],'appContext':{'productName':shellConfig[_0x2c2583(0xc9)+_0x2c2583(0xb7)],'appId':shellConfig[_0x2c2583(0x8f)],'appVersion':app[_0x2c2583(0x1ad)+'on'](),'platform':process[_0x2c2583(0x2fe)],'arch':process['arch'],..._0x337d6f?{'apiEndpoint':_0x337d6f}:{}}}),userEventWriter=createUserEventWriter({'logsDir':configController['paths']['logsDir'],'diagnosticsWriter':diagnosticsWriter});const _0xb39cf7=await loadCreateUpdateController({'logger':mainLogger});updateController=_0xb39cf7({'shellConfig':shellConfig,'appName':()=>app[_0x2c2583(0xe4)],'appVersion':()=>app[_0x2c2583(0x1ad)+'on'](),'broadcast':broadcast,'logger':mainLogger}),updateController['initiali'+'ze'](),registerProcessLogHooks(),mainLogger?.[_0x2c2583(0x1f0)]('electron'+_0x2c2583(0x2b8)+_0x2c2583(0x149)+'ed',{'appVersion':app[_0x2c2583(0x1ad)+'on'](),'electronVersion':process[_0x2c2583(0x173)]['electron'],'nodeVersion':process['versions'][_0x2c2583(0x30c)],'chromeVersion':process['versions'][_0x2c2583(0x200)],'platform':process['platform'],'arch':process[_0x2c2583(0x17d)],'mode':getMode(),'projectRoot':shellConfig[_0x2c2583(0x65)+'oot'],'configPath':shellConfig['configPa'+'th'],'dataDir':shellConfig[_0x2c2583(0x24c)],'logsDir':configController['paths'][_0x2c2583(0x22a)],'rendererUrl':process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x2c2583(0x65)+_0x2c2583(0x2d8)],_0x2c2583(0x1de),_0x2c2583(0x293)+'ml')}),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x2c2583(0x1ad)+'on'](),'productRuntimeHooks':productRuntimeHooks,'userEventWriter':userEventWriter,'sessionSqliteStore':ensureSessionSqliteStore()}),typeof productRuntime['migrateP'+'roductCo'+_0x2c2583(0x2a2)]===_0x2c2583(0x199)&&await productRuntime[_0x2c2583(0x23b)+_0x2c2583(0xf2)+'nfig']({'configController':configController,'mainLogger':mainLogger}),typeof productRuntime[_0x2c2583(0x23b)+_0x2c2583(0xf4)+'ta']===_0x2c2583(0x199)?await productRuntime['migrateP'+_0x2c2583(0xf4)+'ta']({'configController':configController,'generatedFilesStore':ensureGeneratedFilesStore(),'mainLogger':mainLogger,'sessionSqliteStore':ensureSessionSqliteStore()}):await ensureGeneratedFilesStore()[_0x2c2583(0x2eb)+_0x2c2583(0x122)+'d'](),attachGatewayBroadcastHandlers(gatewayController),await installIpcHandlers(),installClawspaceProtocolHandler(),registerShellShortcuts(),await createWindow(),await gatewayController[_0x2c2583(0x2e1)](),updateController['startBac'+'kgroundC'+'hecks'](),mainLogger?.[_0x2c2583(0x1f0)](_0x2c2583(0x187)+_0x2c2583(0x2b8)+_0x2c2583(0x1a9)+_0x2c2583(0x185));}function registerProcessLogHooks(){const _0x46f70a=_0x543b23;if(registerProcessLogHooks[_0x46f70a(0x2cf)+'ed'])return;registerProcessLogHooks[_0x46f70a(0x2cf)+'ed']=!![],process['on'](_0x46f70a(0x36a)+_0x46f70a(0x36b)+'n',_0x56bb6f=>{const _0x2125d5=_0x46f70a;mainLogger?.['error']('uncaught'+_0x2125d5(0x228)+'on',summarizeError(_0x56bb6f));}),process['on'](_0x46f70a(0x132)+'dRejecti'+'on',_0x4ded59=>{const _0x16e83f=_0x46f70a;mainLogger?.[_0x16e83f(0x1bd)]('unhandle'+_0x16e83f(0x359)+_0x16e83f(0x35e),summarizeError(_0x4ded59));}),app['on'](_0x46f70a(0x10c)+_0x46f70a(0x309)+'one',(_0x509de0,_0x38091c,_0x4452e3)=>{const _0x1b2091=_0x46f70a;mainLogger?.[_0x1b2091(0x1bd)](_0x1b2091(0x31a)+_0x1b2091(0x23a)+_0x1b2091(0x316),{'url':_0x38091c[_0x1b2091(0x2a8)](),'details':_0x4452e3});}),app['on'](_0x46f70a(0xe9)+_0x46f70a(0x2dd)+'ne',(_0x95e22f,_0x54a1ca)=>{const _0x760c4d=_0x46f70a;mainLogger?.[_0x760c4d(0x1bd)](_0x760c4d(0x317)+_0x760c4d(0x279)+'ne',{'details':_0x54a1ca});});}app['on']('window-a'+'ll-close'+'d',()=>{const _0x1173fd=_0x543b23;if(process[_0x1173fd(0x2fe)]!=='darwin')app['quit']();}),app['on'](_0x543b23(0xaf),async()=>{const _0x1b0a34=_0x543b23;if(isQuitting){app['quit']();return;}updateController?.[_0x1b0a34(0x127)+'ackgroun'+'dCheck'](_0x1b0a34(0x64)+_0x1b0a34(0x90)),BrowserWindow[_0x1b0a34(0x2bb)+_0x1b0a34(0x246)]()[_0x1b0a34(0xa3)]===0x0&&shellConfig&&await createWindow();}),app['on'](_0x543b23(0x2ff)+_0x543b23(0x259),_0x4fa557=>{const _0xa4afd=_0x543b23;isQuitting=!![],updateController?.[_0xa4afd(0x24d)+_0xa4afd(0x269)](),terminalManager?.[_0xa4afd(0x12d)](),terminalManager=null,productRuntimeHooks?.['dispose']?.();for(const _0x269a67 of Object[_0xa4afd(0x1ae)](productRuntimeHooks))delete productRuntimeHooks[_0x269a67];if(!gatewayController)return;mainLogger?.[_0xa4afd(0x1f0)](_0xa4afd(0x266)+_0xa4afd(0x264)+_0xa4afd(0xeb)+'teway'),_0x4fa557[_0xa4afd(0x215)+_0xa4afd(0x19d)](),void gatewayController[_0xa4afd(0x1a7)]()['finally'](()=>{const _0x5b0a4f=_0xa4afd;gatewayController=null,mainLogger?.['info'](_0x5b0a4f(0x1b3)+_0x5b0a4f(0x10f)+_0x5b0a4f(0x266)+'uit'),app[_0x5b0a4f(0x11f)]();});}),app['on'](_0x543b23(0x18b)+'t',()=>{const _0x2277f2=_0x543b23;globalShortcut[_0x2277f2(0x21e)+'er'](DEVTOOLS_ACCELERATOR);}),app[_0x543b23(0x231)+'y']()[_0x543b23(0x330)](boot)[_0x543b23(0x2b3)](_0xae1021=>{const _0xb2fd2d=_0x543b23;bootError=_0xae1021 instanceof Error?_0xae1021[_0xb2fd2d(0xbf)]:String(_0xae1021),mainLogger?.[_0xb2fd2d(0x1bd)](_0xb2fd2d(0x187)+'\x20main\x20bo'+_0xb2fd2d(0x25b)+'d',summarizeError(_0xae1021)),console[_0xb2fd2d(0x1bd)]('[wujie-s'+'hell]\x20fa'+_0xb2fd2d(0x26d)+'boot\x20ele'+_0xb2fd2d(0xc3)+'in',_0xae1021);});
|
|
1
|
+
const _0x320a6b=_0x26f3;(function(_0x1994c7,_0x54246c){const _0x280f12=_0x26f3,_0x5a8851=_0x1994c7();while(!![]){try{const _0x41ad7f=-parseInt(_0x280f12(0x10b))/0x1+parseInt(_0x280f12(0x168))/0x2+-parseInt(_0x280f12(0x251))/0x3+parseInt(_0x280f12(0x81))/0x4*(-parseInt(_0x280f12(0x290))/0x5)+-parseInt(_0x280f12(0x2fc))/0x6+-parseInt(_0x280f12(0x1e6))/0x7+parseInt(_0x280f12(0x348))/0x8;if(_0x41ad7f===_0x54246c)break;else _0x5a8851['push'](_0x5a8851['shift']());}catch(_0x376bf3){_0x5a8851['push'](_0x5a8851['shift']());}}}(_0x3850,0x7d810));import _0x160cbb from'electron';import{fileURLToPath,pathToFileURL}from'node:url';import{dirname,join,resolve,sep}from'node:path';import{createReadStream,existsSync,statSync}from'node:fs';import{readFile,readdir,stat,writeFile}from'node:fs/promises';import{spawn}from'node:child_process';import{Readable}from'node:stream';import{loadShellConfig}from'@wujie-shell/config';import{createConfigController}from'../config/controller.mjs';import{createGatewayController}from'../gateway/controller.mjs';import{deleteManagedSkill,importSkillZip,updateManagedSkillConfig}from'../skills/import.mjs';import{deleteMarketSkillRegistryEntry,importMarketSkillZip}from'../skills/market.mjs';import{createAgentSessionsMapStore}from'../sessions/agent-sessions-map-store.mjs';import{createSessionSqliteStore}from'../sessions/session-sqlite-store.mjs';import{createTerminalManager}from'../terminal/manager.mjs';import{createShellLogger,exportLogsArchive,summarizeError,summarizePayload,summarizeText,toHomePath}from'../common/logging.mjs';import{createDiagnosticsWriter,diagnosticEventFromError}from'../common/diagnostics.mjs';import{createUserEventWriter}from'../common/user-events.mjs';import{createConnectorController}from'../connectors/controller.mjs';import{resolveRuntimeKdocsCliCommand}from'../connectors/kdocs-cli.mjs';import{createGeneratedFilesStore}from'../files/generated-files-store.mjs';import{registerFileHandlers}from'../files/handlers.mjs';import{registerProductLogHandlers}from'../log-reporting/handlers.mjs';import{resolveWujieApiEndpoint}from'../log-reporting/report-logs.mjs';import{extractModelMessageContent,registerModelHandlers}from'../models/handlers.mjs';import{createPreferencesStore}from'../preferences/store.mjs';function _0x26f3(_0x18d925,_0x50b2b9){_0x18d925=_0x18d925-0x7e;const _0x3850d6=_0x3850();let _0x26f350=_0x3850d6[_0x18d925];return _0x26f350;}import{loadRuntimeInfo,prepareRuntime,resolveRuntimeRoot,getRuntimeSpawnContext,resolveRuntimeLarkCliCommand,runClawOnce}from'../runtime/index.mjs';import{loadCreateUpdateController}from'../updates/loader.mjs';const __dirname=dirname(fileURLToPath(import.meta.url)),preloadPath=join(__dirname,'preload.'+'mjs'),{app,BrowserWindow,clipboard,dialog,globalShortcut,ipcMain,protocol,shell}=_0x160cbb,DEVTOOLS_ACCELERATOR=_0x320a6b(0x30c)+_0x320a6b(0x2a6)+'+Shift+I',CLAWSPACE_PROTOCOL_SCHEME=_0x320a6b(0xcc)+'e',DEBUG_STDOUT=process.env.WUJIE_SHELL_DEBUG==='1'||process.env.VITE_DEV_SERVER_URL||process.env.NODE_ENV!==_0x320a6b(0x29c)+'on',LOCAL_FILE_MIME_TYPES=new Map([[_0x320a6b(0x1c8),_0x320a6b(0x1e7)+_0x320a6b(0x80)+_0x320a6b(0x2b7)+'8'],[_0x320a6b(0x19d),_0x320a6b(0x241)+_0x320a6b(0x136)+_0x320a6b(0x15f)+'tf-8'],[_0x320a6b(0x99),'image/jp'+'eg'],[_0x320a6b(0x1f7),_0x320a6b(0xd0)+'eg'],['.png','image/pn'+'g'],[_0x320a6b(0x246),_0x320a6b(0x214)+'f'],[_0x320a6b(0x2f7),_0x320a6b(0x38f)+'p'],[_0x320a6b(0x329),_0x320a6b(0x327)+'g+xml'],['.webp',_0x320a6b(0x203)+'bp'],['.mp4',_0x320a6b(0xf2)+'4'],[_0x320a6b(0x341),_0x320a6b(0x179)+'icktime'],[_0x320a6b(0x272),_0x320a6b(0x1ed)+'msvideo'],[_0x320a6b(0x20c),_0x320a6b(0x1ed)+_0x320a6b(0x114)],[_0x320a6b(0x30f),_0x320a6b(0x13c)+'bm'],['.mp3','audio/mp'+'eg'],[_0x320a6b(0x29b),_0x320a6b(0x18e)+'v'],[_0x320a6b(0x2c7),'audio/mp'+'4'],[_0x320a6b(0xba),_0x320a6b(0x319)+'c'],[_0x320a6b(0x1ee),_0x320a6b(0x2d2)+'g'],['.flac',_0x320a6b(0x14b)+'ac']]);protocol[_0x320a6b(0x388)+_0x320a6b(0x1be)+_0x320a6b(0x1e9)+_0x320a6b(0x86)]([{'scheme':CLAWSPACE_PROTOCOL_SCHEME,'privileges':{'secure':!![],'standard':!![],'supportFetchAPI':!![],'corsEnabled':!![]}}]);let mainWindow=null,shellConfig=null,configController=null,gatewayController=null,bootError=null,mainLogger=null,ipcLogger=null,filesLogger=null,rendererLogger=null,terminalManager=null,connectorController=null,generatedFilesStore=null,productRuntime=null,productRuntimeHooks={},sessionSqliteStore=null,diagnosticsWriter=null,userEventWriter=null,isQuitting=![],updateController=null;function attachGatewayBroadcastHandlers(_0x284c5b){const _0x51cb4c=_0x320a6b;for(const _0x45665e of[_0x51cb4c(0x1e5)+'status',_0x51cb4c(0x1e5)+_0x51cb4c(0x127),_0x51cb4c(0x317)+'eam-even'+'t',_0x51cb4c(0x187)+_0x51cb4c(0x281),_0x51cb4c(0x1b8)+_0x51cb4c(0x11d)+_0x51cb4c(0x245),_0x51cb4c(0xf0)+_0x51cb4c(0x1d6),'agents-u'+_0x51cb4c(0x31b),_0x51cb4c(0x143)+'-questio'+'n']){_0x284c5b['on'](_0x45665e,_0x3db899=>broadcast(_0x45665e,_0x3db899));}}function ensureSessionSqliteStore(){const _0x7ba5aa=_0x320a6b;if(sessionSqliteStore)return sessionSqliteStore;if(!configController)throw new Error(_0x7ba5aa(0x106)+_0x7ba5aa(0x25c)+_0x7ba5aa(0x1ab)+'t\x20initia'+_0x7ba5aa(0x181));return sessionSqliteStore=createSessionSqliteStore({'stateDir':configController[_0x7ba5aa(0x11c)+_0x7ba5aa(0x22c)]()}),sessionSqliteStore;}function ensureGeneratedFilesStore(){const _0x1320f5=_0x320a6b;if(generatedFilesStore)return generatedFilesStore;if(!configController)throw new Error(_0x1320f5(0x106)+_0x1320f5(0x25c)+_0x1320f5(0x1ab)+_0x1320f5(0x2d3)+_0x1320f5(0x181));return generatedFilesStore=createGeneratedFilesStore({'stateDir':configController[_0x1320f5(0x11c)+_0x1320f5(0x22c)]()}),generatedFilesStore;}async function ensureGatewayControllerStarted(){const _0x1db233=_0x320a6b;if(!gatewayController&&(!shellConfig||!configController))throw new Error(bootError?_0x1db233(0x106)+_0x1db233(0x337)+_0x1db233(0x29a)+'\x20'+bootError:_0x1db233(0x106)+_0x1db233(0x2ae)+_0x1db233(0xe9)+_0x1db233(0x38a)+'alized');return!gatewayController&&(mainLogger?.['warn'](_0x1db233(0x224)+_0x1db233(0xd3)+_0x1db233(0x2b9)+_0x1db233(0x346)+_0x1db233(0xa1)),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x1db233(0x334)+'on'](),'productRuntimeHooks':productRuntimeHooks,'userEventWriter':userEventWriter,'sessionSqliteStore':ensureSessionSqliteStore()}),attachGatewayBroadcastHandlers(gatewayController)),await gatewayController[_0x1db233(0x14d)](),gatewayController;}function getMode(){const _0xe6293c=_0x320a6b;return process.env.VITE_DEV_SERVER_URL?'dev':_0xe6293c(0x101);}function isGatewayNotInitializedError(_0x191aeb){const _0x1dbff6=_0x320a6b;return _0x191aeb instanceof Error&&_0x191aeb['message']===_0x1dbff6(0x106)+_0x1dbff6(0x2ae)+_0x1dbff6(0xe9)+_0x1dbff6(0x38a)+'alized';}function _0x3850(){const _0x562f05=['cwd','HEAD','audio/og','t\x20initia','Custom','ready','logs\x20dir','channelI','openDire','temp','eted','rocess-g','filePath','Everywhe','d-state','record','ntime','dRejecti','models:s','sConnect','ssionKey','keyDown','saveFeis','emoji','alized','chat:abo','eated','isMaximi','mand','command','update','dist','runtime:','abort','api.open','D,\x20OPTIO','nabled','der/mode','chat:his','.bmp','range','ywhere','shared-c','context','4854420KbmeWd',':run-onc','com-chan','ession','file\x20wri','minimize','cle','multiSel','send','closeToT','inimize','object','nel','plugin\x20c','replace','maxEntri','CommandO','path\x20is\x20','meta','.webm','now','getPinne','cancelFe','string','succeede','dels','les:reve','chat-str','cCliConn','audio/aa','app:file','pdated','nnectSes','platform','teway','resource','e\x20url','liConnec','ocs','oot','saveWeco','logs:exp',':diagnos','image/sv',':rename','.svg','ntext','openExte','ChannelC','reorderP','ximize','shuDocCl',':list','hatChann','lawChann','gatewayP','getVersi','ssion','catch','ell\x20boot','st-direc','app:tray','filters',':save-fe','\x20shortcu','folder','maxToken','-exit','logsDir','.mov','node','dated','webConte','-pinned','ng;\x20recr','rated-fi','22364600XyLMEs','before-i','Keys','\x20configu','stration','em:resta',':resize','onnector','ate','orConfig','ncident','ad-binar','ls:delet','get','entDocsC','untimeHa','binary\x20f','-weixin','efault','et-self-','before-q','est_fail','chatChan','-request','logs','\x20to\x20load','no\x20defau','g_conten','illEntry','\x20complet','s:hide','setName','pping\x20ga','showOpen','select\x20d','product\x20','readSess','cancelWe','cron:run','parse','create','ead','pened',':save-kd',':complet','oken','Config','e\x20comple','isabled','min','model','les:dele','window_f','feishu_d','cron','nectSess','xOf','Updates','shell-ru','chat:str','lose','edWindow','files:se','nput-eve','register','toLowerC','ot\x20initi','updateOp','ey\x20is\x20re','uit','unmaximi','image/bm','trationS','title','mChannel','ocsCliCo','method','les:hide','stomMode','[wujie-s','isIntege','in;\x20char','252utAzWm','select\x20f','then','parentSe','devtools','ged','includes','Entry','n\x20not\x20fo','close',':save-we','parseInt','tabs-com','saveTenc','agent\x20cr','getAllWi','ion/json','ype','ources','toISOStr','name','wBin','window:t','boot\x20ele','.jpg','keys','info','openDevT','remove','nt]','GET,\x20HEA','defaultF','eating','complete',':get-clo','all','app:upda','\x20main\x20bo','ndlers','-port','ame','child-pr','model-id','relaunch','models:c','enable','upsert','ationSta','some','t-stream','ector:\x20','red;\x20set','Dialog','stringif','control','ell:even','avatar','.aac','runtime\x20','detach','file\x20rea','pluginId','tup:get','exec','inned','markQuit','manifest','app_acti','agent\x20al','failed','yInfo','cron:lis','agents:u','lConfig','ready\x20ex','clawspac','ile\x20comp','et-selec','plugins','image/jp','type','nts','controll','productN','orted','m-channe','ocess-go','showSave','Unsuppor','reate',':open-cl','temperat','ap:entry','from','uired','Update','ctStatus','unknown','-data','skills:s',':cancel','nstall','enClawCo','product-','way\x20is\x20n','board:wr','ort','nConfig','ontents','ls:list','te:downl','agent-ev','ls:set-e','video/mp','canceled','agents:w','ngtalk-d','fromEntr','l\x20prepar','Observed','getAppPa','ase',':agent-m','quit','s:reveal','imePlugi','hecks','ackgroun','prod','huChanne',':runtime','ndows','hell:ipc','wujie-sh','ite','igWriteH','ap:upser','s:list','468244NOOBVQ','entExmai','resh-age','preventD','andledIn','e:write-','openPath','itialize','ustom-mo','matroska',':downloa','nnel','agent\x20id','-refresh','ted\x20conn','defaults','tic','resolveS','-invalid','/chat/co','onfig\x20up','syncRunt','disable','oggle-ma','pServer','ctory','shuRegis','applicat','log','handle','set','ies','IPC\x20requ','elConfig',':save-te','deletedS','atus','startsWi','nfo','utf8','uRegistr','-questio','ile\x20writ','kdown;\x20c','n-direct','app:clip','deleteOp','lawPlugi','ap:get','video/we','local','ot\x20compl','ilConnec','Version','rename','ion','ask-user','ists','agent','choices','warn','omModel','logs\x20exp','pen-devt','audio/fl','ipc\x20requ','start','omplete','s:delete','lastInde','ontent-t','feishu','ncent-do','saveNetE',':save-di','fig','hell]\x20fa','lect-fil','tabs:req','content-','t-messag','files:li','-life-cy','onfig','harset=u','em:open-','tabs:ref','artifact','ired','dCheck','talkDocC','ipc_requ','rver','1843818YcQdBh','app.asar','wechat','\x20log','\x20is\x20requ','ted','https://','window:c','n\x20loaded','est\x20star','range,\x20c','deleteFi','tSession','d\x20comple','tup:set','e:direct','entries','video/qu','n\x20failed','versions','nges','h\x0aexec\x20\x22','lect-dir','ile\x20read','startBac','lized','\x20main\x20wi','settings','focus','nt-state','function','session-','ove','app:syst','nelSessi','payload','stop','download','audio/wa','promises','est\x20fail','-by-sess','oad','dSession','maximize','main','Bearer\x20','ectory\x20o','ssion:\x20','ectSessi','mpletion','path','loadURL','.md','preferen','app:star','status','setOpenC','initiali','loadFile','ipc','skills:u','number','terminal','ishu-doc','index.mj','meFilter','ig\x20is\x20no','elected-','kdocs','chat','indexOf','figured:','tabs:nav','InFolder','gatewayT','igSnapsh','plugins:','ccept-ra','-session','sessions','stion','aseMailC','hide','config:c','tease-ma','SchemesA','error','e:open-d','apiKey','dispose','\x20CLI\x20wra','enClawSk','ted-ever','map','enClawMc','.txt','ll-close','-once','message','getURL','jie-shel','creating','migrateP','nfig','#!/bin/s','ngs','tChannel','ItemSett','limit','ent','ileName','content','size','runtimeI','ettings','diagnost','sender','Invalid\x20','slice','ot\x20faile','ishu-cha','\x20a\x20provi','required','workspac','gateway-','7018172LZzDKg','text/pla','isArray','sPrivile','get-conf','l\x20reques','configPa','video/x-','.ogg','primary','files:re',':input','window:i','extensio','kgroundC','ections','deleteCu','.jpeg','generate','files','dow\x20load','provider','paths','quitAndI','dataDir','app:open','skills:i','level','\x20not\x20con','image/we','iConnect','messages','product','#0000000','setSetti','POST','ModelId','getRecen','.mkv','key','leted','lawSkill','activate','tLogs','wujiecla','roductDa','image/gi',':fork','getKdocs','headers','enClawCh','renderer','torConfi','ions-lis','list','child\x20pr','und','rayOnClo','unregist','tus','models','-logs','gateway\x20','cron:cre','toWeb','peratedM','ory\x20open','targetDi','e\x20direct','annelCon','tateDir',':create','-status','elSessio','delete','protocol','OPTIONS','started',':save-qq','getPath',':choose','startFei','sion','-shortcu','open\x20ext','openAtLo','sPath','d-local','ot\x20start','groups','openclaw','text/mar','skills:d','unhandle','deleteIm','ated','.gif','-context','elete','d\x20is\x20req','filter','ools','bytes\x20','main\x20win','ionEntry','ings','quired','1094667IZlNaT','director','agent-','sessionK','trim','CliConne','app:gene',':save-ne','uit:\x20sto','\x20process','input','ell\x20conf','byteLeng','ory','fromWebC','tory','isFinite','tatus','finally','l\x20first','hideBySe','ProductR','index.ht','saveQqMa','Not\x20foun','skills','ector\x20se','runOnce','nectorCo','th\x20is\x20re','ing','uest-age','recursiv','.avi','#f8fafc','-info','getStatu','agentId','ocess\x20go','getFeish',':pin','tabs-age','rnal','te:get-s','dled-res','writeEve','iled\x20to\x20','bot-chan','updated','render-p','saveKdoc','baseUrl','roductCo','electron','e:shared','\x20request','zed','range,\x20a','irectory','runtimeR','nnelEnab','uncaught','gin','44335ySLsUF','openFile','split','sharedCo','length','isFile','model\x20ht','pathname','plugin\x20e','-restart','\x20failed:','.wav','producti','stopped\x20','projectR','whenRead','yed','find',':status','ctron\x20ma','ai.com/v','ure','rControl','ectory','darwin','timeoutM','agents','kUserQue','huDocCon','requestB','ell\x20gate','before\x20q','les:list','captureI','eam',':unpin','lConnect','resize','ndow','set=utf-',':start','er\x20missi','files:wr','cancelKd','href','t:\x20','fromIpc','selected','pdate','ishuDocC','tate','-mail','agent\x20de','text','ion/octe','.m4a','config:i','FeishuDo',':gateway','uDocCliC','navigati','logs:wri','readConf','timeout'];_0x3850=function(){return _0x562f05;};return _0x3850();}function revealPathInFolder(_0x319604){const _0x338fb4=_0x320a6b,_0xff139f=String(_0x319604||'')['trim']();if(!_0xff139f)return{'ok':![],'error':'path\x20is\x20'+_0x338fb4(0x1e3)};return shell['showItem'+_0x338fb4(0x1b2)](_0xff139f),{'ok':!![]};}function resolveProjectRoot(){const _0xf1d091=_0x320a6b;if(process.env.WUJIE_SHELL_PROJECT_ROOT)return resolve(process.env.WUJIE_SHELL_PROJECT_ROOT);if(app['isPackag'+'ed']&&process[_0xf1d091(0x31f)+_0xf1d091(0x23c)])return join(process[_0xf1d091(0x31f)+'sPath'],_0xf1d091(0x169));return resolve(process[_0xf1d091(0x2d0)]());}function getLocalFileMimeType(_0x3ff2c5){const _0x3a6b0e=_0x320a6b;return LOCAL_FILE_MIME_TYPES[_0x3a6b0e(0x355)](_0x3ff2c5['slice'](_0x3ff2c5['lastInde'+'xOf']('.'))['toLowerC'+'ase']())||_0x3a6b0e(0x126)+_0x3a6b0e(0x2c6)+_0x3a6b0e(0xb2);}function parseSingleRangeHeader(_0x49e5bf,_0x3f5212){const _0x43b5ef=_0x320a6b,_0x53856f=/^bytes=(\d*)-(\d*)$/i[_0x43b5ef(0xc0)](_0x49e5bf[_0x43b5ef(0x255)]());if(!_0x53856f)return null;const [,_0xe6e555,_0xe1126a]=_0x53856f;if(!_0xe6e555&&!_0xe1126a)return null;if(!_0xe6e555){const _0x589580=Number['parseInt'](_0xe1126a,0xa);if(!Number[_0x43b5ef(0x261)](_0x589580)||_0x589580<=0x0)return null;const _0xde8fb=Math['max'](_0x3f5212-_0x589580,0x0);return{'start':_0xde8fb,'end':_0x3f5212-0x1};}const _0x37ca3d=Number['parseInt'](_0xe6e555,0xa);if(!Number['isFinite'](_0x37ca3d)||_0x37ca3d<0x0||_0x37ca3d>=_0x3f5212)return null;const _0x1f4e53=_0xe1126a?Number[_0x43b5ef(0x8c)](_0xe1126a,0xa):_0x3f5212-0x1;if(!Number[_0x43b5ef(0x261)](_0x1f4e53)||_0x1f4e53<_0x37ca3d)return null;return{'start':_0x37ca3d,'end':Math[_0x43b5ef(0x379)](_0x1f4e53,_0x3f5212-0x1)};}function decodeClawspacePath(_0x59ff81){const _0x5ca4c9=_0x320a6b;try{const _0x42cb29=new URL(_0x59ff81);if(_0x42cb29[_0x5ca4c9(0x231)]!==CLAWSPACE_PROTOCOL_SCHEME+':')return null;if(_0x42cb29['hostname']!==_0x5ca4c9(0x13d))return null;const _0x21dad1=decodeURIComponent(_0x42cb29[_0x5ca4c9(0x297)]);if(!_0x21dad1)return null;if(/^\/[A-Za-z]:\//['test'](_0x21dad1))return _0x21dad1['slice'](0x1);return _0x21dad1;}catch{return null;}}function createClawspaceHeaders(_0x3048a0={}){const _0x1e991b=_0x320a6b;return new Headers({'access-control-allow-origin':'*','access-control-allow-methods':_0x1e991b(0x9f)+_0x1e991b(0x2f3)+'NS','access-control-allow-headers':_0x1e991b(0x172)+_0x1e991b(0x151)+_0x1e991b(0x92),'access-control-expose-headers':_0x1e991b(0x15a)+'length,\x20'+_0x1e991b(0x15a)+_0x1e991b(0x28a)+_0x1e991b(0x1b6)+_0x1e991b(0x17c),..._0x3048a0});}function createLocalFileResponse(_0x2ab36a,_0x3f20af){const _0x3129d2=_0x320a6b,_0x42e21a=statSync(_0x3f20af);if(!_0x42e21a[_0x3129d2(0x295)]())return new Response('Not\x20foun'+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x3129d2(0x1e7)+'in;\x20char'+_0x3129d2(0x2b7)+'8'})});const _0x4f8cb3=getLocalFileMimeType(_0x3f20af),_0x3009a1=createClawspaceHeaders({'content-type':_0x4f8cb3,'accept-ranges':'bytes','cache-control':'no-store'});if(_0x2ab36a[_0x3129d2(0x394)]===_0x3129d2(0x2d1))return _0x3009a1[_0x3129d2(0x129)](_0x3129d2(0x15a)+_0x3129d2(0x294),String(_0x42e21a[_0x3129d2(0x1d9)])),new Response(null,{'status':0xc8,'headers':_0x3009a1});const _0x46b57=_0x2ab36a[_0x3129d2(0x217)]['get'](_0x3129d2(0x2f8));if(!_0x46b57)return _0x3009a1[_0x3129d2(0x129)](_0x3129d2(0x15a)+'length',String(_0x42e21a[_0x3129d2(0x1d9)])),new Response(Readable[_0x3129d2(0x226)](createReadStream(_0x3f20af)),{'status':0xc8,'headers':_0x3009a1});const _0x2d3aad=parseSingleRangeHeader(_0x46b57,_0x42e21a[_0x3129d2(0x1d9)]);if(!_0x2d3aad)return new Response(null,{'status':0x1a0,'headers':createClawspaceHeaders({...Object[_0x3129d2(0xf6)+_0x3129d2(0x12a)](_0x3009a1['entries']()),'content-range':'bytes\x20*/'+_0x42e21a[_0x3129d2(0x1d9)]})});const {start:_0x2551c6,end:_0x356b2b}=_0x2d3aad,_0x527006=_0x356b2b-_0x2551c6+0x1,_0xd8f8ed=new Headers(_0x3009a1);return _0xd8f8ed['set'](_0x3129d2(0x15a)+_0x3129d2(0x294),String(_0x527006)),_0xd8f8ed[_0x3129d2(0x129)](_0x3129d2(0x15a)+_0x3129d2(0x2f8),_0x3129d2(0x24c)+_0x2551c6+'-'+_0x356b2b+'/'+_0x42e21a[_0x3129d2(0x1d9)]),new Response(Readable[_0x3129d2(0x226)](createReadStream(_0x3f20af,{'start':_0x2551c6,'end':_0x356b2b})),{'status':0xce,'headers':_0xd8f8ed});}function installClawspaceProtocolHandler(){const _0x2c6cee=_0x320a6b;protocol[_0x2c6cee(0x128)](CLAWSPACE_PROTOCOL_SCHEME,_0x3c8491=>{const _0x4c62e5=_0x2c6cee;if(_0x3c8491[_0x4c62e5(0x394)]===_0x4c62e5(0x232))return new Response(null,{'status':0xcc,'headers':createClawspaceHeaders()});const _0x3d4a07=decodeClawspacePath(_0x3c8491['url']);if(!_0x3d4a07)return new Response(_0x4c62e5(0x1de)+'clawspac'+_0x4c62e5(0x320),{'status':0x190,'headers':createClawspaceHeaders({'content-type':_0x4c62e5(0x1e7)+_0x4c62e5(0x80)+'set=utf-'+'8'})});if(!existsSync(_0x3d4a07))return new Response(_0x4c62e5(0x269)+'d',{'status':0x194,'headers':createClawspaceHeaders({'content-type':_0x4c62e5(0x1e7)+_0x4c62e5(0x80)+'set=utf-'+'8'})});return createLocalFileResponse(_0x3c8491,_0x3d4a07);});}function broadcast(_0x51a9ad,_0x13d39f){const _0x1502d7=_0x320a6b;DEBUG_STDOUT&&console['info'](_0x1502d7(0x7e)+'hell:eve'+_0x1502d7(0x9e),_0x51a9ad,summarizePayload(_0x13d39f,{'maxDepth':0x2}));for(const _0x2a175f of BrowserWindow[_0x1502d7(0x90)+_0x1502d7(0x104)]()){!_0x2a175f[_0x1502d7(0x344)+_0x1502d7(0xd2)]['isDestro'+'yed']()&&_0x2a175f[_0x1502d7(0x344)+_0x1502d7(0xd2)][_0x1502d7(0x304)](_0x1502d7(0x106)+'ell:even'+'t',{'name':_0x51a9ad,'payload':_0x13d39f});}}async function loadProductRuntime(){const _0x331fcf=_0x320a6b,_0x319092=[join(shellConfig['projectR'+'oot'],_0x331fcf(0x382)+_0x331fcf(0x2e0),_0x331fcf(0x1a9)+'s'),join(app[_0x331fcf(0xf9)+'th'](),_0x331fcf(0x382)+_0x331fcf(0x2e0),'index.mj'+'s')],_0x5a185f=_0x319092['find'](_0x428167=>existsSync(_0x428167));if(!_0x5a185f)return mainLogger?.[_0x331fcf(0x9b)]('product\x20'+_0x331fcf(0xbb)+_0x331fcf(0x1f3)+_0x331fcf(0x89)+_0x331fcf(0x21e),{'runtimeCandidates':_0x319092}),{};try{const _0x45cacc=await import(pathToFileURL(_0x5a185f)[_0x331fcf(0x2bc)]);return mainLogger?.[_0x331fcf(0x9b)]('product\x20'+_0x331fcf(0xbb)+'extensio'+_0x331fcf(0x170),{'runtimePath':_0x5a185f}),_0x45cacc;}catch(_0x4c6c70){mainLogger?.[_0x331fcf(0x1bf)](_0x331fcf(0x36b)+'runtime\x20'+'extensio'+_0x331fcf(0x17a)+_0x331fcf(0x361),{'runtimePath':_0x5a185f,'error':summarizeError(_0x4c6c70)});throw _0x4c6c70;}}function openDevToolsForActiveContext(){const _0x39d56f=_0x320a6b,_0x52fe5a=BrowserWindow['getFocus'+_0x39d56f(0x385)]()||mainWindow;if(!_0x52fe5a||_0x52fe5a['isDestro'+_0x39d56f(0x2a0)]())return{'ok':![]};return _0x52fe5a[_0x39d56f(0x344)+_0x39d56f(0xd2)][_0x39d56f(0x9c)+'ools']({'mode':_0x39d56f(0xbc)}),_0x52fe5a['webConte'+_0x39d56f(0xd2)][_0x39d56f(0x304)](_0x39d56f(0x106)+_0x39d56f(0xb8)+'t',{'name':_0x39d56f(0x85)+_0x39d56f(0x239)+'t','payload':{'accelerator':DEVTOOLS_ACCELERATOR}}),{'ok':!![]};}function registerShellShortcuts(){const _0x8854d4=_0x320a6b;globalShortcut[_0x8854d4(0x220)+'er'](DEVTOOLS_ACCELERATOR);const _0x41d228=globalShortcut['register'](DEVTOOLS_ACCELERATOR,openDevToolsForActiveContext);!_0x41d228&&console[_0x8854d4(0x147)](_0x8854d4(0x7e)+'hell]\x20fa'+_0x8854d4(0x27f)+_0x8854d4(0x388)+_0x8854d4(0x33c)+_0x8854d4(0x2bd)+DEVTOOLS_ACCELERATOR);}async function getRuntimeResourceStatus(){const _0x5424d5=_0x320a6b;try{const _0x40e85d=await loadRuntimeInfo(shellConfig[_0x5424d5(0x29e)+_0x5424d5(0x323)]),_0x9c144b=_0x40e85d[_0x5424d5(0xc3)]||{};return{'ok':!![],'runtimeRoot':_0x40e85d[_0x5424d5(0x28c)+_0x5424d5(0x323)],'openclawVersion':_0x40e85d[_0x5424d5(0x240)+_0x5424d5(0x140)],'generatedAt':_0x9c144b[_0x5424d5(0x1f8)+'dAt']||null,'pluginCount':Array[_0x5424d5(0x1e8)](_0x9c144b[_0x5424d5(0xcf)])?_0x9c144b[_0x5424d5(0xcf)][_0x5424d5(0x294)]:0x0,'plugins':Array[_0x5424d5(0x1e8)](_0x9c144b['plugins'])?_0x9c144b[_0x5424d5(0xcf)]:[],'agents':_0x9c144b['agents']||null,'skills':_0x9c144b['skills']||null,'wrapper':_0x9c144b[_0x5424d5(0x212)+_0x5424d5(0x96)]||null,'product':_0x9c144b[_0x5424d5(0x206)]||null};}catch(_0x4bda00){return{'ok':![],'runtimeRoot':resolveRuntimeRoot(shellConfig?.[_0x5424d5(0x29e)+'oot']||resolveProjectRoot()),'error':_0x4bda00 instanceof Error?_0x4bda00[_0x5424d5(0x1cb)]:String(_0x4bda00)};}}async function createWindow(){const _0x596186=_0x320a6b,_0x2f5ace=process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x596186(0x29e)+'oot'],_0x596186(0x2ef),'index.ht'+'ml'),_0x53cca3=process[_0x596186(0x31d)]==='darwin';mainLogger?.[_0x596186(0x9b)](_0x596186(0x1ce)+_0x596186(0x182)+_0x596186(0x2b6),{'rendererUrl':_0x2f5ace,'mode':getMode()}),mainWindow=new BrowserWindow({'width':0x49c,'height':0x30c,'minWidth':0x384,'minHeight':0x26c,'title':shellConfig[_0x596186(0xd4)+'ame'],'backgroundColor':_0x53cca3?_0x596186(0x207)+'0':_0x596186(0x273),'titleBarStyle':_0x53cca3?'hidden':'default',..._0x53cca3?{'titleBarOverlay':!![],'trafficLightPosition':{'x':0x10,'y':0xc}}:{},..._0x53cca3?{'vibrancy':'sidebar'}:{},'webPreferences':{'preload':preloadPath,'contextIsolation':!![],'nodeIntegration':![],'sandbox':![]}}),mainWindow[_0x596186(0x344)+_0x596186(0xd2)]['on'](_0x596186(0x349)+_0x596186(0x387)+'nt',_0x267573=>{const _0x3b73d0=_0x596186,_0x298ad7=_0x267573[_0x3b73d0(0x25b)];if(!_0x298ad7||_0x298ad7['type']!==_0x3b73d0(0x2e5))return;const _0x1f67ad=String(_0x298ad7[_0x3b73d0(0x20d)]||'')[_0x3b73d0(0x389)+_0x3b73d0(0xfa)](),_0x3cb1f8=_0x1f67ad==='r',_0x149174=process[_0x3b73d0(0x31d)]===_0x3b73d0(0x2a8)?_0x298ad7['meta']===!![]:_0x298ad7[_0x3b73d0(0xb7)]===!![];if(!_0x3cb1f8||!_0x149174)return;_0x267573[_0x3b73d0(0x10e)+'efault'](),broadcast(_0x3b73d0(0x8d)+_0x3b73d0(0x2ec),{'type':_0x3b73d0(0x2cc)+'on','action':'reload'});}),mainWindow['on'](_0x596186(0x184),()=>{const _0x53f73e=_0x596186;updateController?.[_0x53f73e(0x2ad)+'ackgroun'+_0x53f73e(0x164)](_0x53f73e(0x37c)+'ocus');});const _0x310a5d=process.env.VITE_DEV_SERVER_URL;_0x310a5d?(await mainWindow[_0x596186(0x19c)](_0x310a5d),process.env.WUJIE_SHELL_OPEN_DEVTOOLS==='1'&&mainWindow[_0x596186(0x344)+_0x596186(0xd2)]['openDevT'+_0x596186(0x24b)]({'mode':_0x596186(0xbc)})):await mainWindow[_0x596186(0x1a3)](join(shellConfig[_0x596186(0x29e)+_0x596186(0x323)],'dist',_0x596186(0x267)+'ml')),mainLogger?.[_0x596186(0x9b)](_0x596186(0x24d)+_0x596186(0x1fa)+'ed',{'rendererUrl':_0x2f5ace,'mode':getMode()});}async function installIpcHandlers(){const _0x1ad4e7=_0x320a6b,_0x1a14b8=(_0x2aee45,_0x399283)=>{const _0x4ae786=_0x26f3;ipcMain[_0x4ae786(0x128)](_0x2aee45,async(_0x49eaa8,_0x104490)=>{const _0x112d8c=_0x4ae786,_0x448062=Date[_0x112d8c(0x310)](),_0x3b30d2=_0x49eaa8['senderFr'+'ame']?.['url']||_0x49eaa8[_0x112d8c(0x1dd)]['getURL']();ipcLogger?.[_0x112d8c(0x9b)](_0x112d8c(0x14c)+_0x112d8c(0x171)+_0x112d8c(0x16d),{'channel':_0x2aee45,'senderUrl':_0x3b30d2,'payload':summarizePayload(_0x104490)});DEBUG_STDOUT&&console[_0x112d8c(0x9b)](_0x112d8c(0x7e)+'hell:ipc'+']',_0x2aee45,_0x112d8c(0x233),summarizePayload(_0x104490));try{let _0x35a798;try{_0x35a798=await _0x399283(_0x49eaa8,_0x104490);}catch(_0x21a89e){if(!isGatewayNotInitializedError(_0x21a89e))throw _0x21a89e;await ensureGatewayControllerStarted(),_0x35a798=await _0x399283(_0x49eaa8,_0x104490);}const _0x3f518f=Date['now']()-_0x448062;return ipcLogger?.[_0x112d8c(0x9b)](_0x112d8c(0x14c)+'est\x20comp'+_0x112d8c(0x20e),{'channel':_0x2aee45,'durationMs':_0x3f518f,'result':summarizePayload(_0x35a798,{'maxDepth':0x2})}),await userEventWriter?.[_0x112d8c(0x2be)]({'channel':_0x2aee45,'payload':_0x104490,'result':_0x35a798,'durationMs':_0x3f518f,'status':_0x112d8c(0x314)+'d'}),DEBUG_STDOUT&&console[_0x112d8c(0x9b)]('[wujie-s'+'hell:ipc'+']',_0x2aee45,_0x112d8c(0xa2)+'d',summarizePayload(_0x35a798,{'maxDepth':0x2})),_0x35a798;}catch(_0xb91428){const _0xee856f=Date['now']()-_0x448062;ipcLogger?.[_0x112d8c(0x1bf)](_0x112d8c(0x14c)+'est\x20fail'+'ed',{'channel':_0x2aee45,'durationMs':_0xee856f,'error':summarizeError(_0xb91428)}),await userEventWriter?.[_0x112d8c(0x2be)]({'channel':_0x2aee45,'payload':_0x104490,'error':_0xb91428,'durationMs':_0xee856f,'status':_0x112d8c(0xc6)}),await diagnosticsWriter?.[_0x112d8c(0x2b1)+_0x112d8c(0x352)](diagnosticEventFromError(_0xb91428,{'category':_0x112d8c(0x1a4),'event':_0x112d8c(0x166)+_0x112d8c(0x35d)+'ed','message':_0x112d8c(0x12b)+_0x112d8c(0x190)+'ed:\x20'+_0x2aee45,'durationMs':_0xee856f,'meta':{'channel':_0x2aee45,'senderUrl':_0x3b30d2,'payload':summarizePayload(_0x104490)}}));DEBUG_STDOUT&&console[_0x112d8c(0x1bf)](_0x112d8c(0x7e)+_0x112d8c(0x105)+']',_0x2aee45,_0x112d8c(0xc6),summarizeError(_0xb91428));throw _0xb91428;}});},_0x1edaf4=()=>{const _0x324322=_0x26f3;if(!gatewayController)throw new Error(bootError?_0x324322(0x106)+_0x324322(0x337)+_0x324322(0x29a)+'\x20'+bootError:_0x324322(0x106)+_0x324322(0x2ae)+_0x324322(0xe9)+_0x324322(0x38a)+_0x324322(0x2e8));return gatewayController;},_0x416fb3=()=>{const _0x1e4f59=_0x26f3;if(typeof productRuntime[_0x1e4f59(0x388)+_0x1e4f59(0x266)+_0x1e4f59(0x357)+_0x1e4f59(0xa7)]!==_0x1e4f59(0x186))return;const _0x2a5ee6=productRuntime['register'+'ProductR'+_0x1e4f59(0x357)+_0x1e4f59(0xa7)]({'app':app,'BrowserWindow':BrowserWindow,'broadcast':broadcast,'configController':configController,'diagnosticEventFromError':diagnosticEventFromError,'diagnosticsWriter':diagnosticsWriter,'dialog':dialog,'exportLogsArchive':exportLogsArchive,'filesLogger':filesLogger,'getRuntimeSpawnContext':getRuntimeSpawnContext,'handle':_0x1a14b8,'mainLogger':mainLogger,'mainWindow':mainWindow,'rendererLogger':rendererLogger,'requireGateway':_0x1edaf4,'sep':sep,'openClawConfigHandlers':{'update':(..._0x4bdeb4)=>configController[_0x1e4f59(0x38b)+_0x1e4f59(0xe7)+_0x1e4f59(0x1d0)](..._0x4bdeb4),'setPluginConfig':_0x53183b=>configController['setOpenC'+_0x1e4f59(0x13a)+_0x1e4f59(0xec)](_0x53183b),'setChannelConfig':_0x265b64=>configController[_0x1e4f59(0x1a1)+'lawChann'+_0x1e4f59(0x12c)](_0x265b64),'deleteChannelConfig':_0x413b2b=>configController['deleteOp'+_0x1e4f59(0x218)+_0x1e4f59(0x22b)+_0x1e4f59(0x156)](_0x413b2b),'setSkillEntry':_0x18d61f=>configController[_0x1e4f59(0x1a1)+_0x1e4f59(0x20f)+_0x1e4f59(0x88)](_0x18d61f),'deleteSkillEntry':_0x598ae5=>configController[_0x1e4f59(0x139)+_0x1e4f59(0x1c4)+_0x1e4f59(0x364)](_0x598ae5),'setMcpServer':_0x16c293=>configController[_0x1e4f59(0x1a1)+'lawMcpSe'+_0x1e4f59(0x167)](_0x16c293),'deleteMcpServer':_0x4e88df=>configController[_0x1e4f59(0x139)+'enClawMc'+_0x1e4f59(0x123)](_0x4e88df)},'shell':shell,'shellConfig':shellConfig,'resolveRuntimeKdocsCliCommand':resolveRuntimeKdocsCliCommand,'resolveRuntimeLarkCliCommand':resolveRuntimeLarkCliCommand,'summarizePayload':summarizePayload,'summarizeText':summarizeText,'toHomePath':toHomePath,'writeMutableConfig':_0x3e806d})||{};Object['assign'](productRuntimeHooks,_0x2a5ee6);};_0x1a14b8('app:info',async()=>({'name':shellConfig['productN'+_0x1ad4e7(0xa9)],'version':app[_0x1ad4e7(0x334)+'on'](),'appId':shellConfig['appId'],'dataDir':shellConfig[_0x1ad4e7(0x1fe)]})),_0x1a14b8(_0x1ad4e7(0x1ff)+'-url',async(_0x2069d,_0x15be80)=>{const _0x41aa34=_0x1ad4e7,_0x59eb96=typeof _0x15be80===_0x41aa34(0x313)?_0x15be80:'';if(!_0x59eb96)return{'ok':![]};return filesLogger?.[_0x41aa34(0x9b)](_0x41aa34(0x23a)+'ernal\x20ur'+_0x41aa34(0x1eb)+'ted',{'url':summarizeText(_0x59eb96,0xa0)}),await shell[_0x41aa34(0x32b)+_0x41aa34(0x27b)](_0x59eb96),{'ok':!![]};});const _0x3e806d=async(_0x14f853,_0xe5135d)=>{const _0x3088b2=_0x1ad4e7;return configController['markConf'+_0x3088b2(0x108)+_0x3088b2(0x10f)+'ternally'](),await configController['writeCon'+_0x3088b2(0x156)](_0x14f853,_0xe5135d),{'ok':!![]};};_0x416fb3(),_0x1a14b8(_0x1ad4e7(0x200)+'mport-zi'+'p',async(_0x174e63,_0x1b019a)=>importMarketSkillZip({'payload':_0x1b019a,'importSkillZip':_0xd1450b=>importSkillZip({..._0xd1450b,'app':app,'dialog':dialog,'dialogWindow':BrowserWindow['fromWebC'+_0x1ad4e7(0xed)](_0x174e63[_0x1ad4e7(0x1dd)])||mainWindow,'configController':configController}),'configController':configController})),_0x1a14b8(_0x1ad4e7(0x1a5)+_0x1ad4e7(0x2c0),(_0x2cb240,_0x5c8015)=>updateManagedSkillConfig({'payload':_0x5c8015,'configController':configController})),_0x1a14b8(_0x1ad4e7(0x242)+_0x1ad4e7(0x248),(_0x287845,_0x58d32a)=>deleteMarketSkillRegistryEntry({'payload':_0x58d32a,'deleteManagedSkill':_0x3a03c4=>deleteManagedSkill({..._0x3a03c4,'gateway':_0x1edaf4(),'configController':configController}),'configController':configController}));const _0x596ac6=ensureGeneratedFilesStore();_0x1a14b8(_0x1ad4e7(0x257)+_0x1ad4e7(0x347)+_0x1ad4e7(0x2b0),async()=>_0x596ac6[_0x1ad4e7(0x21c)]()),_0x1a14b8(_0x1ad4e7(0x257)+'rated-fi'+'les:upse'+'rt',async(_0x407d5a,_0x546a4c={})=>_0x596ac6[_0x1ad4e7(0xaf)](_0x546a4c)),_0x1a14b8(_0x1ad4e7(0x257)+_0x1ad4e7(0x347)+_0x1ad4e7(0x395),async(_0x22738b,_0x3c8f1d)=>_0x596ac6['hide'](String(_0x3c8f1d||''))),_0x1a14b8(_0x1ad4e7(0x257)+_0x1ad4e7(0x347)+_0x1ad4e7(0x395)+_0x1ad4e7(0x191)+_0x1ad4e7(0x142),async(_0x32446b,_0x24a6e5)=>_0x596ac6[_0x1ad4e7(0x265)+_0x1ad4e7(0x335)](String(_0x24a6e5||''))),_0x1a14b8(_0x1ad4e7(0x257)+_0x1ad4e7(0x347)+_0x1ad4e7(0x37b)+'te',async(_0x398f55,_0x131870)=>_0x596ac6[_0x1ad4e7(0x173)+'le'](String(_0x131870||''))),_0x1a14b8(_0x1ad4e7(0x257)+_0x1ad4e7(0x347)+'les:dele'+'ted-stat'+'e',async(_0x161e74,_0x40e5c1=[])=>_0x596ac6[_0x1ad4e7(0x12e)+_0x1ad4e7(0x2c2)](_0x40e5c1)),_0x1a14b8(_0x1ad4e7(0x257)+_0x1ad4e7(0x347)+_0x1ad4e7(0x316)+'al',async(_0x12fc40,_0x648d9f)=>revealPathInFolder(_0x648d9f)),_0x1a14b8(_0x1ad4e7(0x162)+_0x1ad4e7(0x10a),async()=>_0x596ac6[_0x1ad4e7(0x21c)]()),_0x1a14b8(_0x1ad4e7(0x162)+'s:upsert',async(_0x2aa3c2,_0x52b93b={})=>_0x596ac6[_0x1ad4e7(0xaf)](_0x52b93b)),_0x1a14b8(_0x1ad4e7(0x162)+_0x1ad4e7(0x366),async(_0x1131a2,_0x291924={})=>_0x596ac6[_0x1ad4e7(0x1bb)](String(_0x291924['id']||_0x291924||''))),_0x1a14b8('artifact'+_0x1ad4e7(0x14f),async(_0x26ca9a,_0x2a8ece={})=>_0x596ac6[_0x1ad4e7(0x173)+'le'](String(_0x2a8ece['id']||_0x2a8ece||''))),_0x1a14b8(_0x1ad4e7(0x162)+_0x1ad4e7(0x14f)+_0x1ad4e7(0x2de),async(_0xf95c3d,_0x25298c={})=>_0x596ac6[_0x1ad4e7(0x12e)+_0x1ad4e7(0x2c2)](_0x25298c['paths']||_0x25298c)),_0x1a14b8('artifact'+_0x1ad4e7(0xfd),async(_0x5272c4,_0x26c145={})=>{const _0x51369d=_0x1ad4e7,_0x157c44=typeof _0x26c145===_0x51369d(0x313)?_0x26c145:_0x26c145['path']||_0x26c145['uri'];return revealPathInFolder(_0x157c44);});const _0x34d815=createPreferencesStore({'stateDir':configController['resolveS'+_0x1ad4e7(0x22c)](),'storeFile':_0x1ad4e7(0xe8)+_0x1ad4e7(0x19e)+'ces.json'});_0x1a14b8(_0x1ad4e7(0x339)+_0x1ad4e7(0xa3)+'se',async()=>_0x34d815[_0x1ad4e7(0x355)](_0x1ad4e7(0x305)+'rayOnClo'+'se',![])),_0x1a14b8(_0x1ad4e7(0x339)+':set-clo'+'se',async(_0x206e72,_0x1de37b)=>_0x34d815[_0x1ad4e7(0x129)]('closeToT'+_0x1ad4e7(0x21f)+'se',_0x1de37b===!![])),registerFileHandlers({'app':app,'filesLogger':filesLogger,'handle':_0x1a14b8,'sep':sep,'stateDir':configController['resolveS'+_0x1ad4e7(0x22c)](),'toHomePath':toHomePath}),registerProductLogHandlers({'app':app,'configController':configController,'diagnosticEventFromError':diagnosticEventFromError,'diagnosticsWriter':diagnosticsWriter,'exportLogsArchive':exportLogsArchive,'handle':_0x1a14b8,'mainLogger':mainLogger,'rendererLogger':rendererLogger,'summarizeText':summarizeText,'toHomePath':toHomePath}),registerModelHandlers({'handle':_0x1a14b8,'modelHandlers':{'saveCustomModel':_0x3f6550=>_0x1edaf4()[_0x1ad4e7(0x222)]['saveCust'+_0x1ad4e7(0x148)](_0x3f6550),'deleteCustomModel':_0x5aff5f=>_0x1edaf4()['models'][_0x1ad4e7(0x1f6)+_0x1ad4e7(0x396)+'l'](_0x5aff5f)}}),connectorController=createConnectorController({'shellConfig':shellConfig,'configController':configController,'broadcast':broadcast,'shell':shell,'getRuntimeSpawnContext':getRuntimeSpawnContext,'openClawConfigHandlers':{'update':(..._0x1afe4f)=>configController['updateOp'+_0x1ad4e7(0xe7)+_0x1ad4e7(0x1d0)](..._0x1afe4f),'setPluginConfig':_0xdcf063=>configController[_0x1ad4e7(0x1a1)+_0x1ad4e7(0x13a)+_0x1ad4e7(0xec)](_0xdcf063),'setChannelConfig':_0x3b738c=>configController[_0x1ad4e7(0x1a1)+_0x1ad4e7(0x332)+_0x1ad4e7(0x12c)](_0x3b738c),'deleteChannelConfig':_0x2fd2da=>configController['deleteOp'+'enClawCh'+_0x1ad4e7(0x22b)+_0x1ad4e7(0x156)](_0x2fd2da),'setSkillEntry':_0x8c6111=>configController[_0x1ad4e7(0x1a1)+'lawSkill'+_0x1ad4e7(0x88)](_0x8c6111),'deleteSkillEntry':_0x27a7b9=>configController[_0x1ad4e7(0x139)+_0x1ad4e7(0x1c4)+_0x1ad4e7(0x364)](_0x27a7b9),'setMcpServer':_0x4904fe=>configController[_0x1ad4e7(0x1a1)+'lawMcpSe'+_0x1ad4e7(0x167)](_0x4904fe),'deleteMcpServer':_0x548f90=>configController[_0x1ad4e7(0x139)+_0x1ad4e7(0x1c7)+_0x1ad4e7(0x123)](_0x548f90)},'resolveRuntimeKdocsCliCommand':resolveRuntimeKdocsCliCommand,'resolveRuntimeLarkCliCommand':resolveRuntimeLarkCliCommand}),_0x1a14b8('config:i'+_0x1ad4e7(0xd6)+_0x1ad4e7(0xee),async()=>connectorController['listImCh'+_0x1ad4e7(0x22b)+'figs']()),_0x1a14b8(_0x1ad4e7(0x2c8)+_0x1ad4e7(0xd6)+_0x1ad4e7(0x354)+'e',async(_0x15ee84,_0x21e1bc={})=>connectorController[_0x1ad4e7(0x244)+_0x1ad4e7(0x32c)+_0x1ad4e7(0x15e)](_0x21e1bc)),_0x1a14b8('config:i'+_0x1ad4e7(0xd6)+_0x1ad4e7(0xf1)+_0x1ad4e7(0x2f4),async(_0x571153,_0xcba7df={})=>connectorController['setImCha'+_0x1ad4e7(0x28d)+'led'](_0xcba7df)),_0x1a14b8(_0x1ad4e7(0x1bc)+_0x1ad4e7(0x34f)+':save',async(_0x39ea09,_0x3e45a0={})=>{const _0x3ae74b=_0x1ad4e7,_0x1d31b1=String(_0x3e45a0['channelI'+'d']||_0x3e45a0['payload']?.['channelI'+'d']||_0x3e45a0[_0x3ae74b(0x18b)]?.['id']||'');if(!_0x1d31b1)throw new Error(_0x3ae74b(0x2d7)+_0x3ae74b(0x249)+_0x3ae74b(0xdf));const _0x246c94=_0x3e45a0['payload']||_0x3e45a0,_0x25f3cd={'feishu':connectorController[_0x3ae74b(0x2e6)+_0x3ae74b(0x102)+'lConfig'],'qqbot':connectorController['saveQqbo'+_0x3ae74b(0x1d3)+_0x3ae74b(0x376)],'wecom':connectorController[_0x3ae74b(0x324)+_0x3ae74b(0x392)+'Config'],'qq_mail':connectorController[_0x3ae74b(0x268)+_0x3ae74b(0x13f)+'torConfi'+'g'],'netease_mail':connectorController[_0x3ae74b(0x154)+_0x3ae74b(0x1ba)+_0x3ae74b(0x34f)+_0x3ae74b(0x376)],'tencent_exmail':connectorController[_0x3ae74b(0x8e)+_0x3ae74b(0x10c)+_0x3ae74b(0x2b4)+_0x3ae74b(0x351)],'feishu_doc':connectorController[_0x3ae74b(0x2e6)+_0x3ae74b(0x2ac)+'nectorCo'+_0x3ae74b(0x1d0)],'tencent_docs':connectorController[_0x3ae74b(0x8e)+_0x3ae74b(0x356)+'onnector'+_0x3ae74b(0x376)],'kdocs':connectorController[_0x3ae74b(0x283)+_0x3ae74b(0x2e3)+_0x3ae74b(0x351)],'dingtalk_doc':connectorController['saveDing'+_0x3ae74b(0x165)+'onnector'+_0x3ae74b(0x376)]},_0xe6fb22=_0x25f3cd[_0x1d31b1];if(!_0xe6fb22)throw new Error(_0x3ae74b(0xd9)+'ted\x20conn'+_0x3ae74b(0xb3)+_0x1d31b1);return _0xe6fb22(_0x246c94);}),_0x1a14b8(_0x1ad4e7(0x1bc)+_0x1ad4e7(0x34f)+_0x1ad4e7(0x33b)+_0x1ad4e7(0x1e1)+_0x1ad4e7(0x116),async(_0x58586b,_0x47738d={})=>connectorController[_0x1ad4e7(0x2e6)+_0x1ad4e7(0x102)+_0x1ad4e7(0xca)](_0x47738d)),_0x1a14b8(_0x1ad4e7(0x1bc)+_0x1ad4e7(0x34f)+':save-qq'+_0x1ad4e7(0x280)+_0x1ad4e7(0x308),async(_0x28ef71,_0x537984={})=>connectorController['saveQqbo'+_0x1ad4e7(0x1d3)+_0x1ad4e7(0x376)](_0x537984)),_0x1a14b8('config:c'+_0x1ad4e7(0x34f)+_0x1ad4e7(0x8b)+_0x1ad4e7(0x2fe)+_0x1ad4e7(0x308),async(_0x426e99,_0x5ebfd0={})=>connectorController['saveWeco'+_0x1ad4e7(0x392)+'Config'](_0x5ebfd0)),_0x1a14b8(_0x1ad4e7(0x1bc)+_0x1ad4e7(0x34f)+_0x1ad4e7(0x234)+_0x1ad4e7(0x2c3),async(_0x5efcfe,_0x369815={})=>connectorController[_0x1ad4e7(0x268)+'ilConnec'+_0x1ad4e7(0x21a)+'g'](_0x369815)),_0x1a14b8(_0x1ad4e7(0x1bc)+'onnector'+_0x1ad4e7(0x258)+_0x1ad4e7(0x1bd)+'il',async(_0x4a6e09,_0x17001a={})=>connectorController[_0x1ad4e7(0x154)+'aseMailC'+_0x1ad4e7(0x34f)+_0x1ad4e7(0x376)](_0x17001a)),_0x1a14b8('config:c'+_0x1ad4e7(0x34f)+_0x1ad4e7(0x12d)+'ncent-ex'+'mail',async(_0x39bdbb,_0x2b070b={})=>connectorController[_0x1ad4e7(0x8e)+_0x1ad4e7(0x10c)+'lConnect'+_0x1ad4e7(0x351)](_0x2b070b)),_0x1a14b8(_0x1ad4e7(0x1bc)+_0x1ad4e7(0x34f)+':save-fe'+_0x1ad4e7(0x1a8),async(_0x5b4ceb,_0x24e9db={})=>connectorController[_0x1ad4e7(0x2e6)+_0x1ad4e7(0x2ac)+_0x1ad4e7(0x26d)+_0x1ad4e7(0x1d0)](_0x24e9db)),_0x1a14b8(_0x1ad4e7(0x1bc)+_0x1ad4e7(0x34f)+_0x1ad4e7(0x12d)+_0x1ad4e7(0x153)+'cs',async(_0xa8b6f8,_0x36f14e={})=>connectorController[_0x1ad4e7(0x8e)+_0x1ad4e7(0x356)+_0x1ad4e7(0x34f)+'Config'](_0x36f14e)),_0x1a14b8('config:c'+_0x1ad4e7(0x34f)+_0x1ad4e7(0x373)+_0x1ad4e7(0x322),async(_0x2b2b38,_0x32c1ca={})=>connectorController[_0x1ad4e7(0x283)+_0x1ad4e7(0x2e3)+'orConfig'](_0x32c1ca)),_0x1a14b8(_0x1ad4e7(0x1bc)+_0x1ad4e7(0x34f)+_0x1ad4e7(0x155)+_0x1ad4e7(0xf5)+'oc',async(_0x2a1a2e,_0x32cb1a={})=>connectorController['saveDing'+'talkDocC'+_0x1ad4e7(0x34f)+'Config'](_0x32cb1a)),_0x1a14b8('config:c'+_0x1ad4e7(0x34f)+'-session'+_0x1ad4e7(0x2b8),async(_0x3c0b94,_0x344999={})=>{const _0x344a6e=_0x1ad4e7,_0x2f36b4=String(_0x344999['channelI'+'d']||_0x344999['type']||'');if(_0x2f36b4===_0x344a6e(0x1ad))return connectorController['startKdo'+'csCliCon'+_0x344a6e(0x37f)+'ion']();if(_0x2f36b4===_0x344a6e(0x37d)+'oc')return connectorController[_0x344a6e(0x237)+_0x344a6e(0x32f)+_0x344a6e(0x204)+'Session']();if(_0x2f36b4===_0x344a6e(0x152))return connectorController['startFei'+_0x344a6e(0x125)+_0x344a6e(0x390)+_0x344a6e(0x2ff)](_0x344999);if(_0x2f36b4===_0x344a6e(0x240)+'-weixin'||_0x2f36b4===_0x344a6e(0x16a))return connectorController['startWec'+_0x344a6e(0x331)+_0x344a6e(0x22f)+'n']({'gatewayPort':_0x1edaf4()['gatewayP'+_0x344a6e(0xeb)](),'gatewayToken':_0x1edaf4()[_0x344a6e(0x1b3)+'oken']()});throw new Error(_0x344a6e(0xd9)+_0x344a6e(0x119)+'ector\x20se'+'ssion:\x20'+(_0x2f36b4||_0x344a6e(0xe2)));}),_0x1a14b8(_0x1ad4e7(0x1bc)+_0x1ad4e7(0x34f)+'-session'+_0x1ad4e7(0x2a2),async(_0x2d10b5,_0x5e4719={})=>{const _0x3a3847=_0x1ad4e7,_0xabe2ac=String(_0x5e4719[_0x3a3847(0x2d7)+'d']||_0x5e4719[_0x3a3847(0xd1)]||'');if(_0xabe2ac===_0x3a3847(0x1ad))return connectorController[_0x3a3847(0x216)+_0x3a3847(0x256)+_0x3a3847(0xe1)](_0x5e4719);if(_0xabe2ac===_0x3a3847(0x37d)+'oc')return connectorController['getFeish'+_0x3a3847(0x2cb)+'onnectSt'+_0x3a3847(0x12f)](_0x5e4719);if(_0xabe2ac===_0x3a3847(0x152))return connectorController[_0x3a3847(0x278)+_0x3a3847(0x133)+_0x3a3847(0xb0)+_0x3a3847(0x221)](_0x5e4719);throw new Error(_0x3a3847(0xd9)+_0x3a3847(0x119)+_0x3a3847(0x26b)+_0x3a3847(0x198)+(_0xabe2ac||'unknown'));}),_0x1a14b8(_0x1ad4e7(0x1bc)+_0x1ad4e7(0x34f)+_0x1ad4e7(0x1b7)+_0x1ad4e7(0xe5),async(_0x51b5eb,_0x10128c={})=>{const _0x2796d7=_0x1ad4e7,_0x31edd5=String(_0x10128c['channelI'+'d']||_0x10128c[_0x2796d7(0xd1)]||'');if(_0x31edd5===_0x2796d7(0x1ad))return connectorController[_0x2796d7(0x2bb)+_0x2796d7(0x393)+_0x2796d7(0x31c)+_0x2796d7(0x238)](_0x10128c);if(_0x31edd5==='feishu_d'+'oc')return connectorController[_0x2796d7(0x312)+_0x2796d7(0x2c1)+_0x2796d7(0x321)+_0x2796d7(0x174)](_0x10128c);if(_0x31edd5===_0x2796d7(0x152))return connectorController['cancelFe'+'ishuRegi'+_0x2796d7(0x34c)+'Session'](_0x10128c);if(_0x31edd5===_0x2796d7(0x240)+_0x2796d7(0x359)||_0x31edd5===_0x2796d7(0x16a))return connectorController[_0x2796d7(0x36d)+_0x2796d7(0x35e)+_0x2796d7(0x18a)+'on']();return{'ok':!![]};}),_0x1a14b8('config:c'+'onnector'+_0x1ad4e7(0x1b7)+_0x1ad4e7(0x374)+'e',async(_0x5f2c2e,_0x2993b4={})=>{const _0x778f71=_0x1ad4e7,_0x1d9122=String(_0x2993b4[_0x778f71(0x2d7)+'d']||_0x2993b4[_0x778f71(0xd1)]||'');if(_0x1d9122===_0x778f71(0x37d)+'oc')return connectorController['complete'+_0x778f71(0x2c9)+_0x778f71(0x318)+_0x778f71(0x199)+'on'](_0x2993b4);throw new Error(_0x778f71(0xd9)+'ted\x20conn'+'ector\x20se'+_0x778f71(0x198)+(_0x1d9122||'unknown'));}),_0x1a14b8('config:r'+_0x1ad4e7(0x371),()=>connectorController[_0x1ad4e7(0x2ce)+_0x1ad4e7(0x1b4)+'ot']());const _0x16e912=_0x3f7036=>{const _0xae995b=_0x1ad4e7,_0x5284a5=_0x3f7036[_0xae995b(0x2aa)]&&typeof _0x3f7036[_0xae995b(0x2aa)]===_0xae995b(0x307)?_0x3f7036['agents']:{};return Array[_0xae995b(0x1e8)](_0x5284a5[_0xae995b(0x21c)])?_0x5284a5[_0xae995b(0x21c)]:[];},_0x49662d=_0x2f4eb4=>{const _0x372c1a=_0x1ad4e7,_0x4e5aa8=typeof _0x2f4eb4===_0x372c1a(0x313)?_0x2f4eb4['trim']():'',_0x353817=_0x4e5aa8['match'](/^agent:([^:]+):/);return _0x353817?.[0x1]||'';},_0x305a17=(_0x100858={},_0x3094e2=[])=>{const _0x41332f=_0x1ad4e7,_0x2e86f4=Array[_0x41332f(0x1e8)](_0x100858[_0x41332f(0x2aa)])?_0x100858[_0x41332f(0x2aa)]:Array['isArray'](_0x100858['list'])?_0x100858[_0x41332f(0x21c)]:[],_0x1a481b=Array[_0x41332f(0x1e8)](_0x3094e2)?_0x3094e2:[];return _0x2e86f4[_0x41332f(0x1c6)](_0x48944b=>{const _0x3bcd0f=_0x41332f,_0x54918b=String(_0x48944b?.['id']||_0x48944b?.[_0x3bcd0f(0x276)]||'')[_0x3bcd0f(0x255)]();return{'agent':_0x48944b,'sessions':_0x54918b?_0x1a481b['filter'](_0x18fa1f=>{const _0x1a7a15=_0x3bcd0f,_0x3443d0=String(_0x18fa1f?.[_0x1a7a15(0x276)]||_0x18fa1f?.['agent_id']||_0x18fa1f?.[_0x1a7a15(0x145)]?.['id']||_0x49662d(_0x18fa1f?.[_0x1a7a15(0x20d)])||'')['trim']();return _0x3443d0?_0x3443d0===_0x54918b:_0x54918b===_0x1a7a15(0x195);}):[]};});};_0x1a14b8(_0x1ad4e7(0xa5)+_0x1ad4e7(0x27c)+_0x1ad4e7(0x2c2),async()=>updateController?.['getState']()),_0x1a14b8('app:upda'+'te:check',async()=>updateController?.['checkFor'+_0x1ad4e7(0x381)]()),_0x1a14b8('app:upda'+_0x1ad4e7(0xef)+_0x1ad4e7(0x192),async()=>updateController?.[_0x1ad4e7(0x18d)+_0x1ad4e7(0xe0)]()),_0x1a14b8(_0x1ad4e7(0xa5)+'te:quit-'+'and-inst'+'all',async()=>updateController?.[_0x1ad4e7(0x1fd)+_0x1ad4e7(0xe6)]()),_0x1a14b8(_0x1ad4e7(0x31a)+_0x1ad4e7(0x236),async(_0x15c25a,_0x29586f={})=>{const _0x249593=_0x1ad4e7,_0xa113b0=await dialog[_0x249593(0x369)+'Dialog'](BrowserWindow[_0x249593(0x25f)+_0x249593(0xed)](_0x15c25a[_0x249593(0x1dd)])??mainWindow,{'properties':[_0x249593(0x291),..._0x29586f?.[_0x249593(0x1d5)]!==0x1?['multiSel'+_0x249593(0x1f5)]:[]],'filters':_0x29586f?.['customNa'+'meFilter'+'s']?[{'name':_0x249593(0x2d4),'extensions':_0x29586f['customNa'+_0x249593(0x1aa)+'s']}]:undefined});return _0xa113b0[_0x249593(0x2dc)+'s'][_0x249593(0x1c6)](_0x4fb019=>({'path':_0x4fb019,'name':_0x4fb019[_0x249593(0x292)](/[\\/]/)['pop']()||_0x4fb019}));}),_0x1a14b8(_0x1ad4e7(0x31a)+_0x1ad4e7(0x115)+_0x1ad4e7(0x23d),async(_0x4ae71a,_0x3df581={})=>{const _0x1725dc=_0x1ad4e7,_0x27231d=String(_0x3df581['sourcePa'+'th']||'');if(!_0x27231d)return{'success':![],'error':'sourcePa'+_0x1725dc(0x26e)+_0x1725dc(0x250)};const _0x227cea=await dialog[_0x1725dc(0xd8)+'Dialog'](mainWindow,{'defaultPath':_0x3df581[_0x1725dc(0xa0)+_0x1725dc(0x1d7)]||_0x27231d['split'](/[\\/]/)['pop']()});if(_0x227cea[_0x1725dc(0xf3)]||!_0x227cea[_0x1725dc(0x2dc)])return{'success':![],'canceled':!![]};const {copyFile:_0x4fc2d5}=await import('node:fs/'+_0x1725dc(0x18f));return await _0x4fc2d5(_0x27231d,_0x227cea['filePath']),{'success':!![],'filePath':_0x227cea[_0x1725dc(0x2dc)]};}),_0x1a14b8(_0x1ad4e7(0x138)+_0x1ad4e7(0xea)+'ite',async(_0x803145,_0x289478)=>{return clipboard['writeTex'+'t'](String(_0x289478??'')),{'ok':!![]};}),_0x1a14b8('app:syst'+_0x1ad4e7(0x34d)+'rt',async()=>{const _0x3cfad9=_0x1ad4e7;return app[_0x3cfad9(0xac)](),app[_0x3cfad9(0xfc)](),{'ok':!![]};}),_0x1a14b8(_0x1ad4e7(0x1f2)+'s-maximi'+_0x1ad4e7(0x289),_0x2cf646=>Boolean(BrowserWindow['fromWebC'+_0x1ad4e7(0xed)](_0x2cf646[_0x1ad4e7(0x1dd)])?.[_0x1ad4e7(0x2eb)+'zed']())),_0x1a14b8(_0x1ad4e7(0x19f)+_0x1ad4e7(0x176),async(_0x3025a4,_0x1a68cd)=>{const _0x590f2d=_0x1ad4e7;return app['setLogin'+_0x590f2d(0x1d4)+'ings']({'openAtLogin':_0x1a68cd===!![]}),{'ok':!![],'enabled':_0x1a68cd===!![]};}),_0x1a14b8(_0x1ad4e7(0x19f)+_0x1ad4e7(0xbf),async()=>app['getLogin'+_0x1ad4e7(0x1d4)+_0x1ad4e7(0x24f)]()[_0x1ad4e7(0x23b)+_0x1ad4e7(0x28f)]),_0x1a14b8(_0x1ad4e7(0x31a)+':choose-'+_0x1ad4e7(0x33d),async _0x500cf2=>{const _0x41272b=_0x1ad4e7,_0x398604=await dialog[_0x41272b(0x369)+_0x41272b(0xb5)](BrowserWindow[_0x41272b(0x25f)+_0x41272b(0xed)](_0x500cf2[_0x41272b(0x1dd)])??mainWindow,{'properties':[_0x41272b(0x2d8)+_0x41272b(0x124)]});return _0x398604[_0x41272b(0x2dc)+'s'][0x0]||'';}),_0x1a14b8(_0x1ad4e7(0x189)+_0x1ad4e7(0x160)+_0x1ad4e7(0x33d),async(_0x3f6805,_0x128a67)=>{const _0x18c9a1=_0x1ad4e7,_0x4613b3=await shell[_0x18c9a1(0x111)](String(_0x128a67||''));return _0x4613b3||'';}),_0x1a14b8('openclaw'+':gateway'+'-token',async()=>_0x1edaf4()['gatewayT'+_0x1ad4e7(0x375)]()),_0x1a14b8(_0x1ad4e7(0x240)+_0x1ad4e7(0x2ca)+_0x1ad4e7(0xa8),async()=>_0x1edaf4()[_0x1ad4e7(0x333)+_0x1ad4e7(0xeb)]()),_0x1a14b8('openclaw'+_0x1ad4e7(0x2fd)+'e',async(_0x494b7e,_0x320785=[])=>{const _0x415e61=_0x1ad4e7,_0x5e7446=await runClawOnce(shellConfig[_0x415e61(0x29e)+_0x415e61(0x323)],Array[_0x415e61(0x1e8)](_0x320785)?_0x320785:[]);return{'ok':_0x5e7446['code']===0x0,..._0x5e7446};}),_0x1a14b8(_0x1ad4e7(0x1b8)+_0x1ad4e7(0x215),async(_0x16c0ea,_0x49b357={})=>_0x1edaf4()['sessions']['create']({..._0x49b357,'parentSessionKey':_0x49b357[_0x1ad4e7(0x84)+_0x1ad4e7(0x2e4)]||_0x49b357[_0x1ad4e7(0x254)+'ey']}));const _0x4ba1c3=configController['resolveS'+_0x1ad4e7(0x22c)]();sessionSqliteStore=ensureSessionSqliteStore();const _0x3e46cb=createAgentSessionsMapStore({'stateDir':_0x4ba1c3});_0x1a14b8('sessions'+':agent-m'+_0x1ad4e7(0x13b),async(_0x1e3789,_0x19b9f3={})=>_0x3e46cb[_0x1ad4e7(0x355)](_0x19b9f3)),_0x1a14b8(_0x1ad4e7(0x1b8)+_0x1ad4e7(0xfb)+_0x1ad4e7(0x109)+'t',async(_0x42fe1f,_0x369bb6={})=>_0x3e46cb['upsert'](_0x369bb6)),_0x1a14b8('sessions'+':agent-m'+_0x1ad4e7(0xdd),async(_0x1cfa15,_0xd44415={})=>{const _0x27324a=_0x1ad4e7,_0x168edb=String(_0xd44415[_0x27324a(0x254)+'ey']||'')['trim']();if(!_0x168edb)return null;return await sessionSqliteStore[_0x27324a(0x36c)+_0x27324a(0x24e)](_0x168edb);}),_0x1a14b8('agents:c'+_0x1ad4e7(0xda),async(_0xb86107,_0x3c45e4={})=>{const _0x3a8a75=_0x1ad4e7,_0x23e7f3=await readMutableConfig(),_0x52c77f=_0x23e7f3[_0x3a8a75(0x2aa)]&&typeof _0x23e7f3[_0x3a8a75(0x2aa)]===_0x3a8a75(0x307)?_0x23e7f3[_0x3a8a75(0x2aa)]:{},_0x1d3f34=_0x16e912(_0x23e7f3),_0x2156a3=String(_0x3c45e4['id']||_0x3c45e4[_0x3a8a75(0x95)]||_0x3a8a75(0x253)+Date[_0x3a8a75(0x310)]())[_0x3a8a75(0x255)]()[_0x3a8a75(0x30a)](/\s+/g,'-'),_0x557971={'id':_0x2156a3,'name':String(_0x3c45e4['name']||_0x2156a3),..._0x3c45e4[_0x3a8a75(0x1e4)+'e']?{'workspace':String(_0x3c45e4[_0x3a8a75(0x1e4)+'e'])}:{},..._0x3c45e4['model']?{'model':_0x3c45e4[_0x3a8a75(0x37a)]}:{},..._0x3c45e4['emoji']?{'emoji':_0x3c45e4[_0x3a8a75(0x2e7)]}:{},..._0x3c45e4[_0x3a8a75(0xb9)]?{'avatar':_0x3c45e4[_0x3a8a75(0xb9)]}:{},...Array[_0x3a8a75(0x1e8)](_0x3c45e4['skills'])?{'skills':_0x3c45e4[_0x3a8a75(0x26a)]}:{}};if(_0x1d3f34[_0x3a8a75(0xb1)](_0x3abd2c=>_0x3abd2c?.['id']===_0x2156a3))throw new Error(_0x3a8a75(0xc5)+_0x3a8a75(0xcb)+_0x3a8a75(0x144));return _0x52c77f[_0x3a8a75(0x21c)]=[..._0x1d3f34,_0x557971],_0x23e7f3[_0x3a8a75(0x2aa)]=_0x52c77f,await _0x3e806d(_0x23e7f3,_0x3a8a75(0x8f)+_0x3a8a75(0x2ea)),{'ok':!![],'agent':_0x557971};}),_0x1a14b8(_0x1ad4e7(0xc9)+_0x1ad4e7(0x2c0),async(_0x39cd9e,_0x7e62e5={})=>{const _0x2ee1e9=_0x1ad4e7,_0x15124a=String(_0x7e62e5['id']||_0x7e62e5[_0x2ee1e9(0x276)]||'')['trim']();if(!_0x15124a)throw new Error(_0x2ee1e9(0x117)+_0x2ee1e9(0x16c)+'ired');const _0x5bcbfb=await readMutableConfig(),_0x9c2c63=_0x5bcbfb[_0x2ee1e9(0x2aa)]&&typeof _0x5bcbfb[_0x2ee1e9(0x2aa)]===_0x2ee1e9(0x307)?_0x5bcbfb[_0x2ee1e9(0x2aa)]:{},_0x6e00df=_0x16e912(_0x5bcbfb),_0x5c155c=_0x6e00df[_0x2ee1e9(0x1c6)](_0x3590fd=>_0x3590fd?.['id']===_0x15124a?{..._0x3590fd,..._0x7e62e5,'id':_0x15124a}:_0x3590fd);return _0x9c2c63[_0x2ee1e9(0x21c)]=_0x5c155c,_0x5bcbfb[_0x2ee1e9(0x2aa)]=_0x9c2c63,await _0x3e806d(_0x5bcbfb,'agent\x20up'+_0x2ee1e9(0x343)),{'ok':!![],'agent':_0x5c155c[_0x2ee1e9(0x2a1)](_0x1b6bef=>_0x1b6bef?.['id']===_0x15124a)||null};}),_0x1a14b8('agents:d'+_0x1ad4e7(0x248),async(_0x4f7b17,_0x44076e={})=>{const _0x48bb81=_0x1ad4e7,_0x3e4bec=String(_0x44076e['id']||_0x44076e[_0x48bb81(0x276)]||'')['trim']();if(!_0x3e4bec)throw new Error(_0x48bb81(0x117)+_0x48bb81(0x16c)+_0x48bb81(0x163));const _0x33111a=await readMutableConfig(),_0x266674=_0x33111a[_0x48bb81(0x2aa)]&&typeof _0x33111a[_0x48bb81(0x2aa)]===_0x48bb81(0x307)?_0x33111a['agents']:{};return _0x266674[_0x48bb81(0x21c)]=_0x16e912(_0x33111a)['filter'](_0x5b5233=>_0x5b5233?.['id']!==_0x3e4bec),_0x33111a[_0x48bb81(0x2aa)]=_0x266674,await _0x3e806d(_0x33111a,_0x48bb81(0x2c4)+_0x48bb81(0x20e)),{'ok':!![],'agentId':_0x3e4bec};}),_0x1a14b8(_0x1ad4e7(0xf4)+'ith-sess'+_0x1ad4e7(0x21b)+'t',async(_0x5f4eae,_0x36599e={})=>{const _0x21f939=_0x1ad4e7,[_0x2a8233,_0x13deb7]=await Promise[_0x21f939(0xa4)]([_0x1edaf4()['agents'][_0x21f939(0x21c)](),_0x1edaf4()[_0x21f939(0x1b8)][_0x21f939(0x21c)](_0x36599e)[_0x21f939(0x336)](()=>({'sessions':[]}))]),_0x4fa813=Array[_0x21f939(0x1e8)](_0x13deb7[_0x21f939(0x1b8)])?_0x13deb7[_0x21f939(0x1b8)]:[];return{..._0x2a8233,'sessions':_0x4fa813,'groups':Array[_0x21f939(0x1e8)](_0x2a8233[_0x21f939(0x23f)])?_0x2a8233[_0x21f939(0x23f)]:_0x305a17(_0x2a8233,_0x4fa813)};}),terminalManager=createTerminalManager({'cwd':join(configController['resolveS'+_0x1ad4e7(0x22c)](),_0x1ad4e7(0x1e4)+'e'),'emitData':_0x22562b=>broadcast(_0x1ad4e7(0x1a7)+_0x1ad4e7(0xe3),_0x22562b),'emitExit':_0xf5cc81=>broadcast(_0x1ad4e7(0x1a7)+_0x1ad4e7(0x33f),_0xf5cc81)}),_0x1a14b8('terminal'+_0x1ad4e7(0x22d),async(_0x24775e,_0x5ee7d8={})=>terminalManager[_0x1ad4e7(0x370)](_0x5ee7d8)),_0x1a14b8(_0x1ad4e7(0x1a7)+_0x1ad4e7(0x1f1),async(_0x5ad84d,_0xc8f5d4={})=>terminalManager[_0x1ad4e7(0x25b)](_0xc8f5d4)),_0x1a14b8(_0x1ad4e7(0x1a7)+_0x1ad4e7(0x34e),async(_0x43fa2b,_0x4ff997={})=>terminalManager[_0x1ad4e7(0x2b5)](_0x4ff997)),_0x1a14b8(_0x1ad4e7(0x1a7)+':close',async(_0x100900,_0x4882e3={})=>terminalManager[_0x1ad4e7(0x8a)](_0x4882e3)),_0x1a14b8(_0x1ad4e7(0x1b5)+_0x1ad4e7(0x21c),async()=>{const _0x2676f6=_0x1ad4e7,_0x5b693b=gatewayController?.[_0x2676f6(0x1da)+'nfo']?.()||{};return _0x5b693b[_0x2676f6(0xcf)]||[];}),_0x1a14b8(_0x1ad4e7(0x1b5)+_0x1ad4e7(0x1ea)+'ig',async(_0x55ac17,_0x4f9048={})=>{const _0x4d2bbf=_0x1ad4e7,_0x4772c1=String(_0x4f9048[_0x4d2bbf(0xbe)]||_0x4f9048['id']||''),_0x5c2386=await readMutableConfig(),_0x1b1dc3=_0x5c2386[_0x4d2bbf(0xcf)]?.['entries']||{};return _0x4772c1?_0x1b1dc3[_0x4772c1]||null:_0x1b1dc3;}),_0x1a14b8('plugins:'+'update-c'+'onfig',async(_0x5a6f5f,_0x3ac3fc={})=>{const _0x45f1cc=_0x1ad4e7,_0x1c78d9=String(_0x3ac3fc[_0x45f1cc(0xbe)]||_0x3ac3fc['id']||'');if(!_0x1c78d9)throw new Error(_0x45f1cc(0xbe)+_0x45f1cc(0x16c)+_0x45f1cc(0x163));const _0x396440=await readMutableConfig(),_0xc4c0cd=_0x396440[_0x45f1cc(0xcf)]&&typeof _0x396440[_0x45f1cc(0xcf)]===_0x45f1cc(0x307)?_0x396440[_0x45f1cc(0xcf)]:{},_0x53d255=_0xc4c0cd[_0x45f1cc(0x178)]&&typeof _0xc4c0cd[_0x45f1cc(0x178)]==='object'?_0xc4c0cd[_0x45f1cc(0x178)]:{};return _0x53d255[_0x1c78d9]={..._0x53d255[_0x1c78d9]||{},..._0x3ac3fc['config']||_0x3ac3fc['patch']||{}},_0xc4c0cd[_0x45f1cc(0x178)]=_0x53d255,_0x396440[_0x45f1cc(0xcf)]=_0xc4c0cd,_0x3e806d(_0x396440,_0x45f1cc(0x309)+_0x45f1cc(0x11f)+_0x45f1cc(0x343));}),_0x1a14b8(_0x1ad4e7(0x1b5)+_0x1ad4e7(0xae),async(_0x567893,_0x4e12e4={})=>{const _0x343cb7=_0x1ad4e7,_0x159b5e=String(_0x4e12e4[_0x343cb7(0xbe)]||_0x4e12e4['id']||'');if(!_0x159b5e)throw new Error(_0x343cb7(0xbe)+_0x343cb7(0x16c)+_0x343cb7(0x163));const _0x1f53e7=await readMutableConfig(),_0x208864=_0x1f53e7[_0x343cb7(0xcf)]&&typeof _0x1f53e7['plugins']===_0x343cb7(0x307)?_0x1f53e7[_0x343cb7(0xcf)]:{},_0xd9f820=_0x208864['entries']&&typeof _0x208864[_0x343cb7(0x178)]===_0x343cb7(0x307)?_0x208864['entries']:{};return _0xd9f820[_0x159b5e]={..._0xd9f820[_0x159b5e]||{},'enabled':!![]},_0x208864['entries']=_0xd9f820,_0x1f53e7[_0x343cb7(0xcf)]=_0x208864,_0x3e806d(_0x1f53e7,_0x343cb7(0x298)+_0x343cb7(0x2f4));}),_0x1a14b8(_0x1ad4e7(0x1b5)+_0x1ad4e7(0x121),async(_0x145ed9,_0x3ca224={})=>{const _0xb9897f=_0x1ad4e7,_0x4c6556=String(_0x3ca224['pluginId']||_0x3ca224['id']||'');if(!_0x4c6556)throw new Error(_0xb9897f(0xbe)+_0xb9897f(0x16c)+_0xb9897f(0x163));const _0x4da65a=await readMutableConfig(),_0x4664f5=_0x4da65a[_0xb9897f(0xcf)]&&typeof _0x4da65a[_0xb9897f(0xcf)]===_0xb9897f(0x307)?_0x4da65a[_0xb9897f(0xcf)]:{},_0x40e1c4=_0x4664f5['entries']&&typeof _0x4664f5[_0xb9897f(0x178)]===_0xb9897f(0x307)?_0x4664f5[_0xb9897f(0x178)]:{};return _0x40e1c4[_0x4c6556]={..._0x40e1c4[_0x4c6556]||{},'enabled':![]},_0x4664f5[_0xb9897f(0x178)]=_0x40e1c4,_0x4da65a[_0xb9897f(0xcf)]=_0x4664f5,_0x3e806d(_0x4da65a,'plugin\x20d'+_0xb9897f(0x378));}),_0x1a14b8(_0x1ad4e7(0x1b5)+_0x1ad4e7(0x1a0),async(_0x17d214,_0x4994fe={})=>({'plugins':await((async()=>{const _0xaeb43a=_0x1ad4e7,_0x2b2c65=gatewayController?.[_0xaeb43a(0x1da)+_0xaeb43a(0x131)]?.()||{};if(!_0x4994fe?.[_0xaeb43a(0xbe)]&&!_0x4994fe?.['id'])return _0x2b2c65[_0xaeb43a(0xcf)]||[];const _0x3052c1=String(_0x4994fe[_0xaeb43a(0xbe)]||_0x4994fe['id']||'');return(_0x2b2c65[_0xaeb43a(0xcf)]||[])['filter'](_0x4f590a=>_0x4f590a[_0xaeb43a(0xbe)]===_0x3052c1);})())})),_0x1a14b8(_0x1ad4e7(0x1b1)+'igate',async(_0x2d7a2c,_0x2f53f9)=>({'ok':!![],'payload':_0x2f53f9})),_0x1a14b8('tabs:pos'+_0x1ad4e7(0x15b)+'e',async(_0x4e0d9d,_0x531eff)=>{const _0xa27a6e=_0x1ad4e7;return broadcast(_0xa27a6e(0x8d)+_0xa27a6e(0x2ec),_0x531eff),{'ok':!![]};}),_0x1a14b8(_0x1ad4e7(0x159)+_0x1ad4e7(0x270)+'nt-state',async()=>{const _0x3a7b55=_0x1ad4e7;return broadcast('tabs-age'+_0x3a7b55(0x185)+_0x3a7b55(0x35f),{}),{'ok':!![]};}),_0x1a14b8(_0x1ad4e7(0x161)+_0x1ad4e7(0x10d)+'nt-state',async(_0x211345,_0x4e61c0={})=>{const _0x5d9323=_0x1ad4e7;return broadcast(_0x5d9323(0x27a)+_0x5d9323(0x185)+_0x5d9323(0x118)+_0x5d9323(0x35f),_0x4e61c0),{'ok':!![]};}),_0x1a14b8('window:m'+_0x1ad4e7(0x306),_0x561203=>{const _0x1dc765=_0x1ad4e7;return BrowserWindow[_0x1dc765(0x25f)+_0x1dc765(0xed)](_0x561203[_0x1dc765(0x1dd)])?.[_0x1dc765(0x301)](),{'ok':!![]};}),_0x1a14b8(_0x1ad4e7(0x97)+_0x1ad4e7(0x122)+_0x1ad4e7(0x32e),_0x251984=>{const _0x1afdc2=_0x1ad4e7,_0x4911e5=BrowserWindow[_0x1afdc2(0x25f)+_0x1afdc2(0xed)](_0x251984['sender']);if(!_0x4911e5)return{'isMaximized':![]};if(_0x4911e5[_0x1afdc2(0x2eb)+'zed']())_0x4911e5[_0x1afdc2(0x38e)+'ze']();else _0x4911e5[_0x1afdc2(0x194)]();return{'isMaximized':_0x4911e5[_0x1afdc2(0x2eb)+'zed']()};}),_0x1a14b8(_0x1ad4e7(0x16f)+_0x1ad4e7(0x384),_0x2ac8dc=>{const _0x39968d=_0x1ad4e7;return BrowserWindow['fromWebC'+'ontents'](_0x2ac8dc[_0x39968d(0x1dd)])?.[_0x39968d(0x8a)](),{'ok':!![]};}),_0x1a14b8('window:o'+_0x1ad4e7(0x14a)+'ools',()=>openDevToolsForActiveContext()),_0x1a14b8(_0x1ad4e7(0x240)+_0x1ad4e7(0x103)+_0x1ad4e7(0x274),()=>_0x1edaf4()['runtimeI'+_0x1ad4e7(0x131)]()),_0x1a14b8('openclaw'+_0x1ad4e7(0x2ca)+_0x1ad4e7(0x22e),async()=>(await ensureGatewayControllerStarted())[_0x1ad4e7(0x275)+'s']()),_0x1a14b8('openclaw'+':gateway'+_0x1ad4e7(0x299),()=>_0x1edaf4()['restart'](_0x1ad4e7(0x219)+_0x1ad4e7(0x288))),_0x1a14b8(_0x1ad4e7(0x240)+':loading'+_0x1ad4e7(0x15d)+_0x1ad4e7(0x302),async()=>({'loadingLifeCycle':_0x1ad4e7(0x2d5),'message':'','updatedAt':new Date()[_0x1ad4e7(0x94)+_0x1ad4e7(0x26f)]()})),_0x1a14b8(_0x1ad4e7(0x240)+_0x1ad4e7(0x2ca)+_0x1ad4e7(0x223),(_0x58e530,_0x5f1848={})=>_0x1edaf4()[_0x1ad4e7(0x20b)+_0x1ad4e7(0x211)](_0x5f1848?.[_0x1ad4e7(0x1d5)]??0xc8)),_0x1a14b8(_0x1ad4e7(0x240)+':answer-'+'ask-user'+_0x1ad4e7(0x134)+'n',(_0x12ceb9,_0x287497)=>_0x1edaf4()['answerAs'+_0x1ad4e7(0x2ab)+_0x1ad4e7(0x1b9)](_0x287497)),_0x1a14b8(_0x1ad4e7(0x240)+_0x1ad4e7(0xdb)+'i-window',async()=>{const _0xb2a025=_0x1ad4e7,_0x2f25cc=join(resolveRuntimeRoot(shellConfig[_0xb2a025(0x29e)+_0xb2a025(0x323)]),'bin',_0xb2a025(0x212)+'w');if(!existsSync(_0x2f25cc))throw new Error(_0xb2a025(0x240)+_0xb2a025(0x1c3)+'pper\x20not'+'\x20found:\x20'+_0x2f25cc+('.\x20Run\x20wu'+_0xb2a025(0x1cd)+_0xb2a025(0xf7)+'e\x20first.'));const _0x4ab5ba=join(app[_0xb2a025(0x235)](_0xb2a025(0x2d9)),'wujie-sh'+'ell-cli.'+_0xb2a025(0x2ed));await writeFile(_0x4ab5ba,_0xb2a025(0x1d1)+_0xb2a025(0x17d)+_0x2f25cc[_0xb2a025(0x30a)](/\\/g,'\x5c\x5c')[_0xb2a025(0x30a)](/"/g,'\x5c\x22')+'\x22\x0a',{'mode':0x1ed});const _0x3557f6=spawn('open',['-a','Terminal',_0x4ab5ba],{'detached':!![],'stdio':'ignore'});return _0x3557f6['unref'](),{'ok':!![],'cliPath':_0x2f25cc};}),_0x1a14b8('agents:l'+'ist',()=>_0x1edaf4()[_0x1ad4e7(0x2aa)][_0x1ad4e7(0x21c)]()),_0x1a14b8(_0x1ad4e7(0xe4)+_0x1ad4e7(0x262),(_0x4c2845,_0x1cc13f)=>_0x1edaf4()[_0x1ad4e7(0x26a)][_0x1ad4e7(0x1a0)](_0x1cc13f)),_0x1a14b8('sessions'+_0x1ad4e7(0x22d),(_0x1e97de,_0x2f66b8)=>_0x1edaf4()[_0x1ad4e7(0x1b8)][_0x1ad4e7(0x370)](_0x2f66b8)),_0x1a14b8('sessions'+_0x1ad4e7(0x330),(_0x1a0c30,_0x1bb0fe)=>_0x1edaf4()['sessions']['list'](_0x1bb0fe)),_0x1a14b8(_0x1ad4e7(0x1b8)+':delete',(_0x42482a,_0x3c285f)=>_0x1edaf4()[_0x1ad4e7(0x1b8)][_0x1ad4e7(0x230)](_0x3c285f)),_0x1a14b8(_0x1ad4e7(0x383)+_0x1ad4e7(0x2b2),(_0xc957f6,_0x25806b)=>_0x1edaf4()[_0x1ad4e7(0x1ae)]['stream'](_0x25806b)),_0x1a14b8(_0x1ad4e7(0x2e9)+'rt',(_0x3b3970,_0x1762d3)=>_0x1edaf4()[_0x1ad4e7(0x1ae)][_0x1ad4e7(0x2f1)](_0x1762d3)),_0x1a14b8(_0x1ad4e7(0x2f6)+_0x1ad4e7(0x260),(_0x1ce81d,_0x4be0a8)=>_0x1edaf4()[_0x1ad4e7(0x1ae)]['history'](_0x4be0a8)),_0x1a14b8(_0x1ad4e7(0x2cd)+'te',async(_0x544235,_0x3380d1={})=>{const _0x4586fd=_0x1ad4e7,_0x1544ff=typeof _0x3380d1[_0x4586fd(0x201)]==='string'?_0x3380d1['level']:_0x4586fd(0x9b),_0x2de134=typeof _0x3380d1['message']===_0x4586fd(0x313)?_0x3380d1[_0x4586fd(0x1cb)]:_0x4586fd(0x219)+_0x4586fd(0x16b),_0xf5e608=typeof _0x3380d1[_0x4586fd(0x2fb)]===_0x4586fd(0x313)&&_0x3380d1[_0x4586fd(0x2fb)][_0x4586fd(0x255)]()?_0x4586fd(0x219)+':'+_0x3380d1[_0x4586fd(0x2fb)][_0x4586fd(0x255)]():_0x4586fd(0x219),_0x23991e=_0x3380d1[_0x4586fd(0x30e)]&&typeof _0x3380d1[_0x4586fd(0x30e)]===_0x4586fd(0x307)?{...summarizePayload(_0x3380d1[_0x4586fd(0x30e)]),'context':_0xf5e608}:{'context':_0xf5e608},_0x4c5d70=rendererLogger;if(_0x4c5d70?.[_0x1544ff])await _0x4c5d70[_0x1544ff](_0x2de134,_0x23991e);else await _0x4c5d70?.[_0x4586fd(0x9b)](_0x2de134,_0x23991e);if(_0x3380d1[_0x4586fd(0x1dc)+'ic']===!![]||_0xf5e608===_0x4586fd(0x219)+_0x4586fd(0x326)+_0x4586fd(0x11b)){const _0x3ecf71=_0x3380d1['record']&&typeof _0x3380d1[_0x4586fd(0x2df)]===_0x4586fd(0x307)?_0x3380d1[_0x4586fd(0x2df)]:_0x3380d1['meta']?.[_0x4586fd(0x2df)]&&typeof _0x3380d1[_0x4586fd(0x30e)][_0x4586fd(0x2df)]===_0x4586fd(0x307)?_0x3380d1[_0x4586fd(0x30e)][_0x4586fd(0x2df)]:{'level':_0x1544ff,'category':_0x4586fd(0x219),'event':_0xf5e608,'message':_0x2de134,'meta':_0x3380d1[_0x4586fd(0x30e)]};await diagnosticsWriter?.[_0x4586fd(0x27e)+'nt'](_0x3ecf71,{'captureIncident':String(_0x3ecf71[_0x4586fd(0x201)]||_0x1544ff)['toLowerC'+_0x4586fd(0xfa)]()===_0x4586fd(0x1bf)||_0x3380d1['captureI'+_0x4586fd(0x352)]===!![]});}return{'ok':!![]};}),_0x1a14b8(_0x1ad4e7(0x325)+_0x1ad4e7(0xeb),async(_0x5b95ac,_0x49ad65={})=>{const _0x3f44d5=_0x1ad4e7,_0x33af5f=typeof _0x49ad65[_0x3f44d5(0x229)+'r']===_0x3f44d5(0x313)&&_0x49ad65[_0x3f44d5(0x229)+'r'][_0x3f44d5(0x255)]()?_0x49ad65[_0x3f44d5(0x229)+'r']:undefined,_0x565d00=await exportLogsArchive({'logsDir':configController['paths']['logsDir'],'targetDir':_0x33af5f,'appVersion':app[_0x3f44d5(0x334)+'on']()});return mainLogger?.[_0x3f44d5(0x9b)](_0x3f44d5(0x149)+_0x3f44d5(0xd5),{'path':toHomePath(_0x565d00[_0x3f44d5(0x19b)])}),_0x565d00;}),_0x1a14b8('logs:ope'+_0x1ad4e7(0x137)+'ory',async()=>{const _0x24c565=_0x1ad4e7;return await shell['openPath'](configController[_0x24c565(0x1fc)]['logsDir']),mainLogger?.['info'](_0x24c565(0x2d6)+_0x24c565(0x197)+_0x24c565(0x372),{'logsDir':toHomePath(configController['paths'][_0x24c565(0x340)])}),{'ok':!![],'path':configController[_0x24c565(0x1fc)][_0x24c565(0x340)]};}),_0x1a14b8('logs:lis'+'t',async()=>{const _0x2b5b84=_0x1ad4e7,_0x20b2f9=await readdir(configController[_0x2b5b84(0x1fc)]['logsDir'],{'recursive':!![]})['catch'](()=>[]);return _0x20b2f9;}),_0x1a14b8('logs:rea'+'d',async(_0x209eb1,_0x1b4cbd={})=>{const _0x1e2970=_0x1ad4e7,_0x2a5133=String(_0x1b4cbd[_0x1e2970(0x19b)]||'');if(!_0x2a5133)throw new Error(_0x1e2970(0x30d)+'required');return readFile(_0x2a5133,'utf8');}),_0x1a14b8(_0x1ad4e7(0x1f0)+'ad',async(_0x19950c,_0x30044a)=>{const _0x17c1f1=_0x1ad4e7,_0x209395=Date[_0x17c1f1(0x310)]();try{const _0x203fc9=await readFile(_0x30044a,_0x17c1f1(0x132));return filesLogger?.[_0x17c1f1(0x9b)](_0x17c1f1(0xbd)+_0x17c1f1(0x175)+_0x17c1f1(0x16d),{'path':toHomePath(_0x30044a),'bytes':Buffer[_0x17c1f1(0x25d)+'th'](_0x203fc9),'durationMs':Date[_0x17c1f1(0x310)]()-_0x209395}),_0x203fc9;}catch(_0x28603e){filesLogger?.[_0x17c1f1(0x1bf)](_0x17c1f1(0xbd)+'d\x20failed',{'path':toHomePath(_0x30044a),'durationMs':Date[_0x17c1f1(0x310)]()-_0x209395,'error':summarizeError(_0x28603e)});throw _0x28603e;}}),_0x1a14b8(_0x1ad4e7(0x1f0)+_0x1ad4e7(0x353)+'y',async(_0x346c75,_0x12c006)=>{const _0x2ecda8=_0x1ad4e7,_0x37fb71=Date[_0x2ecda8(0x310)]();try{const _0x4fd7c2=await readFile(_0x12c006);return filesLogger?.['info'](_0x2ecda8(0x358)+_0x2ecda8(0x17f)+_0x2ecda8(0x365)+'ed',{'path':toHomePath(_0x12c006),'bytes':_0x4fd7c2[_0x2ecda8(0x25d)+'th'],'durationMs':Date[_0x2ecda8(0x310)]()-_0x37fb71}),new Uint8Array(_0x4fd7c2);}catch(_0x380cc5){filesLogger?.[_0x2ecda8(0x1bf)](_0x2ecda8(0x358)+_0x2ecda8(0x17f)+'\x20failed',{'path':toHomePath(_0x12c006),'durationMs':Date[_0x2ecda8(0x310)]()-_0x37fb71,'error':summarizeError(_0x380cc5)});throw _0x380cc5;}}),_0x1a14b8(_0x1ad4e7(0x2ba)+_0x1ad4e7(0x107),async(_0x7068b7,_0x25775e={})=>{const _0x1bd38d=_0x1ad4e7,_0x599220=Date[_0x1bd38d(0x310)]();return await writeFile(_0x25775e[_0x1bd38d(0x19b)],_0x25775e[_0x1bd38d(0x1d8)]??'',_0x1bd38d(0x132)),filesLogger?.['info'](_0x1bd38d(0x300)+'te\x20compl'+'eted',{'path':toHomePath(_0x25775e[_0x1bd38d(0x19b)]),'bytes':Buffer[_0x1bd38d(0x25d)+'th'](String(_0x25775e[_0x1bd38d(0x1d8)]??'')),'durationMs':Date['now']()-_0x599220}),{'ok':!![]};}),_0x1a14b8(_0x1ad4e7(0x2ba)+'ite-bina'+'ry',async(_0x42ca1f,_0x282fdf={})=>{const _0x2abdd9=_0x1ad4e7,_0x2c9b3d=Date['now']();await writeFile(_0x282fdf['path'],Buffer[_0x2abdd9(0xde)](_0x282fdf[_0x2abdd9(0x1d8)]??[]));const _0x140f70=await stat(_0x282fdf[_0x2abdd9(0x19b)])[_0x2abdd9(0x336)](()=>null);return filesLogger?.[_0x2abdd9(0x9b)](_0x2abdd9(0x358)+_0x2abdd9(0x135)+_0x2abdd9(0x377)+'ted',{'path':toHomePath(_0x282fdf[_0x2abdd9(0x19b)]),'bytes':_0x140f70?.[_0x2abdd9(0x1d9)]??0x0,'durationMs':Date[_0x2abdd9(0x310)]()-_0x2c9b3d}),{'ok':!![]};}),_0x1a14b8(_0x1ad4e7(0x386)+_0x1ad4e7(0x158)+'e',async(_0x479458,_0x1982d6={})=>{const _0x119808=_0x1ad4e7,_0x525370=await dialog['showOpen'+_0x119808(0xb5)](BrowserWindow[_0x119808(0x25f)+_0x119808(0xed)](_0x479458[_0x119808(0x1dd)])??mainWindow,{'title':typeof _0x1982d6[_0x119808(0x391)]===_0x119808(0x313)?_0x1982d6['title']:undefined,'properties':[_0x119808(0x291),..._0x1982d6[_0x119808(0x303)+_0x119808(0x1f5)]?['multiSel'+_0x119808(0x1f5)]:[]],'filters':Array[_0x119808(0x1e8)](_0x1982d6[_0x119808(0x33a)])?_0x1982d6[_0x119808(0x33a)]:undefined});return filesLogger?.[_0x119808(0x9b)](_0x119808(0x82)+_0x119808(0xcd)+_0x119808(0x20e),{'canceled':_0x525370[_0x119808(0xf3)],'count':_0x525370[_0x119808(0x2dc)+'s'][_0x119808(0x294)],'paths':_0x525370['filePath'+'s'][_0x119808(0x1c6)](toHomePath)}),{'canceled':_0x525370[_0x119808(0xf3)],'paths':_0x525370[_0x119808(0x2dc)+'s']};}),_0x1a14b8(_0x1ad4e7(0x15c)+_0x1ad4e7(0x338)+_0x1ad4e7(0x260),async(_0x47c3f6,_0x5230a2={})=>{const _0x2f68cc=_0x1ad4e7,_0x1ee78b=resolve(String(_0x5230a2['path']||'')),_0x2eca73=_0x5230a2[_0x2f68cc(0x271)+'e']!==![],_0x315f66=Array[_0x2f68cc(0x1e8)](_0x5230a2['extensio'+'ns'])?_0x5230a2[_0x2f68cc(0x1f3)+'ns'][_0x2f68cc(0x1c6)](_0xc1d04b=>String(_0xc1d04b)['toLowerC'+_0x2f68cc(0xfa)]()[_0x2f68cc(0x30a)](/^\./,''))[_0x2f68cc(0x24a)](Boolean):null,_0x2f54ba=Number[_0x2f68cc(0x7f)+'r'](_0x5230a2[_0x2f68cc(0x30b)+'es'])&&_0x5230a2[_0x2f68cc(0x30b)+'es']>0x0?_0x5230a2[_0x2f68cc(0x30b)+'es']:0xc350,_0x4385d5=[];let _0xdd0b41=![];async function _0x412eab(_0x527e69){const _0x3212ab=_0x2f68cc;if(_0xdd0b41)return;let _0x2c7a30;try{_0x2c7a30=await readdir(_0x527e69,{'withFileTypes':!![]});}catch{return;}for(const _0xc130bc of _0x2c7a30){if(_0xdd0b41)return;if(_0xc130bc[_0x3212ab(0x95)][_0x3212ab(0x130)+'th']('.'))continue;const _0x58f389=join(_0x527e69,_0xc130bc[_0x3212ab(0x95)]);if(_0xc130bc['isDirect'+_0x3212ab(0x25e)]()){if(_0x2eca73)await _0x412eab(_0x58f389);continue;}if(!_0xc130bc[_0x3212ab(0x295)]())continue;if(_0x315f66){const _0x1dba9b=_0xc130bc[_0x3212ab(0x95)][_0x3212ab(0x150)+_0x3212ab(0x380)]('.'),_0x292ecd=_0x1dba9b>=0x0?_0xc130bc[_0x3212ab(0x95)][_0x3212ab(0x1df)](_0x1dba9b+0x1)[_0x3212ab(0x389)+_0x3212ab(0xfa)]():'';if(!_0x315f66['includes'](_0x292ecd))continue;}if(_0x4385d5[_0x3212ab(0x294)]>=_0x2f54ba){_0xdd0b41=!![];return;}_0x4385d5['push']({'name':_0xc130bc[_0x3212ab(0x95)],'path':_0x58f389});}}return await _0x412eab(_0x1ee78b),{'path':_0x1ee78b,'entries':_0x4385d5,'truncated':_0xdd0b41};}),_0x1a14b8(_0x1ad4e7(0x386)+_0x1ad4e7(0x17e)+_0x1ad4e7(0x2a7),async(_0xdcf5d4,_0x53ec25={})=>{const _0x259ded=_0x1ad4e7,_0x2bccfd=await dialog[_0x259ded(0x369)+_0x259ded(0xb5)](BrowserWindow[_0x259ded(0x25f)+_0x259ded(0xed)](_0xdcf5d4[_0x259ded(0x1dd)])??mainWindow,{'title':typeof _0x53ec25['title']===_0x259ded(0x313)?_0x53ec25['title']:undefined,'properties':[_0x259ded(0x2d8)+_0x259ded(0x124)]});return filesLogger?.[_0x259ded(0x9b)](_0x259ded(0x36a)+_0x259ded(0x28b)+_0x259ded(0x365)+'ed',{'canceled':_0x2bccfd[_0x259ded(0xf3)],'count':_0x2bccfd[_0x259ded(0x2dc)+'s'][_0x259ded(0x294)],'paths':_0x2bccfd[_0x259ded(0x2dc)+'s'][_0x259ded(0x1c6)](toHomePath)}),{'canceled':_0x2bccfd['canceled'],'paths':_0x2bccfd['filePath'+'s']};}),_0x1a14b8(_0x1ad4e7(0x1e4)+_0x1ad4e7(0x177)+'ory-info',()=>_0x1edaf4()[_0x1ad4e7(0x1e4)+'e'][_0x1ad4e7(0x252)+_0x1ad4e7(0xc7)]()),_0x1a14b8(_0x1ad4e7(0x1e4)+_0x1ad4e7(0x1c0)+_0x1ad4e7(0x28b),async()=>{const _0x40e62d=_0x1ad4e7,_0x542977=await _0x1edaf4()[_0x40e62d(0x1e4)+'e'][_0x40e62d(0x252)+'yInfo']();return await shell[_0x40e62d(0x111)](_0x542977[_0x40e62d(0x19b)]),filesLogger?.[_0x40e62d(0x9b)](_0x40e62d(0x1e4)+_0x40e62d(0x22a)+_0x40e62d(0x228)+'ed',{'path':toHomePath(_0x542977[_0x40e62d(0x19b)])}),{'ok':!![],'path':_0x542977[_0x40e62d(0x19b)]};}),_0x1a14b8(_0x1ad4e7(0x1e4)+_0x1ad4e7(0x287)+_0x1ad4e7(0x247),()=>_0x1edaf4()[_0x1ad4e7(0x1e4)+'e'][_0x1ad4e7(0x293)+_0x1ad4e7(0x32a)]()),_0x1a14b8('workspac'+_0x1ad4e7(0x110)+_0x1ad4e7(0x2fa)+'ontext',(_0x2fe2d8,_0x53aec5)=>_0x1edaf4()[_0x1ad4e7(0x1e4)+'e']['writeSha'+'redConte'+'xt'](_0x53aec5)),_0x1a14b8(_0x1ad4e7(0x1b8)+_0x1ad4e7(0x328),(_0x5e6c14,_0x4021f6)=>_0x1edaf4()[_0x1ad4e7(0x1b8)][_0x1ad4e7(0x141)](_0x4021f6)),_0x1a14b8(_0x1ad4e7(0x1b8)+_0x1ad4e7(0x279),async(_0x5ac7ed,_0x1ee58c={})=>{const _0x402685=_0x1ad4e7,_0x52fe95=String(_0x1ee58c[_0x402685(0x254)+'ey']||_0x1ee58c['key']||'')['trim']();if(!_0x52fe95)throw new Error(_0x402685(0x254)+_0x402685(0x38c)+'quired');const _0x403aaf=await ensureSessionSqliteStore()[_0x402685(0x311)+'dSession'+_0x402685(0x34a)](),_0x49dd59=await _0x1edaf4()[_0x402685(0x1b8)][_0x402685(0x32d)+_0x402685(0xc1)]([_0x52fe95,..._0x403aaf[_0x402685(0x24a)](_0x495e45=>_0x495e45!==_0x52fe95)]);return _0x49dd59;}),_0x1a14b8(_0x1ad4e7(0x1b8)+_0x1ad4e7(0x2b3),async(_0x5a51d4,_0x5c3380={})=>{const _0x1ede26=_0x1ad4e7,_0xed400d=String(_0x5c3380[_0x1ede26(0x254)+'ey']||_0x5c3380['key']||'')[_0x1ede26(0x255)]();if(!_0xed400d)throw new Error(_0x1ede26(0x254)+_0x1ede26(0x38c)+_0x1ede26(0x250));const _0x2d21fc=await ensureSessionSqliteStore()[_0x1ede26(0x311)+_0x1ede26(0x193)+_0x1ede26(0x34a)]();return await _0x1edaf4()[_0x1ede26(0x1b8)]['reorderP'+_0x1ede26(0xc1)](_0x2d21fc[_0x1ede26(0x24a)](_0x1d3229=>_0x1d3229!==_0xed400d));}),_0x1a14b8(_0x1ad4e7(0x1b8)+':reorder'+_0x1ad4e7(0x345),async(_0x223b00,_0x3aa1ba={})=>{const _0x5782f9=_0x1ad4e7,_0x4a9e26=Array[_0x5782f9(0x1e8)](_0x3aa1ba['keys'])?_0x3aa1ba[_0x5782f9(0x9a)]:_0x3aa1ba;return await _0x1edaf4()[_0x5782f9(0x1b8)]['reorderP'+_0x5782f9(0xc1)](_0x4a9e26);}),_0x1a14b8(_0x1ad4e7(0x200)+_0x1ad4e7(0xe6),(_0x48a8e5,_0x25962d)=>_0x1edaf4()[_0x1ad4e7(0x26a)]['install'](_0x25962d)),_0x1a14b8(_0x1ad4e7(0xc8)+'t',(_0x453bf5,_0x25fd41)=>_0x1edaf4()[_0x1ad4e7(0x37e)][_0x1ad4e7(0x21c)](_0x25fd41)),_0x1a14b8(_0x1ad4e7(0x225)+_0x1ad4e7(0x350),(_0x53d3f2,_0x479e8)=>_0x1edaf4()[_0x1ad4e7(0x37e)][_0x1ad4e7(0x370)](_0x479e8)),_0x1a14b8('cron:upd'+_0x1ad4e7(0x350),(_0x51bd52,_0x1d9fef)=>_0x1edaf4()[_0x1ad4e7(0x37e)][_0x1ad4e7(0x2ee)](_0x1d9fef)),_0x1a14b8('cron:rem'+_0x1ad4e7(0x188),(_0x3b6a3d,_0x1392e3)=>_0x1edaf4()[_0x1ad4e7(0x37e)][_0x1ad4e7(0x9d)](_0x1392e3)),_0x1a14b8(_0x1ad4e7(0x36e)+_0x1ad4e7(0x1ca),(_0x53715f,_0x220289)=>_0x1edaf4()[_0x1ad4e7(0x37e)][_0x1ad4e7(0x26c)](_0x220289)),_0x1a14b8('cron:log'+'s',(_0x2b6a25,_0x48d768)=>_0x1edaf4()['cron'][_0x1ad4e7(0x360)](_0x48d768)),_0x1a14b8('models:c'+_0x1ad4e7(0x14e),async(_0x58be0e,_0x1c823d={})=>{const _0x6df3d6=_0x1ad4e7,_0x5cfbac=configController['resolveC'+'onfigPat'+'h'](),_0x3b048d=JSON[_0x6df3d6(0x36f)](await readFile(_0x5cfbac,_0x6df3d6(0x132))),_0x4e1dcc=_0x3b048d?.[_0x6df3d6(0x222)]?.[_0x6df3d6(0x1fb)+'s']&&typeof _0x3b048d[_0x6df3d6(0x222)]['provider'+'s']==='object'?_0x3b048d[_0x6df3d6(0x222)][_0x6df3d6(0x1fb)+'s']:{},_0x51f816=typeof _0x3b048d?.[_0x6df3d6(0x2aa)]?.['defaults']?.[_0x6df3d6(0x37a)]?.[_0x6df3d6(0x1ef)]==='string'?_0x3b048d[_0x6df3d6(0x2aa)][_0x6df3d6(0x11a)][_0x6df3d6(0x37a)][_0x6df3d6(0x1ef)]:'',_0x2ff807=String(_0x1c823d[_0x6df3d6(0x37a)]||_0x51f816||'');if(!_0x2ff807[_0x6df3d6(0x87)]('/'))throw new Error(_0x6df3d6(0x362)+'lt\x20model'+_0x6df3d6(0x34b)+_0x6df3d6(0xb4)+_0x6df3d6(0x1e2)+_0x6df3d6(0x2f5)+_0x6df3d6(0x264));const _0x4e22c6=_0x2ff807[_0x6df3d6(0x1af)]('/'),_0xad68ac=_0x2ff807['slice'](0x0,_0x4e22c6),_0x3c0176=_0x2ff807[_0x6df3d6(0x1df)](_0x4e22c6+0x1),_0x1d3e54=_0x4e1dcc[_0xad68ac];if(!_0x1d3e54||typeof _0x1d3e54!==_0x6df3d6(0x307))throw new Error('provider'+_0x6df3d6(0x202)+_0x6df3d6(0x1b0)+'\x20'+_0xad68ac);const _0x5303c8=String(_0x1d3e54[_0x6df3d6(0x284)]||_0x6df3d6(0x16e)+_0x6df3d6(0x2f2)+_0x6df3d6(0x2a4)+'1')[_0x6df3d6(0x255)]()[_0x6df3d6(0x30a)](/\/$/,''),_0x2f134b=await fetch(_0x5303c8+(_0x6df3d6(0x11e)+_0x6df3d6(0x19a)+'s'),{'method':_0x6df3d6(0x209),'headers':{'content-type':_0x6df3d6(0x126)+_0x6df3d6(0x91),'Authorization':_0x6df3d6(0x196)+(_0x1d3e54[_0x6df3d6(0x1c1)]||''),..._0x1d3e54[_0x6df3d6(0x217)]&&typeof _0x1d3e54[_0x6df3d6(0x217)]===_0x6df3d6(0x307)?_0x1d3e54[_0x6df3d6(0x217)]:{}},'body':JSON[_0x6df3d6(0xb6)+'y']({'model':_0x3c0176,'max_tokens':Number[_0x6df3d6(0x7f)+'r'](_0x1c823d[_0x6df3d6(0x33e)+'s'])?_0x1c823d['maxToken'+'s']:0x400,'temperature':typeof _0x1c823d[_0x6df3d6(0xdc)+'ure']===_0x6df3d6(0x1a6)?_0x1c823d[_0x6df3d6(0xdc)+_0x6df3d6(0x2a5)]:undefined,'messages':Array['isArray'](_0x1c823d[_0x6df3d6(0x205)])?_0x1c823d[_0x6df3d6(0x205)]:[]}),'signal':AbortSignal[_0x6df3d6(0x2cf)](Number[_0x6df3d6(0x7f)+'r'](_0x1c823d['timeoutM'+'s'])?_0x1c823d[_0x6df3d6(0x2a9)+'s']:0x1d4c0)});if(!_0x2f134b['ok']){const _0x321e90=await _0x2f134b[_0x6df3d6(0x2c5)]();throw new Error(_0x6df3d6(0x296)+'tp\x20'+_0x2f134b['status']+':\x20'+_0x321e90[_0x6df3d6(0x1df)](0x0,0x190));}const _0x820605=await _0x2f134b['json'](),_0x572507=_0x820605?.[_0x6df3d6(0x146)]?.[0x0]?.[_0x6df3d6(0x1cb)]??{};return{'content':extractModelMessageContent(_0x572507[_0x6df3d6(0x1d8)]),'reasoning':typeof _0x572507['reasonin'+'g_conten'+'t']===_0x6df3d6(0x313)?_0x572507['reasonin'+_0x6df3d6(0x363)+'t']:'','model':_0x820605?.[_0x6df3d6(0x37a)]||_0x3c0176};}),_0x1a14b8('models:s'+_0x1ad4e7(0x1db),()=>_0x1edaf4()[_0x1ad4e7(0x222)][_0x1ad4e7(0x183)]()),_0x1a14b8(_0x1ad4e7(0x2e2)+'et-setti'+_0x1ad4e7(0x1d2),(_0x2c14c8,_0x50e250)=>_0x1edaf4()['models'][_0x1ad4e7(0x208)+_0x1ad4e7(0x1d2)](_0x50e250)),_0x1a14b8('models:s'+_0x1ad4e7(0xce)+_0x1ad4e7(0x1c5)+_0x1ad4e7(0x2f9),(_0x2bc26b,_0x52e3a7)=>_0x1edaf4()[_0x1ad4e7(0x222)]['setSelec'+'tedModel'+_0x1ad4e7(0x2dd)+'re'](_0x52e3a7)),_0x1a14b8(_0x1ad4e7(0x2e2)+_0x1ad4e7(0x35b)+'operated',(_0x49e13c,_0x55f076)=>_0x1edaf4()[_0x1ad4e7(0x222)]['setSelfO'+_0x1ad4e7(0x227)+'odels'](_0x55f076)),_0x1a14b8(_0x1ad4e7(0x2e2)+_0x1ad4e7(0x1ac)+_0x1ad4e7(0xab),()=>_0x1edaf4()[_0x1ad4e7(0x222)][_0x1ad4e7(0x2bf)+_0x1ad4e7(0x20a)]()),_0x1a14b8(_0x1ad4e7(0xad)+_0x1ad4e7(0x113)+'dels',()=>_0x1edaf4()[_0x1ad4e7(0x222)]['customMo'+_0x1ad4e7(0x315)]()),_0x1a14b8(_0x1ad4e7(0x2f0)+'sync-bun'+_0x1ad4e7(0x27d)+_0x1ad4e7(0x93),async()=>{const _0x486509=_0x1ad4e7,_0x4c83c6=await prepareRuntime(shellConfig,{'syncOnly':!![]});return await configController[_0x486509(0x120)+_0x486509(0xfe)+'ns'](),{'ok':!![],'syncedAt':new Date()[_0x486509(0x94)+_0x486509(0x26f)](),'manifest':_0x4c83c6,'status':await getRuntimeResourceStatus()};}),_0x1a14b8('runtime:'+_0x1ad4e7(0x31f)+'-status',async()=>getRuntimeResourceStatus());}async function boot(){const _0x5e0f6c=_0x320a6b;shellConfig=await loadShellConfig(resolveProjectRoot()),app[_0x5e0f6c(0x367)](shellConfig[_0x5e0f6c(0xd4)+'ame']),configController=createConfigController(shellConfig),mainLogger=createShellLogger(configController[_0x5e0f6c(0x1fc)],_0x5e0f6c(0x195)),ipcLogger=createShellLogger(configController['paths'],_0x5e0f6c(0x1a4)),filesLogger=createShellLogger(configController[_0x5e0f6c(0x1fc)],_0x5e0f6c(0x1f9)),rendererLogger=createShellLogger(configController['paths'],'renderer'),productRuntime=await loadProductRuntime();const _0x4f05d5=resolveWujieApiEndpoint();diagnosticsWriter=createDiagnosticsWriter({'logsDir':configController[_0x5e0f6c(0x1fc)][_0x5e0f6c(0x340)],'appContext':{'productName':shellConfig[_0x5e0f6c(0xd4)+_0x5e0f6c(0xa9)],'appId':shellConfig['appId'],'appVersion':app[_0x5e0f6c(0x334)+'on'](),'platform':process['platform'],'arch':process['arch'],..._0x4f05d5?{'apiEndpoint':_0x4f05d5}:{}}}),userEventWriter=createUserEventWriter({'logsDir':configController[_0x5e0f6c(0x1fc)]['logsDir'],'diagnosticsWriter':diagnosticsWriter});const _0x52307a=await loadCreateUpdateController({'logger':mainLogger});updateController=_0x52307a({'shellConfig':shellConfig,'appName':()=>app[_0x5e0f6c(0x95)],'appVersion':()=>app[_0x5e0f6c(0x334)+'on'](),'broadcast':broadcast,'logger':mainLogger}),updateController[_0x5e0f6c(0x1a2)+'ze'](),registerProcessLogHooks(),mainLogger?.[_0x5e0f6c(0x9b)](_0x5e0f6c(0x286)+_0x5e0f6c(0xa6)+_0x5e0f6c(0x23e)+'ed',{'appVersion':app[_0x5e0f6c(0x334)+'on'](),'electronVersion':process['versions'][_0x5e0f6c(0x286)],'nodeVersion':process[_0x5e0f6c(0x17b)][_0x5e0f6c(0x342)],'chromeVersion':process['versions']['chrome'],'platform':process['platform'],'arch':process['arch'],'mode':getMode(),'projectRoot':shellConfig['projectR'+'oot'],'configPath':shellConfig[_0x5e0f6c(0x1ec)+'th'],'dataDir':shellConfig[_0x5e0f6c(0x1fe)],'logsDir':configController[_0x5e0f6c(0x1fc)][_0x5e0f6c(0x340)],'rendererUrl':process.env.VITE_DEV_SERVER_URL||join(shellConfig[_0x5e0f6c(0x29e)+_0x5e0f6c(0x323)],'dist',_0x5e0f6c(0x267)+'ml')}),gatewayController=createGatewayController({'shellConfig':shellConfig,'configController':configController,'appVersion':app[_0x5e0f6c(0x334)+'on'](),'productRuntimeHooks':productRuntimeHooks,'userEventWriter':userEventWriter,'sessionSqliteStore':ensureSessionSqliteStore()}),typeof productRuntime[_0x5e0f6c(0x1cf)+_0x5e0f6c(0x285)+'nfig']===_0x5e0f6c(0x186)&&await productRuntime[_0x5e0f6c(0x1cf)+_0x5e0f6c(0x285)+_0x5e0f6c(0x1d0)]({'configController':configController,'mainLogger':mainLogger}),typeof productRuntime[_0x5e0f6c(0x1cf)+_0x5e0f6c(0x213)+'ta']===_0x5e0f6c(0x186)?await productRuntime[_0x5e0f6c(0x1cf)+_0x5e0f6c(0x213)+'ta']({'configController':configController,'generatedFilesStore':ensureGeneratedFilesStore(),'mainLogger':mainLogger,'sessionSqliteStore':ensureSessionSqliteStore()}):await ensureGeneratedFilesStore()['ensureIn'+_0x5e0f6c(0x112)+'d'](),attachGatewayBroadcastHandlers(gatewayController),await installIpcHandlers(),installClawspaceProtocolHandler(),registerShellShortcuts(),await createWindow(),await gatewayController[_0x5e0f6c(0x14d)](),updateController[_0x5e0f6c(0x180)+_0x5e0f6c(0x1f4)+_0x5e0f6c(0xff)](),mainLogger?.[_0x5e0f6c(0x9b)](_0x5e0f6c(0x286)+_0x5e0f6c(0xa6)+_0x5e0f6c(0x13e)+_0x5e0f6c(0x2da));}function registerProcessLogHooks(){const _0x227fda=_0x320a6b;if(registerProcessLogHooks[_0x227fda(0x388)+'ed'])return;registerProcessLogHooks[_0x227fda(0x388)+'ed']=!![],process['on'](_0x227fda(0x28e)+'Exceptio'+'n',_0x28217a=>{const _0x302843=_0x227fda;mainLogger?.['error'](_0x302843(0x28e)+'\x20excepti'+'on',summarizeError(_0x28217a));}),process['on']('unhandle'+_0x227fda(0x2e1)+'on',_0x19992b=>{const _0x4fd2e2=_0x227fda;mainLogger?.[_0x4fd2e2(0x1bf)](_0x4fd2e2(0x243)+'d\x20reject'+_0x4fd2e2(0x142),summarizeError(_0x19992b));}),app['on'](_0x227fda(0x282)+_0x227fda(0x2db)+'one',(_0x33d700,_0x176c6f,_0x27703f)=>{const _0xd90a0f=_0x227fda;mainLogger?.[_0xd90a0f(0x1bf)](_0xd90a0f(0x219)+_0xd90a0f(0x25a)+'\x20gone',{'url':_0x176c6f[_0xd90a0f(0x1cc)](),'details':_0x27703f});}),app['on'](_0x227fda(0xaa)+_0x227fda(0xd7)+'ne',(_0x2973d5,_0x1f771c)=>{const _0x46e138=_0x227fda;mainLogger?.[_0x46e138(0x1bf)](_0x46e138(0x21d)+_0x46e138(0x277)+'ne',{'details':_0x1f771c});});}app['on']('window-a'+_0x320a6b(0x1c9)+'d',()=>{const _0x1b6de8=_0x320a6b;if(process[_0x1b6de8(0x31d)]!=='darwin')app['quit']();}),app['on'](_0x320a6b(0x210),async()=>{const _0x2d9fdf=_0x320a6b;if(isQuitting){app['quit']();return;}updateController?.[_0x2d9fdf(0x2ad)+_0x2d9fdf(0x100)+_0x2d9fdf(0x164)](_0x2d9fdf(0xc4)+'vate'),BrowserWindow['getAllWi'+_0x2d9fdf(0x104)]()[_0x2d9fdf(0x294)]===0x0&&shellConfig&&await createWindow();}),app['on'](_0x320a6b(0x35c)+_0x320a6b(0x38d),_0x365877=>{const _0x22f490=_0x320a6b;isQuitting=!![],updateController?.[_0x22f490(0xc2)+_0x22f490(0xf8)](),terminalManager?.[_0x22f490(0x1c2)](),terminalManager=null,productRuntimeHooks?.[_0x22f490(0x1c2)]?.();for(const _0x36e6af of Object['keys'](productRuntimeHooks))delete productRuntimeHooks[_0x36e6af];if(!gatewayController)return;mainLogger?.['info'](_0x22f490(0x2af)+_0x22f490(0x259)+_0x22f490(0x368)+_0x22f490(0x31e)),_0x365877[_0x22f490(0x10e)+_0x22f490(0x35a)](),void gatewayController[_0x22f490(0x18c)]()[_0x22f490(0x263)](()=>{const _0x54f6c1=_0x22f490;gatewayController=null,mainLogger?.['info'](_0x54f6c1(0x224)+_0x54f6c1(0x29d)+_0x54f6c1(0x2af)+_0x54f6c1(0x38d)),app['quit']();});}),app['on']('will-qui'+'t',()=>{const _0x25804a=_0x320a6b;globalShortcut[_0x25804a(0x220)+'er'](DEVTOOLS_ACCELERATOR);}),app[_0x320a6b(0x29f)+'y']()[_0x320a6b(0x83)](boot)['catch'](_0xe6ec4a=>{const _0x18dfe0=_0x320a6b;bootError=_0xe6ec4a instanceof Error?_0xe6ec4a[_0x18dfe0(0x1cb)]:String(_0xe6ec4a),mainLogger?.[_0x18dfe0(0x1bf)]('electron'+_0x18dfe0(0xa6)+_0x18dfe0(0x1e0)+'d',summarizeError(_0xe6ec4a)),console[_0x18dfe0(0x1bf)](_0x18dfe0(0x7e)+_0x18dfe0(0x157)+_0x18dfe0(0x27f)+_0x18dfe0(0x98)+_0x18dfe0(0x2a3)+'in',_0xe6ec4a);});
|